starknet_estimateFee

Estimates the resources required by a given sequence of transactions when applied on a given state. If one of the transactions reverts or fails due to any reason (e.g., validation failure or an internal error), a TRANSACTION_EXECUTION_ERROR is returned. For v0-2 transactions the estimate is given in wei, and for v3 transactions it is given in fri.

Path parameters

apiKeystringRequiredDefaults to docs-demo

Request

This endpoint expects an object.
requestlist of objectsRequired
The transaction to estimate
simulation_flagslist of enumsRequired
Describes what parts of the transaction should be executed
Allowed values:
block_idobject or enumRequired

The hash of the requested block, or number (height) of the requested block, or a block tag, for the block referencing the state or call the transaction on.

Response

The fee estimations
gas_consumedstringformat: "^0x(0|[a-fA-F1-9]{1}[a-fA-F0-9]{0,62})$"
The Ethereum gas consumption of the transaction
gas_pricestringformat: "^0x(0|[a-fA-F1-9]{1}[a-fA-F0-9]{0,62})$"

The gas price (in wei or fri, depending on the tx version) that was used in the cost estimation

data_gas_consumedstringformat: "^0x(0|[a-fA-F1-9]{1}[a-fA-F0-9]{0,62})$"
The Ethereum data gas consumption of the transaction
data_gas_pricestringformat: "^0x(0|[a-fA-F1-9]{1}[a-fA-F0-9]{0,62})$"

The data gas price (in wei or fri, depending on the tx version) that was used in the cost estimation

overall_feestringformat: "^0x(0|[a-fA-F1-9]{1}[a-fA-F0-9]{0,62})$"

The estimated fee for the transaction (in wei or fri, depending on the tx version), equals to gas_consumed * gas_price + data_gas_consumed * data_gas_price

unitenum
Units in which the fee is given
Allowed values: