EverscaleNet.Client 1.37.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package EverscaleNet.Client --version 1.37.1                
NuGet\Install-Package EverscaleNet.Client -Version 1.37.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EverscaleNet.Client" Version="1.37.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EverscaleNet.Client --version 1.37.1                
#r "nuget: EverscaleNet.Client, 1.37.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install EverscaleNet.Client as a Cake Addin
#addin nuget:?package=EverscaleNet.Client&version=1.37.1

// Install EverscaleNet.Client as a Cake Tool
#tool nuget:?package=EverscaleNet.Client&version=1.37.1                

Main workflow Chat on Telegram <img src="https://avatars3.githubusercontent.com/u/67861283?s=150&u=4536b61595a1b422604fab8a7012092d891278f6&v=4" align="right" width="150">

Everscale .NET Client

Everscale is secure and scalable network. Lets do this network convenient both for users and developers!

  • This client was automatically generated from api.json (see ClientGenerator)
  • Fully supported methods provided in SDK documentation https://github.com/tonlabs/TON-SDK/tree/master/docs
  • No Newtonsoft.Json required, it is kinda legacy now, last release was over a year ago. New System.Text.Json is ten times faster
  • The most complete support of CancellationToken
  • Net Standard 2.1 compatible

Quick start

Add Nuget Package to your project

# Typical .Net application
dotnet add package EverscaleNet.Client

# Blazor WASM application
dotnet add package EverscaleNet.WebClient

Register in DI

Be careful! no network endpoints provided as default

public void ConfigureServices(IServiceCollection services)
{
    services.AddEverClient();
}

Ready to use everywhere

public class YourEverService {
    private readonly IEverClient _everClient;

    public YourEverService(IEverClient everClient) {
        _everClient = everClient;
    }
    
    public string GetEverSecretPhase() {
        var mnemonic = await _everClient.Crypto.MnemonicFromRandom(new ParamsOfMnemonicFromRandom());
        return mnemonic.Phrase;
    }
}

IPackageManager interface

There is easy option to load contracts abi and tvm info from files in this client.

Now available following async methods:

Task<Package> LoadPackage(string name); // Package entity just contains Abi and Tvc
Task<Abi> LoadAbi(string name);
Task<string> LoadTvc(string name);

Default contracts path is _contracts. Be careful, Blazor WASM app will search for _contracts relative to wwwroot.

Advanced client configuration

See configuration parameters:

public void ConfigureServices(IServiceCollection services)
{
    services.AddEverClient(config =>
    {
        config.Network.Endpoints = new[] { // see avalable networks https://tonlabs.gitbook.io/ton-sdk/reference/ton-os-api/networks#networks // };
        config.Network.NetworkRetriesCount = 5;
    }, packageManagerConfig =>
    {
        packageManagerConfig.PackagesPath = "packages"; // path to abi.json and tvc files, _contracts is default
    });  
}

or configure options by appsettings.json or another configuration provider

https://docs.microsoft.com/en-us/dotnet/core/extensions/configuration-providers

Example for appsettings.json
{
  "EverClient": {
    "Network": {
      "Endpoints": [ "https://eri01.net.everos.dev/", "https://rbx01.net.everos.dev/", "https://gra01.net.everos.dev/" ],
      "WaitForTimeout": 5000
    }
  },
  "PackageManager": {
    "PackagesPath": "my_app_contracts"
  }
}
public void ConfigureServices(IServiceCollection services)
{
    services.AddEverClient()        
        .Configure<EverClientOptions>(Configuration.GetSection("EverClient"))
        .Configure<PackageManagerOptions>(Configuration.GetSection("PackageManager"));
}

Logging

Fully compatible with https://docs.microsoft.com/en-us/dotnet/core/extensions/logging

Prototype type extensions

There are a few properties with type JsonElement in data models. And this client provide methods to easy convert this properties to/from Prototype.

Convert to Prototype example:

ResultOfParse parseResult = await everClient.Boc.ParseMessage(new ParamsOfParse
{
    Boc = "te6ccgEBAQEAWAAAq2n+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE/zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzSsG8DgAAAAAjuOu9NAL7BxYpA"
});
var parsedPrototype = new {type = default(int), id = default(string)};
var parsedMessage = parseResult.Parsed!.Value.ToPrototype(parsedPrototype);

_logger.LogInformation("Parsed message id: {id} type: {type}", parsedMessage.id, parsedMessage.type);

Convert from Prototype example:

await everClient.Net.WaitForCollection(new ParamsOfWaitForCollection
{
    Collection = "transactions",
    Filter = new {in_msg = new {eq = parsedMessage.id}}.ToJsonElement(),
    Result = "id"
});

Samples

https://github.com/everscale-actions/everscale-dotnet/tree/master/samples/

Support us

This project has no funding, but everyone can support.

Surf Wallet: 0:9b487d68e4f029ab6d92640892d99d1c549ae69b198df414e905350559a165bf

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on EverscaleNet.Client:

Package Downloads
EverscaleNet.TestSuite

Everscale .Net Client

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.48.1 124 11/13/2024
1.48.0 181 8/20/2024
1.47.0 149 7/19/2024
1.45.1 319 2/22/2024
1.44.4.5 604 11/27/2023
1.44.4.4 336 11/17/2023
1.44.4.3 311 11/16/2023
1.44.4.2 308 11/15/2023
1.44.4.1 466 11/14/2023
1.44.4 454 11/14/2023
1.44.3 555 9/12/2023
1.44.2 570 8/24/2023
1.44.1 634 7/31/2023
1.44.0 625 7/27/2023
1.43.3 668 6/26/2023
1.43.2 614 6/19/2023
1.43.1 655 6/3/2023
1.43.0 653 5/24/2023
1.42.2-alfa9 643 5/22/2023
1.42.2-alfa8 569 5/22/2023
1.42.2-alfa5 610 5/21/2023
1.42.2-alfa4 587 5/21/2023
1.42.2-alfa3 608 5/21/2023
1.42.2-alfa2 145 5/11/2023
1.42.2-alfa 141 5/11/2023
1.42.1 264 3/23/2023
1.42.0 232 3/22/2023
1.41.1 216 3/22/2023
1.41.0 257 2/15/2023
1.41.0-alfa6 111 2/14/2023
1.41.0-alfa5 131 2/14/2023
1.41.0-alfa3 148 2/14/2023
1.40.1-alfa 122 2/13/2023
1.40.0 313 1/12/2023
1.39.0 295 12/9/2022
1.38.1 340 11/12/2022
1.38.0.2 327 11/10/2022
1.38.0.1 327 11/10/2022
1.38.0 404 10/12/2022
1.37.2 408 9/17/2022
1.37.1 473 9/14/2022
1.37.0 433 8/3/2022
1.36.1 437 7/20/2022
1.36.0 455 7/14/2022
1.35.1 428 6/30/2022
1.35.0 416 6/28/2022
1.34.3 433 6/20/2022
1.34.2 446 6/1/2022
1.34.1 432 5/28/2022
1.33.1 437 5/11/2022
1.33.0 422 5/4/2022
1.32.0 452 4/3/2022
1.31.0 444 4/3/2022
1.30.0 482 2/5/2022
1.29.0 457 2/4/2022
1.28.0.4 458 1/29/2022
1.28.0.2 3,083 1/22/2022