Withdrawal
Withdrawal is the process of moving funds from a TrexWallet account to an external blockchain address. This process is subject to network fees, AML/KYC checks, and may require manual approval for large amounts.
Key Steps
- User initiates a withdrawal request.
- System checks balance, permissions, and AML/KYC status.
- Withdrawal is queued and processed by the blockchain module.
- Network fee is calculated and deducted.
- Transaction is broadcast to the blockchain.
- Status is updated after confirmations.
Example API Call
POST /trex/v1/wallet/create_withdraw
Content-Type: application/json
Cookie: sid=...
{
"currency": "ETH",
"tokenNetwork": 1,
"amount": 0.5,
"fee": 0.001,
"address": "0x..."
}
The wallet is identified by the authenticated session. tokenNetwork is the terminal identifier
returned by the terminal API. fee must match the server-quoted withdrawal fee; if it changes
between preview and confirmation, the request is rejected and the caller must re-quote.
Per-terminal AML and RequirePartnerInfo flags are evaluated server-side. Large amounts may
require operator approval on the WithdrawApprove admin page.
Sending from a specific client address (EVM)
For EVM-based terminals (Ethereum, BNB Smart Chain with Base / ERC20 / BEP20 / EVM) two opt-in fields control the on-chain source:
requireClientAssetSource: true— pin the withdrawal to one of the user's own client addresses. The server auto-picks the first eligible address (sufficient asset + native gas, orHotApprovedflow with hot spender). The platform never substitutes a plain hot-wallet source with a different on-chain asset owner.sourceAddressId: "<int64>"— explicit address id fromlist_addresses, sent as a decimal string. ImpliesrequireClientAssetSource=true. TrexWallet validates ownership (the address must belong to the wallet), security policy (notDisabled/Compromised/Reserve/ManualOnly/TestOnly), and balance/gas eligibility. If the chosen address cannot fund the withdrawal, the request is rejected withClientAssetSourceNotAvailable. Non-EVM terminals reject this field withNotSupportedbefore any OTP step.
To let the user pick which of their own addresses to use, the wallet UI calls list_addresses?includeTechnicalState=true — the per-address technicalState reports the on-chain amount of the asset, the native coin available for gas, hotApproved, and whether the backend currently supports pinned source for this terminal.