Skip to content
Alchemy Logo

prepareCalls

function prepareCalls<TAccount>(
  client,
  params,
): Promise<{} | {} | {} | ({} & object)>;

Defined in: account-kit/wallet-client/src/client/actions/prepareCalls.ts:57

Prepares a set of contract calls for execution by building a user operation. Returns the built user operation and a signature request that needs to be signed before submitting to sendPreparedCalls.

// Prepare a sponsored user operation call
const result = await client.prepareCalls({
  calls: [
    {
      to: "0x1234...",
      data: "0xabcdef...",
      value: "0x0",
    },
  ],
  capabilities: {
    paymasterService: { policyId: "your-policy-id" },
  },
});

Type ParameterDefault type

TAccount extends undefined | `0x${string}`

undefined | `0x${string}`

ParameterTypeDescription

client

InnerWalletApiClient

The wallet API client to use for the request

params

PrepareCallsParams<TAccount>

Parameters for preparing calls

Promise< | { } | { } | { } | { } & object>

A Promise that resolves to the prepared calls result containing the user operation data and signature request

Was this page helpful?