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

# Tokens & Balances

> Token lists, prices, balances, and metadata.

The SDK includes typed wrappers for the public token endpoints. All return cached prices where possible — use them in tight UI loops without hammering the API.

## getAllTokens

```ts theme={null}
const tokens = await dzap.getAllTokens(1);                                  // Ethereum
const withPrices = await dzap.getAllTokens(1, undefined, '0xUser');         // include balances
```

## getTokenDetails

```ts theme={null}
const usdc = await dzap.getTokenDetails(
  '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',  // address
  1,                                                // chainId
  '0xUser',                                         // account (optional)
  true,                                             // includeBalance
  true,                                             // includePrice
);
```

## getTokenPrices

```ts theme={null}
const prices = await dzap.getTokenPrices(
  ['0xA0b...', '0xC02...'],
  1,
);
// prices => { '0xA0b...': '1.00', '0xC02...': '3450.12' }  (USD strings or null)
```

## getBalances

```ts theme={null}
const balances = await dzap.getBalances(
  8453,         // chainId
  '0xUser',
);
// Native + ERC20 balances with USD valuation
```

## Tips

* **Native token** — comes back under the sentinel address `0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE`.
* **Price freshness** — DZap aggregates prices across CoinGecko + protocol-native sources. Stale prices (>5min) are flagged in the response.
* **Decimals** — always check `decimals` before formatting. USDC is 6, WETH is 18.
