-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Description
Tron is not token yet.
This code return valid tron address. Please update your code to was possible get address from a box.
./hd-wallet-derive/hd-wallet-derive.php --coin=ETH --mnemonic="mnemonic" --mnemonic-pw="password" --path="m/44'/195'/0'/0/0" -g --numderive=1 --format=csv
use BitcoinPHP\BitcoinECDSA\BitcoinECDSA;
use IEXBase\TronAPI\Support\Utils as TronUtils;
use IEXBase\TronAPI\Tron;
$fullNode = new HttpProvider('https://api.trongrid.io');
$solidityNode = new HttpProvider('https://api.trongrid.io');
$eventServer = new HttpProvider('https://api.trongrid.io');
$blockchain = new Tron($fullNode, $solidityNode, $eventServer);
function getTronAddress($privateKey)
{
$bitcoinECDSA = new BitcoinECDSA();
$bitcoinECDSA->setPrivateKey($privateKey);
$publicKey = $bitcoinECDSA->getUncompressedPubKey();
$address = TronUtils::pubKeyToAddress($publicKey);
return $blockchain ->hexString2Address($address);
}
Metadata
Metadata
Assignees
Labels
No labels