Skip to content

feat(trezor): migration to SDK with up-to-date RPCs #2836

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
wants to merge 16 commits into
base: dev
Choose a base branch
from

Conversation

takenagain
Copy link
Collaborator

@takenagain takenagain commented Jun 26, 2025

Summary

Migration of Trezor functionality to the SDK.

  • Use task-based get_new_address RPC for address creation.
  • Consolidate enabledByDefaultCoins lists.
  • Remove legacy trezor RPCs and coin filters from KW. Coin filtering is now handled in the SDK.
  • Add priv_key_policy to coin activation params and add task-based ETH activation RPC.

Fixes the following issues

  • Trezor address discovery failure. Users previously had to manually click on "Create Address" button to discover existing addresses.
  • Trezor confirmation not requested when creating a new address.

Remaining issues not resolved here

  • During inactivity, a PIN is requested on Trezor, but nothing is displayed in the UI.
  • Transactions from hidden wallets appear in the standard wallet's list. This is linked to the hidden wallet used to initialise trezor. We could delete the hidden "My Trezor" wallet on each login/logout, but that would mean a full rescan of default coins, and manual re-activation of any coins that the user activated previously for each login.

Summary by CodeRabbit

  • New Features

    • Enhanced hardware wallet authentication flow with improved support for Trezor devices, including new authentication states and dialogs.
    • Added new authentication events for Trezor PIN and passphrase entry.
  • Bug Fixes

    • Fixed a typographical error in the Trezor device busy message.
    • Improved transaction address display to handle empty address lists gracefully.
  • Refactor

    • Migrated Trezor hardware wallet logic from dedicated blocs and repositories to a unified authentication flow.
    • Simplified and centralized coin price fetching and coin activation logic.
    • Removed legacy and redundant Trezor-related files and code.
  • Style

    • Cleaned up unused imports and improved code readability in several files.
  • Tests

    • Added and updated test cases to better handle self-transfer scenarios in transaction history.
  • Chores

    • Updated translation files and improved error message handling for hardware wallet dialogs.

@takenagain takenagain self-assigned this Jun 26, 2025
Copy link
Contributor

coderabbitai bot commented Jun 26, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This update removes all legacy Trezor hardware wallet integration code, including related blocs, repositories, models, and API layers. Trezor authentication and wallet operations are now handled via a new TrezorAuthMixin integrated into AuthBloc, with corresponding event and state changes. UI components and coin activation logic are refactored to remove Trezor-specific branches and dependencies.

Changes

File(s) / Path(s) Change Summary
lib/bloc/trezor_*, lib/blocs/trezor_coins_bloc.dart, lib/model/hw_wallet/trezor_*, ... All Trezor-specific blocs, repositories, models, and API layers deleted.
lib/mm2/mm2_api/mm2_api_trezor.dart, lib/mm2/mm2_api/rpc/trezor/ All Trezor-related API request/response classes and interfaces deleted.
lib/bloc/auth_bloc/auth_bloc.dart, lib/bloc/auth_bloc/trezor_auth_mixin.dart Added TrezorAuthMixin to AuthBloc for Trezor authentication; new event handlers for Trezor auth flow.
lib/bloc/auth_bloc/auth_bloc_event.dart Added new Trezor authentication events (init, PIN, passphrase, cancel).
lib/bloc/auth_bloc/auth_bloc_state.dart Refactored state to use new AuthenticationState with Trezor-specific statuses.
lib/views/common/hw_wallet_dialog/*, lib/views/wallets_manager/widgets/hardware_wallets_manager.dart UI refactored to use new AuthBloc-based Trezor flow; removed all TrezorInitBloc usage.
lib/bloc/coins_bloc/coins_bloc.dart, lib/bloc/coins_bloc/coins_repo.dart, lib/bloc/coins_manager/coins_manager_bloc.dart Removed Trezor-specific coin activation, balance logic, and filtering.
lib/model/coin.dart, lib/app_config/app_config.dart Removed Trezor-related getters and config lists.
lib/views/wallet/coin_details/receive/receive_address.dart, lib/views/wallet/coin_details/receive/receive_address_trezor.dart, lib/views/wallet/coin_details/receive/request_address_button.dart Removed Trezor-specific receive address widgets and logic.
lib/views/common/hw_wallet_dialog/trezor_steps/trezor_dialog_error.dart, ... Simplified error handling and dialog logic for Trezor, using new AuthBloc events and state.
lib/main.dart, lib/bloc/app_bloc_root.dart, lib/mm2/mm2_api/mm2_api.dart Removed Trezor repo/coin bloc instantiation and dependency injection.
lib/bloc/cex_market_data/price_chart/price_chart_bloc.dart, lib/bloc/cex_market_data/price_chart/price_chart_state.dart, ... Refactored unrelated price chart code to use AssetId keys.
lib/shared/utils/extensions/transaction_extensions.dart, test_units/tests/utils/transaction_history/sanitize_transaction_test.dart Improved transaction sanitization logic and added tests for self-transfer edge cases.
Various files (e.g., lib/views/settings/widgets/security_settings/seed_settings/seed_show.dart) Removed unused or obsolete imports.
assets/translations/en.json Fixed a minor typo in a Trezor error translation string.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI
    participant AuthBloc
    participant KomodoDefiSdk

    User->>UI: Selects Trezor wallet
    UI->>AuthBloc: Dispatch AuthTrezorInitAndAuthStarted
    AuthBloc->>KomodoDefiSdk: Start Trezor auth stream
    KomodoDefiSdk-->>AuthBloc: Emits AuthenticationState (various statuses)
    AuthBloc->>UI: Emits AuthBlocState (e.g., initializing, pin/passphrase required)
    User->>UI: Enters PIN/Passphrase
    UI->>AuthBloc: Dispatch AuthTrezorPinProvided/AuthTrezorPassphraseProvided
    AuthBloc->>KomodoDefiSdk: Provide credentials
    KomodoDefiSdk-->>AuthBloc: Emits AuthenticationState.completed
    AuthBloc->>UI: Emits logged-in state
Loading

Possibly related PRs

  • KomodoPlatform/komodo-wallet#2746: Removes all Trezor-related code, including the TrezorInitBloc and its associated files, which this PR also removes and replaces.

Suggested labels

QA

Suggested reviewers

  • smk762
  • CharlVS

Poem

A rabbit hopped through fields of code,
Where Trezor's footprints once had strode.
Old wires snipped and logic neat,
New mixins make the auth flow sweet.
With every hop, the garden's clear—
Simpler paths, no Trezor here!
🐇✨


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

github-actions bot commented Jun 26, 2025

Visit the preview URL for this PR (updated for commit f176228):

https://walletrc--pull-2836-merge-tyk9ck28.web.app

(expires Mon, 14 Jul 2025 14:13:46 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: f66a4ff03faa546f12f0ae5a841bd9eff2714dcc

@takenagain takenagain added this to the v0.9.2 Release milestone Jul 1, 2025
@takenagain
Copy link
Collaborator Author

@coderabbitai review

Copy link
Contributor

coderabbitai bot commented Jul 2, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🔭 Outside diff range comments (6)
lib/bloc/auth_bloc/auth_bloc.dart (1)

288-288: Address deprecated method usage

The pipeline indicates that downloadEncryptedWallet is deprecated and should be replaced with KomodoDefiSdk.auth.getMnemonicEncrypted.

Apply this fix to use the recommended replacement:

-      await _walletsRepository.downloadEncryptedWallet(wallet, event.password);
+      await _kdfSdk.auth.getMnemonicEncrypted(event.password);
lib/bloc/coins_bloc/coins_repo.dart (4)

395-404: Consider removing deprecated getFirstPubkey method

This method is marked as deprecated with clear guidance to use _kdfSdk.pubkeys.getPubkeys instead. Since it's still being used internally (lines 203, 232, 398), consider refactoring these usages to use the SDK directly and let users select from available pubkeys as suggested in the deprecation notice.


386-393: Replace deprecated MM2 call method

The _mm2.call() method is deprecated. Replace with SDK's client.rpc or client.executeRpc:

  • Line 388: For disabling coins
  • Line 616: For withdraw operations

Consider using the SDK's RPC client instead:

-      await _mm2.call(DisableCoinReq(coin: coinId));
+      await _kdfSdk.client.executeRpc(DisableCoinReq(coin: coinId));

Also applies to: 614-642


406-415: Replace deprecated usdPrice field access

The coin?.usdPrice?.price access pattern is deprecated. Use the SDK's price manager instead:

  double? getUsdPriceByAmount(String amount, String coinAbbr) {
    final Coin? coin = getCoin(coinAbbr);
    final double? parsedAmount = double.tryParse(amount);
-   final double? usdPrice = coin?.usdPrice?.price;
+   final double? usdPrice = await _kdfSdk.marketData.maybeFiatPrice(coin.id)?.toDouble();

-   if (coin == null || usdPrice == null || parsedAmount == null) {
+   if (coin == null || parsedAmount == null) {
      return null;
    }
+   
+   final fiatPrice = await _kdfSdk.marketData.maybeFiatPrice(coin.id);
+   if (fiatPrice == null) return null;
+   
-   return parsedAmount * usdPrice;
+   return parsedAmount * fiatPrice.toDouble();
  }

Note: This would require making the method async.


199-209: Replace deprecated getCoin with getCoinFromId and migrate to AssetId

To align with the SDK and remove the @deprecated API, replace all
coinsRepository.getCoin(String coinId) calls with
coinsRepository.getCoinFromId(AssetId coinId) (or accept AssetId directly).

Key locations:

  • lib/bloc/coins_bloc/coins_repo.dart (lines 199, 407, 547)
  • All other occurrences found via rg -A2 "getCoin\(" --type dart

Example refactor in coins_repo.dart:

- final coin = getCoin(enabledAsset);
+ // Wrap the string ID into an AssetId (use real name from your asset metadata)
+ final assetId = AssetId(id: enabledAsset, name: enabledAsset);
+ final coin = getCoinFromId(assetId);
  if (coin == null) return null;

For a more thorough migration, consider changing method signatures to take
AssetId instead of String:

- Future<Coin?> fetchCoin(String enabledAsset) async {
+ Future<Coin?> fetchCoin(AssetId enabledAsset) async {
    final coin = getCoinFromId(enabledAsset);
    if (coin == null) return null;
    …
  }

Repeat this pattern for each getCoin(...) usage to eliminate the deprecated API.

lib/bloc/coins_bloc/coins_bloc.dart (1)

343-357: Remove deprecated enabledType and reset() usages across the codebase

The pipeline warnings for these deprecated APIs must be addressed before the next release. We found multiple occurrences that need migration to the SDK’s recommended WalletManager and Asset state management:

• lib/shared/utils/utils.dart – if (coin.enabledType == WalletType.trezor)
• lib/model/coin.dart – builder assignment ..enabledType = …
• lib/bloc/bridge_form/bridge_validator.dart – several null checks on enabledType
• lib/bloc/taker_form/taker_validator.dart – several null checks on enabledType
• lib/bloc/coins_bloc/coins_repo.dart – coin.enabledType = currentUser.wallet.config.type
• lib/bloc/coins_bloc/coins_bloc.dart
switch (coin.enabledType) cases
– final coin.reset() call at the end of the handler

Please replace all .enabledType references with the new WalletManager APIs and swap out coin.reset() for the Asset state–based reset method. A global search-and-replace or codemod is recommended to ensure no occurrences are missed.

🧹 Nitpick comments (3)
lib/views/wallet/wallet_page/charts/coin_prices_chart.dart (2)

6-6: Remove unused import.

The pipeline correctly identifies this as an unused import that should be removed.

-import 'package:komodo_defi_sdk/komodo_defi_sdk.dart';

14-14: Remove unused import.

The pipeline correctly identifies this as an unused import that should be removed.

-import 'package:web_dex/bloc/coins_blob/asset_coin_extension.dart';
lib/views/common/hw_wallet_dialog/trezor_steps/trezor_dialog_error.dart (1)

24-28: Consider preserving error-specific messaging

The simplified error display always shows trezorErrorBusy regardless of the actual error. This might provide less helpful feedback to users compared to the previous implementation that showed error-specific messages.

Consider using the error string to provide more specific messages:

  ErrorDisplay(
-   message: LocaleKeys.trezorErrorBusy.tr(),
+   message: _getErrorMessage(error),
    detailedMessage: error,
    showIcon: false,
  ),

Add a method to map common error strings to user-friendly messages while falling back to a generic message for unknown errors.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6e51915 and d5b869c.

⛔ Files ignored due to path filters (2)
  • packages/komodo_ui_kit/pubspec.lock is excluded by !**/*.lock
  • pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing (74)
  • assets/translations/en.json (1 hunks)
  • lib/app_config/app_config.dart (0 hunks)
  • lib/bloc/app_bloc_root.dart (0 hunks)
  • lib/bloc/auth_bloc/auth_bloc.dart (4 hunks)
  • lib/bloc/auth_bloc/auth_bloc_event.dart (1 hunks)
  • lib/bloc/auth_bloc/auth_bloc_state.dart (1 hunks)
  • lib/bloc/auth_bloc/trezor_auth_mixin.dart (1 hunks)
  • lib/bloc/cex_market_data/price_chart/price_chart_bloc.dart (4 hunks)
  • lib/bloc/cex_market_data/price_chart/price_chart_state.dart (3 hunks)
  • lib/bloc/coin_addresses/bloc/coin_addresses_bloc.dart (0 hunks)
  • lib/bloc/coins_bloc/coins_bloc.dart (4 hunks)
  • lib/bloc/coins_bloc/coins_repo.dart (2 hunks)
  • lib/bloc/coins_manager/coins_manager_bloc.dart (1 hunks)
  • lib/bloc/trezor_bloc/trezor_repo.dart (0 hunks)
  • lib/bloc/trezor_connection_bloc/trezor_connection_bloc.dart (0 hunks)
  • lib/bloc/trezor_connection_bloc/trezor_connection_event.dart (0 hunks)
  • lib/bloc/trezor_connection_bloc/trezor_connection_state.dart (0 hunks)
  • lib/bloc/trezor_init_bloc/trezor_init_bloc.dart (0 hunks)
  • lib/bloc/trezor_init_bloc/trezor_init_event.dart (0 hunks)
  • lib/bloc/trezor_init_bloc/trezor_init_state.dart (0 hunks)
  • lib/blocs/trezor_coins_bloc.dart (0 hunks)
  • lib/main.dart (1 hunks)
  • lib/mm2/mm2_api/mm2_api.dart (0 hunks)
  • lib/mm2/mm2_api/mm2_api_trezor.dart (0 hunks)
  • lib/mm2/mm2_api/rpc/trezor/balance/trezor_balance_init/trezor_balance_init_request.dart (0 hunks)
  • lib/mm2/mm2_api/rpc/trezor/balance/trezor_balance_init/trezor_balance_init_response.dart (0 hunks)
  • lib/mm2/mm2_api/rpc/trezor/balance/trezor_balance_status/trezor_balance_status_request.dart (0 hunks)
  • lib/mm2/mm2_api/rpc/trezor/balance/trezor_balance_status/trezor_balance_status_response.dart (0 hunks)
  • lib/mm2/mm2_api/rpc/trezor/enable_utxo/trezor_enable_utxo/trezor_enable_utxo_request.dart (0 hunks)
  • lib/mm2/mm2_api/rpc/trezor/enable_utxo/trezor_enable_utxo/trezor_enable_utxo_response.dart (0 hunks)
  • lib/mm2/mm2_api/rpc/trezor/enable_utxo/trezor_enable_utxo_status/trezor_enable_utxo_status_request.dart (0 hunks)
  • lib/mm2/mm2_api/rpc/trezor/enable_utxo/trezor_enable_utxo_status/trezor_enable_utxo_status_response.dart (0 hunks)
  • lib/mm2/mm2_api/rpc/trezor/get_new_address/get_new_address_request.dart (0 hunks)
  • lib/mm2/mm2_api/rpc/trezor/get_new_address/get_new_address_response.dart (0 hunks)
  • lib/mm2/mm2_api/rpc/trezor/init/init_trezor/init_trezor_request.dart (0 hunks)
  • lib/mm2/mm2_api/rpc/trezor/init/init_trezor/init_trezor_response.dart (0 hunks)
  • lib/mm2/mm2_api/rpc/trezor/init/init_trezor_cancel/init_trezor_cancel_request.dart (0 hunks)
  • lib/mm2/mm2_api/rpc/trezor/init/init_trezor_status/init_trezor_status_request.dart (0 hunks)
  • lib/mm2/mm2_api/rpc/trezor/init/init_trezor_status/init_trezor_status_response.dart (0 hunks)
  • lib/mm2/mm2_api/rpc/trezor/trezor_connection_status/trezor_connection_status_request.dart (0 hunks)
  • lib/mm2/mm2_api/rpc/trezor/trezor_passphrase/trezor_passphrase_request.dart (0 hunks)
  • lib/mm2/mm2_api/rpc/trezor/trezor_pin/trezor_pin_request.dart (0 hunks)
  • lib/mm2/mm2_api/rpc/trezor/withdraw/trezor_withdraw/trezor_withdraw_request.dart (0 hunks)
  • lib/mm2/mm2_api/rpc/trezor/withdraw/trezor_withdraw/trezor_withdraw_response.dart (0 hunks)
  • lib/mm2/mm2_api/rpc/trezor/withdraw/trezor_withdraw_cancel/trezor_withdraw_cancel_request.dart (0 hunks)
  • lib/mm2/mm2_api/rpc/trezor/withdraw/trezor_withdraw_status/trezor_withdraw_status_request.dart (0 hunks)
  • lib/mm2/mm2_api/rpc/trezor/withdraw/trezor_withdraw_status/trezor_withdraw_status_response.dart (0 hunks)
  • lib/model/coin.dart (0 hunks)
  • lib/model/hw_wallet/init_trezor.dart (0 hunks)
  • lib/model/hw_wallet/trezor_progress_status.dart (0 hunks)
  • lib/model/hw_wallet/trezor_status.dart (0 hunks)
  • lib/model/main_menu_value.dart (0 hunks)
  • lib/model/wallet.dart (1 hunks)
  • lib/router/navigators/page_content/page_content_router_delegate.dart (0 hunks)
  • lib/router/parsers/root_route_parser.dart (0 hunks)
  • lib/shared/utils/extensions/transaction_extensions.dart (1 hunks)
  • lib/views/common/hw_wallet_dialog/hw_dialog_init.dart (2 hunks)
  • lib/views/common/hw_wallet_dialog/hw_dialog_wallet_select.dart (2 hunks)
  • lib/views/common/hw_wallet_dialog/show_trezor_passphrase_dialog.dart (2 hunks)
  • lib/views/common/hw_wallet_dialog/show_trezor_pin_dialog.dart (2 hunks)
  • lib/views/common/hw_wallet_dialog/trezor_steps/trezor_dialog_error.dart (2 hunks)
  • lib/views/common/hw_wallet_dialog/trezor_steps/trezor_dialog_in_progress.dart (3 hunks)
  • lib/views/settings/widgets/security_settings/seed_settings/seed_confirmation/seed_confirmation.dart (0 hunks)
  • lib/views/settings/widgets/security_settings/seed_settings/seed_show.dart (0 hunks)
  • lib/views/wallet/coin_details/coin_details_info/charts/animated_portfolio_charts.dart (0 hunks)
  • lib/views/wallet/coin_details/receive/receive_address.dart (0 hunks)
  • lib/views/wallet/coin_details/receive/receive_address_trezor.dart (0 hunks)
  • lib/views/wallet/coin_details/receive/request_address_button.dart (0 hunks)
  • lib/views/wallet/coin_details/transactions/transaction_list_item.dart (1 hunks)
  • lib/views/wallet/coins_manager/coins_manager_filters_dropdown.dart (1 hunks)
  • lib/views/wallet/wallet_page/charts/coin_prices_chart.dart (1 hunks)
  • lib/views/wallets_manager/widgets/hardware_wallets_manager.dart (3 hunks)
  • lib/views/wallets_manager/widgets/iguana_wallets_manager.dart (0 hunks)
  • test_units/tests/utils/transaction_history/sanitize_transaction_test.dart (2 hunks)
💤 Files with no reviewable changes (50)
  • lib/views/wallet/coin_details/coin_details_info/charts/animated_portfolio_charts.dart
  • lib/router/navigators/page_content/page_content_router_delegate.dart
  • lib/views/settings/widgets/security_settings/seed_settings/seed_confirmation/seed_confirmation.dart
  • lib/bloc/coin_addresses/bloc/coin_addresses_bloc.dart
  • lib/views/wallets_manager/widgets/iguana_wallets_manager.dart
  • lib/router/parsers/root_route_parser.dart
  • lib/views/settings/widgets/security_settings/seed_settings/seed_show.dart
  • lib/model/main_menu_value.dart
  • lib/model/coin.dart
  • lib/app_config/app_config.dart
  • lib/views/wallet/coin_details/receive/receive_address.dart
  • lib/bloc/trezor_connection_bloc/trezor_connection_event.dart
  • lib/mm2/mm2_api/rpc/trezor/init/init_trezor/init_trezor_response.dart
  • lib/mm2/mm2_api/rpc/trezor/balance/trezor_balance_init/trezor_balance_init_request.dart
  • lib/mm2/mm2_api/rpc/trezor/trezor_passphrase/trezor_passphrase_request.dart
  • lib/mm2/mm2_api/rpc/trezor/withdraw/trezor_withdraw_status/trezor_withdraw_status_request.dart
  • lib/mm2/mm2_api/rpc/trezor/balance/trezor_balance_status/trezor_balance_status_request.dart
  • lib/mm2/mm2_api/rpc/trezor/init/init_trezor/init_trezor_request.dart
  • lib/mm2/mm2_api/rpc/trezor/withdraw/trezor_withdraw_cancel/trezor_withdraw_cancel_request.dart
  • lib/mm2/mm2_api/rpc/trezor/init/init_trezor_cancel/init_trezor_cancel_request.dart
  • lib/bloc/trezor_connection_bloc/trezor_connection_state.dart
  • lib/mm2/mm2_api/rpc/trezor/init/init_trezor_status/init_trezor_status_request.dart
  • lib/bloc/trezor_init_bloc/trezor_init_event.dart
  • lib/mm2/mm2_api/rpc/trezor/enable_utxo/trezor_enable_utxo/trezor_enable_utxo_request.dart
  • lib/mm2/mm2_api/rpc/trezor/enable_utxo/trezor_enable_utxo_status/trezor_enable_utxo_status_request.dart
  • lib/mm2/mm2_api/rpc/trezor/enable_utxo/trezor_enable_utxo/trezor_enable_utxo_response.dart
  • lib/bloc/trezor_connection_bloc/trezor_connection_bloc.dart
  • lib/mm2/mm2_api/mm2_api.dart
  • lib/views/wallet/coin_details/receive/receive_address_trezor.dart
  • lib/mm2/mm2_api/rpc/trezor/init/init_trezor_status/init_trezor_status_response.dart
  • lib/views/wallet/coin_details/receive/request_address_button.dart
  • lib/model/hw_wallet/trezor_progress_status.dart
  • lib/mm2/mm2_api/rpc/trezor/trezor_pin/trezor_pin_request.dart
  • lib/bloc/app_bloc_root.dart
  • lib/model/hw_wallet/trezor_status.dart
  • lib/blocs/trezor_coins_bloc.dart
  • lib/mm2/mm2_api/rpc/trezor/balance/trezor_balance_status/trezor_balance_status_response.dart
  • lib/bloc/trezor_init_bloc/trezor_init_state.dart
  • lib/mm2/mm2_api/rpc/trezor/balance/trezor_balance_init/trezor_balance_init_response.dart
  • lib/bloc/trezor_init_bloc/trezor_init_bloc.dart
  • lib/mm2/mm2_api/rpc/trezor/withdraw/trezor_withdraw/trezor_withdraw_response.dart
  • lib/mm2/mm2_api/rpc/trezor/withdraw/trezor_withdraw/trezor_withdraw_request.dart
  • lib/mm2/mm2_api/rpc/trezor/trezor_connection_status/trezor_connection_status_request.dart
  • lib/mm2/mm2_api/rpc/trezor/withdraw/trezor_withdraw_status/trezor_withdraw_status_response.dart
  • lib/mm2/mm2_api/rpc/trezor/enable_utxo/trezor_enable_utxo_status/trezor_enable_utxo_status_response.dart
  • lib/model/hw_wallet/init_trezor.dart
  • lib/mm2/mm2_api/rpc/trezor/get_new_address/get_new_address_request.dart
  • lib/mm2/mm2_api/rpc/trezor/get_new_address/get_new_address_response.dart
  • lib/mm2/mm2_api/mm2_api_trezor.dart
  • lib/bloc/trezor_bloc/trezor_repo.dart
