Alchemy Logo

sendPreparedCalls

function sendPreparedCalls(
  client,
  params,
): Promise<{
  details:
    | {
        data: object[];
        type: "user-operations";
      }
    | {
        data: {
          calls?: object[];
          hash: `0x${string}`;
        };
        type: "user-operation";
      };
  id: `0x${string}`;
  preparedCallIds: `0x${string}`[];
}>;

Defined in: account-kit/wallet-client/src/client/actions/sendPreparedCalls.ts:53

Sends prepared calls by submitting a signed user operation. This method is used after signing the signature request returned from prepareCalls.

// First prepare the calls
const preparedCalls = await client.prepareCalls({
  calls: [
    {
      to: "0x1234...",
      data: "0xabcdef...",
      value: "0x0",
    },
  ],
  capabilities: {
    paymasterService: { policyId: "your-policy-id" },
  },
});
 
// Then sign the calls
const signedCalls = await client.signPreparedCalls(preparedCalls);
 
// Then send the prepared calls with the signature
const result = await client.sendPreparedCalls({
  signedCalls,
});

ParameterTypeDescription

client

InnerWalletApiClient

The wallet API client to use for the request

params

SendPreparedCallsParams

Parameters for sending prepared calls

Promise<{ details: | { data: object[]; type: "user-operations"; } | { data: { calls?: object[]; hash: `0x${string}`; }; type: "user-operation"; }; id: `0x${string}`; preparedCallIds: `0x${string}`[]; }>

A Promise that resolves to the result containing the call ID

Was this page helpful?