estimateFee
curl --request POST \
--url https://ton-mainnet.core.chainstack.com/f2a2411bce1e54a2658f2710cd7969c3/api/v2/estimateFee \
--header 'Content-Type: application/json' \
--data '
{
"address": "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs",
"body": "te6cckEBAQEAAgAAAEysuc0=",
"init_code": "<string>",
"init_data": "<string>",
"ignore_chksig": true
}
'import requests
url = "https://ton-mainnet.core.chainstack.com/f2a2411bce1e54a2658f2710cd7969c3/api/v2/estimateFee"
payload = {
"address": "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs",
"body": "te6cckEBAQEAAgAAAEysuc0=",
"init_code": "<string>",
"init_data": "<string>",
"ignore_chksig": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
address: 'EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs',
body: JSON.stringify('te6cckEBAQEAAgAAAEysuc0='),
init_code: '<string>',
init_data: '<string>',
ignore_chksig: true
})
};
fetch('https://ton-mainnet.core.chainstack.com/f2a2411bce1e54a2658f2710cd7969c3/api/v2/estimateFee', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ton-mainnet.core.chainstack.com/f2a2411bce1e54a2658f2710cd7969c3/api/v2/estimateFee",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'address' => 'EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs',
'body' => 'te6cckEBAQEAAgAAAEysuc0=',
'init_code' => '<string>',
'init_data' => '<string>',
'ignore_chksig' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ton-mainnet.core.chainstack.com/f2a2411bce1e54a2658f2710cd7969c3/api/v2/estimateFee"
payload := strings.NewReader("{\n \"address\": \"EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs\",\n \"body\": \"te6cckEBAQEAAgAAAEysuc0=\",\n \"init_code\": \"<string>\",\n \"init_data\": \"<string>\",\n \"ignore_chksig\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://ton-mainnet.core.chainstack.com/f2a2411bce1e54a2658f2710cd7969c3/api/v2/estimateFee")
.header("Content-Type", "application/json")
.body("{\n \"address\": \"EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs\",\n \"body\": \"te6cckEBAQEAAgAAAEysuc0=\",\n \"init_code\": \"<string>\",\n \"init_data\": \"<string>\",\n \"ignore_chksig\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ton-mainnet.core.chainstack.com/f2a2411bce1e54a2658f2710cd7969c3/api/v2/estimateFee")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"address\": \"EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs\",\n \"body\": \"te6cckEBAQEAAgAAAEysuc0=\",\n \"init_code\": \"<string>\",\n \"init_data\": \"<string>\",\n \"ignore_chksig\": true\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"result": {
"@type": "<string>",
"source_fees": {
"@type": "<string>",
"in_fwd_fee": 123,
"storage_fee": 123,
"gas_fee": 123,
"fwd_fee": 123
},
"destination_fees": [
{}
],
"@extra": "<string>"
}
}TON node API
estimateFee | TON v2
The estimateFee method estimates the fee required to send a message to the TON blockchain. Available on TON v2 via Chainstack JSON-RPC nodes.
POST
/
estimateFee
estimateFee
curl --request POST \
--url https://ton-mainnet.core.chainstack.com/f2a2411bce1e54a2658f2710cd7969c3/api/v2/estimateFee \
--header 'Content-Type: application/json' \
--data '
{
"address": "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs",
"body": "te6cckEBAQEAAgAAAEysuc0=",
"init_code": "<string>",
"init_data": "<string>",
"ignore_chksig": true
}
'import requests
url = "https://ton-mainnet.core.chainstack.com/f2a2411bce1e54a2658f2710cd7969c3/api/v2/estimateFee"
payload = {
"address": "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs",
"body": "te6cckEBAQEAAgAAAEysuc0=",
"init_code": "<string>",
"init_data": "<string>",
"ignore_chksig": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
address: 'EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs',
body: JSON.stringify('te6cckEBAQEAAgAAAEysuc0='),
init_code: '<string>',
init_data: '<string>',
ignore_chksig: true
})
};
fetch('https://ton-mainnet.core.chainstack.com/f2a2411bce1e54a2658f2710cd7969c3/api/v2/estimateFee', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ton-mainnet.core.chainstack.com/f2a2411bce1e54a2658f2710cd7969c3/api/v2/estimateFee",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'address' => 'EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs',
'body' => 'te6cckEBAQEAAgAAAEysuc0=',
'init_code' => '<string>',
'init_data' => '<string>',
'ignore_chksig' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ton-mainnet.core.chainstack.com/f2a2411bce1e54a2658f2710cd7969c3/api/v2/estimateFee"
payload := strings.NewReader("{\n \"address\": \"EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs\",\n \"body\": \"te6cckEBAQEAAgAAAEysuc0=\",\n \"init_code\": \"<string>\",\n \"init_data\": \"<string>\",\n \"ignore_chksig\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://ton-mainnet.core.chainstack.com/f2a2411bce1e54a2658f2710cd7969c3/api/v2/estimateFee")
.header("Content-Type", "application/json")
.body("{\n \"address\": \"EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs\",\n \"body\": \"te6cckEBAQEAAgAAAEysuc0=\",\n \"init_code\": \"<string>\",\n \"init_data\": \"<string>\",\n \"ignore_chksig\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ton-mainnet.core.chainstack.com/f2a2411bce1e54a2658f2710cd7969c3/api/v2/estimateFee")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"address\": \"EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs\",\n \"body\": \"te6cckEBAQEAAgAAAEysuc0=\",\n \"init_code\": \"<string>\",\n \"init_data\": \"<string>\",\n \"ignore_chksig\": true\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"result": {
"@type": "<string>",
"source_fees": {
"@type": "<string>",
"in_fwd_fee": 123,
"storage_fee": 123,
"gas_fee": 123,
"fwd_fee": 123
},
"destination_fees": [
{}
],
"@extra": "<string>"
}
}The
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
curl -X POST \
'https://ton-mainnet.core.chainstack.com/f2a2411bce1e54a2658f2710cd7969c3/api/v2/jsonRPC' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "estimateFee",
"params": {
"address": "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs",
"body": "te6cckEBAQEAAgAAAEysuc0=",
"ignore_chksig": true
}
}'
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.
curl -X 'POST' \
'https://ton-mainnet.core.chainstack.com/f2a2411bce1e54a2658f2710cd7969c3/api/v2/estimateFee' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"address": "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs",
"body": "te6cckEBAQEAAgAAAEysuc0=",
"ignore_chksig": true
}'
The total fee is approximately the sum of
in_fwd_fee, storage_fee, gas_fee, and fwd_fee. However, actual fees may vary slightly due to network conditions.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
Last modified on June 22, 2026
Was this page helpful?