feat(minotari): Transaction fetching#46
Conversation
igordanilcenko
commented
Feb 26, 2026
- Aligned CW methods implementation to be called from Minotari
- Removed abandoned methods
…ate transaction history
Summary of ChangesHello @igordanilcenko, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly advances the Minotari integration by implementing the core transaction fetching mechanism. It transitions from placeholder methods to actual FFI calls for retrieving transaction data, streamlines the transaction update process, and refactors DTO conversion logic for better maintainability. The changes ensure that the application can now accurately fetch and process Minotari transactions. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request implements transaction fetching for Minotari wallets. The core logic is encapsulated in a new fetchTransactions method, and existing code is refactored to use it, which is a good structural improvement. The conversion from a transaction DTO to a transaction info object has also been extracted into a helper method, improving code clarity and reusability. My review includes a couple of suggestions to enhance the implementation's robustness and align it more closely with Dart idioms.
| : TransactionDirection.outgoing; | ||
|
|
||
| final isPending = txDto.status != DisplayedTransactionStatus.confirmed; | ||
| final date = DateTime.tryParse(txDto.blockchain.timestamp) ?? DateTime.now(); |
There was a problem hiding this comment.
Using DateTime.now() as a fallback for a failed timestamp parse can be misleading, as it will make the transaction appear as if it just happened. This could confuse the user. A better approach is to use a neutral default like the Unix epoch DateTime.fromMillisecondsSinceEpoch(0) to signify an unknown or invalid date. It is also recommended to log an error when parsing fails to aid in debugging potential issues with data from the FFI layer.
| final date = DateTime.tryParse(txDto.blockchain.timestamp) ?? DateTime.now(); | |
| final date = DateTime.tryParse(txDto.blockchain.timestamp) ?? DateTime.fromMillisecondsSinceEpoch(0); |
| final result = <String, MinotariTransactionInfo>{}; | ||
| for (final txDto in txDtos) { | ||
| result[txDto.id] = _dtoToTransactionInfo(txDto); | ||
| } | ||
| return result; |
There was a problem hiding this comment.
This logic for building the map of transactions can be made more concise and idiomatic using Dart's collection-for feature. This improves readability and reduces verbosity.
| final result = <String, MinotariTransactionInfo>{}; | |
| for (final txDto in txDtos) { | |
| result[txDto.id] = _dtoToTransactionInfo(txDto); | |
| } | |
| return result; | |
| return {for (final txDto in txDtos) txDto.id: _dtoToTransactionInfo(txDto)}; |