Skip to main content
Open the Quickstart guide to send your first cross-chain transaction and see the SDK in action.

TypeScript SDK on NPM

Build hybrid dApp using TypeScript with @tonappchain/sdk

Python SDK on PyPI

Build hybrid dApp using Python with tac-sdk

Installation

Install the TAC SDK using your preferred package manager:

Core Capabilities

The SDK provides four essential capabilities that make hybrid dApp development straightforward:
Code snippets below are written in TypeScript, but the same features are also available in Python.

1. TON Wallet Integration

The SDK handles all aspects of TON wallet connectivity through the standard TON Connect protocol (or mnemonic usage). Users can connect with popular wallets like Wallet and Tonkeeper without installing additional software or managing new seed phrases.

2. Cross-Chain Transaction Routing

Developers specify what they want to happen on the EVM side, and the SDK handles all the complex message formatting and routing through the TON Adapter.
Always send transactions on a Testnet first. Cross-chain transactions are irreversible once confirmed, and incorrect parameters can result in loss of funds.

3. Asset Bridging

Token transfers between TON and TAC EVM happen automatically on behalf on the TON Adapter. The SDK manages encoding calldata for locking the specific tokens on TON, and accessing the target EVM dApp method. Learn more about working with different types of assets in the Asset Bridging page.

4. Real-Time Status Tracking

The SDK provides comprehensive tools for monitoring cross-chain transactions, allowing applications to show users exactly what’s happening and when operations complete.

How It Works

The SDK acts as a bridge between your frontend application and TAC’s cross-chain infrastructure:

Developer Integration

Developers integrate the SDK into their frontend applications and specify EVM operations using familiar TypeScript/JavaScript patterns.

Message Preparation

The SDK formats cross-chain messages with proper encoding, handles asset preparation, and manages wallet interactions.

Simulation

Before each send cross-chain transaction call, simulation of the requested operation on TAC EVM is performed automatically, helping you identify any potential issues before actually sending anything.

Cross-Chain Routing

Messages are routed through the TON Adapter’s sequencer network, which validates and processes them securely.

EVM Execution

Target EVM contracts receive properly formatted calls with bridged assets, executing the requested operations.

Status Updates

The SDK monitors progress and provides real-time updates to the frontend, handling completion or failure scenarios.

Key Components

The SDK is organized into focused components that handle different aspects of hybrid dApp functionality:
The primary class that developers interact with for all cross-chain operations. It handles SDK initialization, transaction sending, token address mapping, and balance queries.Key features include sending cross-chain transactions, getting token addresses across chains, checking user balances, and managing SDK lifecycle.
Provides comprehensive tools for tracking cross-chain transaction status and progress. Applications can monitor operations in real-time and provide users with accurate updates.Supports both simplified status checking (Pending/Successful/Failed) and detailed stage-by-stage tracking for advanced use cases.
Handles transaction signing and submission through different wallet types. Supports TON Connect for web applications and raw private keys for backend services.Provides a unified interface regardless of the underlying wallet technology, simplifying application development.

Development Experience

The SDK is designed to feel familiar to web developers while providing powerful cross-chain capabilities:

Typification

The SDK provides comprehensive TypeScript definitions and Python type hints, enabling better development experience with IDE autocompletion and compile-time error checking.

Simulation

Built-in simulation capabilities help developers validate their integrations before transfer:

Testnet

Joint TON Testnet and TAC Testnet environment available for developers 24/7. Verify your DeFi flow from TON to TAC and vice versa as simply as creating your sdk instance in the Testnet mode:

Wait Options

Many SDK methods support optional wait parameters to control the time it takes for operations to complete:

Verification

Test your installation with a simple initialization:
Remember to always call await tacSdk.closeConnections() when your application shuts down to properly clean up network resources and prevent memory leaks.

Sender Factory

The SDK supports all standard TON wallet versions:
Batch Transaction Limits: Different wallet versions support different batch sizes when sending multiple transactions. V5R1 wallets can send up to 254 transactions per batch, while V4 and other standard wallets support up to 4 transactions per batch. Highload V3 wallets are optimized for large batch operations.

EVM Target Messages

Developers specify EVM operations using a unified structure for cross-chain delivery:
Use ethers or similar libraries to encode contract parameters and make sure the encoded parameters are valid tuples. Learn more about parameter encoding and decoding here.

Method Name Formatting

The SDK accepts flexible method name formats:

Asset Bridging

Tokens (native, FTs) and NFTs to transfer are specified using user-friendly amounts that the SDK automatically converts to the proper formats for each chain:

Configuration Options

The SDK accepts several configuration options during initialization:
Explore more options in the docs.

Error Handling

The SDK provides comprehensive error handling that protects user assets and provides meaningful feedback:
The SDK validates parameters, checks balances, and estimates gas costs before submitting transactions, preventing common failure scenarios.

Documentation

Comprehensive documentation with helpful examples is available on the SDK’s GitHub repositories:

TypeScript SDK Documentation

Python TAC SDK Documentation