Skip to main content

Get Transactions In Block

POST

Retrieves the list of transactions within a specific block.

🚧 Caution when using decodeInput

The decodeInput field decodes the transaction's input field and provides the result. However, different functions can use the same function selector, so the provided result may not match the actually called function. Therefore, additional verification is recommended for functions that differ from ERC standard specifications.

Path Parameters
chainstringrequired
Parameter specifying the target chain to query.
networkstringrequired
Parameter specifying the network of the target chain.
Request Body
blockstringrequired
Parameter specifying the point in time for balance query. You can enter block hash, block number, or block tag.
  • block number: Enter as a decimal string.
  • block hash: Enter as a 64-character hexadecimal string, excluding the 0x prefix.
  • block tag: Enter "earliest" or "latest"; "latest" queries the balance of the most recent block.
pageinteger
The page parameter specifies the data page to query. It accepts values up to 100; for pages exceeding 100, use the cursor pagination method.The page and cursor parameters cannot be used together. If both page and cursor are empty, cursor pagination is used.
rppinteger
rpp stands for results per page and specifies the page size. You can specify a number greater than 0 and up to 100.
cursorstring
The cursor parameter supports pagination and data navigation between pages. Provide the cursor value from the previous page in the next request to load the next page of data.The page and cursor parameters cannot be used together. If both page and cursor are empty, cursor pagination is used.
withCountboolean
Parameter specifying whether to include the count field in the response. The count field indicates the total number of requested data items. When set to true, the count field is included and response speed may be slower.
withLogsboolean
Parameter specifying whether to include the logs field in the response. Response speed may be slower when set to true.
withDecodeboolean
Parameter specifying whether to include decodedInput and decodedLog fields in the response. Response speed may be slower when set to true.decodedLog is part of logs, so it is not included when withLogs is false even if withDecode is true.decodedInput interprets the transaction input field and provides the result. However, different functions may use the same function selector, so the result may not match the actually called function. Additional verification is recommended for non-standard ERC functions.
Responses
pageinteger
Field representing the page number specified in the page parameter. This field is only included in the response when a value greater than 0 is specified for the page parameter.
rppinteger
Field representing the number of results per page specified in the rpp parameter.
cursorstring
A field for cursor pagination. This value must be provided in the next request to load the next page of data.
countinteger
Field representing the total count of requested data. This field is only included in the response when true is set for the withCount parameter.
transactionHashstringrequired
Unique hash value that identifies the transaction. This field has a 64-character hexadecimal string format excluding the prefix (0x).
transactionIndexintegerrequired
Order in which the transaction was included within a specific block; indicates the execution order of the transaction.
transactionTimestampintegerrequired
Indicates when the transaction was created in milliseconds. The time when the transaction was created may differ from when it was included in a block; the actual state change is applied at the block timestamp when the transaction is included in the block.
blockNumberintegerrequired
Unique number of the block. This number indicates the order in which the block was created on the blockchain.
blockTimestampintegerrequired
Timestamp of when the block was created, provided in milliseconds. Stored in Unix timestamp format.
refBlockBytesstringrequired
Indicates the block referenced by the transaction. This field uses the 6th to 7th bytes of the reference block number, totaling 2 bytes. The reference block is the most recently finalized block; this value is embedded in the transaction to prevent transaction replay.
refBlockHashstringrequired
Indicates the block referenced by the transaction. This field uses the 8th to 15th bytes of the reference block hash, totaling 8 bytes. The reference block is the most recently finalized block; this value is embedded in the transaction to prevent transaction replay.
typestringrequired
Indicates the type of transaction. This field specifies the specific action performed by the transaction so the network can process it accordingly. Values include TransferContract, TriggerSmartContract, etc., defining operations such as TRX transfer and smart contract execution.
typeUrlstringrequired
Field that specifies the specific path of the transaction type. This field is used to identify transaction types defined in chain buffer format.
isMultiSigbooleanrequired
Field indicating whether the transaction is a multi-signature transaction. Multi-sig requires signatures from multiple accounts and is used to enhance security.
fromstringrequired
Represents the sender address that created the transaction. That is, the account address from which the transaction originates. This field has a 34-character base58 string format starting with "T".
tostringrequired
Represents the recipient address that will receive the transaction. Depending on the transaction type, this may mean the address receiving the transferred TRX or the smart contract being invoked. This field has a 34-character base58 string format starting with "T".
valuestringrequired
Represents the amount of assets transferred in the transaction. These assets include TRX or TRC10 tokens. <strong style='color: red;'>*</strong> The type of asset transferred depends on the "assetId" field value. When "assetId" is 0, it represents the TRX amount; when non-zero, it represents the amount of a specific TRC10 token. The amount is expressed in the smallest unit (e.g., sun for TRX) as a decimal string.
assetIdintegerrequired
Identifier for the token being transferred (TRX, TRC10). <strong style='color: red;'>*</strong> When the "assetId" field is 0, it means TRX; when non-zero, it means a specific TRC10 token.
inputstringrequired
Represents the data or input value passed when invoking a smart contract. Primarily used as parameter values for smart contract functions, specifying the actions the contract should perform.
functionSelectorstringrequired
Represents the unique identifier of the function executed in the transaction. For example, the signature of the transfer(address,uint256) function generates a specific hash through Keccak-256 hashing, and the first 4 bytes of this hash are used as the function selector.
resultstringrequired
Indicates the final status of the transaction execution. Provides the overall result of whether the entire transaction was processed successfully, allowing users to easily verify if the transaction completed successfully. Status values are SUCCESS and FAILED.<strong style='color: red;'>*</strong> Even if smart contract execution fails, the transaction itself is considered successful if it was recorded on the blockchain.
contractRetstringrequired
Indicates the smart contract execution result, providing more detailed information about the transaction success or failure.
  • Examples: SUCCESS, REVERT, BAD_JUMP_DESTINATION, OUT_OF_MEMORY, PRECOMPILED_CONTRACT, ...
