Send batch transactions
Using Smart Wallets, you can batch multiple actions (such as token transfers, approvals, or swaps) into a single transaction. Users will no longer need multiple confirmations or pop-ups to handle sequential actions. This helps you speed up how users interact with your app and improve the user experience.
How it works
Smart wallets support running a batch of actions, called “calls”, in a single transaction. These actions are atomic, which means if any of them fail (revert), the entire batched transaction will revert. This protects users from accidentally having part of a batch apply, but not all.
To use this feature, you just need to specify multiple calls to make. The parameter type accepts an array of calls, and each element should contain the action you want the wallet to take.
Prerequisites
- API key from your dashboard
- Smart Wallets installed and configured in your project.
Implementation
JavaScript
API
See the sendCalls SDK
reference
for full descriptions of the parameters used in the following example.
You can batch transactions using either the smart wallet client sendCalls or prepareCalls actions.
Next steps
Build more: