Skip to content
On this page

getGasPrice

Returns the current price of gas (in wei).

Import

ts
import { getGasPrice } from 'viem'

Usage

ts
import { getGasPrice } from 'viem'
import { publicClient } from '.'
 
const gasPrice = await getGasPrice(publicClient) 

Returns

bigint

The gas price (in wei).

Released under the MIT License.