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;
client: ThirdwebClient;
maxBlocksWaitTime?: number;
readonly transactionHash: `0x${string}`;
} & { queryOptions?: { enabled?: boolean } }),
): UseQueryResult<TransactionReceipt>;

Parameters

The options for waiting for a transaction receipt.

Type

let options:
| undefined
| ({
chain: Readonly;
client: ThirdwebClient;
maxBlocksWaitTime?: number;
readonly transactionHash: `0x${string}`;
} & { queryOptions?: { enabled?: boolean } });

Returns

let returnType: UseQueryResult<TransactionReceipt>;

a query object.