{"openapi":"3.2.0","info":{"title":"getTipAccounts","version":"1","description":"Read the live set of accounts a 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":"getTipAccounts","summary":"getTipAccounts","description":"Read the live set of accounts a 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":["getTipAccounts"]},"params":{"description":"Ignored when present."}}},"examples":{"Request":{"value":{"jsonrpc":"2.0","id":1,"method":"getTipAccounts"}}}}}},"responses":{"200":{"description":"Returns the current base58 tip-account addresses for transactions and bundles.\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 returned addresses count as tip recipients; membership can change. Any entry is valid and order does not indicate priority. An empty array means no account is available; submissions return `not_ready` with `waiting_for: tip_vaults`. Do not hard-code the list. Cache it for up to 15 minutes, and fetch it again sooner after that refusal or after a `missing_tip` with a lower `found` than expected. For USDC, USDT and WSOL tips, use [`getTipTokenAccounts`](/reference/json-rpc/tip-token-accounts). See [Tips](/swqos/tips).","items":{"type":"string","description":"Base58 tip account address."}},"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":["TIP_ACCOUNT_1","TIP_ACCOUNT_2"],"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 rand::seq::IndexedRandom;\nuse swqos_examples::swqos::{Result, call};\n\n#[tokio::main]\nasync fn main() -> Result<()> {\n    let accounts: Vec<String> = call(\"getTipAccounts\", None).await?;\n    let tip_account = accounts\n        .choose(&mut rand::rng())\n        .ok_or(\"no tip account is live; retry shortly\")?;\n    println!(\"{tip_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\t\"math/rand/v2\"\n)\n\nfunc PrintTipAccount(ctx context.Context) error {\n\taccounts, err := Call[[]string](ctx, \"getTipAccounts\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(accounts) == 0 {\n\t\treturn errors.New(\"no tip account is live; retry shortly\")\n\t}\n\ttipAccount := accounts[rand.IntN(len(accounts))]\n\tfmt.Println(tipAccount)\n\treturn nil\n}"},{"lang":"ts","id":"ts","label":"TypeScript","source":"// Builds on the example project (/reference/json-rpc#example-project).\nimport { call } from './swqos.ts'\n\nconst accounts = await call<string[]>('getTipAccounts')\nconst tipAccount = accounts[Math.floor(Math.random() * accounts.length)]\nif (!tipAccount) throw new Error('no tip account is live; retry shortly')\nconsole.log(tipAccount)"}]}}},"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"}}}}}}}}}}