Skip to main content

Balance Management

This guide covers querying and managing token balances in the Privacy Boost Android SDK.

Understanding Balances

Privacy Boost tracks two types of balances:

Get Single Token Balance

Get All Balances

Balance Type

Formatting Amounts

Convert between wei strings and human-readable format:

Checking Sufficient Balance

Before performing operations, verify the user has enough balance:

ViewModel Integration

Displaying Balances in Compose

Error Handling

Best Practices

1. Refresh After Operations

2. Handle Zero Balances

3. Filter Non-Zero Balances

Next Steps