Download the PHP package it-healer/laravel-tron without Composer
On this page you can find all versions of the php package it-healer/laravel-tron. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-tron
Laravel Tron Package
Laravel Tron is a comprehensive Laravel package for working with the Tron blockchain and TRC-20 tokens. It allows you to generate HD wallets using mnemonic phrases (BIP39/BIP44), validate addresses, check balances and resources, preview and send TRX/TRC-20 tokens. Automate cryptocurrency receiving and withdrawals in your Laravel application with ease.
Table of Contents
- Features
- Requirements
- Installation
- Configuration
- Quick Start
- Usage
- Working with Nodes
- Working with Wallets
- Working with Addresses
- Working with TRX
- Working with TRC-20 Tokens
- Advanced Usage
- Testing
- Artisan Commands
- Security
- Troubleshooting
- Changelog
- Support
- Credits
- License
Features
✨ Key Features:
- 🔐 Built-in BIP39/BIP44 Support - No external dependencies for mnemonic generation
- 💼 HD Wallet Generation - Create hierarchical deterministic wallets
- 🎯 Multiple Address Support - Generate unlimited addresses from a single seed
- 💰 TRX & TRC-20 Support - Full support for native TRX and TRC-20 tokens
- 🔄 Automatic Synchronization - Background sync of transactions and balances
- 📊 Resource Management - Track bandwidth and energy usage
- 🎨 Customizable Models - Extend default models to fit your needs
- 🔔 Webhook Handler - Custom event handling for deposits
- 🧪 Fully Tested - Comprehensive test suite with 17 tests
- 🛡️ Secure - Encrypted storage for sensitive data
Requirements
- PHP: 8.1 or newer
- Laravel: 10.0 or newer (tested with Laravel 10, 11, and 12)
- PHP Extensions:
ext-gmp- GNU Multiple Precision arithmeticext-ctype- Character type checking
- External Services:
- TronGrid API key (Get one here)
Installation
Install the package via Composer:
Run the installer command:
This will publish the configuration file and migrations.
Run the migrations:
Laravel 11+ (Automatic Discovery)
The package will be automatically discovered. No additional steps needed!
Laravel 10 (Manual Registration)
For Laravel 10, register the Service Provider and Facade in config/app.php:
Scheduler Setup
For Laravel 10:
Edit app/Console/Kernel.php and add to the schedule() method:
For Laravel 11+:
Add to routes/console.php:
Configuration
After installation, you'll find the configuration file at config/tron.php:
Custom Webhook Handler
Create a custom webhook handler to process deposit events:
Then update config/tron.php:
Quick Start
1. Register with TronGrid
First, create an account on TronGrid and generate an API key.
2. Create a Tron Node
3. Generate a Wallet
4. Create an Address
5. Send TRX
Usage
Working with Nodes
Create a Node
Alchemy as RPC node
Alchemy can serve Tron RPC (balances, account resources, triggerconstantcontract,
broadcast), but not the TronGrid address-history endpoints (v1/accounts/.../transactions).
createAlchemyNode() points RPC at Alchemy and keeps history (and therefore deposit detection)
on TronGrid via a separate indexer provider — pass your TronGrid API key for that:
Under the hood the node stores an optional index_node ({url, headers}); ApiManager routes
v1/* requests to it when set, everything else to the RPC node.
Get Node Information
Working with Wallets
Generate Wallet
Import Existing Wallet
Wallet with Passphrase
Validate Mnemonic
Working with Addresses
Create Address
Import Watch-Only Address
Validate Address
Get Address Balance
Get Address Resources
Working with TRX
Preview Transfer
Send TRX
Working with TRC-20 Tokens
Register TRC-20 Token
Get TRC-20 Balance
Preview TRC-20 Transfer
Send TRC-20 Tokens
Advanced Usage
Custom Models
Extend the default models to add custom functionality:
Update config/tron.php:
Touch Synchronization System (TSS) — adaptive sync
For applications with many addresses, enable TSS so addresses are polled often while in use
and rarely while idle, instead of every run. An address is "active" for waiting_seconds
after its last touch_at; while active it syncs no more often than fast_interval, while idle
no more often than slow_interval.
Mark activity by updating touch_at when the wallet is used (GUI view, API call, unlock):
Defaults (fast_interval 0, slow_interval null) preserve the legacy behavior: active
addresses sync every run, idle ones are skipped. tron:address-sync --force bypasses the schedule.
Multiple Derivation Paths
The package uses BIP44 standard with the path m/44'/195'/0'/0 for Tron:
Testing
The package includes a comprehensive test suite:
Test Coverage:
- ✅ BIP39 mnemonic generation (12, 15, 24 words)
- ✅ BIP39 mnemonic validation
- ✅ Seed generation with/without passphrase
- ✅ BIP44 address derivation
- ✅ Private/public key generation
- ✅ Address generation from private keys
- ✅ Multiple address generation
See tests/README.md for more details.
Artisan Commands
Synchronization Commands
Creation Commands
Security
Best Practices
- 🔐 Never store mnemonics in plain text - Always encrypt sensitive data
- 🔑 Use strong passphrases - Add an additional layer of security to wallets
- 🌐 Use HTTPS - Always communicate with Tron nodes over HTTPS
- 🔒 Secure your database - Encrypt database backups and use strong credentials
- 👥 Limit access - Restrict who can access wallet operations
- 📝 Log transactions - Keep audit logs of all cryptocurrency operations
- 🧪 Test on testnet first - Always test on Shasta testnet before mainnet
Encrypted Storage
The package automatically encrypts sensitive data:
- Private keys are encrypted using Laravel's encryption
- Mnemonics are encrypted before storage
- Passwords are hashed using bcrypt
Reporting Vulnerabilities
If you discover a security vulnerability, please email [email protected]. All security vulnerabilities will be promptly addressed.
Troubleshooting
Common Issues
Issue: "Class 'GMP' not found"
Issue: "Invalid mnemonic phrase"
- Ensure the mnemonic has the correct number of words (12, 15, 18, 21, or 24)
- Check for typos in the mnemonic words
- Verify words are from the BIP39 wordlist
Issue: "Insufficient energy"
- Freeze TRX to get energy
- Or use TRX to pay for energy (higher cost)
- Consider using
transferPreview()to estimate costs
Issue: "Node API limit exceeded"
- TronGrid free tier has rate limits
- Upgrade to a paid plan on TronGrid
- Or use your own Tron node
Debug Mode
Enable debug logging in .env:
Check logs in storage/logs/laravel.log for detailed information.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Custom development & contacts / Заказная разработка и контакты
EN — Need a new project built from scratch, or these modules integrated into your existing application? Contact the developer directly — custom development, module integration and ongoing support are available.
RU — Нужен новый проект «под ключ» или интеграция этих модулей в существующее приложение? Свяжитесь с разработчиком напрямую — доступны заказная разработка, интеграция модулей и поддержка.
- 🌐 Website / Сайт: it-healer.com
- ✈️ Telegram: @biodynamist · +90 551 629 47 16
- 📱 WhatsApp: +90 551 629 47 16
- 📧 Email: [email protected]
- 🐛 Issues / Баг-репорты: GitHub Issues
Credits
License
The MIT License (MIT). Please see License File for more information.
Made with ❤️ by IT-HEALER
All versions of laravel-tron with dependencies
ext-gmp Version *
ext-ctype Version *
illuminate/contracts Version ^10.0|^11.0|^12.0|^13.0
spatie/laravel-package-tools Version ^1.15
minter/minter-php-bip-44 Version ^1.2
web3p/web3.php Version ^0.1.6
kornrunner/secp256k1 Version ^0.3
simplito/elliptic-php Version ^1.0
brick/math Version ^0.14.2 || ^0.15 || ^0.16 || ^0.17