API Reference

eth_getBlockByHash - Linea

Returns information about a block by block hash.

Parameters

  • DATA, 32 Bytes - Hash of a block.
  • Boolean - If true it returns the full transaction objects, if false only the hashes of the transactions.
params: [
	"0x2d527c4323e099781fc0c816557ed4f083ab58e5df66aa1e064e8d03d8724285",
	true,
];

Returns

Object - A block object with the following fields, or null when no block was found:

  • number: QUANTITY - the block number. null when its pending block.
  • hash: DATA, 32 Bytes - hash of the block. null when its pending block.
  • parentHash: DATA, 32 Bytes - hash of the parent block.
  • nonce: DATA, 8 Bytes - hash of the generated proof-of-work. null when its pending block.
  • sha3Uncles: DATA, 32 Bytes - SHA3 of the uncles data in the block.
  • logsBloom: DATA, 256 Bytes - the bloom filter for the logs of the block. null when its pending block.
  • transactionsRoot: DATA, 32 Bytes - the root of the transaction trie of the block.
  • stateRoot: DATA, 32 Bytes - the root of the final state trie of the block.
  • receiptsRoot: DATA, 32 Bytes - the root of the receipts trie of the block.
  • miner: DATA, 20 Bytes - the address of the beneficiary to whom the mining rewards were given.
  • difficulty: QUANTITY - integer of the difficulty for this block.
  • totalDifficulty: QUANTITY - integer of the total difficulty of the chain until this block.
  • extraData: DATA - the "extra data" field of this block.
  • size: QUANTITY - integer the size of this block in bytes.
  • gasLimit: QUANTITY - the maximum gas allowed in this block.
  • gasUsed: QUANTITY - the total used gas by all transactions in this block.
  • timestamp: QUANTITY - the unix timestamp for when the block was collated.
  • transactions: Array - Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter.
  • uncles: Array - Array of uncle hashes.

Example

Request

curl --location 'https://linea-mainnet.unifra.io/v1/{your-api-key}' \
--header 'Content-Type: application/json' \
--data '{
    "jsonrpc": "2.0",
    "method": "eth_getBlockByHash",
    "params": [
        "0x2d527c4323e099781fc0c816557ed4f083ab58e5df66aa1e064e8d03d8724285",
        true
    ],
    "id": "5b54dd59-c6b9-4fa4-9105-4165778b5fde"
}'
URL: https://eth-mainnet.unifra.io/v1/your-api-key
RequestType: POST
Body:
{
    "jsonrpc":"2.0",
    "method":"eth_getBlockByHash",
    "params":["0xc0f4906fea23cf6f3cce98cb44e8e1449e455b28d684dfa9ff65426495584de6", true],
    "id":0
}

Result

