2020-08-25 16:32:40 +00:00
|
|
|
import 'package:cake_wallet/bitcoin/bitcoin_address_record.dart';
|
|
|
|
|
|
|
|
class BitcoinUnspent {
|
2021-07-05 13:52:24 +00:00
|
|
|
BitcoinUnspent(this.address, this.hash, this.value, this.vout)
|
|
|
|
: isSending = true,
|
|
|
|
isFrozen = false,
|
|
|
|
note = '';
|
2020-08-25 16:32:40 +00:00
|
|
|
|
|
|
|
factory BitcoinUnspent.fromJSON(
|
|
|
|
BitcoinAddressRecord address, Map<String, dynamic> json) =>
|
|
|
|
BitcoinUnspent(address, json['tx_hash'] as String, json['value'] as int,
|
|
|
|
json['tx_pos'] as int);
|
|
|
|
|
|
|
|
final BitcoinAddressRecord address;
|
|
|
|
final String hash;
|
|
|
|
final int value;
|
|
|
|
final int vout;
|
|
|
|
|
2021-05-07 07:36:38 +00:00
|
|
|
bool get isP2wpkh =>
|
|
|
|
address.address.startsWith('bc') || address.address.startsWith('ltc');
|
2021-07-05 13:52:24 +00:00
|
|
|
bool isSending;
|
|
|
|
bool isFrozen;
|
|
|
|
String note;
|
2020-08-25 16:32:40 +00:00
|
|
|
}
|