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.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.
Key Components
The SDK is organized into focused components that handle different aspects of hybrid dApp functionality:TacSdk - Main Interface
TacSdk - Main Interface
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.
OperationTracker - Status Monitoring
OperationTracker - Status Monitoring
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.
Senders - Wallet Integration
Senders - Wallet Integration
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: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: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:- Full Signature
- Simple Name
- No Method Name
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:Error Handling
The SDK provides comprehensive error handling that protects user assets and provides meaningful feedback:- Pre-Transaction Validation
- Network Resilience
- Asset Protection
The SDK validates parameters, checks balances, and estimates gas costs
before submitting transactions, preventing common failure scenarios.