useWaitForCallsStatus
Defined in: account-kit/react/src/hooks/useWaitForCallsStatus.ts:46
Hook to wait for calls status to be confirmed. It will poll until the calls reach the desired status or until a timeout occurs.
Example
import { function useWaitForCallsStatus({ client, ...params }: UseWaitForCallsStatusParams): UseWaitForCallsStatusResultHook to wait for calls status to be confirmed. It will poll until the calls reach the desired status or until a timeout occurs.
useWaitForCallsStatus } from "@account-kit/react"; function function MyComponent(): voidMyComponent() { const { data: { version: string; id: string; chainId: number; atomic: boolean; receipts?: WalletCallReceipt<bigint, "success" | "reverted">[] | undefined; capabilities?: { [key: string]: any; } | { [x: string]: any; } | undefined; statusCode: number; status: "pending" | "success" | "failure" | undefined; } | undefinedThe last successfully resolved data for the query.
The last successfully resolved data for the query.
The last successfully resolved data for the query.
The last successfully resolved data for the query.
The last successfully resolved data for the query.
The last successfully resolved data for the query.
data: const result: { version: string; id: string; chainId: number; atomic: boolean; receipts?: WalletCallReceipt<bigint, "success" | "reverted">[] | undefined; capabilities?: { [key: string]: any; } | { [x: string]: any; } | undefined; statusCode: number; status: "pending" | "success" | "failure" | undefined; } | undefinedThe last successfully resolved data for the query.
result, const isLoading: booleanIs true
whenever the first fetch for a query is in-flight. Is the same as isFetching && isPending
.
isLoading, const error: Error | nullThe error object for the query, if an error was thrown. Defaults to null
.
error, } = function useWaitForCallsStatus({ client, ...params }: UseWaitForCallsStatusParams): UseWaitForCallsStatusResultHook to wait for calls status to be confirmed. It will poll until the calls reach the desired status or until a timeout occurs.
useWaitForCallsStatus({ UseWaitForCallsStatusParams.client: { account: SupportedAccounts; batch?: { multicall?: boolean | Prettify<MulticallBatchOptions> | undefined; } | undefined; cacheTime: number; ccipRead?: false | { request?: (parameters: CcipRequestParameters) => Promise<CcipRequestReturnType>; } | undefined; chain: Chain | undefined; experimental_blockTag?: BlockTag | undefined; key: string; ... 81 more ...; extend: <const client extends { ...; } & ExactPartial<...>>(fn: (client: Client<...>) => client) => Client<...>; } | { ...; } | { ...; } | { ...; } | undefinedclient: anysmartWalletClient, id: stringThe id of the call batch to wait for.
id: "0x1234...", // The call ID from sendPreparedCalls timeout?: number | undefinedOptional timeout (in milliseconds) to wait before stopping polling.
timeout: 30_000, // 30 second timeout }); }
Parameters
Returns
Query result containing the final status