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
| status | Final | Meaning |
|---|---|---|
| PENDING | in flight | Transaction issued, not yet signed or landed. |
| CONFIRMING | in flight | Deposit seen, awaiting confirmation. |
| EXCHANGING | in flight | Deposit confirmed, moving through the pool. |
| ANONYMIZING | in flight | In the pool, waiting out the privacy delay. |
| SUCCESSFUL | final | Recipient credited. |
| REFUNDED | final | Returned to the sender, and the refund has confirmed. |
| EXPIRED | final | Never signed. Nothing entered the pool. |
| FAILED | final | Permanent 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.
| detailedStatus | Surfaces as | Meaning |
|---|---|---|
| awaiting_signature | PENDING | Transaction issued, nothing on-chain yet. |
| deposit_seen | CONFIRMING | Deposit observed, not yet confirmed. |
| deposit_confirmed | EXCHANGING | Confirmed and accepted into the pool. |
| queued_payout | ANONYMIZING | Waiting out the decorrelation delay. |
| paying | ANONYMIZING | Payout transaction in flight. |
| paid | SUCCESSFUL | Recipient credited. |
| refunding | EXCHANGING | Refund in flight. Not REFUNDED. See below. |
| refunded | REFUNDED | Refund confirmed on-chain. |
| expired | EXPIRED | Never signed. |
| failed | FAILED | Permanent failure. |
A refund in flight reads as EXCHANGING
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.
