Skip to content

Commit

Permalink
example generate local address
Browse files Browse the repository at this point in the history
  • Loading branch information
serderovsh committed Sep 23, 2020
1 parent afd3ddf commit 0b286ea
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions examples/account.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
include_once '../vendor/autoload.php';

try {
$tron = new \IEXBase\TronAPI\Tron();

$generateAddress = $tron->generateAddress(); // or createAddress()
$isValid = $tron->isAddress($generateAddress->getAddress());


echo 'Address hex: '. $generateAddress->getAddress();
echo 'Address base58: '. $generateAddress->getAddress(true);
echo 'Private key: '. $generateAddress->getPrivateKey();
echo 'Public key: '. $generateAddress->getPublicKey();
echo 'Is Validate: '. $isValid;

echo 'Raw data: '.$generateAddress->getRawData();

} catch (\IEXBase\TronAPI\Exception\TronException $e) {
echo $e->getMessage();
}



0 comments on commit 0b286ea

Please sign in to comment.