cake_wallet/cw_nano/lib/banano_balance.dart
Matthew Fosse fe2e26f146
Minor nano fixes + abstract nano utils out into package (#1250)
* fixes

* refactors

* fixes

* more fixes

* fixes for monero.com

* update confirmed balance to receivable balance

* fix balance display bug

* remove print statements

* prevent unnecessary writes

* review fixes

* forgot to add pubspec changes

* fix

* fix sync status desyncing on rpc fail

* fix

* update translations + txDetails fixes

* squash balance bug

* add source address on tx info

* fix
2024-01-12 01:00:41 +02:00

19 lines
599 B
Dart

import 'package:cw_core/balance.dart';
import 'package:nanoutil/nanoutil.dart';
class BananoBalance extends Balance {
final BigInt currentBalance;
final BigInt receivableBalance;
BananoBalance({required this.currentBalance, required this.receivableBalance}) : super(0, 0);
@override
String get formattedAvailableBalance {
return NanoAmounts.getRawAsUsableString(currentBalance.toString(), NanoAmounts.rawPerBanano);
}
@override
String get formattedAdditionalBalance {
return NanoAmounts.getRawAsUsableString(receivableBalance.toString(), NanoAmounts.rawPerBanano);
}
}