function prepareCalls(client, params): Promise<PrepareCallsResult>;Defined in: packages/wallet-apis/src/actions/prepareCalls.ts:82
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.
The client defaults to using EIP-7702 with the signer's address, so you can call
this directly without first calling requestAccount.
// Prepare a sponsored user operation call (uses signer address via EIP-7702 by default)
const result = await client.prepareCalls({
calls: [
{
to: "0x1234...",
data: "0xabcdef...",
value: 0n,
},
],
capabilities: {
paymaster: { policyId: "your-policy-id" },
},
});| Parameter | Type | Description |
|---|---|---|
|
| The wallet API client to use for the request |
|
| Parameters for preparing calls |
Promise<PrepareCallsResult>
A Promise that resolves to the prepared calls result containing the user operation data and signature request