Overview
The Node SDK supports two approaches to SVM gas sponsorship:- Dynamic sponsorship — pass
sponsor: truetosignTransaction(). Dynamic replaces the fee payer with a sponsor wallet. No funded wallet required on your end. - Custom fee payer (delegated access) — your server holds a funded Solana wallet and signs as the fee payer alongside the user’s delegated wallet.
Dynamic sponsorship (simplest)
Passsponsor: true to signTransaction() on DynamicSvmWalletClient. Dynamic’s API replaces the fee payer before signing.
Gas sponsorship must be enabled for your environment in the Dynamic dashboard.
sponsorTransaction() directly to inspect or modify the sponsored transaction before signing.
Custom fee payer with delegated access
Use delegated access to sponsor gas fees for user-initiated Solana transactions. Your server signs transactions on behalf of users while paying the transaction fees.Your server wallet acts as the fee payer for transactions while the user’s delegated wallet signs the transaction instructions.
Prerequisites
- A funded Solana wallet for paying gas fees
- Dynamic server API key
- Environment variables configured
@dynamic-labs-wallet/node-svmpackage installed
Delegated Access: Sponsor gas for user wallets
Use delegated credentials to sign transactions on behalf of users while your server pays the gas fees.1) Create a delegated client and set up fee payer
2) Prepare delegation credentials from webhook
When a user delegates access, you receive encrypted credentials via webhook. Decrypt and prepare them:3) Sign transaction with delegated wallet and fee payer
SPL Token Transfers with Gas Sponsorship
Signature Verification
When using both delegated signing and fee payer signatures, verify all required signatures are present:Error Handling
Related
signTransaction()- Sign withsponsor: truefor Dynamic-managed sponsorshipsponsorTransaction()- Sponsor a transaction separately for manual controldelegatedSignTransaction()- Sign with delegated access andsignerAddress- Delegated Access Overview