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。