-
Notifications
You must be signed in to change notification settings - Fork 20
feat: load real transaction history in demo app #102
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
Open
j-kon
wants to merge
20
commits into
bitcoindevkit:main
Choose a base branch
from
j-kon:feat/bdk-demo-real-transaction-history
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
030bf85
docs: plan real transaction history
j-kon c5ffc47
refactor: rename transaction history model
j-kon 872f362
feat: map wallet transactions for history
j-kon 4fe1f20
feat: load real wallet transaction history
j-kon 08b201a
chore: clean up PR 102, delete docs, fix UTC time, handle no wallet s…
j-kon 6539787
refactor: extract hasActiveWalletProvider and remove real BDK wallet …
j-kon d7f3842
test: rename helper parameter to hasActiveWallet in transactions_list…
j-kon 720ce42
Scope transactions controller and details to active logical wallet ID
j-kon 51d2d75
Merge remote-tracking branch 'upstream/main' into feat/bdk-demo-real-…
j-kon 1bbf82a
fix(demo): clean up transaction history resources
j-kon 2bfc3ff
fix(demo): scope transaction state by wallet ID
j-kon ac5acbb
feat: automatically load and refresh transaction history
j-kon 82e246d
feat: auto-reload transactions in background after broadcast and sync…
j-kon ec8434d
fix: stabilize transaction history refresh lifecycle
j-kon eb368c5
ci: trigger fresh build on all platforms
j-kon ce9da32
fix: queue pending transaction refreshes and resolve analyzer warning
j-kon 36c8a82
fix(demo): address transaction history review feedback
j-kon 3d441b4
fix(demo): address transaction history follow-up
j-kon aace3a5
style(demo): remove redundant section heading from transaction histor…
j-kon 0cb3375
style(demo): remove redundant subtitle text from transaction detail h…
j-kon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
4 changes: 2 additions & 2 deletions
4
.../transactions/models/demo_tx_details.dart → ...ions/models/transaction_history_item.dart
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
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
50 changes: 50 additions & 0 deletions
50
bdk_demo/lib/features/transactions/transaction_history_mapper.dart
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| import 'package:bdk_demo/features/transactions/models/transaction_history_item.dart'; | ||
|
|
||
| sealed class TransactionHistoryPosition { | ||
| const TransactionHistoryPosition(); | ||
| } | ||
|
|
||
| class ConfirmedTransactionPosition extends TransactionHistoryPosition { | ||
| final int blockHeight; | ||
| final int confirmationTime; | ||
|
|
||
| const ConfirmedTransactionPosition({ | ||
| required this.blockHeight, | ||
| required this.confirmationTime, | ||
| }); | ||
| } | ||
|
|
||
| class UnconfirmedTransactionPosition extends TransactionHistoryPosition { | ||
| const UnconfirmedTransactionPosition(); | ||
| } | ||
|
|
||
| class TransactionHistoryMapper { | ||
| const TransactionHistoryMapper._(); | ||
|
|
||
| static TransactionHistoryItem fromWalletData({ | ||
| required String txid, | ||
| required int sent, | ||
| required int received, | ||
| required TransactionHistoryPosition position, | ||
| }) { | ||
| return switch (position) { | ||
| ConfirmedTransactionPosition() => TransactionHistoryItem( | ||
| txid: txid, | ||
| sent: sent, | ||
| received: received, | ||
| pending: false, | ||
| blockHeight: position.blockHeight, | ||
| confirmationTime: DateTime.fromMillisecondsSinceEpoch( | ||
| position.confirmationTime * 1000, | ||
| isUtc: true, | ||
| ), | ||
| ), | ||
| UnconfirmedTransactionPosition() => TransactionHistoryItem( | ||
| txid: txid, | ||
| sent: sent, | ||
| received: received, | ||
| pending: true, | ||
| ), | ||
| }; | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.