cake_wallet/cw_zano/lib/model/zano_balance.dart

18 lines
694 B
Dart
Raw Normal View History

2023-11-17 17:40:23 +00:00
import 'package:cw_core/balance.dart';
import 'package:cw_zano/zano_formatter.dart';
2023-10-02 14:17:35 +00:00
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;
final int decimalPoint;
2024-04-06 10:03:11 +00:00
ZanoBalance({required this.total, required this.unlocked, this.decimalPoint = ZanoFormatter.defaultDecimalPoint}) : super(unlocked, total - unlocked);
ZanoBalance.empty({this.decimalPoint = ZanoFormatter.defaultDecimalPoint}): total = 0, unlocked = 0, super(0, 0);
2023-12-14 04:51:16 +00:00
2023-11-17 17:40:23 +00:00
@override
String get formattedAdditionalBalance => ZanoFormatter.intAmountToString(total - unlocked, decimalPoint);
2023-11-17 17:40:23 +00:00
@override
String get formattedAvailableBalance => ZanoFormatter.intAmountToString(unlocked, decimalPoint);
2023-11-17 17:40:23 +00:00
}