Polygon API Documentation
eth_getUncleByBlockHashAndIndex RPC Method
eth_getUncleByBlockHashAndIndex
JSON-RPC method on Polygon returns information about the 'Uncle' of a block by hash and the Uncle index position.
Parameters
BlockHash
- [required] - String- The hash (32 bytes) of the block to retrieve.
Uncle index position
- [required] - An integer indicating the uncle's index position encoded as hexadecimal.
params: [
'0x6730865e4d068c4b0246d7fbe609d7a2cebacea77c7bc5df0d21d77d75d9dcc6', '0x0'
]
Returns
-
Block object
ornull
when no block was found. Properties:-
number
- The block number. Null when the returned block is the pending block. -
hash
32 Bytes - Hash of the block. In case of a pending block, it returns null. -
parentHash
32 Bytes - Hash of the parent block. -
nonce
8 Bytes - Hash of the generated proof-of-work. Null if pending. -
difficulty
- The integer of the difficulty for this block encoded as a hexadecimal string. -
totalDifficulty
- Hexadecimal of the total difficulty of the chain until this block. -
logsBloom
- The bloom filter for the logs of the block. null if pending. -
sha3uncles
- SHA3 of the uncles data in the block. -
extraData
- The “extra data” field of this block. -
timestamp
- The Unix timestamp for when the block was collated. -
size
- The unix timestamp for when the block was collated. -
miner
20 Bytes - The address of the miner receiving the reward. -
transactionsRoot
- The root of the transaction trie of the block. -
stateRoot
- The root of the final state trie of the block. -
receiptsRoot
32 Bytes - The root of the receipts trie of the block. -
uncles
- An Array of uncle hashes. -
transactions
- Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter. -
gasUsed
- The total used gas by all transactions in this block as a hexadecimal string. -
gasLimit
- The maximum gas allowed in this block encoded as a hexadecimal. -
mixHash
- A string of a 256-bit hash encoded as a hexadecimal. -
baseFeePerGas
- A string of the base fee encoded in hexadecimal format.
-
Request
POST https://<network>.chainnodes.org/YOUR-API-KEY
Example
💡 Confusing?
Ask our experienced blockchain developers in Telegram
- HTTPS POST Request with a JSON RPC call in the body
- Replace YOUR-API-KEY with the API key from your CHAINNODES.ORG Dashboard
- You can use a different supported network by replacing
polygon-mainnet
curl https://polygon-mainnet.chainnodes.org/YOUR-API-KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getUncleByBlockHashAndIndex","params": ["0x6730865e4d068c4b0246d7fbe609d7a2cebacea77c7bc5df0d21d77d75d9dcc6","0x0"],"id":1}'
Body
{
"jsonrpc":"2.0",
"id":1,
"result":null
}
🔌 To use eth_getRawTransactionByBlockNumberAndIndex
you must be connected to a blockchain node.
eth_getUncleByBlockHashAndIndex
Use cases
- Enhancing Blockchain Understanding: *: Developers working on the Polygon network can use the eth_getUncleByBlockHashAndIndex method to gain more understanding of the network's structure. By retrieving uncle blocks, developers can study how Polygon, an Ethereum-compatible blockchain, handles and rewards blocks that aren't included in the main chain but contribute to network security.
- Powering Blockchain Explorers: Blockchain explorers, which provide a user interface for navigating the Polygon network, can use the eth_getUncleByBlockHashAndIndex method to display detailed information about uncle blocks.
- Improving Network Monitoring Tools: Network monitoring tools can use the eth_getUncleByBlockHashAndIndex method to track the rate of uncle blocks. A high rate of uncle blocks could indicate network congestion or slow block propagation, allowing for fast detection and response to network performance problems.
JSON-RPC API Documentation by CHAINNODES is based on Erigon node client. Contact us if you are interested in specific methods that are only available on geth, besu, Nethermind or reth