Estimate Credit Withdrawal Fees
Wallet
Estimate Credit Withdrawal Fees
Calculate network fees for withdrawing funds from the credit wallet
GET
Estimate Credit Withdrawal Fees
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.
Overview
This endpoint calculates the estimated gas fees for withdrawing funds from a credit wallet to an external wallet address. Network fees vary based on blockchain congestion and are deducted from the withdrawal amount. Always call this endpoint before initiating a withdrawal to inform users of the net amount they will receive. Use Cases:- Display estimated fees to users before withdrawal confirmation
- Calculate net amount user will receive after fees
- Compare fee estimates across different times to optimize for lower costs
- Provide transparency in withdrawal costs
- Currently supports Linea network only
- Returns fees in multiple denominations (wei, ETH, USDC)
Authentication
Your public API client key that identifies your environment
Bearer token obtained from OAuth flow or direct login
Query Parameters
Set to
true to route request to US backend environment (if available for your client)Response
Gas fee estimate in wei (smallest ETH unit)
Gas fee estimate in ETH
Gas fee estimate converted to USDC at current exchange rate
Code Examples
Best Practices
Fee Calculation: Fees are estimates based on current network conditions. Actual fees may vary slightly when the transaction is executed. Always add a small buffer for production implementations.
Edge Cases
High Network Congestion
During peak network usage, gas fees can spike:- Fees may temporarily exceed the withdrawal amount for small transactions
- Consider implementing minimum withdrawal amounts to ensure economical transactions
- Poll this endpoint periodically to catch fee reductions
Fee Precision
Fee amounts include many decimal places for accuracy:- Always use decimal or BigInt types, never floating-point arithmetic
- Round displayed values appropriately for user presentation
- Store full precision values for accounting purposes
Network Limitations
Currently Linea network only:- Other networks will return an error
- Check user’s registered external wallet network before calling
- Future updates may support additional networks
Calculation Example
Example: Net Amount Calculation
Related Endpoints
- Withdraw from Credit Wallet - Execute withdrawal after estimating fees
- Get Credit Wallet Balance - Check available balance before withdrawal
- Get External Wallets - View registered external wallets for withdrawal destination