Sponsor EVM transaction fees for your users with Dynamic’s gas sponsorship feature for embedded wallets.
Recommended: JavaScript SDK with React Hooks
For new React apps, we recommend the JavaScript SDK with React Hooks (@dynamic-labs-sdk/react-hooks) instead of the legacy React SDK documented here. The JS SDK comes with many benefits such as a much smaller bundle size and other optimizations. Use the React quickstart (JavaScript SDK) to get started.
EVM Gas Sponsorship lets your users send EVM transactions without paying gas. Dynamic relays the transaction on the user’s behalf and uses EIP-7702 to execute a batch of calls directly from the user’s embedded wallet.
EVM Gas Sponsorship is available exclusively for V3 MPC embedded wallets. Contact us to enable it for your project.
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, binds them to a relayer address, and sets 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. The lifecycle is pending → submitted → success (or failure). The on-chain transaction hash is available once the relay reports submitted.
EVM gas sponsorship is exposed through @dynamic-labs-sdk/evm. Install it alongside the React-hooks package that lets you reactively read wallet accounts:
isEvmGasSponsorshipEnabled returns synchronously based on the project settings already loaded by the SDK. Use it to gate UI before showing a “Send gasless” button.
import { isEvmGasSponsorshipEnabled } from '@dynamic-labs-sdk/evm';const canSponsor = isEvmGasSponsorshipEnabled();
sendSponsoredTransaction 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.Use useGetWalletAccounts from @dynamic-labs-sdk/react-hooks to reactively get the EVM embedded wallet:
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.
nonce
—
Reuse a specific bitmap nonce (bigint, as returned on the signed intent) instead of letting the SDK generate one. Sign several intents with the same nonce so at most one can land on-chain (cancel-replace). Used as-is, with no on-chain check.
For retry, batching, or custom UI flows you can split the steps:
signSponsoredTransaction returns the signed intent without contacting the relayer.
relaySponsoredTransaction sends a signed intent (or signs and sends in one step) and returns a requestId.
waitForSponsoredTransaction polls a requestId until the relay reports inclusion on-chain.
getEVMSponsoredTransactionStatus does a one-shot status read for custom polling.
import { signSponsoredTransaction, relaySponsoredTransaction, waitForSponsoredTransaction, getEVMSponsoredTransactionStatus,} from '@dynamic-labs-sdk/evm';// Sign now, relay laterconst signedTransaction = await signSponsoredTransaction({ walletAccount, calls,});const { requestId } = await relaySponsoredTransaction({ signedTransaction,});// Block until inclusionconst { transactionHash } = await waitForSponsoredTransaction({ requestId });// Or read the current status without pollingconst status = await getEVMSponsoredTransactionStatus({ requestId });
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.
The first sponsored transaction from a given wallet activates EIP-7702 delegation to Dynamic’s gasless contract. By default sendSponsoredTransaction and relaySponsoredTransaction 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 functions directly.
sign7702Authorization returns a signed authorization without broadcasting anything. Pass it to a later sendSponsoredTransaction, relaySponsoredTransaction, or activate7702Delegation call.
import { sign7702Authorization } from '@dynamic-labs-sdk/evm';const authorization = await sign7702Authorization({ walletAccount, // Defaults to the wallet's active network chain ID. // chainId: 1,});
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.
import { sign7702Authorization, activate7702Delegation,} from '@dynamic-labs-sdk/evm';// Sign now, activate laterconst authorization = await sign7702Authorization({ walletAccount });const { transactionHash } = await activate7702Delegation({ walletAccount, authorization,});// Or have the SDK sign and activate in one callawait activate7702Delegation({ walletAccount });