resMessagestringrequired
When transaction execution fails, represents the failure reason or error message. Returns an empty string for successful transactions.
feestringrequired
Total TRX cost consumed during transaction execution. When the bandwidth and energy of the account that created the transaction are insufficient, the shortfall is covered in TRX. This field represents that shortfall and is the sum of netFee and energyFee. For example, if bandwidth and energy are sufficient, fee is 0. Otherwise, it indicates the amount of TRX consumed to cover the shortfall. The unit of this field is "sun", and 1 TRX = 1,000,000 sun.
feeLimitstringrequired
Maximum fee limit set by the user when creating the transaction; specifies the upper limit of fees that can be consumed when the transaction is executed. If the actual fee used exceeds feeLimit, the transaction fails. This allows users to prevent unexpected high fees in advance. The unit of this field is "sun", and 1 TRX = 1,000,000 sun.
netFeestringrequired
Cost paid in TRX when the bandwidth of the transaction creator's account is insufficient. If available bandwidth is sufficient, no netFee is incurred. The unit of this field is "sun", and 1 TRX = 1,000,000 sun.
netUsagestringrequired
Amount of bandwidth actually used in the transaction. When the transaction creator's remaining bandwidth is insufficient, the shortfall is paid in TRX, and the amount paid is recorded in netFee.
energyFeestringrequired
Represents the cost paid in TRX when the energy of the transaction creator's account is insufficient. Only incurred when the energy required for smart contract execution exceeds the creator's available balance. The unit of this field is "sun", and 1 TRX = 1,000,000 sun.
energyUsagestringrequired
Amount of energy used from the transaction creator's account.
originEnergyUsagestringrequired
Represents the amount of energy used from the account that deployed the smart contract. In certain situations, the contract deployer may bear some of the energy cost.
energyUsageTotalstringrequired
Total amount of energy consumed in the transaction. Sum of energy consumed by the transaction creator (energyUsage) and energy consumed by the deployed smart contract (originEnergyUsage), representing the total energy usage for transaction execution.
energyPenaltyTotalstringrequired
Additional energy amount that must be paid when calling certain popular smart contracts. Because TRON network resources (bandwidth and energy) are limited, penalties are applied to prevent excessive resource usage by specific popular smart contracts.
permissionIdinteger
Field that specifies the permission to use for the transaction.
  • 0: Indicates Owner permission.
  • 1: Indicates Witness permission. Related to block production; cannot be used for transaction signing.
  • 2 or higher: Indicates Active permission groups. Specifies the user group that can execute transactions.