🧰 Additional context used
🧠 Learnings (21)
lib/views/wallet/coin_details/transactions/transaction_list_item.dart (2)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
lib/bloc/coins_manager/coins_manager_bloc.dart (2)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
lib/views/wallet/wallet_page/charts/coin_prices_chart.dart (2)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
lib/views/common/hw_wallet_dialog/hw_dialog_init.dart (6)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional `dart:io` imports in the Komodo wallet codebase when the usage is guarded by `!kIsWeb` conditional checks that prevent the platform-specific code from being executed in web environments.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under `test_units/tests/` but are executed through the central entry point in `test_units/main.dart`, so individual test files don't need their own `main()` function.
lib/bloc/cex_market_data/price_chart/price_chart_state.dart (3)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional `dart:io` imports in the Komodo wallet codebase when the usage is guarded by `!kIsWeb` conditional checks that prevent the platform-specific code from being executed in web environments.
lib/model/wallet.dart (2)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
lib/views/common/hw_wallet_dialog/show_trezor_passphrase_dialog.dart (6)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional `dart:io` imports in the Komodo wallet codebase when the usage is guarded by `!kIsWeb` conditional checks that prevent the platform-specific code from being executed in web environments.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under `test_units/tests/` but are executed through the central entry point in `test_units/main.dart`, so individual test files don't need their own `main()` function.
test_units/tests/utils/transaction_history/sanitize_transaction_test.dart (1)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under `test_units/tests/` but are executed through the central entry point in `test_units/main.dart`, so individual test files don't need their own `main()` function.
lib/views/wallet/coins_manager/coins_manager_filters_dropdown.dart (2)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
lib/main.dart (6)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under `test_units/tests/` but are executed through the central entry point in `test_units/main.dart`, so individual test files don't need their own `main()` function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional `dart:io` imports in the Komodo wallet codebase when the usage is guarded by `!kIsWeb` conditional checks that prevent the platform-specific code from being executed in web environments.
lib/views/common/hw_wallet_dialog/show_trezor_pin_dialog.dart (6)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional `dart:io` imports in the Komodo wallet codebase when the usage is guarded by `!kIsWeb` conditional checks that prevent the platform-specific code from being executed in web environments.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under `test_units/tests/` but are executed through the central entry point in `test_units/main.dart`, so individual test files don't need their own `main()` function.
lib/bloc/coins_bloc/coins_repo.dart (6)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional `dart:io` imports in the Komodo wallet codebase when the usage is guarded by `!kIsWeb` conditional checks that prevent the platform-specific code from being executed in web environments.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under `test_units/tests/` but are executed through the central entry point in `test_units/main.dart`, so individual test files don't need their own `main()` function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
lib/bloc/auth_bloc/auth_bloc.dart (6)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional `dart:io` imports in the Komodo wallet codebase when the usage is guarded by `!kIsWeb` conditional checks that prevent the platform-specific code from being executed in web environments.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under `test_units/tests/` but are executed through the central entry point in `test_units/main.dart`, so individual test files don't need their own `main()` function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
lib/views/common/hw_wallet_dialog/trezor_steps/trezor_dialog_in_progress.dart (6)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional `dart:io` imports in the Komodo wallet codebase when the usage is guarded by `!kIsWeb` conditional checks that prevent the platform-specific code from being executed in web environments.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under `test_units/tests/` but are executed through the central entry point in `test_units/main.dart`, so individual test files don't need their own `main()` function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
lib/views/common/hw_wallet_dialog/hw_dialog_wallet_select.dart (6)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional `dart:io` imports in the Komodo wallet codebase when the usage is guarded by `!kIsWeb` conditional checks that prevent the platform-specific code from being executed in web environments.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under `test_units/tests/` but are executed through the central entry point in `test_units/main.dart`, so individual test files don't need their own `main()` function.
lib/bloc/auth_bloc/auth_bloc_event.dart (1)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
lib/views/common/hw_wallet_dialog/trezor_steps/trezor_dialog_error.dart (3)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional `dart:io` imports in the Komodo wallet codebase when the usage is guarded by `!kIsWeb` conditional checks that prevent the platform-specific code from being executed in web environments.
lib/bloc/coins_bloc/coins_bloc.dart (6)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional `dart:io` imports in the Komodo wallet codebase when the usage is guarded by `!kIsWeb` conditional checks that prevent the platform-specific code from being executed in web environments.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under `test_units/tests/` but are executed through the central entry point in `test_units/main.dart`, so individual test files don't need their own `main()` function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
lib/bloc/cex_market_data/price_chart/price_chart_bloc.dart (6)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional `dart:io` imports in the Komodo wallet codebase when the usage is guarded by `!kIsWeb` conditional checks that prevent the platform-specific code from being executed in web environments.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under `test_units/tests/` but are executed through the central entry point in `test_units/main.dart`, so individual test files don't need their own `main()` function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
lib/bloc/auth_bloc/trezor_auth_mixin.dart (1)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
lib/views/wallets_manager/widgets/hardware_wallets_manager.dart (6)
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: In the Komodo Wallet project, part files share imports with their parent files. The import for `app_config.dart` in `coins_bloc.dart` is necessary because the part file `coins_state.dart` uses `excludedAssetList` from that package.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2566
File: lib/bloc/coins_bloc/coins_bloc.dart:10-10
Timestamp: 2025-04-01T15:51:37.060Z
Learning: The `excludedAssetList` from `app_config.dart` is used in the `_filterExcludedAssets` method in `coins_state.dart`. Since `coins_state.dart` is a part file of `coins_bloc.dart`, the import needs to be in the parent file even though it's not directly used there. In Dart, part files share the namespace and imports of their parent files.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2608
File: lib/bloc/fiat/fiat_onramp_form/fiat_form_bloc.dart:2-3
Timestamp: 2025-05-01T21:00:36.970Z
Learning: It's acceptable to use unconditional `dart:io` imports in the Komodo wallet codebase when the usage is guarded by `!kIsWeb` conditional checks that prevent the platform-specific code from being executed in web environments.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/http_head_time_provider_test.dart:8-24
Timestamp: 2025-05-08T19:05:13.083Z
Learning: In the Komodo Wallet project, test functions are defined in individual files under `test_units/tests/` but are executed through the central entry point in `test_units/main.dart`, so individual test files don't need their own `main()` function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
Learnt from: takenagain
PR: KomodoPlatform/komodo-wallet#2611
File: test_units/tests/system_health/system_clock_repository_test.dart:7-8
Timestamp: 2025-05-08T19:07:13.442Z
Learning: In the Komodo Wallet project, test files are structured to define test functions that are called from a central test runner in test_units/main.dart, rather than each test file having its own main() function.
🪛 GitHub Actions: takenagain is validating code guidelines 🚀
lib/views/wallet/coin_details/transactions/transaction_list_item.dart

