function usePrepareCalls(params): UsePrepareCallsResult;Defined in: account-kit/react/src/hooks/usePrepareCalls.ts:88
Hook for preparing calls to a smart account.
This hook provides functionality to prepare calls for execution on a smart account. It handles the preparation step of the Account Abstraction flow, but does not support EOA wallets.
import { usePrepareCalls } from "@account-kit/react";
const { prepareCalls, prepareCallsAsync, isPreparingCalls, error } =
usePrepareCalls();
// Prepare calls
await prepareCallsAsync({
calls: [
{
to: "0x...",
data: "0x...",
value: "0x0",
},
],
});| Parameter | Type | Description |
|---|---|---|
| Configuration parameters for the hook |
An object containing:
prepareCalls: Function to prepare calls synchronously (returns void)prepareCallsAsync: Async function to prepare calls (returns Promise)preparedCalls: The result of the last successful call preparationisPreparingCalls: Boolean indicating if calls are currently being preparederror: Error from the last failed call preparation, if any
- This hook only works with smart accounts and does not support EOA wallets
- The hook handles the preparation step of the Account Abstraction flow
- Prepared calls must be signed, then can be used with
useSendPreparedCallsto complete the execution