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

# Send and Track Solana Transactions with Raptor

> Send signed Solana transactions through Raptor, poll their status, and read the amounts a swap actually traded.

After the user signs a swap, send it with `POST /send-transaction`. Raptor submits it straight to block leaders and keeps resending it for up to 30 seconds or until it lands. Then poll `GET /transaction/{signature}` for the result.

You can send any signed transaction this way, not only Raptor swaps.

## Send

```javascript theme={null}
const RAPTOR = "https://raptor.solanatracker.io";

const res = await fetch(`${RAPTOR}/send-transaction`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ transaction: signedTxBase64 }),
});
const { signature } = await res.json();
```

```json Response theme={null}
{
  "signature": "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW",
  "signature_base64": "2E7bSk9JY3Yb1aN0…",
  "success": true
}
```

`success: true` means Raptor accepted the transaction. It doesn't mean it landed. Check the status for that.

## Track

```javascript theme={null}
async function waitForResult(signature) {
  for (let i = 0; i < 30; i++) {
    const tx = await fetch(`${RAPTOR}/transaction/${signature}`).then((r) => r.json());
    if (tx.status !== "pending") return tx;
    await new Promise((r) => setTimeout(r, 1000));
  }
  throw new Error("Timed out waiting for transaction");
}

const tx = await waitForResult(signature);
console.log(tx.status, tx.latency_ms, "ms");
```

| `status` | Meaning |
| - | - |
| `pending` | Sent, not landed yet |
| `confirmed` | Landed at `confirmed` commitment |
| `failed` | Landed, but the transaction returned an error (see `error`) |
| `expired` | Did not land in time. Get a new quote and try again. |

The signature can be base58 or base64. Raptor only tracks transactions sent through `/send-transaction`, and only for a short time. Other signatures return `404`.

## Read the swap result

For Raptor swaps, `events` lists the program's events. `SwapEvent` holds the amounts that were actually traded:

```javascript theme={null}
for (const event of tx.events ?? []) {
  if (event.name === "SwapEvent") {
    console.log(`${event.parsed.amountIn} in → ${event.parsed.amountOut} out`);
  }
}
```

```json Example theme={null}
{
  "signature": "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW",
  "status": "confirmed",
  "slot": 454215402,
  "sent_at": 1791374181491,
  "confirmed_at": 1791374182103,
  "latency_ms": 612,
  "events": [
    {
      "name": "SwapEvent",
      "data": "…",
      "parsed": { "amountIn": 100000000, "amountOut": 11703794 }
    }
  ]
}
```

Event names: `SwapEvent`, `SwapCompleteEvent`, `PlaceOrderEvent`, `FillOrderEvent`, `CancelOrderEvent`, `UpdateOrderEvent`.

## Errors

| Status | Meaning |
| - | - |
| `400` | The transaction couldn't be decoded, for example it isn't base64 or isn't signed |
| `404` | The signature isn't tracked |

```json theme={null}
{ "error": "Transaction not found.", "code": 404 }
```

Full field lists: [Send a signed transaction](https://docs.solanatracker.io/raptor/http/send-a-signed-transaction.md) and [Get transaction status](https://docs.solanatracker.io/raptor/http/get-transaction-status.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.