assetIssueIdinteger
Value that identifies the TRC10 issued by the transaction. Returns the TRC10 asset ID when the transaction type is AssetIssueContract; returns null for other transaction types.
withdrawAmountstring
Represents the amount of rewards withdrawn, in sun. For reward withdrawal and unfreeze transactions, voting rewards are withdrawn to the account. The unit of this field is "sun", and 1 TRX = 1,000,000 sun.
withdrawExpireAmountstring
In the Stake2.0 phase, represents the amount of TRX withdrawn to the account for the following transactions. The unit of this field is "sun", and 1 TRX = 1,000,000 sun.1. Unstaking transaction2. Transaction that withdraws unfrozen balance to the account3. Transaction that cancels all unstaking requests
unfreezeAmountstring
In the Stake1.0 phase, for unstaking transactions, this field returns the amount of unstaked TRX. The unit of this field is "sun", and 1 TRX = 1,000,000 sun.
Amount of TRX used to re-stake the cancelled unstaking principal to obtain various resources such as BANDWIDTH, ENERGY, or TRON POWER.
energystring
Amount of TRX used to re-stake the cancelled unstaking principal to obtain energy. The value is expressed in SUN units.
tronPowerstring
Amount of TRX used to re-stake the cancelled unstaking principal to obtain TRON Power (voting and governance participation rights on the TRON network). The value is expressed in SUN units.
bandwidthstring
Amount of TRX used to re-stake the cancelled unstaking principal to obtain bandwidth. The value is expressed in SUN units.
exchangeIdinteger
Unique ID that identifies a swap transaction on the decentralized exchange (DEX) provided by the TRON network. This ID distinguishes specific swap transactions and tracks which asset pair was traded.
exchangeReceivedAmountstring
Represents the final amount of assets received through a swap transaction on the decentralized exchange (DEX) provided by the TRON network.
exchangeInjectAnotherAmountstring
Amount of the other asset additionally injected during a swap transaction on the decentralized exchange (DEX) provided by the TRON network.
exchangeWithdrawAnotherAmountstring
Represents the amount withdrawn in another asset after a swap transaction on the decentralized exchange (DEX) provided by the TRON network.
Value decoded from the input data based on ABI when calling a smart contract. For regular transfers such as native token (TRX) transfers that are not smart contract calls, no input data exists, so this field is not provided.<strong style='color: red;'>*</strong> This field is only provided when withDecode is true.
typestring
Represents the type of the decoded data. For example, returns "function" for smart contract function calls.
namestring
Represents the name of the smart contract function that was called. The function name is determined by the ABI definition.
signaturestring
Signature of the smart contract function, explicitly expressing the function name and parameter data types. Used to identify the uniqueness of the function.
List of arguments passed to the called function, including the name, type, and actual value of each argument. May have multiple arguments depending on the ABI.
namestring
Name of the specific argument used in the function call, representing the argument name defined in the ABI.
typestring
Represents the data type of the argument. Common data types include "address", "integer", "string", "bool", etc.
valuestring
Represents the actual value passed to the argument. The format varies by data type; for example, an "address" type displays a wallet address.
contractAddressstringrequired
Represents the address of the smart contract where the event occurred. This serves as the identifier for the contract that emitted the event. This field has a 34-character base58 string format starting with "T".
transactionHashstringrequired
Unique hash of the transaction in which this log occurred. This field has a 64-character hexadecimal string format excluding the prefix (0x).
transactionIndexintegerrequired
Indicates the index of the transaction (within the block) in which the log occurred. Identifies the position among multiple transactions in the same block.
blockNumberintegerrequired
Indicates the block number that contains the log. Used to identify the block where the log is stored.
datastringrequired
Field containing additional information related to the event. Returns non-indexed data from the event log; indexed values are returned in the topics field.
logIndexintegerrequired
Indicates the index of the log within the block. Identifies the position of a specific log among multiple logs in the block.
topicsarrayrequired
Array of topics describing the log event. Each topic describes key attributes of the event, and indexed fields are returned here. Non-indexed fields are returned in data.
Provides decoded information according to the smart contract's event definition, with the following sub-fields.<strong style='color: red;'>*</strong> This field is only provided when withDecode is true.
namestring
Represents the name of the event.
eventFragmentstring
The event fragment or simplified form of the signature.
signaturestring
Full signature of the event, representing the structure of the event. This field includes the event name and argument types.
eventHashstring
Unique hash value of the event, used as a key to identify the event. This value is generated by hashing the event signature with the Keccak-256 hash function.
List of arguments passed to the event. For example, a Transfer event includes sender (from), recipient (to), value, etc.
namestring
Represents the name of the event argument.
typestring
Represents the data type of the event argument.
valuestring
Represents the value of the event argument.
codestringrequired
Code identifying the cause of the failed request.
messagestringrequired
Detailed message including the name and value of the invalid parameter.
{
"code": "MISSING_REQUIRED_PARAMETER",
"message": "Missing required parameter: { PARAMETER_NAME }"
}
cURL
curl -X POST 'https://web3.nodit.io/v1/tron/mainnet/blockchain/getTransactionsInBlock' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: nodit-demo' \
-d '{
"block": "latest",
"withLogs": false,
"withDecode": false
}'