PHPackages                             jackillll/tron - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. jackillll/tron

ActiveLibrary[API Development](/categories/api)

jackillll/tron
==============

A PHP API for interacting with Tron (Trx) blockchain with Laravel integration - Based on iexbase/tron-api

v2.0.3(7mo ago)020MITPHPPHP &gt;=8.1

Since Sep 24Pushed 7mo agoCompare

[ Source](https://github.com/jackillll/tron)[ Packagist](https://packagist.org/packages/jackillll/tron)[ Docs](https://github.com/jackillll/tron)[ RSS](/packages/jackillll-tron/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (5)Used By (0)

TRON API
========

[](#tron-api)

A PHP API for interacting with the Tron Protocol

**Based on [iexbase/tron-api](https://github.com/iexbase/tron-api)**

[![Latest Stable Version](https://camo.githubusercontent.com/ddbf7cbae4ee4bb10ae570b454685de910acfe2987b6eb7898386131b8ddd16c/68747470733a2f2f706f7365722e707567782e6f72672f6a61636b696c6c6c6c2f74726f6e2f76657273696f6e)](https://packagist.org/packages/jackillll/tron)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Install
-------

[](#install)

```
composer require jackillll/tron
```

Requirements
------------

[](#requirements)

The following versions of PHP are supported by this version.

- PHP 7.4+

Configuration
-------------

[](#configuration)

This package supports a new, more intuitive configuration structure:

### New Configuration Structure

[](#new-configuration-structure)

```
'network' => 'mainnet',        // Network name: mainnet, testnet, nile
'use_solidity' => false,       // Boolean: true for Solidity node, false for Full node
'networks' => [
    'mainnet' => [
        'host' => 'https://api.trongrid.io',
        'explorer' => 'https://tronscan.org'
    ],
    'testnet' => [
        'host' => 'https://api.shasta.trongrid.io',
        'explorer' => 'https://shasta.tronscan.org'
    ],
    'nile' => [
        'host' => 'https://nile.trongrid.io',
        'explorer' => 'https://nile.tronscan.org'
    ]
]
```

Usage
-----

[](#usage)

### Laravel Usage

[](#laravel-usage)

#### 1. Installation in Laravel

[](#1-installation-in-laravel)

```
composer require jackillll/tron
```

#### 2. Publish Configuration

[](#2-publish-configuration)

```
php artisan vendor:publish --provider="Jackillll\Tron\TronServiceProvider"
```

#### 3. Environment Configuration

[](#3-environment-configuration)

Add to your `.env` file:

```
TRON_NETWORK=mainnet
TRON_USE_SOLIDITY=false
TRON_API_KEY=your-trongrid-api-key
TRON_PRIVATE_KEY=your-private-key
TRON_ADDRESS=your-address
TRON_TIMEOUT=30000
```

#### 4. Laravel Usage Examples

[](#4-laravel-usage-examples)

**Using Dependency Injection:**

```
