Fix NostrTools detection for zaps

This commit is contained in:
thePR0M3TH3AN committed 2025-10-04 23:48:23 -04:00
1 parent 2132a913d5
commit d843a6aa51
1 file changed
+4 -1
+4 -1
View File
@@ -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.`);
}
}