eth_estimateGas
Generates and returns an estimate of how much gas is necessary to allow the transaction to complete.
Params
(2)1. block (required)
Quantity
(any of)
string<hex>
2. tx (required)
accessList
anychainId
anydata
anyfrom
anygas
anyinput
anymaxFeePerGas
string or null
maxPriorityFeePerGas
string or null
nonce
anyto
anyvalue
anyResult
(Quantity)string<hex>
Example
Request
await window.ethereum.request({
"method": "eth_estimateGas",
"params": [
{
"accessList": null,
"chainId": null,
"data": null,
"from": null,
"gas": null,
"input": null,
"maxFeePerGas": "0x0",
"maxPriorityFeePerGas": "0x0",
"nonce": null,
"to": null,
"value": null
}
]
});
Result
null