Tron ( TRX ) crypto currency API ! This library facilitates connectivity to the Tron network, enabling you to generate a personalized wallet address. This is achieved through utilization of the Tron API.
composer require takpesar/tron
This package requires PHP 8 or later. GMP and curl extensions require this package
<?php
require __DIR__ . '/vendor/autoload.php';
use Tak\Tron\API;
$tron = new API();
$address = $tron->generateAddress();
var_dump($address);
$tron = new API(privatekey : $address->privatekey,wallet : $address->wallet);
$balance = $tron->getBalance();
print 'your balance : '.$balance;
print PHP_EOL;
try {
$send = $tron->sendTron(to : 'TJZfm2PSQ38WNwzPqSBpTbVAynZpMEmfKR',amount : 10.5);
print 'transaction : '.var_export($send,true);
} catch(Throwable $e){
print 'transaction error : '.$e->getMessage();
}
<?php
copy('https://tron.phar.fun/tron.phar','trx.phar');
require_once './trx.phar';
use Tak\Tron\API;
$tron = new API();
$address = $tron->generateAddress();
var_dump($address);
Note Please see
examples
for more examples
Should you encounter any issues, please do not hesitate to reach out to us via email at loser.man.2007@gmail.com
.
The MIT License (MIT). Please see LICENSE
for more information.