curl --request GET \
--url https://api.onswitch.xyz/wallet/{wallet_id}/balance \
--header 'x-service-key: <api-key>'{
"success": true,
"message": "Wallet balance fetched successfully",
"timestamp": "2024-01-01T00:00:00.000Z",
"data": {
"balance": 150.5,
"balance_in_usd": 150.5,
"breakdown": [
{
"id": "base:usdc",
"balance": 100,
"balance_in_usd": 100
},
{
"id": "solana:usdc",
"balance": 50.5,
"balance_in_usd": 50.5
}
]
}
}Get unified spendable wallet balance and breakdown by chain.
curl --request GET \
--url https://api.onswitch.xyz/wallet/{wallet_id}/balance \
--header 'x-service-key: <api-key>'{
"success": true,
"message": "Wallet balance fetched successfully",
"timestamp": "2024-01-01T00:00:00.000Z",
"data": {
"balance": 150.5,
"balance_in_usd": 150.5,
"breakdown": [
{
"id": "base:usdc",
"balance": 100,
"balance_in_usd": 100
},
{
"id": "solana:usdc",
"balance": 50.5,
"balance_in_usd": 50.5
}
]
}
}Service key for API authentication
Unique identifier for the wallet
^[a-f0-9]{24}$Balance retrieved successfully