mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-05 12:22:28 +00:00
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:
1 file changed
+4
-1
@@ -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.`);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user