Skip to content

Commit 9ea218b

Browse files
authored
Merge pull request #17 from MostroP2P/status_nip69
Update addressable events status
2 parents fce2196 + cf07341 commit 9ea218b

11 files changed

+48
-294
lines changed

src/admin_cancel_order.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Mostro will send this message to the both parties buyer/seller and to the admin:
3030

3131
## Mostro updates addressable events
3232

33-
Mostro will publish two addressable events, one for the order to update the status to `canceled-by-admin`, this means that the hold invoice was canceled and the seller's funds were returned:
33+
Mostro will publish two addressable events, one for the order to update the status to `canceled`, this means that the hold invoice was canceled and the seller's funds were returned:
3434

3535
```json
3636
[
@@ -45,7 +45,7 @@ Mostro will publish two addressable events, one for the order to update the stat
4545
["d", "<Order Id>"],
4646
["k", "sell"],
4747
["f", "VES"],
48-
["s", "canceled-by-admin"],
48+
["s", "canceled"],
4949
["amt", "7851"],
5050
["fa", "100"],
5151
["pm", "face to face"],
@@ -59,8 +59,7 @@ Mostro will publish two addressable events, one for the order to update the stat
5959
]
6060
```
6161

62-
And updates addressable dispute event with status `seller-refunded`:
63-
62+
The second event updates the addressable dispute event with status `seller-refunded`:
6463
```json
6564
[
6665
"EVENT",

src/admin_settle_order.md

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -28,38 +28,9 @@ Mostro will send this message to the both parties buyer/seller and to the admin:
2828
}
2929
```
3030

31-
## Mostro updates addressable events
31+
## Mostro updates addressable dispute event
3232

33-
Mostro will publish two addressable events, one for the order to update the status to `settled-by-admin`, this means that the hold invoice paid by the seller was settled:
34-
35-
```json
36-
[
37-
"EVENT",
38-
"RAND",
39-
{
40-
"id": "3d74ce3f10096d163603aa82beb5778bd1686226fdfcfba5d4c3a2c3137929ea",
41-
"pubkey": "<Mostro's pubkey>",
42-
"created_at": 1703260182,
43-
"kind": 38383,
44-
"tags": [
45-
["d", "<Order Id>"],
46-
["k", "sell"],
47-
["f", "VES"],
48-
["s", "settled-by-admin"],
49-
["amt", "7851"],
50-
["fa", "100"],
51-
["pm", "face to face"],
52-
["premium", "1"],
53-
["y", "mostro"],
54-
["z", "order"]
55-
],
56-
"content": "",
57-
"sig": "<Mostro's signature>"
58-
}
59-
]
60-
```
61-
62-
And updates addressable dispute event with status `settled`:
33+
Mostro updates the addressable dispute event with status `settled`:
6334

6435
```json
6536
[

src/cancel.md

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,32 @@ And this message to the buyer:
107107
}
108108
```
109109

110-
Mostro updates the parameterized replaceable event with `d` tag `<Order Id>` to change the status to `cooperatively-canceled`:
110+
The buyer can accept the cooperative cancellation sending this message:
111+
112+
```json
113+
{
114+
"order": {
115+
"version": 1,
116+
"id": "<Order Id>",
117+
"action": "cancel",
118+
"payload": null
119+
}
120+
}
121+
```
122+
123+
And Mostro will send this message to both parties:
124+
125+
```json
126+
{
127+
"order": {
128+
"version": 1,
129+
"id": "<Order Id>",
130+
"action": "cooperative-cancel-accepted",
131+
"payload": null
132+
}
133+
}
134+
```
135+
Mostro updates the parameterized replaceable event with `d` tag `<Order Id>` to change the status to `canceled`:
111136

112137
```json
113138
[
@@ -122,7 +147,7 @@ Mostro updates the parameterized replaceable event with `d` tag `<Order Id>` to
122147
["d", "<Order Id>"],
123148
["k", "sell"],
124149
["f", "VES"],
125-
["s", "cooperatively-canceled"],
150+
["s", "canceled"],
126151
["amt", "7851"],
127152
["fa", "100"],
128153
["pm", "face to face"],
@@ -135,29 +160,3 @@ Mostro updates the parameterized replaceable event with `d` tag `<Order Id>` to
135160
}
136161
]
137162
```
138-
139-
The buyer can accept the cooperative cancellation sending this message:
140-
141-
```json
142-
{
143-
"order": {
144-
"version": 1,
145-
"id": "<Order Id>",
146-
"action": "cancel",
147-
"payload": null
148-
}
149-
}
150-
```
151-
152-
And Mostro will send this message to both parties:
153-
154-
```json
155-
{
156-
"order": {
157-
"version": 1,
158-
"id": "<Order Id>",
159-
"action": "cooperative-cancel-accepted",
160-
"payload": null
161-
}
162-
}
163-
```

