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.