curl --request POST \
--url https://rpc.testnet.tempo.xyz/ \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "eth_gasPrice",
"params": [],
"id": 1
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}curl --request POST \
--url https://rpc.testnet.tempo.xyz/ \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "eth_gasPrice",
"params": [],
"id": 1
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}noneresult — the current gas price in wei encoded as hexadecimaleth_gasPrice code examplesconst Web3 = require("web3");
const NODE_URL = "CHAINSTACK_NODE_URL";
const web3 = new Web3(NODE_URL);
async function getGasPrice() {
const gasPrice = await web3.eth.getGasPrice();
console.log(`Gas price: ${gasPrice} wei`);
}
getGasPrice()
Was this page helpful?