lily-wallet icon indicating copy to clipboard operation
lily-wallet copied to clipboard

transactions pagination

Open vesparny opened this issue 5 years ago • 4 comments

Hi, I see blockstream rteturns a max of 50 txs per addrress. Is pagination already implemented in the code or you only show the last 50 transactions?

Thanks

vesparny avatar Sep 14 '20 15:09 vesparny

I don't do anything with pagination at the moment but most addresses only have two transactions: one incoming and one outgoing.

KayBeSee avatar Sep 15 '20 02:09 KayBeSee

I see. I guess it could be a problem for xpubs used for DCA. Imagine stacking sats every 3 days, in that case it would be easy to reach the limit of 50 transactions.

vesparny avatar Sep 15 '20 13:09 vesparny

From my understanding, it is 50 txs per address. Wallets that follow best practices don't reuse addresses, so when the user goes to the receive page, they are always given a fresh address with zero transactions associated with it.

In your example with DCA, unless there is auto withdraw to a specific address (I believe Swan does this) then yes I can see it hitting that limit but I don't think many folks do that. The 50 tx limit could also be hit if the user posted a static address somewhere (like a donation page) and had 50 people send money to it.

You're right though, for those weird edge cases, we should add logic in the tx fetching call to see if the response is 50 and if it is then making another request with the pagination value.

KayBeSee avatar Sep 15 '20 16:09 KayBeSee

yeah it's probably just an edge case. You are right.

vesparny avatar Sep 15 '20 16:09 vesparny