Skip to main content

linea_estimateGas RPC Method

Returns an estimated gas amount needed for the transaction to execute on Ethereum without adding it to the blockchain.

Updated on
Feb 24, 2026

Parameters

transaction
object
REQUIRED

The transaction call object:

from
string

The address from which the transaction is sent

to
string

The address to which the transaction is addressed

gas
string

The integer of gas provided for the transaction execution

gasPrice
string

The integer of gasPrice used for each paid gas encoded as hexadecimal

maxPriorityFeePerGas
string

The maximum fee, in wei, the sender is willing to pay per gas above the base fee

maxFeePerGas
string

The maximum total fee (base fee + priority fee), in wei, the sender is willing to pay per gas

value
string

The integer of value sent with this transaction encoded as hexadecimal

data
string

The hash of the method signature and encoded parameters. For more information, see the Contract ABI documentation.

stateOverride
object

(Optional) Address-to-state mapping to override account state before estimating gas. Each key is a 20-byte address; each value may include balance, nonce, code, and/or stateDiff fields.

balance
string

The fake balance to set for the account before executing the call

nonce
string

The fake nonce to set for the account before executing the call

code
string

The fake EVM bytecode to inject into the account before executing the call

stateDiff
object

The fake key-value mapping to override individual slots in the account storage before executing the call

Returns

gasLimit
string

The estimated maximum gas that the transaction may consume

baseFeePerGas
string

The minimum required fee per gas unit in the network

priorityFeePerGas
string

The suggested tip for miners to prioritize the transaction

Request
Response
1
{
2
"jsonrpc": "2.0",
3
"id": 1,
4
"result": {
5
"gasLimit": "0xd221",
6
"baseFeePerGas": "0x7",
7
"priorityFeePerGas": "0x245fe65"
8
}
9
}
1
{
2
"jsonrpc": "2.0",
3
"id": 1,
4
"result": {
5
"gasLimit": "0xd221",
6
"baseFeePerGas": "0x7",
7
"priorityFeePerGas": "0x245fe65"
8
}
9
}
Don't have an account yet?
Create your Quicknode endpoint in seconds and start building
Get started for free