Log In

eth_getBlockByNumber - zkSync Era

Returns information about a block by block number.

Parameters

  • QUANTITY|TAG - Integer of a block number, or the string "earliest", "latest" or "pending", as in the default block parameter.
  • Boolean - If true it returns the full transaction objects, if false only the hashes of the transactions.
params: ["0x0", true];

Returns

See eth_getBlockByHash.

Example

Request

curl --location --request POST 'https://zksync-era-mainnet.unifra.io/v1/your-api-key' \
--header 'Content-Type: application/json' \
--data-raw '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x1", true],"id":0}'

Result

{
    "jsonrpc": "2.0",
    "id": 0,
    "result": "0x103df"
}

🚧

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!