GET · /api/v1/wallet/support/chains
查询已启用公链
返回当前应用已开通的公链列表(按链去重,不含币种)。用于商户初始化时获取可用链,以及展示充值链选择下拉列表。
/api/v1/wallet/support/chains HMAC 应用范围由 HMAC 签名确定
本接口返回的是 当前 X-Api-Key 所属应用已开通订阅的链,而非平台全量链列表。 不同应用开通的链可能不同。Header 参数
X-Api-Keystring required | 应用 apiKey。沙箱前缀 pk_test_,正式 pk_live_。 例: pk_test_4f9d8ab1c0e74... |
X-Timestampinteger (UNIX 毫秒) required | 请求发起时刻的 UNIX 毫秒时间戳(13 位整数)。与服务端时差不能超过 ±300000ms(5 分钟)。 例: 1746450000000 |
X-Noncestring required | 本次请求的随机串,建议 UUID v4 或 16 字节 hex。同一 (apiKey, nonce) 在 10 分钟窗口内不可重复。 例: 8e3a1c2f7b6d4a90 |
X-Signaturestring required | HMAC-SHA256 签名(小写 hex,64 字符)。算法: HMAC(secret, METHOD + "\n" + PATH + "\n" + ts + "\n" + nonce + "\n" + SHA256(body))。详见 鉴权章节。 例: 6e4a8c1f...(64 字符) |
Query 参数
无。
请求示例
# 签名算法(4 个 header)见 /docs/api/auth;GET body=''
API_KEY=pk_live_xxx
SECRET=sk_live_xxx
METHOD=GET
REQ_PATH=/api/v1/wallet/support/chains
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" \
-H "X-Api-Key: $API_KEY" \
-H "X-Timestamp: $TS" \
-H "X-Nonce: $NONCE" \
-H "X-Signature: $SIG"响应
200OK
{
"code": 0,
"data": [
{
"chainCode": "ETH",
"chainName": "Ethereum",
"namespace": "EVM",
"evmChainId": 1,
"minConfirmations": 12,
"explorerUrl": "https://etherscan.io/tx/"
},
{
"chainCode": "BSC",
"chainName": "BNB Smart Chain",
"namespace": "EVM",
"evmChainId": 56,
"minConfirmations": 15,
"explorerUrl": "https://bscscan.com/tx/"
},
{
"chainCode": "TRON",
"chainName": "TRON",
"namespace": "TRON",
"evmChainId": null,
"minConfirmations": 19,
"explorerUrl": "https://tronscan.org/#/transaction/"
}
],
"msg": ""
}data[] 字段说明
chainCodestring required | 公链 code,后续所有接口的链主键。 例: ETH |
chainNamestring required | 公链全称。 例: Ethereum |
namespacestring required | 命名空间枚举:EVM / BTC / TRON / SOLANA / RIPPLE / STELLAR / EOS。 例: EVM |
evmChainIdinteger | null required | EVM 链 id;仅 EVM 链非空(如以太坊主网 = 1);其它 namespace 恒为 null。 例: 1 |
minConfirmationsinteger required | 链默认最小确认数。代币可单独覆盖,见 /support/tokens。 例: 12 |
explorerUrlstring required | 区块浏览器 URL 模板,如 https://etherscan.io/tx/。 例: https://etherscan.io/tx/ |