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。

立即申請