Overview
In order to have a shared order's book, Mostro daemon send Addressable Events with 38383
as event kind
, you can find more details about that specific event here
The Message
All messages from/to Mostro should be Gift wrap Nostr events, the content
of the rumor
event is an array
, the first element should be a JSON-serialized string
(with no white space or line breaks), the second element is the signature
of the sha256 hash of the serialized first element, here the structure of the first element:
- Wrapper: Wrapper of the Message
- <
version
integer>: Version of the protocol, currently1
- [
id
integer]: (optional) Wrapper Id - [
request_id
integer]: (optional) Mostro daemon should send back this same id in the response - [
trade_index
integer]: (optional) This field is used by users who wants to maintain reputation, it should be the index of the trade in the user's trade history - <
action
string>: Action to be performed by Mostro daemon - [
payload
string]: (optional) Payload of the message, it should be a JSON-serialized string. The content of this field depends on theaction
field.
- <
Here an example of a new-order
order message:
{
"order": {
"version": 1,
"id": "<Order id>",
"request_id": 123456,
"trade_index": 1,
"action": "new-order",
"payload": {
"order": {
"id": "<Order id>",
"kind": "sell",
"status": "pending",
"amount": 0,
"fiat_code": "VES",
"fiat_amount": 100,
"payment_method": "face to face",
"premium": 1,
"created_at": 1698870173
}
}
}
}