src/fiatsent.md

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -66,35 +66,3 @@ And here an example of the message from Mostro to the seller:
6666
}
6767
}
6868
```
69-
70-
Mostro updates the addressable event with `d` tag `<Order Id>` to change the status to `fiat-sent`:
71-
72-
```json
73-
[
74-
"EVENT",
75-
"RAND",
76-
{
77-
"id": "<Event id>",
78-
"pubkey": "<Mostro's pubkey>",
79-
"created_at": 1702549437,
80-
"kind": 38383,
81-
"tags": [
82-
["d", "<Order Id>"],
83-
["k", "sell"],
84-
["f", "VES"],
85-
["s", "fiat-sent"],
86-
["amt", "7851"],
87-
["fa", "100"],
88-
["pm", "face to face"],
89-
["premium", "1"],
90-
["network", "mainnet"],
91-
["layer", "lightning"],
92-
["expiration", "1719391096"],
93-
["y", "mostro"],
94-
["z", "order"]
95-
],
96-
"content": "",
97-
"sig": "<Mostro's signature>"
98-
}
99-
]
100-
```

src/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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+
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)
44

55
## The Message
66

src/release.md

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ And a message to the buyer to let him know that the sats were released:
5454

5555
## Buyer receives sats
5656

57-
Right after seller release sats Mostro will try to pay the buyer's lightning invoice, if the payment is successful Mostro will send a message to the buyer indicating that the purchase was completed:
57+
Right after seller release sats Mostro will attempt to pay the buyer's lightning invoice. When the payment succeeds, Mostro will send a message to the buyer indicating that the purchase was completed:
5858

5959
```json
6060
{
@@ -67,36 +67,7 @@ Right after seller release sats Mostro will try to pay the buyer's lightning inv
6767
}
6868
```
6969

70-
Mostro updates the addressable event with `d` tag `<Order Id>` to change the status to `settled-hold-invoice`:
71-
72-
```json
73-
[
74-
"EVENT",
75-
"RAND",
76-
{
77-
"id": "<Event id>",
78-
"pubkey": "<Mostro's pubkey>",
79-
"created_at": 1702549437,
80-
"kind": 38383,
81-
"tags": [
82-
["d", "<Order Id>"],
83-
["k", "sell"],
84-
["f", "VES"],
85-
["s", "settled-hold-invoice"],
86-
["amt", "7851"],
87-
["fa", "100"],
88-
["pm", "face to face"],
89-
["premium", "1"],
90-
["y", "mostro"],
91-
["z", "order"]
92-
],
93-
"content": "",
94-
"sig": "<Mostro's signature>"
95-
}
96-
]
97-
```
98-
99-
Mostro will then attempt to pay the buyer's invoice, if the payment successds Mostro updates the addressable event with `d` tag `<Order Id>` to change the status to `success`:
70+
Mostro updates the addressable event with the `d` tag `<Order Id>` to change the status to `success`:
10071

10172
```json
10273
[

src/seller_pay_hold_invoice.md

Lines changed: 1 addition & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -93,35 +93,6 @@ Mostro also send a message to the buyer, this way they can both write to each ot
9393
]
9494
```
9595

96-
Mostro updates the addressable event with `d` tag `<Order Id>` to change the status to `active`:
97-
98-
```json
99-
[
100-
"EVENT",
101-
"RAND",
102-
{
103-
"id": "<Event id>",
104-
"pubkey": "<Mostro's pubkey>",
105-
"created_at": 1702549437,
106-
"kind": 38383,
107-
"tags": [
108-
["d", "<Order Id>"],
109-
["k", "sell"],
110-
["f", "VES"],
111-
["s", "active"],
112-
["amt", "7851"],
113-
["fa", "100"],
114-
["pm", "face to face"],
115-
["premium", "1"],
116-
["y", "mostro"],
117-
["z", "order"]
118-
],
119-
"content": "",
120-
"sig": "<Mostro's signature>"
121-
}
122-
]
123-
```
124-
12596
## If the buyer didn't sent the invoice yet
12697

12798
Mostro send this message to the seller:
@@ -162,38 +133,6 @@ And this message to the buyer:
162133
}
163134
```
164135

165-
And updates the addressable event with `d` tag `<Order Id>` to change the status to `waiting-buyer-invoice`:
166-
167-
```json
168-
[
169-
"EVENT",
170-
"RAND",
171-
{
172-
"id": "<Event id>",
173-
"pubkey": "<Mostro's pubkey>",
174-
"created_at": 1702549437,
175-
"kind": 38383,
176-
"tags": [
177-
["d", "<Order Id>"],
178-
["k", "sell"],
179-
["f", "VES"],
180-
["s", "waiting-buyer-invoice"],
181-
["amt", "7851"],
182-
["fa", "100"],
183-
["pm", "face to face"],
184-
["premium", "1"],
185-
["network", "mainnet"],
186-
["layer", "lightning"],
187-
["expiration", "1719391096"],
188-
["y", "mostro"],
189-
["z", "order"]
190-
],
191-
"content": "",
192-
"sig": "<Mostro's signature>"
193-
}
194-
]
195-
```
196-
197136
Now buyer sends the invoice to Mostro:
198137

199138
```json
@@ -212,4 +151,4 @@ Now buyer sends the invoice to Mostro:
212151
}
213152
```
214153

215-
And both parties receives each other pubkeys to start a direct conversation
154+
And both parties receives each other pubkeys to start a direct conversation.

0 commit comments

Comments
 (0)