{"openapi":"3.2.0","info":{"title":"getTipTokenAccounts","version":"1","description":"Read the token accounts that a USDC, USDT or WSOL transfer must reach to count as an SWQoS tip."},"servers":[{"url":"https://sol.zerocopy.sh","description":"Nearest metro."},{"url":"https://{metro}.sol.zerocopy.sh","description":"Named metro.","variables":{"metro":{"enum":["fra","ams","lon","nyc","lax","tyo"],"default":"fra"}}}],"security":[{"apiKeyHeader":[]},{"apiKeyQuery":[]},{"bearer":[]}],"components":{"securitySchemes":{"apiKeyHeader":{"$ref":"#/x-ext/b08d7c8/components/securitySchemes/apiKeyHeader"},"apiKeyQuery":{"$ref":"#/x-ext/b08d7c8/components/securitySchemes/apiKeyQuery"},"bearer":{"$ref":"#/x-ext/b08d7c8/components/securitySchemes/bearer"}}},"paths":{"/":{"post":{"operationId":"getTipTokenAccounts","summary":"getTipTokenAccounts","description":"Read the token accounts that a USDC, USDT or WSOL transfer must reach to count as an SWQoS tip.","requestBody":{"required":true,"description":"One JSON object using the [shared request conventions](/reference/json-rpc#request). The method takes no params; queries do not use your send rate. The [local agent](/swqos/agent/local-interfaces#http) also serves this method.","content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","method"],"properties":{"jsonrpc":{"$ref":"#/x-ext/b08d7c8/components/schemas/JsonRpcVersion"},"id":{"$ref":"#/x-ext/b08d7c8/components/schemas/JsonRpcId"},"method":{"type":"string","enum":["getTipTokenAccounts"]},"params":{"description":"Ignored when present."}}},"examples":{"Request":{"value":{"jsonrpc":"2.0","id":1,"method":"getTipTokenAccounts"}}}}}},"responses":{"200":{"description":"Returns the token accounts of the live tip accounts for each accepted token.\n\nRefusals with HTTP 200, by `error.data.reason`:\n\n- [`invalid_request`](/reference/errors#invalid_request): invalid JSON-RPC body.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["jsonrpc","result","id"],"properties":{"jsonrpc":{"$ref":"#/x-ext/b08d7c8/components/schemas/JsonRpcVersion"},"result":{"type":"array","description":"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](/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](/swqos/tips#tip-in-tokens).","items":{"type":"object","required":["account","wallet","mint","symbol","decimals"],"properties":{"account":{"type":"string","description":"Base58 token account address. Use it as the destination of a Token Program `Transfer` or `TransferChecked`."},"wallet":{"type":"string","description":"Base58 tip account that owns the token account, one that [`getTipAccounts`](/reference/json-rpc/tip-accounts) returns."},"mint":{"type":"string","description":"Base58 mint address of the token."},"symbol":{"type":"string","enum":["USDC","USDT","WSOL"],"description":"The token's symbol."},"decimals":{"type":"integer","enum":[6,9],"description":"The mint's decimals. Transfer amounts are in base units, so 250,000 is 0.25 USDC."}}}},"id":{"$ref":"#/x-ext/b08d7c8/components/schemas/JsonRpcId"}},"additionalProperties":false},{"$ref":"#/x-ext/b08d7c8/components/schemas/JsonRpcErrorEnvelope"}]},"examples":{"Success":{"summary":"Success","value":{"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}},"Unavailable":{"summary":"Token tips not available for the key","value":{"jsonrpc":"2.0","result":[],"id":1}},"ParseError":{"$ref":"#/x-ext/b08d7c8/components/examples/ParseError"}}}}},"401":{"$ref":"#/x-ext/b08d7c8/components/responses/Unauthorized"},"421":{"$ref":"#/x-ext/b08d7c8/components/responses/MisdirectedRequest"}},"x-codeSamples":[{"lang":"rust","id":"rust","label":"Rust","source":"// Builds on the example project (/reference/json-rpc#example-project).\nuse serde::Deserialize;\nuse swqos_examples::swqos::{Result, call};\n\n#[derive(Deserialize)]\nstruct TipTokenAccount {\n    account: String,\n    symbol: String,\n}\n\n#[tokio::main]\nasync fn main() -> Result<()> {\n    let accounts: Vec<TipTokenAccount> = call(\"getTipTokenAccounts\", None).await?;\n    let usdc = accounts\n        .iter()\n        .find(|entry| entry.symbol == \"USDC\")\n        .ok_or(\"token tips are not available; tip in SOL\")?;\n    println!(\"{}\", usdc.account);\n    Ok(())\n}"},{"lang":"go","id":"go","label":"Go","source":"// Builds on the example project (/reference/json-rpc#example-project).\npackage swqos\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n)\n\nfunc PrintUsdcTipTokenAccount(ctx context.Context) error {\n\taccounts, err := Call[[]struct {\n\t\tAccount string `json:\"account\"`\n\t\tSymbol  string `json:\"symbol\"`\n\t}](ctx, \"getTipTokenAccounts\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, entry := range accounts {\n\t\tif entry.Symbol == \"USDC\" {\n\t\t\tfmt.Println(entry.Account)\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn errors.New(\"token tips are not available; tip in SOL\")\n}"},{"lang":"ts","id":"ts","label":"TypeScript","source":"// Builds on the example project (/reference/json-rpc#example-project).\nimport { call } from './swqos.ts'\n\ntype TipTokenAccount = {\n  account: string\n  wallet: string\n  mint: string\n  symbol: 'USDC' | 'USDT' | 'WSOL'\n  decimals: number\n}\n\nconst accounts = await call<TipTokenAccount[]>('getTipTokenAccounts')\nconst usdc = accounts.find((entry) => entry.symbol === 'USDC')\nif (!usdc) throw new Error('token tips are not available; tip in SOL')\nconsole.log(usdc.account)"}]}}},"x-ext":{"b08d7c8":{"components":{"schemas":{"Rejection":{"type":"object","required":["reason","message","retryable"],"properties":{"reason":{"type":"string","description":"Stable snake_case reason. Match on this; `message` wording can change, and the numeric codes are shared with Solana's RPC.","examples":["missing_tip"]},"message":{"type":"string","description":"What happened and what to change. Wording can change.","examples":["tip too small: the tip transfers add up to 123 lamports, the minimum is 1,000,000; raise the transfer to one of the tip accounts to at least 1,000,000 lamports"]},"retryable":{"type":"boolean","description":"Whether the unchanged request can succeed later. Wait before retrying, and check that the transaction has not expired.","examples":[false]},"docs":{"type":"string","format":"uri","description":"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.","examples":["https://zerocopy.sh/docs/reference/errors#missing_tip"]}},"additionalProperties":true,"description":"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.","examples":[{"reason":"missing_tip","minimum":1000000,"found":123,"message":"tip too small: the tip transfers add up to 123 lamports, the minimum is 1,000,000; raise the transfer to one of the tip accounts to at least 1,000,000 lamports","retryable":false,"docs":"https://zerocopy.sh/docs/reference/errors#missing_tip"}]},"JsonRpcVersion":{"type":"string","enum":["2.0"],"examples":["2.0"]},"JsonRpcError":{"type":"object","required":["code","message","data"],"properties":{"code":{"type":"integer","enum":[-32700,-32600,-32601,-32602,-32603,-32000,-32001,-32002,-32003],"description":"[Status codes](/reference/json-rpc#status-codes) maps reasons and problems to codes. Match on `data.reason`.","examples":[-32602]},"message":{"type":"string","description":"The same sentence as data.message."},"data":{"$ref":"#/x-ext/b08d7c8/components/schemas/Rejection"}},"additionalProperties":false},"JsonRpcId":{"type":["string","number","null"],"description":"Optional request id, echoed exactly in the response. Null when absent or refused before the id could be read.","examples":[1,"request-1",null]},"JsonRpcErrorEnvelope":{"type":"object","required":["jsonrpc","error","id"],"properties":{"jsonrpc":{"$ref":"#/x-ext/b08d7c8/components/schemas/JsonRpcVersion"},"error":{"$ref":"#/x-ext/b08d7c8/components/schemas/JsonRpcError"},"id":{"$ref":"#/x-ext/b08d7c8/components/schemas/JsonRpcId"}},"additionalProperties":false}},"securitySchemes":{"apiKeyHeader":{"type":"apiKey","in":"header","name":"x-api-key","description":"Send the SWQoS API key in this header. See the [authentication reference](/reference/json-rpc#authentication) for compatibility forms and precedence."},"apiKeyQuery":{"type":"apiKey","in":"query","name":"api-key","description":"Compatibility authentication. See the [authentication reference](/reference/json-rpc#authentication) for precedence and the URL logging warning. Prefer x-api-key."},"bearer":{"type":"http","scheme":"bearer","description":"SWQoS API key sent as Authorization: Bearer YOUR_KEY. The prefix `Bearer ` is case-sensitive. Prefer x-api-key. See the [authentication reference](/reference/json-rpc#authentication) for precedence."}},"examples":{"ParseError":{"summary":"Invalid JSON","value":{"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}}},"responses":{"Unauthorized":{"description":"[`unauthorized`](/reference/errors#unauthorized): missing, unknown or revoked API key.","content":{"application/json":{"schema":{"$ref":"#/x-ext/b08d7c8/components/schemas/JsonRpcErrorEnvelope"},"examples":{"unauthorized":{"value":{"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}}}}}},"MisdirectedRequest":{"description":"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":{"text/plain":{"schema":{"type":"string"},"examples":{"UnknownHost":{"value":"This hostname is not served here. Check the endpoint address"}}}}}}}}}}