eth_estimateGas
Estimate the gas required for an Ethereum transaction by providing sender, recipient, and value in wei, without broadcasting. Supports mainnet and testnets like sepolia.
Instructions
Estimate the gas required to execute a transaction without broadcasting it.
Args:
from (string): Sender address (20-byte hex, e.g., '0x...').
to (string): Recipient address (20-byte hex, e.g., '0x...').
value (string): Amount to send in wei as hex (e.g., '0xde0b6b3a7640000' for 1 ETH).
network (string, optional): Ethereum network to query. Defaults to 'mainnet'.
Returns:
Hexadecimal string representing estimated gas units (e.g., '0x5208' for 21000 gas).
Examples:
"Estimate ETH transfer": { "from": "0xYourAddress", "to": "0xRecipient", "value": "0xde0b6b3a7640000" }
"Estimate on Sepolia": { "from": "0x...", "to": "0x...", "value": "0x0", "network": "sepolia" }
Errors:
InvalidParams: When address format or value format is invalid.
InternalError: When transaction would revert or Infura API fails.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | Yes | The address from which the transaction is sent. | |
| to | Yes | The address to which the transaction is sent. | |
| value | Yes | The amount of Ether to send (in wei). | |
| network | No | The Ethereum network to query, e.g., 'mainnet' or 'sepolia'. | mainnet |
| response_format | No | Output format: 'json' for structured data, 'markdown' for human-readable. | json |