post https://merlin-mainnet.unifra.io/v1/#2
Returns information about a block by hash.
Parameters
- DATA, 32 Bytes - Hash of a block.
- Boolean - If true it returns the full transaction objects, if false it returns only the hashes of the transactions.
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
Request
curl --location --request POST 'https://merlin-mainnet.unifra.io/v1/your-api-key' \
--header 'Content-Type: application/json' \
--data-raw '
{
"jsonrpc":"2.0",
"method":"eth_getBlockByHash",
"params":["0x9b58a44e96fde767d91026811e765b16fc5b137bbc3c5455c346d42ada0f8b8d", true],
"id":0
}'
Result
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"parentHash": "0xea4def0dc30142977f21d44649a8bcdf4ba8c1bc6817fa1935de32629d109e40",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"miner": "0xf73d921aa8f2dbe77adca8466127b392ede89dc9",
"stateRoot": "0x08b8e4d01660898fc75445d2cb6a17cdafe56ce738d403b68f34ee7bc358a5f5",
"transactionsRoot": "0x6185ccd517e752248139b0ee84b35ee2d3715b83b45cbfeef6dcdf6d85c74cc6",
"receiptsRoot": "0xec86c90b6ea4bea54aa5639e1e0b51f0938504a523c2424993416ad3ba4b5a24",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"difficulty": "0x0",
"totalDifficulty": "0x0",
"size": "0x267",
"number": "0x1",
"gasLimit": "0x1c9c380",
"gasUsed": "0x5208",
"timestamp": "0x65bce888",
"extraData": "0x",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x0000000000000000",
"hash": "0x9b58a44e96fde767d91026811e765b16fc5b137bbc3c5455c346d42ada0f8b8d",
"transactions": [
"0xba4304eb48dbe0582e51576db33d1be7186cf6c192d47abeb7ee58956f7b8868"
],
"uncles": []
}
}