TRON developer tools by TronLess

Ten small, focused Node.js packages for building on the TRON network: address validation, unit conversion, offline key generation, energy and fee calculation, account resources, TRC-20 decoding and reading, transaction inspection, RPC health checks and deposit watching. MIT-licensed, ESM, TypeScript definitions included, no tronweb required.

Built and maintained by TronLess, the TRON energy rental service — we use these in production and publish them because everyone writing TRON integrations rewrites the same helpers.

The tools

Package What it does CLI
@tronless/tron-address Validate a TRON address with its real checksum; convert Base58 ⇄ hex ⇄ 0x tron-address
@tronless/tron-units SUN ⇄ TRX and TRC-20 decimals, BigInt-safe tron-units
@tronless/tron-keygen Offline keys, BIP-39 mnemonics on m/44'/195', vanity addresses tron-keygen
@tronless/tron-energy-calculator What a USDT transfer costs in energy, bandwidth and TRX; rent vs burn vs stake tron-energy-calculator
@tronless/tron-account-resources Energy, bandwidth, staking and delegations of any address tron-account-resources
@tronless/trc20-decoder Decode TRC-20 calldata, event logs and whole transactions; encode calls trc20-decoder
@tronless/trc20-token Balances, decimals, supply and allowances without a private key trc20-token
@tronless/tron-tx-inspector Status, decoded method and full fee breakdown for a transaction hash tron-tx-inspector
@tronless/tron-rpc-health Latency, height and lag of public TRON endpoints; pick the best node tron-rpc-health
@tronless/tron-address-watcher USDT TRC-20 and TRX deposit notifications with webhooks tron-address-watcher

All of them share one small foundation: @tronless/tron-client, a zero-dependency HTTP client for TronGrid and full nodes with API-key support and correct rate-limit backoff. It is published too, and usable on its own.

Try one without installing anything

npx @tronless/tron-address TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t
npx @tronless/tron-energy-calculator usdt
npx @tronless/tron-tx-inspector b86bfe8c777cd3419c22dd254763d157ee35146b410540c9f7c2864e283ef415
npx @tronless/tron-rpc-health --network mainnet

A worked example

Estimate a USDT payout, check the sender can afford it, send it with your own signer, then verify the receipt:

import { getAccountResources, canCover } from '@tronless/tron-account-resources';
import { estimateUsdtTransfer, fetchChainParams } from '@tronless/tron-energy-calculator';
import { inspectTransaction } from '@tronless/tron-tx-inspector';
import { getUsdtBalance } from '@tronless/trc20-token';

const from = 'TMoRLxzroxJTS3QUvNdQ18tpCZ7rtzKFo5';

const params = await fetchChainParams();                 // live getEnergyFee etc.
const resources = await getAccountResources(from);
const estimate = estimateUsdtTransfer({ params, availableEnergy: resources.energy.available });

console.log(`this transfer will burn ${estimate.total.trx} TRX`);
if (!canCover(resources, { energy: estimate.energy.required, bandwidth: 345 })) {
  console.log('no energy — rent some first: https://tronless.app/tron-energy');
}

const balance = await getUsdtBalance(from);
// … sign and broadcast with tronweb …
const receipt = await inspectTransaction(txid);
console.log(receipt.status, receipt.fee.totalTrx, receipt.tokenTransfers);

Design rules

Development

npm install          # npm workspaces, one install for all packages
npm test             # unit tests, no network
npm run test:live    # also runs the tests that hit TRON mainnet
npm run check        # metadata, bin, types and README checks before publishing
npm run site         # build static landing pages into site/dist/

Requires Node.js 20 or newer. Tests use the built-in node --test runner; there is no test framework to install.

Continuous integration runs the unit tests on Node 20, 22 and 24 on Linux and Windows, and a weekly live run against mainnet so that fee defaults and the endpoint list cannot silently rot.

Contributing

Issues and pull requests are welcome at github.com/TronLess/tron-tools. Two rules: every network call must be mockable through an injected fetch, and any on-chain number added to the code or the docs must come with the command that produced it.

About TronLess

TronLess rents TRON energy so that USDT TRC-20 transfers cost a fraction of burning TRX. There is a Telegram bot for one-off rentals and an API for exchanges, payment services and bots. These tools are independent of that service and work fine without it — they exist because we needed them ourselves.

Further reading on the fee mechanics these tools model:

License

MIT © TronLess

All tools

Decode TRC-20 transactions, calldata and event logs — @tronless/trc20-decoder

Turn a9059cbb000000000000000000000000b80ea17f…01af0f900 into transfer(to: TSkQrvdRba8JaHWwC9bDFsX3euMzuiqjxu, value: 452000000) — no ABI file, no tronweb, no network call. Also dec…

Get a USDT TRC-20 balance without a private key — @tronless/trc20-token

Read any TRC-20 token on TRON — balance, decimals, symbol, total supply, allowance — through wallet/triggerconstantcontract. No private key, no signing, no gas: a constant call is …

Check TRON energy, bandwidth and staking of an address — @tronless/tron-account-resources

wallet/getaccountresource returns a dozen fields with names like freeNetUsed, NetLimit and TotalEnergyWeight, and none of them directly answer the question you have: can this addre…

TRON address validator and converter — @tronless/tron-address

Validate a TRON address and convert it between all three forms it appears in: Base58 (TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t), TRON hex (41a614f803b6fd780986a42c78ec9c7f77e6ded13c) and…

USDT TRC-20 deposit notifications for TRON — @tronless/tron-address-watcher

Watch a set of TRON addresses and get an event the moment USDT TRC-20 or TRX arrives — no node to run, no websocket, no indexer. Polls the TronGrid account endpoints, de-duplicates…

TRON HTTP client for Node.js (TronGrid / full node) — @tronless/tron-client

A 200-line, zero-dependency HTTP client for the TRON full-node API and TronGrid. It knows the mainnet, Nile and Shasta endpoints, sends your TRON-PRO-API-KEY, times out, and retrie…

TRON energy and USDT TRC-20 fee calculator — @tronless/tron-energy-calculator

A USDT TRC-20 transfer from an address with no energy costs 6.4285 TRX on TRON mainnet today: 64,285 energy at 100 SUN per unit, with the 345 bytes of bandwidth covered by the free…

Offline TRON wallet generator — @tronless/tron-keygen

Generate TRON private keys, addresses and BIP-39 mnemonics without a network connection. Derivation follows m/44'/195'/0'/0/n, the same path TronLink, Ledger and TronWeb.fromMnemon…

TRON RPC endpoints and node health checker — @tronless/tron-rpc-health

A curated list of public TRON endpoints for mainnet, Nile and Shasta, plus a probe that measures each one's latency, block height and how far behind consensus it is. Use it to pick…

TRON transaction inspector and fee breakdown — @tronless/tron-tx-inspector

Paste a transaction hash, get a receipt: status, block, decoded method, who sent what to whom, and where every SUN of the fee went — energy burned versus energy from your own stake…

SUN to TRX converter and TRC-20 amount formatter — @tronless/tron-units

1 TRX = 1,000,000 SUN, USDT TRC-20 has 6 decimals and USDD has 18. Get any of those conversions wrong by one zero and you send a hundred times too much. This package does them with…