Documentation
    Preparing search index...

    Interface Nip65Registry

    A closure-scoped registry of parsed NIP-65 relay lists keyed by author pubkey. Returned by createNip65Registry. Each registry owns its own Map — two registries never share state (unlike a module-globals pattern).

    const registry = createNip65Registry();
    registry.ingest(event); // store by event.pubkey
    const outbox = registry.resolveOutboxRelays([authorA, authorB]);
    interface Nip65Registry {
        clear(): void;
        delete(pubkey: string): boolean;
        getRelayList(pubkey: string): RelayEntry[] | undefined;
        has(pubkey: string): boolean;
        ingest(event: NostrEvent): RelayEntry[];
        resolveOutboxRelays(pubkeys: readonly string[]): string[];
        resolveReadRelays(pubkeys: readonly string[]): string[];
        setRelayList(pubkey: string, entries: readonly RelayEntry[]): void;
    }
    Index

    Methods

    • Drop a single author's stored relay list. Returns true if one existed.

      Parameters

      • pubkey: string

      Returns boolean

    • Parse and store a kind-10002 event under its own pubkey. Overwrites any previously stored list for that author (kind-10002 is replaceable).

      Parameters

      • event: NostrEvent

        A kind-10002 relay-list event

      Returns RelayEntry[]

      The parsed entries that were stored

    • Resolve write (outbox) relay URLs across the given authors, de-duplicated. Authors with no stored list contribute nothing. Empty input or all-unknown authors yield [].

      Parameters

      • pubkeys: readonly string[]

        Author hex public keys

      Returns string[]

      De-duplicated outbox relay URLs in first-seen order

    • Resolve read (inbox) relay URLs across the given authors, de-duplicated.

      Parameters

      • pubkeys: readonly string[]

        Author hex public keys

      Returns string[]

      De-duplicated inbox relay URLs in first-seen order

    • Store an already-parsed relay list for an explicit pubkey. Use when you parsed elsewhere or want to seed the registry without an event object.

      Parameters

      • pubkey: string

        Author hex public key

      • entries: readonly RelayEntry[]

        Parsed relay entries

      Returns void