curl --request POST \
--url https://monad-testnet.core.chainstack.com/9c5b265f20b3ea5df4f54f70eb74b800/ \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_gasPrice",
"params": []
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}curl --request POST \
--url https://monad-testnet.core.chainstack.com/9c5b265f20b3ea5df4f54f70eb74b800/ \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_gasPrice",
"params": []
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}Monad API method that returns the current gas price in wei. This value is determined by the network and represents the median gas price of recent blocks.Documentation Index
Fetch the complete documentation index at: https://chainstack-mintlify-flesh-empty-pages.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
noneresult — the current gas price in wei, encoded as hexadecimal.eth_gasPrice code examplesconst { ethers } = require("ethers");
const provider = new ethers.JsonRpcProvider("CHAINSTACK_NODE_URL");
async function getGasPrice() {
const feeData = await provider.getFeeData();
console.log(`Gas price: ${ethers.formatUnits(feeData.gasPrice, "gwei")} gwei`);
}
getGasPrice();
eth_gasPrice is calculating transaction costs before sending transactions, allowing users to see estimated fees in their wallet or DApp interface.Was this page helpful?