> ## 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 EVM transactions

> In this guide, we’ll walk through the process of setting up sponsored transactions, with abstractions for transaction construction, broadcast, and gas management, using React.

## SDK Overview

> The SDK primarily abstracts three endpoints: `eth_send_transaction`, `get_send_transaction_status`, and `get_gas_usage`.

You can sign and broadcast transactions in two primary ways:

1. **Using the React handler (`handleSendTransaction`) from `@turnkey/react-wallet-kit`**
   This gives you:
   * modals
   * spinner + chain logo
   * success screen
   * explorer link
   * built-in polling

2. **Using low-level functions in `@turnkey/core`**
   You manually call:
   * `ethSendTransaction` OR `solSendTransaction` → submit
   * `pollTransactionStatus` → wait for inclusion

3. **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).

## Using `handleSendTransaction` (React)

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

### Step 1 — Configure the Provider

```ts 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` inside your UI

```ts theme={"system"}
const { handleSendTransaction, wallets } = useTurnkey();

const walletAccount = wallets[0].accounts[0];

await handleSendTransaction({
  transaction: {
    from: walletAccount.address,
    to: "0xRecipient",
    value: "1000000000000000",
    data: "0x",
    caip2: "eip155:8453",
    sponsor: true,
  },
});
```

OR (Solana):

```ts 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, // Solana address
    unsignedTransaction: "<base64-serialized-unsigned-solana-tx>",
    caip2: "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1", // devnet
    sponsor: true,
    // recentBlockhash: "<recent blockhash>", // optional
  },
});
```

* Full React handler implementation [here](https://github.com/tkhq/sdk/blob/e5a153efa90c325d4f5ecfe65d8d2bff8573c64f/packages/react-wallet-kit/src/providers/client/Provider.tsx#L5536)

This automatically:

* opens Turnkey modal
* shows 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.

You may also want to monitor your all org gas usage regularly to see if you are approaching your gas limit.

```ts theme={"system"}
const resp = await httpClient?.getGasUsage({})
if (resp?.usageUsd! > resp?.windowLimitUsd!) { // you can also configure this to be a threshold
  console.error("Gas usage limit exceeded for sponsored transactions");
  return
}
```

For additional references leveraging these endpoints, check out our [Swapping Example](https://github.com/tkhq/sdk/tree/main/examples/eth-usdc-swap) and [Sweeping Example](https://github.com/tkhq/sdk/tree/main/examples/sweeper)

## EVM paymaster example

You may also leverage our own example for setting up EVM paymaster leveraging the above endpoints. This example shows how to send an erc-20 token on EVM networks using Turnkey's paymaster (gas sponsorship).

Please refer to [with-paymaster](https://github.com/tkhq/sdk/tree/main/examples/with-paymaster) to see how to setup and manage paymaster for your transaction operations.
