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

# Balance

> Check your private EVM balance on Privacy Cash

## Get Private Balance

Retrieve your private ETH or ERC-20 balance from a Privacy Cash EVM pool.

```typescript theme={null}
import { getBalance } from 'privacycash-evm'

const result = await getBalance({
  signature: string,
  address: string,
  token?: 'eth' | 'usdc' | 'usdt',
  network?: NetworkConfig | number
})
```

### Parameters

| Parameter   | Type                        | Required | Description                                                  |
| ----------- | --------------------------- | -------- | ------------------------------------------------------------ |
| `signature` | `string`                    | Yes      | Wallet signature of the Privacy Cash sign-in message         |
| `address`   | `string`                    | Yes      | Your EVM wallet address                                      |
| `token`     | `'eth' \| 'usdc' \| 'usdt'` | No       | Token balance to scan. Defaults to `'eth'`                   |
| `network`   | `NetworkConfig \| number`   | No       | EVM network. Defaults from `NEXT_PUBLIC_CHAIN_ID`, then Base |

### Returns

```typescript theme={null}
{
  balance: string // token balance as a decimal string, e.g. "0.123456789"
}
```

### Example

```typescript theme={null}
import { ethers } from 'ethers'
import { BASE_NETWORK, ETH_NETWORK, getBalance } from 'privacycash-evm'

const network = ETH_NETWORK // or BASE_NETWORK
const SIGN_MESSAGE = 'Privacy Money account sign in'

const provider = new ethers.providers.JsonRpcProvider(network.rpcUrl, {
  name: network.chainKey,
  chainId: network.chainId,
})
const signer = new ethers.Wallet(process.env.PRIVATE_KEY!, provider)

const signature = await signer.signMessage(SIGN_MESSAGE)
const address = await signer.getAddress()

const result = await getBalance({ signature, address, token: 'eth', network })

console.log('Private ETH balance:', result.balance, 'ETH')
```

***

## How Balance Works

`getBalance()` scans all on-chain `NewCommitment` events emitted by the Privacy Cash contract and attempts to decrypt each one using your derived encryption key. UTXOs that decrypt successfully and have not been spent are summed to produce your total balance.

No private key or encryption key is ever sent off-device — all decryption happens locally.

***

## Supported Tokens

Privacy Cash EVM currently supports these token pools:

| Network  | Tokens    |
| -------- | --------- |
| Base     | ETH, USDC |
| Ethereum | ETH, USDT |
