AptosAptos Network's breakthrough technology and seamless user experience are now available on QuickNode.
Start building today!The eth_getBlockByHash EVM method is only supported on the Avalanche C-Chain.
The API credit value for this method is 2 . To learn more about API credits and each method's value, visit the API Credits page.
Parameters:
Returns:
number - The block number of the requested block encoded as a hexadecimal. null if pending.
hash - The block hash of the requested block. null if pending.
parentHash - Hash of the parent block.
nonce - Hash of the generated proof-of-work. null if pending.
sha3Uncles - SHA3 of the uncles data in the block.
logsBloom - The bloom filter for the logs of the block. null if pending.
transactionsRoot - The root of the transaction trie of the block.
stateRoot - The root of the final state trie of the block.
receiptsRoot - The root of the receipts trie of the block.
miner - The address of the beneficiary to whom the mining rewards were given.
difficulty - Integer of the difficulty for this block encoded as a hexadecimal.
totalDifficulty - Integer of the total difficulty of the chain until this block encoded as a hexadecimal.
extraData - The “extra data” field of this block.
size - The size of this block in bytes as an Integer value encoded as hexadecimal.
gasLimit - The maximum gas allowed in this block encoded as a hexadecimal.
gasUsed - The total used gas by all transactions in this block encoded as a hexadecimal.
timestamp - The unix timestamp for when the block was collated.
transactions - Array of transaction objects - please see eth_getTransactionByHash for exact shape.
uncles - Array of uncle hashes.
Code Examples:
To use the eth_getBlockByHash EVM method on the Avalanche C-Chain, ensure that the end of your URL includes ext/bc/C/rpc.
require 'ethereum.rb' client = Ethereum::HttpClient.new('http://sample-endpoint-name.network.quiknode.pro/token-goes-here/ext/bc/C/rpc') blockData = client.eth_get_block_by_hash('0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b',false) puts blockData["result"]
curl http://sample-endpoint-name.network.quiknode.pro/token-goes-here/ext/bc/C/rpc \ -X POST \ -H "Content-Type: application/json" \ --data '{"method":"eth_getBlockByHash","params":["0x3e56c97d34f03b1369c351fa6c9f57c8bfa987c7da40964fab981303e0ef5849",false],"id":1,"jsonrpc":"2.0"}'
from web3 import Web3, HTTPProvider w3 = Web3(HTTPProvider('http://sample-endpoint-name.network.quiknode.pro/token-goes-here/ext/bc/C/rpc')) print(w3.eth.get_block('0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b'))
const ethers = require("ethers"); (async () => { const provider = new ethers.providers.JsonRpcProvider( "http://sample-endpoint-name.network.quiknode.pro/token-goes-here/ext/bc/C/rpc" ); const blockData = await provider.getBlock( "0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b" ); console.log(blockData); })();