Refund your leg
refund_legReclaim a funded swap leg after its timelock passes when the counterparty never claims it, signing with the agent's own key across EVM, TRON, Solana, and Bitcoin.
Instructions
AUTONOMOUS SETTLEMENT: take back YOUR funded leg after its timelock has passed and the counterparty never claimed it, signing with the agent's own key. Works on every rail — EVM and TRON call the escrow, Solana and Bitcoin sign a transaction the server builds. On Bitcoin a node also rejects it until the chain's MEDIAN TIME PAST has passed the timelock, which trails real time by roughly an hour. Each rail sends the money where it was agreed it would go: the leg's refund address on Bitcoin and Solana, and on EVM and TRON the wallet that funded the escrow — the agent's own key. 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": "refund_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 |