{
    "jsonrpc": "2.0",
    "id": "a07e3942-8bce-4161-aac4-d4ea387f2e6b",
    "result": {
        "baseFeePerGas": "0x7",
        "difficulty": "0x2",
        "extraData": "0xd883010b06846765746888676f312e32302e36856c696e75780000000000000051cd9ad7bda9cf1be8ffabdaa69c9817c77cafadea94e4048ee33df26072454363354af2a6a8cbeaf14d884b5ecbff9bde569c9e51bd34da6345fc33bf7a6e0500",
        "gasLimit": "0x3a2c940",
        "gasUsed": "0x2f65c",
        "hash": "0x2d527c4323e099781fc0c816557ed4f083ab58e5df66aa1e064e8d03d8724285",
        "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000010000000000000000000000000000000080000000000000000000000080000000000000000000000000000000000000002000000000000000000000000000000000000000040000000000000",
        "miner": "0x0000000000000000000000000000000000000000",
        "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "nonce": "0x0000000000000000",
        "number": "0x1122",
        "parentHash": "0x97037346159b2cc5fdc59d441e722d296b58c14881748e0fadaa7f761b287657",
        "receiptsRoot": "0x15554bca6a389e9ee6795a7b7a8f8ed5f93080076535ff86e3074b93d9795185",
        "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
        "size": "0x515",
        "stateRoot": "0x9477e97ad925e82da51dc4838d37d35a1f6001d1f8de5e393ebf3cb9bc320efc",
        "timestamp": "0x64b6f41c",
        "totalDifficulty": "0x2245",
        "transactions": [
            {
                "blockHash": "0x2d527c4323e099781fc0c816557ed4f083ab58e5df66aa1e064e8d03d8724285",
                "blockNumber": "0x1122",
                "from": "0x46ea7a855da88fbc09cc59de93468e6bfbf0d81b",
                "gas": "0x19952",
                "gasPrice": "0xe4c31795",
                "maxFeePerGas": "0xe4c3179c",
                "maxPriorityFeePerGas": "0xe4c3178e",
                "hash": "0xec9abed525ab321fdf3c593c187c924a55f230215003ee9f8b27090a5d33ca2f",
                "input": "0x491e0936000000000000000000000000c00e5733a91b3aff85e844d0703ae2abd5c65a4f000000000000000000000000c00e5733a91b3aff85e844d0703ae2abd5c65a4f0000000000000000000000000000000000000000000000000001e9a15768c0c000000000000000000000000000000000000000000000000000038d7ea4c68000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000c500000000000000000000000000000000000000000000000000000000000000000",
                "nonce": "0xac9",
                "to": "0x508ca82df566dcd1b0de8296e70a96332cd644ec",
                "transactionIndex": "0x0",
                "value": "0x0",
                "type": "0x2",
                "accessList": [],
                "chainId": "0xe708",
                "v": "0x0",
                "r": "0xc98056211611e5331caf2ad0b22ac3979a4aba37695822c8be066b4c32a1f520",
                "s": "0x32102183fd856ba0f560ceafee9d44e0554e4dce414735b82c6cfee57514ac53"
            },
            {
                "blockHash": "0x2d527c4323e099781fc0c816557ed4f083ab58e5df66aa1e064e8d03d8724285",
                "blockNumber": "0x1122",
                "from": "0x2fc617e933a52713247ce25730f6695920b3befe",
                "gas": "0x5208",
                "gasPrice": "0x2540be400",
                "hash": "0xd1e033682a62099ecd8528db80331a52fc10b1b0b11733ce5cd90e632703cd89",
                "input": "0x",
                "nonce": "0x1c9",
                "to": "0xab8e676111b67f6879119f9f71f9d402e4020824",
                "transactionIndex": "0x1",
                "value": "0x27147114878000",
                "type": "0x0",
                "chainId": "0xe708",
                "v": "0x1ce33",
                "r": "0x31ff484b51c2ca60325b7d1d1c0440695413a746576cca2dca5a5f88ba232b9a",
                "s": "0x946da476fe4108c48b074f28a4cda40185ba921185ee557a51c5e08177c3831"
            },
            {
                "blockHash": "0x2d527c4323e099781fc0c816557ed4f083ab58e5df66aa1e064e8d03d8724285",
                "blockNumber": "0x1122",
                "from": "0xba1e7d0dc72faca991fb71cd47a4b99d39c847f2",
                "gas": "0x130ec",
                "gasPrice": "0x22c4f5d5c",
                "maxFeePerGas": "0x22c4f5d61",
                "maxPriorityFeePerGas": "0x22c4f5d55",
                "hash": "0xe5c2bd4a8d2abd3400be120066dce85c41029897de332ed73440c152a8404c74",
                "input": "0x1d7df191000000000000000000000000ba1e7d0dc72faca991fb71cd47a4b99d39c847f20000000000000000000000000000000000000000000000000000000000000001",
                "nonce": "0x0",
                "to": "0xb62c414abf83c0107db84f8de1c88631c05a8d7b",
                "transactionIndex": "0x2",
                "value": "0x2c2ad68fd9000",
                "type": "0x2",
                "accessList": [],
                "chainId": "0xe708",
                "v": "0x1",
                "r": "0xfd7486170a58b1fe5b2040624f179eedfd6a2bd4469114157d0f0d67a0c8da5b",
                "s": "0x4870dbc12139b57e6c738cb78a43394eb2d48fe1cfb6e92fe00992c8fc8a1919"
            }
        ],
        "transactionsRoot": "0x385885c39ece2929d8e2d4496e16f62f4408a6daaeb5c89203ae210b8e214c2e",
        "uncles": []
    }
}

🚧

The below parameter inputs do not work, please reference the section above instead.

Language
Click Try It! to start a request and see the response here!