iCryptoNow

API 路径、字段名、事件名和代码示例保持英文,与接口完全一致,可直接复制使用。

报价

GET/v1/quote

返回某个金额的准确手续费和最低金额,让您在玩家付款或提现之前向他们展示真实的数字。

查询参数

参数类型说明
chainstring · 必填链 ID,例如 tron。
tokenstring · 必填USDT 或 USDC。
directionstring · 必填in 表示充值,out 表示代付。
amountstring · 必填以代币最小单位表示的整数,必须大于 0。
modestring · 选填仅 in:standard 或 pro。默认按网络现在的收款方式。Standard 网络上,玩家转到以前的专属地址按 Pro 计费,用 mode=pro 查。

示例

const { body } = await 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。

立即申请