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

# Get balance for all wallets

> In this example, we will get the balance for each connected wallet.

```ts React Native theme={"system"}
// Using RN client + viem public client
import { dynamicClient } from '<path-to-your-dynamicClient>';
import { mainnet } from 'viem/chains'

export const getAllBalances = async () => {
  const wallets = dynamicClient.wallets.userWallets;
  const publicClient = dynamicClient.viem.createPublicClient({ chain: mainnet });

  const results = [] as Array<{ address: string; balance: string }>;
  for (const w of wallets) {
    const balance = await publicClient.getBalance({ address: w.address as `0x${string}` });
    results.push({ address: w.address, balance: balance.toString() });
  }
  return results;
}
```
