> ## Documentation Index
> Fetch the complete documentation index at: https://docs.turnkey.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sending sponsored Solana transactions

> Send sponsored Solana transactions using Turnkey's solSendTransaction API

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](/company-wallets/code-examples/sending-sponsored-transactions).

<Note>
  Before sponsoring Solana transactions, review
  [Solana Rent Sponsorship](/networks/solana-rent-refunds). 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.
</Note>

<Note>
  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](/networks/solana-rent-refunds) for rent setup and
  refund-path guidance, and [Solana transaction construction for sponsored
  flows](/networks/solana-transaction-construction) for payer-model and
  account-creation caveats.
</Note>

## Using `handleSendTransaction` (React)

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

### Step 1 — configure the provider

```tsx theme={"system"}
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

```tsx theme={"system"}
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.

```tsx theme={"system"}
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](/cookbook/jupiter) and [Sweeping Example](/cookbook/sweeping).
