Estimate Reward Withdrawal Fees
curl --request GET \
--url https://api.example.com/v1/wallet/reward/withdraw-estimation \
--header 'Authorization: <authorization>' \
--header 'x-client-key: <x-client-key>'import requests
url = "https://api.example.com/v1/wallet/reward/withdraw-estimation"
headers = {
"x-client-key": "<x-client-key>",
"Authorization": "<authorization>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-client-key': '<x-client-key>', Authorization: '<authorization>'}
};
fetch('https://api.example.com/v1/wallet/reward/withdraw-estimation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/wallet/reward/withdraw-estimation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"x-client-key: <x-client-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/wallet/reward/withdraw-estimation"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-client-key", "<x-client-key>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/wallet/reward/withdraw-estimation")
.header("x-client-key", "<x-client-key>")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/wallet/reward/withdraw-estimation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-client-key"] = '<x-client-key>'
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"wei": "6219123007416",
"eth": "0.000006219123007416",
"usdc": "0.01644666445335518319452825472"
}
Wallet
Estimate Reward Withdrawal Fees
Calculate network fees for withdrawing funds from the reward wallet
GET
/
v1
/
wallet
/
reward
/
withdraw-estimation
Estimate Reward Withdrawal Fees
curl --request GET \
--url https://api.example.com/v1/wallet/reward/withdraw-estimation \
--header 'Authorization: <authorization>' \
--header 'x-client-key: <x-client-key>'import requests
url = "https://api.example.com/v1/wallet/reward/withdraw-estimation"
headers = {
"x-client-key": "<x-client-key>",
"Authorization": "<authorization>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-client-key': '<x-client-key>', Authorization: '<authorization>'}
};
fetch('https://api.example.com/v1/wallet/reward/withdraw-estimation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/wallet/reward/withdraw-estimation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"x-client-key: <x-client-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/wallet/reward/withdraw-estimation"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-client-key", "<x-client-key>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/wallet/reward/withdraw-estimation")
.header("x-client-key", "<x-client-key>")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/wallet/reward/withdraw-estimation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-client-key"] = '<x-client-key>'
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"wei": "6219123007416",
"eth": "0.000006219123007416",
"usdc": "0.01644666445335518319452825472"
}
Overview
Calculate estimated gas fees for withdrawing rewards to an external wallet. Network fees vary based on blockchain congestion and are deducted from the withdrawal amount. Use this endpoint before initiating a withdrawal to show users the net amount they will receive. Network Support: Currently supports Linea network onlyAuthentication
string
required
Your public API client key
string
required
Bearer token for authentication
Query Parameters
boolean
default:false
Route to US backend environment
Response
string
Gas fee estimate in wei
string
Gas fee estimate in ETH
string
Gas fee estimate in USDC at current exchange rate
{
"wei": "6219123007416",
"eth": "0.000006219123007416",
"usdc": "0.01644666445335518319452825472"
}
Code Examples
curl -X GET "https://dev.api.baanx.com/v1/wallet/reward/withdraw-estimation" \
-H "x-client-key: YOUR_CLIENT_KEY" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
import requests
from decimal import Decimal
url = "https://dev.api.baanx.com/v1/wallet/reward/withdraw-estimation"
headers = {
"x-client-key": "YOUR_CLIENT_KEY",
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
}
response = requests.get(url, headers=headers)
fees = response.json()
reward_balance = Decimal("50.00")
fee_usdc = Decimal(fees['usdc'])
net_amount = reward_balance - fee_usdc
print(f"Reward Balance: {reward_balance} USDC")
print(f"Network Fee: {fee_usdc} USDC")
print(f"You will receive: {net_amount} USDC")
interface FeeEstimate {
wei: string;
eth: string;
usdc: string;
}
const response = await fetch(
'https://dev.api.baanx.com/v1/wallet/reward/withdraw-estimation',
{
headers: {
'x-client-key': 'YOUR_CLIENT_KEY',
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
}
}
);
const fees: FeeEstimate = await response.json();
Related Endpoints
Was this page helpful?
⌘I