TronAksaSharp 1.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package TronAksaSharp --version 1.0.3
                    
NuGet\Install-Package TronAksaSharp -Version 1.0.3
                    
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="TronAksaSharp" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TronAksaSharp" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="TronAksaSharp" />
                    
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 TronAksaSharp --version 1.0.3
                    
#r "nuget: TronAksaSharp, 1.0.3"
                    
#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 TronAksaSharp@1.0.3
                    
#: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=TronAksaSharp&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=TronAksaSharp&version=1.0.3
                    
Install as a Cake Tool

TronAksaSharp

TronAksaSharp: C# ile yazılmış, Tron ağı için yerli ve açık kaynaklı bir cüzdan & adres üretme kütüphanesidir.
Bu kütüphane ile kolayca private key → public key → Tron adresi dönüşümü yapabilirsiniz.


Özellikler

  • Rastgele Private Key üretimi
  • Private Key’den Public Key türetme
  • Public Key’den Tron Adresi hesaplama
  • Base58Check formatında okunabilir adres üretimi (bağımsız Base58 implementasyonu)
  • Adres byte uzunluğu kontrolü
  • Cüzdanın TRX kontrolü (MainNet,Nile,Shasta) Dahil
  • Stake edilmiş varlıkları sorgulama (Bandwith,Energy)

Yakında Gelecek Özellikler :

  • TRX Transferi - Tron ağında TRX gönderme/alma
  • TRC20 Token Desteği - USDT, BTT gibi token işlemleri
  • Akıllı Kontrat Etkileşimi - Tron smart contract'ları ile çalışma
  • TRC20 Token Bakiye Sorgulama - Adres bakiyelerini öğrenme
  • İşlem Geçmişi - Transfer geçmişini görüntüleme

Kurulum :

  1. Projenize TronAksaSharp kütüphanesini ekleyin. NuGet : https://www.nuget.org/packages/TronAksaSharp

  1. Gerekli bağımlılıkları yükleyin:

    Bu paketleri NuGet Paket Yöneticisi ile yükleyebilirsiniz:

    Install-Package BouncyCastle
    

NOT: Base58 işlemleri artık kütüphane içinde, SimpleBase bağımlılığı kaldırıldı.

Yeni Cüzdan Oluşturma :

using TronAksaSharp.Wallet;
using TronAksaSharp.Wallet; // TronWallet ve AddressUtils
using System;

var wallet = TronWallet.CreateTronWallet();

// Byte dizilerini hex string olarak gösterme
string ToHex(byte[] data) => BitConverter.ToString(data).Replace("-", "").ToLower();

Console.WriteLine($"Private Key (hex): {ToHex(wallet.PrivateKey)}");
Console.WriteLine($"Public Key (hex) : {ToHex(wallet.PublicKey)}");
Console.WriteLine($"Address          : {wallet.Address}");

// Adresin byte uzunluğunu kontrol etme
int addrLength = AddressUtils.GetAddressByteLength(wallet.Address);
Console.WriteLine($"Address byte uzunluğu = {addrLength}");

Örnek Çıktı :
Private Key (hex): 03FFEB1D127C5BEF8377F32092F3AD4FEEC93D337553CF5DC8120EC9838147DC
Public Key (hex) : 046AF87108AD9870550EF651B18D24A551391D66E73BA44DCB45AE7232955FC19D6F6190B58BD3B5D1D96CD127D423B72D70900A972ACD48BD42C35C30098416E8
Address          : TUqSfg8fT6t4R5zn2Lhe1RtQ6vHmJLeyJt
Address byte uzunluğu = 25

Hex ve Adres Hesaplama Açıklaması :

1. Private Key → Public Key
- secp256k1 eliptik eğri algoritması kullanılır.
- Public key uncompressed formatta (65 byte) elde edilir.

2. Public Key → Tron Adresi
- Public key’in ilk byte’ı (0x04) çıkarılır.
- Kalan 64 byte, Keccak-256 hash işleminden geçirilir.
- Hash’in son 20 byte’ı alınır ve başına 0x41 eklenir (TRON adres prefix).
- byte checksum hesaplanır (Double SHA-256).
- Sonuç Base58Check formatına çevrilir → okunabilir Tron adresi elde edilir.

3. Adres Byte Uzunluğu
- Tron Base58Check adresi: 21 byte veri + 4 byte checksum = 25 byte uzunluğundadır.
- AddressUtils.GetAddressByteLength metodu ile bu uzunluğu kolayca doğrulayabilirsiniz.


TRX BAKİYE-STAKE(ENERGY,BANDWİTH) SORGULAMA :

using TronAksaSharp.Wallet;

// TRX BAKİYE SORGULAMA :
string walletAddress = "TEWJWLwFL3dbMjXtj2smNfto9sXdWquF4N"; // Örnek TRON adresi

decimal trxBalance = await BalanceService.GetTRXBalanceAsync(walletAddress, TronNetwork.NileTestNet); // Nile TestNet
Console.WriteLine($"TRX Balance (Nile): {trxBalance}");

trxBalance = await BalanceService.GetTRXBalanceAsync(walletAddress, TronNetwork.ShastaTestNet); // Shasta TestNet
Console.WriteLine($"TRX Balance (Shasta): {trxBalance}");

trxBalance = await BalanceService.GetTRXBalanceAsync(walletAddress, TronNetwork.MainNet); // MainNet
Console.WriteLine($"TRX Balance (MainNet): {trxBalance}");

var staked = await BalanceService.GetBandwidthStakeAsync(walletAddress, TronNetwork.NileTestNet); // Bandwith TRX Bakiye Sorgulama
Console.WriteLine("Stake Edilmiş Bandwith TRX: " + staked);

staked = await BalanceService.GetEnergyStakeAsync(walletAddress, TronNetwork.NileTestNet); // Energy Trx Bakiye Sorgulama
Console.WriteLine("Stake Edilmiş Energy TRX: " + staked);

Örnek Çıktı :

TRX Balance (Nile): 35452,278782
TRX Balance (Shasta): 9957,8
TRX Balance (MainNet): 0

MIT License :

Copyright (c) 2025 Kubilay Efe Akdoğan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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 (1)

Showing the top 1 NuGet packages that depend on TronAksaSharp:

Package Downloads
UnifiedChainWallet

Kendi Yazdığım Tron Kütüphanesini Ekledim

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.1.2 33 3/12/2026
2.1.1 95 2/19/2026
2.1.0 112 2/16/2026
2.0.0 109 1/26/2026
1.0.3 200 11/26/2025
1.0.2 390 11/23/2025
1.0.1 382 11/23/2025
1.0.0 607 11/18/2025