Appearance
代币列表接口文档
接口信息
| 项目 | 说明 |
|---|---|
| 接口路径 | /api/v1/dex/tokens |
| 请求方法 | GET |
| 代理路径 | /serverproxy/api/v1/dex/tokens |
| 后端服务 | https://api.dev.topo.club |
| 认证方式 | Authorization: ApiKey <key> |
请求参数
Query 参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| network_id | string | 是 | 网络标识,前端自动注入。topo--164 或 aptos--2 |
| force_refresh | boolean | 否 | true 时强制刷新缓存,默认 false |
请求示例
bash
GET /serverproxy/api/v1/dex/tokens?network_id=topo--164
Authorization: ApiKey <key>响应数据结构
json
{
"code": 0,
"message": "Success",
"data": {
"coin_list": [
{
"coinType": "0x1::aptos_coin::AptosCoin",
"symbol": "APT",
"name": "Aptos",
"decimals": 8,
"logoURL": "https://...",
"isVerified": true,
"isNative": true,
"price": "2.1250",
"marketCap": "10500000000",
"liquidity": "5200000",
"holders": 128540,
"age": 600,
"marketData": {
"m30": {
"priceChange": 0.32,
"volume": 12000,
"buyVolume": 8000,
"sellVolume": 4000
},
"hour1": {
"priceChange": -0.15,
"volume": 24000,
"buyVolume": null,
"sellVolume": null
},
"hour4": { "priceChange": 1.45, "volume": null, "buyVolume": null, "sellVolume": null },
"hour24": { "priceChange": 2.10, "volume": null, "buyVolume": null, "sellVolume": null }
}
}
]
},
"timestamp": 1745380000
}响应字段说明
data 对象字段
| 字段名 | 类型 | 说明 |
|---|---|---|
| coin_list | array | 代币列表 |
coin_list 数组项字段
| 字段名 | 类型 | 说明 |
|---|---|---|
| coinType | string | 代币完整类型标识符 |
| symbol | string | 代币符号(如 APT、USDC) |
| name | string | 代币名称 |
| decimals | number | 精度(小数位数) |
| logoURL | string | 图标 URL,可能为空 |
| isVerified | boolean | 是否已验证 |
| isNative | boolean | 是否为链原生代币 |
| price | string | 当前价格(美元),可能为空 |
| marketCap | string | 市值(美元),可能为空 |
| liquidity | string | 流动性(美元),可能为空 |
| holders | number | 持有者数量,可能为空 |
| age | number | 代币上线天数,可能为空 |
| marketData | object | 市场数据(见下) |
marketData 对象字段
包含 m30(30 分钟)、hour1(1 小时)、hour4(4 小时)、hour24(24 小时)四个时间窗口,每个窗口包含:
| 字段名 | 类型 | 说明 |
|---|---|---|
| priceChange | number | 价格变化(百分比) |
| volume | number | null | 成交量(美元) |
| buyVolume | number | null | 买入量(美元) |
| sellVolume | number | null | 卖出量(美元) |
前端调用示例
typescript
import { fetchDexTokens } from '@/lib/request/api'
const result = await fetchDexTokens({ force_refresh: false })
const tokens = result.data.coin_list注意事项
network_id由前端request()函数自动注入,对/api/v1/dex路径的 GET 请求统一追加- 部分字段(
price、marketCap、liquidity等)可能为空,前端需做空值兼容 marketData各时间窗口的volume、buyVolume、sellVolume可能为null