EVM Gas Sponsorship lets your users send EVM transactions without paying gas. Dynamic relays the transaction on their behalf and uses EIP-7702 delegation to execute batched calls from the user’s embedded wallet.Documentation Index
Fetch the complete documentation index at: https://www.dynamic.xyz/docs/llms.txt
Use this file to discover all available pages before exploring further.
EVM Gas Sponsorship is available exclusively for V3 MPC embedded wallets. Contact us to enable it for your project.
How it works
A sponsored transaction is a batch of{ target, data, value } calls that Dynamic submits on-chain on the user’s behalf:
- The user’s embedded wallet signs an EIP-712 intent that authorizes the calls and binds them to a relayer address and a deadline.
- The first time a wallet is sponsored, the SDK also signs an EIP-7702 authorization to delegate the EOA to Dynamic’s gasless delegation contract. After activation, the delegation persists on-chain and is reused on subsequent transactions.
- Dynamic’s relayer submits the transaction and reports a
pending→submitted→success(orfailure) lifecycle. The on-chain transaction hash is available once the relay reportssubmitted.
Prerequisites
Before you start, make sure you have:- A React Native app set up with the React Native quickstart.
- V3 MPC embedded wallets enabled in Settings > Embedded Wallets in the Dynamic dashboard.
- EVM Gas Sponsorship enabled for your environment. Contact us to turn it on.
Setup
Install the extension
- expo
- npm
- yarn
- pnpm
- bun
Extend the Dynamic client
AddEthereumGaslessExtension() to the extension chain on your existing createClient() call. This adds an ethereumGasless namespace to the client.
client.ts
Check if sponsorship is enabled
CallisEnabled to confirm that sponsorship is turned on for your environment. Use this to gate UI before showing a “Send gasless” button.
Send a sponsored transaction
send signs the intent, hands it to the relayer, and resolves once the transaction is included on-chain. The calls array supports batches — every entry runs atomically.
Call shape
Each entry incalls describes a single call inside the sponsored batch:
| Field | Type | Description |
|---|---|---|
target | `0x${string}` | Contract or recipient address to execute the call against. |
data | `0x${string}` | Hex-encoded calldata. Use 0x for a plain native transfer. |
value | bigint | Native token amount (in wei) to send with the call. |
data with encodeFunctionData from viem:
Options
Pass these alongsidewallet and calls:
| Option | Default | Description |
|---|---|---|
autoDelegate | true | When true, the SDK signs an EIP-7702 authorization if the wallet is not already delegated. Set to false if you manage delegation yourself. |
authorization | — | Pre-signed EIP-7702 authorization. Takes priority over autoDelegate. |
validForSeconds | 600 | How long the signed intent stays valid before the relayer rejects it. |
Split signing and relaying
For retry, batching, or custom UI flows, you can split the steps:signreturns the signed intent without contacting the relayer.relaysends a signed intent (or signs and sends in one step) and returns arequestId.waitForpolls arequestIduntil it resolves to an on-chain transaction.getStatusdoes a one-shot status read for custom polling.
status.status is one of pending, submitted, success, or failure. status.transactionHash is populated once the relay reports submitted; status.errorMessage is populated on failure.
EIP-7702 delegation
The first sponsored transaction from a given wallet activates EIP-7702 delegation to Dynamic’s gasless contract. By defaultsend and relay handle this for you via autoDelegate: true. If you want to manage delegation explicitly — for example, to surface an “Enable gasless” button before the first transaction — use these methods directly.
Check delegation status
Sign a 7702 authorization
sign7702Authorization returns a signed authorization without broadcasting anything. Pass it to a later send, relay, or activate7702Delegation call.
Activate delegation explicitly
activate7702Delegation sends a sponsored transaction whose only purpose is to activate the delegation on-chain. After it resolves, subsequent sponsored transactions skip the authorization step.
Error handling
Sponsorship failures throw — there is no silent fallback. Wrap calls intry/catch and surface a useful message to the user:
- EVM Gas Sponsorship is not enabled for the environment.
- The wallet is not a V3 MPC embedded wallet.
- The wallet’s active network is not supported by the relayer.
- The signed intent expired (
validForSecondselapsed before the relayer ran). - A terminal on-chain failure on the relayed transaction.
Limitations
| Limitation | Details |
|---|---|
| Wallet type | V3 MPC embedded wallets only. External wallets and legacy embedded wallets are not supported. |
| Chain | EVM networks where Dynamic has enabled a relayer. Use isEnabled and is7702DelegationActive to gate UI per chain. |
| Batch size | Calls execute atomically inside one sponsored transaction — the whole batch reverts if any call fails. |
| Intent lifetime | The signed intent expires after validForSeconds (default 600). Sign close to the time you relay. |