[warning] 258-258: 'getUsdPriceByAmount' is deprecated. Use sdk.prices.fiatPrice(assetId) * amount instead.

lib/views/wallet/wallet_page/charts/coin_prices_chart.dart

[warning] 6-6: Unused import: 'package:komodo_defi_sdk/komodo_defi_sdk.dart'.


[warning] 14-14: Unused import: 'package:web_dex/bloc/coins_bloc/asset_coin_extension.dart'.

lib/bloc/coins_bloc/coins_repo.dart

[warning] 73-616: 'getCoin', 'getFirstPubkey', 'call', and 'usdPrice' are deprecated. Use KomodoDefiSdk assets, pubkeys.getPubkeys, client.rpc or client.executeRpc, and sdk.prices.fiatPrice(id) respectively.

lib/bloc/auth_bloc/auth_bloc.dart

[warning] 288-288: 'downloadEncryptedWallet' is deprecated. Use KomodoDefiSdk.auth.getMnemonicEncrypted instead.

lib/bloc/coins_bloc/coins_bloc.dart

[warning] 343-357: 'enabledType' and 'reset' are deprecated. Use SDK's WalletManager and Asset state management respectively. This must be fixed before the next release.

lib/bloc/cex_market_data/price_chart/price_chart_bloc.dart

