mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-03 09:29:48 +00:00
c9a6abeea4
* fix: Confirm widget is still mounted * feat: Modify balance display to include full balance * fix: Modifying balance * chore: Feature cleanup * fix: Add frozen balance into consideration when taking available balance and add field to make full balance display only on bitcoin and litecoin wallets * fix: Adjust balance card to display correct available and unavailable balance, unavailable balance should only be displayed when there is one WIP * fix: Cleanup balance page and balance page view_model * chore: Revert formatting * fix: Remove full balance * fix: Remove full balance * fix: Remove full balance * chore: Rever formating [skip ci] * feat: Finalize display only available and unavailable balance * fix: Modify the way balance is displayed, activate frozen balance with label, remove unavailable/additional balance for bitcoin wallet type * fix: Issues coming from syncing with main * fix: Modify additional balance label * fix: Monero and Wownero balances display bug * fix: Resolve merge conflicts * feat: Activate CPFP for BTC, LTC and BCH, also fix issues with frozen balance display * - minor fix - remove unused functions * Fix conflicts --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com> Co-authored-by: tuxsudo <tuxsudo@tux.pizza>
27 lines
1 KiB
Dart
27 lines
1 KiB
Dart
import 'package:cw_core/balance.dart';
|
|
import 'package:cw_core/monero_amount_format.dart';
|
|
|
|
class MoneroBalance extends Balance {
|
|
MoneroBalance({required this.fullBalance, required this.unlockedBalance, this.frozenBalance = 0})
|
|
: formattedUnconfirmedBalance = moneroAmountToString(amount: fullBalance - unlockedBalance),
|
|
formattedUnlockedBalance = moneroAmountToString(amount: unlockedBalance - frozenBalance),
|
|
formattedFrozenBalance = moneroAmountToString(amount: frozenBalance),
|
|
super(unlockedBalance, fullBalance);
|
|
|
|
final int fullBalance;
|
|
final int unlockedBalance;
|
|
final int frozenBalance;
|
|
final String formattedUnconfirmedBalance;
|
|
final String formattedUnlockedBalance;
|
|
final String formattedFrozenBalance;
|
|
|
|
@override
|
|
String get formattedUnAvailableBalance =>
|
|
formattedFrozenBalance == '0.0' ? '' : formattedFrozenBalance;
|
|
|
|
@override
|
|
String get formattedAvailableBalance => formattedUnlockedBalance;
|
|
|
|
@override
|
|
String get formattedAdditionalBalance => formattedUnconfirmedBalance;
|
|
}
|