account.php 655 B

123456789101112131415161718192021222324
  1. <?php
  2. include_once '../vendor/autoload.php';
  3. try {
  4. $tron = new \IEXBase\TronAPI\Tron();
  5. $generateAddress = $tron->generateAddress(); // or createAddress()
  6. $isValid = $tron->isAddress($generateAddress->getAddress());
  7. echo 'Address hex: '. $generateAddress->getAddress();
  8. echo 'Address base58: '. $generateAddress->getAddress(true);
  9. echo 'Private key: '. $generateAddress->getPrivateKey();
  10. echo 'Public key: '. $generateAddress->getPublicKey();
  11. echo 'Is Validate: '. $isValid;
  12. echo 'Raw data: '.$generateAddress->getRawData();
  13. } catch (\IEXBase\TronAPI\Exception\TronException $e) {
  14. echo $e->getMessage();
  15. }