From 32f01e3e328db0006a55c6324625b49d60244b66 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 28 Feb 2026 15:16:20 -0800 Subject: fix typescript issues --- lib/nostr.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'lib/nostr.ts') diff --git a/lib/nostr.ts b/lib/nostr.ts index bcb20ea1..7ed41f36 100644 --- a/lib/nostr.ts +++ b/lib/nostr.ts @@ -1,5 +1,5 @@ import config from "$config"; -import { db, g, s } from "$lib/db"; +import { db, g } from "$lib/db"; import { l, warn } from "$lib/logging"; import { scan } from "$lib/strfry"; import { fail, fields, getUser, pick } from "$lib/utils"; @@ -23,8 +23,7 @@ const alwaysTrue: any = (t: Event) => { t[Symbol("verified")] = true; return true; }; -export const pool = new AbstractSimplePool({ verifyEvent: alwaysTrue }); -const opts = { maxWait: 2000 }; +export const pool = new (AbstractSimplePool as any)({ verifyEvent: alwaysTrue }); export const anon = (pubkey) => ({ username: pubkey.substr(0, 6), @@ -124,9 +123,10 @@ export const getRelays = async (pubkey): Promise => { if (!r[2] || r[2] === "read") read.push(r[1]); } } else - pool + (pool as any) .get(relays, filter) - .then(send) + // @ts-ignore + .then(send as any) .catch(() => {}); return { read, write }; @@ -163,7 +163,8 @@ export const getCount = async (pubkey) => { let followers = await g(k); if (followers === null) { - [followers] = await count({ + // @ts-ignore + [followers] = await (count as any)({ "#p": [pubkey], kinds: [3], }); @@ -220,7 +221,7 @@ export const q = async (f) => { const p = new Promise((resolve) => { const r = []; - pool.subscribeMany(["wss://relay.primal.net"], [f], { + (pool as any).subscribeMany(["wss://relay.primal.net"], [f], { onevent(e) { r.push(e); coinos.publish(e); -- cgit v1.2.3