Docs

wallet/getblockbylatestnum - Get Recent TRON Bl...

Get multiple recent TRON blocks by specifying a range from the latest block via Dwellir's high-performance RPC endpoint.

Get a range of recent blocks counting backwards from the latest block.

Endpoint

Text
POST /wallet/getblockbylatestnum

Request Parameters

Request
numnumber

Required parameter: Number of recent blocks to retrieve (max: 99)

Response Body

Response
resultOBJECT

`blockID` - Block hash identifier `block_header` - Block header information `raw_data` - Raw block data `number` - Block height `txTrieRoot` - Transaction trie root `witness_address` - Block producer address `parentHash` - Parent block hash `timestamp` - Block timestamp (milliseconds) `version` - Block version `witness_signature` - Witness signature `transactions` - Array of transactions in each block

Implementation Examples

Bash
# Get last 5 blocks
curl -X POST https://api-tron-mainnet.n.dwellir.com/YOUR_API_KEY/wallet/getblockbylatestnum \
  -H "Content-Type: application/json" \
  -d '{
    "num": 5
  }'

# Get last 20 blocks
curl -X POST https://api-tron-mainnet.n.dwellir.com/YOUR_API_KEY/wallet/getblockbylatestnum \
  -H "Content-Type: application/json" \
  -d '{
    "num": 20
  }'

# Get maximum allowed (99 blocks)
curl -X POST https://api-tron-mainnet.n.dwellir.com/YOUR_API_KEY/wallet/getblockbylatestnum \
  -H "Content-Type: application/json" \
  -d '{
    "num": 99
  }'

Use Cases

  • Real-time Monitoring: Track latest blockchain activity
  • Transaction Confirmation: Check recent blocks for transaction inclusion
  • Network Health: Monitor block production rate and consistency
  • Statistical Analysis: Analyze recent blockchain metrics
  • Block Explorer: Display recent blocks on explorer homepage