stacks-blockchain-api icon indicating copy to clipboard operation
stacks-blockchain-api copied to clipboard

Create an endpoint to fetch all account transactions at once with no query limit so we can give users there STX txs for tax reporting

Open BLuEScioN opened this issue 1 year ago • 1 comments

Context: https://hiropbc.slack.com/archives/C03UFUA5Q65/p1707775272136679

Trust Machines is trying to use the "Export as CSV" feature on the explorer to get a CSV of their transactions to use in filing their taxes. There are a couple issues they are running into:

The one that concerns the API is

The button only returns max 30 txs (the latest ones) because the endpoint has a query limit. In order to fetch all the transactions, the explorer would have to query for account txs in a loop until all ts have been fetched. The issue here is that would potentially cause rate limit issues, cause load issues on the API, and make bloat the FE with logic to handle all these concerns and the edge cases.

As it currently stands, I consider the "Export as CSV" button broken as it not only does not return all the txs but it misleadingly does so since it does not inform the user of the trnsaction cap or error out.

Can we create an endpoint that returns all of an account's txs with one query?

@rafaelcr pointed out there is a lot of data returned but the current endpoint (https://docs.hiro.so/api/get-account-transactions) that can be stripped out to make the page size smaller and the memory load on the server more maneagable.

BLuEScioN avatar Feb 12 '24 22:02 BLuEScioN

We can make a new endpoint with smaller entry sizes and therefore larger page limits, but I don't think it's a good idea to introduce an unbounded endpoint. Sounds like it would introduce a pretty severe ddos vulnerability.

zone117x avatar Feb 13 '24 15:02 zone117x