API 路径、字段名、事件名和代码示例保持英文,与接口完全一致,可直接复制使用。
报价
GET/v1/quote
返回某个金额的准确手续费和最低金额,让您在玩家付款或提现之前向他们展示真实的数字。
查询参数
| 参数 | 类型 | 说明 |
|---|---|---|
chain | string · 必填 | 链 ID,例如 tron。 |
token | string · 必填 | USDT 或 USDC。 |
direction | string · 必填 | in 表示充值,out 表示代付。 |
amount | string · 必填 | 以代币最小单位表示的整数,必须大于 0。 |
mode | string · 选填 | 仅 in:standard 或 pro。默认按网络现在的收款方式。Standard 网络上,玩家转到以前的专属地址按 Pro 计费,用 mode=pro 查。 |
示例
const { body } = await icn("GET", "/v1/quote?chain=tron&token=USDT&direction=in&amount=50000000");
status, body = icn("GET", "/v1/quote?chain=tron&token=USDT&direction=in&amount=50000000")
200 OK
{
"asset": "tron:USDT",
"decimals": 6,
"direction": "in",
"mode": "pro",
"amount": "50000000",
"fee": "1000000",
"net": "49000000",
"min_amount": "10000000",
"accepted": true
}字段
fee= 您的费率(服务费)加上网络费(主要是链上 gas:TRON 能量、gas),按您账户的约定计算。direction=in:net=amount − fee,即您的余额实际收到的金额。玩家仍按完整的amount入账。direction=out的计算方式与POST /v1/payouts相同,并额外返回fee_mode、send_amount(玩家收到的金额)和total(您的余额被扣除的金额)。net等于send_amount。网络设为Standard时,in和out都按 Standard 价格;mode表示用的是哪个价格。要一次查所有网络和价格,用网络。- 当金额低于
min_amount或不足以支付手续费时,accepted为false,此时各金额均为"0"。
200 OK (direction=out, on_top)
{
"asset": "tron:USDT",
"decimals": 6,
"direction": "out",
"mode": "pro",
"amount": "50000000",
"fee": "2000000",
"min_amount": "10000000",
"accepted": true,
"fee_mode": "on_top",
"net": "50000000",
"send_amount": "50000000",
"total": "52000000"
}如果该资产未对您的账户开通,返回 404 not_found。