EVM Gas Sponsorship lets you sponsor EVM transaction fees for embedded wallet users. UseDocumentation 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.
sendSponsoredTransaction to send a sponsored transaction and wait for the on-chain hash, or compose the lower-level functions for custom flows.
EVM Gas Sponsorship is available exclusively for V3 MPC embedded wallets. It uses EIP-7702 delegation to relay a batch of calls through a Dynamic-operated relayer contract.
Overview
When you callsendSponsoredTransaction, the SDK:
- Builds an EIP-712 intent describing the batch of calls and a deadline
- Signs the intent with the user’s embedded wallet (and, if delegation is needed, an EIP-7702 authorization for the wallet’s EOA)
- Relays the signed intent to Dynamic’s sponsorship backend
- Polls the relayer until the request reaches a terminal state, then returns the on-chain transaction hash
SponsorTransactionError is thrown. There is no silent fallback.
Enabling EVM Gas Sponsorship
- Go to the Dynamic Dashboard
- Navigate to Settings > Embedded Wallets
- Ensure the EVM chains you want to sponsor are enabled
- Toggle on EVM Gas Sponsorship
Usage
UsesendSponsoredTransaction with a batch of calls to sign, relay, and wait for the transaction in a single call:
| Field | Type | Description |
|---|---|---|
target | Hex | Target contract address. |
data | Hex | Hex-encoded calldata to execute on the target. Use 0x for a plain native-token transfer. |
value | bigint | Amount of native token (in wei) to send with the call. |
Splitting sign and send
Reuse a pre-signed intent (for example, to send it from a different process) by callingsignSponsoredTransaction first and passing the result to sendSponsoredTransaction:
validForSeconds:
EIP-7702 delegation
Before a wallet can submit a sponsored transaction, its EOA must be delegated to the Dynamic relayer contract via an EIP-7702 authorization. The SDK ships three helpers that cover the full lifecycle without dropping into viem.Checking delegation status
Useis7702DelegationActive to check whether delegation is already active on the wallet’s current network. Results are cached per wallet + chain in an in-memory registry, so repeated calls are cheap:
Signing an authorization
sign7702Authorization signs an EIP-7702 authorization for the Dynamic delegation contract using the wallet’s active network (or an explicit chainId override). Pass the result to signSponsoredTransaction or sendSponsoredTransaction to attach it to the next sponsored call:
Activating delegation up-front
For flows that want delegation persisted on-chain before the first user-facing sponsored transaction (e.g. during onboarding), callactivate7702Delegation. It sends an empty sponsored transaction that only carries the EIP-7702 authorization, then returns the on-chain transaction hash. Subsequent sponsored transactions no longer need to include an authorization:
authorization to activate7702Delegation to reuse one obtained from sign7702Authorization.
When
sendSponsoredTransaction is called on a wallet that has not been delegated yet, the SDK signs an EIP-7702 authorization automatically and attaches it to the first call — these helpers are only needed when you want explicit control over the delegation step.Polling the relay status yourself
For custom UI (e.g. a progress bar acrossSUBMITTED → CONFIRMED), call getEVMSponsoredTransactionStatus directly on the requestId returned by relaySponsoredTransaction:
status is one of PENDING, SENT, SUBMITTED, CONFIRMED, FAILED, CANCELED, EXPIRED, or REJECTED. transactionHash is set once the relay broadcasts the transaction.
For the common “wait until done” case, use waitForSponsoredTransaction — it polls every 2 seconds and resolves on CONFIRMED (timeout: 60s):
Error Handling
Sponsorship failures throw aSponsorTransactionError. This error is thrown when:
- The sponsorship API rejects the request (e.g. sponsorship not enabled, chain not supported, paymaster limit hit)
- The relay reaches a terminal failure status (
FAILED,CANCELED,EXPIRED,REJECTED) waitForSponsoredTransactiontimes out after 60 seconds- The wallet provider does not support sponsored transactions (e.g. external wallets)
React
UsesendSponsoredTransaction inside a button handler, with useWalletAccounts from @dynamic-labs-sdk/react-hooks to reactively get the embedded wallet:
Limitations
| Limitation | Details |
|---|---|
| Wallet type | Embedded wallets only (V3 MPC) |
| Mechanism | EIP-7702 delegation to the Dynamic relayer contract |
| Intent validity | 10 minutes by default; configurable via validForSeconds |
| Polling timeout | waitForSponsoredTransaction resolves or throws within 60 seconds |
| Batching | One signed intent per sendSponsoredTransaction call; each intent can contain multiple calls |
Related functions
- isEvmGasSponsorshipEnabled — check whether the dashboard toggle is on for the current project
- EVM Gas Sponsorship Quickstart — the ZeroDev / ERC-4337 alternative for smart accounts
- SVM Gas Sponsorship — the Solana equivalent
Helpers
sign7702Authorization— sign an EIP-7702 authorization for the Dynamic delegation contractis7702DelegationActive— check whether delegation is active for a wallet on its current networkactivate7702Delegation— activate delegation on-chain via a single empty sponsored transaction