Overview
EIP-7702 is available as of
[email protected] (web) and @magic-sdk/[email protected] / @magic-sdk/[email protected] (React Native).wallet.sign7702Authorization()— Signs an authorization that delegates your EOA to a smart contract implementationwallet.send7702Transaction()— Sends a Type-4 transaction that includes signed authorizations
Compatibility
- EIP-7702 operates headlessly with no UI confirmation prompt
- Requires a network that supports EIP-7702 (e.g., Ethereum Mainnet, Sepolia, Arbitrum, Base, Optimism)
- The wallet must have ETH (or the network’s native token) to pay for gas
Use Cases
- Temporarily delegate an EOA to a smart contract implementation for advanced features
- Enable batched transactions through a delegated smart account
- Integrate with account abstraction infrastructure that leverages EIP-7702
Usage
Step 1: Sign an EIP-7702 Authorization
Thesign7702Authorization method signs an authorization that delegates your EOA to a specified smart contract. This authorization is then included in a Type-4 transaction.
JavaScript
Parameters
Response
Step 2: Send a Type-4 Transaction
Thesend7702Transaction method sends a Type-4 transaction that includes the signed authorization list. This is what actually executes the delegation on-chain.
JavaScript
Parameters
Response
Complete Example
JavaScript