Skip to content

Commit 09454ff

Browse files
authored
Merge pull request #42 from MostroP2P/docs/admin-bond-resolution-payload
docs: document BondResolution payload for admin settle/cancel
2 parents f90c8ae + 314fdeb commit 09454ff

2 files changed

Lines changed: 66 additions & 0 deletions

File tree

src/admin_cancel_order.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,39 @@ An admin can cancel an order, most of the time this is done when admin is solvin
1616
]
1717
```
1818

19+
## Bond resolution payload
20+
21+
When solving a dispute, the admin can optionally slash one or both parties' bonds independently from the trade outcome (settle vs. cancel). To do this, the `payload` is set to a `bond_resolution` object with two booleans, `slash_seller` and `slash_buyer`:
22+
23+
```json
24+
[
25+
{
26+
"order": {
27+
"version": 1,
28+
"id": "<Order Id>",
29+
"action": "admin-cancel",
30+
"payload": {
31+
"bond_resolution": {
32+
"slash_seller": true,
33+
"slash_buyer": false
34+
}
35+
}
36+
}
37+
},
38+
null
39+
]
40+
```
41+
42+
Accepted combinations on `admin-cancel`:
43+
44+
- `{ "slash_seller": false, "slash_buyer": false }` — cancel without slashing any bond
45+
- `{ "slash_seller": true, "slash_buyer": false }` — cancel and slash the seller's bond
46+
- `{ "slash_seller": false, "slash_buyer": true }` — cancel and slash the buyer's bond
47+
- `{ "slash_seller": true, "slash_buyer": true }` — cancel and slash both bonds
48+
- `payload: null` — legacy clients; interpreted server-side as "no slash"
49+
50+
`bond_resolution` is only valid on `admin-cancel` and `admin-settle`; it is rejected on every other action.
51+
1952
## Mostro response
2053

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

src/admin_settle_order.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,39 @@ An admin can settle an order, most of the time this is done when admin is solvin
1616
]
1717
```
1818

19+
## Bond resolution payload
20+
21+
When solving a dispute, the admin can optionally slash one or both parties' bonds independently from the trade outcome (settle vs. cancel). To do this, the `payload` is set to a `bond_resolution` object with two booleans, `slash_seller` and `slash_buyer`:
22+
23+
```json
24+
[
25+
{
26+
"order": {
27+
"version": 1,
28+
"id": "<Order Id>",
29+
"action": "admin-settle",
30+
"payload": {
31+
"bond_resolution": {
32+
"slash_seller": false,
33+
"slash_buyer": true
34+
}
35+
}
36+
}
37+
},
38+
null
39+
]
40+
```
41+
42+
Accepted combinations on `admin-settle`:
43+
44+
- `{ "slash_seller": false, "slash_buyer": false }` — settle without slashing any bond
45+
- `{ "slash_seller": true, "slash_buyer": false }` — settle and slash the seller's bond
46+
- `{ "slash_seller": false, "slash_buyer": true }` — settle and slash the buyer's bond
47+
- `{ "slash_seller": true, "slash_buyer": true }` — settle and slash both bonds
48+
- `payload: null` — legacy clients; interpreted server-side as "no slash"
49+
50+
`bond_resolution` is only valid on `admin-settle` and `admin-cancel`; it is rejected on every other action.
51+
1952
## Mostro response
2053

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

0 commit comments

Comments
 (0)