With Base Account, you can send multiple onchain calls in a single transaction. Doing so improves the UX of multi-step interactions by reducing them to a single click. A common example of where you might want to leverage batch transactions is an ERC-20Documentation Index
Fetch the complete documentation index at: https://base-a060aa97-meyer9-move-azul-to-top-of-upgrades.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
approve followed by a swap.
You can submit batch transactions by using the wallet_sendCalls RPC method, defined in EIP-5792.
Installation
Install the Base Account SDK:Setup
Initialize the SDK
Import and create the Base Account SDK instance:batchTransactions.tsx
Basic Batch Transaction
Simple Multiple Transfers
Send multiple ETH transfers in a single transaction:batchTransactions.tsx
Contract Interactions
ERC-20 Approve and Mint an NFT (ERC-721)
A common pattern is to approve the NFT contract to move your ERC-20 and then mint an NFT (ERC-721):batchTransactions.tsx
Advanced Features
Checking Wallet Capabilities
Before sending batch transactions, you can check if the wallet supports atomic batching:batchTransactions.tsx
Non-Atomic Batching
Sometimes you want calls to execute sequentially, even if some fail:batchTransactions.tsx
Getting the Batch Transaction Result
wallet_getCallsStatus returns the execution status for a batch you previously submitted with wallet_sendCalls. Capture the callsId returned by wallet_sendCalls, then poll for the batch status until it is confirmed or fails.
batchTransactions.tsx
wallet_getCallsStatus in the reference documentation.