Introduction to TronTool.Net
TronTool.Net is a powerful development kit designed to enable .Net/C# applications to seamlessly integrate support for TRON and USDT-TRC20 digital assets. Whether you're running your own TRON blockchain node or utilizing TRON's official public API services for lightweight deployments, this toolkit provides robust functionality.
๐ Explore blockchain development tools
Key Features of TronTool.Net
- Native TRX Transaction Support: Facilitates direct TRX transfers on the TRON blockchain
- Smart Contract & TRC20 Token Integration: Full support for TRON smart contracts and TRC20 tokens like USDT-TRC20
- Secure Offline Transaction Signing: Protects private keys through offline signature generation
- Comprehensive Node API Wrapper: Complete coverage of APIs from full nodes, Solidity nodes, and event nodes
- Flexible Node Configuration: Compatible with both private nodes and third-party services like TRON's public nodes
Package Structure (Version 1.0.0)
| Code File | Description |
|---|---|
TronTool.sln | Solution configuration file |
Address.cs | TRON address representation class |
Contract.cs | Smart contract encapsulation class |
Credential.cs | Blockchain identity class for transaction signing |
NodeClient.cs | TRON node protocol wrapper |
Trc20.cs | TRC20 smart contract implementation |
TronApi.cs | Multi-node client interface |
TronKit.cs | Primary development kit entry point |
Getting Started with TronKit
Initializing TronKit
// Connect to TRON MainNet with private key
TronKit kit = new TronKit(
TronApi.MainNet(),
Credential.FromPrivateKey("87c12d....d435")
);TRX Transactions and Balance Checks
// Send 1000 TRX (converted to SUN)
string recipient = "TDN3QY85Jft3RwgyatjRNmrwRmwkn8qwqx";
long amount = 1000000000; // 1000 TRX = 1,000,000,000 SUN
TransactionResult result = kit.SendTrx(recipient, amount);
// Check TRX balance
long balance = kit.GetTrxBalance(recipient);TRC20 Token Operations
// USDT-TRC20 transfer (1.3153 USDT)
Trc20 usdt = kit.Trc20("TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t");
BigInteger transferAmount = new BigInteger(1315300);
usdt.Transfer(recipient, transferAmount);
// Query token balance
BigInteger tokenBalance = usdt.BalanceOf(recipient);Advanced Features
Event Monitoring
// Query recent USDT events
long timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() - 10000;
ContractEvent[] events = usdt.GetEvents(timestamp);Address Management
// Create new credentials
Credential newAccount = Credential.Create();
// Address conversion
Address addr = Address.FromBase58("TDN3QY85Jft3RwgyatjRNmrwRmwkn8qwqx");
string hexAddress = addr.Hex; // Returns 41253...A43๐ Discover more about blockchain address systems
Node API Integration
TronApi provides comprehensive access to TRON node interfaces:
// Initialize with custom nodes
TronApi api = new TronApi(
"https://private-full-node.example",
"https://private-solidity-node.example",
"https://private-event-node.example"
);
// Query account information
Account account = api.GetAccount("TEgM5CPeqow...7vcBgVkD4tP");FAQ
Q: Can I use TronTool.Net with test networks?
A: Yes, simply use TronApi.TestNet() to connect to Shasta testnet.
Q: How do I handle different address formats?
A: The Address class provides conversion between base58 and hex formats with FromBase58() and FromHex() methods.
Q: Is offline transaction signing secure?
A: Absolutely. The Credential class keeps private keys secure by performing all signing operations offline.
Q: What's the minimum TRX unit for transactions?
A: Transactions use SUN (1 TRX = 1,000,000 SUN) for precise value handling.
๐ Learn about blockchain security best practices
Conclusion
TronTool.Net offers enterprise-grade TRON blockchain integration for .Net developers, combining comprehensive functionality with security-conscious design. The toolkit's modular architecture and thorough documentation enable rapid implementation of TRON-based solutions across various deployment scenarios.