getBalance method
Implementation
int getBalance(String walletId, String unit) {
_initBalanceStream(walletId);
final balances = _walletsBalances[walletId];
if (balances == null) {
return 0;
}
final balance =
balances.firstWhereOrNull((balance) => balance.unit == unit);
return balance?.amount ?? 0;
}