Skip to main content

Internal Transfer

Internal transfer is a process of moving funds between wallets within TrexWallet, without interacting with external blockchains. This operation is instant and atomic. A fee may apply: the transfer tariff is resolved per currency/amount and can be zero or greater.

Key Steps

  1. User initiates a transfer to another TrexWallet user (by user ID or internal address), or to another wallet owned by the same user.
  2. System checks balances and permissions.
  3. Funds are debited from the sender's sub-balance and credited to the recipient's sub-balance.
  4. Transaction is recorded in the internal ledger.
  5. Both users receive notifications.

Example API Call

POST /trex/v1/wallet/internal_transfer
Content-Type: application/json
Cookie: sid=...

{
"recipient": "user@example.com",
"currency": "USDT",
"amount": 100.0,
"tag": "split bill"
}

The sender identity comes from the authenticated session. The optional tag carries a comment shown in transaction history. Internal transfers are atomic: either the complete transfer is accepted or no balance changes are applied.

Recipient Formats

The recipient field accepts:

  • Crm ID
  • email
  • phone number
  • Telegram ID
  • internal wallet address
  • destination wallet_id

When recipient is a wallet_id, TrexWallet treats it as an exact destination wallet. The wallet must belong to the same project as the active session wallet.

If the destination wallet belongs to the same user but is a different wallet, the operation is recorded as a self wallet transfer. It uses the same internal_transfer endpoint and confirmation flow, but appears in history with the self-transfer transaction type and can have a separate tariff.

Trying to transfer to the same active wallet is rejected.

Wallet UI Terminal

In terminal-driven wallet UIs, self wallet transfers should be exposed as a separate internal processing method:

FieldValue
type_network240 (Internal)
type_contract234 (SelfWalletTransfer)
Built-in labelOwn Wallet Transfer

The UI should choose the transfer form from type_contract, just like other withdrawal / internal processing methods. The selected destination wallet id is sent as recipient.

Two-Step Confirmation

The first internal_transfer call returns a CreateTransactOut with txId, the resolved fee, and a confirmationStatusCode. To finalize, repeat the call with the transaction tick and code as query parameters:

POST /trex/v1/wallet/internal_transfer?confirmationTimetick=<txId>&confirmationCode=<code>

When the wallet has the Require2FA flag, the confirmation channel depends on the login method (X-KeyType): Fido2Key returns NeedSign (signature verified via X-SignResult), PassKey/UserKey send an OTP (NeedCodeConfirm). Without Require2FA the code is returned inline for confirmation.