Typing all the types

This commit is contained in:
2024-10-23 00:27:20 +02:00
parent edaf5f5c71
commit 46ad9813eb
15 changed files with 97 additions and 105 deletions

View File

@@ -1,21 +1,15 @@
import { NPool, NRelay1 } from "@nostrify/nostrify";
import config from "./config.ts";
export interface NEvent {
content: string;
created_at: number;
id: string;
kind: number;
pubkey: string;
sig: string;
tags: Array<[string, string, string?]>;
}
const relayPool = new NPool({
open: (url) => new NRelay1(url),
reqRouter: async (filters) => new Map(
config.relay_urls.map(url => [ url, filters ])
)
// deno-lint-ignore require-await
reqRouter: async (filters) =>
new Map(
config.relay_urls.map((url) => [url, filters]),
),
// deno-lint-ignore require-await
eventRouter: async (_event) => [],
});
export async function fetchReplaceableEvent(