diff options
| author | Adam Soltys <[email protected]> | 2026-02-28 15:16:20 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-28 15:16:20 -0800 |
| commit | 32f01e3e328db0006a55c6324625b49d60244b66 (patch) | |
| tree | b97866549b919964957365e1e05681e85af7021a /routes/nostr.ts | |
| parent | a1632ae402d11fdd7ffc360de97c55e0b4fad677 (diff) | |
| download | coinos-server-32f01e3e328db0006a55c6324625b49d60244b66.tar.gz coinos-server-32f01e3e328db0006a55c6324625b49d60244b66.zip | |
fix typescript issues
Diffstat (limited to 'routes/nostr.ts')
| -rw-r--r-- | routes/nostr.ts | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/routes/nostr.ts b/routes/nostr.ts index 554a230c..de6dac13 100644 --- a/routes/nostr.ts +++ b/routes/nostr.ts @@ -1,5 +1,5 @@ import config from "$config"; -import { db, g, s } from "$lib/db"; +import { db, g } from "$lib/db"; import ln from "$lib/ln"; import { EX, @@ -18,7 +18,7 @@ import { bail, fail, fields, getUser } from "$lib/utils"; import got from "got"; import type { Event } from "nostr-tools"; import { decode } from "nostr-tools/nip19"; -import type { ProfilePointer } from "nostr-tools/nip19"; + import { getZapEndpoint, makeZapRequest } from "nostr-tools/nip57"; export default { @@ -163,7 +163,8 @@ export default { const filter = { kinds: [9735], "#e": [id] }; let events = await scan(filter); if (!events.length) { - await sync("wss://relay.primal.net", filter); + // @ts-ignore + await (sync as any)("wss://relay.primal.net", filter); events = await scan(filter); } if (!events.length) return c.json([]); @@ -331,7 +332,7 @@ export default { } else { const records = await db.sMembers("nip5"); for (const s of records) { - const [name, pubkey] = s.split(":"); + const [name, pubkey] = (s as string).split(":"); names[name] = pubkey; } } @@ -346,8 +347,8 @@ export default { async profile(c) { const profile = c.req.param("profile"); const { data } = decode(profile); - const { pubkey, relays } = data as ProfilePointer; - const recipient = await getProfile(pubkey, relays); + const { pubkey, relays } = data as any; + const recipient = await (getProfile as any)(pubkey, relays); recipient.relays = relays; return c.json(recipient); }, @@ -357,7 +358,7 @@ export default { const body = await c.req.json(); const { amount, id } = body; const { pubkey } = await get({ ids: [id] }); - const event = await makeZapRequest({ + const event = await (makeZapRequest as any)({ profile: pubkey, event: id, amount: amount * 1000, |
