PHP Tron is a complete, framework-agnostic PHP library for working with the TRON blockchain (TRX) and TRC-20 tokens such as USDT. Generate HD wallets, derive unlimited addresses, check balances and resources, preview and send TRX and tokens, detect incoming deposits with signed webhooks, and keep everything in encrypted backups — all from plain PHP, with no framework and no database required.
Drop it into any project — plain PHP, an existing API, a CMS, Laravel/Symfony, a Telegram bot or a custom backend — and start accepting and sending crypto in minutes.
Key Features
- Pure PHP, framework-agnostic — works anywhere, installs via Composer.
- HD wallets with built-in BIP39 / BIP44 — mnemonics and unlimited deterministic addresses from a single seed (no external service).
- Full TRX support — balances, account info, bandwidth/energy, fee preview, send and "send all".
- Full TRC-20 support (USDT and any token) — contract metadata, balances, preview and send transfers.
- Deposit monitoring with webhooks — a signed HMAC-SHA256 HTTP callback for every new incoming TRX/TRC-20 transaction, de-duplicated via SQLite.
- Encrypted storage & portable backups — AES-256-GCM wallet files, password protected.
- Transaction history — auto-paginating iterators for TRX and TRC-20 transfers.
- Standalone cURL HTTP client with HTTP/SOCKS proxy support (TronGrid, Shasta testnet or your own node).
- Command-line tool — wallets, payments and the deposit monitor from the terminal.
- Bilingual web playground (EN/RU) + full documentation (EN & RU) + 10 examples + PHPUnit tests.
What's Included
- The PHP library (PSR-4, Composer-ready)
- Command-line tool (bin/tron.php)
- Bilingual web application (landing + live example + API documentation)
- Full API reference in English & Russian + a Webhooks guide
- 10 runnable code examples
- Unit tests (known BIP39/BIP44 vectors)
Perfect For
- Crypto payment gateways & checkout
- Exchanges, wallets and custodial services
- Automated TRX / USDT payouts
- Deposit detection & accounting
- Telegram / e-commerce bots and any PHP backend working with TRON
Requirements
- PHP 8.1 or newer
- PHP extensions: gmp, ctype, curl, openssl, pdo_sqlite (pdo_sqlite only for the deposit monitor)
- Composer
- A free TronGrid API key is recommended for production
Quick Start
require 'vendor/autoload.php';
use ItHealerTronTron;
$tron = Tron::make(apiKey: 'your-trongrid-api-key');
$wallet = $tron->createWallet('My Wallet');
echo $wallet->getPrimaryAddress()->address; // T...
echo $tron->getBalance($wallet->getPrimaryAddress()); // TRX balance
// Send TRX or USDT (TRC-20)
$tron->transfer($wallet->getPrimaryAddress(), 'TRECIPIENT...', 1.5);
$tron->transferTRC20('TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t', $from, $to, 100);
Why PHP Tron? Clean, commented, tested code with zero framework lock-in, real-world features (webhooks, encrypted backups, CLI) and a working live demo. Everything you need to integrate TRON and USDT payments into your PHP project — fast.