useWaitForCallsStatus

1function useWaitForCallsStatus(params): UseWaitForCallsStatusResult;

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): UseWaitForCallsStatusResult

Hook 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(): void
MyComponent
() {
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; } | undefined

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.

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; } | undefined

The last successfully resolved data for the query.

result
,
const isLoading: boolean

Is true whenever the first fetch for a query is in-flight. Is the same as isFetching && isPending.

isLoading
,
const error: Error | null

The error object for the query, if an error was thrown. Defaults to null.

error
,
} =
function useWaitForCallsStatus({ client, ...params }: UseWaitForCallsStatusParams): UseWaitForCallsStatusResult

Hook 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<...>; } | { ...; } | { ...; } | { ...; } | undefined
client
:
any
smartWalletClient
,
id: string

The id of the call batch to wait for.

id
: "0x1234...", // The call ID from sendPreparedCalls
timeout?: number | undefined

Optional timeout (in milliseconds) to wait before stopping polling.

timeout
: 30_000, // 30 second timeout
}); }

Parameters

ParameterTypeDescription

params

UseWaitForCallsStatusParams

Parameters for the hook

Returns

UseWaitForCallsStatusResult

Query result containing the final status