Contents

eth_estimateGas RPC method

Parameters:

  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.

Returns:

  1. Quantity - The estiamte amount of gas used.

Code Examples:

curl http://sample-endpoint-name.network.quiknode.pro/token-goes-here/ \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"method":"eth_estimateGas","params":[{"from":"0x8D97689C9818892B700e27F316cc3E41e17fBeb9","to":"0xd3CdA913deB6f67967B99D67aCDFa1712C293601","value":"0x186a0"}],"id":1,"jsonrpc":"2.0"}'
Ready to try QuickNode? Start your 7-day free trial