Skip to main content

Get SOL Balance

Retrieve your private SOL balance from Privacy Cash.

Parameters

Returns

Example


Get SPL Token Balance

Retrieve your private balance for any supported SPL token.

Parameters

Returns

Example


Get USDC Balance

Convenience method specifically for USDC.

Returns

Example


Supported Tokens


How Balance Checking Works

1

Fetch Encrypted UTXOs

The SDK fetches all encrypted UTXOs from the relayer API
2

Decrypt Your UTXOs

Using your encryption key, the SDK decrypts UTXOs that belong to you
3

Check Spent Status

Each UTXO is checked on-chain to see if it has been spent
4

Sum Unspent

The amounts of all unspent UTXOs are summed to get your balance

Caching

The SDK caches decrypted UTXOs locally for faster subsequent balance checks:

Aborting Balance Requests

For long-running balance checks, you can abort the request:

Complete Example