-
Notifications
You must be signed in to change notification settings - Fork 329
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
Transaction Sorting and Querying #794
Comments
Hi @allisonmoyer I can give some commentary about where we're going with this. BDK is moving towards a v1.0 release. I made the first PR for this yesterday #793. The good news is that in We have the ability to search for transactions in a height range already: https://github.com/LLFourn/bdk_core_staging/blob/c4de0235bae61d9e51dbe16f13a3c1c658444676/bdk_core/src/sparse_chain.rs#L386 We are planning to allow attaching some associated data to transactions in the |
Need to confirm how this should be done with the new wallet API. I don't think the best way to do this will be via queries directly on the DB, it should be more efficient to do with the new in memory view of the wallet transactions. |
I have rough plan in #1333 for how to sort transaction in the way I think applications should display them which is by the first time they saw the transaction i.e. transactions don't move place in the list. Other indexes can of course be implemented by applications separately but that seems like the default one that will satisfy most people. This would also keep transactions that are not in the chain in the list but allow you to tell what happened to them (RBF, re-org) etc. I would consider including this as the last task for v1.0 after #1194 |
Describe the enhancement
We'd like to be able to sort transactions at the DB layer and be able to paginate (and maybe in the future search) queries to the transactions.
Use case
We want to display transactions to our customers in a sorted manner. We can do this by first querying all transactions and then sorting them after the fact, but this won't perform well once customers have a large number of transactions.
Currently we are thinking of sorting based on confirmation time for confirmed transactions and no sorting for unconfirmed transactions, but we may explore associating metadata with transactions (i.e. "initiation date" for when the transaction was initiated) and would want to be able to sort transactions based on that (this would help us sort unconfirmed transactions).
In the future, we may also allow customers to filter / search their transactions – ideally we could associate some sort of metadata here that we could filter / search by, but in a simpler use case could also imagine looking up date ranges (i.e. searching / grouping by confirmation time).
The text was updated successfully, but these errors were encountered: