Skip to main content

Batch Operations

Batch operations let system processes execute multiple ledger transactions in a single private inter-module request. When a tx_group is supplied, the entries share one group identifier and settle as a single atomic unit.

Key Steps

  1. A module prepares a batch of TransactIn operations (e.g., multiple transfers).
  2. TrexWallet validates and applies the batch atomically.
  3. With a tx_group, the entries are treated as one logical unit (all settle or none).
  4. The response is an ApiResponse<Dictionary<long,string>> containing only the failed entries (transaction ID → error message). An empty dictionary means every operation succeeded.

Example API Call

Batch execution is exposed only as a private inter-module endpoint (not callable by end users):

POST private/v1/execute_transactions?tx_group=9000000000001
Content-Type: application/json

[
{
"type": 1,
"from": 17234567890001,
"to": 17234567890099,
"amount": 1000000,
"currency": "USDT",
"fee": 0,
"externalId": 0,
"appId": 0,
"partnerInfo": "",
"tag": ""
},
{
"type": 1,
"from": 17234567890001,
"to": 17234567890100,
"amount": 2000000,
"currency": "USDT",
"fee": 0,
"externalId": 0,
"appId": 0,
"partnerInfo": "",
"tag": ""
}
]

Notes:

  • The endpoint uses the private (inter-module) authentication scheme.
  • amount and fee are integer units (lowest denomination for the currency), not decimal strings.
  • type is the numeric TransactTypeEnum value (1 = InnerTransfer, 24 = PaymentOrder, etc.).
  • tx_group is a query parameter. When supplied, all entries share the group identifier and the platform treats them as one logical unit (all settle or none).
  • Integrations must submit operations through execute_transactions; direct data-store changes are unsupported and bypass validation and atomicity guarantees.
  • Generic execute_transactions must NOT be used for DebtCharge — there is a dedicated create_debt_charge endpoint for that.