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

ActiveLibrary[API Development](/categories/api)

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

1.0.0(2y ago)012MITPHPPHP &gt;=8.0

Since Aug 27Pushed 2y ago1 watchersCompare

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

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

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

TRON-PHP
========

[](#tron-php)

 [![Stable Version](https://camo.githubusercontent.com/a7b54424e81da4c204088cf92cb2b38d6fe7c7a759dc5ce35d1887a97899d192/68747470733a2f2f706f7365722e707567782e6f72672f7869616f6875617368656e673078312f74726f6e2d7068702f762f737461626c65)](https://github.com/xiaohuasheng0x1/tron-php/releases) [![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) [![Total Downloads](https://camo.githubusercontent.com/e05b71997ec5fa156ebf7950ba28a7f3e3ed639fce9a6e40fd8a9f62996ecf29/68747470733a2f2f706f7365722e707567782e6f72672f7869616f6875617368656e673078312f74726f6e2d7068702f646f776e6c6f616473)](https://packagist.org/packages/xiaohuasheng0x1/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)

```
composer require xiaohuasheng0x1/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/7fcf0211146430ad0778fded1b698a059bff48299077ab42d7c85de5528e6237/68747470733a2f2f7374617263686172742e63632f7869616f6875617368656e673078312f74726f6e2d7068702e737667)](https://starchart.cc/xiaohuasheng0x1/tron-php)

Cooperate
---------

[](#cooperate)

Contact

- TG: @X\_H\_S\_001

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

Every ~0 days

Total

2

Last Release

987d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4646175128c98659d5d3409a25c6122e7752dca1c5dcc99b3c00692d15434300?d=identicon)[xiaohuasheng0x1](/maintainers/xiaohuasheng0x1)

---

Top Contributors

[![xiaohuasheng0x1](https://avatars.githubusercontent.com/u/126474581?v=4)](https://github.com/xiaohuasheng0x1 "xiaohuasheng0x1 (5 commits)")

---

Tags

phptrontrxtrc20

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

21436.6k1](/packages/fenguoz-tron-php)[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)
