useCallsStatus

1function useCallsStatus(params): UseCallsStatusResult;

Defined in: account-kit/react/src/hooks/useCallsStatus.ts:55

Hook to retrieve the status of prepared calls from the Wallet API.

This hook queries the status of a specific call ID that was returned from wallet_sendPreparedCalls. The status indicates whether the batch of calls has been processed, confirmed, or failed on-chain.

Example

import { 
function useCallsStatus(params: UseCallsStatusParams): UseCallsStatusResult

Hook to retrieve the status of prepared calls from the Wallet API.

This hook queries the status of a specific call ID that was returned from wallet_sendPreparedCalls. The status indicates whether the batch of calls has been processed, confirmed, or failed on-chain.

useCallsStatus
} from "@account-kit/react";
function
function MyComponent(): void
MyComponent
() {
const {
data: { receipts?: { status: `0x${string}`; logs: { address: `0x${string}`; data: `0x${string}`; topics: `0x${string}`[]; }[]; blockHash: `0x${string}`; blockNumber: `0x${string}`; gasUsed: `0x${string}`; transactionHash: `0x${string}`; }[] | undefined; id: `0x${string}`; chainId: `0x${string}`; atomic: boolean; status: 200 | 100 | 400 | 500 | 600; } | 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 callsStatus: { receipts?: { status: `0x${string}`; logs: { address: `0x${string}`; data: `0x${string}`; topics: `0x${string}`[]; }[]; blockHash: `0x${string}`; blockNumber: `0x${string}`; gasUsed: `0x${string}`; transactionHash: `0x${string}`; }[] | undefined; id: `0x${string}`; chainId: `0x${string}`; atomic: boolean; status: 200 | 100 | 400 | 500 | 600; } | undefined

The last successfully resolved data for the query.

callsStatus
,
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 useCallsStatus(params: UseCallsStatusParams): UseCallsStatusResult

Hook to retrieve the status of prepared calls from the Wallet API.

This hook queries the status of a specific call ID that was returned from wallet_sendPreparedCalls. The status indicates whether the batch of calls has been processed, confirmed, or failed on-chain.

useCallsStatus
({
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
,
callId: `0x${string}` | undefined
callId
: "0x1234...", // The call ID from sendPreparedCalls
queryOptions?: Omit<UseQueryOptions<{ receipts?: { status: `0x${string}`; logs: { address: `0x${string}`; data: `0x${string}`; topics: `0x${string}`[]; }[]; blockHash: `0x${string}`; blockNumber: `0x${string}`; gasUsed: `0x${string}`; transactionHash: `0x${string}`; }[] | undefined; id: `0x${string}`; chainId: `0x${string}`; atomic: boolean; status: 200 | 100 | 400 | 500 | 600; }, Error, { receipts?: { status: `0x${string}`; logs: { address: `0x${string}`; data: `0x${string}`; topics: `0x${string}`[]; }[]; blockHash: `0x${string}`; blockNumber: `0x${string}`; gasUsed: `0x${string}`; transactionHash: `0x${string}`; }[] | undefined; id: `0x${string}`; chainId: `0x${string}`; atomic: boolean; status: 200 | 100 | 400 | 500 | 600; }, readonly unknown[]>, "queryKey" | "queryFn"> | undefined
queryOptions
: {
// Refetch every 2 sec while pending.
refetchInterval?: number | false | ((query: Query<{ receipts?: { status: `0x${string}`; logs: { address: `0x${string}`; data: `0x${string}`; topics: `0x${string}`[]; }[]; blockHash: `0x${string}`; blockNumber: `0x${string}`; gasUsed: `0x${string}`; transactionHash: `0x${string}`; }[] | undefined; id: `0x${string}`; chainId: `0x${string}`; atomic: boolean; status: 200 | 100 | 400 | 500 | 600; }, Error, { receipts?: { status: `0x${string}`; logs: { address: `0x${string}`; data: `0x${string}`; topics: `0x${string}`[]; }[]; blockHash: `0x${string}`; blockNumber: `0x${string}`; gasUsed: `0x${string}`; transactionHash: `0x${string}`; }[] | undefined; id: `0x${string}`; chainId: `0x${string}`; atomic: boolean; status: 200 | 100 | 400 | 500 | 600; }, readonly unknown[]>) => number | false | undefined) | undefined

If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency Defaults to false.

refetchInterval
: (
q: Query<{ receipts?: { status: `0x${string}`; logs: { address: `0x${string}`; data: `0x${string}`; topics: `0x${string}`[]; }[]; blockHash: `0x${string}`; blockNumber: `0x${string}`; gasUsed: `0x${string}`; transactionHash: `0x${string}`; }[] | undefined; id: `0x${string}`; chainId: `0x${string}`; atomic: boolean; status: 200 | 100 | 400 | 500 | 600; }, Error, { receipts?: { status: `0x${string}`; logs: { address: `0x${string}`; data: `0x${string}`; topics: `0x${string}`[]; }[]; blockHash: `0x${string}`; blockNumber: `0x${string}`; gasUsed: `0x${string}`; transactionHash: `0x${string}`; }[] | undefined; id: `0x${string}`; chainId: `0x${string}`; atomic: boolean; status: 200 | 100 | 400 | 500 | 600; }, readonly unknown[]>
q
) => (
q: Query<{ receipts?: { status: `0x${string}`; logs: { address: `0x${string}`; data: `0x${string}`; topics: `0x${string}`[]; }[]; blockHash: `0x${string}`; blockNumber: `0x${string}`; gasUsed: `0x${string}`; transactionHash: `0x${string}`; }[] | undefined; id: `0x${string}`; chainId: `0x${string}`; atomic: boolean; status: 200 | 100 | 400 | 500 | 600; }, Error, { receipts?: { status: `0x${string}`; logs: { address: `0x${string}`; data: `0x${string}`; topics: `0x${string}`[]; }[]; blockHash: `0x${string}`; blockNumber: `0x${string}`; gasUsed: `0x${string}`; transactionHash: `0x${string}`; }[] | undefined; id: `0x${string}`; chainId: `0x${string}`; atomic: boolean; status: 200 | 100 | 400 | 500 | 600; }, readonly unknown[]>
q
.
Query<{ receipts?: { status: `0x${string}`; logs: { address: `0x${string}`; data: `0x${string}`; topics: `0x${string}`[]; }[]; blockHash: `0x${string}`; blockNumber: `0x${string}`; gasUsed: `0x${string}`; transactionHash: `0x${string}`; }[] | undefined; id: `0x${string}`; chainId: `0x${string}`; atomic: boolean; status: 200 | ... 3 more ... | 600; }, Error, { receipts?: { status: `0x${string}`; logs: { address: `0x${string}`; data: `0x${string}`; topics: `0x${string}`[]; }[]; blockHash: `0x${string}`; blockNumber: `0x${string}`; gasUsed: `0x${string}`; transactionHash: `0x${string}`; }[] | undefined; id: `0x${string}`; chainId: `0x${string}`; atomic: boolean; status: 200 | ... 3 more ... | 600; }, readonly unknown[]>.state: QueryState<{ receipts?: { status: `0x${string}`; logs: { address: `0x${string}`; data: `0x${string}`; topics: `0x${string}`[]; }[]; blockHash: `0x${string}`; blockNumber: `0x${string}`; gasUsed: `0x${string}`; transactionHash: `0x${string}`; }[] | undefined; id: `0x${string}`; chainId: `0x${string}`; atomic: boolean; status: 200 | 100 | 400 | 500 | 600; }, Error>
state
.
QueryState<{ receipts?: { status: `0x${string}`; logs: { address: `0x${string}`; data: `0x${string}`; topics: `0x${string}`[]; }[]; blockHash: `0x${string}`; blockNumber: `0x${string}`; gasUsed: `0x${string}`; transactionHash: `0x${string}`; }[] | undefined; id: `0x${string}`; chainId: `0x${string}`; atomic: boolean; status: 200 | ... 3 more ... | 600; }, Error>.data: { receipts?: { status: `0x${string}`; logs: { address: `0x${string}`; data: `0x${string}`; topics: `0x${string}`[]; }[]; blockHash: `0x${string}`; blockNumber: `0x${string}`; gasUsed: `0x${string}`; transactionHash: `0x${string}`; }[] | undefined; id: `0x${string}`; chainId: `0x${string}`; atomic: boolean; status: 200 | 100 | 400 | 500 | 600; } | undefined
data
?.
status: 200 | 100 | 400 | 500 | 600 | undefined
status
=== 100 ? 2000 : false),
}, }); }

Parameters

ParameterTypeDescription

params

UseCallsStatusParams

Parameters for the hook

Returns

UseCallsStatusResult

Query result