Skip to main content
Learn how to send multiple onchain calls in a single transaction with Wagmi and Base Account.

Overview

Wagmi is a collection of React hooks for Ethereum Virtual Machine (EVM) compatible networks that makes it easy to work with wallets, contracts, transactions, and signing. Base Account integrates perfectly with Wagmi, allowing you to use all your familiar hooks. You can jump ahead and use the Base Account Wagmi Template to get started.
Base Account Wagmi Templatehttps://github.com/base/demos/tree/master/base-account/base-account-wagmi-template

Setup

Make sure you have set up Wagmi with Base Account before following this guide.

Basic Batch Transaction

Send multiple ETH transfers in a single transaction by creating a component that uses the sendCalls method and adding a button to trigger the transaction.
You don’t need to “Connect the wallet” firstBase Account allows you to prompt the user for sending the transaction using the sendCalls method without needing to “Connect the wallet” (ie. using eth_requestAccounts) first.