Skip to main content

Endpoints

NetworkURL
Mainnethttps://toncenter.com/api/v2
Testnethttps://testnet.toncenter.com/api/v2

SDK Usage

import asyncio

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

async def main() -> None:
    async with ToncenterRestClient(network=Network.MAINNET) as client:
        result = await client.v2.accounts.get_address_balance("EQDtFpEwcFAEcRe5mLVh2N6C0x-_hJEM7W61_JLnSF74p4q2")
        print(result)


if __name__ == "__main__":
    asyncio.run(main())
Resource groupProperty
Accountsclient.v2.accounts
Blocksclient.v2.blocks
Transactionsclient.v2.transactions
Sendclient.v2.send
Run Methodclient.v2.runmethod
Configurationclient.v2.configuration
Utilsclient.v2.utils
RPCclient.v2.rpc
Retries for 429 and 5xx are enabled by default with exponential backoff. See Reference for retry policy, rate limiting, and session management.

Errors

V2 API may return status codes 400, 401, 403, 404, 405, 409, 422, 429, 500, 504, and 542. See Reference for the full exception hierarchy, descriptions, and handling examples.