[warning] 104-104: 'assetsFromTicker' is deprecated. Intended for transition to KDF SDK.

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build-android-docker
🔇 Additional comments (41)
lib/views/wallet/wallet_page/charts/coin_prices_chart.dart (1)

54-54: LGTM! Simplified coin list construction.

The change correctly adapts to the new Map<AssetId, CoinPriceInfo> type by directly using the keys, eliminating the need for the previous mapping through getSdkAsset.

lib/views/wallet/coin_details/transactions/transaction_list_item.dart (1)

286-294: Excellent defensive programming!

The change properly handles edge cases where address lists might be empty, preventing potential runtime exceptions when accessing addressList.first. The fallback to LocaleKeys.unknown.tr() provides a graceful user experience.

lib/bloc/cex_market_data/price_chart/price_chart_state.dart (3)

2-2: LGTM! Import addition for AssetId type.

The import is correctly added to support the new AssetId type used in the state.


12-12: LGTM! Improved type safety with AssetId.

The change from Map<String, CoinPriceInfo> to Map<AssetId, CoinPriceInfo> enhances type safety and consistency throughout the price chart feature.


32-32: LGTM! Consistent parameter type update.

The copyWith method parameter type is correctly updated to match the field type change, maintaining consistency across the class.

lib/shared/utils/extensions/transaction_extensions.dart (1)

16-18: Excellent improvement for self-transfer handling!

The conditional logic properly handles self-transfer scenarios where the sender is the only recipient. This prevents creating empty recipient lists while maintaining the original functionality for multi-recipient transactions.

test_units/tests/utils/transaction_history/sanitize_transaction_test.dart (2)

41-61: Excellent test coverage for self-transfer scenarios!

The new test group comprehensively validates the edge case where a transaction's from and to contain the same single address, ensuring the sanitize method handles self-transfers correctly without creating empty address lists.


108-108: Correct test expectation update.

The expectation is properly updated to align with the new conditional logic in the sanitize method, where the sender address remains when it's the only recipient.

lib/bloc/cex_market_data/price_chart/price_chart_bloc.dart (5)

4-5: LGTM! Import changes support the refactoring.

The new imports for komodo_defi_types and asset_coin_extension are necessary for the AssetId type usage and SDK asset operations in the refactored code.


32-34: Good refactoring approach with conditional fetching.

The conditional fetching logic prevents unnecessary API calls when coin data is already available, which is an efficient pattern.


37-42: Proper SDK integration with AssetId types.

The migration from string-based symbols to AssetId objects is correctly implemented and aligns with the SDK modernization effort. The use of sdk.getSdkAsset() and proper asset ID extraction follows the expected patterns.

Also applies to: 55-55


121-123: Consistent error handling approach.

The error handling for individual coin OHLC fetching follows the same pattern as the existing code - logging errors and gracefully continuing with other coins. This ensures robustness when some coins fail to fetch data.


96-139: Address potential deprecation of assetsFromTicker and optimize async concurrency

A few spots to verify and improve:

  • Deprecation of assetsFromTicker
    In
    lib/bloc/cex_market_data/price_chart/price_chart_bloc.dart:104
    replace

    .where((coin) => sdk.assets.assetsFromTicker(coin.id).isNotEmpty)

    with the non-deprecated KDF SDK API once confirmed (e.g.

    .where((coin) => kdfSdk.assets.lookupByTicker(coin.id).isNotEmpty)

    or whatever the new method is).

  • Async concurrency in your map + Future.wait
    You build a list of async closures via

    final coins = coinList.map((coin) async { … }).toList();
    final fetchedCexCoins = {
      for (var coin in await Future.wait(coins)) …
    };

    For large coin lists this can spawn too many parallel requests. Consider using a Stream or batching, for example:

    await Stream.fromIterable(coinList)
        .asyncMap((coin) async { … })
        .toList();

    or splitting the list into smaller chunks.

Let me know once you’ve confirmed the replacement method in the KDF SDK and adjusted the concurrency model.

lib/model/wallet.dart (1)

169-170: LGTM! Formatting improvement maintains functionality.

The reformatting of the activatedCoins assignment improves readability while preserving the exact same functionality. This aligns well with the broader Trezor migration effort.

lib/views/wallet/coins_manager/coins_manager_filters_dropdown.dart (1)

152-154: Correctly removes Trezor-specific filtering logic.

The removal of the hasTrezorSupport condition aligns perfectly with the migration strategy. Trezor wallets now use the same filtering logic as other wallet types, which is consistent with the broader removal of Trezor-specific support throughout the codebase.

assets/translations/en.json (1)

336-336: Good catch fixing the typographical error.

Removing the extraneous single quote improves the translation string quality and ensures clean user-facing messages.

lib/main.dart (1)

64-64: Correctly simplifies CoinsRepo initialization.

Removing the trezorBloc parameter from the CoinsRepo constructor aligns with the migration strategy of eliminating standalone Trezor integration and consolidating hardware wallet functionality within the general authentication framework.

lib/bloc/coins_manager/coins_manager_bloc.dart (1)

273-276: Correctly consolidates wallet type handling.

