Marmot-TS
    Preparing search index...

    Function serializeApplicationRumor

    • Serializes an application rumor (unsigned Nostr event) to bytes. This is the format used for application messages in Marmot groups.

      Only the six members a Marmot app event may carry are written (foundation/application-messages.md §Encoding), so a signed event or an object with extra fields does not leak a sig or unknown member onto the wire. The result is checked with deserializeApplicationData: a payload every conformant receiver would drop (wrong id, non-integer created_at, unpaired surrogate in a string, ...) throws here instead of being sent.

      Parameters

      • rumor: Rumor

        The unsigned Nostr event to serialize

      Returns Uint8Array

      The serialized application data as bytes

      if the rumor would not decode as a valid Marmot app event