Appearance
代币持有者接口文档
接口信息
| 项目 | 说明 |
|---|---|
| 接口路径 | /api/v1/dex/token-holders |
| 请求方法 | GET |
| 代理路径 | /serverproxy/api/v1/dex/token-holders |
| 后端服务 | https://api.dev.topo.club |
| 认证方式 | Authorization: ApiKey <key> |
请求参数
Query 参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| network_id | string | 是 | 网络标识,前端自动注入。topo--164 或 aptos--2 |
| coinType | string | 是 | 要查询的代币完整 Coin Type,如 0x1::aptos_coin::AptosCoin |
| page | number | 否 | 页码,从 1 开始,默认 1 |
| page_size | number | 否 | 每页数量,默认 20 |
请求示例
bash
GET /serverproxy/api/v1/dex/token-holders?network_id=topo--164&coinType=0x1::aptos_coin::AptosCoin&page=1&page_size=20
Authorization: ApiKey <key>响应数据结构
json
{
"code": 0,
"message": "Success",
"data": {
"holders": [
{
"account": "0x4c25640a...",
"balance": "50000000000",
"percentage": "5.00"
},
{
"account": "0x7b8c9d1e...",
"balance": "30000000000",
"percentage": "3.00"
}
],
"total": 128540,
"page": 1,
"page_size": 20
},
"timestamp": 1745380000
}响应字段说明
| 字段名 | 类型 | 说明 |
|---|---|---|
| holders | array | 持有者列表 |
| holders[].account | string | 持有者地址 |
| holders[].balance | string | 持有数量(原始值,未除精度) |
| holders[].percentage | string | 持有占比(百分比,如 "5.00") |
| total | number | 持有者总数 |
| page | number | 当前页码 |
| page_size | number | 每页数量 |
前端调用示例
typescript
import { fetchDexTokenHolders } from '@/lib/request/api'
const result = await fetchDexTokenHolders({
coinType: '0x1::aptos_coin::AptosCoin',
page: 1,
page_size: 20,
})
const { holders, total } = result.data对应 Hook:apps/web/hooks/use-token-holders.ts
注意事项
network_id由前端request()自动注入到 GET query 参数balance为链上原始整数值,展示时需除以代币精度(decimals)percentage为字符串格式的百分比数字,如"5.00"表示 5%