Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update specs with kebab case instead camel case #207

Merged
merged 1 commit into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 0 additions & 35 deletions book/src/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,4 @@

Action is used to identify each message between Mostro and users

```rust
pub enum Action {
Order,
TakeSell,
TakeBuy,
PayInvoice,
FiatSent,
Release,
Cancel,
CooperativeCancelInitiatedByYou,
CooperativeCancelInitiatedByPeer,
DisputeInitiatedByYou,
DisputeInitiatedByPeer,
CooperativeCancelAccepted,
BuyerInvoiceAccepted,
SaleCompleted,
PurchaseCompleted,
HoldInvoicePaymentAccepted,
HoldInvoicePaymentSettled,
HoldInvoicePaymentCanceled,
WaitingSellerToPay,
WaitingBuyerInvoice,
AddInvoice,
BuyerTookOrder,
RateUser,
CantDo,
Received,
Dispute,
AdminCancel,
AdminSettle,
AdminAddSolver,
AdminTakeDispute,
}
```

You can see details in [mostro core documentation](https://docs.rs/mostro-core/latest/mostro_core/message/enum.Action.html)
20 changes: 10 additions & 10 deletions book/src/admin_cancel_order.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Cancel order

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 `AdminCancel` with the `Id` of the order like this:
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:

```json
{
"Order": {
"order": {
"version": 1,
"id": "ede61c96-4c13-4519-bf3a-dcf7f1e9d842",
"pubkey": null,
"action": "AdminCancel",
"action": "admin-cancel",
"content": null
}
}
Expand All @@ -20,19 +20,19 @@ Mostro will send this message to the both parties buyer/seller and to the admin:

```json
{
"Order": {
"order": {
"version": 1,
"id": "ede61c96-4c13-4519-bf3a-dcf7f1e9d842",
"pubkey": null,
"action": "AdminCancel",
"action": "admin-cancel",
"content": null
}
}
```

## Mostro updates nip 33 events

Mostro will publish two nip33 messages, one for the order to update the status to `CanceledByAdmin`, this means that the hold invoice was canceled and the seller's funds were returned:
Mostro will publish two nip33 messages, 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:

```json
[
Expand All @@ -45,9 +45,9 @@ Mostro will publish two nip33 messages, one for the order to update the status t
"kind": 38383,
"tags": [
["d", "ede61c96-4c13-4519-bf3a-dcf7f1e9d842"],
["k", "Sell"],
["k", "sell"],
["f", "VES"],
["s", "CanceledByAdmin"],
["s", "canceled-by-admin"],
["amt", "7851"],
["fa", "100"],
["pm", "face to face"],
Expand All @@ -61,7 +61,7 @@ Mostro will publish two nip33 messages, one for the order to update the status t
]
```

And updates nip33 dispute event with status `SellerRefunded`:
And updates nip33 dispute event with status `seller-refunded`:

```json
[
Expand All @@ -74,7 +74,7 @@ And updates nip33 dispute event with status `SellerRefunded`:
"kind": 38383,
"tags": [
["d", "efc75871-2568-40b9-a6ee-c382d4d6de01"],
["s", "SellerRefunded"],
["s", "seller-refunded"],
["y", "mostrop2p"],
["z", "dispute"]
],
Expand Down
26 changes: 13 additions & 13 deletions book/src/admin_settle_order.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Settle order

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 `AdminSettle` with the `Id` of the order like this:
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:

```json
{
"Order": {
"order": {
"version": 1,
"id": "ede61c96-4c13-4519-bf3a-dcf7f1e9d842",
"pubkey": null,
"action": "AdminSettle",
"action": "admin-settle",
"content": null
}
}
Expand All @@ -20,19 +20,19 @@ Mostro will send this message to the both parties buyer/seller and to the admin:

```json
{
"Order": {
"order": {
"version": 1,
"id": "ede61c96-4c13-4519-bf3a-dcf7f1e9d842",
"pubkey": null,
"action": "AdminSettle",
"action": "admin-settle",
"content": null
}
}
```

## Mostro updates nip 33 events

Mostro will publish two nip33 messages, one for the order to update the status to `SettledByAdmin`, this means that the hold invoice paid by the seller was settled:
Mostro will publish two nip33 messages, one for the order to update the status to `settled-by-admin`, this means that the hold invoice paid by the seller was settled:

```json
[
Expand All @@ -45,9 +45,9 @@ Mostro will publish two nip33 messages, one for the order to update the status t
"kind": 38383,
"tags": [
["d", "ede61c96-4c13-4519-bf3a-dcf7f1e9d842"],
["k", "Sell"],
["k", "sell"],
["f", "VES"],
["s", "SettledByAdmin"],
["s", "settled-by-admin"],
["amt", "7851"],
["fa", "100"],
["pm", "face to face"],
Expand All @@ -61,7 +61,7 @@ Mostro will publish two nip33 messages, one for the order to update the status t
]
```

And updates nip33 dispute event with status `Settled`:
And updates nip33 dispute event with status `settled`:

```json
[
Expand All @@ -74,7 +74,7 @@ And updates nip33 dispute event with status `Settled`:
"kind": 38383,
"tags": [
["d", "efc75871-2568-40b9-a6ee-c382d4d6de01"],
["s", "Settled"],
["s", "settled"],
["y", "mostrop2p"],
["z", "dispute"]
],
Expand All @@ -86,7 +86,7 @@ And updates nip33 dispute event with status `Settled`:

## Payment of the buyer's invoice

At this point Mostro is trying to pay the buyer's invoice, right after complete the payment Mostro will update the status of the order nip33 event to `Success`:
At this point Mostro is trying to pay the buyer's invoice, right after complete the payment Mostro will update the status of the order nip33 event to `success`:

```json
[
Expand All @@ -99,9 +99,9 @@ At this point Mostro is trying to pay the buyer's invoice, right after complete
"kind": 38383,
"tags": [
["d", "ede61c96-4c13-4519-bf3a-dcf7f1e9d842"],
["k", "Sell"],
["k", "sell"],
["f", "VES"],
["s", "Success"],
["s", "success"],
["amt", "7851"],
["fa", "100"],
["pm", "face to face"],
Expand Down
46 changes: 23 additions & 23 deletions book/src/cancel.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
# Cancel Order

A user can cancel an Order created by himself and with status `Pending` sending action `Cancel`, the message content will look like this:
A user can cancel an Order created by himself and with status `pending` sending action `cancel`, the message content will look like this:

```json
{
"Order": {
"order": {
"version": 1,
"id": "ede61c96-4c13-4519-bf3a-dcf7f1e9d842",
"pubkey": "00000ba40c5795451705bb9c165b3af93c846894d3062a9cd7fcba090eb3bf78",
"action": "Cancel",
"action": "cancel",
"content": null
}
}
```

## Mostro response

Mostro will send a message with action `Cancel` confirming the order was canceled, here an example of the message:
Mostro will send a message with action `cancel` confirming the order was canceled, here an example of the message:

```json
{
"Order": {
"order": {
"version": 1,
"id": "ede61c96-4c13-4519-bf3a-dcf7f1e9d842",
"pubkey": null,
"action": "Cancel",
"action": "cancel",
"content": null
}
}
```

Mostro updates the nip 33 event with `d` tag `ede61c96-4c13-4519-bf3a-dcf7f1e9d842` to change the status to `Canceled`:
Mostro updates the nip 33 event with `d` tag `ede61c96-4c13-4519-bf3a-dcf7f1e9d842` to change the status to `canceled`:

```json
[
Expand All @@ -43,9 +43,9 @@ Mostro updates the nip 33 event with `d` tag `ede61c96-4c13-4519-bf3a-dcf7f1e9d8
"kind": 38383,
"tags": [
["d", "ede61c96-4c13-4519-bf3a-dcf7f1e9d842"],
["k", "Sell"],
["k", "sell"],
["f", "VES"],
["s", "Canceled"],
["s", "canceled"],
["amt", "7851"],
["fa", "100"],
["pm", "face to face"],
Expand All @@ -61,15 +61,15 @@ Mostro updates the nip 33 event with `d` tag `ede61c96-4c13-4519-bf3a-dcf7f1e9d8

## Cancel cooperatively

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:
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:

```json
{
"Order": {
"order": {
"version": 1,
"id": "ede61c96-4c13-4519-bf3a-dcf7f1e9d842",
"pubkey": null,
"action": "Cancel",
"action": "cancel",
"content": null
}
}
Expand All @@ -79,11 +79,11 @@ Mostro will send this message to the seller:

```json
{
"Order": {
"order": {
"version": 1,
"id": "ede61c96-4c13-4519-bf3a-dcf7f1e9d842",
"pubkey": null,
"action": "CooperativeCancelInitiatedByYou",
"action": "cooperative-cancel-initiated-by-you",
"content": null
}
}
Expand All @@ -93,17 +93,17 @@ And this message to the buyer:

```json
{
"Order": {
"order": {
"version": 1,
"id": "ede61c96-4c13-4519-bf3a-dcf7f1e9d842",
"pubkey": null,
"action": "CooperativeCancelInitiatedByPeer",
"action": "cooperative-cancel-initiated-by-peer",
"content": null
}
}
```

Mostro updates the nip 33 event with `d` tag `ede61c96-4c13-4519-bf3a-dcf7f1e9d842` to change the status to `CooperativelyCanceled`:
Mostro updates the nip 33 event with `d` tag `ede61c96-4c13-4519-bf3a-dcf7f1e9d842` to change the status to `cooperatively-canceled`:

```json
[
Expand All @@ -116,9 +116,9 @@ Mostro updates the nip 33 event with `d` tag `ede61c96-4c13-4519-bf3a-dcf7f1e9d8
"kind": 38383,
"tags": [
["d", "ede61c96-4c13-4519-bf3a-dcf7f1e9d842"],
["k", "Sell"],
["k", "sell"],
["f", "VES"],
["s", "CooperativelyCanceled"],
["s", "cooperatively-canceled"],
["amt", "7851"],
["fa", "100"],
["pm", "face to face"],
Expand All @@ -136,11 +136,11 @@ The buyer can accept the cooperative cancellation sending this message:

```json
{
"Order": {
"order": {
"version": 1,
"id": "ede61c96-4c13-4519-bf3a-dcf7f1e9d842",
"pubkey": null,
"action": "Cancel",
"action": "cancel",
"content": null
}
}
Expand All @@ -150,11 +150,11 @@ And Mostro will send this message to both parties:

```json
{
"Order": {
"order": {
"version": 1,
"id": "ede61c96-4c13-4519-bf3a-dcf7f1e9d842",
"pubkey": null,
"action": "CooperativeCancelAccepted",
"action": "cooperative-cancel-accepted",
"content": null
}
}
Expand Down