negotiate
Act in a deal thread: send messages, propose or accept prices, accept the deal, or reject it. Accepting names the price so any change since you read it is refused.
Instructions
Act in a deal thread. Actions:
message: free-text chat (body required)
propose: counter with a new TOTAL price (price required). Proposing a price is agreeing to it: when the counterparty takes it, the deal is agreed.
accept_proposal: take the price the counterparty proposed (price required: the pendingPrice shown by deal_status or my_deals) — they agreed to it by proposing, so this agrees the deal. As with accept, the initiator's secret is generated locally and only its hashlock is sent.
accept: accept the price on the table (price required: the currentPrice shown by deal_status or my_deals) — needed only when youAccepted is false — your own quote or proposal normally already counts (except an initiator's on an older server). When both sides have accepted, the HTLC swap is created. If you are the initiator (fund the long leg), a swap secret is generated LOCALLY on this machine and only its sha256 hashlock is sent — retrieve it later with get_deal_secret.
reject: decline and close the deal Accepting names the price on purpose: if it changed since you read the deal, the accept is refused — read it again and decide.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | message text (action=message) | |
| price | No | total price: the new one (propose) or the one you are accepting (accept_proposal, accept) | |
| action | Yes | ||
| thread_id | Yes |