Skip to content

Commit 1bb54a2

Browse files
committed
Fixes to keep consistency
1 parent ab52b99 commit 1bb54a2

18 files changed

+258
-167
lines changed

src/admin_add_solver.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,31 @@ The administrator can also solve disputes.
99
To add a solver the admin will need to send an `order` message to Mostro with action `admin-add-solver`:
1010

1111
```json
12-
{
13-
"order": {
12+
[
13+
{
14+
"order": {
1415
"version": 1,
1516
"action": "admin-add-solver",
1617
"payload": {
1718
"text_message": "npub1qqq884wtp2jn96lqhqlnarl4kk3rmvrc9z2nmrvqujx3m4l2ea5qd5d0fq"
1819
}
19-
}
20-
}
20+
},
21+
null
22+
]
2123
```
2224

2325
## Mostro response
2426

2527
Mostro will send this message to the admin:
2628

2729
```json
28-
{
29-
"order": {
30+
[
31+
{
32+
"order": {
3033
"version": 1,
3134
"action": "admin-add-solver",
3235
"payload": null
33-
}
34-
}
36+
},
37+
null
38+
]
3539
```

src/admin_cancel_order.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,33 @@
33
An admin can cancel an order, most of the time this is done when admin is solving a dispute, for this the admin will need to send an `order` message to Mostro with action `admin-cancel` with the `id` of the order like this:
44

55
```json
6-
{
7-
"order": {
6+
[
7+
{
8+
"order": {
89
"version": 1,
910
"id": "<Order Id>",
1011
"action": "admin-cancel",
1112
"payload": null
12-
}
13-
}
13+
},
14+
null
15+
]
1416
```
1517

1618
## Mostro response
1719

1820
Mostro will send this message to the both parties buyer/seller and to the admin:
1921

2022
```json
21-
{
22-
"order": {
23+
[
24+
{
25+
"order": {
2326
"version": 1,
2427
"id": "<Order Id>",
2528
"action": "admin-canceled",
2629
"payload": null
27-
}
28-
}
30+
},
31+
null
32+
]
2933
```
3034

3135
## Mostro updates addressable events

src/admin_settle_order.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,33 @@
33
An admin can settle an order, most of the time this is done when admin is solving a dispute, for this the admin will need to send an `order` message to Mostro with action `admin-settle` with the `id` of the order like this:
44

55
```json
6-
{
7-
"order": {
6+
[
7+
{
8+
"order": {
89
"version": 1,
910
"id": "<Order Id>",
1011
"action": "admin-settle",
1112
"payload": null
12-
}
13-
}
13+
},
14+
null
15+
]
1416
```
1517

1618
## Mostro response
1719

1820
Mostro will send this message to the both parties buyer/seller and to the admin:
1921

2022
```json
21-
{
22-
"order": {
23+
[
24+
{
25+
"order": {
2326
"version": 1,
2427
"id": "<Order Id>",
2528
"action": "admin-settled",
2629
"payload": null
27-
}
28-
}
30+
},
31+
null
32+
]
2933
```
3034

3135
## Mostro updates addressable dispute event

