EIP-7702 Wallet API Quickstart
Learn how to send user ops using EIP-7702
This short guide will introduce how to prepare and send user operations using a 7702 account in a matter of minutes. We’ll demonstrate how to do it using the SDK client or by using platform-agnostic JSON-RPC APIs.
The logical flow is to prepare the calls you’re looking to send, sign them, and send them!
In API calls, it’s as simple as:
This guide assumes you have an account you can sign with, like an Alchemy Signer or a user’s EOA. You will also need an Alchemy API key, and a gas manager policy ID if you want to sponsor gas.
Don't have an API key?
Start using the Alchemy Wallets API today! Get started for free.
Using The TypeScript SDK
1. Install Prerequisites
You’re going to need the @account-kit/wallet-client
and @account-kit/infra
. We’ll also be using LocalAccountSigner
from @aa-sdk/core
as the signer for demonstration purposes.
2. Create A Smart Wallet Client
Create a client for a given signer (e.g. a LocalAccountSigner
imported from @aa-sdk/core
or an Alchemy Signer).
3. Send A Sponsored User Op
All you need to do is follow a few simple steps to start sending user ops with Wallet APIs!
Using The JSON-RPC APIs Directly
1. Prepare Your Calls
You can simply prepare whatever calls you’d like to send, being sure to include the 7702 capability.
If the account isn’t already delegated to Modular Account V2 onchain, this will return an array of calls that must be signed:
For subsequent calls, only one call will be returned (unless the owner removed or changed the delegation):
2. Sign The Call(s)
Sign the prepared calls. How exactly you do this will differ depending on your language. Here is an example using Viem in TypeScript:
3. Send The Prepared Calls
Now that you have the prepared calls & signatures, you’re ready to send the calls!
This will return the array of prepared call IDs.
4. Check The Calls Status
Now you can simply call wallet_getCallsStatus
to check the status of the calls.
See here for all of the possible results.