eth_getUncleByBlockHashAndIndex - Optimism
Example code for the eth_getUncleByBlockHashAndIndex json-rpc method. Сomplete guide on how to use eth_getUncleByBlockHashAndIndex json-rpc in GetBlock.io Web3 documentation.
Parameters
Parameter
Type
Description
Required
Request Sample
curl --location 'https://go.getblock.us/<ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_getUncleByBlockHashAndIndex",
"params": [
"0x1648eed8c4befcf5a1e517bf07302bf4ab3ba61fb6a8669a506e0ba5784ae0f2",
"0x0"
],
"id": "getblock.io"
}'import axios from 'axios'
let data = JSON.stringify({
"jsonrpc": "2.0",
"method": "eth_getUncleByBlockHashAndIndex",
"params": [
"0x1648eed8c4befcf5a1e517bf07302bf4ab3ba61fb6a8669a506e0ba5784ae0f2",
"0x0"
],
"id": "getblock.io"
};
let config = {
method: "post",
maxBodyLength: Infinity,
url: "https://go.getblock.us/<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
Response Parameters
Use Case
Error handling
Status Code
Error Message
Cause
Last updated
Was this helpful?