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 release

commandorder.release
KindWrite (trade step) — irreversible
WhoThe seller, after receiving the fiat
NeedsMOSTRO_PUBKEY, RELAYS, identity, the order’s local row, --yes in JSON mode
PublishesOne release request signed with the order’s trade key
Local writeStatus → settled-hold-invoice; for a sell range maker, the next trade index
Statusesok, error, uncertain
Schemasschemas/order.release.input.json, schemas/order.release.output.json

Settles the seller’s hold invoice: the sats go to the buyer. It cannot be undone. Only release after confirming the fiat arrived in your account; fiat-sent from the buyer is a claim, not proof.

Invocation

mostro-cli --output json order release --order UUID --yes

Replaces release -o ....

Input

OptionRequiredRule
--orderyesUUID of an order in the local store
--yesyes in JSONAn agent must have explicit user consent for this specific order

Behavior

Looks up the trade key, publishes release, waits for hold-invoice-payment-settled or released, records settled-hold-invoice. If you are the maker of a sell range order with room left, the request carries a fresh trade key at the next index; the node creates a child order for the rest of the range and announces it to that key, and the outcome says next_step: sync_child_order.

Success data: StepData

See order fiat-sent. Here result is released; next_step is sync_child_order (range continued) or null.

Outcomes

As order fiat-sent.

After uncertain, never release again blindly. Run order info --order <id>: status settled-hold-invoice or success means it went through; fiat-sent still means it did not (yet). Only then decide whether to send it again.

Errors

As order add-invoice.

Warnings

local_status_stale, trade_index_not_recorded, invalid_event_timestamp, cleanup_incomplete.

Examples

Maker of a sell range order released; the node creates a child order: run order sync

order.release/range_continued · status ok · exit 0 · fixture

mostro-cli --output json order release --order 00000000-0000-0000-0000-000000000001 --yes
{
  "schema_version": "1",
  "command": "order.release",
  "status": "ok",
  "data": {
    "next_step": "sync_child_order",
    "next_trade_index": "4",
    "node_pubkey": "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
    "order_id": "00000000-0000-0000-0000-000000000001",
    "result": "released",
    "trade_pubkey": "c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5"
  },
  "error": null,
  "warnings": [],
  "meta": {
    "publication": "published",
    "daemon_acceptance": "accepted",
    "persistence": "applied",
    "snapshot": null
  }
}

The seller released the sats

order.release/released · status ok · exit 0 · fixture

mostro-cli --output json order release --order 00000000-0000-0000-0000-000000000001 --yes
{
  "schema_version": "1",
  "command": "order.release",
  "status": "ok",
  "data": {
    "next_step": null,
    "next_trade_index": null,
    "node_pubkey": "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
    "order_id": "00000000-0000-0000-0000-000000000001",
    "result": "released",
    "trade_pubkey": "c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5"
  },
  "error": null,
  "warnings": [],
  "meta": {
    "publication": "published",
    "daemon_acceptance": "accepted",
    "persistence": "applied",
    "snapshot": null
  }
}

Released, local status not updated: ok with local_status_stale

order.release/stale_status · status ok · exit 0 · fixture

mostro-cli --output json order release --order 00000000-0000-0000-0000-000000000001 --yes
{
  "schema_version": "1",
  "command": "order.release",
  "status": "ok",
  "data": {
    "next_step": null,
    "next_trade_index": null,
    "node_pubkey": "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
    "order_id": "00000000-0000-0000-0000-000000000001",
    "result": "released",
    "trade_pubkey": "c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5"
  },
  "error": null,
  "warnings": [
    {
      "code": "local_status_stale",
      "message": "The node accepted the invoice but the local order status could not be updated."
    }
  ],
  "meta": {
    "publication": "published",
    "daemon_acceptance": "accepted",
    "persistence": "failed",
    "snapshot": null
  }
}

Range maker released, the wait failed; the index reserved for the child was recorded

order.release/relay_read_failed_uncertain_range · status uncertain · relay_read_failed · exit 1 · authored

mostro-cli --output json order release --order 00000000-0000-0000-0000-000000000001 --yes
{
  "schema_version": "1",
  "command": "order.release",
  "status": "uncertain",
  "data": null,
  "error": {
    "code": "relay_read_failed",
    "message": "A configured relay failed during the public order read."
  },
  "warnings": [],
  "meta": {
    "publication": "published",
    "daemon_acceptance": "unknown",
    "persistence": "applied",
    "snapshot": null
  }
}

No answer: the sats may have been released. Do not resend blindly

order.release/reply_timeout_uncertain · status uncertain · reply_timeout · exit 1 · fixture

mostro-cli --output json order release --order 00000000-0000-0000-0000-000000000001 --yes
{
  "schema_version": "1",
  "command": "order.release",
  "status": "uncertain",
  "data": null,
  "error": {
    "code": "reply_timeout",
    "message": "The node did not answer before the deadline."
  },
  "warnings": [],
  "meta": {
    "publication": "published",
    "daemon_acceptance": "unknown",
    "persistence": "not_attempted",
    "snapshot": null
  }
}

Refused with reason invalid_peer

order.release/node_refused · status error · node_refused · exit 1 · fixture

mostro-cli --output json order release --order 00000000-0000-0000-0000-000000000001 --yes
{
  "schema_version": "1",
  "command": "order.release",
  "status": "error",
  "data": null,
  "error": {
    "code": "node_refused",
    "message": "The node refused the request.",
    "reason": "invalid_peer"
  },
  "warnings": [],
  "meta": {
    "publication": "published",
    "daemon_acceptance": "rejected",
    "persistence": "not_attempted",
    "snapshot": null
  }
}

No local row for this order

order.release/order_unknown · status error · order_unknown · exit 1 · fixture

mostro-cli --output json order release --order 00000000-0000-0000-0000-000000000009 --yes
{
  "schema_version": "1",
  "command": "order.release",
  "status": "error",
  "data": null,
  "error": {
    "code": "order_unknown",
    "message": "No local order has this id, so nothing was sent."
  },
  "warnings": [],
  "meta": {
    "publication": "not_attempted",
    "daemon_acceptance": "unknown",
    "persistence": "not_attempted",
    "snapshot": null
  }
}

Next

Rate the counterparty (human-only today: mostro-cli rate). For a range order: order sync.