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

ActiveLibrary[API Development](/categories/api)

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

01PHP

Since Feb 26Pushed 3y agoCompare

[ Source](https://github.com/doveCat/tron-php)[ Packagist](https://packagist.org/packages/dovecat/tron-php)[ RSS](/packages/dovecat-tron-php/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

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

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity23

Early-stage or recently created project

 Bus Factor1

Top contributor holds 94.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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/9176c21f429e0cb73dfdc40a28ba587742946e39ab092f5490276f946d97838f?d=identicon)[doveCat](/maintainers/doveCat)

---

Top Contributors

[![Fenguoz](https://avatars.githubusercontent.com/u/28383092?v=4)](https://github.com/Fenguoz "Fenguoz (33 commits)")[![doveCat](https://avatars.githubusercontent.com/u/95156150?v=4)](https://github.com/doveCat "doveCat (2 commits)")

### Embed Badge

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

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

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k13](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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