Grouping WalletType.trezor with WalletType.iguana and WalletType.hdwallet is the right approach for the migration. This eliminates Trezor-specific filtering logic and treats all these wallet types consistently, which aligns with the broader removal of Trezor-specific support throughout the codebase.

lib/views/common/hw_wallet_dialog/hw_dialog_init.dart (2)

4-4: LGTM: Import migration to AuthBloc

The import change from TrezorInitBloc to AuthBloc aligns with the architectural migration to consolidate Trezor authentication within the unified AuthBloc.


22-23: LGTM: Consistent migration to AuthBloc state and events

The changes correctly update the loading state check from TrezorInitBloc.inProgress to AuthBloc.isLoading and dispatch the appropriate AuthTrezorInitAndAuthStarted event. The logic and flow remain functionally equivalent.

lib/views/common/hw_wallet_dialog/hw_dialog_wallet_select.dart (2)

7-7: LGTM: Import migration to AuthBloc

The import change correctly reflects the migration from TrezorInitBloc to the unified AuthBloc approach.


87-88: LGTM: BlocSelector migration maintains UI behavior

The BlocSelector is correctly updated to use AuthBloc and AuthBlocState, with the selector extracting the isLoading property instead of inProgress. This maintains the same UI loading state behavior.

lib/views/common/hw_wallet_dialog/show_trezor_pin_dialog.dart (2)

3-3: LGTM: Import migration to AuthBloc

The import change from TrezorRepo to AuthBloc aligns with the migration away from dedicated Trezor repositories to unified authentication handling.


27-28: LGTM: Proper migration to BLoC event pattern

The change from calling TrezorRepo.sendPin() to dispatching AuthTrezorPinProvided event to AuthBloc follows proper BLoC architecture patterns. This maintains separation of concerns and ensures consistent state management.

lib/views/common/hw_wallet_dialog/show_trezor_passphrase_dialog.dart (2)

3-3: LGTM: Import migration to AuthBloc

The import change from TrezorRepo to AuthBloc is consistent with the overall migration strategy.


28-29: LGTM: Consistent BLoC event pattern migration

The migration from TrezorRepo.sendPassphrase() to dispatching AuthTrezorPassphraseProvided event maintains functionality while following proper BLoC architecture patterns, consistent with the PIN dialog changes.

lib/bloc/auth_bloc/auth_bloc.dart (5)

8-9: LGTM: Import addition for Trezor functionality

The import of PrivateKeyPolicy from komodo_defi_rpc_methods is appropriately scoped and likely required for the new Trezor authentication functionality in the mixin.


19-19: LGTM: Trezor mixin integration

The part declaration for trezor_auth_mixin.dart properly integrates Trezor-specific authentication logic into the AuthBloc structure.


23-23: LGTM: Mixin pattern for Trezor authentication

Using TrezorAuthMixin allows for clean separation of Trezor-specific authentication logic while keeping it integrated within the main AuthBloc. This is a good architectural choice.


36-36: LGTM: Trezor event handlers setup

The call to setupTrezorEventHandlers() in the constructor ensures Trezor-specific event handling is properly initialized when the AuthBloc is created.


45-46: LGTM: SDK access for mixin

The override getter provides the TrezorAuthMixin with access to the KomodoDefiSdk instance, enabling proper integration between the mixin and the main bloc functionality.

lib/bloc/coins_bloc/coins_repo.dart (2)

34-36: LGTM! Clean removal of Trezor integration

The constructor has been properly updated to remove the Trezor-specific dependencies.


560-560: Clean removal of Trezor-specific balance update logic

The removal of updateTrezorBalances is consistent with the migration to SDK-based Trezor handling.

lib/views/common/hw_wallet_dialog/trezor_steps/trezor_dialog_in_progress.dart (1)

3-3: Successful migration to SDK's AuthenticationStatus

The widget has been properly updated to use the SDK's AuthenticationStatus enum instead of the custom TrezorProgressStatus. The status checks have been correctly mapped to the new enum values.

Also applies to: 14-14, 29-34

lib/bloc/auth_bloc/auth_bloc_event.dart (1)

57-75: Well-structured Trezor authentication events

The new Trezor-related events are properly implemented and follow the established event pattern. They provide clear interfaces for:

  • Starting Trezor authentication
  • Providing PIN input
  • Providing passphrase input
  • Cancelling the authentication flow
lib/views/common/hw_wallet_dialog/trezor_steps/trezor_dialog_error.dart (1)

32-32: Correct event dispatch to AuthBloc

The retry button now properly dispatches AuthTrezorCancelled event to the AuthBloc, which is consistent with the new authentication flow.

lib/bloc/coins_bloc/coins_bloc.dart (3)

389-391: Good defensive programming with known coins filtering

The additional filter .where((coin) => _coinsRepo.getKnownCoinsMap().containsKey(coin)) ensures only coins known to the repository are activated. This prevents potential issues with unknown or invalid coin IDs.


449-453: Successful consolidation of Trezor activation logic

The Trezor wallet type now shares the same activation path as iguana/hdwallet types, which simplifies the code and aligns with the SDK-based approach.


413-432: Verify Activated Coins Against Known Coins Map
Now that _activateCoins sources exclusively from _coinsRepo.getKnownCoinsMap(), any coin ID in config.activatedCoins not present in that map will be dropped. Manually confirm that your default and persisted activated coins lists only contain valid IDs by checking these locations:

  • lib/bloc/wallets_repository.dart → wallet.config.activatedCoins
  • lib/bloc/auth_bloc/auth_bloc.dart → _kdfSdk.addActivatedCoins(event.wallet.config.activatedCoins)
  • lib/bloc/coins_bloc/coins_bloc.dart → _activateCoins(currentWallet.config.activatedCoins, emit)
  • lib/bloc/auth_bloc/trezor_auth_mixin.dart → authState.user!.wallet.config.activatedCoins
lib/views/wallets_manager/widgets/hardware_wallets_manager.dart (1)

51-91: Clean migration to AuthBloc

The migration from TrezorInitBloc to AuthBloc is well implemented with proper event handling and state management.

lib/bloc/auth_bloc/trezor_auth_mixin.dart (1)

119-119: enabledByDefaultCoins is available via the parent file import

The parent auth_bloc.dart imports app_config.dart, which defines enabledByDefaultCoins. As a part file, trezor_auth_mixin.dart shares the parent’s namespace and has access to that getter. No changes needed.

@takenagain takenagain marked this pull request as ready for review July 2, 2025 10:53
@takenagain takenagain added the QA Ready for QA Testing label Jul 2, 2025
@takenagain takenagain requested review from smk762 and CharlVS July 2, 2025 10:53
@smk762
Copy link
Collaborator

