Claim your leg
claim_legClaims the receiving leg of an HTLC swap using the agent's key and preimage, reveals the secret on-chain so the counterparty can settle the other leg, and reports the claim to the API.
Instructions
AUTONOMOUS SETTLEMENT: claim YOUR receive leg of a swap using the preimage, signing with the agent's own key. This reveals the secret on-chain (so the counterparty/keeper can settle the other leg) and reports the claim to the API. Requires both legs funded and the preimage available (you are the initiator, or the initiator already revealed it). As the initiator it first checks the counterparty's escrow on chain (pays your key, agreed terms, still claimable) and refuses otherwise. Use this when the agent holds the receiving key; to claim with your own wallet use get_deal_secret, then reveal_claim. Returns the on-chain tx id.
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": {
"swap_id": "<swap_id>"
},
"name": "claim_leg"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| swap_id | Yes | Swap id (swap.id from deal_status, or swapId once a deal is agreed) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tx | No | On-chain tx id | |
| leg | No | ||
| chain | No | ||
| error | No | Set instead when the call failed |