Download the PHP package jackillll/tron without Composer
On this page you can find all versions of the php package jackillll/tron. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jackillll/tron
More information about jackillll/tron
Files in jackillll/tron
Package tron
Short Description A PHP API for interacting with Tron (Trx) blockchain with Laravel integration - Based on iexbase/tron-api
License MIT
Homepage https://github.com/jackillll/tron
Informations about the package tron
TRON API
A PHP API for interacting with the Tron Protocol
Based on iexbase/tron-api
Install
Requirements
The following versions of PHP are supported by this version.
- PHP 7.4+
Configuration
This package supports a new, more intuitive configuration structure:
New Configuration Structure
Usage
Laravel Usage
1. Installation in Laravel
2. Publish Configuration
3. Environment Configuration
Add to your .env file:
4. Laravel Usage Examples
Using Dependency Injection:
Using Facade:
Service Class Example:
Plain PHP Usage
1. Using TronConfig Helper (Recommended)
2. Traditional HttpProvider Usage
3. Complete PHP Example
Network Configuration
Available Networks
- mainnet: Tron mainnet (production)
- testnet: Shasta testnet (development)
- nile: Nile testnet (development)
Node Types
- Full Node (
use_solidity = false): For sending transactions, getting latest data - Solidity Node (
use_solidity = true): For querying smart contracts, historical data
Dynamic Network Switching
Basic Examples
Quick Start Example
Legacy HttpProvider Example
Advanced Features
Smart Contract Interaction
Transaction Management
Block and Transaction Queries
Configuration Migration
From Old Configuration
To New Configuration
Error Handling
Best Practices
- Use Environment Variables: Store sensitive data like private keys in environment variables
- Error Handling: Always wrap API calls in try-catch blocks
- Network Selection: Use testnet for development, mainnet for production
- API Keys: Use TronGrid API keys for better rate limits
- Node Types: Use Full Node for transactions, Solidity Node for queries
API Documentation
For detailed API documentation, please refer to:
- NEW_CONFIG_GUIDE.md - New configuration structure guide
- Tron Developer Documentation
- TronGrid API Documentation
Testing
Examples
Check the examples/ directory for more usage examples:
new-config-simple.php- Basic new configuration usageconfig-based-example.php- Advanced configuration examplesfinal-verification.php- Comprehensive feature testing
Changelog
v2.0.0
- ✅ New configuration structure with
networkanduse_solidity - ✅ TronConfig helper class for easier setup
- ✅ Support for multiple networks (mainnet, testnet, nile)
- ✅ Backward compatibility with old configuration
- ✅ Improved Laravel integration
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
The MIT License (MIT). Please see License File for more information.