Stars: 147
Forks: 64
Pull Requests: 1
Issues: 36
Watchers: 8
Last Updated: 2023-02-10 01:19:52
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
License: MIT License
Languages: PHP
English | 中文
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
generateAddress()
validateAddress(Address $address)
privateKeyToAddress(string $privateKeyHex)
balance(Address $address)
transfer(string $from, string $to, float $amount)
blockNumber()
blockByNumber(int $blockID)
transactionReceipt(string $txHash)
PHP8
composer require fenguoz/tron-php
or PHP7
composer require fenguoz/tron-php ~1.3
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();
Name | description | Scenes |
---|---|---|
Fenguoz/tron-api | TRON official document recommends PHP extension package | TRON basic API |
Contact