Skip to main content
POST
eth_maxPriorityFeePerGas
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>"
}
Tempo API method that returns the current maximum priority fee per gas. This is the fee tip that goes to validators on top of the base fee.

Parameters

None.

Response

  • result — the current max priority fee per gas encoded as hexadecimal (in wei)

eth_maxPriorityFeePerGas code examples

const 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();

Body

application/json
jsonrpc
string
default:2.0
method
string
default:eth_maxPriorityFeePerGas
params
any[]
id
integer
default:1

Response

200 - application/json

The max priority fee per gas

jsonrpc
string
id
integer
result
string

The max priority fee per gas in wei encoded as hexadecimal