Cloak API

Order lifecycle

Cloak has eight order states. Four are final. When final is true, you can stop polling and act on the result.

States

statusFinalMeaning
PENDINGin flightTransaction issued, not yet signed or landed.
CONFIRMINGin flightDeposit seen, awaiting confirmation.
EXCHANGINGin flightDeposit confirmed, moving through the pool.
ANONYMIZINGin flightIn the pool, waiting out the privacy delay.
SUCCESSFULfinalRecipient credited.
REFUNDEDfinalReturned to the sender, and the refund has confirmed.
EXPIREDfinalNever signed. Nothing entered the pool.
FAILEDfinalPermanent failure.

Two states to handle carefully

EXCHANGING means the deposit is moving through the pool. On a same-asset send it does not imply a swap. On a private swap it does: both swap states project to it, so your integration needs no new case.

REFUNDED appears only once a refund has actually confirmed on-chain, never while one is merely in progress.

detailedStatus

Use detailedStatus for logs and support. Build application logic around status, because new detailed values may be added.

detailedStatusSurfaces asMeaning
awaiting_signaturePENDINGTransaction issued, nothing on-chain yet.
deposit_seenCONFIRMINGDeposit observed, not yet confirmed.
deposit_confirmedEXCHANGINGConfirmed and accepted into the pool.
queued_payoutANONYMIZINGWaiting out the decorrelation delay.
payingANONYMIZINGPayout transaction in flight.
paidSUCCESSFULRecipient credited.
refundingEXCHANGINGRefund in flight. Not REFUNDED. See below.
refundedREFUNDEDRefund confirmed on-chain.
expiredEXPIREDNever signed.
failedFAILEDPermanent failure.

A refund in flight reads as EXCHANGING

Until the refund confirms, status remains EXCHANGING and detailedStatus becomes refunding. Only show a completed refund whenstatus is REFUNDED.

Acting on a final status

You can update the interface, create a receipt, or send a webhook when final is true. Handle all four final states. A refund is a terminal failure of the transfer, not a success.