Skip to content

Commit

Permalink
Status, actions use kebab case instead of camel
Browse files Browse the repository at this point in the history
  • Loading branch information
grunch committed Mar 9, 2024
1 parent 4a63508 commit 6957c40
Show file tree
Hide file tree
Showing 19 changed files with 419 additions and 489 deletions.
35 changes: 0 additions & 35 deletions actions.html
Original file line number Diff line number Diff line change
Expand Up @@ -174,41 +174,6 @@ <h1 class="menu-title">Mostro messages specs</h1>
<h1 id="actions"><a class="header" href="#actions">Actions</a></h1>
<h2 id="mostro_coreaction"><a class="header" href="#mostro_coreaction">mostro_core::Action</a></h2>
<p>Action is used to identify each message between Mostro and users</p>
<pre><pre class="playground"><code class="language-rust"><span class="boring">#![allow(unused)]
</span><span class="boring">fn main() {
</span> 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,
}
<span class="boring">}</span></code></pre></pre>
<p>You can see details in <a href="https://docs.rs/mostro-core/latest/mostro_core/message/enum.Action.html">mostro core documentation</a></p>

</main>
Expand Down
20 changes: 10 additions & 10 deletions admin_cancel_order.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,31 +172,31 @@ <h1 class="menu-title">Mostro messages specs</h1>
<div id="content" class="content">
<main>
<h1 id="cancel-order"><a class="header" href="#cancel-order">Cancel order</a></h1>
<p>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 <code>Order</code> message to Mostro with action <code>AdminCancel</code> with the <code>Id</code> of the order like this:</p>
<p>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 <code>order</code> message to Mostro with action <code>admin-cancel</code> with the <code>Id</code> of the order like this:</p>
<pre><code class="language-json">{
&quot;Order&quot;: {
&quot;order&quot;: {
&quot;version&quot;: 1,
&quot;id&quot;: &quot;ede61c96-4c13-4519-bf3a-dcf7f1e9d842&quot;,
&quot;pubkey&quot;: null,
&quot;action&quot;: &quot;AdminCancel&quot;,
&quot;action&quot;: &quot;admin-cancel&quot;,
&quot;content&quot;: null
}
}
</code></pre>
<h2 id="mostro-response"><a class="header" href="#mostro-response">Mostro response</a></h2>
<p>Mostro will send this message to the both parties buyer/seller and to the admin:</p>
<pre><code class="language-json">{
&quot;Order&quot;: {
&quot;order&quot;: {
&quot;version&quot;: 1,
&quot;id&quot;: &quot;ede61c96-4c13-4519-bf3a-dcf7f1e9d842&quot;,
&quot;pubkey&quot;: null,
&quot;action&quot;: &quot;AdminCancel&quot;,
&quot;action&quot;: &quot;admin-cancel&quot;,
&quot;content&quot;: null
}
}
</code></pre>
<h2 id="mostro-updates-nip-33-events"><a class="header" href="#mostro-updates-nip-33-events">Mostro updates nip 33 events</a></h2>
<p>Mostro will publish two nip33 messages, one for the order to update the status to <code>CanceledByAdmin</code>, this means that the hold invoice was canceled and the seller's funds were returned:</p>
<p>Mostro will publish two nip33 messages, one for the order to update the status to <code>canceled-by-admin</code>, this means that the hold invoice was canceled and the seller's funds were returned:</p>
<pre><code class="language-json">[
&quot;EVENT&quot;,
&quot;RAND&quot;,
Expand All @@ -207,9 +207,9 @@ <h2 id="mostro-updates-nip-33-events"><a class="header" href="#mostro-updates-ni
&quot;kind&quot;: 38383,
&quot;tags&quot;: [
[&quot;d&quot;, &quot;ede61c96-4c13-4519-bf3a-dcf7f1e9d842&quot;],
[&quot;k&quot;, &quot;Sell&quot;],
[&quot;k&quot;, &quot;sell&quot;],
[&quot;f&quot;, &quot;VES&quot;],
[&quot;s&quot;, &quot;CanceledByAdmin&quot;],
[&quot;s&quot;, &quot;canceled-by-admin&quot;],
[&quot;amt&quot;, &quot;7851&quot;],
[&quot;fa&quot;, &quot;100&quot;],
[&quot;pm&quot;, &quot;face to face&quot;],
Expand All @@ -222,7 +222,7 @@ <h2 id="mostro-updates-nip-33-events"><a class="header" href="#mostro-updates-ni
}
]
</code></pre>
<p>And updates nip33 dispute event with status <code>SellerRefunded</code>:</p>
<p>And updates nip33 dispute event with status <code>seller-refunded</code>:</p>
<pre><code class="language-json">[
&quot;EVENT&quot;,
&quot;RAND&quot;,
Expand All @@ -233,7 +233,7 @@ <h2 id="mostro-updates-nip-33-events"><a class="header" href="#mostro-updates-ni
&quot;kind&quot;: 38383,
&quot;tags&quot;: [
[&quot;d&quot;, &quot;efc75871-2568-40b9-a6ee-c382d4d6de01&quot;],
[&quot;s&quot;, &quot;SellerRefunded&quot;],
[&quot;s&quot;, &quot;seller-refunded&quot;],
[&quot;y&quot;, &quot;mostrop2p&quot;],
[&quot;z&quot;, &quot;dispute&quot;]
],
Expand Down
26 changes: 13 additions & 13 deletions admin_settle_order.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,31 +172,31 @@ <h1 class="menu-title">Mostro messages specs</h1>
<div id="content" class="content">
<main>
<h1 id="settle-order"><a class="header" href="#settle-order">Settle order</a></h1>
<p>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 <code>Order</code> message to Mostro with action <code>AdminSettle</code> with the <code>Id</code> of the order like this:</p>
<p>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 <code>order</code> message to Mostro with action <code>admin-settle</code> with the <code>Id</code> of the order like this:</p>
<pre><code class="language-json">{
&quot;Order&quot;: {
&quot;order&quot;: {
&quot;version&quot;: 1,
&quot;id&quot;: &quot;ede61c96-4c13-4519-bf3a-dcf7f1e9d842&quot;,
&quot;pubkey&quot;: null,
&quot;action&quot;: &quot;AdminSettle&quot;,
&quot;action&quot;: &quot;admin-settle&quot;,
&quot;content&quot;: null
}
}
</code></pre>
<h2 id="mostro-response"><a class="header" href="#mostro-response">Mostro response</a></h2>
<p>Mostro will send this message to the both parties buyer/seller and to the admin:</p>
<pre><code class="language-json">{
&quot;Order&quot;: {
&quot;order&quot;: {
&quot;version&quot;: 1,
&quot;id&quot;: &quot;ede61c96-4c13-4519-bf3a-dcf7f1e9d842&quot;,
&quot;pubkey&quot;: null,
&quot;action&quot;: &quot;AdminSettle&quot;,
&quot;action&quot;: &quot;admin-settle&quot;,
&quot;content&quot;: null
}
}
</code></pre>
<h2 id="mostro-updates-nip-33-events"><a class="header" href="#mostro-updates-nip-33-events">Mostro updates nip 33 events</a></h2>
<p>Mostro will publish two nip33 messages, one for the order to update the status to <code>SettledByAdmin</code>, this means that the hold invoice paid by the seller was settled:</p>
<p>Mostro will publish two nip33 messages, one for the order to update the status to <code>settled-by-admin</code>, this means that the hold invoice paid by the seller was settled:</p>
<pre><code class="language-json">[
&quot;EVENT&quot;,
&quot;RAND&quot;,
Expand All @@ -207,9 +207,9 @@ <h2 id="mostro-updates-nip-33-events"><a class="header" href="#mostro-updates-ni
&quot;kind&quot;: 38383,
&quot;tags&quot;: [
[&quot;d&quot;, &quot;ede61c96-4c13-4519-bf3a-dcf7f1e9d842&quot;],
[&quot;k&quot;, &quot;Sell&quot;],
[&quot;k&quot;, &quot;sell&quot;],
[&quot;f&quot;, &quot;VES&quot;],
[&quot;s&quot;, &quot;SettledByAdmin&quot;],
[&quot;s&quot;, &quot;settled-by-admin&quot;],
[&quot;amt&quot;, &quot;7851&quot;],
[&quot;fa&quot;, &quot;100&quot;],
[&quot;pm&quot;, &quot;face to face&quot;],
Expand All @@ -222,7 +222,7 @@ <h2 id="mostro-updates-nip-33-events"><a class="header" href="#mostro-updates-ni
}
]
</code></pre>
<p>And updates nip33 dispute event with status <code>Settled</code>:</p>
<p>And updates nip33 dispute event with status <code>settled</code>:</p>
<pre><code class="language-json">[
&quot;EVENT&quot;,
&quot;RAND&quot;,
Expand All @@ -233,7 +233,7 @@ <h2 id="mostro-updates-nip-33-events"><a class="header" href="#mostro-updates-ni
&quot;kind&quot;: 38383,
&quot;tags&quot;: [
[&quot;d&quot;, &quot;efc75871-2568-40b9-a6ee-c382d4d6de01&quot;],
[&quot;s&quot;, &quot;Settled&quot;],
[&quot;s&quot;, &quot;settled&quot;],
[&quot;y&quot;, &quot;mostrop2p&quot;],
[&quot;z&quot;, &quot;dispute&quot;]
],
Expand All @@ -243,7 +243,7 @@ <h2 id="mostro-updates-nip-33-events"><a class="header" href="#mostro-updates-ni
]
</code></pre>
<h2 id="payment-of-the-buyers-invoice"><a class="header" href="#payment-of-the-buyers-invoice">Payment of the buyer's invoice</a></h2>
<p>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 <code>Success</code>:</p>
<p>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 <code>success</code>:</p>
<pre><code class="language-json">[
&quot;EVENT&quot;,
&quot;RAND&quot;,
Expand All @@ -254,9 +254,9 @@ <h2 id="payment-of-the-buyers-invoice"><a class="header" href="#payment-of-the-b
&quot;kind&quot;: 38383,
&quot;tags&quot;: [
[&quot;d&quot;, &quot;ede61c96-4c13-4519-bf3a-dcf7f1e9d842&quot;],
[&quot;k&quot;, &quot;Sell&quot;],
[&quot;k&quot;, &quot;sell&quot;],
[&quot;f&quot;, &quot;VES&quot;],
[&quot;s&quot;, &quot;Success&quot;],
[&quot;s&quot;, &quot;success&quot;],
[&quot;amt&quot;, &quot;7851&quot;],
[&quot;fa&quot;, &quot;100&quot;],
[&quot;pm&quot;, &quot;face to face&quot;],
Expand Down
46 changes: 23 additions & 23 deletions cancel.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,30 +172,30 @@ <h1 class="menu-title">Mostro messages specs</h1>
<div id="content" class="content">
<main>
<h1 id="cancel-order"><a class="header" href="#cancel-order">Cancel Order</a></h1>
<p>A user can cancel an Order created by himself and with status <code>Pending</code> sending action <code>Cancel</code>, the message content will look like this:</p>
<p>A user can cancel an Order created by himself and with status <code>pending</code> sending action <code>cancel</code>, the message content will look like this:</p>
<pre><code class="language-json">{
&quot;Order&quot;: {
&quot;order&quot;: {
&quot;version&quot;: 1,
&quot;id&quot;: &quot;ede61c96-4c13-4519-bf3a-dcf7f1e9d842&quot;,
&quot;pubkey&quot;: &quot;00000ba40c5795451705bb9c165b3af93c846894d3062a9cd7fcba090eb3bf78&quot;,
&quot;action&quot;: &quot;Cancel&quot;,
&quot;action&quot;: &quot;cancel&quot;,
&quot;content&quot;: null
}
}
</code></pre>
<h2 id="mostro-response"><a class="header" href="#mostro-response">Mostro response</a></h2>
<p>Mostro will send a message with action <code>Cancel</code> confirming the order was canceled, here an example of the message:</p>
<p>Mostro will send a message with action <code>cancel</code> confirming the order was canceled, here an example of the message:</p>
<pre><code class="language-json">{
&quot;Order&quot;: {
&quot;order&quot;: {
&quot;version&quot;: 1,
&quot;id&quot;: &quot;ede61c96-4c13-4519-bf3a-dcf7f1e9d842&quot;,
&quot;pubkey&quot;: null,
&quot;action&quot;: &quot;Cancel&quot;,
&quot;action&quot;: &quot;cancel&quot;,
&quot;content&quot;: null
}
}
</code></pre>
<p>Mostro updates the nip 33 event with <code>d</code> tag <code>ede61c96-4c13-4519-bf3a-dcf7f1e9d842</code> to change the status to <code>Canceled</code>:</p>
<p>Mostro updates the nip 33 event with <code>d</code> tag <code>ede61c96-4c13-4519-bf3a-dcf7f1e9d842</code> to change the status to <code>canceled</code>:</p>
<pre><code class="language-json">[
&quot;EVENT&quot;,
&quot;RAND&quot;,
Expand All @@ -206,9 +206,9 @@ <h2 id="mostro-response"><a class="header" href="#mostro-response">Mostro respon
&quot;kind&quot;: 38383,
&quot;tags&quot;: [
[&quot;d&quot;, &quot;ede61c96-4c13-4519-bf3a-dcf7f1e9d842&quot;],
[&quot;k&quot;, &quot;Sell&quot;],
[&quot;k&quot;, &quot;sell&quot;],
[&quot;f&quot;, &quot;VES&quot;],
[&quot;s&quot;, &quot;Canceled&quot;],
[&quot;s&quot;, &quot;canceled&quot;],
[&quot;amt&quot;, &quot;7851&quot;],
[&quot;fa&quot;, &quot;100&quot;],
[&quot;pm&quot;, &quot;face to face&quot;],
Expand All @@ -222,40 +222,40 @@ <h2 id="mostro-response"><a class="header" href="#mostro-response">Mostro respon
]
</code></pre>
<h2 id="cancel-cooperatively"><a class="header" href="#cancel-cooperatively">Cancel cooperatively</a></h2>
<p>A user can cancel an <code>Active</code> order, but will need the counterparty to agree, let's look at an example where the seller initiates a cooperative cancellation:</p>
<p>A user can cancel an <code>active</code> order, but will need the counterparty to agree, let's look at an example where the seller initiates a cooperative cancellation:</p>
<pre><code class="language-json">{
&quot;Order&quot;: {
&quot;order&quot;: {
&quot;version&quot;: 1,
&quot;id&quot;: &quot;ede61c96-4c13-4519-bf3a-dcf7f1e9d842&quot;,
&quot;pubkey&quot;: null,
&quot;action&quot;: &quot;Cancel&quot;,
&quot;action&quot;: &quot;cancel&quot;,
&quot;content&quot;: null
}
}
</code></pre>
<p>Mostro will send this message to the seller:</p>
<pre><code class="language-json">{
&quot;Order&quot;: {
&quot;order&quot;: {
&quot;version&quot;: 1,
&quot;id&quot;: &quot;ede61c96-4c13-4519-bf3a-dcf7f1e9d842&quot;,
&quot;pubkey&quot;: null,
&quot;action&quot;: &quot;CooperativeCancelInitiatedByYou&quot;,
&quot;action&quot;: &quot;cooperative-cancel-initiated-by-you&quot;,
&quot;content&quot;: null
}
}
</code></pre>
<p>And this message to the buyer:</p>
<pre><code class="language-json">{
&quot;Order&quot;: {
&quot;order&quot;: {
&quot;version&quot;: 1,
&quot;id&quot;: &quot;ede61c96-4c13-4519-bf3a-dcf7f1e9d842&quot;,
&quot;pubkey&quot;: null,
&quot;action&quot;: &quot;CooperativeCancelInitiatedByPeer&quot;,
&quot;action&quot;: &quot;cooperative-cancel-initiated-by-peer&quot;,
&quot;content&quot;: null
}
}
</code></pre>
<p>Mostro updates the nip 33 event with <code>d</code> tag <code>ede61c96-4c13-4519-bf3a-dcf7f1e9d842</code> to change the status to <code>CooperativelyCanceled</code>:</p>
<p>Mostro updates the nip 33 event with <code>d</code> tag <code>ede61c96-4c13-4519-bf3a-dcf7f1e9d842</code> to change the status to <code>cooperatively-canceled</code>:</p>
<pre><code class="language-json">[
&quot;EVENT&quot;,
&quot;RAND&quot;,
Expand All @@ -266,9 +266,9 @@ <h2 id="cancel-cooperatively"><a class="header" href="#cancel-cooperatively">Can
&quot;kind&quot;: 38383,
&quot;tags&quot;: [
[&quot;d&quot;, &quot;ede61c96-4c13-4519-bf3a-dcf7f1e9d842&quot;],
[&quot;k&quot;, &quot;Sell&quot;],
[&quot;k&quot;, &quot;sell&quot;],
[&quot;f&quot;, &quot;VES&quot;],
[&quot;s&quot;, &quot;CooperativelyCanceled&quot;],
[&quot;s&quot;, &quot;cooperatively-canceled&quot;],
[&quot;amt&quot;, &quot;7851&quot;],
[&quot;fa&quot;, &quot;100&quot;],
[&quot;pm&quot;, &quot;face to face&quot;],
Expand All @@ -283,22 +283,22 @@ <h2 id="cancel-cooperatively"><a class="header" href="#cancel-cooperatively">Can
</code></pre>
<p>The buyer can accept the cooperative cancellation sending this message:</p>
<pre><code class="language-json">{
&quot;Order&quot;: {
&quot;order&quot;: {
&quot;version&quot;: 1,
&quot;id&quot;: &quot;ede61c96-4c13-4519-bf3a-dcf7f1e9d842&quot;,
&quot;pubkey&quot;: null,
&quot;action&quot;: &quot;Cancel&quot;,
&quot;action&quot;: &quot;cancel&quot;,
&quot;content&quot;: null
}
}
</code></pre>
<p>And Mostro will send this message to both parties:</p>
<pre><code class="language-json">{
&quot;Order&quot;: {
&quot;order&quot;: {
&quot;version&quot;: 1,
&quot;id&quot;: &quot;ede61c96-4c13-4519-bf3a-dcf7f1e9d842&quot;,
&quot;pubkey&quot;: null,
&quot;action&quot;: &quot;CooperativeCancelAccepted&quot;,
&quot;action&quot;: &quot;cooperative-cancel-accepted&quot;,
&quot;content&quot;: null
}
}
Expand Down
Loading

0 comments on commit 6957c40

Please sign in to comment.