iexbase / tron-api

A PHP API for interacting with Tron (TRX)
https://iexbase.github.io/tron-api/
MIT License
405 stars 287 forks source link

getTransactionCount #185

Open Tak-Pesar opened 1 year ago

Tak-Pesar commented 1 year ago

this is my code :

$fullNode = new \IEXBase\TronAPI\Provider\HttpProvider('https://api.trongrid.io');
$solidityNode = new \IEXBase\TronAPI\Provider\HttpProvider('https://api.trongrid.io');
$eventServer = new \IEXBase\TronAPI\Provider\HttpProvider('https://api.trongrid.io');

try {
    $tron = new \IEXBase\TronAPI\Tron($fullNode, $solidityNode, $eventServer);
} catch (\IEXBase\TronAPI\Exception\TronException $e) {
    exit($e->getMessage());
}

$tron->setAddress('...');

$tron->setPrivateKey('...');

var_dump($tron->getBalance(fromTron : true)); // 100

var_dump($tron->getTransactionCount());

IEXBase\TronAPI\Tron::getTransactionCount(): Return value must be of type int, null returned 671 Undefined array key "num" 671

this url for Transactions changed ! and also :

var_dump($tron->getTransactionsRelated('...','to'));

i get this error :

Client error: POST https://api.trongrid.io/walletextension/gettransactionstothis resulted in a 405 Method Not Allowed response:

Error 405 HTTP method POST (truncated...)

113

I also had this problem in the Python library and I brought it to your attention