Handle alternate SimplePool exports

This commit is contained in:
thePR0M3TH3AN committed 2025-10-06 10:42:39 -04:00
1 parent c4cc89af29
commit d35f396c2f
1 file changed
+8 -1
+8 -1
View File
@@ -4292,7 +4292,14 @@ class NostrClient {
}
const tools = await ensureNostrTools();
const SimplePool = tools?.SimplePool;
const SimplePool =
typeof tools?.SimplePool === "function"
? tools.SimplePool
: typeof tools?.pool?.SimplePool === "function"
? tools.pool.SimplePool
: typeof tools?.SimplePool?.SimplePool === "function"
? tools.SimplePool.SimplePool
: null;
if (typeof SimplePool !== "function") {
const error = new Error("NostrTools SimplePool is unavailable.");
error.code = "nostr-simplepool-unavailable";