feat: NIP-24

This commit is contained in:
2023-08-17 19:54:14 +01:00
parent 8500dee24f
commit f6a46e3523
51 changed files with 792 additions and 319 deletions

View File

@ -4,7 +4,7 @@ import { unwrap, ExternalStore, unixNowMs } from "@snort/shared";
import { DefaultConnectTimeout } from "./const";
import { ConnectionStats } from "./connection-stats";
import { NostrEvent, ReqCommand, TaggedRawEvent, u256 } from "./nostr";
import { NostrEvent, ReqCommand, TaggedNostrEvent, u256 } from "./nostr";
import { RelayInfo } from "./relay-info";
export type AuthHandler = (challenge: string, relay: string) => Promise<NostrEvent | undefined>;
@ -62,7 +62,7 @@ export class Connection extends ExternalStore<ConnectionStateSnapshot> {
ReconnectTimer?: ReturnType<typeof setTimeout>;
EventsCallback: Map<u256, (msg: boolean[]) => void>;
OnConnected?: (wasReconnect: boolean) => void;
OnEvent?: (sub: string, e: TaggedRawEvent) => void;
OnEvent?: (sub: string, e: TaggedNostrEvent) => void;
OnEose?: (sub: string) => void;
OnDisconnect?: (code: number) => void;
Auth?: AuthHandler;