-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature/REST] Pagination by index for address|scripthash txs/chain endpoint #50
base: new-index
Are you sure you want to change the base?
Conversation
Hi @junderw, thanks for writing the PR! There were three reasons I implemented pagination using the 'last seen' strategy rather than index numbers:
Pagination is not available for mempool transactions at all for similar reasons, since the entire tx set may change at any time and there's no reasonably consistent way to paginate it. You can only get the "first" Can you tell me more about your need for index-based paging? Is that so its possible to link directly to the Nth page instead of only the next/previous page? |
This is precisely the feature we're looking for. As a user with an address that has 100 pages of transactions, and I want to look for one of my first transactions, the current method requires skipping through 100 clicks and loads of the "next" button etc. Whereas clicking a "last" or "99" button will just pass along 98 * 25 (2450) to the endpoint to get the transactions. People who hit "next" or "2" when on "1" we can use the last seen feature as is. Usually people jumping 10-20 pages don't care if a transaction bumped everything down 1 while they reload, since clicking on "page 87" is not a precise window to begin with. |
Fix: Chunk RPC requests to 50k each
76e8821
to
b02a22a
Compare
Fix crashes for unknown Outpoint
b02a22a
to
2494a02
Compare
…ectrum (Requires merge by @wiz) Feat: Unix sockets for Electrum RPC
Mempool (which relies on this endpoint for its address pages) currently can only implement "next page" on the address page since there is no way to skip a certain number of transactions.
ie. If an address has 100 transactions, right now it shows the first 25 and you have to click "show more" and it fetches the next 25 with the last_seen_txid of the last tx on the current page.
With this patch, they can provide links numbered 1, 2, 3, 4, and clicking on 3 will pass
"50"
instead of the hex txid, which will skip the first 50 transactions and display starting from the 51st transaction.If there are other endpoints you'd like to be index-paginated where they used to be hex id paginated, we can do something similar as well.
Just submitting my initial impl to get feedback.