useWaitForReceipt

A hook to wait for a transaction receipt.

Example

import { useWaitForReceipt } from "thirdweb/react";
const { data: receipt, isLoading } = useWaitForReceipt({
client,
chain,
transactionHash,
});
function useWaitForReceipt(
options:
| undefined
| {
chain: Readonly<ChainOptions & { rpc: string }>;
client: ThirdwebClient;
maxBlocksWaitTime?: number;
readonly transactionHash: `0x${string}`;
},
): UseQueryResult<TransactionReceipt>;

Parameters

The options for waiting for a transaction receipt.

Type

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

Returns

let returnType: UseQueryResult<TransactionReceipt>;

a query object.