just-luka/php-tron
最新稳定版本:v1.1.1
Composer 安装命令:
composer require just-luka/php-tron
包简介
PHP package for interacting with TRX network
README 文档
README
A PHP library for interacting with the TRON blockchain.
Package provides user-friendly extension API. The latest version of TronGrid's proprietary API is v1. TronGrid API service has the features of low latency, high consistency, high availability and partition fault tolerance.
Note: In order to ensure the reasonable allocation of requested resources, all request APIs need to include the API Key parameter.
Requests without an API Key will be severely limited or may not receive a response.
Features
- Generate TRON address
- Check account balance
- Check transaction details
- List assets from chain
- List transactions by contract address
Installation
Install the package via Composer:
composer require just-Luka/php-tron
Usage
Initialize the Client (Mainnet)
use Trx\TrxClient; $tron = new TronClient('API-KEY');
Initialize the Client (Shasta Testnet)
use Trx\TrxClient; $tron = new TronClient(testmode: true);
Example
Generate TRON address
$wallet = $tron->wallet()->create(); echo $wallet->getAddress(); echo $wallet->getPrivateKey();
TRON balance
$account = $tron->account('TDrbCtdTj5KMo67mtQw2XXu5eTqwwVYoKz'); echo $account->explore()->balance;
Transactions
$account = $tron->account('TDrbCtdTj5KMo67mtQw2XXu5eTqwwVYoKz'); $transactions = $account->transactions(); # Or $transactions = $account->filterLimit(10)->filterOnlyConfirmed()->transactions(); # Apply filters var_dump($transactions);
统计信息
- 总下载量: 15
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-04