API Reference

eth_getBlockByHash - Zeta

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: [ "0x10f1f46e29205744f94af844630a4a6670925a621e4fefec1475361a1280f877", 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

Requests

curl --location 'http://zetachain-athens-3.unifra.io/v1//health' \ --header 'Content-Type: application/json' \ --data '{ "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": [ "0x10f1f46e29205744f94af844630a4a6670925a621e4fefec1475361a1280f877", true ], "id": "89783" }'
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": "89783", "result": { "baseFeePerGas": "0x7", "difficulty": "0x0", "extraData": "0x", "gasLimit": "0x1dcd6500", "gasUsed": "0x2fa9bc", "hash": "0x10f1f46e29205744f94af844630a4a6670925a621e4fefec1475361a1280f877", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000002400000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000", "miner": "0xa0f9252f1ed06722996ed578bb2f39f631e76982", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x152283", "parentHash": "0xe4259d51de869416886efc96020ba5fa305309f660771e3d48587b08161638df", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x64d3", "stateRoot": "0xab9bc3875f052de5c240a3e2779d9f1210dfb56e974bba4907531fead4dd0017", "timestamp": "0x64ed6cea", "totalDifficulty": "0x0", "transactions": [ { "blockHash": "0x10f1f46e29205744f94af844630a4a6670925a621e4fefec1475361a1280f877", "blockNumber": "0x152283", "from": "0x735b14bb79463307aacbed86daf3322b1e6226ab", "gas": "0x650c", "gasPrice": "0x7", "hash": "0xb15ad2ce31933e13b53ba7630f777a1d9356227745dba1895acdbadf8237fce3", "input": "0x", "nonce": "0x0", "to": "0xedf1c3275d13489acdc6cd6ed246e72458b8795b", "transactionIndex": "0x0", "value": "0x0", "type": "0x58", "chainId": "0x1b59", "v": null, "r": null, "s": null } ], "transactionsRoot": "0x8bd068a35eadc8759ae5562976c32a085768ac2386e3a0f3400ef5f35c56baee", "uncles": [] } }

🚧

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

Path Params
string
required
Body Params
json
Defaults to { "jsonrpc": "2.0", "method": "eth_getBlockByHash", "params": [ "0xeb3bad6c11ff198037c7ab15779294030a3883a06a816f2784589d3a486e5b75", true ], "id": "123" }
Responses

Language
Click Try It! to start a request and see the response here! Or choose an example:
application/json