Help instance Help

TON SDK — Overview

TON SDK is a modular SDK for building applications on The Open Network (TON). It offers first‑class support for Kotlin and Java on the JVM/Android, and can be consumed from Swift on iOS via Kotlin Multiplatform. It provides the core data structures (Cells/BOC), TL‑B codecs, crypto primitives, networking stacks (ADNL/RLDP), and high‑level APIs (contracts, lite client) so you can integrate TON from server, desktop, Android, or iOS with one codebase.

This document explains the SDK at a high level: what it is, how it is organized, and when to use each module. For hands‑on guides and API details, see the other topics in this documentation set.

What is TON SDK?

A collection of modular libraries published on Maven Central under the org.ton.sdk group. Each module focuses on a well‑defined layer of the TON stack, from low‑level binary formats up to ready‑to‑use APIs.

Key features

  • Kotlin Multiplatform first: shared code for JVM, Android, and other targets.

  • Zero‑dependency core for critical primitives (Cells, BOC, TL‑B).

  • TL‑B serialization/deserialization with code‑generated schemas for blockchain objects.

  • Networking layers for TON (ADNL, RLDP) and a Lite Client API.

  • Contract utilities to work with smart‑contracts from Kotlin.

  • Carefully tested with cross‑platform test suites.

Module map (current)

  • ton-sdk-blockchain — Core blockchain primitives such as Address, BlockId, Transaction, Message, etc.

  • ton-sdk-crypto — ED25519, SHA, CRC, and related crypto utilities.

  • ton-sdk-tl — Type Language (TL) serializer for kotlinx-serialization used in network protocols and more.

  • ton-sdk-cell — The fundamental immutable binary structure in TON used by TVM; also includes the BOC (Bag of Cells) container format.

  • ton-sdk-liteapi-client — LiteAPI (LiteClient) for RPC, requests unindexed data from blockchain nodes via LiteServer.

  • ton-sdk-toncenter-client — HTTP RPC client for TonCenter V3 (Indexed) and TonCenter V2 (Unindexed).

  • ton-sdk-dict — TVM Dictionary built on top of Cells.

  • ton-sdk-bitstring — Small module for BitStrings (used by Cells and for byte-level serialization).

  • ton-sdk-bigint — Cross‑platform big integer; on JVM it aliases java.math.BigInteger, with platform implementations elsewhere.

Note: Artifact coordinates in Maven Central may use org.ton.kotlin with module names like ton-kotlin-*. Refer to the README for the latest coordinates and versions.

Typical use cases

  • Indexers and backends that need to parse blocks/transactions and verify proofs.

  • Wallets and apps that compose and serialize messages and contracts.

  • Services querying blockchain data via the Lite Client or TON Center http client.

  • Tooling and middleware that rely on TL‑B codecs and BOC manipulation.

Installation

Add TON SDK modules from Maven Central. Use the coordinates under the org.ton.sdk group. Keep module versions aligned (e.g., 0.6.0).

<dependencies> <dependency> <groupId>org.ton.sdk</groupId> <artifactId>ton-sdk-toncenter-client-jvm</artifactId> <version>0.6.0-SNAPSHOT</version> </dependency> <dependency> <groupId>io.ktor</groupId> <artifactId>ktor-client-java-jvm</artifactId> <version>3.3.1</version> </dependency> </dependencies>
dependencies { api("org.ton.sdk:ton-sdk-toncenter-client:0.6.0-SNAPSHOT") }

Quick start

Add the artifacts you need from Maven Central and start from the level that fits your use case.

public static void main(String[] args) throws ExecutionException, InterruptedException { // create TON Center v3 http client TonCenterV3Client client = TonCenterV3Client.create(); // Get 10 last transactions for account Future<TonCenterTransactionsResponse> response = client.transactionsAsync( new TonCenterTransactionsRequestBuilder() .address(AddressStd.parse("UQAKtVj024T9MfYaJzU1xnDAkf_GGbHNu-V2mgvyjTuP6uYH")) .limit(10) ); // Print transactions info and balance after transaction for (TonCenterTransaction transaction : response.get().transactions()) { Coins balance = transaction.accountStateAfter().balance(); BigInteger value = BigInteger.ZERO; if (balance != null) { value = balance.value(); } System.out.println("hash="+transaction.hash()+" lt="+transaction.lt()+" balance="+value); } }
@JvmStatic fun main(args: Array<String>) = runBlocking { // create TON Center v3 http client val client: TonCenterV3Client = TonCenterV3Client.create() // Get 10 last transactions for account val response: Deferred<TonCenterTransactionsResponse> = GlobalScope.async { client.transactions { account += AddressStd.parse("UQAKtVj024T9MfYaJzU1xnDAkf_GGbHNu-V2mgvyjTuP6uYH") limit = 10 } } // Print transactions info and balance after transaction response.await().transactions.forEach { transaction -> val balance = transaction.accountStateAfter.balance val value = balance?.value ?: 0.toBigInt() println("hash=${transaction.hash} lt=${transaction.lt} balance=$value") } }

See examples/ and tests in the repository for more scenarios.

Supported platforms

  • JVM / Android — Kotlin and Java (first‑class)

  • iOS — Swift via Kotlin Multiplatform bindings (availability may vary by module)

  • Desktop/Server — JVM (JDK 8+)

  • Other Kotlin targets may be available per‑module; check each module’s README or Gradle metadata.

Where to go next

  • Project README: architecture, badges, and links

  • Wiki/Docs: deeper guides and API references

  • Examples directory: runnable samples

  • Telegram chat: community support and announcements

27 October 2025