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

1import { useCallsStatus } from "@account-kit/react";
2
3function MyComponent() {
4 const {
5 data: callsStatus,
6 isLoading,
7 error,
8 } = useCallsStatus({
9 client: smartWalletClient,
10 callId: "0x1234...", // The call ID from sendPreparedCalls
11 queryOptions: {
12 // Refetch every 2 sec while pending.
13 refetchInterval: (q) => (q.state.data?.status === 100 ? 2000 : false),
14 },
15 });
16}

Parameters

ParameterTypeDescription

params

UseCallsStatusParams

Parameters for the hook

Returns

UseCallsStatusResult

Query result