sendCalls

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

Import

1import { sendCalls } from "@account-kit/wallet-client";

Usage

1const result = await client.sendCalls({
2 calls: [
3 {
4 to: "0x1234...",
5 data: "0xabcdef...",
6 value: "0x0",
7 },
8 ],
9 capabilities: {
10 paymasterService: { policyId: "your-policy-id" },
11 },
12});
13
14// The result contains the prepared call IDs
15console.log(result.preparedCallIds);

Parameters

client

InnerWalletApiClient

  • The wallet API client to use for the request

signer

SmartAccountSigner

  • The signer to use

params

PrepareCallsParams<TAccount>

  • Parameters for sending calls

params.calls

Array<{to: Address, data?: Hex, value?: Hex}>

  • Array of contract calls to execute

params.from

Address

  • The address to execute the calls from (required if the client wasn’t initialized with an account)

params.capabilities

object

  • Optional capabilities to include with the request.

Returns

Promise<SendPreparedCallsResult> A Promise that resolves to the result containing the prepared call IDs.