Documentation
    Preparing search index...

    Interface OutboxRelayPool

    Relay pool contract the router drives. Implementors adapt their pool library while the router retains relay selection and event attribution.

    interface OutboxRelayPool {
        isAvailable(): boolean;
        publish(
            event: NostrEvent,
            relayUrls: string[],
        ): void | Record<string, boolean> | Promise<Record<string, boolean>>;
        subscribe(
            filters: NostrFilter[],
            relayUrls: string[],
            callback: (item: NostrEvent | "EOSE") => void,
            origin?: OutboxRelayOrigin,
            authors?: readonly string[],
        ): { unsubscribe(): void };
    }
    Index

    Methods

    • Publish event to relayUrls, optionally returning per-relay outcomes.

      Parameters

      Returns void | Record<string, boolean> | Promise<Record<string, boolean>>

    • Subscribe to filters on exactly relayUrls.

      Parameters

      • filters: NostrFilter[]

        NIP-01 filters.

      • relayUrls: string[]

        Relays this call must use.

      • callback: (item: NostrEvent | "EOSE") => void

        Receives matching events or 'EOSE'.

      • Optionalorigin: OutboxRelayOrigin

        Why relayUrls are in this read, when the router knows.

      • Optionalauthors: readonly string[]

        NIP-65 owners for these relays, or requested authors for hints/fallback; an empty array authoritatively means no authors.

      Returns { unsubscribe(): void }