[skip ci] wip

This commit is contained in:
Matthew Fosse 2024-11-05 09:22:42 -08:00
parent 97a345e7dc
commit 4c4f697daa

View file

@ -41,6 +41,7 @@ class ElectrumTransactionInfo extends TransactionInfo {
String? to, String? to,
this.unspents, this.unspents,
this.isReceivedSilentPayment = false, this.isReceivedSilentPayment = false,
Map<String, dynamic>? additionalInfo,
}) { }) {
this.id = id; this.id = id;
this.height = height; this.height = height;
@ -54,6 +55,7 @@ class ElectrumTransactionInfo extends TransactionInfo {
this.isReplaced = isReplaced; this.isReplaced = isReplaced;
this.confirmations = confirmations; this.confirmations = confirmations;
this.to = to; this.to = to;
this.additionalInfo = additionalInfo ?? {};
} }
factory ElectrumTransactionInfo.fromElectrumVerbose(Map<String, Object> obj, WalletType type, factory ElectrumTransactionInfo.fromElectrumVerbose(Map<String, Object> obj, WalletType type,
@ -212,6 +214,7 @@ class ElectrumTransactionInfo extends TransactionInfo {
BitcoinSilentPaymentsUnspent.fromJSON(null, unspent as Map<String, dynamic>)) BitcoinSilentPaymentsUnspent.fromJSON(null, unspent as Map<String, dynamic>))
.toList(), .toList(),
isReceivedSilentPayment: data['isReceivedSilentPayment'] as bool? ?? false, isReceivedSilentPayment: data['isReceivedSilentPayment'] as bool? ?? false,
additionalInfo: data['additionalInfo'] as Map<String, dynamic>?,
); );
} }
@ -246,7 +249,8 @@ class ElectrumTransactionInfo extends TransactionInfo {
isReplaced: isReplaced ?? false, isReplaced: isReplaced ?? false,
inputAddresses: inputAddresses, inputAddresses: inputAddresses,
outputAddresses: outputAddresses, outputAddresses: outputAddresses,
confirmations: info.confirmations); confirmations: info.confirmations,
additionalInfo: additionalInfo);
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -265,10 +269,11 @@ class ElectrumTransactionInfo extends TransactionInfo {
m['inputAddresses'] = inputAddresses; m['inputAddresses'] = inputAddresses;
m['outputAddresses'] = outputAddresses; m['outputAddresses'] = outputAddresses;
m['isReceivedSilentPayment'] = isReceivedSilentPayment; m['isReceivedSilentPayment'] = isReceivedSilentPayment;
m['additionalInfo'] = additionalInfo;
return m; return m;
} }
String toString() { String toString() {
return 'ElectrumTransactionInfo(id: $id, height: $height, amount: $amount, fee: $fee, direction: $direction, date: $date, isPending: $isPending, isReplaced: $isReplaced, confirmations: $confirmations, to: $to, unspent: $unspents, inputAddresses: $inputAddresses, outputAddresses: $outputAddresses)'; return 'ElectrumTransactionInfo(id: $id, height: $height, amount: $amount, fee: $fee, direction: $direction, date: $date, isPending: $isPending, isReplaced: $isReplaced, confirmations: $confirmations, to: $to, unspent: $unspents, inputAddresses: $inputAddresses, outputAddresses: $outputAddresses, additionalInfo: $additionalInfo)';
} }
} }