useSendPreparedCalls
Defined in: account-kit/react/src/hooks/useSendPreparedCalls.ts:86
Hook for sending prepared calls to a smart account.
This hook provides functionality to send previously prepared calls to a smart account. It handles the signing and sending of prepared calls, but does not support EOA wallets.
Example
import { function useSendPreparedCalls(params: UseSendPreparedCallsParams): UseSendPreparedCallsResultHook for sending prepared calls to a smart account.
This hook provides functionality to send previously prepared calls to a smart account. It handles the signing and sending of prepared calls, but does not support EOA wallets.
useSendPreparedCalls } from "@account-kit/react"; const { const sendPreparedCalls: UseMutateFunction<{ preparedCallIds: `0x${string}`[]; }, Error, MutationParams, unknown>sendPreparedCalls, const sendPreparedCallsAsync: UseMutateAsyncFunction<{ preparedCallIds: `0x${string}`[]; }, Error, MutationParams, unknown>sendPreparedCallsAsync, const isSendingPreparedCalls: booleanisSendingPreparedCalls, const error: Error | nullerror, } = function useSendPreparedCalls(params: UseSendPreparedCallsParams): UseSendPreparedCallsResultHook for sending prepared calls to a smart account.
This hook provides functionality to send previously prepared calls to a smart account. It handles the signing and sending of prepared calls, but does not support EOA wallets.
useSendPreparedCalls(); // Send prepared calls await const sendPreparedCallsAsync: (variables: MutationParams, options?: MutateOptions<{ preparedCallIds: `0x${string}`[]; }, Error, MutationParams, unknown> | undefined) => Promise<{ preparedCallIds: `0x${string}`[]; }>sendPreparedCallsAsync({ preparedCalls: never[]preparedCalls: [ // prepared call objects ], });
Parameters
Returns
An object containing:
sendPreparedCalls
: Function to send prepared calls synchronously (returns void)sendPreparedCallsAsync
: Async function to send prepared calls (returns Promise)sendPreparedCallsResult
: The result of the last successful prepared call executionisSendingPreparedCalls
: Boolean indicating if prepared calls are currently being senterror
: Error from the last failed prepared call execution, if any
Description
- This hook only works with smart accounts and does not support EOA wallets
- The hook handles the signing and sending of prepared calls
- The returned result contains the prepared call IDs