Transactions
Tron Network has a diverse and dynamic set of transaction types.TronBatchProcessor has methods for subscribing to some common transaction types, all with fine-grained filters:
For other transaction types you can use the general method addTransaction() that does not offer much filtering.
If your application would benefit from fine-grained request methods for other transaction types, please let us know in the SquidDevs Telegram channel.
addTransferTransaction(options) {#add-transfer-transaction}
Get some or all TransferContract transactions on the network. options has the following structure:
where field:
owner: the set of addresses of owners of the token being transferred.to: the set of addresses of tokens’ receivers.
where field to subscribe to all TransferContract txs network-wide.
Related data can be requested via the include field:
logs = true: will retrieve event logs emitted by the selected transactions.internalTransactions = true: will retrieve internal txs that occurred due to the selected transactions.
.logs and .internalTransactions fields of each transaction item.
Note that transactions can also be requested by the other TronBatchProcessor methods as related data.
Selection of the exact fields to be retrieved for each transaction and the optional related data items is done with the setFields() method documented on the Field selection page.
Example
This requestsTransferContract txs where owner is 41da9964294c8689bfee2778606e485221625496bf, plus their logs, on block 64000675.
addTransferAssetTransaction(options) {#add-transfer-asset-transaction}
Get some or all TransferAssetContract transactions on the network. options has the following structure:
where field:
asset: the set of token names / ids.owner: the set of addresses of owners of the token being transferred.to: the set of addresses of tokens’ receivers.
where field to subscribe to all TransferAssetContract txs network-wide.
Related data can be requested via the include field:
logs = true: will retrieve event logs emitted by the selected transactions.internalTransactions = true: will retrieve internal txs that occurred due to the selected transactions.
.logs and .internalTransactions fields of each transaction item.
Note that transactions can also be requested by the other TronBatchProcessor methods as related data.
Selection of the exact fields to be retrieved for each transaction and the optional related data items is done with the setFields() method documented on the Field selection page.
Example
This requestsTransferAssetContract txs where owner is 4170d66a855afef04753f06c4d6210d6b77708cdb0, plus their internal txs, on block 64000000.
addTriggerSmartContractTransaction(options) {#add-trigger-smart-contract-transaction}
Get some or all TriggerSmartContract transactions on the network. options has the following structure:
where field:
contract: the set of addresses of contracts being called.sighash: the set of 4-byte signature hashes to filter the calls by.owner: the set of addresses of call owners.
where field to subscribe to all TriggerSmartContract txs network-wide.
Related data can be requested via the include field:
logs = true: will retrieve event logs emitted by the selected transactions.internalTransactions = true: will retrieve internal txs that occurred due to the selected transactions.
.logs and .internalTransactions fields of each transaction item.
Note that transactions can also be requested by the other TronBatchProcessor methods as related data.
Selection of the exact fields to be retrieved for each transaction and the optional related data items is done with the setFields() method documented on the Field selection page.
Example
This requestsTriggerSmartContract txs made directly to the USDT contract (41a614f803b6fd780986a42c78ec9c7f77e6ded13c).
addTransaction(options) {#add-transaction}
Get some or all transactions on the network. options has the following structure:
where field:
typesets the allowed transaction types. Leave it undefined to subscribe to transactions of all types.
where field to subscribe to all txs network-wide.
Related data can be requested via the include field:
logs = true: will retrieve event logs emitted by the selected transactions.internalTransactions = true: will retrieve internal txs that occurred due to the selected transactions.
.logs and .internalTransactions fields of each transaction item.
Note that transactions can also be requested by the other TronBatchProcessor methods as related data.
Selection of the exact fields to be retrieved for each transaction and the optional related data items is done with the setFields() method documented on the Field selection page.
Example
This requests allFreezeBalanceV2Contract txs network-wide, along with all the logs they emitted:

