eth_getUncleByBlockNumberAndIndex - Optimism
Example code for the eth_getUncleByBlockNumberAndIndex json-rpc method. Сomplete guide on how to use eth_getUncleByBlockNumberAndIndex json-rpc in GetBlock.io Web3 documentation.
Parameters
Parameter
Type
Description
Required
Request
curl --location 'https://shared.us-east-1.getblock.io/<ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_getUncleByBlockHashAndIndex",
"params": ["latest", "0x0"],
"id": "getblock.io"
}'import axios from 'axios'
let data = JSON.stringify({
"jsonrpc": "2.0",
"method": "eth_getUncleByBlockHashAndIndex",
"params": ["latest", "0x0"],
"id": "getblock.io"
};
let config = {
method: "post",
maxBodyLength: Infinity,
url: "https://shared.us-east-1.getblock.io/<ACCESS_TOKEN>",
headers: {
"Content-Type": "application/json",
},
data: data,
};
axios
.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Response
{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": null
}Response Parameters
Use Case
Error handling
Status Code
Error Message
Cause
Last updated
Was this helpful?