Skip to main content
POST
starknet_estimateMessageFee
Starknet OpenRPC specFor the latest version of the publicly maintained OpenRPC spec, see the Starknet specs GitHub repo.
Starknet API method that returns the fee estimate for an L1 to L2 message, which is a message that an Ethereum contract sends to a Starknet contract. The estimate covers the l1_handler transaction that the message triggers on Starknet. You pay this fee on Ethereum when you send the message through the Starknet core contract. The returned overall_fee is at least 50,000,000,000,000 wei (0.00005 ETH).
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • message — the L1 to L2 message to estimate, with the following fields:
    • from_address — the address of the Ethereum contract that sends the message.
    • to_address — the address of the Starknet contract that receives the message.
    • entry_point_selector — the selector of the l1_handler function in the receiving contract.
    • payload — the message payload as an array of field elements.
  • block_id — 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

  • result — the fee estimate, with the following fields. Numeric values are hexadecimal strings.
    • l1_gas_consumed — the Ethereum gas the message consumes.
    • l1_gas_price — the Ethereum gas price used in the estimate, in wei.
    • l2_gas_consumed — the Starknet gas the message consumes.
    • l2_gas_price — the Starknet gas price used in the estimate, in wei.
    • l1_data_gas_consumed — the Ethereum data gas the message consumes.
    • l1_data_gas_price — the Ethereum data gas price used in the estimate, in wei.
    • overall_fee — the fee for the message, in wei. The value is at least 50,000,000,000,000 wei (0.00005 ETH). When the gas amounts multiplied by their prices add up to less than that, overall_fee is exactly 50,000,000,000,000 wei.
    • unit — the fee unit, always WEI.

Use case

A practical use case for starknet_estimateMessageFee is to set the fee for a message that you send from Ethereum to Starknet. The message fee is the ETH value sent with the sendMessageToL2 call to the Starknet core contract, so pass the returned overall_fee as that value.

Deprecated feeder gateway method

The feeder gateway was deprecated on December 11, 2023. Example of the call you had to make to the feeder gateway before the deprecation:
Shell

Body

application/json
id
integer
jsonrpc
string
method
string
params
object[]

Response

200

Successful response

Last modified on October 8, 2026