Documentation
    Preparing search index...

    Interface RelayPoolAdapter

    Abstract relay pool — runtime uses this to subscribe to and publish events on real Nostr relays. Implementor wraps their relay library.

    interface RelayPoolAdapter {
        closeScopedRelay(windowId: string): void;
        isAvailable(): boolean;
        openScopedRelay(
            windowId: string,
            relayUrl: string,
            subId: string,
            filters: NostrFilter[],
            sendToNapplet: SendToNapplet,
        ): void;
        publish(event: NostrEvent): void;
        publishToScopedRelay(windowId: string, event: NostrEvent): boolean;
        selectRelayTier(filters: NostrFilter[]): string[];
        subscribe(
            filters: NostrFilter[],
            callback: (item: NostrEvent | "EOSE") => void,
            relayUrls?: string[],
        ): RelaySubscriptionHandle;
        trackSubscription(subKey: string, cleanup: () => void): void;
        untrackSubscription(subKey: string): void;
    }
    Index

    Methods

    • Track a subscription key for lifecycle management.

      Parameters

      • subKey: string
      • cleanup: () => void

      Returns void