请求格式application/json
walletrequired string | 进行资产兑换的商户 ID。使用 "Personal" ID 可用于个人余额 |
from_tokenrequired string | 源代币 ID(见加密货币列表) |
from_networkrequired string | 源网络 ID(见网络列表) |
to_tokenrequired string | 目标代币 ID(见加密货币列表) |
to_networkrequired string | 目标网络 ID(见网络列表) |
amountrequired string | 要兑换的资产数量 |
请求示例
curl --request POST 'https://api.fps.pro/balances/convert' \
--header 'Content-Type: application/json' \
--header 'X-Client-Id: YOUR_CLIENT_ID' \
--header 'X-Timestamp: 1720000000' \
--header 'X-Signature: YOUR_HMAC_SHA256_SIGNATURE' \
--data '{
"wallet": "42",
"from_token": "tether",
"from_network": "tron",
"to_token": "btc",
"to_network": "btc",
"amount": "100"
}'成功响应
{
"status": 200,
"message": "convert success"
}错误
详细的授权错误列表位于 授权 - 错误
{
"status": 422,
"message": "Validation Error",
"errors": [
{
"field": "wallet",
"message": "wallet is required"
}
]
}{
"status": 400,
"message": "Bad balance"
}{
"status": 400,
"message": "Amount exceeds available balance"
}{
"status": 500,
"message": "Internal Server Error"
}