wallet_sendCalls
Requests that a wallet submits a batch of calls. The wallet may execute these calls atomically (in a single transaction) or non-atomically (in multiple transactions), depending on the wallet's capabilities and the atomicRequired
parameter.
Example Usage
provider.request({
method: 'wallet_sendCalls',
params: [{
version: '1.0',
id: '0x123...',
chainId: '0x01',
from: '0xd46e8dd67c5d32be8058bb8eb970870f07244567',
atomicRequired: true,
calls: [
{
to: '0xd46e8dd67c5d32be8058bb8eb970870f07244567',
value: '0x9184e72a',
data: '0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675'
},
{
to: '0xd46e8dd67c5d32be8058bb8eb970870f07244567',
value: '0x182183',
data: '0xfbadbaf01'
}
],
capabilities: {
paymasterService: {
url: "https://...",
optional: true
}
}
}]
})
{ "id": "0x00000000000000000000000000000000000000000000000000000000000000000e670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331" }
Parameters
An array with a single object that contains the following fields:
-
version
string
- The version of the
sendCalls
API to use. Currently, '1.0' is the only version.
-
id
string
(optional)- A unique identifier for this batch of calls. If provided, must be a unique string up to 4096 bytes (8194 characters including leading
0x
). Must be unique per sender per app. If not provided, the wallet will generate a random ID.
-
chainId
Hex
- The chain ID to send the calls on. This is top level because all calls must be submitted on the same chain.
-
from
Address
(optional)- The address to send the calls from. If not provided, the wallet should allow the user to select the address during confirmation.
-
atomicRequired
boolean
- Specifies whether the wallet must execute all calls atomically (in a single transaction) or not. If set to
true
, the wallet MUST execute all calls atomically and contiguously. If set tofalse
, the wallet MUST execute calls sequentially (one after another), but they need not be contiguous (other transactions may be interleaved) and some calls may fail independently. - If the wallet's
atomic
capability isready
, it MUST upgrade tosupported
before proceeding with atomic execution.
-
calls
Call[]
- The calls to submit. A
Call
is defined as an object that has the following fields:- to (optional)
Address
- The address to send this call to. This field is optional because a call can be a contract creation.
- value (optional)
Hex
- Value in wei to send with this call.
- data
Hex
- The hash of the invoked method signature and encoded parameters OR the compiled code of a contract.
- capabilities (optional)
Record<string, Capability>
- Call-specific capability parameters
- to (optional)
-
capabilities
Record<string, Capability>
- An object where the keys are capability names and the values are capability-specific parameters. The wallet MUST support all non-optional capabilities requested or reject the request.
Returns
{ id: string, capabilities?: Record<string, any> }
Returns an object containing:
id
: A call bundle identifier that can be used withwallet_getCallsStatus
andwallet_showCallsStatus
capabilities
: Optional capability-specific response data