eth_getTransactionByHash

Returns the information about a transaction requested by transaction hash.

Parameters

  1. DATA, 32 Bytes - Transaction hash. It must contain exactly 64 hexadecimal characters, with or without a 0x prefix.

Return fields

When the transaction is found, result is a transaction object; otherwise it is null. The table below describes selected fields as returned on TRON. Quantities are encoded as 0x-prefixed hexadecimal values.

FieldMeaning
gasEnergy actually consumed by the transaction, not a caller-specified limit. Returns 0x0 when the transaction receipt is unavailable
gasPriceEnergy price at the time of the transaction's block, in sun per Energy; returns 0x when the block is unavailable
valueMapped from the native transaction type: the TRX amount in sun for TRX transfers and contract calls, the raw Token amount for TRC-10 transfers, or the total vote count for voting, for example. It does not consistently represent a TRX transfer amount
inputCall data for TriggerSmartContract; other transaction types, including contract deployment, return 0x
typeAlways 0x0; it does not identify the native TRON transaction type
nonceAlways 0x0; TRON does not use Ethereum's account nonce mechanism

To read the native transaction type and parameters, use GetTransactionById and inspect raw_data.contract[].type and the corresponding parameter.

Example

Request

curl -X POST 'https://api.shasta.trongrid.io/jsonrpc' --data '{
	"jsonrpc": "2.0",
	"method": "eth_getTransactionByHash",
	"params": ["c9af231ad59bcd7e8dcf827afd45020a02112704dce74ec5f72cb090aa07eef0"],
	"id": 64
}'

Response

{
	"jsonrpc": "2.0",
	"id": 64,
	"result": {
		"blockHash": "0x00000000020ef11c87517739090601aa0a7be1de6faebf35ddb14e7ab7d1cc5b",
		"blockNumber": "0x20ef11c",
		"from": "0x6eced5214d62c3bc9eaa742e2f86d5c516785e14",
		"gas": "0x0",
		"gasPrice": "0x8c",
		"hash": "0xc9af231ad59bcd7e8dcf827afd45020a02112704dce74ec5f72cb090aa07eef0",
		"input": "0x",
		"nonce": "0x0",
		"r": "0x433eaf0a7df3a08c8828a2180987146d39d44de4ac327c4447d0eeda42230ea8",
		"s": "0x6f91f63b37f4d1cd9342f570205beefaa5b5ba18d616fec643107f8c1ae1339d",
		"to": "0x0697250b9d73b460a9d2bbfd8c4cacebb05dd1f1",
		"transactionIndex": "0x6",
		"type": "0x0",
		"v": "0x1b",
		"value": "0x1cb2310"
	}
}