order fiat-sent
command | order.fiat-sent |
| Kind | Write (trade step) |
| Who | The buyer, after paying the fiat |
| Needs | MOSTRO_PUBKEY, RELAYS, identity, the order’s local row, --yes in JSON mode |
| Publishes | One fiat-sent request signed with the order’s trade key |
| Local write | Status → fiat-sent; for a buy range maker, the next trade index |
| Statuses | ok, error, uncertain |
| Schemas | schemas/order.fiat-sent.input.json, schemas/order.fiat-sent.output.json |
Tells the seller, through the node, that the fiat payment was made.
Invocation
mostro-cli --output json order fiat-sent --order UUID --yes
Replaces fiatsent -o ....
Input
| Option | Required | Rule |
|---|---|---|
--order | yes | UUID of an order in the local store |
--yes | yes in JSON |
Behavior
Looks up the order’s trade key, publishes fiat-sent, waits for fiat-sent-ok, records
the local status. If you are the maker of a buy range order with room left, the request
also carries a fresh trade key at the next index for the child order the node will create
when the seller releases; next_trade_index reports it. See
Range orders.
Success data: StepData
Shared with release and cancel.
| Field | Type | Meaning |
|---|---|---|
node_pubkey | hex64 | The node |
order_id | uuid | The order |
result | enum | fiat_sent here |
next_step | enum or null | wait_for_release here |
trade_pubkey | hex64 | The order’s trade key |
next_trade_index | decimal string or null | Index reserved for a range order’s next key; null when none was sent |
StepData.result values across the three steps:
result | Step | Node reply | Local status |
|---|---|---|---|
fiat_sent | fiat-sent | fiat-sent-ok | fiat-sent |
released | release | hold-invoice-payment-settled or released | settled-hold-invoice |
canceled | cancel | canceled | canceled |
cancel_requested | cancel | cooperative-cancel-initiated-by-you | unchanged |
cancel_accepted | cancel | cooperative-cancel-accepted | cooperatively-canceled |
StepData.next_step values:
next_step | When | Do |
|---|---|---|
wait_for_release | after fiat_sent | Wait for the seller; watch message list |
wait_for_peer_cancel | after cancel_requested | The other party must also run order cancel |
sync_child_order | after released of a sell range order that sent a next key | Run order sync |
null | otherwise |
Outcomes
| Case | status | code | Stages |
|---|---|---|---|
| Accepted, row updated | ok | published / accepted / applied | |
| Accepted, row update failed | ok + local_status_stale | published / accepted / failed | |
| Accepted, next index not recorded (range) | ok + trade_index_not_recorded | published / accepted / failed | |
| Not in store | error | order_unknown | not_attempted / unknown / not_attempted |
| Other local failure | error | its code | not_attempted / unknown / not_attempted |
| Refused (wrong status, not the buyer…) | error | node_refused + reason | published / rejected / not_attempted |
| No / unusable reply, relay dropped wait | uncertain | reply_timeout, reply_malformed, relay_read_failed, pow_required | published / unknown / not_attempted, applied or failed |
| Ambiguous relays | uncertain | request_rejected | unknown / unknown / not_attempted, applied or failed |
On uncertain, persistence is not_attempted unless a range key was sent (then it says
whether the reserved index was recorded). Check order info: status fiat-sent means it
went through.
Errors
Warnings
local_status_stale, trade_index_not_recorded, invalid_event_timestamp,
cleanup_incomplete.
Examples
The buyer confirmed the fiat payment
order.fiat-sent/fiat_sent · status ok · exit 0 · fixture
mostro-cli --output json order fiat-sent --order 00000000-0000-0000-0000-000000000001 --yes
{
"schema_version": "1",
"command": "order.fiat-sent",
"status": "ok",
"data": {
"next_step": "wait_for_release",
"next_trade_index": null,
"node_pubkey": "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
"order_id": "00000000-0000-0000-0000-000000000001",
"result": "fiat_sent",
"trade_pubkey": "c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5"
},
"error": null,
"warnings": [],
"meta": {
"publication": "published",
"daemon_acceptance": "accepted",
"persistence": "applied",
"snapshot": null
}
}
Maker of a buy range order: the step carried the next trade key (index 4)
order.fiat-sent/range_key_sent · status ok · exit 0 · fixture
mostro-cli --output json order fiat-sent --order 00000000-0000-0000-0000-000000000001 --yes
{
"schema_version": "1",
"command": "order.fiat-sent",
"status": "ok",
"data": {
"next_step": "wait_for_release",
"next_trade_index": "4",
"node_pubkey": "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
"order_id": "00000000-0000-0000-0000-000000000001",
"result": "fiat_sent",
"trade_pubkey": "c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5"
},
"error": null,
"warnings": [],
"meta": {
"publication": "published",
"daemon_acceptance": "accepted",
"persistence": "applied",
"snapshot": null
}
}
Range maker: accepted, but the reserved index 4 could not be recorded
order.fiat-sent/trade_index_not_recorded · status ok · exit 0 · authored
mostro-cli --output json order fiat-sent --order 00000000-0000-0000-0000-000000000001 --yes
{
"schema_version": "1",
"command": "order.fiat-sent",
"status": "ok",
"data": {
"node_pubkey": "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
"order_id": "00000000-0000-0000-0000-000000000001",
"result": "fiat_sent",
"next_step": "wait_for_release",
"trade_pubkey": "c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5",
"next_trade_index": "4"
},
"error": null,
"warnings": [
{
"code": "trade_index_not_recorded",
"message": "The request was accepted but its new trade index could not be recorded, so the next order may reuse it."
}
],
"meta": {
"publication": "published",
"daemon_acceptance": "accepted",
"persistence": "failed",
"snapshot": null
}
}
Refused with reason invalid_pubkey
order.fiat-sent/node_refused · status error · node_refused · exit 1 · fixture
mostro-cli --output json order fiat-sent --order 00000000-0000-0000-0000-000000000001 --yes
{
"schema_version": "1",
"command": "order.fiat-sent",
"status": "error",
"data": null,
"error": {
"code": "node_refused",
"message": "The node refused the request.",
"reason": "invalid_pubkey"
},
"warnings": [],
"meta": {
"publication": "published",
"daemon_acceptance": "rejected",
"persistence": "not_attempted",
"snapshot": null
}
}
The removed fiatsent spelling
order.fiat-sent/removed_spelling · status error · invalid_arguments · exit 2 · fixture
mostro-cli --output json fiatsent -o 00000000-0000-0000-0000-000000000001
{
"schema_version": "1",
"command": null,
"status": "error",
"data": null,
"error": {
"code": "invalid_arguments",
"message": "The command arguments are invalid."
},
"warnings": [],
"meta": {
"publication": "not_attempted",
"daemon_acceptance": "unknown",
"persistence": "not_attempted",
"snapshot": null
}
}
JSON mode without –yes
order.fiat-sent/yes_required · status error · invalid_arguments · exit 2 · fixture
mostro-cli --output json order fiat-sent --order 00000000-0000-0000-0000-000000000001
{
"schema_version": "1",
"command": "order.fiat-sent",
"status": "error",
"data": null,
"error": {
"code": "invalid_arguments",
"message": "The command arguments are invalid."
},
"warnings": [],
"meta": {
"publication": "not_attempted",
"daemon_acceptance": "unknown",
"persistence": "not_attempted",
"snapshot": null
}
}
Next
order release (by the seller)