Transaction States
TrexWallet APIs expose transaction status as TransactStateEnum flags.
State is additive, so one transaction can contain multiple flags.
Canonical transaction states (TransactStateEnum)
| State | Value | Description |
|---|---|---|
| Draft | 0 | Created but not yet started. |
| Created | 1 | Accepted and waiting for the next lifecycle step. |
| Confirmed | 2 | Confirmed in flows that require explicit confirmation. |
| Predicted | 4 | Expected movement marker before final settlement. |
| Verified | 8 | The transaction type's own pre-final gate has passed; the meaning is type-specific. |
| Blocked | 16 | Temporarily blocked from further movement. |
| Canceled | 32 | Canceled; any applicable reserve is returned. |
| Failed | 64 | Reserved compatibility bit; not normally returned as the sole terminal outcome. |
| Finished | 128 | Finalized operation. |
State is handled as OR-composition (additive flags), not as a single overwritten value.
Verified is type-specific
Do not interpret Verified as one universal compliance state:
| Transaction type | Meaning of Verified |
|---|---|
| Income | The partner_info gate is satisfied. It is automatic when the terminal does not require partner info, or set after the required data is supplied. |
| Outcome | Compliance has released the withdrawal for dispatch/finalization (AmlConfirm on address status). |
| TransferOrder | The payout's own recipient and required metadata gate is satisfied; the held payout leg can be released. |
Completion rules
Two independent checks — do not mix them:
-
Is the transaction completed? — numeric threshold:
- Not completed (active):
state < Canceled(< 32) - Completed (terminal):
state >= Canceled(>= 32)
- Not completed (active):
-
Which exact outcome? — bit check (each is its own flag):
Canceled(32) — cancelledFailed(64) — failedFinished(128) — finished successfullyBlocked(16) — AML blocked (not terminal by itself)
Threshold >= Canceled answers "can we still operate on this tx?" (no).
Outcome name is taken from the actual flag, not from a range.
Payment order (tx_type = PaymentOrder)
GET /payment/v1/get_order_info and GET /private/v1/get_payment_order_info return the canonical
state bitmask without converting it to a separate string lifecycle.
Use the same completion checks as above:
- terminal/cancel path:
statehasCanceled - terminal/success path:
statehasFinishedand does not haveCanceled - pending path: neither
FinishednorCanceledis set
Payment statistics counters
For finished / cancelled / pending aggregates:
cancelled = state has Canceled
finished = state has Finished AND NOT cancelled
pending = everything else
Payment order lifecycle (high level)
stateDiagram-v2
[*] --> Draft: put_payment_order (open flow)
Draft --> Predicted: order_start (alias payment_order_start) / locked flow create
Predicted --> Finished: network settlement + link
Predicted --> Canceled: cancel / expiry / failure
API string statuses (payment flows)
confirm_crypto returns plain ApiResponse (success/error). The order's canonical
TransactStateEnum bitmask is exposed via
GET /payment/v1/get_order_info (PaymentOrderOut.state) and
GET /private/v1/get_payment_order_info (PaymentOrderInfoOut.state).
Remaining endpoint-local string statuses (small, fixed sets — kept for clarity in synchronous one-shot responses):
PaymentResult.status(internal pay):completed,failedRefundResult.status(synchronousrefund_paymentresponse): alwayscompletedon success; failures come back as anApiResponseerror, not a status stringRefundStatus.status(get_refund_status):created,completed,cancelled
Transaction type values (TransactTypeEnum)
The full value-to-name mapping lives in the admin reference:
Transactions and Orders admin. The same numeric values are used
by API tx_type fields and estimate_fee.
Related
- Sub-Balances
- Payment Gateway
- Transactions and Orders admin — admin reference for
TransactTypeEnum+AdrTxStateEnum