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
- A module prepares a batch of
TransactInoperations (e.g., multiple transfers). - TrexWallet validates and applies the batch atomically.
- With a
tx_group, the entries are treated as one logical unit (all settle or none). - 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.
amountandfeeare integer units (lowest denomination for the currency), not decimal strings.typeis the numericTransactTypeEnumvalue (1 =InnerTransfer, 24 =PaymentOrder, etc.).tx_groupis 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_transactionsmust NOT be used forDebtCharge— there is a dedicatedcreate_debt_chargeendpoint for that.