> ## Documentation Index
> Fetch the complete documentation index at: https://www.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.

<Card title="Recommended: JavaScript SDK for React Native" icon="react" color="#4779FE">
  While this SDK is still supported, we recommend using newer [JavaScript SDK](/docs/javascript/reference/react-native-quickstart), which is optimized for React Native, but also comes with a host of other benefits.
</Card>

```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;
}
```
