Estimate withdrawal
To find out the network processing fee at the current moment, you must use the query /v1/withdrawal/estimate
This request is completely identical to the request /v1/withdrawal, but it does not create transactions in the blockchain, but calculates fee fee
for the specified payment parameters.
An example of a response with calculated fee
POST https://api.sandbox.xamax.io/v1/withdrawal/estimate HTTP/1.1
Authorization: Bearer {ACCESS_TOKEN}
Content-Type: application/json
{
"fromAddress": [
"0x2222222222222222222222222222222222222222"
],
"code": "eth",
"destination": [
{
"address": "0x1111111111111111111111111111111111111111",
"amount": "98977950000000000",
"behavior": "fee_from_rest_amount"
}
]
}
Response
{
"withdrawals": [
{
"withdrawalAddresses": [
{
"address": "0x1111111111111111111111111111111111111111",
"amount": "98977950000000000",
"amountUnit": "0.09897795"
}
],
"txHash": "0xA0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0",
"fee": "22050000000000",
"feeCurrency": "eth",
"feeUnit": "0.00002205",
"currency": "eth",
"feeExchangeRate": {
"currency": "usd",
"exchangeRate": 1900,
"currencyAmount": 0.041895,
"code": "eth"
}
}
]
}