> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baanx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Estimate Reward Withdrawal Fees

> Calculate network fees for withdrawing funds from the reward wallet

## 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 only

## Authentication

<ParamField header="x-client-key" type="string" required>
  Your public API client key
</ParamField>

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication
</ParamField>

## Query Parameters

<ParamField query="x-us-env" type="boolean" default={false}>
  Route to US backend environment
</ParamField>

## Response

<ResponseField name="wei" type="string">
  Gas fee estimate in wei
</ResponseField>

<ResponseField name="eth" type="string">
  Gas fee estimate in ETH
</ResponseField>

<ResponseField name="usdc" type="string">
  Gas fee estimate in USDC at current exchange rate
</ResponseField>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "wei": "6219123007416",
    "eth": "0.000006219123007416",
    "usdc": "0.01644666445335518319452825472"
  }
  ```
</ResponseExample>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  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"
  ```

  ```python Python theme={null}
  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")
  ```

  ```typescript TypeScript theme={null}
  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();
  ```
</CodeGroup>

## Related Endpoints

* [Withdraw from Reward Wallet](/api-reference/wallet/reward-withdraw)
* [Get Reward Wallet Balance](/api-reference/wallet/reward)
