Quote
GET/v1/quote
Returns the exact fee and minimum for an amount, so you can show players the real numbers before they pay or withdraw.
Query parameters
| Parameter | Type | Description |
|---|---|---|
chain | string · required | Chain id, for example tron. |
token | string · required | USDT or USDC. |
direction | string · required | in for a deposit, out for a payout. |
amount | string · required | Integer in the token's smallest unit, greater than 0. |
mode | string · optional | in only: standard or pro. Default: how the network takes deposits now. On a Standard network, deposits to addresses players were given earlier pay the Pro price: ask with mode=pro. |
Example
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
}Fields
fee= your percentage rate (service fee) plus the network fee (mostly on-chain gas: TRON energy, gas), as agreed for your account.direction=in:net=amount − fee, what your balance receives. The player is still credited the fullamount.direction=outuses the same arithmetic asPOST /v1/payoutsand also returnsfee_mode,send_amount(what the player receives) andtotal(what your balance is charged).netequalssend_amount. While a network is set to Standard, bothinandoutuse the Standard prices;modesays which price was used. To list every network with its prices, use Networks.acceptedisfalsewhen the amount is belowmin_amountor does not cover the fee. The amounts are then"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"
}Returns 404 not_found if the asset is not enabled for your account.