2021-12-24 12:52:08 +00:00
|
|
|
import 'package:cw_core/balance.dart';
|
2022-03-30 15:57:04 +00:00
|
|
|
import 'package:cw_core/monero_amount_format.dart';
|
2021-12-24 12:52:08 +00:00
|
|
|
|
|
|
|
class MoneroBalance extends Balance {
|
2022-10-12 17:09:57 +00:00
|
|
|
MoneroBalance({required this.fullBalance, required this.unlockedBalance})
|
2021-12-24 12:52:08 +00:00
|
|
|
: formattedFullBalance = moneroAmountToString(amount: fullBalance),
|
|
|
|
formattedUnlockedBalance =
|
|
|
|
moneroAmountToString(amount: unlockedBalance),
|
|
|
|
super(unlockedBalance, fullBalance);
|
|
|
|
|
|
|
|
MoneroBalance.fromString(
|
2022-10-12 17:09:57 +00:00
|
|
|
{required this.formattedFullBalance,
|
|
|
|
required this.formattedUnlockedBalance})
|
2021-12-24 12:52:08 +00:00
|
|
|
: fullBalance = moneroParseAmount(amount: formattedFullBalance),
|
|
|
|
unlockedBalance = moneroParseAmount(amount: formattedUnlockedBalance),
|
|
|
|
super(moneroParseAmount(amount: formattedUnlockedBalance),
|
|
|
|
moneroParseAmount(amount: formattedFullBalance));
|
|
|
|
|
|
|
|
final int fullBalance;
|
|
|
|
final int unlockedBalance;
|
|
|
|
final String formattedFullBalance;
|
|
|
|
final String formattedUnlockedBalance;
|
|
|
|
|
|
|
|
@override
|
|
|
|
String get formattedAvailableBalance => formattedUnlockedBalance;
|
|
|
|
|
|
|
|
@override
|
|
|
|
String get formattedAdditionalBalance => formattedFullBalance;
|
|
|
|
}
|