Open
Description
I think the current calculateGasPriceFromGasNow()
implementation make it hard to read the function or to change it for a new developer.
export async function calculateGasPriceFromGasNow() {
return BigNumber.from((await (await fetch(gasNowUrl)).json()).data.rapid)
.mul(Math.round(Number(process.env.GAS_PRICE_MULTIPLIER) * 100000000))
.div(100000000);
}
IMO make sense to separate and assign values to some variables.
E.g
const rapidGasNow = (await fetch(gasNowUrl)).json()).data.rapid;
const multipliedGasNow = rapidGasNow.mul(...);
...