---
description: debug_getBadBlocks RPC Method
---

# debug\_getBadBlocks

**Parameters:**

_none_



**Returns:**

_hash_ - The hash of the transaction

_block_ - A block object, or null when no block was found

_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:

&#x20;    _blockHash_ - The hash of the block where this log was in. Null when it's a pending log

&#x20;    _blockNumber_ - The block number where this log was in. Null when it's a pending log

&#x20;    _from_ - The address of the sender

&#x20;    _gas_ - The gas provided by the sender, encoded as hexadecimal

&#x20;    _gasPrice_ - The gas price provided by the sender in wei, encoded as hexadecimal

&#x20;    _maxFeePerGas_ - The maximum fee per gas set in the transaction

&#x20;    _maxPriorityFeePerGas_ - The maximum priority gas fee set in the transaction

&#x20;    _hash_ - The hash of the transaction

&#x20;    _input_ - The data sent along with the transaction

&#x20;    _nonce_ - The number of transactions made by the sender before this one encoded as hexadecimal

&#x20;    _to_ - The address of the receiver. Null when it's a contract creation transaction

&#x20;    _transactionIndex_ - The integer of the transaction's index position that the log was created from. Null when it's a pending log

&#x20;    _value_ - The value transferred in wei encoded as hexadecimal

&#x20;    _type_ - The transaction type

&#x20;    _accessList_ - A list of addresses and storage keys that the transaction plans to access

&#x20;    _chainId_ - The chain id of the transaction, if any

&#x20;    v - The standardized V field of the signature

&#x20;    _r_ - The R field of the signature

&#x20;    _s_ - The S field of the signature

&#x20;    _transactionsRoot_ - The root of the transaction trie of the block

&#x20;    _uncles_ - An array of uncle hashes

_rlp_ - The RLP encoded header\


**Code Examples:**

```
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("https://api.ebs.ezat.io/core/api/v1.0/rpc/bsc/mainnet?x-api-key-id=API-KEY-ID&x-api-key=API-KEY", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```
