We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Following the example indicating to create a trc20 wallet, it is created correctly.
use GuzzleHttp\Client; $uri = 'https://api.trongrid.io';// mainnet // $uri = 'https://api.shasta.trongrid.io';// shasta testnet $api = new \Tron\Api(new Client(['base_uri' => $uri])); $trxWallet = new \Tron\TRX($api); $addressData = $trxWallet->generateAddress(); // $addressData->privateKey // $addressData->address $config = [ 'contract_address' => 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t',// USDT TRC20 'decimals' => 6, ]; $trc20Wallet = new \Tron\TRC20($api, $config); $addressData = $trc20Wallet->generateAddress();
But I try to modify the same code to get the balance and it gives errors.
These are the unsuccessful tests:
use GuzzleHttp\Client; $uri = 'https://api.trongrid.io';// mainnet // $uri = 'https://api.shasta.trongrid.io';// shasta testnet $api = new \Tron\Api(new Client(['base_uri' => $uri])); $wallet = "TXXXXX..."; $trxWallet = new \Tron\TRX($api); $balance = $trxWallet->balance($wallet); // $addressData->privateKey // $addressData->address $config = [ 'contract_address' => 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t',// USDT TRC20 'decimals' => 6, ]; $trc20Wallet = new \Tron\TRC20($api, $config); $balance = $trc20Wallet->balance($wallet);
I have also tried like this:
use GuzzleHttp\Client; $uri = 'https://api.trongrid.io';// mainnet // $uri = 'https://api.shasta.trongrid.io';// shasta testnet $api = new \Tron\Api(new Client(['base_uri' => $uri])); $wallet = "TXXXXX..."; $trxWallet = new \Tron\TRX($api); $balance = $trxWallet->balance(Address $wallet); // $addressData->privateKey // $addressData->address $config = [ 'contract_address' => 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t',// USDT TRC20 'decimals' => 6, ]; $trc20Wallet = new \Tron\TRC20($api, $config); $balance = $trc20Wallet->balance(Address $wallet);
The text was updated successfully, but these errors were encountered:
https://github.com/Fenguoz/tron-php/blob/master/tests/TRC20Test.php#L59
Sorry, something went wrong.
No branches or pull requests
Following the example indicating to create a trc20 wallet, it is created correctly.
But I try to modify the same code to get the balance and it gives errors.
These are the unsuccessful tests:
I have also tried like this:
The text was updated successfully, but these errors were encountered: