2021-12-24 12:52:08 +00:00
|
|
|
import 'package:cw_bitcoin/bitcoin_address_record.dart';
|
2023-10-12 22:50:16 +00:00
|
|
|
import 'package:cw_core/unspent_transaction_output.dart';
|
2021-12-24 12:52:08 +00:00
|
|
|
|
2023-10-12 22:50:16 +00:00
|
|
|
class BitcoinUnspent extends Unspent {
|
2023-11-17 00:33:26 +00:00
|
|
|
BitcoinUnspent(BitcoinAddressRecord addressRecord, String hash, int value, int vout,
|
2023-11-28 21:20:19 +00:00
|
|
|
{this.silentPaymentTweak, bool? isTaproot})
|
2023-10-12 22:50:16 +00:00
|
|
|
: bitcoinAddressRecord = addressRecord,
|
2023-11-28 21:20:19 +00:00
|
|
|
isTaproot = isTaproot ?? false,
|
2023-10-12 22:50:16 +00:00
|
|
|
super(addressRecord.address, hash, value, vout, null);
|
2021-12-24 12:52:08 +00:00
|
|
|
|
2023-11-14 23:17:15 +00:00
|
|
|
factory BitcoinUnspent.fromJSON(BitcoinAddressRecord address, Map<String, dynamic> json) =>
|
|
|
|
BitcoinUnspent(
|
2023-11-28 21:20:19 +00:00
|
|
|
address, json['tx_hash'] as String, json['value'] as int, json['tx_pos'] as int,
|
|
|
|
silentPaymentTweak: json['silent_payment_tweak'] as String?,
|
|
|
|
isTaproot: json['is_taproot'] as bool?);
|
2021-12-24 12:52:08 +00:00
|
|
|
|
2023-10-12 22:50:16 +00:00
|
|
|
final BitcoinAddressRecord bitcoinAddressRecord;
|
2023-11-28 21:20:19 +00:00
|
|
|
String? silentPaymentTweak;
|
|
|
|
bool isTaproot = false;
|
2021-12-24 12:52:08 +00:00
|
|
|
}
|