balance.php 547 B

12345678910111213141516
  1. <?php
  2. include_once '../vendor/autoload.php';
  3. $fullNode = new \IEXBase\TronAPI\Provider\HttpProvider('https://api.trongrid.io');
  4. $solidityNode = new \IEXBase\TronAPI\Provider\HttpProvider('https://api.trongrid.io');
  5. $eventServer = new \IEXBase\TronAPI\Provider\HttpProvider('https://api.trongrid.io');
  6. try {
  7. $tron = new \IEXBase\TronAPI\Tron($fullNode, $solidityNode, $eventServer);
  8. } catch (\IEXBase\TronAPI\Exception\TronException $e) {
  9. exit($e->getMessage());
  10. }
  11. $tron->setAddress('address');
  12. $balance = $tron->getBalance(null, true);