Hinkal Mobile SDK

Balances

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

Shielded balance

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

ParameterTypeDescription
chainIDLongTarget chain id.
userKeysSignatureStringSignature that unlocks the shielded account.
ethAddressStringThe wallet address.
resetCacheBooleanRe-scan instead of using cached UTXOs.
useBlockedUtxosBooleanInclude 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:

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.

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

2. Check stuck funds when a balance looks low

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