Skip to main content

GetBlockByLatestNum

POST

Retrieves a list of the most recent blocks. Starting from the latest solidified block, the method returns the specified number (num) of blocks in descending order of height.
Path Parameters
chainstringrequired
Parameter specifying the target chain to query.
networkstringrequired
Parameter specifying the network of the target chain.
Request Body
numintegerrequired
Number of most recent blocks to retrieve. Example: 5
visibleboolean
Optional. Set to true to format addresses in Base58; set to false for hex format. (Default: false)
Responses
codestringrequired
Code identifying the cause of the failed request.
messagestringrequired
Detailed message including the name and value of the invalid parameter.
{
"code": "ERROR_CODE",
"message": "400"
}
cURL
curl -X POST 'https://tron-mainnet.nodit.io/walletsolidity/getblockbylatestnum' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: nodit-demo' \
-d '{
"num": 5
}'