Overview
Smart Account requires the
@magic-ext/smart-account extension.- Gas sponsorship — sponsor transaction fees for your users via an Alchemy Gas Manager policy
- Batched calls — send multiple contract calls in a single atomic transaction
- Cross-chain support — use any EVM chain supported by Alchemy
Prerequisites
- An Alchemy account with an API key
- (Optional) A Gas Manager policy ID for gas sponsorship
Setup
Install the Smart Account extension:JavaScript
Configuration Options
Sending a Transaction
UsesmartAccount.sendTransaction() to send one or more calls through the smart account:
JavaScript
Parameters
Each call in the
calls array accepts:
Response
Batched Transactions
Send multiple calls in a single atomic transaction. All calls execute together — if one fails, they all revert.JavaScript
Gas Sponsorship
When apaymasterPolicyId is provided in the extension config, transaction gas fees are automatically sponsored through Alchemy’s Gas Manager. Users don’t need any ETH to send transactions.
JavaScript
Complete Example
JavaScript