Skip to main content
The SDK primarily abstracts three endpoints: sol_send_transaction, get_send_transaction_status, and get_gas_usage. You can sign and broadcast Solana transactions in two primary ways:
  • Using the React handler (handleSendTransaction) from @turnkey/react-wallet-kit This gives you:
    • modals
    • spinner + chain logo
    • success screen
    • explorer link
    • built-in polling
  • Using low-level functions in @turnkey/core You manually call:
    • solSendTransaction → submit
    • pollTransactionStatus → wait for confirmation
  • Using server-side @turnkey/sdk-server This is the right choice for Node.js backends. It exposes the same methods via the server SDK client.
This page walks you through the React flow with full code examples. For using @turnkey/core directly, see Sending Sponsored Transactions.
Before sponsoring Solana transactions, review Solana Rent Sponsorship. Rent sponsorship is opt-in, disabled by default, and must be enabled in the dashboard first. This is especially important if you sponsor transactions from swap providers or other third-party builders that may create and close accounts.
This example shows how to submit a sponsored Solana transaction, but your application is still responsible for validating transaction contents. If the transaction may create accounts that require rent, ensure Sponsor Solana Rent has been enabled in the dashboard first. Review whether the unsigned transaction creates accounts, closes accounts, or routes rent refunds back to the signer. See Solana Rent Sponsorship for rent setup and refund-path guidance, and Solana transaction construction for sponsored flows for payer-model and account-creation caveats.

Using handleSendTransaction (React)

This handler wraps everything: intent creation, signing, Turnkey submission, polling, modal UX, and final success UI.

Step 1 — Configure the Provider

import { TurnkeyProvider } from "@turnkey/react-wallet-kit";

const turnkeyConfig = {
  apiBaseUrl: "https://api.turnkey.com",
  defaultOrganizationId: process.env.NEXT_PUBLIC_TURNKEY_ORG_ID,
  rpId: window.location.hostname,
  iframeUrl: "https://auth.turnkey.com",
};

export default function App({ children }) {
  return (
    <TurnkeyProvider config={turnkeyConfig}>
      {children}
    </TurnkeyProvider>
  );
}

Step 2 — Use handleSendTransaction for Solana

const { handleSendTransaction, wallets } = useTurnkey();

const walletAccount = wallets
  .flatMap((w) => w.accounts)
  .find((a) => a.addressFormat === "ADDRESS_FORMAT_SOLANA");

if (!walletAccount) {
  throw new Error("No Solana wallet account found");
}

await handleSendTransaction({
  transaction: {
    signWith: walletAccount.address,
    unsignedTransaction: "<base64-serialized-unsigned-solana-tx>",
    caip2: "solana:mainnet",
    sponsor: true,
  },
});
This automatically:
  • Opens the Turnkey modal
  • Shows the chain logo
  • Polls until INCLUDED
  • Displays success page + explorer link

Checking Gas Usage

You can configure gas limits for both sub-orgs and all orgs. We recommend checking sub-org gas usage against the limit on the client side so your application can handle edge cases when approaching or exceeding the gas limit.
const resp = await httpClient?.getGasUsage({});
if (resp?.usageUsd! > resp?.windowLimitUsd!) {
  console.error("Gas usage limit exceeded for sponsored transactions");
  return;
}
For additional references leveraging these endpoints, check out our Swapping Example and Sweeping Example.