Skip to content
Alchemy Logo

sendCalls

function sendCalls(client, params): Promise<SendCallsResult>;

Defined in: packages/wallet-apis/src/actions/sendCalls.ts:59

Prepares, signs, and submits calls. This function internally calls prepareCalls, signPreparedCalls, and sendPreparedCalls.

The client defaults to using EIP-7702 with the signer's address, so you can call this directly without first calling requestAccount.

// Send calls (uses signer address via EIP-7702 by default)
const result = await client.sendCalls({
  calls: [
    {
      to: "0x1234...",
      data: "0xabcdef...",
      value: 0n,
    },
  ],
  capabilities: {
    paymaster: { policyId: "your-policy-id" },
  },
});
 
// Wait for the calls to be mined and confirmed.
// Polls getCallsStatus until the bundle succeeds, fails, or times out (default 60s).
// See: https://viem.sh/docs/actions/wallet/waitForCallsStatus
const status = await client.waitForCallsStatus({ id: result.id });
console.log(status.status); // "success" | "failure"

<Note> If using this action with an ERC-20 paymaster in pre-operation mode with autoPermit, the contents of the permit will be hidden from the user. It is recommended to use the prepareCalls action instead to manually handle the permit signature. </Note>

ParameterTypeDescription

client

InnerWalletApiClient

The wallet API client to use for the request

params

SendCallsParams

Parameters for sending calls

Promise<SendCallsResult>

A Promise that resolves to the result containing the call ID.

Was this page helpful?