Ton.LiteClient
0.2.5
See the version list below for details.
dotnet add package Ton.LiteClient --version 0.2.5
NuGet\Install-Package Ton.LiteClient -Version 0.2.5
<PackageReference Include="Ton.LiteClient" Version="0.2.5" />
<PackageVersion Include="Ton.LiteClient" Version="0.2.5" />
<PackageReference Include="Ton.LiteClient" />
paket add Ton.LiteClient --version 0.2.5
#r "nuget: Ton.LiteClient, 0.2.5"
#:package Ton.LiteClient@0.2.5
#addin nuget:?package=Ton.LiteClient&version=0.2.5
#tool nuget:?package=Ton.LiteClient&version=0.2.5
Ton.NET
A modern, comprehensive .NET SDK for the TON (The Open Network) blockchain. Built from scratch with clean architecture, targeting compatibility with the official TON JavaScript SDK.
โจ Features
- ๐ฏ API compatibility with TON JavaScript SDK
- ๐ Type-safe primitives and TL-B structures
- ๐งช 553+ tests with comprehensive coverage
- ๐ฆ Modular architecture - use only what you need
- ๐ Production-ready with .NET 8 & 9 support
- ๐ Complete documentation with examples
๐ฆ Packages
๐ Quick Start
Install packages:
dotnet add package Ton.LiteClient
Create a wallet and check balance:
using Ton.Crypto.Mnemonic;
using Ton.Contracts.Wallets.V5;
using Ton.LiteClient;
// Generate mnemonic
var mnemonic = Mnemonic.New(24);
var keys = Mnemonic.ToWalletKey(mnemonic);
// Create wallet
var wallet = new WalletV5R1(keys.PublicKey);
Console.WriteLine($"Address: {wallet.Address}");
// Connect to blockchain
var client = await LiteClientFactory.CreateFromUrlAsync(
"https://ton.org/global-config.json"
);
// Get balance
var info = await client.GetMasterchainInfoAsync();
var state = await client.GetAccountStateAsync(wallet.Address, info.Last);
Console.WriteLine($"Balance: {state.BalanceInTon} TON");
๐ Documentation
Getting Started
- Installation - Setup and requirements
- First Steps - Basic operations
- Key Concepts - TON fundamentals
Modules
- LiteClient - Direct blockchain queries via ADNL
- HttpClient - HTTP API access
- Core - Cells, Addresses, Types
- Crypto - Cryptography primitives
- Contracts - Wallet operations
Guides
- Common Tasks - Practical examples and patterns
API Reference
- API Documentation - Complete API reference
๐งช Testing
dotnet test
Test Coverage:
- 298 Core tests (BOC, TL-B, Dictionaries, Addresses)
- 47 Crypto tests (Mnemonics, Ed25519, Hashing)
- 41 Contracts tests (Wallets)
- 156 ADNL tests (Protocol, Serialization, Crypto)
- 11 LiteClient tests (Integration)
Total: 553 passing tests
All tests validate compatibility with TON JavaScript SDK behavior.
๐๏ธ Architecture
Ton.LiteClient โ High-level blockchain queries (ADNL protocol)
โโโ Ton.Adnl โ Low-level ADNL protocol
โโโ Ton.Core โ Core primitives (Cell, Address, BOC)
โโโ Ton.Crypto โ Cryptographic operations
Ton.HttpClient โ HTTP API client (Toncenter v2/v4)
โโโ Ton.Core
โโโ Ton.Crypto
Ton.Contracts โ Smart contract implementations
โโโ Ton.Core
โโโ Ton.Crypto
Key Design Principles
- Type Safety - Nullable reference types, records, pattern matching
- Zero External Dependencies - Only System.Text.Json for HTTP clients
- Performance - Efficient cell serialization and hashing
- Compatibility - 1:1 API compatibility with TON JS SDK
- Testability - Comprehensive test coverage
๐ ๏ธ Development
Requirements
- .NET 8.0 or .NET 9.0
- C# 12 language features
Samples
Check out the /samples directory:
- LiteClientPlayground - LiteClient usage examples
- AdnlSample - Low-level ADNL protocol examples
๐ค Contributing
Contributions are welcome! This project aims for API compatibility with the TON JavaScript SDK.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
๐ License
MIT License - see LICENSE file for details.
๐ Resources
Official TON
Community
Ton.NET
Made with โค๏ธ for the TON community
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- System.Threading.RateLimiting (>= 9.0.0)
- Ton.Adnl (>= 0.2.5)
- Ton.Core (>= 0.2.5)
-
net9.0
- System.Threading.RateLimiting (>= 9.0.0)
- Ton.Adnl (>= 0.2.5)
- Ton.Core (>= 0.2.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.