From 13c8faa65dc75a14a6eb6b4dc8cfc677c3cb5c47 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 6 Mar 2026 15:11:53 -0800 Subject: drop abstract pool use --- lib/nostr.ts | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'lib') diff --git a/lib/nostr.ts b/lib/nostr.ts index e98e56a8..a2aee59b 100644 --- a/lib/nostr.ts +++ b/lib/nostr.ts @@ -6,7 +6,6 @@ import { fail, fields, getUser, pick } from "$lib/utils"; import { bytesToHex, hexToBytes } from "@noble/hashes/utils.js"; import { finalizeEvent, getPublicKey, nip19, verifyEvent } from "nostr-tools"; import type { Event } from "nostr-tools"; -import { AbstractSimplePool } from "nostr-tools/abstract-pool"; import { Relay } from "nostr-tools/relay"; export const EX = 60 * 60 * 24; @@ -19,12 +18,6 @@ export const serverSecret2 = bytesToHex(nip19.decode(config.nostrKey2).data as U export const serverPubkey = getPublicKey(hexToBytes(serverSecret)); export const serverPubkey2 = getPublicKey(hexToBytes(serverSecret2)); -const alwaysTrue: any = (t: Event) => { - t[Symbol("verified")] = true; - return true; -}; -export const pool = new (AbstractSimplePool as any)({ verifyEvent: alwaysTrue }); - export const anon = (pubkey) => ({ username: pubkey.substr(0, 6), pubkey, @@ -108,7 +101,7 @@ export async function handleZap(invoice, sender = undefined) { export const getRelays = async (pubkey): Promise => { const { relays } = config; const filter = { authors: [pubkey], kinds: [10002] }; - const result = await scan(filter); + const result = await q(filter); let read = relays; let write = relays; @@ -122,12 +115,7 @@ export const getRelays = async (pubkey): Promise => { if (!r[2] || r[2] === "write") write.push(r[1]); if (!r[2] || r[2] === "read") read.push(r[1]); } - } else - (pool as any) - .get(relays, filter) - // @ts-ignore - .then(send as any) - .catch(() => {}); + } return { read, write }; }; -- cgit v1.2.3