useCallsStatus

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.

Import

1import { useCallsStatus } from "@account-kit/react";

Usage

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

params

UseCallsStatusParams

  • Parameters for the hook

params.client

GetSmartWalletClientResult<Address> | undefined

  • Smart wallet client instance. The hook will not fetch until this is defined.

params.callId

Hex | undefined

  • A call ID (hex string) returned from sendPreparedCalls. The hook will not fetch until this is defined.

Returns

UseCallsStatusResult Query result