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.
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 asigor unknown member onto the wire. The result is checked with deserializeApplicationData: a payload every conformant receiver would drop (wrongid, non-integercreated_at, unpaired surrogate in a string, ...) throws here instead of being sent.