Marketplace has launched, further enabling blockchain developers! Learn more

Contents

eth_gasPrice RPC method

The eth_gasPrice EVM method is only supported on the Avalanche C-Chain.

Parameters:

  1. None

Returns:

  1. Result - Integer value of current gas price in wei.

Code Examples:

To use the eth_gasPrice EVM method on the Avalanche C-Chain, ensure that the end of your URL includes ext/bc/C/rpc.

require 'ethereum.rb'
client = Ethereum::HttpClient.new('http://sample-endpoint-name.network.quiknode.pro/token-goes-here/')
gasPrice = client.eth_gas_price
puts gasPrice["result"].to_i(16)
Ready to get started? Create a free account