eth_estimateGas method calculates the amount of gas required to execute a transaction. This estimation is done without sending the transaction to the network. It’s important to note that the actual gas used by the transaction may differ from the estimate due to the dynamic nature of Ronin transactions and block inclusion.
Get you own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.
Parameters
transaction: An object containing transaction fields, including:from(optional): The address the transaction is sent from.to: The address the transaction is directed to.- Additional fields such as
value,data, andgasPricecan also be included for a more accurate estimate.
blockParameter(optional): A string representing the block number (in hexadecimal) or one of the strings “latest”, “earliest”, or “pending”. This parameter determines the state against which the transaction is estimated.
Response
result: The estimated amount of gas required to execute the transaction, returned as a hexadecimal number.