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

# Overview

> Token launch, fee management, and SOL/SPL transfers — batched and packed into the fewest possible transactions

The `/utils/sol/*` endpoints live on the **History API** (`https://api.raze.bot`)
alongside `/api/sol/*` reads. They cover the non-swap workflows previously hosted
on the legacy `public.raze.sh` service (and briefly on `router.raze.bot`): token
launches, fee management, SOL/SPL transfers, distribution, and consolidation.

Swap / quote / buy / sell / instructions remain on `https://router.raze.bot`.

All endpoints require an API key (same scheme as other History routes —
`X-API-Key`, `Authorization: Bearer sk_...`, or `?apiKey=sk_...`).

## Endpoints

<CardGroup cols={2}>
  <Card title="Transfer" href="/api-reference/history/utils/transfer" icon="paper-plane">
    Batch SOL + SPL + Token-2022 transfers. One request → as few txs as fit.
  </Card>

  <Card title="Burn" href="/api-reference/history/utils/burn" icon="fire">
    Batch burn SPL or Token-2022 tokens across many wallets and mints.
  </Card>

  <Card title="Distribute" href="/api-reference/history/utils/distribute" icon="share-nodes">
    One→many SOL distribute.
  </Card>

  <Card title="Consolidate" href="/api-reference/history/utils/consolidate" icon="arrows-to-circle">
    Many→one SOL sweep, percentage-based.
  </Card>

  <Card title="Launch" href="/api-reference/history/utils/launch" icon="rocket">
    Token launch (pumpfun / bonk / meteora\_dbc / meteora\_cpamm).
  </Card>

  <Card title="Fees: Claim" href="/api-reference/history/utils/fees/claim" icon="hand-holding-dollar">
    Claim pump.fun creator fees or Meteora partner/creator fees.
  </Card>

  <Card title="Fees: Config" href="/api-reference/history/utils/fees/config" icon="sliders">
    Manage pump.fun creator-fee sharing config.
  </Card>
</CardGroup>

## Batch semantics

`transfer` and `burn` are the two endpoints that accept a true batch (`items[]`).
The server groups items by their signer (sender for `transfer`, wallet for `burn`)
and bin-packs each group into as few **versioned transactions** as the 1232-byte
wire limit allows. Items that share a signer share a tx; items with different
signers go to different txs.

The response includes a `batches[]` array describing the packing — `batches[i]`
describes `transactions[i]`, telling you which input item indices ended up in
that tx and how many non-fee instructions it contains. That lets you do
partial-retry logic when one tx in a batch lands and another doesn't.

```jsonc theme={null}
// Request: 4 items, two senders
{
  "items": [
    { "sender": "A...", "receiver": "X...", "amount": 0.1 },
    { "sender": "A...", "receiver": "Y...", "tokenAddress": "USDC...", "amount": 5 },
    { "sender": "B...", "receiver": "Z...", "amount": 0.2 },
    { "sender": "A...", "receiver": "W...", "amount": 0.05 }
  ]
}

// Response: 2 txs (one per signer)
{
  "success": true,
  "transactions": ["base64...", "base64..."],
  "batches": [
    { "signers": ["A..."], "itemIndices": [0, 1, 3], "instructionCount": 3 },
    { "signers": ["B..."], "itemIndices": [2],       "instructionCount": 1 }
  ]
}
```

## Common request flags

| Flag                      | Default           | What it does                                                                                                                                                                                                                                                                                                                                                             |
| ------------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `encoding`                | `base64`          | Output transaction encoding. `base58` supported for legacy callers.                                                                                                                                                                                                                                                                                                      |
| `simulate`                | `false`           | When true, every built tx is run through `simulateTransaction` and the result is attached as `simulations[i]`.                                                                                                                                                                                                                                                           |
| `tipWallet`               | Raze relay wallet | Custom tip recipient.                                                                                                                                                                                                                                                                                                                                                    |
| `tipLamports`             | —                 | Flat tip transfer (floored at 100000 lamports). Omit for no tip — utils transactions carry no implicit service fee.                                                                                                                                                                                                                                                      |
| `feeTipLamports`          | —                 | Legacy alias for `tipLamports` (tips the Raze relay wallet). `tipLamports` wins when both are set.                                                                                                                                                                                                                                                                       |
| `feeWallet` + `feeBps`    | —                 | Custom percentage fee, same contract as the swap endpoints: `feeBps` basis points of the SOL volume the endpoint moves, sent to `feeWallet` (both required). Bases: transfer = each SOL item, consolidate = SOL swept per tx, distribute = each recipient's amount, launch = each buyer's quote amount. Endpoints with no SOL volume (burn, agent, fees) charge nothing. |
| `transactionsFeeLamports` | —                 | When set, compute-budget instructions are prepended to every output tx.                                                                                                                                                                                                                                                                                                  |
| `maxInstructionsPerTx`    | auto              | Optional cap on non-fee instructions per tx. Default fits the 1232-byte budget.                                                                                                                                                                                                                                                                                          |

## Common response envelope

```ts theme={null}
{
  success: boolean,
  transactions?: string[],          // serialized partially-signed v0 txs
  batches?: BatchInfo[],            // per-tx packing metadata (transfer/burn)
  mint?: string,                    // launch only
  platform?: string,                // launch + fees/claim only
  status?: object,                  // fees/config status reads
  simulations?: object[],           // present when simulate: true
  error?: string,                   // non-fatal partial-failure summary
}
```

## Token program autodetection

Anywhere a `tokenAddress` (mint) appears, the server batch-fetches the mint
account in one `getMultipleAccounts` call and detects whether the mint is owned
by the SPL Token program or Token-2022. The right program ID is used for
ATA derivation and `transfer_checked` / `burn_checked` instruction building.
Callers don't pass a `tokenProgram` flag.

Token-2022 mints with the **transfer-fee extension** are not yet supported and
will fail on-chain. Open an issue if you hit one and we'll add
`transfer_checked_with_fee`.

## Migration from `public.raze.sh` / `router.raze.bot`

| Legacy                                            | Current                                           |
| ------------------------------------------------- | ------------------------------------------------- |
| `POST https://public.raze.sh/api/sol/transfer`    | `POST https://api.raze.bot/utils/sol/transfer`    |
| `POST https://public.raze.sh/api/sol/burn`        | `POST https://api.raze.bot/utils/sol/burn`        |
| `POST https://public.raze.sh/api/sol/distribute`  | `POST https://api.raze.bot/utils/sol/distribute`  |
| `POST https://public.raze.sh/api/sol/consolidate` | `POST https://api.raze.bot/utils/sol/consolidate` |
| `POST https://public.raze.sh/api/sol/create`      | `POST https://api.raze.bot/utils/sol/launch`      |
| `POST https://public.raze.sh/api/sol/fee-claim`   | `POST https://api.raze.bot/utils/sol/fees/claim`  |
| `POST https://public.raze.sh/api/sol/fee-config`  | `POST https://api.raze.bot/utils/sol/fees/config` |
| `POST https://router.raze.bot/utils/sol/*`        | `POST https://api.raze.bot/utils/sol/*`           |

The legacy `GET /api/metadata/*`, `GET /api/image/*`, and `POST /api/upload`
endpoints have no public replacement — read Metaplex / Token-2022 metadata via
Solana RPC, serve images through a CDN, and pin to IPFS via Pinata directly.

The new endpoints **require an API key** (the legacy service was open). Default
output encoding is `base64` (legacy was `base58`); pass `encoding: "base58"`
for byte-for-byte compatibility.
