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

ActiveLibrary[API Development](/categories/api)

jinfakeji168/tron-api
=====================

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

1.1.2(1y ago)0371MITPHPPHP ^7.2|^8.0

Since May 25Pushed 8mo agoCompare

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

READMEChangelog (2)Dependencies (5)Versions (5)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

32

—

LowBetter than 72% of packages

Maintenance51

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~63 days

Total

4

Last Release

525d ago

PHP version history (2 changes)1.0PHP ^7.2

1.1.1PHP ^7.2|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b170667787ca6d42bb749af6dce773bfe28a4c3f5f907ca6089091ab470bb6c?d=identicon)[jinfakeji168](/maintainers/jinfakeji168)

---

Top Contributors

[![jinfakeji168](https://avatars.githubusercontent.com/u/155955836?v=4)](https://github.com/jinfakeji168 "jinfakeji168 (3 commits)")[![ufado](https://avatars.githubusercontent.com/u/162969789?v=4)](https://github.com/ufado "ufado (3 commits)")[![1768177868](https://avatars.githubusercontent.com/u/14767215?v=4)](https://github.com/1768177868 "1768177868 (1 commits)")[![wangxuancheng-dev](https://avatars.githubusercontent.com/u/14767215?v=4)](https://github.com/wangxuancheng-dev "wangxuancheng-dev (1 commits)")

---

Tags

iexbasetron-libtron-phptron-apitron-rest-apiufado

###  Code Quality

TestsPHPUnit

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/jinfakeji168-tron-api/health.svg)](https://phpackages.com/packages/jinfakeji168-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)
