An API key (hk_live_… / hk_test_…) with read/taker/maker scopes. read is read-only: every write except webhooks needs taker or maker (403 otherwise), and either of those can read too. Creating RFQs and listing tokens need taker; quoting needs maker.
bitcoin only: refund an escrow this leg moved OFF (after a pubkey correction) instead of its current one; refused for an address that was never this leg's escrow
Response
signing material
What to sign, per chain family; sign says which shape it is. evm-tx: sign and send each of txs in order, from from when given. btc-payment (fund): pay amountSats to payTo (and feeAmountSats to feePayTo when present). btc-sighash (claim/refund): sign each of sighashHexes, then broadcast { psbtBase64, signaturesHex, preimageHex? }. solana-tx: sign transactionBase64 and broadcast it. tron-txid: sign each transactions[].txID and broadcast each signed transaction.
tron-txid: unsigned transactions (a TRC-20 fund is approve, then fund)
Show child attributes
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Hashlock Markets","description":"Developer documentation for Hashlock Markets: non-custodial atomic P2P cross-chain swaps (Bitcoin, Ethereum, Base, Robinhood Chain, TRON, Solana) via sealed RFQ and HTLC — REST API, SDK, webhooks and MCP for AI agents.","colors":{"primary":"#665bff","light":"#a39cff","dark":"#5a4ff0"},"logo":{"light":"https://mintcdn.com/hashlock-markets/W3jVTJYLEiBG4td8/logo/light.svg?fit=max\u0026auto=format\u0026n=W3jVTJYLEiBG4td8\u0026q=85\u0026s=b391e3e8e9aa88f494e04c0f38ab75b8","dark":"https://mintcdn.com/hashlock-markets/W3jVTJYLEiBG4td8/logo/dark.svg?fit=max\u0026auto=format\u0026n=W3jVTJYLEiBG4td8\u0026q=85\u0026s=49cc4d2d43b6ea71419ee446e0830202","href":"https://hashlock.markets"},"favicon":{"light":"https://mintcdn.com/hashlock-markets/W3jVTJYLEiBG4td8/favicon-light.svg?fit=max\u0026auto=format\u0026n=W3jVTJYLEiBG4td8\u0026q=85\u0026s=14dedcf92af94227b976945081785c73","dark":"https://mintcdn.com/hashlock-markets/W3jVTJYLEiBG4td8/favicon-dark.svg?fit=max\u0026auto=format\u0026n=W3jVTJYLEiBG4td8\u0026q=85\u0026s=b178a1b91d6b566d68639c39d6a094bc"},"appearance":{"default":"dark"},"background":{"color":{"light":"#f5f6f8","dark":"#0b0e14"}},"navbar":{"links":[{"href":"https://hashlock.markets/app","label":"App"}],"primary":{"type":"button","label":"Get an API key","href":"https://hashlock.markets/developers"}},"footer":{"links":[{"header":"Legal","items":[{"label":"Terms","href":"https://hashlock.markets/legal/terms"},{"label":"Privacy","href":"https://hashlock.markets/legal/privacy"}]}]},"seo":{"metatags":{"og:site_name":"Hashlock Markets Docs","keywords":"atomic swap, HTLC, cross-chain, RFQ, OTC, Bitcoin, TRON, Solana, EVM, non-custodial, MCP, AI agents, API"},"indexing":"navigable"},"fonts":{"heading":{"family":"Satoshi","weight":500,"source":"fonts/Satoshi-Medium.woff2","format":"woff2"},"body":{"family":"Satoshi","weight":400,"source":"fonts/Satoshi-Regular.woff2","format":"woff2"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"hashlock-markets","hasAudioNarration":false,"actualSubdomain":"hashlock-markets","customDomains":["docs.hashlock.markets"],"gitSource":{"type":"github","owner":"hashlock-tech","repo":"hashlock-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"latestBuiltDeploymentHistoryId":"6aecd2df5db8fe579a227409","collectionId":"c9439e9c-7b1d-4876-ad88-8bb3d34c9ccf","liveDeploymentHistoryId":"6aecd2df5db8fe579a227409","schemaVersion":"v3"},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"DISABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6aedb54bf8ed849a5c7da712","clientVersion":"0.0.4076","searchFilterCounts":[{"language":"default","tag":"API reference","count":36},{"language":"default","tag":"Documentation","count":18},{"language":"default","tag":"Swaps and settlement","count":9},{"language":"default","tag":"Market","count":9},{"language":"default","tag":"Concepts","count":7},{"language":"default","tag":"Guides","count":6},{"language":"default","tag":"Wallets","count":6},{"language":"default","tag":"Webhooks","count":4},{"language":"default","tag":"Negotiation","count":4},{"language":"default","tag":"AI agents","count":3}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".nav-logo{height:2rem!important}.goplus-logo{width:auto!important;height:32px!important;max-width:none!important}.dark .goplus-logo{filter:invert(1)}.goplus-link{border-bottom:none!important;text-decoration:none!important}"}],"page":{"pagePath":"api-reference/build-unsigned-refund-after-the-timelock","slug":"/api-reference/build-unsigned-refund-after-the-timelock","pageMetadata":{"title":"Build UNSIGNED refund (after the timelock)","description":null,"deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/swaps/{id}/legs/{leg}/refund","href":"/api-reference/build-unsigned-refund-after-the-timelock","autogeneratedByOpenApi":true},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Build UNSIGNED refund (after the timelock)","description":null,"deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/swaps/{id}/legs/{leg}/refund","href":"/api-reference/build-unsigned-refund-after-the-timelock","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"summary":"Build UNSIGNED refund (after the timelock)","parameters":["f882fd20-fa7d-4a2f-b84c-dbb45dc44542","9ecc573f-c567-484e-a9c7-bb5fcd40f5c9","57f80462-cd4c-42f8-b0a8-707855dbea05"],"responses":{"200":"19bf23a0-1c29-4d69-84d8-79e6a15a25f5","400":"9b7e23e4-1e28-41c8-b045-5526b5436571","409":"58cac56b-7437-492a-9be1-4d676b873564","504":"85a15361-2738-42be-8fc1-c4d1705e0bf5"},"operationId":"postSwapsByIdLegsByLegRefund","method":"post","type":"path","servers":["fa5eaf0f-b3d5-41ac-97b2-a2ad974f1f1e"],"security":["02729528-b331-4025-bc19-f4263b95bef2"],"path":"/v1/swaps/{id}/legs/{leg}/refund","baseUrlOptions":["https://api.hashlock.markets"],"title":"Build UNSIGNED refund (after the timelock)","description":"","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"f882fd20-fa7d-4a2f-b84c-dbb45dc44542":{"name":"id","in":"path","required":true,"schema":{"type":"string","isRequired":true,"uniqueKey":"","typeLabel":"string"}},"9ecc573f-c567-484e-a9c7-bb5fcd40f5c9":{"name":"leg","in":"path","required":true,"schema":{"type":"string","enum":["a","b"],"isRequired":true,"uniqueKey":"","typeLabel":"enum\u003cstring>"}},"57f80462-cd4c-42f8-b0a8-707855dbea05":{"name":"escrow","in":"query","required":false,"schema":{"type":"string","isRequired":false,"description":"bitcoin only: refund an escrow this leg moved OFF (after a pubkey correction) instead of its current one; refused for an address that was never this leg's escrow","uniqueKey":"","typeLabel":"string"},"description":"bitcoin only: refund an escrow this leg moved OFF (after a pubkey correction) instead of its current one; refused for an address that was never this leg's escrow"}},"responses":{"19bf23a0-1c29-4d69-84d8-79e6a15a25f5":{"description":"signing material","content":{"application/json":{"schema":{"type":"object","description":"What to sign, per chain family; `sign` says which shape it is. `evm-tx`: sign and send each of `txs` in order, from `from` when given. `btc-payment` (fund): pay `amountSats` to `payTo` (and `feeAmountSats` to `feePayTo` when present). `btc-sighash` (claim/refund): sign each of `sighashHexes`, then broadcast `{ psbtBase64, signaturesHex, preimageHex? }`. `solana-tx`: sign `transactionBase64` and broadcast it. `tron-txid`: sign each `transactions[].txID` and broadcast each signed `transaction`.","required":["chain","family","sign"],"properties":{"chain":{"type":"string","isRequired":true,"uniqueKey":"chain","typeLabel":"string"},"family":{"type":"string","enum":["evm","bitcoin","svm","tvm"],"isRequired":true,"uniqueKey":"family","typeLabel":"enum\u003cstring>"},"sign":{"type":"string","enum":["evm-tx","btc-payment","btc-sighash","solana-tx","tron-txid"],"isRequired":true,"uniqueKey":"sign","typeLabel":"enum\u003cstring>"},"note":{"type":"string","description":"what to do with it, in words","uniqueKey":"note","typeLabel":"string"},"chainId":{"type":"integer","description":"evm-tx","uniqueKey":"chainId","typeLabel":"integer"},"from":{"type":"string","description":"evm-tx (fund) and tron-txid: the address that must sign","uniqueKey":"from","typeLabel":"string"},"txs":{"type":"array","description":"evm-tx: unsigned transactions (an ERC-20 fund is approve, then createSwap)","items":{"type":"object","properties":{"to":{"type":"string","uniqueKey":"txs.items.[INDEX].to","typeLabel":"string"},"data":{"type":"string","uniqueKey":"txs.items.[INDEX].data","typeLabel":"string"},"value":{"type":"string","description":"hex wei","uniqueKey":"txs.items.[INDEX].value","typeLabel":"string"}},"uniqueKey":"txs.items.[INDEX]","typeLabel":"object"},"uniqueKey":"txs","typeLabel":"object[]"},"payTo":{"type":"string","description":"btc-payment: the escrow (P2WSH) address","uniqueKey":"payTo","typeLabel":"string"},"amountSats":{"oneOf":[{"type":"string","description":"btc-payment: sats still due to the escrow (string); btc-sighash: what the spend pays out after the network fee (integer)","uniqueKey":"amountSats.oneOf.0","typeLabel":"string"},{"type":"integer","description":"btc-payment: sats still due to the escrow (string); btc-sighash: what the spend pays out after the network fee (integer)","uniqueKey":"amountSats.oneOf.1","typeLabel":"integer"}],"uniqueKey":"amountSats","typeLabel":"string | integer"},"topUp":{"type":"boolean","description":"btc-payment: the escrow already holds part of the amount","uniqueKey":"topUp","typeLabel":"boolean"},"feePayTo":{"type":"string","description":"btc-payment: the protocol fee treasury, when this leg carries the fee","uniqueKey":"feePayTo","typeLabel":"string"},"feeAmountSats":{"type":"string","description":"btc-payment: the protocol fee in sats","uniqueKey":"feeAmountSats","typeLabel":"string"},"toAddress":{"type":"string","description":"btc-sighash: where the spend pays","uniqueKey":"toAddress","typeLabel":"string"},"psbtBase64":{"type":"string","description":"btc-sighash","uniqueKey":"psbtBase64","typeLabel":"string"},"sighashHex":{"type":"string","description":"btc-sighash: equals sighashHexes[0]","uniqueKey":"sighashHex","typeLabel":"string"},"sighashHexes":{"type":"array","items":{"type":"string","uniqueKey":"sighashHexes.items.[INDEX]","typeLabel":"string"},"description":"btc-sighash: one per input, same key","uniqueKey":"sighashHexes","typeLabel":"string[]"},"feeSats":{"type":"integer","description":"btc-sighash: the network fee","uniqueKey":"feeSats","typeLabel":"integer"},"preimageHex":{"type":"string","description":"btc-sighash, claim: the secret you sent, to pass back on broadcast","uniqueKey":"preimageHex","typeLabel":"string"},"timelockUnix":{"type":"integer","description":"refund (btc-sighash, solana-tx): the leg timelock","uniqueKey":"timelockUnix","typeLabel":"integer"},"escrow":{"type":"string","description":"solana-tx: the escrow account","uniqueKey":"escrow","typeLabel":"string"},"transactionBase64":{"type":"string","description":"solana-tx: the unsigned transaction","uniqueKey":"transactionBase64","typeLabel":"string"},"blockhash":{"type":"string","description":"solana-tx","uniqueKey":"blockhash","typeLabel":"string"},"lastValidBlockHeight":{"type":"integer","description":"solana-tx: rebuild once the chain passes it","uniqueKey":"lastValidBlockHeight","typeLabel":"integer"},"transactions":{"type":"array","description":"tron-txid: unsigned transactions (a TRC-20 fund is approve, then fund)","items":{"type":"object","properties":{"transaction":{"type":"object","uniqueKey":"transactions.items.[INDEX].transaction","typeLabel":"object"},"txID":{"type":"string","uniqueKey":"transactions.items.[INDEX].txID","typeLabel":"string"}},"uniqueKey":"transactions.items.[INDEX]","typeLabel":"object"},"uniqueKey":"transactions","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"chain":"\u003cstring>","family":"evm","sign":"evm-tx","note":"\u003cstring>","chainId":123,"from":"\u003cstring>","txs":[{"to":"\u003cstring>","data":"\u003cstring>","value":"\u003cstring>"}],"payTo":"\u003cstring>","amountSats":"\u003cstring>","topUp":true,"feePayTo":"\u003cstring>","feeAmountSats":"\u003cstring>","toAddress":"\u003cstring>","psbtBase64":"\u003cstring>","sighashHex":"\u003cstring>","sighashHexes":["\u003cstring>"],"feeSats":123,"preimageHex":"\u003cstring>","timelockUnix":123,"escrow":"\u003cstring>","transactionBase64":"\u003cstring>","blockhash":"\u003cstring>","lastValidBlockHeight":123,"transactions":[{"transaction":{},"txID":"\u003cstring>"}]}}},"exampleType":"generated"}},"exampleType":"generated"},"9b7e23e4-1e28-41c8-b045-5526b5436571":{"description":"error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","isRequired":true,"uniqueKey":"error","typeLabel":"string"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"58cac56b-7437-492a-9be1-4d676b873564":{"description":"refused for the swap's state, not the request: the timelock has not passed yet, you already claimed the other leg, or the transaction would revert now — the message says which (never stored by Idempotency-Key)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","isRequired":true,"uniqueKey":"error","typeLabel":"string"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"85a15361-2738-42be-8fc1-c4d1705e0bf5":{"description":"a chain or explorer read of ours ran out of time — nothing was changed; retry (an Idempotency-Key does not remember a 504)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","isRequired":true,"uniqueKey":"error","typeLabel":"string"}},"required":["error"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"02729528-b331-4025-bc19-f4263b95bef2":{"ApiKey":{"type":"http","scheme":"bearer","description":"An API key (hk_live_… / hk_test_…) with read/taker/maker scopes. `read` is read-only: every write except webhooks needs `taker` or `maker` (403 otherwise), and either of those can read too. Creating RFQs and listing tokens need `taker`; quoting needs `maker`.","scopes":[],"schemeName":"ApiKey"}}},"servers":{"fa5eaf0f-b3d5-41ac-97b2-a2ad974f1f1e":{"url":"https://api.hashlock.markets","description":"production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"An API key (hk_live_… / hk_test_…) with read/taker/maker scopes. `read` is read-only: every write except webhooks needs `taker` or `maker` (403 otherwise), and either of those can read too. Creating RFQs and listing tokens need `taker`; quoting needs `maker`.","scopes":[],"schemeName":"ApiKey"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"An API key (hk_live_… / hk_test_…) with read/taker/maker scopes. `read` is read-only: every write except webhooks needs `taker` or `maker` (403 otherwise), and either of those can read too. Creating RFQs and listing tokens need `taker`; quoting needs `maker`.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"ApiKey","name":"Authorization"}],"title":"ApiKey"}]},"originalFileLocation":"api-reference/openapi.json"},"subdomain":"hashlock-markets","siteName":"Hashlock Markets","title":"Build UNSIGNED refund (after the timelock) - Hashlock Markets","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-06T11:09:03.767Z","originalFileLocation":"api-reference/build-unsigned-refund-after-the-timelock.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"keywords\" content=\"atomic swap, HTLC, cross-chain, RFQ, OTC, Bitcoin, TRON, Solana, EVM, non-custodial, MCP, AI agents, API\">\u003cmeta data-mint-head name=\"application-name\" content=\"Hashlock Markets\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/hashlock-markets/EfiTJHPU-uDB1RSd/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/hashlock-markets/EfiTJHPU-uDB1RSd/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/hashlock-markets/EfiTJHPU-uDB1RSd/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/hashlock-markets/EfiTJHPU-uDB1RSd/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/hashlock-markets/EfiTJHPU-uDB1RSd/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/hashlock-markets/EfiTJHPU-uDB1RSd/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/hashlock-markets/EfiTJHPU-uDB1RSd/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/hashlock-markets/EfiTJHPU-uDB1RSd/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/hashlock-markets/EfiTJHPU-uDB1RSd/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Build UNSIGNED refund (after the timelock) - Hashlock Markets\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Hashlock Markets Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.hashlock.markets/api-reference/build-unsigned-refund-after-the-timelock\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://hashlock-markets.mintlify.site/_mintlify/api/og/v2?division=Swaps+and+settlement\u0026amp;title=Build+UNSIGNED+refund+%28after+the+timelock%29\u0026amp;theme=ab4c4d8da703125ceb481f13\u0026amp;signature=a76035fcc15e1b2f22ebe236bdd3d70d004e51cef4ec797d9c4339eb2f674d61\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Build UNSIGNED refund (after the timelock) - Hashlock Markets\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://hashlock-markets.mintlify.site/_mintlify/api/og/v2?division=Swaps+and+settlement\u0026amp;title=Build+UNSIGNED+refund+%28after+the+timelock%29\u0026amp;theme=ab4c4d8da703125ceb481f13\u0026amp;signature=a76035fcc15e1b2f22ebe236bdd3d70d004e51cef4ec797d9c4339eb2f674d61\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/hashlock-markets/EfiTJHPU-uDB1RSd/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Hashlock Markets\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#665bff\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.hashlock.markets/api-reference/build-unsigned-refund-after-the-timelock\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/build-unsigned-refund-after-the-timelock.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.hashlock.markets/#organization\",\"name\":\"Hashlock Markets\",\"url\":\"https://docs.hashlock.markets\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/hashlock-markets/W3jVTJYLEiBG4td8/logo/light.svg?fit=max\u0026auto=format\u0026n=W3jVTJYLEiBG4td8\u0026q=85\u0026s=b391e3e8e9aa88f494e04c0f38ab75b8\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.hashlock.markets#website\",\"name\":\"Hashlock Markets\",\"url\":\"https://docs.hashlock.markets\",\"publisher\":{\"@id\":\"https://docs.hashlock.markets/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.hashlock.markets/api-reference/build-unsigned-refund-after-the-timelock#webpage\",\"url\":\"https://docs.hashlock.markets/api-reference/build-unsigned-refund-after-the-timelock\",\"name\":\"Build UNSIGNED refund (after the timelock)\",\"dateModified\":\"2026-11-06T11:09:03.767Z\",\"isPartOf\":{\"@id\":\"https://docs.hashlock.markets#website\"},\"breadcrumb\":{\"@id\":\"https://docs.hashlock.markets/api-reference/build-unsigned-refund-after-the-timelock#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.hashlock.markets/api-reference/build-unsigned-refund-after-the-timelock#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Swaps and settlement\",\"item\":\"https://docs.hashlock.markets/api-reference/list-your-swaps-%E2%80%94-cursor-paginated\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Build UNSIGNED refund (after the timelock)\",\"item\":\"https://docs.hashlock.markets/api-reference/build-unsigned-refund-after-the-timelock\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.hashlock.markets/api-reference/build-unsigned-refund-after-the-timelock#apireference\",\"headline\":\"Build UNSIGNED refund (after the timelock)\",\"name\":\"Build UNSIGNED refund (after the timelock)\",\"url\":\"https://docs.hashlock.markets/api-reference/build-unsigned-refund-after-the-timelock\",\"mainEntityOfPage\":{\"@id\":\"https://docs.hashlock.markets/api-reference/build-unsigned-refund-after-the-timelock#webpage\"},\"dateModified\":\"2026-11-06T11:09:03.767Z\",\"publisher\":{\"@id\":\"https://docs.hashlock.markets/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.hashlock.markets#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Hashlock Markets\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Hashlock Markets","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":""}]},{"tab":"API reference","groups":[{"group":"Overview","pages":[{"title":"Introduction","href":"/api-reference/introduction"}]},{"group":"Account and keys","pages":[{"title":"Verify the key, list its scopes and the wallets attached to its account","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/me","href":"/api-reference/verify-the-key-list-its-scopes-and-the-wallets-attached-to-its-account"},{"title":"Start minting an API key: a single-use nonce (5 minutes). No key needed.","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/keys/nonce","href":"/api-reference/start-minting-an-api-key:-a-single-use-nonce-5-minutes-no-key-needed"},{"title":"Mint an API key with a wallet signature — no browser, no key needed (agents start here)","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/keys","href":"/api-reference/mint-an-api-key-with-a-wallet-signature-—-no-browser-no-key-needed-agents-start-here"}]},{"group":"Wallets","pages":[{"title":"A single-use nonce to put in the message you are about to sign","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/wallets/nonce","href":"/api-reference/a-single-use-nonce-to-put-in-the-message-you-are-about-to-sign"},{"title":"Prove a EVM wallet this account holds","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/wallets/evm","href":"/api-reference/prove-a-evm-wallet-this-account-holds"},{"title":"Prove a TRON wallet this account holds","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/wallets/tron","href":"/api-reference/prove-a-tron-wallet-this-account-holds"},{"title":"Prove a Solana wallet this account holds","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/wallets/solana","href":"/api-reference/prove-a-solana-wallet-this-account-holds"},{"title":"Prove a Bitcoin wallet this account holds","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/wallets/bitcoin","href":"/api-reference/prove-a-bitcoin-wallet-this-account-holds"},{"title":"Withdraw a proof this account made","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json delete /v1/wallets/{address}","href":"/api-reference/withdraw-a-proof-this-account-made"}]},{"group":"Market","pages":[{"title":"Enabled asset registry — the whole list, or a search","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/assets","href":"/api-reference/enabled-asset-registry-—-the-whole-list-or-a-search"},{"title":"Ask for a token to be listed","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/assets","href":"/api-reference/ask-for-a-token-to-be-listed"},{"title":"Order book (open RFQs to quote) — cursor-paginated","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/rfqs","href":"/api-reference/order-book-open-rfqs-to-quote-—-cursor-paginated"},{"title":"Create an RFQ (scope: taker)","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/rfqs","href":"/api-reference/create-an-rfq-scope:-taker"},{"title":"Your own RFQs — private ones included, every status — cursor-paginated","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/rfqs/mine","href":"/api-reference/your-own-rfqs-—-private-ones-included-every-status-—-cursor-paginated"},{"title":"Get an RFQ","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/rfqs/{id}","href":"/api-reference/get-an-rfq"},{"title":"The negotiation threads on an RFQ — every one for its creator, your own for a maker","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/rfqs/{id}/threads","href":"/api-reference/the-negotiation-threads-on-an-rfq-—-every-one-for-its-creator-your-own-for-a-maker"},{"title":"Withdraw your own RFQ (scope: taker)","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/rfqs/{id}/cancel","href":"/api-reference/withdraw-your-own-rfq-scope:-taker"},{"title":"Quote an RFQ (scope: maker) — opens a settlement thread","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/rfqs/{id}/quotes","href":"/api-reference/quote-an-rfq-scope:-maker-—-opens-a-settlement-thread"}]},{"group":"Negotiation","pages":[{"title":"Get a negotiation thread (messages, current terms)","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/threads/{id}","href":"/api-reference/get-a-negotiation-thread-messages-current-terms"},{"title":"Propose a new price on a thread","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/threads/{id}/propose","href":"/api-reference/propose-a-new-price-on-a-thread"},{"title":"Accept the counterparty's pending price","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/threads/{id}/accept-proposal","href":"/api-reference/accept-the-counterpartys-pending-price"},{"title":"Accept the current terms — COMMITS, and cannot be undone","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/threads/{id}/accept","href":"/api-reference/accept-the-current-terms-—-commits-and-cannot-be-undone"}]},{"group":"Swaps and settlement","pages":[{"title":"List your swaps — cursor-paginated","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/swaps","href":"/api-reference/list-your-swaps-—-cursor-paginated"},{"title":"Swap lifecycle status","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/swaps/{id}","href":"/api-reference/swap-lifecycle-status"},{"title":"Set a settlement address","openapi":"POST /v1/swaps/{id}/address","href":"/api-reference/endpoints/set-swap-address"},{"title":"Reserve an EVM leg's funding, then report its broadcast","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/swaps/{id}/fund-intent","href":"/api-reference/reserve-an-evm-legs-funding-then-report-its-broadcast"},{"title":"Give back a funding reservation that never broadcast","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json delete /v1/swaps/{id}/fund-intent/{leg}","href":"/api-reference/give-back-a-funding-reservation-that-never-broadcast"},{"title":"Build UNSIGNED transaction(s) to fund a leg — sign with your own key/HSM, then broadcast","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/swaps/{id}/legs/{leg}/fund","href":"/api-reference/build-unsigned-transactions-to-fund-a-leg-—-sign-with-your-own-keyhsm-then-broadcast"},{"title":"Build UNSIGNED claim (reveals the secret) — body: { secret: 32-byte hex }","description":"The secret travels to the server in this request, on every chain: the EVM, TRON and Solana claim transactions carry it, and on Bitcoin it comes back as `preimageHex` for the broadcast. Until then the server has only `sha256(secret)`. Build the claim when you are about to send it: the transaction puts the secret on chain, where it is public. It is refused until both legs are funded, and a refused request has still carried the secret, so do not call it earlier.","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/swaps/{id}/legs/{leg}/claim","href":"/api-reference/build-unsigned-claim-reveals-the-secret-—-body:-"},{"title":"Build UNSIGNED refund (after the timelock)","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/swaps/{id}/legs/{leg}/refund","href":"/api-reference/build-unsigned-refund-after-the-timelock"},{"title":"Relay a client-signed transaction","description":null,"deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/tx/broadcast","href":"/api-reference/relay-a-client-signed-transaction"}]},{"group":"Webhooks","pages":[{"title":"List your webhooks (secret not shown)","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json get /v1/webhooks","href":"/api-reference/list-your-webhooks-secret-not-shown"},{"title":"Register a webhook","openapi":"POST /v1/webhooks","href":"/api-reference/endpoints/register-webhook"},{"title":"Delete a webhook","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json delete /v1/webhooks/{id}","href":"/api-reference/delete-a-webhook"},{"title":"Send a test delivery to a webhook","deprecated":null,"version":null,"openapi":"/api-reference/openapi.json post /v1/webhooks/{id}/ping","href":"/api-reference/send-a-test-delivery-to-a-webhook"}]}]}]},"basePath":"","title":"Build UNSIGNED refund (after the timelock) - Hashlock Markets","buildId":"dpl_8LJbrAiZvr1K98WQNZXCyY5AvT34","deploymentId":"dpl_8LJbrAiZvr1K98WQNZXCyY5AvT34","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-i2a3QZ8E.js","utils-ChLwp8m0.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-DRktVTDc.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-CA2pEs4T.js","snippetPresets-ClQ6XrKD.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-Ct_Lv36y.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-Cn2PYw9e.js","shallow-rkyymjXQ.js","getApiPlaygroundDisplay-BB9vkXtE.js","CodeSnippet-Bm5RU7m1.js","CodeSnippets-BgU9Deuz.js","Page-BUDYNlhG.js","getPastedJson-BD-6NNum.js","icon-8Z6tud2e.js","MethodPill-Tuzr4g3V.js","DuplicateIcon-0ceWFYhN.js","createIcon-FBXow_ST.js","DynamicMarkdown-CD8713Yy.js","SectionHeading-7zgzQbH-.js","axios-vUo_bRtp.js","Markdown-D7Ofw1oz.js","clsx-eKJ4rcii.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-CwjSCXIK.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-9EK5IAXV.js"]}