Build on TRON,without protocol complexity.
One idiomatic Rust API for accounts, transactions, staking, contracts, tokens, and solidified chain state.
Quick start
cargo add tronzConnect to TronGrid or any TRON gRPC endpoint. Add a signer when you are ready to transact.
release0.5.1
transportgRPC
rust1.91.1
At a glance
Start with a read-only provider. Add a signer when you need transactions, then use the same provider for typed contract calls.
use tronz::{ProviderBuilder, TronProvider, TRONGRID_MAINNET};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// Mainnet is safe here because this example only reads chain state.
let provider = ProviderBuilder::new()
.connect_grpc(TRONGRID_MAINNET)
.await?;
// Read the latest block.
let block = provider.get_now_block().await?;
println!("block {} @ {}ms", block.number, block.timestamp);
Ok(())
}use tronz::{
Address, LocalSigner, ProviderBuilder, TronProvider, Trx, TRONGRID_NILE,
};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let signer = LocalSigner::from_hex("PRIVATE_KEY_HEX")?;
let recipient: Address = "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t".parse()?;
// Use Nile for transactions so no real TRX is at risk.
let provider = ProviderBuilder::new()
.with_signer(signer)
.connect_grpc(TRONGRID_NILE)
.await?;
// Build, sign, and broadcast in one chain.
let pending = provider
.send_trx()
.to(recipient)
.amount(Trx::from_sun(1_000_000)?)
.send()
.await?;
let receipt = pending.get_receipt().await?;
println!("status: {:?}", receipt.status);
Ok(())
}use tronz::contract::Trc20Ext;
use tronz::{Address, ProviderBuilder, TRONGRID_MAINNET};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// Read token metadata from mainnet without signing a transaction.
let provider = ProviderBuilder::new()
.connect_grpc(TRONGRID_MAINNET)
.await?;
let usdt: Address = "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t".parse()?;
let token = provider.trc20(usdt);
println!("{} ({})", token.name().await?, token.symbol().await?);
Ok(())
}Features
TRON-native
Protocol primitives
First-class types for
Address, Trx, resources, permissions, and receipts.Modular
Composable providers
Layer in signers, fillers, middleware, retries, and failover without rewriting application code.
Lazy
Predictable transactions
Build and inspect requests locally; network I/O begins only when you call
.send().Type-safe
Contracts and tokens
Use TRC20, TRC721, JSON ABI, and
tron_sol! bindings with alloy-compatible types.Full coverage
Staking and governance
Freeze, delegate, vote, claim rewards, manage witnesses, and submit proposals.
Finalized
Solidified state
Read irreversible chain state through
SolidityProvider.Sponsors
Thanks to the organizations supporting the ongoing development and maintenance of tronz.
Community
- Found a bug or have an idea? Open a GitHub issue.
- Ready to contribute? Read the contribution guide.

CatFee.IO | TRON Service Provider