From d4bac45943cc58f11e3fe6ccfbd361eb64d25d0e Mon Sep 17 00:00:00 2001 From: ruben beck Date: Mon, 16 Oct 2023 17:07:30 +0200 Subject: [PATCH] add funding and closing transaction to paymentMinutiae --- lib/models/payment_minutiae.dart | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lib/models/payment_minutiae.dart b/lib/models/payment_minutiae.dart index 8b47a8654..85514ae74 100644 --- a/lib/models/payment_minutiae.dart +++ b/lib/models/payment_minutiae.dart @@ -30,6 +30,8 @@ class PaymentMinutiae { final bool hasMetadata; final bool isKeySend; final PaymentStatus status; + final String? fundingTxid; + final String? closingTxid; const PaymentMinutiae({ required this.id, @@ -50,6 +52,8 @@ class PaymentMinutiae { required this.hasMetadata, required this.isKeySend, required this.status, + required this.fundingTxid, + required this.closingTxid, }); factory PaymentMinutiae.fromPayment(Payment payment, BreezTranslations texts) { @@ -73,6 +77,8 @@ class PaymentMinutiae { hasMetadata: factory._hasMetadata(), isKeySend: factory._isKeySend(), status: payment.status, + fundingTxid: factory._fundingTx(), + closingTxid: factory._closedTx(), ); } } @@ -286,4 +292,20 @@ class _PaymentMinutiaeFactory { final details = _payment.details.data; return (details is LnPaymentDetails) ? details.keysend : false; } + + String? _fundingTx() { + final details = _payment.details.data; + if (details is ClosedChannelPaymentDetails) { + return details.fundingTxid; + } + return null; + } + + String? _closedTx() { + final details = _payment.details.data; + if (details is ClosedChannelPaymentDetails) { + return details.closingTxid; + } + return null; + } }