Build your claim
build_claimBuild the UNSIGNED claim of the leg you receive (reveals the secret on-chain). Requires both legs funded. Acting for a person with no wallet here? Give them the swap's dealUrl to claim there instead. The initiator claims with its own secret; the counterparty, with the revealed one — swap_status shows it in secretCiphertext (plain hex, despite the name). secret = 32-byte hex preimage. This call sends the secret to Hashlock's server, even when it is refused (legs not both funded yet), so call it only when you are about to sign and send the claim. EVM returns txs to sign and send; TRON returns a transaction whose txID you sign; Solana returns sign="solana-tx" with transactionBase64 — only the leg's payout key can sign it (it is also the fee payer), then broadcast it; Bitcoin returns sign="btc-sighash" with sighashHexes — one per escrow input: sign EACH with secp256k1 and pass them back through broadcast_tx as { psbtBase64, signaturesHex: [...], preimageHex }, and the witness is assembled for you.
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": {
"id": "<id>",
"leg": "<leg>",
"secret": "<secret>"
},
"name": "build_claim"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Swap id | |
| leg | Yes | The leg that pays YOU: a if you are the taker, b if you are the maker | |
| secret | Yes | 32-byte hex preimage of the swap hashlock |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| txs | No | EVM txs | |
| sign | No | Signing scheme | |
| payTo | No | Bitcoin escrow address | |
| feePayTo | No | ||
| amountSats | No | ||
| psbtBase64 | No | ||
| sighashHexes | No | One per input | |
| transactions | No | TRON txs | |
| feeAmountSats | No | ||
| transactionBase64 | No | Solana tx |