tronprotocol / java-tron

Java implementation of the Tron whitepaper
GNU Lesser General Public License v3.0
3.68k stars 1.38k forks source link

API to get user transaction list #5902

Closed SugamKuber closed 3 weeks ago

SugamKuber commented 1 month ago

We don't have any API to query local java tron node directly to get users address/contact address transactions list There are API's from tronscanapi, trongrid but I dont want to call any of these, I need to make use of my hosted node to list transactions

FULL NODE HTTP API from tron doc has POST request to get the transaction detail by querying with Transaction ID which is named GetTransactionById & we also have GetTransactionInfoById, GetTransactionInfoByBlockNum but none of these can be used to get a particular users/contracts transactions history

There was a similar issue back then ISSUE-5107 but this was closed by concluding use trongrid API.

We need to write a new function in java-tron which will get transactions based on multiple parameters.

ferdinand026 commented 1 month ago

It may be hard to realize your requirement on common fullnode, querying an address's transaction list is time-consuming or space-consuming. But if we run a fullnode, and it serves ourselves, we can modify the code to realize it by ourself.

If you only want to call the fullnode's interface now, maybe the only way is to parse the blocks and save the useful data into our own database, here is a guide.

lvs007 commented 3 weeks ago

Please feel free to re-open it if you still see the issue, thanks.