feat(wallet): Add ability to track wallet transaction history#1041
Open
edgarmuyomba wants to merge 5 commits into
Open
feat(wallet): Add ability to track wallet transaction history#1041edgarmuyomba wants to merge 5 commits into
edgarmuyomba wants to merge 5 commits into
Conversation
…history - add a WalletTransactionState
- cover crud operations - cover wallet cli operations
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1041 +/- ##
==========================================
+ Coverage 75.09% 75.26% +0.17%
==========================================
Files 110 111 +1
Lines 12093 12193 +100
==========================================
+ Hits 9081 9177 +96
- Misses 3012 3016 +4 ☔ View full report in Codecov by Harness. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #173
Supersedes #315
Summary
This PR introduces functionality to the wallet to be able to keep track of past transactions. It adds code that hooks into transaction facing functions of the wallet to store transaction details in the
transactionsdatabase table that can be queried later to examine the history.Changes
m017to create the transactions tablestore_transactions(...),update_transaction_state(...)andget_transaction_state(...)->cashu/wallet/crud.pysend,receive,mintandmeltmethods in thecashu/wallet/helpers.pyandcashu/wallet/wallet.pyfiles to store and update transactions when they take placehistorycommand to the wallet cli incashu/wallet/cli/cli.py.tests/wallet/test_wallet_cli.pyandtests/wallet/test_wallet_crud_unit.pycovering storing, update and querying of the transactions tableTransactions Table Structure
Example Ouput
After running command
cashu history-------------- Transaction history -------------- Type Amount State Time ------------------------------------------------- mint +100000 sat completed 2026-06-09 05:28 melt -1 sat completed 2026-06-09 05:23 mint +100 sat completed 2026-06-09 03:19 send -300 sat completed 2026-06-09 03:18