useWaitForCallsStatus

Hook to wait for calls status to be confirmed. It will poll until the calls reach the desired status or until a timeout occurs.

Import

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

Usage

1import { useWaitForCallsStatus } from "@account-kit/react";
2
3function MyComponent() {
4 const {
5 data: result,
6 isLoading,
7 error,
8 } = useWaitForCallsStatus({
9 client: smartWalletClient,
10 id: "0x1234...", // The call ID from sendPreparedCalls
11 timeout: 30_000, // 30 second timeout
12 });
13}

Parameters

params

UseWaitForCallsStatusParams

  • Parameters for the hook

params.client

GetSmartWalletClientResult<Address> | undefined

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

Returns

UseWaitForCallsStatusResult Query result containing the final status