diff --git a/packages/ndk/lib/domain_layer/usecases/zaps/Invoice_response.dart b/packages/ndk/lib/domain_layer/usecases/zaps/Invoice_response.dart index 44ae1130..35fd4d43 100644 --- a/packages/ndk/lib/domain_layer/usecases/zaps/Invoice_response.dart +++ b/packages/ndk/lib/domain_layer/usecases/zaps/Invoice_response.dart @@ -5,5 +5,6 @@ class InvoiceResponse { String? nostrPubkey; /// . - InvoiceResponse({required this.invoice, this.nostrPubkey, required this.amountSats}); + InvoiceResponse( + {required this.invoice, this.nostrPubkey, required this.amountSats}); } diff --git a/packages/ndk/lib/domain_layer/usecases/zaps/zap_receipt.dart b/packages/ndk/lib/domain_layer/usecases/zaps/zap_receipt.dart index a1ba1d3f..5ef239e3 100644 --- a/packages/ndk/lib/domain_layer/usecases/zaps/zap_receipt.dart +++ b/packages/ndk/lib/domain_layer/usecases/zaps/zap_receipt.dart @@ -1,23 +1,44 @@ import 'dart:convert'; -import 'package:ndk/domain_layer/entities/nip_01_event.dart'; -import 'package:ndk/domain_layer/usecases/lnurl/lnurl.dart'; - import '../../../shared/logger/logger.dart'; +import '../../entities/nip_01_event.dart'; +import '../lnurl/lnurl.dart'; class ZapReceipt { + /// zap receipt kind static const KIND = 9735; + /// time payment happend int? paidAt; + + /// amount in sats int? amountSats; + + /// pubKey String? pubKey; + + /// invoice String? bolt11; + + /// invoice preimage String? preimage; + + /// pubkey of recipient String? recipient; + + /// nostr eventId String? eventId; + + /// user defined comment String? comment; + + /// pubkey sender String? sender; + + /// String? anon; + + /// lnurl String? lnurl; ZapReceipt.fromEvent(Nip01Event event) { @@ -70,13 +91,13 @@ class ZapReceipt { return false; } // - The invoiceAmount contained in the bolt11 tag of the zap receipt MUST equal the amount tag of the zap request (if present). - if (bolt11!=null && bolt11!.isNotEmpty) { + if (bolt11 != null && bolt11!.isNotEmpty) { if (amountSats != Lnurl.getAmountFromBolt11(bolt11!)) { return false; } } // - The lnurl tag of the zap request (if present) SHOULD equal the recipient's lnurl. - if (lnurl!=null && lnurl!.isNotEmpty) { + if (lnurl != null && lnurl!.isNotEmpty) { if (lnurl != recipientLnurl) { return false; } diff --git a/packages/ndk/lib/domain_layer/usecases/zaps/zap_request.dart b/packages/ndk/lib/domain_layer/usecases/zaps/zap_request.dart index 27d81599..ad0d9296 100644 --- a/packages/ndk/lib/domain_layer/usecases/zaps/zap_request.dart +++ b/packages/ndk/lib/domain_layer/usecases/zaps/zap_request.dart @@ -1,4 +1,4 @@ -import 'package:ndk/domain_layer/entities/nip_01_event.dart'; +import '../../entities/nip_01_event.dart'; /// Zap Request class ZapRequest extends Nip01Event { diff --git a/packages/ndk/lib/domain_layer/usecases/zaps/zaps.dart b/packages/ndk/lib/domain_layer/usecases/zaps/zaps.dart index 679071ef..2ca99f49 100644 --- a/packages/ndk/lib/domain_layer/usecases/zaps/zaps.dart +++ b/packages/ndk/lib/domain_layer/usecases/zaps/zaps.dart @@ -12,7 +12,7 @@ import '../nwc/nwc.dart'; import '../nwc/nwc_connection.dart'; import '../nwc/responses/pay_invoice_response.dart'; import '../requests/requests.dart'; -import 'Invoice_response.dart'; +import 'invoice_response.dart'; import 'zap_receipt.dart'; import 'zap_request.dart';