Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

order fiat-sent

commandorder.fiat-sent
KindWrite (trade step)
WhoThe buyer, after paying the fiat
NeedsMOSTRO_PUBKEY, RELAYS, identity, the order’s local row, --yes in JSON mode
PublishesOne fiat-sent request signed with the order’s trade key
Local writeStatus → fiat-sent; for a buy range maker, the next trade index
Statusesok, error, uncertain
Schemasschemas/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

OptionRequiredRule
--orderyesUUID of an order in the local store
--yesyes 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.

FieldTypeMeaning
node_pubkeyhex64The node
order_iduuidThe order
resultenumfiat_sent here
next_stepenum or nullwait_for_release here
trade_pubkeyhex64The order’s trade key
next_trade_indexdecimal string or nullIndex reserved for a range order’s next key; null when none was sent

StepData.result values across the three steps:

resultStepNode replyLocal status
fiat_sentfiat-sentfiat-sent-okfiat-sent
releasedreleasehold-invoice-payment-settled or releasedsettled-hold-invoice
canceledcancelcanceledcanceled
cancel_requestedcancelcooperative-cancel-initiated-by-youunchanged
cancel_acceptedcancelcooperative-cancel-acceptedcooperatively-canceled

StepData.next_step values:

next_stepWhenDo
wait_for_releaseafter fiat_sentWait for the seller; watch message list
wait_for_peer_cancelafter cancel_requestedThe other party must also run order cancel
sync_child_orderafter released of a sell range order that sent a next keyRun order sync
nullotherwise

Outcomes

CasestatuscodeStages
Accepted, row updatedokpublished / accepted / applied
Accepted, row update failedok + local_status_stalepublished / accepted / failed
Accepted, next index not recorded (range)ok + trade_index_not_recordedpublished / accepted / failed
Not in storeerrororder_unknownnot_attempted / unknown / not_attempted
Other local failureerrorits codenot_attempted / unknown / not_attempted
Refused (wrong status, not the buyer…)errornode_refused + reasonpublished / rejected / not_attempted
No / unusable reply, relay dropped waituncertainreply_timeout, reply_malformed, relay_read_failed, pow_requiredpublished / unknown / not_attempted, applied or failed
Ambiguous relaysuncertainrequest_rejectedunknown / 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

As order add-invoice.

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)