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

ActiveLibrary[API Development](/categories/api)

nature6016/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

v1.0.1(3y ago)07MITPHP

Since Jan 22Pushed 3y ago1 watchersCompare

[ Source](https://github.com/nature6016/tron-php)[ Packagist](https://packagist.org/packages/nature6016/tron-php)[ Docs](https://github.com/nature6016/tron-php)[ RSS](/packages/nature6016-tron-php/feed)WikiDiscussions main Synced yesterday

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

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

TRON-PHP
========

[](#tron-php)

 [![Php Version](https://camo.githubusercontent.com/b89e839d5d52995202e3f77713d3272afdfffacf314e3562e9a20a1d070b6ff7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d372e322d627269676874677265656e2e7376673f6d61784167653d32353932303030)](https://www.php.net) [![Hyperf License](https://camo.githubusercontent.com/884e555081e73c251aa3b8e8706ad6847ffc7c2a73867508e96bfb477f99bab8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6879706572662f6879706572662e7376673f6d61784167653d32353932303030)](https://github.com/hyperf/hyperf/blob/master/LICENSE)

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)

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

### 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[iexbase/tron-api](https://github.com/iexbase/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：18589058898
- QQ：996666016

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

1257d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/94d7aa406df1491af403c2fd42d173bcce603995c54aaed08ae7f340b271159b?d=identicon)[nature6016](/maintainers/nature6016)

---

Top Contributors

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

---

Tags

phptrontrxtrc20

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[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

21438.8k1](/packages/fenguoz-tron-php)[takpesar/tron

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

193.3k](/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

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

PHPackages © 2026

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