Get SOL Balance
Retrieve your private SOL balance from Privacy Cash.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
abortSignal | AbortSignal | No | Optional signal to abort the request |
Returns
Example
Get SPL Token Balance
Retrieve your private balance for any supported SPL token.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
mintAddress | PublicKey | string | Yes | The SPL token mint address |
Returns
Example
Get USDC Balance
Convenience method specifically for USDC.Returns
Example
Supported Tokens
| Token | Mint Address | Decimals | Units per Token |
|---|---|---|---|
| SOL | Native | 9 | 1,000,000,000 |
| USDC | EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v | 6 | 1,000,000 |
| USDT | Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB | 6 | 1,000,000 |
| ZEC | A7bdiYdS5GjqGFtxf17ppRHtDKPkkRqbKtR27dxvQXaS | 8 | 100,000,000 |
| ORE | oreoU2P8bN6jkk3jbaiVxYnG1dCXcYxwhwyK9jSybcp | 11 | 100,000,000,000 |
| STORE | sTorERYB6xAZ1SSbwpK3zoK2EEwbBrc7TZAzg1uCGiH | 11 | 100,000,000,000 |
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
