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

# eth_getBlockByHash

> Returns information about a block by hash.

### Parameters

<ParamField query="chainId" type="string" default="10" required>
  Unique identifier for a blockchain network.
</ParamField>

<ParamField body="id" type="number" default={1} required>
  Request identifier used to match responses.
</ParamField>

<ParamField body="jsonrpc" type="string" default="2.0" required>
  JSON-RPC version.
</ParamField>

<ParamField body="method" type="string" default="eth_getBlockByHash" required>
  JSON-RPC method name.
</ParamField>

<ParamField body="params" type="object" default={["0xbfb3bb785c60ee4f93aa6e506f6f5d5fc5173301f537d856cac59d91e7a0ce09",true]} placeholder="[&#x22;0xbfb3bb785c60ee4f93aa6e506f6f5d5fc5173301f537d856cac59d91e7a0ce09&#x22;,true]" required>
  Parameters for eth\_getBlockByHash: \[blockHash, fullTransactions].

  Positional parameters for <code>eth\_getBlockByHash</code>:

  <ul>
    <li><code>params\[0]</code>: 32 Bytes - hash of the block where this transaction was included. Null when pending.</li>
    <li><code>params\[1]</code>: If true, returns the full transaction objects. If false, returns only the transaction hashes.</li>
  </ul>
</ParamField>

### Returns

