eth_maxPriorityFeePerGas

Generally you will use the value returned from this method to set the maxFeePerGas in a subsequent transaction that you are submitting. This method was introduced with EIP 1559.

Parameters

None

Returns

  1. string - The hex value of the priority fee needed to be included in a block

Example

NOTE: In this example we are using public Ethereum endpoint. Ideally, for your own projects, you should use your own endpoint, which you can generate for free by connecting to your wallet here.

Query

NOTE: ethers used below is a well-known web3 library, check it out here.

import { ethers } from 'ethers';

const provider =
  new ethers
    .providers
    .JsonRpcProvider("https://www.noderpc.xyz/rpc-mainnet/public")

const info = async ()=> {
  const result = await provider.send("eth_maxPriorityFeePerGas", []);
  console.log(result);
}
info();

Result

0x5f5e100

Last updated