Chain used: Poylgon/mainnet or mumbai
I am trying to get gas fees for a contract call. I should be able to let user chose if : Medium or High
Same as metamask does it:
but this should be done on user side.
I tried the following code :
var gp = await signer.getGasPrice();
extra =Math.floor( gp / 2);
gas_price = firstTwoDigits ( Number(gp) + Number(extra));
I use it then like this:
var gasar = { gasLimit: 20000000, maxFeePerGas: gas_price, maxPriorityFeePerGas: gas_price}
// contract.callrow(arg1, gasar)
This is how i get a High priority gas fees. Looks like is not accurate at all.
How to get a better gas fees suggestion ?