Typing all the types
This commit is contained in:
20
nostr.ts
20
nostr.ts
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user