feat: add error handling

This commit is contained in:
Filip Dunder
2024-04-21 13:43:46 +02:00
parent 5d9ffcbc43
commit d0b59102c9
3 changed files with 4 additions and 2 deletions

View File

@ -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 }>;
}

View File

@ -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())],