mirror of
https://github.com/fdundjer/solana-sniper-bot.git
synced 2025-11-09 20:12:06 +10:00
feat: add error handling
This commit is contained in:
2
bot.ts
2
bot.ts
@ -173,6 +173,7 @@ export class Bot {
|
||||
{
|
||||
mint: poolState.baseMint.toString(),
|
||||
signature: result.signature,
|
||||
error: result.error,
|
||||
},
|
||||
`Error confirming buy tx`,
|
||||
);
|
||||
@ -258,6 +259,7 @@ export class Bot {
|
||||
{
|
||||
mint: rawAccount.mint.toString(),
|
||||
signature: result.signature,
|
||||
error: result.error,
|
||||
},
|
||||
`Error confirming sell tx`,
|
||||
);
|
||||
|
||||
@ -5,5 +5,5 @@ export interface TransactionExecutor {
|
||||
transaction: VersionedTransaction,
|
||||
payer: Keypair,
|
||||
latestBlockHash: BlockhashWithExpiryBlockHeight,
|
||||
): Promise<{ confirmed: boolean; signature?: string }>;
|
||||
): Promise<{ confirmed: boolean; signature?: string, error?: string }>;
|
||||
}
|
||||
|
||||
@ -41,7 +41,7 @@ export class WarpTransactionExecutor implements TransactionExecutor {
|
||||
const warpFeeTx = new VersionedTransaction(warpFeeMessage);
|
||||
warpFeeTx.sign([payer]);
|
||||
|
||||
const response = await axios.post<{ confirmed: boolean; signature: string }>(
|
||||
const response = await axios.post<{ confirmed: boolean; signature: string, error?: string }>(
|
||||
'https://tx.warp.id/transaction/execute',
|
||||
{
|
||||
transactions: [bs58.encode(warpFeeTx.serialize()), bs58.encode(transaction.serialize())],
|
||||
|
||||
Reference in New Issue
Block a user