按 ID 查询提现记录
描述
返回当前已认证用户名下指定提现 UUID 的完整提现记录。若 ID 不存在或属于其他用户,则返回 404。
常用于调用 POST /spot/withdraw/request 后的状态轮询。完整的端到端流程请参阅 提现流程。
HTTP 请求
GET /spot/withdrawals/:id(JWT 或 API Key)
:id 路径段为 POST /spot/withdraw/request 返回的提现 UUID。
权重
0 — 当前 MVP 阶段不设每 IP 频率限制。
响应示例
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。 |
token | 代币符号,MVP 阶段为 DF。 |
amount | 请求提现金额的十进制字符串。 |
fee | 提现手续费(十进制字符串),当前始终为 "0"。 |
chain_id | 目标链 id — 97(BSC 测试网)。 |
nonce | EIP-712 类型化数据的每(用户、链)nonce (保留)。 |
status | signed(已签名)/ confirmed(已确认)/ expired(已过期)。详见 提现状态。 |
deadline | Unix 秒时间戳 — EIP-712 签名的有效期截止时间。 |
tx_hash | 链上交易哈希。status = confirmed 之前为 null。 |
block_number | SpotWithdrawal 事件所在的区块号。status = confirmed 之前为 null。 |
requested_at | Unix 秒时间戳 — 后端签署释放授权的时间。 |
confirmed_at | Unix 秒时间戳 — 监听器观测到链上事件的时间。确认之前为 null。 |
错误响应
| HTTP | error |
|---|---|
400 | invalid id — :id 不是有效的 UUID。 |
401 | (空响应体) — 凭证缺失或无效。 |
404 | not found — 提现记录不存在或属于其他用户。 |
500 | internal — 意外的 数据库错误。 |
完整列表:错误码。
代码示例
cURL(JWT)
JWT="your_jwt_token"
WITHDRAWAL_ID="9f2a1c4e-5b67-4d8a-bf93-2e1f4a6c8d10"
curl -s "https://api-sepolia.p99.world/api/v1/spot/withdrawals/${WITHDRAWAL_ID}" \
-H "Authorization: Bearer ${JWT}"
cURL(HMAC API Key)
API_KEY="your_api_key"
API_SECRET="your_api_secret"
WITHDRAWAL_ID="9f2a1c4e-5b67-4d8a-bf93-2e1f4a6c8d10"
TIMESTAMP=$(date +%s%3N)
PAYLOAD="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/withdrawals/${WITHDRAWAL_ID}?timestamp=${TIMESTAMP}&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"
WITHDRAWAL_ID = "9f2a1c4e-5b67-4d8a-bf93-2e1f4a6c8d10"
def signed_get(path: str) -> dict:
ts = int(time.time() * 1000)
payload = f"timestamp={ts}"
sig = hmac.new(API_SECRET.encode(), payload.encode(), hashlib.sha256).hexdigest()
r = requests.get(
f"{BASE_URL}{path}?timestamp={ts}&signature={sig}",
headers={"X-MBX-APIKEY": API_KEY},
timeout=5,
)
r.raise_for_status()
return r.json()
row = signed_get(f"/spot/withdrawals/{WITHDRAWAL_ID}")
print(f"status={row['status']} tx_hash={row.get('tx_hash')} confirmed_at={row.get('confirmed_at')}")