useSendPreparedCalls

1function useSendPreparedCalls(params): UseSendPreparedCallsResult;

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): UseSendPreparedCallsResult

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.

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: boolean
isSendingPreparedCalls
,
const error: Error | null
error
,
} =
function useSendPreparedCalls(params: UseSendPreparedCallsParams): UseSendPreparedCallsResult

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.

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

ParameterTypeDescription

params

UseSendPreparedCallsParams

Configuration parameters for the hook

Returns

UseSendPreparedCallsResult

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 execution
  • isSendingPreparedCalls: Boolean indicating if prepared calls are currently being sent
  • error: 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