计算转换
post
https://api.cryptomus.com/v2/user-api/convert/calculate
要求
查询参数
姓名 | 参数类型 | 定义 |
---|---|---|
from* | stringmax:10 | 源货币 |
to* | stringmax:10 | 要在源货币中计算的金额 |
from_amount* | stringrequired_without: to_amount | 要在源货币中计算的金额 |
to_amount* | stringrequired_without: from_amount | 要在目标货币中计算的金额 |
参数类型
stringmax:10定义
源货币参数类型
stringmax:10定义
要在源货币中计算的金额参数类型
stringrequired_without: to_amount定义
要在源货币中计算的金额参数类型
stringrequired_without: from_amount定义
要在目标货币中计算的金额
* - 强制性参数
请求示例
curl https://api.cryptomus.com/v2/user-api/calculate \
-X POST \
-H 'userId: 8b03432e-385b-4670-8d06-064591096795' \
-H 'sign: fe99035f86fa436181717b302b95bacff1' \
-H 'Content-Type: application/json' \
-d '{
"from": "BTC",
"to": "USDT",
"from_amount": "0.0001"
}'
复制回复
响应参数
姓名 | 定义 |
---|---|
from | 金额从 |
approximate_rate | 汇率 |
commission | 佣金 |
total_amount | 总金额 |
to | 金额到 |
定义
金额从定义
汇率定义
佣金定义
总金额定义
金额到
响应示例
1{
2 "state": 0,
3 "result": {
4 "from": "0.001",
5 "approximate_rate": "57853.000",
6 "commission": "3",
7 "total_amount": "60.000",
8 "to": "60.000"
9 }
10}
复制