estimateFee method estimates the fee required to send a message to the TON blockchain. This method allows you to calculate expected transaction costs before actually sending the transaction.
Start 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.
There’s no difference between a full node an archive node in data availability or pricing. All data is always available and all node requests are consumed as 1 request unit.
Request body
address(string, required) — The address to send the message from. Example:EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs.body(string, required) — The body of the message in base64 format.init_code(string, optional) — The init code in base64 format. Required when deploying a new contract.init_data(string, optional) — The init data in base64 format. Required when deploying a new contract.ignore_chksig(boolean, optional) — Whether to ignore the signature check. Set totruewhen estimating fees without a valid signature. Default:true.
JSON-RPC
Response
-
ok(boolean) — Whether the operation was successful. -
result(object) — The result of the operation. Contains:@type(string) — The type of the result, typicallyquery.fees.source_fees(object) — The fees charged to the source account:in_fwd_fee(integer) — The incoming forward fee in nanotons.storage_fee(integer) — The storage fee in nanotons.gas_fee(integer) — The gas fee in nanotons.fwd_fee(integer) — The forward fee in nanotons.
destination_fees(array) — Array of fee objects for destination accounts (for multi-hop messages).@extra(string) — Extra information about the operation.
Use case
TheestimateFee method is essential for applications that need to calculate transaction costs:
- Wallet applications can display estimated fees to users before they confirm transactions.
- Smart contract developers can estimate deployment costs before deploying contracts.
- DApps can optimize transaction parameters to minimize fees.
- Trading bots can factor in transaction costs when calculating profitability.
- Payment services can include accurate fee estimates in invoices.
Body
application/json
The address to send the message from
The body of the message in base64 format
Optional init code in base64 format for contract deployment
Optional init data in base64 format for contract deployment
Whether to ignore the signature check