eth_estimateGas

Generates and returns an estimate of how much gas is necessary to allow the transaction to complete.

linea_estimateGas uses the same inputs as the standard eth_estimateGas, but returns the recommended gas limit, the base fee per gas, and the priority fee per gas. We recommend using linea_estimateGas for more accurate results.

Path parameters

apiKeystringRequiredDefaults to docs-demo

Request

This endpoint expects an object.
TransactionobjectRequired
The transaction object for which to estimate gas usage.
Blockstring or enumOptional

The block number or tag at which to estimate gas usage. Defaults to 'latest' if not provided.

Response

The estimated amount of gas required for the transaction, as a hexadecimal string.