PHPackages                             fenguoz/tron-php - 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. fenguoz/tron-php

ActiveLibrary[API Development](/categories/api)

fenguoz/tron-php
================

Support TRON's TRX and TRC20, which include functions such as address creation, balance query, transaction transfer, query the latest blockchain, query information based on the blockchain, and query information based on the transaction hash

2.1.0(1y ago)21436.6k↓23%74[24 issues](https://github.com/Fenguoz/tron-php/issues)1MITPHPPHP &gt;=8.0

Since Mar 10Pushed 1y ago7 watchersCompare

[ Source](https://github.com/Fenguoz/tron-php)[ Packagist](https://packagist.org/packages/fenguoz/tron-php)[ Docs](https://github.com/Fenguoz/tron-php)[ RSS](/packages/fenguoz-tron-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (18)Used By (1)

English | [中文](./README-CN.md)

TRON-PHP
========

[](#tron-php)

 [![Stable Version](https://camo.githubusercontent.com/114e33f87e857c23c918d7e6753ff8fcc277c1ad26486b2cb178c0ad34200f49/68747470733a2f2f706f7365722e707567782e6f72672f46656e67756f7a2f74726f6e2d7068702f762f737461626c65)](https://github.com/Fenguoz/tron-php/releases) [![Php Version](https://camo.githubusercontent.com/b89e839d5d52995202e3f77713d3272afdfffacf314e3562e9a20a1d070b6ff7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d372e322d627269676874677265656e2e7376673f6d61784167653d32353932303030)](https://www.php.net) [![tron-php License](https://camo.githubusercontent.com/f373bee380205f47653283976b47db06ef0a5013684d6607d02e0c62d593466c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f66656e67756f7a2f74726f6e2d7068702e7376673f6d61784167653d32353932303030)](https://github.com/Fenguoz/tron-php/blob/master/LICENSE) [![Total Downloads](https://camo.githubusercontent.com/f9e231e9a1aee50da7ce0fff4f3244e2b27e67e02686b9ecd3418a270ccc61d4/68747470733a2f2f706f7365722e707567782e6f72672f46656e67756f7a2f74726f6e2d7068702f646f776e6c6f616473)](https://packagist.org/packages/Fenguoz/tron-php)

Introduction
------------

[](#introduction)

Support TRON's TRX and TRC20, which include functions such as address creation, balance query, transaction transfer, query the latest blockchain, query information based on the blockchain, and query information based on the transaction hash

Advantage
---------

[](#advantage)

1. One set of scripts is compatible with all TRX currencies and TRC20 certifications in the TRON network
2. Interface methods can be added or subtracted flexibly

Support Method
--------------

[](#support-method)

- Generate address `generateAddress()`
- Verify address `validateAddress(Address $address)`
- Get the address according to the private key `privateKeyToAddress(string $privateKeyHex)`
- Check balances `balance(Address $address)`
- Transaction transfer (offline signature) `transfer(string $from, string $to, float $amount)`
- Query the latest block `blockNumber()`
- Query information according to the blockchain `blockByNumber(int $blockID)`
- \*Query information based on transaction hash `transactionReceipt(string $txHash)`

Quick Start
-----------

[](#quick-start)

### Install

[](#install)

PHP8

```
composer require fenguoz/tron-php
```

or PHP7

```
composer require fenguoz/tron-php ~1.3
```

### Interface

[](#interface)

```
use GuzzleHttp\Client;

$uri = 'https://api.trongrid.io';// mainnet
// $uri = 'https://api.shasta.trongrid.io';// shasta testnet
$api = new \Tron\Api(new Client(['base_uri' => $uri]));

$trxWallet = new \Tron\TRX($api);
$addressData = $trxWallet->generateAddress();
// $addressData->privateKey
// $addressData->address

$config = [
    'contract_address' => 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t',// USDT TRC20
    'decimals' => 6,
];
$trc20Wallet = new \Tron\TRC20($api, $config);
$addressData = $trc20Wallet->generateAddress();
```

Plan
----

[](#plan)

- Support TRC10
- Smart Contract

Package
-------

[](#package)

NamedescriptionScenes[Fenguoz/tron-api](https://github.com/Fenguoz/tron-api)TRON official document recommends PHP extension packageTRON basic API🌟🌟
--

[](#)

[![Stargazers over time](https://camo.githubusercontent.com/1a2184439be9c2a77da503058f317e166c7aba316d2c1321806ed79c8211e6bc/68747470733a2f2f7374617263686172742e63632f46656e67756f7a2f74726f6e2d7068702e737667)](https://starchart.cc/Fenguoz/tron-php)

Cooperate
---------

[](#cooperate)

Contact

- WX：zgf243944672
- QQ：243944672

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity48

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 92.3% 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 ~78 days

Recently: every ~296 days

Total

17

Last Release

640d ago

Major Versions

0.1.9 → 1.0.02021-04-01

1.3.0 → 2.0.02023-02-09

### Community

Maintainers

![](https://www.gravatar.com/avatar/b1a4edd9ce705e6ea4c191715ec70228e641722feacc44a8fd634088e4287c1f?d=identicon)[243944672](/maintainers/243944672)

---

Top Contributors

[![Fenguoz](https://avatars.githubusercontent.com/u/28383092?v=4)](https://github.com/Fenguoz "Fenguoz (36 commits)")[![jiangjiangdev](https://avatars.githubusercontent.com/u/14857580?v=4)](https://github.com/jiangjiangdev "jiangjiangdev (2 commits)")[![iskander-g](https://avatars.githubusercontent.com/u/4549657?v=4)](https://github.com/iskander-g "iskander-g (1 commits)")

---

Tags

phprpctrc20trontrxphptrontrxtrc20

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fenguoz-tron-php/health.svg)

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

###  Alternatives

[takpesar/tron

A PHP library to create Tron wallet addresses and manage wallets using the Tron API

183.2k](/packages/takpesar-tron)[fenguoz/bsc-php

Support Binance's BNB and BEP20, which include functions such as address creation, balance query, transaction transfer, query the latest blockchain, query information based on the blockchain, and query information based on the transaction hash

4720.9k](/packages/fenguoz-bsc-php)

PHPackages © 2026

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