Skip to content

feat(minotari): Transaction fetching#46

Merged
brianp merged 1 commit intominotari_integrationfrom
minotari_integration_fetch
Mar 2, 2026
Merged

feat(minotari): Transaction fetching#46
brianp merged 1 commit intominotari_integrationfrom
minotari_integration_fetch

Conversation

@igordanilcenko
Copy link

  • Aligned CW methods implementation to be called from Minotari
  • Removed abandoned methods

@igordanilcenko igordanilcenko self-assigned this Feb 26, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello @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

  • Transaction Fetching Implementation: The fetchTransactions method in MinotariWalletBase has been fully implemented to retrieve transaction data directly from the FFI layer, replacing the previous stub implementation.
  • Transaction Update Logic Refinement: The _updateTransactions method now leverages the new fetchTransactions implementation and correctly saves the updated transaction history, ensuring transaction data is consistently managed.
  • DTO Conversion Extraction: A new private helper method, _dtoToTransactionInfo, was introduced to encapsulate the logic for converting DisplayedTransactionDto objects into MinotariTransactionInfo objects, improving code organization and reusability.
  • Removal of Placeholder Method: The update() method in MinotariTransactionHistoryBase, which was a placeholder, has been removed as its functionality is now handled elsewhere.
Changelog
  • cw_minotari/lib/minotari_transaction_history.dart
    • Removed the update() method, which was a placeholder for future transaction fetching.
  • cw_minotari/lib/minotari_wallet.dart
    • Implemented the fetchTransactions() method to retrieve transactions from the FFI layer instead of returning an empty map.
    • Refactored _updateTransactions() to call the newly implemented fetchTransactions() and save the updated transaction history.
    • Extracted the logic for converting DisplayedTransactionDto to MinotariTransactionInfo into a new private method _dtoToTransactionInfo.
    • Updated _processNewTransactions() to use the new _dtoToTransactionInfo helper method.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@igordanilcenko igordanilcenko changed the title feat(minotari): Implement transaction fetching feat(minotari): Transaction fetching Feb 26, 2026
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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.

Suggested change
final date = DateTime.tryParse(txDto.blockchain.timestamp) ?? DateTime.now();
final date = DateTime.tryParse(txDto.blockchain.timestamp) ?? DateTime.fromMillisecondsSinceEpoch(0);

Comment on lines +550 to +554
final result = <String, MinotariTransactionInfo>{};
for (final txDto in txDtos) {
result[txDto.id] = _dtoToTransactionInfo(txDto);
}
return result;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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)};

@brianp brianp merged commit c2bbf85 into minotari_integration Mar 2, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants