GET · /api/v1/wallet/support/tokens

查询某链已启用代币

按 chainCode 返回当前应用在该链上已启用的代币列表。提现和余额查询接口需要的 chainTokenId 从这里取。

GET/api/v1/wallet/support/tokens HMAC

链未开通时返回业务错误码,不是空列表

如果 chainCode 对应的链在该应用中未开通或已禁用,接口会返回 HTTP 200 + 非 0 业务码,而不是空的 data: [],以便商户明确感知错误。

Header 参数

X-Api-Key
string required
应用 apiKey。沙箱前缀 pk_test_,正式 pk_live_
例: pk_test_4f9d8ab1c0e74...
X-Timestamp
integer (UNIX 毫秒) required
请求发起时刻的 UNIX 毫秒时间戳(13 位整数)。与服务端时差不能超过 ±300000ms(5 分钟)。
例: 1746450000000
X-Nonce
string required
本次请求的随机串,建议 UUID v4 或 16 字节 hex。同一 (apiKey, nonce) 在 10 分钟窗口内不可重复。
例: 8e3a1c2f7b6d4a90
X-Signature
string required
HMAC-SHA256 签名(小写 hex,64 字符)。算法:HMAC(secret, METHOD + "\n" + PATH + "\n" + ts + "\n" + nonce + "\n" + SHA256(body))。详见 鉴权章节
例: 6e4a8c1f...(64 字符)

Query 参数

chainCode
string required
公链 code,如 ETH / BSC / TRON。链未开通或已禁用时返回标准 4xx 错误码,不会以空列表掩盖。
例: ETH

请求示例

# 签名算法(4 个 header)见 /docs/api/auth;GET body=''
API_KEY=pk_live_xxx
SECRET=sk_live_xxx
METHOD=GET
REQ_PATH=/api/v1/wallet/support/tokens
BODY=''
TS=$(( $(date +%s) * 1000 ))
NONCE=$(uuidgen | tr -d '-' | tr '[:upper:]' '[:lower:]')
BODY_SHA=$(printf "" | openssl dgst -sha256 -hex | awk '{print $2}')
SIG=$(printf "%s\n%s\n%s\n%s\n%s" "$METHOD" "$REQ_PATH" "$TS" "$NONCE" "$BODY_SHA" \
  | openssl dgst -sha256 -hmac "$SECRET" -hex | awk '{print $2}')

curl "https://api.pqpa.com$REQ_PATH?chainCode=ETH" \
  -H "X-Api-Key:   $API_KEY" \
  -H "X-Timestamp: $TS" \
  -H "X-Nonce:     $NONCE" \
  -H "X-Signature: $SIG"

响应

Response
200OK
{
  "code": 0,
  "data": [
    {
      "chainTokenId": 1,
      "tokenSymbol": "ETH",
      "tokenType": "NATIVE",
      "contractAddress": null,
      "decimals": 18,
      "minConfirmations": null,
      "supportRecharge": true,
      "supportWithdraw": true
    },
    {
      "chainTokenId": 19,
      "tokenSymbol": "USDT",
      "tokenType": "ERC20",
      "contractAddress": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
      "decimals": 6,
      "minConfirmations": 12,
      "supportRecharge": true,
      "supportWithdraw": true
    }
  ],
  "msg": ""
}

data[] 字段说明

chainTokenId
integer required
链上代币 id,提现 / 余额等接口的代币主键,请持久化保存。
例: 19
tokenSymbol
string required
代币符号。
例: USDT
tokenType
string required
代币类型,如 NATIVE / ERC20 / TRC20 / SPL。
例: ERC20
contractAddress
string | null required
合约地址;原生币(ETH / BNB / TRX 等)为 null。
例: 0xdAC17F958D2ee523a2206206994597C13D831ec7
decimals
integer required
代币小数位,用于金额换算(amount 字段均为已考虑 decimals 的可读字符串)。
例: 6
minConfirmations
integer | null required
代币独立最小确认数;为 null 时复用链默认值(见 /support/chains 的 minConfirmations)。
例: 12
supportRecharge
boolean required
是否支持充值识别。
例: true
supportWithdraw
boolean required
是否支持提现。
例: true

下一步