Skip to main content

Module message

Module message 

Source
Expand description

Protocol message envelope exchanged between clients and a Mostro node.

The top-level type is Message, a tagged union that carries a MessageKind together with a discriminator (order, dispute, DM, rate, can’t-do, restore). MessageKind holds the shared fields present on every request/response: protocol version, optional identifier, trade index, Action and Payload.

In transit, messages are serialized to JSON, optionally signed with the sender’s trade keys using Message::sign, and wrapped in a NIP-59 envelope by crate::nip59::wrap_message.

Structs§

MessageKind
Body shared by every Message variant.
PaymentFailedInfo
Retry configuration for a failed Lightning payment.
Peer
Identity of a counterpart in a trade.
RestoreSessionInfo
Bundle of orders and disputes returned on a session restore.
RestoredDisputeHelper
Row-mapper used by mostrod when fetching disputes for session restore.
RestoredDisputesInfo
Minimal per-dispute information returned to a client on session restore.
RestoredOrderHelper
Row-mapper used by mostrod when fetching metadata for session restore.
RestoredOrdersInfo
Minimal per-order information returned to a client on session restore.

Enums§

Action
Discriminator describing the verb of a Mostro message.
DisputeInitiator
Identifies which party of an order opened a dispute.
Message
Top-level Mostro message exchanged between users and Mostro.
Payload
Typed payload attached to a MessageKind.