eth_getBlockByHash
Retrieves comprehensive information about a block on Base L2 by its hash identifier, including header data, transaction lists, and execution metrics.
Parameters​
Parameter | Type | Required | Description |
---|---|---|---|
blockHash | string | Yes | The 32-byte block hash (66 characters with 0x prefix) |
fullTransactionObjects | boolean | Yes | When true , returns complete transaction objects. When false , returns only transaction hashes |
Returns​
Returns a block object with the following fields:
Field | Type | Description |
---|---|---|
number | string | Block number in hexadecimal |
hash | string | 32-byte block hash |
parentHash | string | Hash of the parent block |
nonce | string | Proof-of-work nonce (always 0x0000000000000000 on Base L2) |
sha3Uncles | string | SHA3 hash of uncles data |
logsBloom | string | 256-byte bloom filter for block logs |
transactionsRoot | string | Root hash of the transaction trie |
stateRoot | string | Root hash of the final state trie |
receiptsRoot | string | Root hash of the receipts trie |
miner | string | Address receiving block rewards |
difficulty | string | Block difficulty (always 0x0 on Base L2) |
totalDifficulty | string | Total chain difficulty up to this block |
extraData | string | Additional block-specific data |
size | string | Block size in bytes (hexadecimal) |
gasLimit | string | Maximum gas allowed in block |
gasUsed | string | Total gas consumed by all transactions |
timestamp | string | Unix timestamp of block creation |
transactions | array | Array of transaction hashes or full transaction objects |
uncles | array | Array of uncle block hashes (always empty on Base L2) |
baseFeePerGas | string | Base fee per gas unit (EIP-1559) |
withdrawals | array | Validator withdrawals (if applicable) |
withdrawalsRoot | string | Root hash of withdrawals trie |
Implementation Example​
- cURL
- JavaScript
- Python
curl -X POST https://api-base-mainnet.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getBlockByHash",
"params": [
"0x4e3a3754410177e6937ef1f84bba68ea139e8d1a2258c5f85db9f1cd715a1bdd",
false
],
"id": 1
}'
const response = await fetch('https://api-base-mainnet.n.dwellir.com/YOUR_API_KEY', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
method: 'eth_getBlockByHash',
params: [
'0x4e3a3754410177e6937ef1f84bba68ea139e8d1a2258c5f85db9f1cd715a1bdd',
false // Set to true for full transaction objects
],
id: 1
})
});
const data = await response.json();
console.log(data.result);
import requests
import json
url = 'https://api-base-mainnet.n.dwellir.com/YOUR_API_KEY'
headers = {'Content-Type': 'application/json'}
payload = {
"jsonrpc": "2.0",
"method": "eth_getBlockByHash",
"params": [
"0x4e3a3754410177e6937ef1f84bba68ea139e8d1a2258c5f85db9f1cd715a1bdd",
False # Set to True for full transaction objects
],
"id": 1
}
response = requests.post(url, headers=headers, data=json.dumps(payload))
print(response.json()['result'])
Response Example​
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"baseFeePerGas": "0x2da282a8",
"difficulty": "0x0",
"extraData": "0x",
"gasLimit": "0x1c9c380",
"gasUsed": "0x3b9aca",
"hash": "0x4e3a3754410177e6937ef1f84bba68ea139e8d1a2258c5f85db9f1cd715a1bdd",
"logsBloom": "0x00000000000000000000000000000000...",
"miner": "0x4200000000000000000000000000000000000011",
"nonce": "0x0000000000000000",
"number": "0x5bad55",
"parentHash": "0xb4fbadf8ea452b139718e2700dc1135cfc81145031c84b7ab27cd99f43ec28ca",
"receiptsRoot": "0x9b0816dba2e4c1c7b2d38d0c3da6e6bb93c1713a7e986e38f856b6fb725234cf",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x21d",
"stateRoot": "0xddc8b0234248b014296fed29c5c0e9d6e5a6e4a0576ce66970a36c064e3cd96b",
"timestamp": "0x5e0be0ff",
"totalDifficulty": "0x0",
"transactions": [
"0x5d2dd8b32dc30f347120c5877975c93ccf3e5a5c9ad0c595b0a73c3e00c9e9bb",
"0x8a91b1b37e0e463c27cb340dc0e2cbc5636cba8d9b3e9a66c2a9e6c3f8c65e82"
],
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"uncles": []
}
}
Need help? Contact our support team or check the Base documentation.