Skip to main content

getGasPrice

Callable


  • Type parameters

    Parameters

    Returns Promise<NumberTypes[ReturnFormat[number]]>

    The gas price determined by the last few blocks median gas price.

    web3.eth.getGasPrice().then(console.log);
    > 20000000000n

    web3.eth.getGasPrice({ number: FMT_NUMBER.HEX , bytes: FMT_BYTES.HEX }).then(console.log);
    > "0x4a817c800"