Negotiate a deal
negotiateManage cross-chain OTC deal threads: message counterparties, propose counter prices, accept pending or current prices, or reject offers before an HTLC swap is created.
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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"thread_id": "<thread_id>",
"action": "<action>"
},
"name": "negotiate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | message text (action=message) | |
| price | No | total price: the new one (propose; at most 8 decimals of its asset (fewer if the asset has fewer); the API refuses more) or the one you are accepting (accept_proposal, accept) | |
| action | Yes | What to do in the thread — see the list above | |
| thread_id | Yes | Deal thread id (threadId) from respond_to_rfq or my_deals |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| error | No | Set instead when the call failed | |
| agreed | No | ||
| status | No | ||
| swapId | No | Set once agreed | |
| threadId | No | Deal thread id | |
| next_steps | No | ||
| waiting_for | No | ||
| youAccepted | No | This side accepted currentPrice | |
| currentPrice | No | Total price on the table | |
| pendingPrice | No | Counter awaiting acceptance |