# getTipTokenAccounts

Read the token accounts that a USDC, USDT or WSOL transfer must reach to count as an SWQoS tip.

Source: https://zerocopy.sh/docs/reference/json-rpc/tip-token-accounts

`POST https://sol.zerocopy.sh/`

Authentication: API key, one of: `x-api-key` header, `api-key` query, `Authorization: Bearer` header.

## Request body (`application/json`)

One JSON object using the [shared request conventions](/docs/reference/json-rpc#request). The method takes no params; queries do not use your send rate. The [local agent](/docs/swqos/agent/local-interfaces#http) also serves this method.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `jsonrpc` | `"2.0"` | yes |  |
| `id` | string or number or null | no | Optional request id, echoed exactly in the response. Null when absent or refused before the id could be read. |
| `method` | `"getTipTokenAccounts"` | yes |  |
| `params` | any | no | Ignored when present. |

```json title="Request"
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getTipTokenAccounts"
}
```

## Responses

### 200

Returns the token accounts of the live tip accounts for each accepted token.

Refusals with HTTP 200, by `error.data.reason`:

- [`invalid_request`](/docs/reference/errors#invalid_request): invalid JSON-RPC body.

Content type: `application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `jsonrpc` | `"2.0"` | yes |  |
| `result` | array of object | yes | Only listed accounts count as token tip recipients; membership can change. Entries are ordered by tip account, then USDC, USDT and WSOL. Any entry for your token is valid and order does not indicate priority. A tip account can lack an entry for a token. An empty array means token tips are not available for your key; tip a [tip account](/docs/reference/json-rpc/tip-accounts) in SOL. Cache the list for up to 15 minutes, and fetch it again sooner after a `missing_tip` with a lower `found` than expected. See [Tips](/docs/swqos/tips#tip-in-tokens). |
| `result[].account` | string | yes | Base58 token account address. Use it as the destination of a Token Program `Transfer` or `TransferChecked`. |
| `result[].wallet` | string | yes | Base58 tip account that owns the token account, one that [`getTipAccounts`](/docs/reference/json-rpc/tip-accounts) returns. |
| `result[].mint` | string | yes | Base58 mint address of the token. |
| `result[].symbol` | `"USDC"` or `"USDT"` or `"WSOL"` | yes | The token's symbol. |
| `result[].decimals` | `6` or `9` | yes | The mint's decimals. Transfer amounts are in base units, so 250,000 is 0.25 USDC. |
| `id` | string or number or null | yes | Optional request id, echoed exactly in the response. Null when absent or refused before the id could be read. |
| `jsonrpc` | `"2.0"` | yes |  |
| `error` | object | yes |  |
| `error.code` | `-32700` or `-32600` or `-32601` or `-32602` or `-32603` or `-32000` or `-32001` or `-32002` or `-32003` | yes | [Status codes](/docs/reference/json-rpc#status-codes) maps reasons and problems to codes. Match on `data.reason`. |
| `error.message` | string | yes | The same sentence as data.message. |
| `error.data` | object | yes | Reason-specific fields are included alongside these members, such as minimum, found, token_value, declared, available, unpaid_lamports, index, per_second and retry_after_ms. Failed preflight also includes Solana simulation fields such as err, logs and unitsConsumed. |
| `error.data.reason` | string | yes | Stable snake_case reason. Match on this; `message` wording can change, and the numeric codes are shared with Solana's RPC. |
| `error.data.message` | string | yes | What happened and what to change. Wording can change. |
| `error.data.retryable` | boolean | yes | Whether the unchanged request can succeed later. Wait before retrying, and check that the transaction has not expired. |
| `error.data.docs` | string (uri) | no | Optional error documentation URL followed by the reason anchor. Hosted responses include it only on sol.zerocopy.sh and its valid DNS subdomains; partner domains, IP addresses, localhost and unnamed connections omit it. Local agent errors keep documentation links. |
| `id` | string or number or null | yes | Optional request id, echoed exactly in the response. Null when absent or refused before the id could be read. |

```json title="Success"
{
  "jsonrpc": "2.0",
  "result": [
    {
      "account": "TOKEN_ACCOUNT_1",
      "wallet": "TIP_ACCOUNT_1",
      "mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "symbol": "USDC",
      "decimals": 6
    },
    {
      "account": "TOKEN_ACCOUNT_2",
      "wallet": "TIP_ACCOUNT_1",
      "mint": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
      "symbol": "USDT",
      "decimals": 6
    },
    {
      "account": "TOKEN_ACCOUNT_3",
      "wallet": "TIP_ACCOUNT_1",
      "mint": "So11111111111111111111111111111111111111112",
      "symbol": "WSOL",
      "decimals": 9
    }
  ],
  "id": 1
}
```

```json title="Token tips not available for the key"
{
  "jsonrpc": "2.0",
  "result": [],
  "id": 1
}
```

```json title="Invalid JSON"
{
  "jsonrpc": "2.0",
  "error": {
    "code": -32700,
    "message": "the body is not valid JSON",
    "data": {
      "reason": "invalid_request",
      "problem": "parse_error",
      "message": "the body is not valid JSON",
      "retryable": false,
      "docs": "https://zerocopy.sh/docs/reference/errors#invalid_request"
    }
  },
  "id": null
}
```

### 401

[`unauthorized`](/docs/reference/errors#unauthorized): missing, unknown or revoked API key.

Content type: `application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `jsonrpc` | `"2.0"` | yes |  |
| `error` | object | yes |  |
| `error.code` | `-32700` or `-32600` or `-32601` or `-32602` or `-32603` or `-32000` or `-32001` or `-32002` or `-32003` | yes | [Status codes](/docs/reference/json-rpc#status-codes) maps reasons and problems to codes. Match on `data.reason`. |
| `error.message` | string | yes | The same sentence as data.message. |
| `error.data` | object | yes | Reason-specific fields are included alongside these members, such as minimum, found, token_value, declared, available, unpaid_lamports, index, per_second and retry_after_ms. Failed preflight also includes Solana simulation fields such as err, logs and unitsConsumed. |
| `error.data.reason` | string | yes | Stable snake_case reason. Match on this; `message` wording can change, and the numeric codes are shared with Solana's RPC. |
| `error.data.message` | string | yes | What happened and what to change. Wording can change. |
| `error.data.retryable` | boolean | yes | Whether the unchanged request can succeed later. Wait before retrying, and check that the transaction has not expired. |
| `error.data.docs` | string (uri) | no | Optional error documentation URL followed by the reason anchor. Hosted responses include it only on sol.zerocopy.sh and its valid DNS subdomains; partner domains, IP addresses, localhost and unnamed connections omit it. Local agent errors keep documentation links. |
| `id` | string or number or null | yes | Optional request id, echoed exactly in the response. Null when absent or refused before the id could be read. |

```json title="unauthorized"
{
  "jsonrpc": "2.0",
  "error": {
    "code": -32000,
    "message": "API key missing or not recognized; pass it as the api-key query parameter, an x-api-key header or Authorization: Bearer",
    "data": {
      "reason": "unauthorized",
      "message": "API key missing or not recognized; pass it as the api-key query parameter, an x-api-key header or Authorization: Bearer",
      "retryable": false,
      "docs": "https://zerocopy.sh/docs/reference/errors#unauthorized"
    }
  },
  "id": null
}
```

### 421

Unknown or removed TLS SNI or HTTP Host/:authority. Returns plain text without a JSON-RPC envelope or rejection object. The current hostname policy also applies to existing connections and resumed TLS sessions.

Content type: `text/plain`

```text title="UnknownHost"
This hostname is not served here. Check the endpoint address
```

## Code samples

```rust title="Rust"
// Builds on the example project (/reference/json-rpc#example-project).
use serde::Deserialize;
use swqos_examples::swqos::{Result, call};

#[derive(Deserialize)]
struct TipTokenAccount {
    account: String,
    symbol: String,
}

#[tokio::main]
async fn main() -> Result<()> {
    let accounts: Vec<TipTokenAccount> = call("getTipTokenAccounts", None).await?;
    let usdc = accounts
        .iter()
        .find(|entry| entry.symbol == "USDC")
        .ok_or("token tips are not available; tip in SOL")?;
    println!("{}", usdc.account);
    Ok(())
}
```

```go title="Go"
// Builds on the example project (/reference/json-rpc#example-project).
package swqos

import (
	"context"
	"errors"
	"fmt"
)

func PrintUsdcTipTokenAccount(ctx context.Context) error {
	accounts, err := Call[[]struct {
		Account string `json:"account"`
		Symbol  string `json:"symbol"`
	}](ctx, "getTipTokenAccounts")
	if err != nil {
		return err
	}
	for _, entry := range accounts {
		if entry.Symbol == "USDC" {
			fmt.Println(entry.Account)
			return nil
		}
	}
	return errors.New("token tips are not available; tip in SOL")
}
```

```ts title="TypeScript"
// Builds on the example project (/reference/json-rpc#example-project).
import { call } from './swqos.ts'

type TipTokenAccount = {
  account: string
  wallet: string
  mint: string
  symbol: 'USDC' | 'USDT' | 'WSOL'
  decimals: number
}

const accounts = await call<TipTokenAccount[]>('getTipTokenAccounts')
const usdc = accounts.find((entry) => entry.symbol === 'USDC')
if (!usdc) throw new Error('token tips are not available; tip in SOL')
console.log(usdc.account)
```
