waitForReceipt

Waits for the transaction receipt of a given transaction hash on a specific contract.

Example

import { waitForReceipt } from "thirdweb";
const receipt = await waitForReceipt({
client,
chain,
transactionHash: "0x123...",
});
function waitForReceipt(options: {
chain: Readonly<ChainOptions & { rpc: string }>;
client: ThirdwebClient;
maxBlocksWaitTime?: number;
readonly transactionHash: `0x${string}`;
}): Promise<TransactionReceipt>;

Parameters

The options for waiting for the receipt. By default, it's 100 blocks.

Type

let options: {
chain: Readonly<ChainOptions & { rpc: string }>;
client: ThirdwebClient;
maxBlocksWaitTime?: number;
readonly transactionHash: `0x${string}`;
};

Returns

let returnType: {
blobGasPrice?: quantity;
blobGasUsed?: quantity;
blockHash: Hash;
blockNumber: quantity;
contractAddress: Address | null | undefined;
cumulativeGasUsed: quantity;
effectiveGasPrice: quantity;
from: Address;
gasUsed: quantity;
logs: Array<Log<quantity, index, false>>;
logsBloom: Hex;
root?: Hash;
status: status;
to: Address | null;
transactionHash: Hash;
transactionIndex: index;
type: type;
};

A promise that resolves with the transaction receipt.