2023-11-17 17:40:23 +00:00
|
|
|
import 'package:cw_core/balance.dart';
|
2024-03-18 12:15:54 +00:00
|
|
|
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;
|
2024-03-18 12:15:54 +00:00
|
|
|
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
|
2024-03-18 12:15:54 +00:00
|
|
|
String get formattedAdditionalBalance => ZanoFormatter.intAmountToString(total - unlocked, decimalPoint);
|
2023-11-17 17:40:23 +00:00
|
|
|
|
|
|
|
@override
|
2024-03-18 12:15:54 +00:00
|
|
|
String get formattedAvailableBalance => ZanoFormatter.intAmountToString(unlocked, decimalPoint);
|
2023-11-17 17:40:23 +00:00
|
|
|
}
|