> For the complete documentation index, see [llms.txt](https://hinkal-team.gitbook.io/hinkal/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hinkal-team.gitbook.io/hinkal/hinkal-mobile-sdk/android/guides/balances.md).

# Balances

Read the Private balance for the connected identity, and check for funds stuck in unspendable UTXOs.

### Shielded balance

```kotlin
val balanceJson = hinkal.getTotalBalance(
    chainId,
    signature,   // userKeysSignature
    address,     // ethAddress
    false,       // resetCache
    false,       // useBlockedUtxos
)
```

The result is JSON with the balance per token. Pass `resetCache = true` to re-scan on-chain instead of using cached UTXOs - do this after a deposit, withdrawal, or transfer.

### Parameters

| Parameter           | Type      | Description                                    |
| ------------------- | --------- | ---------------------------------------------- |
| `chainID`           | `Long`    | Target chain id.                               |
| `userKeysSignature` | `String`  | Signature that unlocks the shielded account.   |
| `ethAddress`        | `String`  | The wallet address.                            |
| `resetCache`        | `Boolean` | Re-scan instead of using cached UTXOs.         |
| `useBlockedUtxos`   | `Boolean` | Include UTXOs blocked by scheduled operations. |

### Stuck balances

Funds can be stuck in UTXOs that normal operations cannot spend (for example after an interrupted deposit-and-withdraw). Check them, then recover with `withdrawStuckUtxos`:

```kotlin
val stuckJson = hinkal.getStuckShieldedBalances(chainId, signature, address)
val recoverTx = hinkal.withdrawStuckUtxos(chainId, tokenAddress, recipientPublicAddress)
```

### Best Practices

#### 1. Cache and refresh deliberately

Read with `resetCache = false` for normal UI reads; pass `resetCache = true` only after a deposit, withdrawal, transfer, or swap.

```kotlin
val fresh = hinkal.getTotalBalance(chainId, signature, address, true, false)
```

#### 2. Check stuck funds when a balance looks low

```kotlin
val stuck = hinkal.getStuckShieldedBalances(chainId, signature, address)
```
