withdraw_htlc
Claim your side of a cross-chain swap by revealing the 32-byte secret preimage. Unlocks both legs of the atomic HTLC simultaneously without an intermediary.
Instructions
Atomic claim — reveals the 32-byte preimage to unlock both legs of the swap simultaneously. Trustless cross-chain finality: no intermediary holds funds at any point.
USE WHEN: counterparty has confirmed their lock on-chain and the user wants to claim their side of the swap. DO NOT USE WHEN: counterparty lock is not yet confirmed on-chain, OR the timelock has already expired — use refund_htlc instead.
PARAM NOTES: preimage must be 0x-prefixed 32-byte hex. Revealing the preimage is what makes the swap atomic — it simultaneously unlocks the counterparty leg. Set chainType to "bitcoin" or "sui" for non-EVM legs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tradeId | Yes | Trade ID | |
| txHash | Yes | On-chain claim transaction hash (0x-prefixed) | |
| preimage | Yes | The 32-byte secret preimage (0x-prefixed hex) | |
| chainType | No | Chain type: evm, bitcoin, or sui | |
| client_request_id | No | Idempotency key. Retrying the SAME write with the SAME id within this MCP session returns the first result instead of triggering a second on-chain/backend side effect. Best-effort: not durable across MCP restarts. |