Alchemy Logo

useSendPreparedCalls

function 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.

import { useSendPreparedCalls } from "@account-kit/react";
 
const {
  sendPreparedCalls,
  sendPreparedCallsAsync,
  isSendingPreparedCalls,
  error,
} = useSendPreparedCalls();
 
// Send prepared calls
await sendPreparedCallsAsync({
  preparedCalls: [
    // prepared call objects
  ],
});

ParameterTypeDescription

params

UseSendPreparedCallsParams

Configuration parameters for the hook

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

  • 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
Was this page helpful?