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

rate limit error #171

Open es-taheri opened 1 year ago

es-taheri commented 1 year ago

{"Error":"request rate exceeded the allowed_rps(10), and the query server is suspended for 5 s"} How Can I fix this rate limit error? 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) { SendMessage(REPORT_CHANNEL, "❗️Tron Blockchain Error While Checking Payments On Cron : " . $e->getMessage()); break; }
$tron->setAddress($u_wallet_trx_address); $balance = $tron->getBalance(null, true); $tron->setPrivateKey($u_wallet_trx_pvkey); $result = $tron->send(trx_wallet, $balance - '0.000001')['result'];

xiaolan36 commented 7 months ago

vendor\iexbase\tron-api\src\Provider\HttpProvider.php __construct() join in $headers=array_merge($headers,[ 'TRON-PRO-API-KEY' => 'youkey', 'Accept' => 'application/json' ]);

key: https://www.trongrid.io/dashboard