xxyy-trade
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseXXYY Trade
XXYY 交易功能
On-chain token trading and data queries on Solana, Ethereum, BSC, and Base via XXYY Open API.
通过XXYY Open API在Solana、Ethereum、BSC和Base链上实现链上token交易与数据查询。
Prerequisites
前置条件
Set environment variables before use:
- (required) -- Your XXYY Open API Key (format:
XXYY_API_KEY). How to get one: visit https://xxyy.io, register and log in, click the 9-dot grid icon in the top toolbar to open the API Key management page, then generate a new API Key.xxyy_ak_xxxx - (optional) -- API base URL, defaults to
XXYY_API_BASE_URLhttps://www.xxyy.io
使用前需设置环境变量:
- (必填)——你的XXYY Open API密钥(格式:
XXYY_API_KEY)。获取方式:访问https://xxyy.io,注册并登录,点击顶部工具栏的九宫格图标打开API密钥管理页面,然后生成新的API密钥。xxyy_ak_xxxx - (可选)——API基础地址,默认值为
XXYY_API_BASE_URLhttps://www.xxyy.io
Authentication
身份验证
All requests require header:
Authorization: Bearer $XXYY_API_KEY所有请求都需要携带请求头:
Authorization: Bearer $XXYY_API_KEYAPI Reference
API 参考
Buy Token
购买Token
POST ${XXYY_API_BASE_URL:-https://www.xxyy.io}/api/trade/open/api/swapjson
{
"chain": "sol",
"walletAddress": "<user_wallet>",
"tokenAddress": "<token_contract>",
"isBuy": true,
"amount": 0.1,
"tip": 0.001,
"slippage": 20
}POST ${XXYY_API_BASE_URL:-https://www.xxyy.io}/api/trade/open/api/swapjson
{
"chain": "sol",
"walletAddress": "<user_wallet>",
"tokenAddress": "<token_contract>",
"isBuy": true,
"amount": 0.1,
"tip": 0.001,
"slippage": 20
}Buy Parameters
购买参数
| Param | Required | Type | Valid values | Description |
|---|---|---|---|---|
| YES | string | | Only these 4 values accepted |
| YES | string | SOL: Base58 32-44 chars; EVM: 0x+40hex | Wallet address on XXYY platform, must match chain |
| YES | string | Valid contract address | Token contract address to buy |
| YES | boolean | | Must be true for buy |
| YES | number | > 0 | Amount in native currency (SOL/ETH/BNB) |
| YES | number | SOL: 0.001-0.1 (unit: SOL); EVM: 0.1-100 (unit: Gwei) | Priority fee for all chains. If not provided, falls back to priorityFee |
| NO | number | 0-100 | Slippage tolerance %, default 20 |
| NO | number | 1 or 2 | 1=anti-sandwich (default), 2=fast mode |
| NO | number | >= 0 | Solana chain only. Extra priority fee in addition to tip |
| 参数 | 是否必填 | 类型 | 有效值 | 描述 |
|---|---|---|---|---|
| 是 | string | | 仅接受这4个值 |
| 是 | string | SOL: Base58格式32-44字符;EVM: 0x开头+40位十六进制字符 | XXYY平台上的钱包地址,必须与所选链匹配 |
| 是 | string | 有效的合约地址 | 要购买的Token合约地址 |
| 是 | boolean | | 购买操作必须设为true |
| 是 | number | > 0 | 原生货币(SOL/ETH/BNB)的数量 |
| 是 | number | SOL: 0.001-0.1(单位:SOL);EVM: 0.1-100(单位:Gwei) | 所有链的优先手续费。若未提供,将回退使用priorityFee |
| 否 | number | 0-100 | 滑点容忍百分比,默认20 |
| 否 | number | 1或2 | 1=防三明治攻击(默认),2=快速模式 |
| 否 | number | >= 0 | 仅Solana链有效。在tip之外额外支付的优先手续费 |
Sell Token
出售Token
POST ${XXYY_API_BASE_URL:-https://www.xxyy.io}/api/trade/open/api/swapjson
{
"chain": "sol",
"walletAddress": "<user_wallet>",
"tokenAddress": "<token_contract>",
"isBuy": false,
"amount": 50,
"tip": 0.001
}POST ${XXYY_API_BASE_URL:-https://www.xxyy.io}/api/trade/open/api/swapjson
{
"chain": "sol",
"walletAddress": "<user_wallet>",
"tokenAddress": "<token_contract>",
"isBuy": false,
"amount": 50,
"tip": 0.001
}Sell Parameters
出售参数
| Param | Required | Type | Valid values | Description |
|---|---|---|---|---|
| YES | string | | Only these 4 values accepted |
| YES | string | SOL: Base58 32-44 chars; EVM: 0x+40hex | Wallet address on XXYY platform, must match chain |
| YES | string | Valid contract address | Token contract address to sell |
| YES | boolean | | Must be false for sell |
| YES | number | 1-100 | Sell percentage. Example: 50 = sell 50% of holdings |
| YES | number | SOL: 0.001-0.1 (unit: SOL); EVM: 0.1-100 (unit: Gwei) | Priority fee for all chains. If not provided, falls back to priorityFee |
| NO | number | 0-100 | Slippage tolerance %, default 20 |
| NO | number | 1 or 2 | 1=anti-sandwich (default), 2=fast mode |
| NO | number | >= 0 | Solana chain only. Extra priority fee in addition to tip |
| 参数 | 是否必填 | 类型 | 有效值 | 描述 |
|---|---|---|---|---|
| 是 | string | | 仅接受这4个值 |
| 是 | string | SOL: Base58格式32-44字符;EVM: 0x开头+40位十六进制字符 | XXYY平台上的钱包地址,必须与所选链匹配 |
| 是 | string | 有效的合约地址 | 要出售的Token合约地址 |
| 是 | boolean | | 出售操作必须设为false |
| 是 | number | 1-100 | 出售持仓的百分比。示例:50 = 出售50%的持仓 |
| 是 | number | SOL: 0.001-0.1(单位:SOL);EVM: 0.1-100(单位:Gwei) | 所有链的优先手续费。若未提供,将回退使用priorityFee |
| 否 | number | 0-100 | 滑点容忍百分比,默认20 |
| 否 | number | 1或2 | 1=防三明治攻击(默认),2=快速模式 |
| 否 | number | >= 0 | 仅Solana链有效。在tip之外额外支付的优先手续费 |
tip / priorityFee Rules
tip / priorityFee 规则
- (required) -- Universal priority fee for ALL chains. EVM chains (eth/bsc/base) use tip as the priority fee. If tip is not provided, the API falls back to priorityFee.
tip- SOL chain: unit is SOL (1 = 1 SOL, very expensive). Recommended range: 0.001 - 0.1
- EVM chains (eth/bsc/base): unit is Gwei. Recommended range: 0.1 - 100
- (optional) -- Only effective on Solana chain. Solana supports both tip and priorityFee simultaneously.
priorityFee
- (必填)——所有链通用的优先手续费。EVM链(eth/bsc/base)将tip作为优先手续费。若未提供tip,API将回退使用priorityFee。
tip- SOL链:单位为SOL(1 = 1 SOL,费用极高)。推荐范围:0.001 - 0.1
- EVM链(eth/bsc/base):单位为Gwei。推荐范围:0.1 - 100
- (可选)——仅对Solana链有效。Solana支持同时使用tip和priorityFee。
priorityFee
Query Trade
查询交易记录
GET ${XXYY_API_BASE_URL:-https://www.xxyy.io}/api/trade/open/api/trade?txId=<tx_id>Response fields: txId, status (pending/success/failed), statusDesc, chain, tokenAddress, walletAddress, isBuy, baseAmount, quoteAmount
GET ${XXYY_API_BASE_URL:-https://www.xxyy.io}/api/trade/open/api/trade?txId=<tx_id>响应字段:txId, status(pending/success/failed), statusDesc, chain, tokenAddress, walletAddress, isBuy, baseAmount, quoteAmount
Ping
心跳检测(Ping)
GET ${XXYY_API_BASE_URL:-https://www.xxyy.io}/api/trade/open/api/pingReturns "pong" if API key is valid.
GET ${XXYY_API_BASE_URL:-https://www.xxyy.io}/api/trade/open/api/ping如果API密钥有效,将返回"pong"。
Feed (Scan Tokens)
Feed(Token扫描)
POST ${XXYY_API_BASE_URL:-https://www.xxyy.io}/api/trade/open/api/feed/{type}?chain={chain}Retrieve Meme token lists: newly launched, almost graduated, or graduated.
POST ${XXYY_API_BASE_URL:-https://www.xxyy.io}/api/trade/open/api/feed/{type}?chain={chain}获取Meme Token列表:新上线、即将毕业、已毕业。
Path & Query Parameters
路径与查询参数
| Param | Required | Type | Valid values | Description |
|---|---|---|---|---|
| YES | path string | | NEW = newly launched, ALMOST = almost graduated, COMPLETED = graduated |
| NO | query string | | Only these 2 chains supported. Default |
| 参数 | 是否必填 | 类型 | 有效值 | 描述 |
|---|---|---|---|---|
| 是 | 路径字符串 | | NEW = 新上线,ALMOST = 即将毕业,COMPLETED = 已毕业 |
| 否 | 查询字符串 | | 仅支持这2条链。默认 |
Body (Filter Parameters)
请求体(过滤参数)
All filters are optional. Range parameters use comma-separated string format . Leave one side empty to set only min or max (e.g. = min 100, = max 50).
"min,max""100,"",50"| Param | Type | Description | Example |
|---|---|---|---|
| string[] | DEX platform filter | See DEX Values by Chain below |
| string[] | Quote token filter | See quoteTokens Values by Chain below |
| string[] | Social media link filter | |
| string[] | Token name/symbol keyword match | |
| string[] | Ignore keywords | |
| string | Market cap range (USD) | |
| string | Liquidity range (USD) | |
| string | Trading volume range (USD) | |
| string | Holder count range | |
| string | Creation time range (minutes from now) | |
| string | Trade count range | |
| string | Buy count range | |
| string | Sell count range | |
| string | Dev buy amount range (native token) | |
| string | Dev sell amount range (native token) | |
| string | Dev holding % range | |
| string | Top10 holding % range | |
| string | Insider holding % range | |
| string | Bundle holding % range | |
| string | New wallet holding % range | |
| string | Graduation progress % range (NEW/ALMOST only) | |
| string | Sniper count range | |
| string | Twitter rename count range | |
| string | Watched wallet buy count range | |
| string | KOL buy count range | |
| int | DexScreener paid, | |
| int | At least one social link, | |
| int | Currently live streaming, | |
所有过滤参数均为可选。范围参数使用逗号分隔的字符串格式。留空一侧可仅设置最小值或最大值(例如: = 最小值100, = 最大值50)。
"min,max""100,"",50"| 参数 | 类型 | 描述 | 示例 |
|---|---|---|---|
| string[] | DEX平台过滤 | 见下方「按链划分的DEX值」 |
| string[] | 报价Token过滤 | 见下方「按链划分的quoteTokens值」 |
| string[] | 社交媒体链接过滤 | |
| string[] | Token名称/符号关键词匹配 | |
| string[] | 忽略关键词 | |
| string | 市值范围(美元) | |
| string | 流动性范围(美元) | |
| string | 交易量范围(美元) | |
| string | 持仓者数量范围 | |
| string | 创建时间范围(距现在的分钟数) | |
| string | 交易次数范围 | |
| string | 买入次数范围 | |
| string | 卖出次数范围 | |
| string | 开发者买入数量范围(原生Token) | |
| string | 开发者卖出数量范围(原生Token) | |
| string | 开发者持仓百分比范围 | |
| string | 前10持仓者百分比范围 | |
| string | 内部人士持仓百分比范围 | |
| string | 捆绑持仓者百分比范围 | |
| string | 新钱包持仓百分比范围 | |
| string | 毕业进度百分比范围(仅NEW/ALMOST类型) | |
| string | 狙击者数量范围 | |
| string | Twitter改名次数范围 | |
| string | 关注钱包买入次数范围 | |
| string | KOL买入次数范围 | |
| int | DexScreener付费推广, | |
| int | 至少有一个社交媒体链接, | |
| int | 当前正在直播, | |
DEX Values by Chain
按链划分的DEX值
- SOL: ,
pump,pumpmayhem,bonk,heaven,believe,daosfun,launchlab,mdbc,jupstudio,mdbcbags,trends,moonshotn,boop,moontime - BSC: ,
four,four_agent,bnonlyflap
- SOL: ,
pump,pumpmayhem,bonk,heaven,believe,daosfun,launchlab,mdbc,jupstudio,mdbcbags,trends,moonshotn,boop,moontime - BSC: ,
four,four_agent,bnonlyflap
quoteTokens Values by Chain
按链划分的quoteTokens值
- SOL: ,
sol,usdcusd1 - BSC: ,
bnb,usdt,usdc,usd1,asteru
- SOL: ,
sol,usdcusd1 - BSC: ,
bnb,usdt,usdc,usd1,asteru
Feed Response
Feed响应示例
json
{
"code": 200,
"msg": "success",
"data": {
"items": [
{
"tokenAddress": "...",
"symbol": "TOKEN",
"name": "Token Name",
"createTime": 1773140232851,
"dexName": "PUMPFUN",
"launchPlatform": { "name": "PUMPFUN", "progress": "12.89", "completed": false },
"holders": 3,
"priceUSD": 0.000003046,
"marketCapUSD": 3046.80,
"devHoldPercent": 12.48,
"hasLink": false,
"snipers": 0,
"quoteToken": "sol"
}
]
},
"success": true
}Key response fields: , , , , , (name/progress/completed), , , , , , , , , , , , ,
tokenAddresssymbolnamecreateTimedexNamelaunchPlatformholderspriceUSDmarketCapUSDdevHoldPercenthasLinksnipersvolumetradeCountbuyCountsellCounttopHolderPercentinsiderHpbundleHpjson
{
"code": 200,
"msg": "success",
"data": {
"items": [
{
"tokenAddress": "...",
"symbol": "TOKEN",
"name": "Token Name",
"createTime": 1773140232851,
"dexName": "PUMPFUN",
"launchPlatform": { "name": "PUMPFUN", "progress": "12.89", "completed": false },
"holders": 3,
"priceUSD": 0.000003046,
"marketCapUSD": 3046.80,
"devHoldPercent": 12.48,
"hasLink": false,
"snipers": 0,
"quoteToken": "sol"
}
]
},
"success": true
}响应核心字段:, , , , , (name/progress/completed), , , , , , , , , , , , ,
tokenAddresssymbolnamecreateTimedexNamelaunchPlatformholderspriceUSDmarketCapUSDdevHoldPercenthasLinksnipersvolumetradeCountbuyCountsellCounttopHolderPercentinsiderHpbundleHpToken Query
Token查询
GET ${XXYY_API_BASE_URL:-https://www.xxyy.io}/api/trade/open/api/query?ca={contract_address}&chain={chain}Query token details: price, security checks, tax rates, holder distribution, etc.
GET ${XXYY_API_BASE_URL:-https://www.xxyy.io}/api/trade/open/api/query?ca={contract_address}&chain={chain}查询Token详情:价格、安全检测、税率、持仓者分布等。
Token Query Parameters
Token查询参数
| Param | Required | Type | Valid values | Description |
|---|---|---|---|---|
| YES | string | Contract address | Token contract address |
| NO | string | | Default |
| 参数 | 是否必填 | 类型 | 有效值 | 描述 |
|---|---|---|---|---|
| 是 | string | 合约地址 | Token合约地址 |
| 否 | string | | 默认 |
Token Query Response
Token查询响应示例
json
{
"code": 200,
"msg": "success",
"data": {
"chainId": "bsc",
"tokenAddress": "0x...",
"baseSymbol": "TOKEN",
"tradeInfo": {
"marketCapUsd": 15464629.87,
"price": 0.01546,
"holder": 7596,
"hourTradeNum": 20611,
"hourTradeVolume": 2564705.05
},
"pairInfo": {
"pairAddress": "0x...",
"pair": "TOKEN - WBNB",
"liquidateUsd": 581750.57,
"createTime": 1772182240000
},
"securityInfo": {
"honeyPot": false,
"openSource": true,
"noOwner": true,
"locked": true
},
"taxInfo": { "buy": "0", "sell": "0" },
"linkInfo": { "tg": "", "x": "", "web": "" },
"dev": { "address": "0x...", "pct": 0.0 },
"topHolderPct": 25.14,
"topHolderList": [
{ "address": "0x...", "balance": 98665702.34, "pct": 9.86 }
]
},
"success": true
}Response groups:
- tradeInfo: marketCapUsd, price, holder, hourTradeNum, hourTradeVolume
- pairInfo: pairAddress, pair, liquidateUsd, createTime
- securityInfo: honeyPot, openSource, noOwner, locked
- taxInfo: buy, sell (percentage strings)
- dev: address, pct
- topHolderPct and topHolderList: top 10 holder distribution
json
{
"code": 200,
"msg": "success",
"data": {
"chainId": "bsc",
"tokenAddress": "0x...",
"baseSymbol": "TOKEN",
"tradeInfo": {
"marketCapUsd": 15464629.87,
"price": 0.01546,
"holder": 7596,
"hourTradeNum": 20611,
"hourTradeVolume": 2564705.05
},
"pairInfo": {
"pairAddress": "0x...",
"pair": "TOKEN - WBNB",
"liquidateUsd": 581750.57,
"createTime": 1772182240000
},
"securityInfo": {
"honeyPot": false,
"openSource": true,
"noOwner": true,
"locked": true
},
"taxInfo": { "buy": "0", "sell": "0" },
"linkInfo": { "tg": "", "x": "", "web": "" },
"dev": { "address": "0x...", "pct": 0.0 },
"topHolderPct": 25.14,
"topHolderList": [
{ "address": "0x...", "balance": 98665702.34, "pct": 9.86 }
]
},
"success": true
}响应分组:
- tradeInfo: marketCapUsd, price, holder, hourTradeNum, hourTradeVolume
- pairInfo: pairAddress, pair, liquidateUsd, createTime
- securityInfo: honeyPot, openSource, noOwner, locked
- taxInfo: buy, sell(百分比字符串)
- dev: address, pct
- topHolderPct 和 topHolderList: 前10持仓者分布
Execution Rules
执行规则
- Always confirm before trading -- Ask user to confirm: chain, token address, amount/percentage, buy or sell
- Use Bash with curl to call the API
- Poll trade result -- After swap submission, query trade status up to 3 times with 5s intervals
- Show transaction link -- Always display the block explorer URL with the txId
- Never retry failed swap requests -- show the error to user instead
- Chain-wallet validation -- walletAddress must match the selected chain. A Solana wallet cannot be used for BSC/ETH/Base trades and vice versa. If the user provides a mismatched wallet/chain combination, warn them and ask to correct before proceeding.
- Strict parameter validation -- Before calling the API, validate EVERY field:
- All required parameters must be present and have legal values
- must be one of
chain/sol/eth/bscbase - must be boolean
isBuyortruefalse - for buy: must be > 0; for sell: must be 1-100
amount - must be provided; SOL chain: 0.001-0.1 (unit: SOL); EVM chains: 0.1-100 (unit: Gwei). If tip is outside the recommended range, must warn the user about potentially high cost and require explicit confirmation before proceeding
tip - if provided must be 1 or 2
model - if provided only applies to Solana chain
priorityFee - Do NOT send any field names outside the parameter tables above
- If any validation fails, refuse to send the request and ask the user to correct
- 交易前必须确认——请求用户确认:链、Token地址、数量/百分比、买入或卖出操作
- 使用Bash和curl调用API
- 轮询交易结果——提交swap请求后,最多查询3次交易状态,每次间隔5秒
- 显示交易链接——必须显示包含txId的区块浏览器地址
- 失败请求不重试——若swap请求失败,直接向用户展示错误信息
- 链与钱包验证——walletAddress必须与所选链匹配。Solana钱包不能用于BSC/ETH/Base交易,反之亦然。若用户提供的钱包与链不匹配,需警告用户并要求修正后再继续。
- 严格参数验证——调用API前,必须验证每一个字段:
- 所有必填参数必须存在且值合法
- 必须是
chain/sol/eth/bsc之一base - 必须是布尔值
isBuy或truefalse - 买入操作的必须>0;卖出操作的
amount必须在1-100之间amount - 必须提供;SOL链的tip需在0.001-0.1之间(单位:SOL);EVM链的tip需在0.1-100之间(单位:Gwei)。若tip超出推荐范围,必须警告用户可能产生高额费用,并要求用户明确确认后再继续
tip - 若提供,必须是1或2
model - 若提供,仅对Solana链有效
priorityFee - 禁止发送参数表中未列出的字段
- 若任何验证失败,拒绝发送请求并要求用户修正
Feed Rules
Feed功能规则
- type validation -- Only accept ,
NEW,ALMOST(uppercase). Reject any other value.COMPLETED - chain validation -- Feed only supports and
sol. If user specifiesbscoreth, reject and inform them that Feed scanning is only available on Solana and BSC chains.base - Single query mode (default) -- Call the Feed API once, format and display key info for each token: symbol, priceUSD, marketCapUSD, holders, devHoldPercent, launchPlatform (name + progress).
- Continuous monitor mode -- Activate only when user explicitly says "持续监控", "monitor", or "watch":
- Use a Bash polling loop, calling Feed API every 5 seconds
- Deduplicate by — only display newly appeared tokens
tokenAddress - Loop limit: 480 seconds (8 minutes). Set Bash timeout to 540000ms
- After loop ends, use AskUserQuestion to ask: continue monitoring / view token details / buy a token / stop
- When continuing, preserve the seen set to avoid repeats
tokenAddress
- Filter guidance -- Before querying, optionally ask user about filter preferences (market cap range, liquidity, holder count, etc.). If not asked, use no filters (return all).
- No auto-trading -- Feed scanning is for observation only. NEVER automatically buy or sell based on scan results.
- Error handling -- See Error Codes table. For data query APIs: with
code == 200means success;success == trueis server error (inform user to retry later);code == 300means stop immediately;code == 8060/8061means wait 2 seconds and retry.code == 8062
- type参数验证——仅接受、
NEW、ALMOST(大写)。拒绝其他任何值。COMPLETED - chain参数验证——Feed功能仅支持和
sol。若用户指定bsc或eth,需拒绝并告知用户Feed扫描仅支持Solana和BSC链。base - 单次查询模式(默认)——调用一次Feed API,格式化并展示每个Token的核心信息:symbol、priceUSD、marketCapUSD、holders、devHoldPercent、launchPlatform(名称+进度)。
- 持续监控模式——仅当用户明确提出「持续监控」「monitor」或「watch」时启用:
- 使用Bash轮询循环,每5秒调用一次Feed API
- 通过去重——仅展示新出现的Token
tokenAddress - 循环限制:480秒(8分钟)。设置Bash超时为540000ms
- 循环结束后,询问用户:继续监控 / 查看Token详情 / 购买Token / 停止
- 若用户选择继续,保留已记录的集合以避免重复展示
tokenAddress
- 过滤引导——查询前可选择询问用户的过滤偏好(市值范围、流动性、持仓者数量等)。若未询问,则不使用任何过滤条件(返回所有结果)。
- 禁止自动交易——Feed扫描仅用于观察。绝不能根据扫描结果自动执行买入或卖出操作。
- 错误处理——参考错误码表。对于数据查询API:且
code == 200表示成功;success == true为服务器错误(告知用户稍后重试);code == 300表示立即停止;code == 8060/8061表示等待2秒后重试。code == 8062
Token Query Rules
Token查询规则
- ca required -- Contract address () must be provided. If missing, ask user for it.
ca - chain validation -- Supports all 4 chains: ,
sol,eth,bsc. Defaultbase.sol - HoneyPot warning -- If , display a prominent warning that this token is a honeypot and trading it is extremely risky.
securityInfo.honeyPot == true - High tax alert -- If or
taxInfo.buy> 5%, warn user about high tax rates.taxInfo.sell - Display format -- Present results in groups: Trade Info → Security Check → Tax Rates → Holder Distribution → Social Links.
- Trade follow-up -- After displaying query results, optionally ask user if they want to buy this token, linking to the Buy Token flow.
- Error handling -- Same as Feed Rules (see Error Codes table).
- ca参数必填——必须提供合约地址()。若缺失,需向用户索要。
ca - chain参数验证——支持全部4条链:、
sol、eth、bsc。默认base。sol - 蜜罐警告——若,需显示显眼警告,告知用户该Token是蜜罐,交易风险极高。
securityInfo.honeyPot == true - 高税率提醒——若或
taxInfo.buy> 5%,需提醒用户该Token税率较高。taxInfo.sell - 展示格式——按分组展示结果:交易信息 → 安全检测 → 税率 → 持仓者分布 → 社交链接。
- 交易跟进——展示查询结果后,可选择询问用户是否要购买该Token,跳转至购买Token流程。
- 错误处理——与Feed功能规则相同(参考错误码表)。
Wallet Address Formats
钱包地址格式
| Chain | Format | Example pattern |
|---|---|---|
| SOL | Base58, 32-44 characters | |
| ETH / BSC / Base | 0x + 40 hex characters | |
| 链 | 格式 | 示例模式 |
|---|---|---|
| SOL | Base58格式,32-44字符 | |
| ETH / BSC / Base | 0x开头+40位十六进制字符 | |
Block Explorer URLs
区块浏览器地址
- SOL:
https://solscan.io/tx/{txId} - ETH:
https://etherscan.io/tx/{txId} - BSC:
https://bscscan.com/tx/{txId} - BASE:
https://basescan.org/tx/{txId}
- SOL:
https://solscan.io/tx/{txId} - ETH:
https://etherscan.io/tx/{txId} - BSC:
https://bscscan.com/tx/{txId} - BASE:
https://basescan.org/tx/{txId}
Error Codes
错误码
| Code | Meaning | Scope |
|---|---|---|
| 200 | Success | Data query APIs (Feed, Token Query) |
| 300 | Server error — inform user to retry later | Data query APIs (Feed, Token Query) |
| 8060 | API Key invalid | All APIs |
| 8061 | API Key disabled | All APIs |
| 8062 | Rate limited | All APIs — data query: retry after 2s; trade: retry after 1s (except swap, see Execution Rules #5) |
| 错误码 | 含义 | 适用范围 |
|---|---|---|
| 200 | 成功 | 数据查询API(Feed、Token查询) |
| 300 | 服务器错误——告知用户稍后重试 | 数据查询API(Feed、Token查询) |
| 8060 | API密钥无效 | 所有API |
| 8061 | API密钥已禁用 | 所有API |
| 8062 | 请求频率受限 | 所有API——数据查询:等待2秒后重试;交易:等待1秒后重试(swap操作除外,见执行规则第5条) |
Example curl
curl示例
bash
undefinedbash
undefinedBuy
购买Token
curl -s -X POST "${XXYY_API_BASE_URL:-https://www.xxyy.io}/api/trade/open/api/swap"
-H "Authorization: Bearer $XXYY_API_KEY"
-H "Content-Type: application/json"
-d '{"chain":"sol","walletAddress":"...","tokenAddress":"...","isBuy":true,"amount":0.1,"tip":0.001}'
-H "Authorization: Bearer $XXYY_API_KEY"
-H "Content-Type: application/json"
-d '{"chain":"sol","walletAddress":"...","tokenAddress":"...","isBuy":true,"amount":0.1,"tip":0.001}'
curl -s -X POST "${XXYY_API_BASE_URL:-https://www.xxyy.io}/api/trade/open/api/swap"
-H "Authorization: Bearer $XXYY_API_KEY"
-H "Content-Type: application/json"
-d '{"chain":"sol","walletAddress":"...","tokenAddress":"...","isBuy":true,"amount":0.1,"tip":0.001}'
-H "Authorization: Bearer $XXYY_API_KEY"
-H "Content-Type: application/json"
-d '{"chain":"sol","walletAddress":"...","tokenAddress":"...","isBuy":true,"amount":0.1,"tip":0.001}'
Query Trade
查询交易记录
curl -s "${XXYY_API_BASE_URL:-https://www.xxyy.io}/api/trade/open/api/trade?txId=..."
-H "Authorization: Bearer $XXYY_API_KEY"
-H "Authorization: Bearer $XXYY_API_KEY"
curl -s "${XXYY_API_BASE_URL:-https://www.xxyy.io}/api/trade/open/api/trade?txId=..."
-H "Authorization: Bearer $XXYY_API_KEY"
-H "Authorization: Bearer $XXYY_API_KEY"
Feed - Scan newly launched tokens on SOL (with filters)
Feed功能 - 扫描SOL链上新上线的Token(带过滤条件)
curl -s -X POST "${XXYY_API_BASE_URL:-https://www.xxyy.io}/api/trade/open/api/feed/NEW?chain=sol"
-H "Authorization: Bearer $XXYY_API_KEY"
-H "Content-Type: application/json"
-d '{"mc":"10000,500000","holder":"50,","insiderHp":",50"}'
-H "Authorization: Bearer $XXYY_API_KEY"
-H "Content-Type: application/json"
-d '{"mc":"10000,500000","holder":"50,","insiderHp":",50"}'
curl -s -X POST "${XXYY_API_BASE_URL:-https://www.xxyy.io}/api/trade/open/api/feed/NEW?chain=sol"
-H "Authorization: Bearer $XXYY_API_KEY"
-H "Content-Type: application/json"
-d '{"mc":"10000,500000","holder":"50,","insiderHp":",50"}'
-H "Authorization: Bearer $XXYY_API_KEY"
-H "Content-Type: application/json"
-d '{"mc":"10000,500000","holder":"50,","insiderHp":",50"}'
Token Query
Token查询
curl -s "${XXYY_API_BASE_URL:-https://www.xxyy.io}/api/trade/open/api/query?ca=TOKEN_ADDRESS&chain=sol"
-H "Authorization: Bearer $XXYY_API_KEY"
-H "Authorization: Bearer $XXYY_API_KEY"
undefinedcurl -s "${XXYY_API_BASE_URL:-https://www.xxyy.io}/api/trade/open/api/query?ca=TOKEN_ADDRESS&chain=sol"
-H "Authorization: Bearer $XXYY_API_KEY"
-H "Authorization: Bearer $XXYY_API_KEY"
undefined