[Block] eth_getBlockByHash
Returns information about a block by hash.
Please check Caution-Block before using this API
JSONRPC: eth_getBlockByHash
Request
- application/json
Body
Array [
]
Default value: eth_getBlockByHash
Method name
Default value: 1
Request ID, Random or Auto incrementation
Default value: 2.0
JSON-RPC Version (2.0)
params
undefined[]
Hash of a block.
If true, it returns the full transaction objects, if false only the hashes of the transactions.
Responses
- 200
Returns information about a block by hash.
- application/json
- Schema
- Example (from schema)
Schema
Array [
- TransactionHash
]
Default value: 2.0
error
object
A Number that indicates the error type that occurred. This MUST be an integer.
| code | message | description | |-----|-----|-------| | -32700 | Parse error | invalid JSON was received by the server. An error occurred on the server while parsing the JSON text. | |-32602 | Invalid params | Invalid method parameter(s). |
A String providing a short description of the error. The message SHOULD be limited to a concise single sentence.
A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.).
result
object
The base fee per gas.
The integer of the difficulty for this block
The "extra data" field of this block.
The maximum gas allowed in this block.
The total used gas by all transactions in this block.
Hash of the block. null when it is a pending block.
The bloom filter for the logs of the block. null when it is a pending block.
The address of the beneficiary to whom the mining rewards were given.
The hash which proves combined with the nonce that a sufficient amount of computation has been carried out on this block.
The hash of the generated proof-of-work.
The block number. null when it is a pending block.
Hash of the parent block.
The root of the receipts trie of the block.
The SHA3 of the uncles data in the block.
Integer of the size of this block in bytes.
The root of the final state trie of the block.
The Unix timestamp for when the block was collated.
The total blockScore of the chain until this block
The root of the transaction trie of the block.
transactions
object[]
Array of transaction objects, or 32-byte transaction hashes depending on the last given parameter.
oneOf
string
Array of uncle hashes.
{
"jsonrpc": "2.0",
"id": 0,
"error": {
"code": -32700,
"message": "Parse error",
"data": "string"
},
"result": {
"baseFeePerGas": "0x5d21dba00",
"difficulty": "0x1",
"extraData": "0xd8820505846b6c617988676f312e31312e328664617277696e00000000000000f89ed594e733cb4d279da696f30d470f8c04decb54fcb0d2b841f1f600d136f93a5a2d9c12a7a9f6d7ba80a047c3910a2bbc01e38bcce25e48ed2004d21f134df5efaf1f8cbb9a26e1548e57628ab258c935490c11a7cd65324701f843b841444b3efc40071b6eec2c4d2630b483710b8fc7a601432431b0161f489102d1ca02f2ef93153d0be3843aa563d34cee1716163f58711843442aedd94a56303c0400",
"gasLimit": "0xe8d4a50fff",
"gasUsed": "0x0",
"governanceData": "0x",
"hash": "0xb8deae63002d2b6aa33247c8ef545383ee0fd2282ac9b49dbbb74114389ddb5c",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0x0000000000000000000000000000000000000000",
"mixHash": "0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365",
"nonce": "0x0000000000000000",
"number": "0x1",
"parentHash": "0x73255a60e9491b5715f9bfcb7fa1143296810f629836d4cefbd1921d9173d63d",
"receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"reward": "0x0000000000000000000000000000000000000000",
"size": "0x2d7",
"stateRoot": "0xedb87f4b0f905a655c80d1768eb22b1eff2405098c4748b8364c869611e02a2b",
"timestamp": "0x5c99cbd8",
"totalDifficulty": "0x2",
"transactions": [],
"transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"uncles": []
}
}