fix available balance for monero/wownero

This commit is contained in:
OmarHatem 2024-12-28 07:15:59 +02:00
parent 4bba9f6ddb
commit 2fe2f58cb4
2 changed files with 2 additions and 2 deletions

View file

@ -4,7 +4,7 @@ import 'package:cw_core/monero_amount_format.dart';
class MoneroBalance extends Balance { class MoneroBalance extends Balance {
MoneroBalance({required this.fullBalance, required this.unlockedBalance, this.frozenBalance = 0}) MoneroBalance({required this.fullBalance, required this.unlockedBalance, this.frozenBalance = 0})
: formattedUnconfirmedBalance = moneroAmountToString(amount: fullBalance - unlockedBalance), : formattedUnconfirmedBalance = moneroAmountToString(amount: fullBalance - unlockedBalance),
formattedUnlockedBalance = moneroAmountToString(amount: unlockedBalance - frozenBalance), formattedUnlockedBalance = moneroAmountToString(amount: unlockedBalance),
formattedFrozenBalance = moneroAmountToString(amount: frozenBalance), formattedFrozenBalance = moneroAmountToString(amount: frozenBalance),
super(unlockedBalance, fullBalance); super(unlockedBalance, fullBalance);

View file

@ -4,7 +4,7 @@ import 'package:cw_core/wownero_amount_format.dart';
class WowneroBalance extends Balance { class WowneroBalance extends Balance {
WowneroBalance({required this.fullBalance, required this.unlockedBalance, this.frozenBalance = 0}) WowneroBalance({required this.fullBalance, required this.unlockedBalance, this.frozenBalance = 0})
: formattedUnconfirmedBalance = wowneroAmountToString(amount: fullBalance - unlockedBalance), : formattedUnconfirmedBalance = wowneroAmountToString(amount: fullBalance - unlockedBalance),
formattedUnlockedBalance = wowneroAmountToString(amount: unlockedBalance - frozenBalance), formattedUnlockedBalance = wowneroAmountToString(amount: unlockedBalance),
formattedFrozenBalance = formattedFrozenBalance =
wowneroAmountToString(amount: frozenBalance), wowneroAmountToString(amount: frozenBalance),
super(unlockedBalance, fullBalance); super(unlockedBalance, fullBalance);