Appearance
Token 持有者列表接口文档
接口信息
- 接口路径:
/api/token-holders - 请求方法:
GET - 接口描述: 获取指定 Token 的持有者列表,支持分页查询
请求参数
Query 参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| coinType | string | 是 | Token 的 Coin Type,如 "0x77045f1b9f811a7a8fb9ebd085b5b0c55c5cb0d1520ff55f7037f89b5da9f5f1::TBTC::TBTC" |
| pageIndex | number | 是 | 页码,从 1 开始 |
| pageSize | number | 是 | 每页数量 |
请求示例
bash
GET /api/token-holders?coinType=0x77045f1b9f811a7a8fb9ebd085b5b0c55c5cb0d1520ff55f7037f89b5da9f5f1::TBTC::TBTC&pageIndex=4&pageSize=10响应数据结构
响应格式
json
{
"code": 200,
"message": "OK",
"result": {
"data": [
{
"account": "0xf3375634f87ba84e23c75e0d868e7ca0d87697d9742b098a13e4189bd664b22e",
"balance": "0.000344",
"percentage": ""
}
],
"nextPageIndex": 5,
"total": 612
}
}响应字段说明
result 对象字段
| 字段名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| data | array | 是 | 持有者列表数据 |
| nextPageIndex | number | 否 | 下一页页码,无下一页为空 |
| total | number | 是 | 总记录数 |
data 数组项字段
| 字段名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| account | string | 是 | 持有者账户地址 |
| balance | string | 是 | 持有余额 |
| percentage | string | 否 | 持有占比百分比,可能为空 |
响应示例
json
{
"code": 200,
"message": "OK",
"result": {
"data": [
{
"account": "0xf3375634f87ba84e23c75e0d868e7ca0d87697d9742b098a13e4189bd664b22e",
"balance": "0.000344",
"percentage": "0.056%"
},
{
"account": "0xa1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"balance": "0.000123",
"percentage": "0.020%"
}
],
"nextPageIndex": 5,
"total": 612
}
}注意事项
pageIndex从 1 开始计数balance为字符串格式,前端需要根据 Token 的decimals进行格式化显示percentage字段可能为空字符串,前端需要做兼容处理- 当
nextPageIndex不存在或为空时,表示没有下一页 total表示符合条件的总记录数,用于计算总页数