Skip to main content
POST
/
api
/
v3
/
estimateFee
Estimate Fee
curl --request POST \
  --url https://toncenter.com/api/v3/estimateFee \
  --header 'Content-Type: application/json' \
  --data '
{
  "address": "<string>",
  "body": "<string>",
  "ignore_chksig": true,
  "init_code": "<string>",
  "init_data": "<string>"
}
'
{
  "destination_fees": [
    {
      "fwd_fee": 123,
      "gas_fee": 123,
      "in_fwd_fee": 123,
      "storage_fee": 123
    }
  ],
  "source_fees": {
    "fwd_fee": 123,
    "gas_fee": 123,
    "in_fwd_fee": 123,
    "storage_fee": 123
  }
}

SDK Usage

import asyncio

from toncenter.rest import ToncenterRestClient
from toncenter.types import Network
from toncenter.rest.v3.models import V2EstimateFeeRequest

ADDRESS = "UQCDrgGaI6gWK-qlyw69xWZosurGxrpRgIgSkVsgahUtxZR0"
BODY = "te6ccgEBAQEAAgAAAA=="


async def main() -> None:
    async with ToncenterRestClient(network=Network.MAINNET) as client:
        result = await client.v3.api_v2.estimate_fee(
            body=V2EstimateFeeRequest(address=ADDRESS, body=BODY),
        )
        print(result.model_dump_json(indent=4))


if __name__ == "__main__":
    asyncio.run(main())

Body

application/json
address
string
body
string
ignore_chksig
boolean
init_code
string
init_data
string

Response

OK

destination_fees
object[]
source_fees
object