跳到主要内容

提现记录列表

描述

返回当前已认证用户的提现历史,按最新记录优先排序。结果可按 status 和/或 token 进行过滤。

各状态值的说明请参阅 提现状态。完整提现流程请参阅 提现流程

HTTP 请求

GET /spot/withdrawals(JWT 或 API Key)

权重

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

请求参数

名称类型必填描述
statusENUM可选按提现状态过滤,可选值为 signedconfirmedexpired。详见 提现状态。省略则返回所有状态。
tokenSTRING可选按代币符号过滤(例如 DF)。省略则返回所有代币。
startLONG可选Unix 秒时间戳 — 仅返回 requested_at >= start 的记录。
endLONG可选Unix 秒时间戳 — 仅返回 requested_at <= end 的记录。
limitNUMBER可选返回的记录数量,默认 50,最大 200(服务端截断)。

响应示例

200 OK

[
{
"id": "9f2a1c4e-5b67-4d8a-bf93-2e1f4a6c8d10",
"token": "DF",
"amount": "100",
"fee": "0",
"chain_id": 97,
"nonce": 42,
"status": "confirmed",
"deadline": 1778402000,
"tx_hash": "0xabc123...",
"block_number": 106400000,
"requested_at": 1778315530,
"confirmed_at": 1778316040
}
]
字段说明
id提现 UUID。可配合 GET /spot/withdrawals/:id 查询单条记录。
token代币符号,MVP 阶段为 DF
amount请求提现金额的十进制字符串。
fee提现手续费(十进制字符串),当前始终为 "0"
chain_id目标链 id — 97(BSC 测试网)。
nonceEIP-712 类型化数据的每(用户、链)nonce (保留)。
statussigned(已签名)/ confirmed(已确认)/ expired(已过期)。详见 提现状态
deadlineUnix 秒时间戳 — EIP-712 签名的有效期截止时间。
tx_hash链上交易哈希。status = confirmed 之前为 null
block_numberSpotWithdrawal 事件所在的区块号。status = confirmed 之前为 null
requested_atUnix 秒时间戳 — 后端签署释放授权的时间。
confirmed_atUnix 秒时间戳 — 监听器观测到链上事件的时间。确认之前为 null

错误响应

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

完整列表:错误码

代码示例

cURL(JWT)

JWT="your_jwt_token"

# 所有提现记录
curl -s "https://api-sepolia.p99.world/api/v1/spot/withdrawals" \
-H "Authorization: Bearer ${JWT}"

# 按状态过滤
curl -s "https://api-sepolia.p99.world/api/v1/spot/withdrawals?status=signed" \
-H "Authorization: Bearer ${JWT}"

cURL(HMAC API Key)

API_KEY="your_api_key"
API_SECRET="your_api_secret"
TIMESTAMP=$(date +%s%3N)
QUERY="status=confirmed&timestamp=${TIMESTAMP}"
SIGNATURE=$(echo -n "${QUERY}" | 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/withdrawals?${QUERY}&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()

withdrawals = signed_get("/spot/withdrawals", {"status": "confirmed", "limit": 20})
for w in withdrawals:
print(
f" {w['id'][:8]}... {w['token']} {w['amount']:>14} "
f"status={w['status']} requested_at={w['requested_at']}"
)