eth_estimateGas RPC method


  1. Object - Transaction object, where from field is optional and nonce field is ommited.
  2. Quantity or Tag - (optional) Integer block number, or the string 'latest', 'earliest' or 'pending', see the default block parameter.


  1. Quantity - The estimated amount of gas used.

Code Examples:

require 'ethereum.rb'
client ='')
blockNumber = client.eth_estimate_gas({"from":"0x8D97689C9818892B700e27F316cc3E41e17fBeb9","to":"0xd3CdA913deB6f67967B99D67aCDFa1712C293601","value":"0x186a0"})
puts blockNumber["result"].to_i(16)
Ready to try QuickNode? Start your 7-day free trial