Skip to main content
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.
Since Denim, Base produces a canonical block every 200ms and Flashblocks are retired. The "pending" tag is still accepted, but it no longer returns Flashblocks preconfirmation state. Use "latest" for the newest canonical state. See Migrate From Flashblocks.

Parameters

object
required
The transaction object to estimate gas for.
string
Block to estimate against. Optional; defaults to "latest".

Returns

string
The estimated gas amount as a hexadecimal integer.

Error Codes

Example