eth_estimateGas - Arbitrum
Example code for the eth_estimateGas JSON RPC method. Сomplete guide on how to use eth_estimateGas JSON RPC in GetBlock Web3 documentation.
Parameters
Field
Type
Required
Description
Request
curl --location 'https://go.getblock.us/<ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_estimateGas",
"id": "getblock.io",
"params": [
{
"from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"to": "0x44aa93095d6749a706051658b970b941c72c1d53",
"value": "0x1"
}
],
}'import axios from 'axios'
let data = JSON.stringify({
"jsonrpc": "2.0",
"method": "eth_estimateGas",
"id": "getblock.io",
"params": [
{
"from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"to": "0x44aa93095d6749a706051658b970b941c72c1d53",
"value": "0x1"
}
],
};
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
Reponse Parameter Definition
Field
Type
Description
Use case
Error handling
Status Code
Error Message
Cause
Integration with Web3
Last updated
Was this helpful?