src/cancel.md

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Mostro will send a message with action `cancel` confirming the order was cancele
3434
]
3535
```
3636

37-
Mostro updates the parameterized replaceable event with `d` tag `<Order Id>` to change the status to `canceled`:
37+
Mostro updates the addressable event with `d` tag `<Order Id>` to change the status to `canceled`:
3838

3939
```json
4040
[
@@ -71,68 +71,78 @@ Mostro updates the parameterized replaceable event with `d` tag `<Order Id>` to
7171
A user can cancel an `active` order, but will need the counterparty to agree, let's look at an example where the seller initiates a cooperative cancellation:
7272

7373
```json
74-
{
75-
"order": {
74+
[
75+
{
76+
"order": {
7677
"version": 1,
7778
"id": "<Order Id>",
7879
"action": "cancel",
7980
"payload": null
80-
}
81-
}
81+
},
82+
null
83+
]
8284
```
8385

8486
Mostro will send this message to the seller:
8587

8688
```json
87-
{
88-
"order": {
89+
[
90+
{
91+
"order": {
8992
"version": 1,
9093
"id": "<Order Id>",
9194
"action": "cooperative-cancel-initiated-by-you",
9295
"payload": null
93-
}
94-
}
96+
},
97+
null
98+
]
9599
```
96100

97101
And this message to the buyer:
98102

99103
```json
100-
{
101-
"order": {
104+
[
105+
{
106+
"order": {
102107
"version": 1,
103108
"id": "<Order Id>",
104109
"action": "cooperative-cancel-initiated-by-peer",
105110
"payload": null
106-
}
107-
}
111+
},
112+
null
113+
]
108114
```
109115

110116
The buyer can accept the cooperative cancellation sending this message:
111117

112118
```json
113-
{
114-
"order": {
119+
[
120+
{
121+
"order": {
115122
"version": 1,
116123
"id": "<Order Id>",
117124
"action": "cancel",
118125
"payload": null
119-
}
120-
}
126+
},
127+
null
128+
]
121129
```
122130

123131
And Mostro will send this message to both parties:
124132

125133
```json
126-
{
127-
"order": {
134+
[
135+
{
136+
"order": {
128137
"version": 1,
129138
"id": "<Order Id>",
130139
"action": "cooperative-cancel-accepted",
131140
"payload": null
132-
}
133-
}
141+
},
142+
null
143+
]
134144
```
135-
Mostro updates the parameterized replaceable event with `d` tag `<Order Id>` to change the status to `canceled`:
145+
Mostro updates the addressable event with `d` tag `<Order Id>` to change the status to `canceled`:
136146

137147
```json
138148
[

src/dispute.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,24 @@ Here is an example of the event sent by Mostro:
8484
Mostro admin will see the dispute and can take it using the dispute `Id` from `d` tag, here how should look the message sent by the admin:
8585

8686
```json
87-
{
88-
"dispute": {
87+
[
88+
{
89+
"dispute": {
8990
"version": 1,
9091
"id": "<Dispute Id>",
9192
"action": "admin-take-dispute",
9293
"payload": null
93-
}
94-
}
94+
},
95+
null
96+
]
9597
```
9698

9799
Mostro will send a confirmation message to the admin with the order details:
98100

99101
```json
100-
{
101-
"dispute": {
102+
[
103+
{
104+
"dispute": {
102105
"version": 1,
103106
"id": "<Dispute Id>",
104107
"action": "admin-took-dispute",
@@ -112,14 +115,15 @@ Mostro will send a confirmation message to the admin with the order details:
112115
"fiat_amount": 100,
113116
"payment_method": "face to face",
114117
"premium": 1,
115-
"master_buyer_pubkey": "<Buyer's trade pubkey>",
116-
"master_seller_pubkey": "<Seller's trade pubkey>",
118+
"buyer_trade_pubkey": "<Buyer's trade pubkey>",
119+
"seller_trade_pubkey": "<Seller's trade pubkey>",
117120
"buyer_invoice": "lnbcrt11020n1pjcypj3pp58m3d9gcu4cc8l3jgkpfn7zhqv2jfw7p3t6z3tq2nmk9cjqam2c3sdqqcqzzsxqyz5vqsp5mew44wzjs0a58d9sfpkrdpyrytswna6gftlfrv8xghkc6fexu6sq9qyyssqnwfkqdxm66lxjv8z68ysaf0fmm50ztvv773jzuyf8a5tat3lnhks6468ngpv3lk5m7yr7vsg97jh6artva5qhd95vafqhxupyuawmrcqnthl9y",
118121
"created_at": 1698870173
119122
}
120123
}
121-
}
122-
}
124+
},
125+
null
126+
]
123127
```
124128

125129
Then mostrod send messages to each trade participat, the buyer and seller for them to know the pubkey of the admin who took the dispute, that way the client can start listening events from that specific pubkey, by default clients should discard any messages received from any pubkey different than Mostro node or dispute solver, the message looks like this:

src/new_buy_order.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ The nostr event will look like this:
4343
Mostro will send back a nip59 event as a confirmation message, the message in the rumor looks like the following:
4444

4545
```json
46-
{
47-
"order": {
46+
[
47+
{
48+
"order": {
4849
"version": 1,
4950
"id": "<Order id>",
5051
"action": "new-order",
@@ -64,8 +65,9 @@ Mostro will send back a nip59 event as a confirmation message, the message in th
6465
"created_at": 1698870173
6566
}
6667
}
67-
}
68-
}
68+
},
69+
null
70+
]
6971
```
7072

7173
Mostro publishes this order as an event kind `38383` with status `pending`:

src/new_buy_order_ln_address.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ The nostr event will look like this:
4747
Mostro will send back a nip59 event as a confirmation message to the user like the following:
4848

4949
```json
50-
{
51-
"order": {
50+
[
51+
{
52+
"order": {
5253
"version": 1,
5354
"id": "<Order Id>",
5455
"action": "new-order",
@@ -62,14 +63,15 @@ Mostro will send back a nip59 event as a confirmation message to the user like t
6263
"fiat_amount": 100,
6364
"payment_method": "face to face,mobile",
6465
"premium": 1,
65-
"master_buyer_pubkey": null,
66-
"master_seller_pubkey": null,
66+
"buyer_trade_pubkey": null,
67+
"seller_trade_pubkey": null,
6768
"buyer_invoice": "mostro_p2p@ln.tips",
6869
"created_at": 1698870173
6970
}
7071
}
71-
}
72-
}
72+
},
73+
null
74+
]
7375
```
7476

7577
Mostro publishes this order as an event kind `38383` with status `pending`:

0 commit comments

Comments
 (0)