Recommended: JavaScript SDK with React Hooks
For new React apps, we recommend the JavaScript SDK with React Hooks (
@dynamic-labs-sdk/react-hooks) instead of the legacy React SDK documented here. The JS SDK comes with many benefits such as a much smaller bundle size and other optimizations. Use the React quickstart (JavaScript SDK) to get started.calls array. This allows you to batch multiple contract calls together, saving on transaction overhead.
Call Structure
Each call in thecalls array has the following structure:
Benefits of Batch Transactions
- Atomicity: All calls succeed or fail together
- Gas Efficiency: Single transaction overhead for multiple operations
- Better UX: Users only need to approve one transaction