@softcose/softchat - v0.1.0
    Preparing search index...

    Class RelaySession

    Serialized relay protocol state machine.

    The host retains WebSocket, persistence, reachability, and retry scheduling.

    Index
    • Confirm socket handoff after a drained authored-event frame is sent.

      Empty event lists are accepted for subscription and control frames.

      Parameters

      Returns void

    • Remove at most limit queued outbound frame records.

      Parameters

      • limit: number = 256

      Returns readonly Readonly<{ deliveryEventIds: readonly NostrEventId[]; frame: string }>[]

    • Queue one bounded batch of signed events for delivery tracking.

      Parameters

      Returns void

    • Consume one relay text frame and return required platform actions.

      Parameters

      • frameJson: string

      Returns readonly Readonly<
          {
              delayMilliseconds: number;
              deliveryDecision?: Readonly<
                  {
                      category: string;
                      eventId: NostrEventId;
                      relayMessage: string;
                      state: DeliveryState;
                  },
              >;
              event?: Readonly<
                  {
                      content: string;
                      createdAt: number;
                      id: NostrEventId;
                      kind: NostrEventKind;
                      publicKey: NostrPublicKey;
                      signature: NostrEventSignature;
                      tags: readonly NostrTag[];
                  },
              >;
              frame: string;
              kind: | "openTransport"
              | "sendFrame"
              | "authenticate"
              | "persistEvent"
              | "subscriptionReady"
              | "subscriptionClosed"
              | "deliveryChanged"
              | "closeTransport"
              | "scheduleReconnect";
              reason: string;
              value: string;
          },
      >[]

    • Add or replace a subscription using canonical filter JSON values.

      Parameters

      • id: string
      • filtersJson: readonly string[]

      Returns void

    • Notify the session of transport loss and calculate recovery actions.

      Returns readonly Readonly<
          {
              delayMilliseconds: number;
              deliveryDecision?: Readonly<
                  {
                      category: string;
                      eventId: NostrEventId;
                      relayMessage: string;
                      state: DeliveryState;
                  },
              >;
              event?: Readonly<
                  {
                      content: string;
                      createdAt: number;
                      id: NostrEventId;
                      kind: NostrEventKind;
                      publicKey: NostrPublicKey;
                      signature: NostrEventSignature;
                      tags: readonly NostrTag[];
                  },
              >;
              frame: string;
              kind: | "openTransport"
              | "sendFrame"
              | "authenticate"
              | "persistEvent"
              | "subscriptionReady"
              | "subscriptionClosed"
              | "deliveryChanged"
              | "closeTransport"
              | "scheduleReconnect";
              reason: string;
              value: string;
          },
      >[]