eth_getBlockByNumber

Returns block information by number.

Parameters:

QUANTITY|TAG - integer of a block number, or the string "latest"

Boolean - If true it returns the full transaction objects, if false only the hashes of the transactions.

Returns:

Object - A block object, or null when no block was found:

  • number: QUANTITY - the block number.

  • hash: DATA, 32 Bytes - hash of the block.

  • parentHash: DATA, 32 Bytes - hash of the parent block.

  • nonce: DATA, 8 Bytes - hash of the generated proof-of-work.

  • 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.

  • 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  https://base-goerli.blockpi.network/v1/rpc/your-rpc-key -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest", true],"id":1}'

// Result
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "baseFeePerGas": "0x54",
        "difficulty": "0x0",
        "extraData": "0x",
        "gasLimit": "0x17d7840",
        "gasUsed": "0x1f03ee",
        "hash": "0x7896799aa9972636ce6621f5099fb0b541406337e33f6b16d733ebfec9f68fe7",
        "logsBloom": "0x00200000000000000008010080000000010008000001000020000008010900000400021400040000000002004200000090400000040800000080300008300000000400000082220000000008040008200000000480c00200020000000200000000000000000800000204000008a00000000000080010040480020010004000200400000200000800000000200000000840000804004110580000004100000000020000002000800240000000000000000000000000000000002040000004000000000002000000000000082100300000000200000000201000000012000000000030400000000802064000000200800000000020000094000000000000400000",
        "miner": "0x4200000000000000000000000000000000000011",
        "mixHash": "0xf63f2a2b0e7885d78381a05ab3b73896e961b238b6020a5162fc95f2fb1bc276",
        "nonce": "0x0000000000000000",
        "number": "0x5f1dae",
        "parentHash": "0x06e43080ef7d2bb7170967993aba670ba5edafbac5481236fcfbbe6f3559c01f",
        "receiptsRoot": "0x7e0c7c49523dffe24039a225811227cc4c5ecc843baa5118b0c8d4d7e65a8f17",
        "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
        "size": "0xef5",
        "stateRoot": "0x56bfc7fbac247262f8b4a40bc648c302104b773facf7a1be2388afd2db972064",
        "timestamp": "0x6497a86c",
        "totalDifficulty": "0x0",
        "transactions": [
            {
                "blockHash": "0x7896799aa9972636ce6621f5099fb0b541406337e33f6b16d733ebfec9f68fe7",
                "blockNumber": "0x5f1dae",
                "from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001",
                "gas": "0xf4240",
                "gasPrice": "0x0",
                "hash": "0x57294047f5f7b7eb9aec7a2b414b4fffe89598b26025c9c4bab9d8d363e3ac82",
                "input": "0x015d8eb900000000000000000000000000000000000000000000000000000000008ced53000000000000000000000000000000000000000000000000000000006497a804000000000000000000000000000000000000000000000000000000000048588ad95d6c1b009e9e7f1b18b1ea2f9dc3dfa2588b67afb757f9355f5ea9a11655f5000000000000000000000000000000000000000000000000000000000000000500000000000000000000000073b4168cc87f35cc239200a20eb841cded23493b000000000000000000000000000000000000000000000000000000000000083400000000000000000000000000000000000000000000000000000000000f4240",
                "nonce": "0x5f1dad",
                "to": "0x4200000000000000000000000000000000000015",
                "transactionIndex": "0x0",
                "value": "0x0",
                "type": "0x7e",
                "v": "0x0",
                "r": "0x0",
                "s": "0x0",
                "sourceHash": "0x4921d9cceeabad2354630ae0cb0a1302df655e9269772c8380bf322b820537fd",
                "mint": "0x0"
            },
            {
                "blockHash": "0x7896799aa9972636ce6621f5099fb0b541406337e33f6b16d733ebfec9f68fe7",
                "blockNumber": "0x5f1dae",
                "from": "0xc4d96ddecc96db3f18159715a2077cc3bf7f99d4",
                "gas": "0x4f0be",
                "gasPrice": "0x59682f54",
                "maxFeePerGas": "0x59682fa8",
                "maxPriorityFeePerGas": "0x59682f00",
                "hash": "0x5c61d8eb4249238b0fce0f3cd9fb0644d8abfda414faf455658de82c20eb3501",
                "input": "0x58f9edfc00000000000000000000000000000000000000000000000000000000000027adf0ee2eab2e41821633ea18bcc924542eb48adb1b1268a0a0918e7a5d97dea387",
                "nonce": "0x11e0a",
                "to": "0x9b9f55494cf915c728dc65ee113c7309ee16ca18",
                "transactionIndex": "0x1",
                "value": "0x0",
                "type": "0x2",
                "accessList": [],
                "chainId": "0x14a33",
                "v": "0x0",
                "r": "0x4c8d9c42357c07ed146fb557225714118f56486bbc73211213a4ef1953b74bf4",
                "s": "0x347fd8e005f75416c10ffad7e29f161813c4aac684dd2af68926f028fe1f54e4"
            },
            {
                "blockHash": "0x7896799aa9972636ce6621f5099fb0b541406337e33f6b16d733ebfec9f68fe7",
                "blockNumber": "0x5f1dae",
                "from": "0xc4d96ddecc96db3f18159715a2077cc3bf7f99d4",
                "gas": "0x4f0be",
                "gasPrice": "0x59682f54",
                "maxFeePerGas": "0x59682fa8",
                "maxPriorityFeePerGas": "0x59682f00",
                "hash": "0x8310320caeb78674974c601b4b22e34457b7da5e77bdbd6f5d0508fef6b326bb",
                "input": "0x58f9edfc00000000000000000000000000000000000000000000000000000000000027ad57fa30fb81c9be12f6ec9f158c27fda54310cde46da407324a8e94c0ba38552c",
                "nonce": "0x11e0b",
                "to": "0x9b9f55494cf915c728dc65ee113c7309ee16ca18",
                "transactionIndex": "0x2",
                "value": "0x0",
                "type": "0x2",
                "accessList": [],
                "chainId": "0x14a33",
                "v": "0x0",
                "r": "0x7214abe20a991140636f39dee815509e62d53a7fdde87efef727523e38f2211f",
                "s": "0x5590a33e82a69094eb0d60a6fcab4fc8ef3f81158d2e3f071a2c9f36c485f836"
            },
            {
                "blockHash": "0x7896799aa9972636ce6621f5099fb0b541406337e33f6b16d733ebfec9f68fe7",
                "blockNumber": "0x5f1dae",
                "from": "0xc4d96ddecc96db3f18159715a2077cc3bf7f99d4",
                "gas": "0x4f0b0",
                "gasPrice": "0x59682f54",
                "maxFeePerGas": "0x59682fa8",
                "maxPriorityFeePerGas": "0x59682f00",
                "hash": "0x99050c3d52e3cbd0ee26870dc55f8fc4d29277b860d636aca26833eacba839b4",
                "input": "0x58f9edfc00000000000000000000000000000000000000000000000000000000000027ad8fcd86b1231be4838fd9d9513e4900677cbeb11da8f3fa35cecd609f98eb4897",
                "nonce": "0x11e0c",
                "to": "0x9b9f55494cf915c728dc65ee113c7309ee16ca18",
                "transactionIndex": "0x3",
                "value": "0x0",
                "type": "0x2",
                "accessList": [],
                "chainId": "0x14a33",
                "v": "0x0",
                "r": "0x807d8ec74a0e29539e722c88949db6b1637de87fc0ef39014f0eb6eab1254b49",
                "s": "0x739cc6105962192debc0844e285f71dc80e43c48864002d1a74c0603f132954"
            },
            {
                "blockHash": "0x7896799aa9972636ce6621f5099fb0b541406337e33f6b16d733ebfec9f68fe7",
                "blockNumber": "0x5f1dae",
                "from": "0x8e0e5bf36d5937df49a6e0dc793eedd896918f1f",
                "gas": "0xb4c7",
                "gasPrice": "0x59682f54",
                "maxFeePerGas": "0x59682f64",
                "maxPriorityFeePerGas": "0x59682f00",
                "hash": "0x68d75a82952957f80c51beead59c97c52b64c3f7cfe68037adbf632997a457e8",
                "input": "0x095ea7b300000000000000000000000029843613c7211d014f5dd5718cf32bcd314914cb00000000000000000000000000000000000000000000011e09b87d658a32638a",
                "nonce": "0xc7",
                "to": "0x3e8b7c72f4a9f4c8ec375c11f44fb84242c3893f",
                "transactionIndex": "0x4",
                "value": "0x0",
                "type": "0x2",
                "accessList": [],
                "chainId": "0x14a33",
                "v": "0x0",