GetTransactionInfoById
Query the transaction fee, block height by transaction id.
This method will use 30
Compute Units.
Parameters
value
- String - Transaction hash, i.e. transaction id.
Returns
This interface returns a TransactionInfo object, which contains the following fields:
id
string
Transaction ID
fee
int64
The total number of TRX burned in this transaction (in sun), including TRX burned for bandwidth/energy, memo fee, account activation fee, multi-signature fee and other fees, unit is SUN.
blockNumber
int64
The block number
blockTimeStamp
int64
The block timestamp, the unit is millisecond
contractResult
string[]
Transaction Execution Results
contract_address
string
Contract address
receipt
ResourceReceipt
Transaction receipt, including transaction execution result and transaction fee details, which contains the following fields:
1. energy_usage
: the amount of energy consumed in the caller's account
2. energy_fee
: the amount of TRX burned to pay for energy
3. origin_energy_usage
: the amount of energy consumed in the contract deployer's account
4. energy_usage_total
: The total amount of energy consumed by the transaction
5. net_usage
: The amount of bandwidth consumed
6. net_fee
: The amount of TRX burned to pay for the bandwidth
7. result
: transaction execution result
8. energy_penalty_total
: The amount of extra energy that needs to be paid for calling a few popular contracts
log
Log[]
The log of events triggered during the smart contract call, each log includes the following information:
1. address
: Contract address. In order to be compatible with EVM, the address in TVM is a hex format address without the prefix 0x41, so if you want to parse the address in the log, you need to add 41 to the beginning of the log address , and then convert it to Base58 format.
2. topics
: The topic of the event, including the event itself and parameters marked as indexed.
3. data
: Non-indexed parameters of events.
result
int
Execution results. If the execution is successful, the field will not be displayed in the returned value, if the execution fails, the field will be "FAILED"
resMessage
string
When the transaction execution fails, the details of the failure will be returned through this field. Hex format, you can convert it to a string to get plaintext information.
withdraw_amount
int64
For the withdrawal reward transaction, it will withdraw the voting reward to account. The number of rewards withdrawn to the account is returned through this field, and the unit is sun
unfreeze_amount
int64
In the Stake1.0 stage, for unstaking transactions, this field returns the amount of unstaked TRX, the unit is sun
withdraw_expire_amount
int64
In the Stake2.0 stage, for unstaking transaction and withdrawing unfrozen balance transaction, and cancelling all unstakes transaction, this field returns the amount of unfrozen TRX withdrawn to the account in this transaction, the unit is sun
cancel_unfreezeV2_amount
map<string, int64>
The amount of TRX re-staked to obtain various types of resources, in sun, that is, the amount of unstaked principal that has been canceled, the key is: "BANDWIDTH" or "ENERGY" or "TRON_POWER"
// Result
{
"id": "7c2d4206c03a883dd9066d620335dc1be272a8dc733cfa3f6d10308faa37facc",
"fee": 1100000,
"blockNumber": 32880248,
"blockTimeStamp": 1681368027000,
"contractResult": [
""
],
"receipt": {
"net_fee": 100000
}
}
curl https://mainnet.tron.validationcloud.io/v1/<YOUR_API_KEY_HERE>/wallet/gettransactionbyid \
-X POST \
-H "Content-Type: application/json" \
-d '
{
"value": "7c2d4206c03a883dd9066d620335dc1be272a8dc733cfa3f6d10308faa37facc"
}
'
Last updated
Was this helpful?