Skip to content

setMinGasPrice

Change the minimum gas price accepted by the network (in wei).

Note: setMinGasPrice can only be used on clients that do not have EIP-1559 enabled.

Usage

import { parseGwei } from 'viem'
import { testClient } from './client'
 
await testClient.setMinGasPrice({ 
  gasPrice: parseGwei('20'),
})

Parameters

gasPrice

  • Type: bigint

The gas price (in wei).

await testClient.setMinGasPrice({
  gasPrice: parseGwei('20'), 
})