跳到主要内容

充值记录列表

描述

返回当前已认证用户的现货充值历史,按最新记录优先排序。接口仅返回已确认的充值记录;未达到确认深度的充值不会出现在此处。前端可通过轮询该接口,将已知的 tx_hash 与列表进行匹配,以追踪充值进度。

关于充值端到端工作原理的详细说明,请参阅 充值流程

HTTP 请求

GET /spot/deposits(JWT 或 API Key)

权重

0 — 当前 MVP 阶段不设每 IP 频率限制。

请求参数

名称类型必填描述
limitNUMBER可选返回的记录数量,默认 50,范围 1–200(服务端截断)。

按代币或时间范围的服务端过滤尚未实现,请在获取数据后进行客户端过滤。

响应示例

200 OK

[
{
"id": "5af0c1a2-3d4e-4f5a-b6c7-8d9e0f1a2b3c",
"token": "DF",
"amount": "100",
"chain_id": 97,
"tx_hash": "0xabc123...",
"block_number": 106384180,
"status": "confirmed",
"created_at": 1778315530,
"confirmed_at": 1778315570
}
]
字段说明
id充值记录的 UUID。
token代币符号,MVP 阶段为 DF
amount已到账金额的十进制字符串。
chain_id来源链 id — 97(BSC 测试网)。
tx_hash链上交易哈希。
block_number触发 SpotDeposit 事件的区块号。
statusconfirmed — 当前接口仅返回该状态。待确认的充值不通过此接口暴露。
created_atUnix 秒时间戳 — 记录插入 spot_deposits 的时间。
confirmed_atUnix 秒时间戳 — 监听器完成余额入账的时间。若尚未确认则为 null(实际上由于接口仅返回已确认记录,该字段极少为 null)。

错误响应

HTTPerror
401(空响应体) — 凭证缺失或无效。
500internal — 意外的数据库错误。

完整列表:错误码

代码示例

cURL(JWT)

JWT="your_jwt_token"

curl -s "https://api-sepolia.p99.world/api/v1/spot/deposits?limit=20" \
-H "Authorization: Bearer ${JWT}"

cURL(HMAC API Key)

API_KEY="your_api_key"
API_SECRET="your_api_secret"
TIMESTAMP=$(date +%s%3N)
# 签名载荷为去除 &signature= 后的完整查询字符串,顺序须与 URL 保持一致。
# 使用任意固定顺序即可——服务端对 &signature= 前的所有字节重新签名。
PAYLOAD="limit=20&timestamp=${TIMESTAMP}"
SIGNATURE=$(echo -n "${PAYLOAD}" | openssl dgst -sha256 -hmac "${API_SECRET}" | awk '{print $2}')

curl -s \
-H "X-MBX-APIKEY: ${API_KEY}" \
"https://api-sepolia.p99.world/api/v1/spot/deposits?${PAYLOAD}&signature=${SIGNATURE}"

Python

import time, hmac, hashlib, requests

API_KEY = "your_api_key"
API_SECRET = "your_api_secret"
BASE_URL = "https://api-sepolia.p99.world/api/v1"

def signed_get(path: str, params: dict) -> list:
ts = int(time.time() * 1000)
# 构建将要签名并发送的完整查询字符串(顺序至关重要)
full_params = {**params, "timestamp": ts}
qs = "&".join(f"{k}={v}" for k, v in full_params.items())
sig = hmac.new(API_SECRET.encode(), qs.encode(), hashlib.sha256).hexdigest()
r = requests.get(
f"{BASE_URL}{path}?{qs}&signature={sig}",
headers={"X-MBX-APIKEY": API_KEY},
timeout=5,
)
r.raise_for_status()
return r.json()

deposits = signed_get("/spot/deposits", {"limit": 20})
for d in deposits:
print(
f" {d['token']:5} {d['amount']:>14} "
f"tx={d['tx_hash'][:12]}... block={d['block_number']} status={d['status']}"
)