@drift-labs/sdk-browser
Version:
SDK for Drift Protocol
21 lines (20 loc) • 1.47 kB
TypeScript
import { Commitment, Connection, SendTransactionError, VersionedTransactionResponse } from '@solana/web3.js';
/**
* THROWS if there is an error
*
* Should only be used for a txSig that is confirmed has an error. There is a race-condition where sometimes the transaction is not instantly available to fetch after the confirmation has already failed with an error, so this method has retry logic which we don't want to do wastefully. This method will throw a generic error if it can't get the transaction result after a retry period.
* @param txSig
* @param connection
* @returns
*/
export declare const throwTransactionError: (txSig: string, connection: Connection, commitment?: Commitment) => Promise<void>;
/**
* RETURNS an error if there is one
*
* Should only be used for a txSig that is confirmed has an error. There is a race-condition where sometimes the transaction is not instantly available to fetch after the confirmation has already failed with an error, so this method has retry logic which we don't want to do wastefully. This method will throw a generic error if it can't get the transaction result after a retry period.
* @param txSig
* @param connection
* @returns
*/
export declare const getTransactionErrorFromTxSig: (txSig: string, connection: Connection, commitment?: Commitment) => Promise<SendTransactionError>;
export declare const getTransactionError: (transactionResult: VersionedTransactionResponse) => SendTransactionError;