Skip to main content
A Hinkal swap whose payout fails isn’t refunded on its own. This endpoint sends the funds back to the wallet that paid, and only there. Use it when /status reports failed with venueStatus ending (needs recovery), or when the deposit confirmed but /status still says pending 25 minutes after the order. It works for 7 days after the order.
A recovery is public. It’s an ordinary on-chain payment back to the paying wallet, which can link that wallet to the one it was paying. Tell your user before they sign.
On JavaScript or TypeScript, recoverStuckFunds runs the whole flow and checks each step. In Python, use recover_stuck_funds.

The flow

1

Ask with the statusRef

{ statusRef } answers sign step 1: a personal_sign that opens a read-only session. Check it as on /execute: the same three lines, never the extra “can also be used to submit transactions” line.
2

Prove the wallet paid

Send { statusRef, authorization, signature } signed by the paying wallet. It answers sign step 2 (a recovery to sign) or nothing.
3

Sign the recovery

Check the typed data: domain { name: "Hinkal Enclave", chainId } on the swap’s source chain, primaryType RecoverStuckBridgeBalance or WithdrawStuckUtxos, message.chainId equal to the domain’s, one tokenAddress, and recipient the paying wallet. Send { statusRef, authorization, signature } again. It answers done with what was recovered.
4

Look again

A swap can leave more than one token. Send { statusRef, authorization } with the authorization from done and no signature, until the answer is nothing.
Each authorization is single-use and lasts 10 minutes.

Request

string
required
The statusRef of the Hinkal swap’s TRANSACTION.
string
From the previous answer.
string
The paying wallet’s signature over the previous answer’s sign. Leave it out after done.

Response

recovered amounts are before Hinkal’s recovery fee, so the wallet receives slightly less. nothing means nothing is stuck right now. A failed bridge shows up about 3 minutes after the payout fails, so try again a few minutes later if you called too soon.

Errors