# Get Wallet Balance

Retrieve the native coin and all token balances for a specific wallet, with optional testnet support.

## Overview

Returns the live on-chain balance for a wallet. The response includes the native balance (ETH, MATIC, SOL, etc.) and all registered token balances (USDC, USDT, etc.) with their contract addresses and decimal precision.

Balances are fetched directly from the blockchain node, so they always reflect the current on-chain state. For an aggregated view across all wallets, use **Aggregate Balances** instead.

### `GET /v1/wallets/{id}/balance`

Authentication: bearer token required.

Returns live native and token balances for the specified wallet.

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | Wallet UUID |

**Query parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `chain` | string | no | Query the wallet's address on another chain of the same network: a chain identifier, or a testnet's chain registry id (e.g. `polygon-amoy`). Default: the wallet's own chain. A chain on the other network returns `400`. |
| `isTestnet` | boolean | no | Fetch testnet balances (default: false) |

**Responses**

`200` OK

```json
{
  "walletId": "wallet-uuid",
  "address": "0xAbCd...",
  "chain": "ethereum",
  "nativeBalance": {
    "symbol": "ETH",
    "amount": "1.2345",
    "decimals": 18
  },
  "tokens": [
    {
      "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "symbol": "USDC",
      "balance": "500.00",
      "decimals": 6
    }
  ]
}
```

`404` Not Found

```json
{ "detail": "Wallet not found" }
```

## Implementation

```javascript
// Get the balance of a specific wallet
async function getWalletBalance(token, walletId) {
  const res = await fetch(
    `https://api.aureahub.com/v1/wallets/${walletId}/balance`,
    { headers: { Authorization: `Bearer ${token}` } }
  );
  if (!res.ok) throw new Error('Failed to fetch balance');
  return res.json();
}

// Check if a wallet has enough ETH for a transaction
async function hasEnoughBalance(token, walletId, requiredAmount) {
  const { nativeBalance } = await getWalletBalance(token, walletId);
  return parseFloat(nativeBalance.amount) >= parseFloat(requiredAmount);
}

// Get USDC balance specifically
async function getTokenBalance(token, walletId, symbol) {
  const { tokens } = await getWalletBalance(token, walletId);
  const token_data = tokens.find(t => t.symbol === symbol);
  return token_data ? parseFloat(token_data.balance) : 0;
}
```

---

Web version: https://docs.aureahub.com/#wallets-balance
