curl --request POST \
--url https://rpc.testnet.tempo.xyz/ \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "eth_maxPriorityFeePerGas",
"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_maxPriorityFeePerGas",
"params": [],
"id": 1
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}result — the current max priority fee per gas encoded as hexadecimal (in wei)eth_maxPriorityFeePerGas code examplesconst ethers = require('ethers');
const NODE_URL = "CHAINSTACK_NODE_URL";
const provider = new ethers.JsonRpcProvider(NODE_URL);
const getMaxPriorityFee = async () => {
const feeData = await provider.getFeeData();
console.log(`Max Priority Fee: ${ethers.formatUnits(feeData.maxPriorityFeePerGas, "gwei")} gwei`);
// Or using raw RPC
const maxPriorityFee = await provider.send("eth_maxPriorityFeePerGas", []);
console.log(`Raw response: ${maxPriorityFee}`);
console.log(`In gwei: ${ethers.formatUnits(maxPriorityFee, "gwei")}`);
};
getMaxPriorityFee();
Was this page helpful?