Skip to main content

Class: PendingTransaction

Represents a pending blockchain transaction.

Usage: Call wait() immediately after receiving the PendingTransaction to ensure proper event handling:

const pendingTx = await gSwap.swap(...);
const result = await pendingTx.wait(); // Call immediately - if you delay then the event may be missed

Properties​

error​

readonly error: boolean;

message​

readonly message: string;

transactionId​

readonly transactionId: string;

Methods​

wait()​

wait(): Promise<{
Data: Record<string, unknown>;
transactionHash: string;
txId: string;
}>;

Waits for the transaction to be confirmed. This should be called immediately after receiving the PendingTransaction to ensure proper event handling. If you delay calling this method and the transaction confirms before you call this method, an error will be thrown.

Returns​

Promise<{ Data: Record<string, unknown>; transactionHash: string; txId: string; }>

A promise that resolves when the transaction is confirmed.