<ResponseField name="result" type="object">
  A block object returned by Ethereum RPC. Null if no block is found.

  <Expandable title="properties">
    <ResponseField name="number" type="string">
      The block number. Null when pending.
    </ResponseField>

    <ResponseField name="hash" type="string">
      Hash of the block. Null when pending.
    </ResponseField>

    <ResponseField name="parentHash" type="string">
      Hash of the parent block.
    </ResponseField>

    <ResponseField name="nonce" type="string">
      8 Bytes - Proof-of-work nonce. Null when pending. Missing in Proof-of-Authority (PoA) networks.
    </ResponseField>

    <ResponseField name="sha3Uncles" type="string">
      SHA3 of the uncles data in the block.
    </ResponseField>

    <ResponseField name="logsBloom" type="string">
      The bloom filter for the logs of the block. Null when pending.
    </ResponseField>

    <ResponseField name="transactionsRoot" type="string">
      Root of the transaction trie of the block.
    </ResponseField>

    <ResponseField name="stateRoot" type="string">
      Root of the final state trie of the block.
    </ResponseField>

    <ResponseField name="receiptsRoot" type="string">
      Root of the receipts trie of the block.
    </ResponseField>

    <ResponseField name="author" type="string">
      Address of the author (beneficiary) of the block.
    </ResponseField>

    <ResponseField name="miner" type="string">
      Alias of "author".
    </ResponseField>

    <ResponseField name="difficulty" type="string">
      Difficulty for this block.
    </ResponseField>

    <ResponseField name="totalDifficulty" type="string">
      Total difficulty of the chain until this block.
    </ResponseField>

    <ResponseField name="extraData" type="string">
      Extra data field of this block.
    </ResponseField>

    <ResponseField name="size" type="string">
      Size of the block in bytes.
    </ResponseField>

    <ResponseField name="gasLimit" type="string">
      Maximum gas allowed in this block.
    </ResponseField>

    <ResponseField name="gasUsed" type="string">
      Total used gas by all transactions in this block.
    </ResponseField>

    <ResponseField name="timestamp" type="string">
      Unix timestamp for when the block was collated.
    </ResponseField>

    <ResponseField name="transactions" type="array">
      Array of either full transaction objects or transaction hashes (32-byte strings).

      <Expandable title="items">
        <ResponseField name="items[]" type="oneOf">
          Legacy transaction (pre-EIP-2718).

          <Expandable title="variants">
            <ResponseField name="variant1" type="object">
              Legacy transaction (pre-EIP-2718).

              <Expandable title="properties">
                <ResponseField name="hash" type="string">
                  32 Bytes - hash of the transaction.
                </ResponseField>

                <ResponseField name="nonce" type="integer">
                  Quantity - (optional) Integer of a nonce. This allows you to overwrite your own pending transactions that use the same nonce.
                </ResponseField>

                <ResponseField name="blockHash" type="string">
                  32 Bytes - hash of the block where this transaction was included. Null when pending.
                </ResponseField>

                <ResponseField name="blockNumber" type="oneOf">
                  Block number where this transaction was included. Null when pending.

                  <Expandable title="variants">
                    <ResponseField name="variant1" type="integer" />

                    <ResponseField name="variant2" type="string" />
                  </Expandable>
                </ResponseField>

                <ResponseField name="transactionIndex" type="integer">
                  The transaction's index position in the block. Null when pending.
                </ResponseField>

                <ResponseField name="from" type="string">
                  20 Bytes - The address the transaction is sent from.
                </ResponseField>

                <ResponseField name="to" type="string">
                  20 Bytes - The address the transaction is directed to. (Optional when creating new contract)
                </ResponseField>

                <ResponseField name="value" type="integer">
                  Quantity - (optional) Integer of the value sent with this transaction.
                </ResponseField>

                <ResponseField name="gasPrice" type="integer">
                  Quantity - (optional) Integer of the gas price used for each paid gas.
                </ResponseField>

                <ResponseField name="gas" type="integer">
                  Quantity - (optional) Integer of the gas provided for the transaction execution. (eth\_call consumes zero gas)
                </ResponseField>

                <ResponseField name="input" type="string">
                  The data sent along with the transaction.
                </ResponseField>

                <ResponseField name="v" type="integer">
                  The standardised V field of the signature.
                </ResponseField>

                <ResponseField name="standardV" type="integer">
                  The standardised V field of the signature (0 or 1). Only applicable to legacy transactions.
                </ResponseField>

                <ResponseField name="r" type="integer">
                  The R field of the signature.
                </ResponseField>

                <ResponseField name="raw" type="string">
                  Raw transaction data.
                </ResponseField>

                <ResponseField name="publicKey" type="string">
                  Public key of the signer.
                </ResponseField>

                <ResponseField name="chainId" type="integer">
                  The chain id of the transaction, if any.
                </ResponseField>

                <ResponseField name="creates" type="string">
                  Creates contract hash.
                </ResponseField>

                <ResponseField name="condition" type="oneOf">
                  Conditional submission of the transaction. Can be an object with a block number (\{ block: 1 }), a UTC timestamp in seconds (\{ time: 1491290692 }), or null.

                  <Expandable title="variants">
                    <ResponseField name="variant1" type="object">
                      <Expandable title="properties">
                        <ResponseField name="block" type="integer">
                          Block number condition
                        </ResponseField>
                      </Expandable>
                    </ResponseField>

                    <ResponseField name="variant2" type="object">
                      <Expandable title="properties">
                        <ResponseField name="time" type="integer">
                          UTC timestamp condition in seconds
                        </ResponseField>
                      </Expandable>
                    </ResponseField>
                  </Expandable>
                </ResponseField>
              </Expandable>
            </ResponseField>

            <ResponseField name="variant2" type="string" />
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="uncles" type="array">
      Array of uncle block hashes.

      <Expandable title="items">
        <ResponseField name="items[]" type="string" />
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash Curl theme={null}
  curl --request POST \
    --url https://api.uniblock.dev/uni/v1/json-rpc?chainId=10 \
    --header 'content-type: application/json' \
    --data '{
      "id": 1,
      "jsonrpc": "2.0",
      "method": "eth_getBlockByHash",
      "params": [
        "0xbfb3bb785c60ee4f93aa6e506f6f5d5fc5173301f537d856cac59d91e7a0ce09",
        true
      ]
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
      "number": "0x1b4",
      "hash": "0xbfb3bb785c60ee4f93aa6e506f6f5d5fc5173301f537d856cac59d91e7a0ce09",
      "parentHash": "0x9646252be9520f6e71339a8df9c55e4d7619deeb018d2a3f2d21fc165dde5eb5",
      "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
      "logsBloom": "0xbfb3bb785c60ee4f93aa6e506f6f5d5fc5173301f537d856cac59d91e7a0ce09",
      "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
      "stateRoot": "0xd5855eb08b3387c0af375e9cdb6acfc05eb8f519e419b874b6ff2ffda7ed1dff",
      "miner": "0x4e65fda2159562a496f9f3522f89122a3088497a",
      "__truncated": true
    }
  }
  ```
</ResponseExample>
