Skip to content

Commit 132b08b

Browse files
authored
Merge pull request #8 from alexandr-kazakov/main
feat: pool Info check added
2 parents dfc55a9 + 8f86e17 commit 132b08b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ const swap = async () => {
2525
* Find pool information for the given token pair.
2626
*/
2727
const poolInfo = raydiumSwap.findPoolInfoForTokens(swapConfig.tokenAAddress, swapConfig.tokenBAddress);
28-
console.log('Found pool info');
28+
if (!poolInfo) {
29+
console.error('Pool info not found');
30+
return 'Pool info not found';
31+
} else {
32+
console.log('Found pool info');
33+
}
2934

3035
/**
3136
* Prepare the swap transaction with the given parameters.

0 commit comments

Comments
 (0)