Skip to main content

Documentation Index

Fetch the complete documentation index at: https://toncenter.ness.su/llms.txt

Use this file to discover all available pages before exploring further.

Read blockchain data, query smart contracts, send transactions, and subscribe to real-time events.

Installation

pip install toncenter
RequirementVersion
Python3.10+
aiohttp3.9+
pydantic2.4+

Quick Start

import asyncio

from toncenter.rest import ToncenterRestClient
from toncenter.types import Network
from toncenter.utils import to_amount


async def main() -> None:
    async with ToncenterRestClient(network=Network.MAINNET) as client:
        info = await client.v2.accounts.get_address_information(
            "EQDtFpEwcFAEcRe5mLVh2N6C0x-_hJEM7W61_JLnSF74p4q2"
        )
        print(f"Balance: {to_amount(int(info.balance))} TON")


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

More Examples

REST v2, REST v3, SSE, and WebSocket examples.

Explore

REST API

Query accounts, transactions, Jettons, NFTs via V2 liteserver and V3 indexed database.

Streaming

Real-time blockchain events over SSE and WebSocket.

AI Plugin

Query TON blockchain through natural language in Claude Code.

Utilities

Address conversion and amount formatting helpers.