From d843a6aa51010474a66e3edec6016c7ac67ebc11 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Sat, 4 Oct 2025 23:48:23 -0400 Subject: [PATCH] Fix NostrTools detection for zaps --- js/payments/nwcClient.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/payments/nwcClient.js b/js/payments/nwcClient.js index 75863ab0..a3b85588 100644 --- a/js/payments/nwcClient.js +++ b/js/payments/nwcClient.js @@ -38,7 +38,10 @@ function assertNostrTools(methods = []) { throw new Error("NostrTools is required for NWC operations."); } for (const method of methods) { - if (typeof tools?.[method] !== "function") { + const candidate = tools?.[method]; + const isCallable = typeof candidate === "function"; + const isNamespace = candidate && typeof candidate === "object"; + if (!isCallable && !isNamespace) { throw new Error(`NostrTools.${method} is unavailable.`); } }