eth_estimateGas
Estimate gas costs for Ethereum transactions before execution to optimize fees and prevent failed transactions due to insufficient gas.
Instructions
Generates and returns an estimate of how much gas is necessary
Input Schema
Name | Required | Description | Default |
---|---|---|---|
data | No | Data to send (hex string) | |
from | No | From address | |
gas | No | Gas limit | |
gasPrice | No | Gas price | |
to | No | Contract address (optional for contract creation) | |
value | No | Value in wei |
Input Schema (JSON Schema)
{
"properties": {
"data": {
"description": "Data to send (hex string)",
"type": "string"
},
"from": {
"description": "From address",
"type": "string"
},
"gas": {
"description": "Gas limit",
"type": "string"
},
"gasPrice": {
"description": "Gas price",
"type": "string"
},
"to": {
"description": "Contract address (optional for contract creation)",
"type": "string"
},
"value": {
"description": "Value in wei",
"type": "string"
}
},
"type": "object"
}