getblock - Tron
getblock. Returns block details by block number, block hash, or the latest block if no parameter is given.
getblock - tron [Value: 20CU]
Returns block details by block number, block hash, or the latest block if no parameter is given.
Use cases
- Also available as GET
- Fetch the latest block without knowing its number in advance
Constraints
- Omitting id_or_num returns the latest block, equivalent to getnowblock
- Also available under /walletsolidity/ for confirmed (solidified) data instead of the latest state
Unlock Access to 100+ chains
Boost your app's speed and reliability with dRPC - get your access API key
Language
Request
Examples
curl --request POST \
--url https://lb.drpc.live/tron/{API-KEY}/wallet/getblock \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"id_or_num": "example", "detail": true, "visible": true}'Response
200
{
"blockID": "00000000000000c86d2473411771f83db5e314c01bc8f8cf0dc2f8892be6fd7f",
"block_header": {
"raw_data": {
"number": 200,
"txTrieRoot": "0000000000000000000000000000000000000000000000000000000000000000",
"witness_address": "41f16412b9a17ee9408646e2a21e16478f72ed1e95",
"parentHash": "00000000000000c7d4d47132f21fd0b74e2f8bcb0c2e9130f7cab35b5d38af9f",
"timestamp": 1575594618000
},
"witness_signature": "97ecda5b130600d18304e02f7fd5ab9d115c5ec9c0e312c8c6fe83939771bb85505fafee598541dc902b1a7b8ca2735c83a12e640203ed4b8529d47ce4f413df00"
}
"transactions": [
...
],
}Request params
idinteger
jsonrpcstring
methodstring
object
id_or_numstring
Block hash or block number to look up. Omit to get the latest block
detailboolean
When true, includes full transaction details instead of just hashes
visibleboolean
When true, addresses are base58check strings; when false (default), hex strings
Response
200
Returns block details by block number, block hash, or the latest block if no parameter is given.Response params
object
blockIDstring
The unique hash identifying this block, encoding both its height and content.
block_headerobject
The block's header, containing metadata about its position in the chain and the producing witness.
object
raw_dataobject
The core header fields that were hashed and signed by the producing witness.
object
timestampinteger
Unix timestamp, in ms, at which this block was produced.
txTrieRootstring
The Merkle root hash of all transactions included in this block, used to verify their integrity.
parentHashstring
The blockID of the preceding block, linking this block into the chain.
numberinteger
The height (sequential number) of this block in the chain.
witness_addressstring
The address of the Super Representative who produced this block.
versioninteger
The block format version used by the node that produced this block.
witness_signaturestring
The hex-encoded signature from the producing witness, proving they authored this block.
transactionsarray_of_objects
The list of transactions included in this block, each with its execution outcome.
object
raw_dataobject
The unsigned transaction body containing the contract instruction and blockchain reference data.
object
ref_block_bytesstring
The last two bytes of the reference block number, used for transaction expiration and replay protection.
ref_block_hashstring
The last eight bytes of the reference block's hash, paired with ref_block_bytes for replay protection.
expirationinteger
Unix timestamp, in ms, after which this transaction would no longer be valid.
contractarray_of_objects
The list of contract instructions executed by this transaction.
object
parameterobject
The typed payload describing the specific contract call being made.
object
valueobject
The decoded fields of the contract — here, a smart contract call (e.g. a TRC20 token transfer).
object
owner_addressstring
The address that initiated the smart contract call, in hex format.
contract_addressstring
The address of the smart contract being invoked, in hex format.
datastring
The hex-encoded ABI-encoded call data, including the function selector and its arguments.
type_urlstring
The fully qualified protobuf type identifier describing which contract schema `value` should be decoded with.
typestring
The human-readable name of the contract type being executed (here, TriggerSmartContract).
timestampinteger
Unix timestamp, in ms, marking when the transaction was created/signed by the client.
fee_limitinteger
The maximum amount of TRX, in sun, the sender is willing to spend on Energy fees for this contract call.
signaturearray_of_strings
The list of hex-encoded signatures authorizing this transaction.
retarray_of_objects
The execution outcome of this transaction as recorded on-chain.
object
contractRetstring
The result status of the contract execution (e.g. SUCCESS, REVERT, OUT_OF_ENERGY).
raw_data_hexstring
The hex-encoded serialized bytes of this transaction's raw_data.
txIDstring
The unique transaction hash (transaction ID) for this transaction, computed as the SHA256 of raw_data.