Returns an estimate of how much gas is required to execute a transaction. The estimate may be larger than the gas actually used at execution time.Documentation Index
Fetch the complete documentation index at: https://base-a060aa97-meyer9-discv5-p2p-protocol-id.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Parameters
The transaction object to estimate gas for.
Block to estimate against. Optional; defaults to
"latest". Use "pending" on a Flashblocks endpoint to estimate against pre-confirmed state.Returns
The estimated gas amount as a hexadecimal integer.
Error Codes
| Code | Message | Description |
|---|---|---|
-32000 | execution reverted | The transaction would revert. The error data field may contain a revert reason. |