smk762 commented Jul 3, 2025

Model 1:

  • init_trezor ok ✔️
  • Default UTXO segwit coins activated on login ✔️
  • Creating new address does not show any pop up in wallet. Button fades and says "Creating...". Around the same time, the trezor device conveniently lit up for a confirmation of the address. Once I clicked Trezor button to confirm, address was created, added to list, and button restored to normal.
    • A second attempt was made, this time I navigated to other tabs and back while the button was in the faded "Creating..." state. Decided to click the trezor button a bit later... when I did, trezor showed confirmation request again, thrice, before returning to normal. The following was seen in console logs:
    • image
    • after some additional navigating around, upon returning to the coin's page, 3 new addresses were listed.
    • We should include a pop up in wallet here, not rely on trezor lighting up. It should also be a blocking pop up - either you confirm the address or cancel the operation, otherwise we might end up in a bad state.
  • addresses produced match those in Trezor suite (when using same "hidden wallet" passphrase!)

@smk762
Copy link
Collaborator

smk762 commented Jul 3, 2025

Confirmed BCH activation failing. This has been reported in KDF repo.
Logs:

{
    "mmrpc": "2.0",
    "error": "Error on platform coin BCH creation: DataError",
    "error_path": "lib.common_impl.coin_balance.mod.pubkey.client",
    "error_type": "CoinCreationError",
    "error_data": {
        "ticker": "BCH",
        "error": "DataError"
    },
    "error_trace": "lib:104] common_impl:66] coin_balance:493] mod:417] pubkey:154] client:93]",
    "object": {
        "mmrpc": "2.0",
        "result": {
            "status": "Error",
            "details": {
                "error": "Error on platform coin BCH creation: DataError",
                "error_path": "lib.common_impl.coin_balance.mod.pubkey.client",
                "error_trace": "lib:104] common_impl:66] coin_balance:493] mod:417] pubkey:154] client:93]",
                "error_type": "CoinCreationError",
                "error_data": {
                    "ticker": "BCH",
                    "error": "DataError"
                }
            }
        },
        "id": null
    }
}

Suggest we add BCH to the exclusion list until resolved.

@smk762
Copy link
Collaborator

smk762 commented Jul 3, 2025

Another error seen in logs after leaving session running while tending to the hounds:

{
    "mmrpc": "2.0",
    "error": "Initialization task has timed out 300s",
    "error_path": "lib.common_impl.coin_balance.mod.pubkey.trezor_rpc_task.handle",
    "error_type": "TaskTimedOut",
    "error_data": {
        "duration": {
            "secs": 300,
            "nanos": 0
        }
    },
    "error_trace": "lib:104] common_impl:66] coin_balance:493] mod:417] pubkey:154] trezor_rpc_task:69] handle:54]",
    "object": {
        "mmrpc": "2.0",
        "result": {
            "status": "Error",
            "details": {
                "error": "Initialization task has timed out 300s",
                "error_path": "lib.common_impl.coin_balance.mod.pubkey.trezor_rpc_task.handle",
                "error_trace": "lib:104] common_impl:66] coin_balance:493] mod:417] pubkey:154] trezor_rpc_task:69] handle:54]",
                "error_type": "TaskTimedOut",
                "error_data": {
                    "duration": {
                        "secs": 300,
                        "nanos": 0
                    }
                }
            }
        },
        "id": null
    }
}

In this state, Trezor Model 1 is lit up with numeric grid, but no way to make input in gui (and model one only has 2 buttons, so cant do on device). Forced to restart device and app to continue. If possible, the ability to "restore session" would be nice, if https://c774543c.komodo-docs.pages.dev/en/docs/komodo-defi-framework/api/v20/utils/trezor_connection_status/ indicates the connection was lost.

@smk762
Copy link
Collaborator

smk762 commented Jul 3, 2025

image

Adding a flashing text cursor, or input border highlight would be nice here to let users know whether or not they are ready to type. Also, a view/hide icon.

@smk762
Copy link
Collaborator

smk762 commented Jul 3, 2025

The error message here does not relate to the verbose form (InvalidPIN).
image

@smk762
Copy link
Collaborator

smk762 commented Jul 3, 2025

Trezor address creation functioning, but there is no preview in GUI to confirm with the device. The normal flow is

  • Ask UI to create address
  • API returns
{
    "mmrpc": "2.0",
    "result": {
        "status": "InProgress",
        "details": {
            "ConfirmAddress": {
                "expected_address": "QSHn5mCGjbAw5NvBX8FjrygmhrAxG1Mdxz"
            }
        }
    },
    "id": null
}
  • GUI displays "expected address"
  • Trezor shows address to be created
  • User confirms the GUI and device are showing the same address, and the address is created (or user cancels).

@smk762
Copy link
Collaborator

smk762 commented Jul 3, 2025

image

We could reduce the options in this filter when in trezor mode.

@smk762
Copy link
Collaborator

smk762 commented Jul 3, 2025

So here I am, patiently waiting for the transaction preview after clicking the "Preview withdrawal button"
image

...
...
...

Oh, you meant on the Trezor? Please sir, can I have a pop up?

@smk762
Copy link
Collaborator

smk762 commented Jul 3, 2025

Another vague/misleading error message
image

In this case the error is UserCancelled. In this case, a modest "operation cancelled" message would be more appropriate than the big red danger.

@smk762
Copy link
Collaborator

smk762 commented Jul 3, 2025

Gonna need another "oi mate, look at the trezor screen" pop up message right about here in the withdrawal process

image

@smk762
Copy link
Collaborator

smk762 commented Jul 3, 2025

A little different to the prevailing style. Another UserCancelled error that could probably look prettier.
image

After all that, I let a withdrawl get through to the end, but there was no positive feedback like a "transaction sent!" pop up after I clicked the trezor buttons to confirm the broadcast. Address balance did not change immediately either, leaving me questioning if my tx was in a box with a cat and a vial of poison. Navigating to portfolio and back revealed a successful delivery, implied via balance change.

* feat(wallet): use pubkey stream for address creation

* fix(coin-addresses): layoutbuilder size constraint in confirmation popup

* chore(deps): bump SDK to ce68c7a80 for pubkey event streaming

* refactor(coin-addresses): use consumer and more declarative approach

* refactor: remove unnecessary dynamic cast
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
QA Ready for QA Testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants