Skip to content

Commit fa56a33

Browse files
authored
Update getTransactions.php
You can now take the list of transactions until you encounter the error of too many requests from the server :) To avoid this problem, you can set the limit to 200 and call sleep function in loop
1 parent 9fd57c7 commit fa56a33

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

example/getTransactions.php

+11-1
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,20 @@
1111
$tron = new API();
1212
$tron->setWallet('TJZfm2PSQ38WNwzPqSBpTbVAynZpMEmfKR');
1313
14-
@params string $address = null bool $confirmed = null bool $to = false bool $from = false bool $searchinternal = true int $limit = 20 string $order = 'desc' int $mintimestamp = null int $maxtimestamp = null
14+
@params string $address = null bool $confirmed = null bool $to = false bool $from = false bool $searchinternal = true int $limit = 20 string $order = 'block_timestamp,desc' int $mintimestamp = null int $maxtimestamp = null
1515
@return mixed
1616
*/
1717

1818
$transactions = $tron->getTransactionsRelated(address : 'TJZfm2PSQ38WNwzPqSBpTbVAynZpMEmfKR',confirmed : true,limit : 5);
1919

2020
var_dump($transactions);
21+
22+
/*
23+
You can use a loop to continue the list of transactions and get all of them
24+
*/
25+
26+
foreach($transactions->iterator as $page => $transaction):
27+
print 'Page '.strval($page + 1);
28+
print PHP_EOL;
29+
var_dump($transaction);
30+
endforeach;

0 commit comments

Comments
 (0)