PHPackages                             ufado/tron-api - 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. ufado/tron-api

ActiveLibrary[API Development](/categories/api)

ufado/tron-api
==============

A PHP API for interacting with Tron (Trx),support Stake2.0

1.1(1y ago)6207↓100%21MITPHPPHP ^7.2

Since May 25Pushed 1y ago2 watchersCompare

[ Source](https://github.com/ufado/tron-api)[ Packagist](https://packagist.org/packages/ufado/tron-api)[ Docs](https://github.com/ufado/tron-api)[ RSS](/packages/ufado-tron-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (5)Versions (3)Used By (1)

TRON API
========

[](#tron-api)

A PHP API for interacting with the Tron Protocol

[![Latest Stable Version](https://camo.githubusercontent.com/2480ee01b1548a24d9bca7db347007ab78c56e372287856641da5cfe51042eb5/68747470733a2f2f706f7365722e707567782e6f72672f756661646f2f74726f6e2d6170692f76657273696f6e)](https://packagist.org/packages/ufado/tron-api)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://camo.githubusercontent.com/fab3c9571dd7f8e09f404f1b9bd1382b8a7a9d3d3975c22a4ddbc93acebe6d9f/68747470733a2f2f6170692e7472617669732d63692e636f6d2f756661646f2f74726f6e2d6170692e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/ufado/tron-api)[![Issues](https://camo.githubusercontent.com/6be5a06b6e279bdc61e665ad23e1b33a2c2cb96f681bd44c65540c4ce4d6f33c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f756661646f2f74726f6e2d6170692e737667)](https://github.com/ufado/tron-api/issues)[![Pull Requests](https://camo.githubusercontent.com/e4348b446b96fbb0e39ef3f4f9c290aceb6aa685b394c90393eebadfb7a52a7a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732d70722f756661646f2f74726f6e2d6170692e737667)](https://github.com/ufado/tron-api/pulls)[![Contributors](https://camo.githubusercontent.com/ded6377fc8e1fd5bc56e83fa03ee5e1240980305221c45071cdefeb07448c4fc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f756661646f2f74726f6e2d6170692e737667)](https://github.com/ufado/tron-api/graphs/contributors)

Install
-------

[](#install)

```
> composer require ufado/tron-api
```

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

[](#requirements)

The following versions of PHP are supported by this version.

- PHP 7.1
- PHP 7.2
- PHP 7.3

Example Usage
-------------

[](#example-usage)

```
use IEXBase\TronAPI\Tron;

$fullNode = new \IEXBase\TronAPI\Provider\HttpProvider('https://api.trongrid.io');
$solidityNode = new \IEXBase\TronAPI\Provider\HttpProvider('https://api.trongrid.io');
$eventServer = new \IEXBase\TronAPI\Provider\HttpProvider('https://api.trongrid.io');

try {
    $tron = new \IEXBase\TronAPI\Tron($fullNode, $solidityNode, $eventServer);
} catch (\IEXBase\TronAPI\Exception\TronException $e) {
    exit($e->getMessage());
}

$this->setAddress('..');
//Balance
$tron->getBalance(null, true);

// Transfer Trx
var_dump($tron->send('to', 1.5));

//Generate Address
var_dump($tron->createAccount());

//Get Last Blocks
var_dump($tron->getLatestBlocks(2));

//Change account name (only once)
var_dump($tron->changeAccountName('address', 'NewName'));
```

Stake 2.0
---------

[](#stake-20)

Support stake2.0,you can see example usage in [/examples/stake2.php](/examples/stake2.php)

```
public function sendDelegate(string $to, float $amount,string $resource = 'ENERGY',  $lock=false,$lock_period=0,string $from=null)
public function sendUnDelegate(string $to, float $amount,string $resource = 'ENERGY',string $from=null): array
public function freezeBalanceV2(float $amount = 0, string $resource = 'ENERGY', string $owner_address = null)
public function getCanDelegatedMaxSize(int $type = 1,string $address = null)
public function getAvailableUnfreezeCount(string $address = null)
```

Testing
-------

[](#testing)

```
$ vendor/bin/phpunit
```

Donations
---------

[](#donations)

**Send me on Tron**: TFFEFBLX8C56A8SUA61ToPqgD21aASK1dy

**Send to iexbase on Tron**: TRWBqiqoFZysoAeyR1J35ibuyc8EvhUAoY

Thanks
------

[](#thanks)

Thanks for the hard work by [iexbase](https://github.com/iexbase)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

2

Last Release

711d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/190b839e916164fab5feb86b1fc2ddc4086d8bc5efa1640e4c5ab4f1d7ff247f?d=identicon)[ufado](/maintainers/ufado)

---

Top Contributors

[![ufado](https://avatars.githubusercontent.com/u/162969789?v=4)](https://github.com/ufado "ufado (3 commits)")

---

Tags

iexbasetron-libtron-phptron-apitron-rest-apiufado

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ufado-tron-api/health.svg)

```
[![Health](https://phpackages.com/badges/ufado-tron-api/health.svg)](https://phpackages.com/packages/ufado-tron-api)
```

###  Alternatives

[iexbase/tron-api

A PHP API for interacting with Tron (Trx)

437136.9k8](/packages/iexbase-tron-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
