Skip to content

Commit 9c834af

Browse files
authored
Merge pull request #25 from MostroP2P/add-new-kind-constants
Add separate event kinds for ratings, info, and disputes
2 parents 8eeb79e + 22dc032 commit 9c834af

File tree

8 files changed

+33
-10
lines changed

8 files changed

+33
-10
lines changed

src/admin_cancel_order.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ The second event updates the addressable dispute event with status `seller-refun
7474
"id": "098e8622eae022a79bc793984fccbc5ea3f6641bdcdffaa031c00d3bd33ca5a0",
7575
"pubkey": "<Mostro's pubkey>",
7676
"created_at": 1703274022,
77-
"kind": 38383,
77+
"kind": 38386,
7878
"tags": [
7979
["d", "efc75871-2568-40b9-a6ee-c382d4d6de01"],
8080
["s", "seller-refunded"],

src/admin_settle_order.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Mostro updates the addressable dispute event with status `settled`:
4646
"id": "098e8622eae022a79bc793984fccbc5ea3f6641bdcdffaa031c00d3bd33ca5a0",
4747
"pubkey": "<Mostro's pubkey>",
4848
"created_at": 1703274022,
49-
"kind": 38383,
49+
"kind": 38386,
5050
"tags": [
5151
["d", "efc75871-2568-40b9-a6ee-c382d4d6de01"],
5252
["s", "settled"],

src/dispute.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Here is an example of the event sent by Mostro:
6868
"id": "<Event id>",
6969
"pubkey": "<Mostro's pubkey>",
7070
"created_at": 1703016565,
71-
"kind": 38383,
71+
"kind": 38386,
7272
"tags": [
7373
["d", "<Dispute Id>"],
7474
["s", "initiated"],
@@ -159,7 +159,7 @@ Also Mostro will broadcast a new addressable dispute event to update the dispute
159159
"id": "<Event id>",
160160
"pubkey": "<Mostro's pubkey>",
161161
"created_at": 1703020540,
162-
"kind": 38383,
162+
"kind": 38386,
163163
"tags": [
164164
["d", "<Dispute Id>"],
165165
["s", "in-progress"],

src/list_disputes.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Listing Disputes
22

3-
Mostro publishes new disputes with event kind `38383` and status `initiated`:
3+
Mostro publishes new disputes with event kind `38386` and status `initiated`:
44

55
```json
66
[
@@ -10,7 +10,7 @@ Mostro publishes new disputes with event kind `38383` and status `initiated`:
1010
"id": "<Event id>",
1111
"pubkey": "<Mostro's pubkey>",
1212
"created_at": 1703016565,
13-
"kind": 38383,
13+
"kind": 38386,
1414
"tags": [
1515
["d", "<Dispute Id>"],
1616
["s", "initiated"],
@@ -23,4 +23,4 @@ Mostro publishes new disputes with event kind `38383` and status `initiated`:
2323
]
2424
```
2525

26-
Clients can query this events by nostr event kind `38383`, nostr event author, dispute status (`s`), type (`z`)
26+
Clients can query these events by nostr event kind `38386`, nostr event author, dispute status (`s`), type (`z`)

src/order_event.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Peer-to-peer Order events. NIP-69
22

3+
## Mostro Event Kinds
4+
5+
Mostro uses different event kinds for different types of data:
6+
7+
| Event Type | Kind | Document (`z` tag) |
8+
|------------|-------|--------------------|
9+
| Orders | 38383 | `order` |
10+
| Ratings | 38384 | `rating` |
11+
| Info | 38385 | `info` |
12+
| Disputes | 38386 | `dispute` |
13+
14+
This document focuses on the **Order** event (kind `38383`), which is used for the P2P order book.
15+
316
## Abstract
417

518
Peer-to-peer (P2P) platforms have seen an upturn in recent years, while having more and more options is positive, in the specific case of p2p, having several options contributes to the liquidity split, meaning sometimes there's not enough assets available for trading. If we combine all these individual solutions into one big pool of orders, it will make them much more competitive compared to centralized systems, where a single authority controls the liquidity.

src/other_events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This event contains specific data about a Mostro instance. The instance is ident
1313
{
1414
"id": "<Event id>",
1515
"pubkey": "<Mostro's pubkey>",
16-
"kind": 38383
16+
"kind": 38385,
1717
"tags": [
1818
[
1919
"d",

src/overview.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
## Overview
22

3-
In order to have a shared order's book, Mostro daemon send [Addressable Events](https://github.com/nostr-protocol/nips/blob/master/01.md#kinds) with `38383` as event `kind`, you can find more details about that specific event [here](./order_event.md)
3+
Mostro uses [Addressable Events](https://github.com/nostr-protocol/nips/blob/master/01.md#kinds) to publish different types of information. Each event type has its own `kind`:
4+
5+
| Event Type | Kind | Description |
6+
|------------|-------|-------------|
7+
| Orders | 38383 | P2P order events for the shared order book |
8+
| Ratings | 38384 | User rating events |
9+
| Info | 38385 | Mostro instance status and information |
10+
| Disputes | 38386 | Dispute events |
11+
12+
You can find more details about the order event [here](./order_event.md)
413

514
## The Message
615

src/user_rating.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,15 @@ Mostro updates the addressable rating event, in this event the `d` tag will be t
6464
"id": "<Event id>",
6565
"pubkey": "<Mostro's pubkey>",
6666
"created_at": 1702637077,
67-
"kind": 38383,
67+
"kind": 38384,
6868
"tags": [
6969
["d", "<Seller's trade pubkey>"],
7070
["total_reviews", "1"],
7171
["total_rating", "2"],
7272
["last_rating", "1"],
7373
["max_rate", "2"],
7474
["min_rate", "5"],
75+
["y", "mostro"],
7576
["z", "rating"]
7677
],
7778
"content": "",

0 commit comments

Comments
 (0)