Documentation
    Preparing search index...

    Interface OutboxRelayPool

    Relay pool contract the router drives. Implementors adapt their pool library (nostr-tools SimplePool, applesauce-relay, etc.). Unlike the lower-level relay NAP pool, both methods take an explicit relay-URL set so the router controls outbox routing and can attribute events to the relay they arrived on.

    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,
        ): { unsubscribe(): void };
    }
    Index

    Methods

    • Publish event to relayUrls. May return a per-relay success map; a void/missing return is treated as optimistic success on every target.

      Parameters

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

    • Subscribe to filters on exactly relayUrls. The callback receives each matching event or the literal 'EOSE' once stored events are exhausted. Returns a handle to cancel the subscription.

      Parameters

      Returns { unsubscribe(): void }