4. Calculate exchange recv
Calculate exchange recv
Calculate the amount the user accepts based on the transfer currency, transfer amount, and receiving currency entered by the user.
POST
/openapi/order/calculate
Request
Name | Type | Required | Description |
---|---|---|---|
exchange_mode | string | yes | Exchange mode [ float | fixed ] |
from_abbr | string | yes | Coin name |
from_chain | string | yes | Chain name |
from_quantity | float | yes | Quantity (minimum: 1e-8) |
to_address | array | yes | Receiving Address list |
to_abbr | string | yes | Receive coin name |
to_address | string | yes | Receiving Address |
to_chain | string | yes | Receiving chain name |
to_group_ratio | float | yes | Receiving group ratio( value>0 or value<= 1 ) |
to_ratio | float | yes | Receiving ratio ( value>0 or value<= 1 ) |
Request
{
"exchange_mode": "float",
"from_abbr": "ARB",
"from_chain": "Arbitrum",
"from_quantity": 100,
"to_address": [
{
"to_abbr": "ETH",
"to_address": "****************",
"to_chain": "Arbitrum",
"to_group_ratio": 1,
"to_ratio": 1
}
]
}
Response
Name | Type | Description |
---|---|---|
code | int | Business status code |
data | object | Data Objects |
min_from_quantity | float | Minimum order quantity |
to | array | Receiving Address list |
group_quantity | float | Number of groups |
to_abbr | string | Receive coin name |
to_address | string | Receiving Address |
to_chain | string | Receiving chain name |
to_group_ratio | float | Receiving group ratio |
to_quantity | float | Receive quantity |
to_ratio | float | Receiving ratio |
msg | string | Business message |
Example Response
{
"code": 0,
"msg": "success",
"data": {
"min_from_quantity": 7,
"to": [
{
"to_chain": "TRON",
"to_abbr": "TRX",
"to_ratio": 1,
"to_group_ratio": 1,
"to_address": "TLxozzoG3Vxy9AqDyiv9fcJZtbTYhAy2rQ",
"to_quantity": 3861.37545,
"group_quantity": 3861.37545
}
]
}
}