wallet_sendPreparedCalls
Sends a prepared call bundle.
Fees
Execution of bundles are paid for by the fee payer, which defaults to the EOA. This can be overriden using feePayer
.
Fees are paid in feeToken
, which is specified in the capabilities of wallet_prepareCalls
. The fee token must be supported on the target chain. The list of supported tokens on each network can be found in the response of wallet_getCapabilities
.
Keys
There exists three different key roles:
- Admin keys are capable of adding and modifying other keys, and capable of spending an unlimited amount of tokens and calling any contract and selector.
- Normal keys can only call contracts as defined by the permissions set on it, and spend the amount of tokens afforded to it by permissions.
- Session keys are like normal keys, except they also have an expiry.
Setting permissions on an admin key is not allowed and will return an error.
For complete details on keys, including their signature encoding, public key encoding, and key hashes, refer to the Key section.
Selectors
Selectors for call permissions can either be a 4-byte selector, e.g. 0x12345678
, or a Solidity-style selector, like transfer(address,uint256)
.
cast sig "transfer(address,uint256)"
# 0xa9059cbb
Request
type Request = {
method: 'wallet_sendPreparedCalls',
params: [{
capabilities?: {
// This will be passed to `feePayer` if specified for additional on-chain verification.
feeSignature?: Hex,
},
context: {
quote: {
chainId: Hex,
intent: {
eoa: Address,
executionData: Hex,
nonce: Hex,
payer: Address,
paymentToken: Address,
prePaymentMaxAmount: Hex,
totalPaymentMaxAmount: Hex,
combinedGas: Hex,
encodedPreCalls: Hex[],
initData: Hex,
prePaymentAmount: Hex,
totalPaymentAmount: Hex,
paymentRecipient: Address,
signature: Hex,
paymentSignature: Hex,
supportedAccountImplementation: Address,
},
txGas: Hex,
nativeFeeEstimate: {
maxFeePerGas: number,
maxPriorityFeePerGas: number,
},
// UNIX timestamp the quote expires at.
ttl: number,
authorizationAddress?: Address,
entrypoint: Address,
// The RPC servers signature over the quote.
signature: {
y_parity: boolean,
r: Hex,
s: Hex,
},
// The hash of the quote.
hash: Hash,
},
},
// The key that signed the bundle. See "Keys".
key: {
type: 'p256' | 'webauthnp256' | 'secp256k1',
publicKey: Hex,
// Whether the bundle digest will be prehashed by the key.
prehash: boolean,
},
signature: Hex,
}],
}
Response
A bundle ID for use with wallet_getCallsStatus
.
type Response = {
// The bundle ID
id: Hex
}