We're now supporting Polygon zkEVM!
Learn more here.
The API credit value for this method is 22 . To learn more about API credits and each method's value, visit the API Credits page.
Parameters:
Returns:
baseFeePerGas - The integer of the difficulty for this block encoded as hexadecimal
difficulty - The integer of the difficulty for this block encoded as hexadecimal
extraData - The extra data field of this block
gasLimit - The maximum gas allowed in this block encoded as hexadecimal
gasUsed - The total used gas by all transactions in this block encoded as hexadecimal
hash - The block hash of the requested block. Null if pending
logsBloom - The bloom filter for the logs of the block. Null if pending
miner - The address of the beneficiary to whom the mining rewards were given
mixHash - A string of a 256-bit hash encoded as hexadecimal
nonce - The hash of the generated proof-of-work. Null if pending
number - The block number of the requested block encoded as hexadecimal. Null if pending
parentHash - The hash of the parent block
receiptsRoot - The root of the receipts trie of the block
sha3Uncles - The SHA3 of the uncles data in the block
size - The size of this block in bytes as an Integer value encoded as hexadecimal
stateRoot - The root of the final state trie of the block
timestamp - The unix timestamp for when the block was collated
transactions - An array of transaction objects with the following fields:
blockHash - The hash of the block where this log was in. Null when it's a pending log
blockNumber - The block number where this log was in. Null when it's a pending log
from - The address of the sender
gas - The gas provided by the sender, encoded as hexadecimal
gasPrice - The gas price provided by the sender in wei, encoded as hexadecimal
maxFeePerGas - The maximum fee per gas set in the transaction
maxPriorityFeePerGas - The maximum priority gas fee set in the transaction
hash - The hash of the transaction
input - The data sent along with the transaction
nonce - The number of transactions made by the sender before this one encoded as hexadecimal
to - The address of the receiver. Null when it's a contract creation transaction
transactionIndex - The integer of the transaction's index position that the log was created from. Null when it's a pending log
value - The value transferred in wei encoded as hexadecimal
type - The transaction type
accessList - A list of addresses and storage keys that the transaction plans to access
chainId - The chain id of the transaction, if any
v - The standardized V field of the signature
r The R field of the signature
s The S field of the signature
transactionsRoot - The root of the transaction trie of the block
uncles - An array of uncle hashes
Code Examples:
from web3 import Web3, HTTPProvider provider = Web3.HTTPProvider("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/") result = provider.make_request('debug_getBadBlocks', []) print(result)
var myHeaders = new Headers(); myHeaders.append("Content-Type", "application/json"); var raw = JSON.stringify({ "method": "debug_getBadBlocks", "params": [], "id": 1, "jsonrpc": "2.0" }); var requestOptions = { method: 'POST', headers: myHeaders, body: raw, redirect: 'follow' }; fetch("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));
curl http://sample-endpoint-name.network.quiknode.pro/token-goes-here/ \ -X POST \ -H "Content-Type: application/json" \ --data '{"method":"debug_getBadBlocks","params":[],"id":1,"jsonrpc":"2.0"}'
require 'eth' client = Eth::Client.create 'http://sample-endpoint-name.network.quiknode.pro/token-goes-here/' payload = { "jsonrpc": "2.0", "method": "debug_getBadBlocks", "params": [], "id": "1" } response = client.send(payload.to_json) puts response
import requests import json url = "http://sample-endpoint-name.network.quiknode.pro/token-goes-here/" payload = json.dumps({ "method": "debug_getBadBlocks", "params": [], "id": 1, "jsonrpc": "2.0" }) headers = { 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text)
require "uri" require "json" require "net/http" url = URI("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/") http = Net::HTTP.new(url.host, url.port); request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request.body = JSON.dump({ "method": "debug_getBadBlocks", "params": [], "id": 1, "jsonrpc": "2.0" }) response = http.request(request) puts response.read_body
const ethers = require("ethers"); (async () => { const provider = new ethers.providers.JsonRpcProvider("http://sample-endpoint-name.network.quiknode.pro/token-goes-here/"); const filterId = await provider.send("debug_getBadBlocks", []); console.log(filterId); })();