Tron Blocks API
The blocks
field allows us to fetch details about the blocks from Tron network.
Here is an example that demonstrates how to retrieve blocks data:
{
tron {
blocks(
date: {after: "2023-07-23"}
options: {desc: "timestamp.iso8601", limit: 10}
) {
hash
height
parentBlockHash
timestamp {
iso8601
}
txTrieRoot
version
witness {
address
annotation
}
witnessSignature
}
}
}
Filtering Blocks
any
:count
: returns aggregate count of the blockscountBigInt
: returns count asBigInt
date
: returns date of the blockexpression
: performs arithematic operation on fields in the query and returns value of the operationhash
: returns block hashheight
: returns block heightmaximum
: returns maximum of selected measurable field of Tron Blocksminimum
: returns minimum of selected measurable field of Tron BlocksparentBlockHash
: returns parent block hash for the blocktimestamp
: returns timestamp of the blocktxTrieRoot
: returns transaction trie root hashversion
: returns block versionwitness
: returns block witnesswitnessSignature
: returns block witness signature