getTipTokenAccounts
Read the token accounts that a USDC, USDT or WSOL transfer must reach to count as an SWQoS tip.
x-api-key<token>Send the SWQoS API key in this header. See the authentication reference for compatibility forms and precedence.
One JSON object using the shared request conventions. The method takes no params; queries do not use your send rate. The local agent also serves this method.
application/json- body
jsonrpc*"2.0""2.0"id?||Optional request id, echoed exactly in the response. Null when absent or refused before the id could be read.
method*"getTipTokenAccounts""getTipTokenAccounts"params?unknownIgnored when present.
Returns the token accounts of the live tip accounts for each accepted token.
Refusals with HTTP 200, by error.data.reason:
invalid_request: invalid JSON-RPC body.
application/json- response
jsonrpc*"2.0""2.0"result*array<>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 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.
id*||Optional request id, echoed exactly in the response. Null when absent or refused before the id could be read.
// 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(())
}{
"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
}