cake_wallet/cw_zano/lib/zano_balance.dart

24 lines
774 B
Dart
Raw Normal View History

2023-11-17 17:40:23 +00:00
import 'package:cw_core/balance.dart';
2023-10-02 14:17:35 +00:00
import 'package:cw_core/crypto_currency.dart';
2023-12-14 04:51:16 +00:00
import 'package:cw_core/monero_amount_format.dart';
2023-10-02 14:17:35 +00:00
import 'package:cw_core/monero_balance.dart';
import 'package:cw_zano/api/balance_list.dart';
import 'package:cw_zano/api/structs/zano_balance_row.dart';
2023-11-17 17:40:23 +00:00
class ZanoBalance extends Balance {
2023-12-14 04:51:16 +00:00
final int total;
final int unlocked;
ZanoBalance({required this.total, required this.unlocked}): super(unlocked, 0);
2023-11-17 17:40:23 +00:00
@override
2023-12-14 04:51:16 +00:00
String get formattedAdditionalBalance => moneroAmountToString(amount: additional);
2023-11-17 17:40:23 +00:00
@override
2023-12-14 04:51:16 +00:00
String get formattedAvailableBalance => moneroAmountToString(amount: unlocked);
2023-11-17 17:40:23 +00:00
2023-12-14 04:51:16 +00:00
@override
String get formattedFrozenBalance => total == unlocked ? '' : moneroAmountToString(amount: total - unlocked);
2023-11-17 17:40:23 +00:00
}