From 4be1a143e602fd0ecd7dba5ad4ca7d689ee704b1 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Thu, 28 Aug 2025 10:35:44 -0400 Subject: [PATCH] Solving parsing issue with NWC --- .../vitorpamplona/quartz/nip47WalletConnect/Response.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip47WalletConnect/Response.kt b/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip47WalletConnect/Response.kt index 4968410be..b653d897b 100644 --- a/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip47WalletConnect/Response.kt +++ b/quartz/src/androidMain/kotlin/com/vitorpamplona/quartz/nip47WalletConnect/Response.kt @@ -37,9 +37,9 @@ class PayInvoiceSuccessResponse( val result: PayInvoiceResultParams? = null, ) : Response("pay_invoice") { class PayInvoiceResultParams( - val preimage: String, + val preimage: String? = null, ) { - fun countMemory(): Long = pointerSizeInBytes + preimage.bytesUsedInMemory() + fun countMemory(): Long = pointerSizeInBytes + (preimage?.bytesUsedInMemory() ?: 0) } override fun countMemory(): Long = pointerSizeInBytes + (result?.countMemory() ?: 0) @@ -49,8 +49,8 @@ class PayInvoiceErrorResponse( val error: PayInvoiceErrorParams? = null, ) : Response("pay_invoice") { class PayInvoiceErrorParams( - val code: ErrorType?, - val message: String?, + val code: ErrorType? = null, + val message: String? = null, ) { fun countMemory(): Long = pointerSizeInBytes + pointerSizeInBytes + (message?.bytesUsedInMemory() ?: 0) }