![]() |
VOOZH | about |
dotnet add package Dzeta.TonSdk.Core.EntityFrameworkCore --version 0.2.0
NuGet\Install-Package Dzeta.TonSdk.Core.EntityFrameworkCore -Version 0.2.0
<PackageReference Include="Dzeta.TonSdk.Core.EntityFrameworkCore" Version="0.2.0" />
<PackageVersion Include="Dzeta.TonSdk.Core.EntityFrameworkCore" Version="0.2.0" />Directory.Packages.props
<PackageReference Include="Dzeta.TonSdk.Core.EntityFrameworkCore" />Project file
paket add Dzeta.TonSdk.Core.EntityFrameworkCore --version 0.2.0
#r "nuget: Dzeta.TonSdk.Core.EntityFrameworkCore, 0.2.0"
#:package Dzeta.TonSdk.Core.EntityFrameworkCore@0.2.0
#addin nuget:?package=Dzeta.TonSdk.Core.EntityFrameworkCore&version=0.2.0Install as a Cake Addin
#tool nuget:?package=Dzeta.TonSdk.Core.EntityFrameworkCore&version=0.2.0Install as a Cake Tool
Note: This is a fork of TonSdk.NET with critical bug fixes and improvements.
Key changes:
- Thread-safety fixes: Replaced
DictionarywithConcurrentDictionaryin LiteClient for concurrent request handling- Bounds checking: Added BOC deserialization safety checks to prevent "Index out of range" errors
- Address struct: Rewritten
Addressas a high-performancestructusingfixed byteandReadOnlySpan<byte>- EF Core integration: New extension package for Entity Framework Core value converters
- Atomic operations: Proper use of
TryAdd/TryRemovefor thread-safe request managementStatus: Currently only Core, Adnl, and EntityFrameworkCore packages are published. Other packages (Client, Contracts, Connect, DeFi) will be added incrementally with improvements.
Core library with types and structures for TON Blockchain. Includes:
Address as high-performance struct with fixed byte hash storageCoins for TON, Jetton amountsdotnet add package Dzeta.TonSdk.Core
Thread-safe ADNL client and LiteClient for interacting with TON blockchain nodes. Includes:
ConcurrentDictionary)dotnet add package Dzeta.TonSdk.Adnl
Entity Framework Core integration for TonSdk.Core types. Includes:
AddressValueConverter - stores Address as 36 bytes (4 bytes workchain + 32 bytes hash)AddressStringValueConverter - stores Address as human-readable string (~80 bytes)dotnet add package Dzeta.TonSdk.Core.EntityFrameworkCore
Usage example:
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Wallet>()
.Property(e => e.Address)
.HasAddressConversion<Wallet>(); // Binary storage (36 bytes)
}
fixed byte for high performance)Install via NuGet Package Manager or .NET CLI:
dotnet add package Dzeta.TonSdk.Core
dotnet add package Dzeta.TonSdk.Adnl
dotnet add package Dzeta.TonSdk.Core.EntityFrameworkCore # Optional, for EF Core users
using TonSdk.Core;
// Parse address
var address = new Address("EQDk2VTvn04SUKJrW7rXahzdF8_Qi6utb0wj43InCu9vdjrR");
// Get raw format
string raw = address.ToRaw(); // "0:e4d954ef9f4e1250a26b5bbad76a1cdd17cfc08babaddf4c23e37227..."
// Get workchain and hash
int workchain = address.Workchain; // 0
ReadOnlySpan<byte> hash = address.Hash; // 32 bytes
using TonSdk.Adnl;
using TonSdk.Adnl.LiteClient;
var client = new LiteClient(LiteClientOptions.GetFromUrl("https://ton-blockchain.github.io/global.config.json"));
await client.Connect();
var masterchain = await client.GetMasterchainInfo();
Console.WriteLine($"Last block: {masterchain.Last.Seqno}");
using TonSdk.Core;
using TonSdk.Core.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
public class Wallet
{
public int Id { get; set; }
public Address Address { get; set; } // TON address stored efficiently
public decimal Balance { get; set; }
}
public class MyDbContext : DbContext
{
public DbSet<Wallet> Wallets { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
// Binary storage (36 bytes) - recommended
modelBuilder.Entity<Wallet>()
.Property(e => e.Address)
.HasAddressConversion<Wallet>();
}
}
MIT License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.