eth_getBlockByNumber method

Returns information about a block with a given number

Parameters

  1. QUANTITY|TAG - integer of a block number, or the string "earliest", "latest" or "pending", as in the default block parameter.

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

Returns

An object containing data about the block at the given height.

Example

// Request
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "eth_getBlockByNumber","params": ["0x46d9e", true]}' https://bsc-api.bwarelabs.com/<your-endpoint-id>

// Response
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "difficulty": "0x2",
    "extraData": "0xd883010002846765746888676f312e31332e34856c696e7578000000000000004bb33f4cc4424417f1b1082f27cd70fb7a3c3f727a5868fd397a5edfc2390ce93a88e2c05e2d7f3ef7fbcc56de326c174a6d523d8b6279a981f0e8e1e449dae601",
    "gasLimit": "0x1c9c380",
    "gasUsed": "0x0",
    "hash": "0x72bd249c65738fe19323dc00e881a49d1c7f0570f11249a37dae67f589a44b80",
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "miner": "0x685b1ded8013785d6623cc18d214320b6bb64759",
    "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "nonce": "0x0000000000000000",
    "number": "0x46d9e",
    "parentHash": "0x6af21f12b49393b23758e96edc4af5b7d7894cf9ce1b6184776e614e4b193f3f",
    "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
    "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
    "size": "0x262",
    "stateRoot": "0x0cd6a3bbceaf4e3410a942ef4e769b8767eb2755308ddc34500fc166419d4607",
    "timestamp": "0x5f57147e",
    "totalDifficulty": "0x8daae",
    "transactions": [],
    "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
    "uncles": []
  }
}

Last updated