TON blockchain HTTP client library for .NET - Toncenter API v2/v4, wallet contracts (V1-V5), jettons, multisig. 1:1 API compatibility with @ton/ton JavaScript library.
$ dotnet add package Ton.HttpClient
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.
| Package | Version | Description |
|---|---|---|
| Ton.Core | Core primitives: Cells, BOC, Addresses, Types | |
| Ton.Crypto |
| Ed25519, Mnemonics (BIP39), SHA, HMAC |
| Ton.Contracts | Smart contracts: Wallets V5R1 |
| Ton.LiteClient | ADNL protocol for direct node communication |
| Ton.HttpClient | HTTP API clients (Toncenter v2/v4) |
Install packages:
dotnet add package Ton.LiteClientCreate 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");dotnet testTest Coverage:
Total: 553 passing tests
All tests validate compatibility with TON JavaScript SDK behavior.
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
Check out the /samples directory:
Contributions are welcome! This project aims for API compatibility with the TON JavaScript SDK.
MIT License - see LICENSE file for details.
Made with ❤️ for the TON community