eth_getBlockByHash
Returns information about a block by hash.
Parameters
- Block Hash - Hash of a block
- Boolean - If
true
returns full transaction objects, iffalse
only hashes
{
"jsonrpc": "2.0",
"method": "eth_getBlockByHash",
"params": ["0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", false],
"id": 1
}
Returns
Block object or null
if no block found.
Implementation Examples
- cURL
- JavaScript
curl -X POST https://api-tron-jsonrpc.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getBlockByHash",
"params": ["0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", false],
"id": 1
}'
// Using ethers.js
const block = await provider.getBlock('0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae');
console.log('Block:', block);