Ton.NET Documentation

Ton.NET is a comprehensive .NET SDK for building applications on the TON blockchain with 1:1 API compatibility with official TON JavaScript libraries.

Quick Start

dotnet add package Ton.Core
dotnet add package Ton.Crypto
dotnet add package Ton.LiteClient
using Ton.Crypto;
using Ton.Contracts.Wallets;
using Ton.LiteClient;

// Generate a new wallet
var mnemonic = Mnemonic.Generate();
var keyPair = Mnemonic.ToKeyPair(mnemonic);
var wallet = new WalletV4R2(keyPair.PublicKey);

// Connect to TON blockchain
var client = await LiteClientFactory.CreateFromUrlAsync(
    "https://ton.org/global-config.json");

// Check wallet balance
var info = await client.GetMasterchainInfoAsync();
var state = await client.GetAccountStateAsync(wallet.Address, info.Last);
Console.WriteLine($"Balance: {state.BalanceInTon} TON");

Modules

API Reference

Browse the complete API Reference for detailed documentation of all types and methods.