Overview
Withdraw accumulated rewards to a registered external wallet. The withdrawal is processed on-chain on the Linea network. The net amount received equals the requested amount minus network gas fees.
Prerequisites:
User must have registered external wallet (completed delegation)
Reward wallet must have sufficient balance
Rewards must be vested and withdrawable
Authentication
Your public API client key
Bearer token for authentication
Query Parameters
Route to US backend environment
Request Body
Amount to withdraw in USDC (decimal string)
Response
Blockchain transaction hash for tracking on Linea network
200 - Success
400 - Bad Request
422 - Validation Error
{
"txHash" : "0xb92de09d893e8162b0861c0f7321f68df02212efbc58f208839ae3f176d89638"
}
Code Examples
curl -X POST "https://dev.api.baanx.com/v1/wallet/reward/withdraw" \
-H "x-client-key: YOUR_CLIENT_KEY" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"amount": "25.00"}'
Complete Withdrawal Flow
Check Reward Balance
const wallet = await fetch ( '/v1/wallet/reward' ). then ( r => r . json ());
const balance = parseFloat ( wallet . balance );
Estimate Fees
const fees = await fetch ( '/v1/wallet/reward/withdraw-estimation' )
. then ( r => r . json ());
const feeUSDC = parseFloat ( fees . usdc );
Calculate Net Amount
const netAmount = balance - feeUSDC ;
console . log ( `You will receive: ${ netAmount . toFixed ( 2 ) } USDC` );
Initiate Withdrawal
const { txHash } = await fetch ( '/v1/wallet/reward/withdraw' , {
method: 'POST' ,
body: JSON . stringify ({ amount: balance . toString () })
}). then ( r => r . json ());
Monitor Transaction
const explorerUrl = `https://lineascan.build/tx/ ${ txHash } ` ;
console . log ( `Track withdrawal: ${ explorerUrl } ` );
Important Notes
Balance Requirements : Withdrawal amount plus fees must not exceed available reward balance.
Vesting Periods : Some rewards may have vesting periods before withdrawal is allowed. Check isWithdrawable flag on the reward wallet.
Transaction Monitoring : Use the returned txHash to track status. Linea confirmations typically take 1-3 minutes.