1234567891011121314151617181920212223 |
- <?php
- include_once '../vendor/autoload.php';
- $fullNode = new \IEXBase\TronAPI\Provider\HttpProvider('https://api.trongrid.io');
- $solidityNode = new \IEXBase\TronAPI\Provider\HttpProvider('https://api.trongrid.io');
- $eventServer = new \IEXBase\TronAPI\Provider\HttpProvider('https://api.trongrid.io');
- try {
- $tron = new \IEXBase\TronAPI\Tron($fullNode, $solidityNode, $eventServer);
- } catch (\IEXBase\TronAPI\Exception\TronException $e) {
- exit($e->getMessage());
- }
- $tron->setAddress('address');
- $tron->setPrivateKey('privateKey');
- try {
- $transfer = $tron->send( 'ToAddress', 1);
- } catch (\IEXBase\TronAPI\Exception\TronException $e) {
- die($e->getMessage());
- }
- var_dump($transfer);
|