| 1 | import 'package:cw_core/hive_type_ids.dart'; |
| 2 | import 'package:cw_core/unspent_comparable_mixin.dart'; |
| 3 | import 'package:hive/hive.dart'; |
| 4 | |
| 5 | part 'unspent_coins_info.part.dart'; |
| 6 | |
| 7 | // @HiveType(typeId: UnspentCoinsInfo.typeId) |
| 8 | class UnspentCoinsInfo extends HiveObject with UnspentComparable { |
| 9 | UnspentCoinsInfo({ |
| 10 | required this.walletId, |
| 11 | required this.hash, |
| 12 | required this.isFrozen, |
| 13 | required this.isSending, |
| 14 | required this.noteRaw, |
| 15 | required this.address, |
| 16 | required this.vout, |
| 17 | required this.value, |
| 18 | this.keyImage = null, |
| 19 | this.isChange = false, |
| 20 | this.accountIndex = 0, |
| 21 | this.isSilentPayment = false, |
| 22 | }); |
| 23 | |
| 24 | static const typeId = UNSPENT_COINS_INFO_TYPE_ID; |
| 25 | static const boxName = 'Unspent'; |
| 26 | static const boxKey = 'unspentBoxKey'; |
| 27 | |
| 28 | // @HiveField(0, defaultValue: '') |
| 29 | String walletId; |
| 30 | |
| 31 | // @HiveField(1, defaultValue: '') |
| 32 | String hash; |
| 33 | |
| 34 | // @HiveField(2, defaultValue: false) |
| 35 | bool isFrozen; |
| 36 | |
| 37 | // @HiveField(3, defaultValue: false) |
| 38 | bool isSending; |
| 39 | |
| 40 | // @HiveField(4) |
| 41 | String? noteRaw; |
| 42 | |
| 43 | // @HiveField(5, defaultValue: '') |
| 44 | String address; |
| 45 | |
| 46 | // @HiveField(6, defaultValue: 0) |
| 47 | int value; |
| 48 | |
| 49 | // @HiveField(7, defaultValue: 0) |
| 50 | int vout; |
| 51 | |
| 52 | // @HiveField(8, defaultValue: null) |
| 53 | String? keyImage; |
| 54 | |
| 55 | // @HiveField(9, defaultValue: false) |
| 56 | bool isChange; |
| 57 | |
| 58 | // @HiveField(10, defaultValue: 0) |
| 59 | int accountIndex; |
| 60 | |
| 61 | // @HiveField(11, defaultValue: false) |
| 62 | bool? isSilentPayment; |
| 63 | |
| 64 | String get note => noteRaw ?? ''; |
| 65 | |
| 66 | set note(String value) => noteRaw = value; |
| 67 | } |