| 1 | import 'package:cw_core/unspent_comparable_mixin.dart'; |
| 2 | |
| 3 | class Unspent with UnspentComparable { |
| 4 | Unspent(this.address, this.hash, this.value, this.vout, this.keyImage) |
| 5 | : isSending = true, |
| 6 | isFrozen = false, |
| 7 | isChange = false, |
| 8 | note = ''; |
| 9 | |
| 10 | final String address; |
| 11 | final String hash; |
| 12 | final int value; |
| 13 | final int vout; |
| 14 | final String? keyImage; |
| 15 | |
| 16 | bool isChange; |
| 17 | bool isSending; |
| 18 | bool isFrozen; |
| 19 | int? confirmations; |
| 20 | String note; |
| 21 | |
| 22 | bool get isP2wpkh => |
| 23 | address.startsWith('bc') || address.startsWith('tb') || address.startsWith('ltc'); |
| 24 | |
| 25 | @override |
| 26 | String toString() { |
| 27 | return 'Unspent(address: $address, hash: $hash, value: $value, vout: $vout, keyImage: $keyImage, isSending: $isSending, isFrozen: $isFrozen, isChange: $isChange, note: $note)'; |
| 28 | } |
| 29 | } |