W6fux5.ChainKit.Evm 0.2.0

dotnet add package W6fux5.ChainKit.Evm --version 0.2.0
                    
NuGet\Install-Package W6fux5.ChainKit.Evm -Version 0.2.0
                    
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="W6fux5.ChainKit.Evm" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="W6fux5.ChainKit.Evm" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="W6fux5.ChainKit.Evm" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add W6fux5.ChainKit.Evm --version 0.2.0
                    
#r "nuget: W6fux5.ChainKit.Evm, 0.2.0"
                    
#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.
#:package W6fux5.ChainKit.Evm@0.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=W6fux5.ChainKit.Evm&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=W6fux5.ChainKit.Evm&version=0.2.0
                    
Install as a Cake Tool

ChainKit

Multi-chain blockchain SDK for .NET. Currently supports Tron.

Installation

dotnet add package W6fux5.ChainKit.Tron

W6fux5.ChainKit.Core is included as a dependency automatically.

Quick Start

using ChainKit.Tron;
using ChainKit.Tron.Crypto;
using ChainKit.Tron.Providers;

// Connect to Tron network
using var provider = new TronHttpProvider(TronNetwork.Nile);  // Testnet
using var client = new TronClient(provider);

// Create or import account
var account = TronAccount.FromPrivateKey(Convert.FromHexString("your_private_key_hex"));

// Transfer TRX
var result = await client.TransferTrxAsync(account, "TReceiverAddress...", 10m);
if (result.Success)
    Console.WriteLine($"TxId: {result.Data!.TxId}");

// Query balance
var balance = await client.GetBalanceAsync(account.Address);
Console.WriteLine($"TRX: {balance.Data!.TrxBalance}");

Features

High-Level API (TronClient)

  • Transfer: TRX transfers with automatic ref block handling
  • Balance: TRX + TRC20 token balances in one call
  • Staking: Stake/unstake TRX for Energy/Bandwidth (Stake 2.0)
  • Delegation: Delegate/undelegate resources to other addresses
  • Resource Rate: Bidirectional TRX ↔ Energy/Bandwidth exchange rate estimation
  • Transaction Detail: Merged Full Node + Solidity Node transaction info with status tracking

TRC20 Contracts (Trc20Contract)

  • Token Info: Name, symbol, decimals, total supply, deployer address (parallel queries)
  • Transfer / Approve / Allowance: Standard ERC20-compatible operations
  • Mint / Burn: Extended operations for mintable/burnable tokens
  • Deploy: Deploy custom TRC20 tokens from built-in template

Transaction Watching (TronTransactionWatcher)

  • Real-time monitoring: Watch addresses for incoming/outgoing TRX and TRC20 transfers
  • Confirmation tracking: Automatic Solidity Node confirmation with failure detection
  • Two stream sources: PollingBlockStream (HTTP) or ZmqBlockStream (self-hosted node)

Providers

  • TronHttpProvider: HTTP/HTTPS with dual endpoint support (Full Node + Solidity Node)
  • TronGrpcProvider: gRPC for high-performance scenarios
  • Optional ILogger: All classes accept optional ILogger<T> for diagnostics

Dual Endpoint Setup

For accurate transaction confirmation, configure separate Full Node and Solidity Node endpoints:

var provider = new TronHttpProvider(
    baseUrl: "http://your-fullnode:8090",
    solidityUrl: "http://your-soliditynode:8091");

TRC20 Example

using var contract = client.GetTrc20Contract("TContractAddress...", account);

// Get token info
var info = await contract.GetTokenInfoAsync();
Console.WriteLine($"{info.Data!.Symbol} - Decimals: {info.Data.Decimals}");

// Transfer tokens
var tx = await contract.TransferAsync("TReceiverAddress...", 100m);

Resource Exchange Rate

var rate = await client.GetResourceExchangeRateAsync(ResourceType.Energy);
Console.WriteLine($"1 TRX = {rate.Data!.ResourcePerTrx:F2} Energy");
Console.WriteLine($"100 TRX = {rate.Data.EstimateResource(100m):F0} Energy");
Console.WriteLine($"10000 Energy = {rate.Data.EstimateTrx(10000):F2} TRX");

Requirements

  • .NET 10.0+

License

Apache License 2.0

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 113 4/13/2026