Skip to main content

Overview

Smart Account requires the @magic-ext/smart-account extension.
Magic’s Smart Account extension lets you send transactions through an EIP-7702 smart account powered by Alchemy’s Smart Wallet infrastructure. With EIP-7702, the user’s existing EOA is the smart account — there is no separate contract deployment or address change. This enables:
  • 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

Setup

Install the Smart Account extension:
Initialize Magic with the extension:
JavaScript

Configuration Options

Sending a Transaction

Use smartAccount.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 a paymasterPolicyId 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
You can configure sponsorship rules (per-user limits, allowed contracts, chain restrictions) in the Alchemy Gas Manager dashboard.

Complete Example

JavaScript

Resources