Merge pull request #297 from PR0M3TH3AN/codex/fix-bitcoin-zap-failure-and-improve-logging

Handle namespace-style NostrTools nip04 exports for zaps
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2025-10-05 00:48:47 -04:00
commit c2620a7564
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.`);
}
}