File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 11
11
exit ($ e ->getMessage ());
12
12
}
13
13
14
+ // get transaction by tx id
14
15
$ detail = $ tron ->getTransaction ('TxId ' );
16
+ var_dump ($ detail );
17
+
18
+ // get all transaction by address
19
+ $ address = 'this is you address ' ;
20
+ $ detail = $ tron ->getTransactions ($ address , 100 );
21
+ var_dump ($ detail );
22
+
23
+ // TRC20 All transactions
24
+ $ contractAddress = 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t ' ; //mainnet usdt contract address
25
+ $ trc20Contract = new \IEXBase \TronAPI \TRC20Contract ($ tron , $ contractAddress );
26
+ $ detail = $ trc20Contract ->getTransactions ($ address , 100 );
15
27
var_dump ($ detail );
Original file line number Diff line number Diff line change @@ -1386,4 +1386,18 @@ public function getTokenByID(string $token_id): array
1386
1386
'value ' => $ token_id
1387
1387
]);
1388
1388
}
1389
+
1390
+ /**
1391
+ * TRX All transactions
1392
+ *
1393
+ * @param string $address
1394
+ * @param int $limit
1395
+ * @return array
1396
+ *
1397
+ * @throws TronException
1398
+ */
1399
+ public function getTransactions (string $ address , int $ limit = 100 ): array
1400
+ {
1401
+ return $ this ->manager ->request ("v1/accounts/ {$ address }/transactions?limit= {$ limit }" , [], 'get ' );
1402
+ }
1389
1403
}
You can’t perform that action at this time.
0 commit comments