A fully-typed TypeScript client for the TRON blockchain that communicates with java-tron full nodes over gRPC. Version 1.0.1 provides a high-level API abstracting away protobuf encoding, base58↔hex address conversion, and sun-to-TRX amount conversion. It requires Node.js 20+ (uses built-in fetch and TextEncoder) and is developed by TronSave/SaveWallet. Compared to alternatives like tronweb or tronbox, tron-grpc is ESM-only, has zero non-peer runtime dependencies, and outputs human-readable strings instead of raw buffers.
npm install tron-grpcNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a mainnet client, fetches the latest block, queries an account's TRX and USDT balances, then closes the client.
Upgrade Node.js to version 20 or later.
Adjust grpcOptions or firewall settings if connection drops unexpectedly.
Replace getBalance(address) with getAccount(address) then access .balanceTrx.
Ensure hex addresses start with '41' or '0x41'. If you have '0x' prefix with other bytes, convert to base58 or pad as needed.
Use import syntax or dynamic import() in your project. If you must use require, upgrade your project to ESM (e.g., set type: module in package.json).
Use import { TronGrpcClient } from 'tron-grpc' instead of require().Upgrade Node.js to version 20 or later.
Check the node URL (e.g., 'grpc.trongrid.io:50051'), network connectivity, and API key if required.
Check if the address is valid and activated. Use account.exists field to verify presence before accessing balanceTrx.