> ## Documentation Index
> Fetch the complete documentation index at: https://docs.validationcloud.io/llms.txt
> Use this file to discover all available pages before exploring further.

# eth_getBlockByHash

Returns information about a block by hash.

This method will use `40` [Compute Units](/nodeapi/about/billing).

***

<Info>
  Over HTTPS, Hyperliquid Mainnet keeps roughly 165 days of blocks, receipts and logs; requests for older blocks return JSON-RPC error `-32603` with `invalid block height`. Over WebSocket the request is served by nanoreth, the HyperEVM archive client, and any block back to genesis is available.
</Info>

## Reference: [Here](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash)

## **Parameters**

1. `DATA`, 32 Bytes - Hash of a block.
2. `Boolean` - If `true` it returns the full transaction objects, if `false` only the hashes of the transactions are returned.

```javascript theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
params: [
 "0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae",
 false,
 ]
```

## **Returns**

`Object` - A block object, 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.

```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
// Result
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "hash": "0xfcc6c301f189ad5f3ae6d7678918c1e16268987e723be01bfd058a66559b2377",
    "parentHash": "0x6ef05b0441b71f2a57917c4603f3a246141896f11d7a1856a8a9672a28178878",
    "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
    "miner": "0x0000000000000000000000000000000000000000",
    "stateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "transactionsRoot": "0xd4dc808b8a3e85d7bf8d051d7ecb896bf1b909f0ceeb231f5b774a40cadb22ae",
    "receiptsRoot": "0xefb0c21ecd3eb07f8b227b25f8248e944bfd58fe7be525bf41b268f8c72f92f1",
    "logsBloom": "0x0002000000000014...",
    "difficulty": "0x0",
    "number": "0x2e2f25e",
    "gasLimit": "0x2dc6c0",
    "gasUsed": "0x89c0c",
    "timestamp": "0x6ace13d8",
    "extraData": "0x",
    "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "nonce": "0x0000000000000000",
    "baseFeePerGas": "0x5f5e100",
    "size": "0xab9",
    "uncles": [],
    "transactions": [
      "0x157a700e366c87a010e757e618d242814d60837782da90b6610ef8ef013e12e5"
    ],
    "withdrawals": []
  }
}
```

<CodeGroup>
  ```bash title="mainnet" theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
  curl https://mainnet.hyperliquid.validationcloud.io/v1/<YOUR_API_KEY_HERE>/evm \
      -X POST \
      -H "Content-Type: application/json" \
      -d '{"jsonrpc":"2.0","method":"eth_getBlockByHash","params":["0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae", false],"id":1}'
  ```
</CodeGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.