Skip to main content
SVM Gas Sponsorship lets you sponsor Solana (SVM) transaction fees for embedded wallet users. Use the dedicated signAndSendSponsoredTransaction function to explicitly send sponsored transactions.
SVM Gas Sponsorship is available exclusively for V3 MPC embedded wallets.

Overview

When you call signAndSendSponsoredTransaction, the SDK:
  1. Sends the transaction to Dynamic’s backend for sponsorship
  2. Replaces the fee payer with Dynamic’s sponsored account
  3. Signs the sponsored transaction with the user’s wallet
  4. Broadcasts to the network with skipPreflight: true by default
If sponsorship fails for any reason, a SponsorTransactionError is thrown — there is no silent fallback.

Enabling SVM Gas Sponsorship

  1. Go to the Dynamic Dashboard
  2. Navigate to Settings > Embedded Wallets
  3. Ensure Solana (SOL) is enabled in your chain configurations
  4. Toggle on SVM Gas Sponsorship

Usage

Use signAndSendSponsoredTransaction to explicitly send a sponsored transaction:
import { signAndSendSponsoredTransaction } from '@dynamic-labs-sdk/solana';

const sendSponsoredTx = async (walletAccount, transaction) => {
  const { signature } = await signAndSendSponsoredTransaction({
    transaction,
    walletAccount,
  });
  console.log('Sponsored transaction sent:', signature);
};

Non-Sponsored Transactions

signAndSendTransaction sends transactions without sponsorship. Use it when you don’t need gas sponsorship:
import { signAndSendTransaction } from '@dynamic-labs-sdk/solana';

const sendTx = async (walletAccount, transaction) => {
  const { signature } = await signAndSendTransaction({
    transaction,
    walletAccount,
  });
  console.log('Transaction sent:', signature);
};

Send Options

You can pass SendOptions to override defaults. Sponsored transactions use skipPreflight: true by default, but you can override this:
const { signature } = await signAndSendSponsoredTransaction({
  transaction,
  walletAccount,
  options: { skipPreflight: false },
});

Error Handling

Sponsorship failures throw a SponsorTransactionError. This error is thrown when:
  • The sponsorship API cannot sponsor the transaction
  • The wallet provider does not support sponsored transactions (e.g. external wallets)
import {
  signAndSendSponsoredTransaction,
  SponsorTransactionError,
} from '@dynamic-labs-sdk/solana';

const sendTransaction = async (walletAccount, transaction) => {
  try {
    const { signature } = await signAndSendSponsoredTransaction({
      transaction,
      walletAccount,
    });
    return { success: true, signature };
  } catch (error) {
    if (error instanceof SponsorTransactionError) {
      return {
        success: false,
        error: 'Gas sponsorship failed',
      };
    }

    return { success: false, error: error.message };
  }
};

Limitations

LimitationDetails
Wallet typeEmbedded wallets only (V3 MPC)
Transaction sizeMaximum 2KB base64-encoded
Already-signedTransactions with signatures are not sponsored
BatchingEach transaction sponsored individually