Skip to content

feat: add transport metadata to HardwareWalletAdapter and clean up exports#26503

Merged
mathieuartu merged 2 commits into
mainfrom
feat/hw-overhaul-3.5
Feb 24, 2026
Merged

feat: add transport metadata to HardwareWalletAdapter and clean up exports#26503
mathieuartu merged 2 commits into
mainfrom
feat/hw-overhaul-3.5

Conversation

@mathieuartu

@mathieuartu mathieuartu commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

Description

Part "3.5" of the hardware wallet connection & error management overhaul. This does not introduce user facing changes.

Final implementation will look like this (Figma designs):
image

Reference feature branch: #25519

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

no manual testing steps

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Medium Risk
Moderate risk due to an interface change affecting all adapter implementations and downstream imports/exports; runtime behavior change is limited to additional transport metadata on Ledger.

Overview
Extends the HardwareWalletAdapter interface with getTransportDisabledErrorCode() and getConnectionTips() so callers can surface transport-specific errors and UX guidance; implements these for LedgerBluetoothAdapter (BLE tips + BluetoothDisabled) and no-ops for NonHardwareAdapter, with tests updated accordingly.

Removes the requiresBluetooth helper and tightens module exports by dropping default exports for useDeviceEventHandlers/useHardwareWalletStateManager and narrowing context exports, plus adds a top-level app/core/HardwareWallet index exporting useHardwareWallet and isUserCancellation.

Written by Cursor Bugbot for commit 010da70. This will update automatically on new commits. Configure here.

@mathieuartu mathieuartu self-assigned this Feb 24, 2026
@mathieuartu mathieuartu added the team-accounts-framework Accounts team label Feb 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Comment thread app/core/HardwareWallet/adapters/LedgerBluetoothAdapter.ts
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 75%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes are to the HardwareWallet module in app/core/HardwareWallet/, which handles Ledger and QR hardware wallet connections. The changes include:

  1. Adding two new methods to the HardwareWalletAdapter interface: getTransportDisabledErrorCode() and getConnectionTips()
  2. Implementing these methods in LedgerBluetoothAdapter (with Bluetooth-specific values) and NonHardwareAdapter (with null/empty values)
  3. Removing the unused requiresBluetooth function
  4. Making several internal types private (they weren't used externally)
  5. Updating test files to match the new interface

The changes are primarily internal refactoring and interface extensions. The removed requiresBluetooth function was not used anywhere in the codebase. The new methods are additive and properly implemented in all adapters.

SmokeAccounts is selected because it covers "adding QR-based hardware wallet accounts" according to its description, which is the most relevant test category for hardware wallet changes. While hardware wallet E2E tests typically require actual hardware devices, running SmokeAccounts provides some coverage for account-related flows that might interact with the hardware wallet layer.

The risk is medium because:

  • Changes are in a critical path (app/core/) but are additive/refactoring
  • No breaking changes to external consumers
  • Hardware wallet functionality is specialized and isolated
  • Unit tests are updated to cover the new interface methods

Performance Test Selection:
The changes are to the HardwareWallet module which handles device connections and error handling. These changes don't affect UI rendering performance, data loading, state management, or any of the critical user flows measured by performance tests. The new methods (getTransportDisabledErrorCode, getConnectionTips) are simple getters that return static values and don't impact app performance. No performance tests are needed.

View GitHub Actions results

@mathieuartu mathieuartu changed the title feat: various hw related changes feat: add transport metadata to HardwareWalletAdapter and clean up exports Feb 24, 2026
@mathieuartu mathieuartu changed the title feat: add transport metadata to HardwareWalletAdapter and clean up exports feat: add transport metadata to HardwareWalletAdapter and clean up exports Feb 24, 2026
@mathieuartu mathieuartu added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Feb 24, 2026
@mathieuartu mathieuartu added this pull request to the merge queue Feb 24, 2026
Merged via the queue into main with commit 0901cd2 Feb 24, 2026
209 of 212 checks passed
@mathieuartu mathieuartu deleted the feat/hw-overhaul-3.5 branch February 24, 2026 21:31
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 24, 2026
@metamaskbot metamaskbot added the release-7.68.0 Issue or pull request that will be included in release 7.68.0 label Feb 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.68.0 Issue or pull request that will be included in release 7.68.0 size-S skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-accounts-framework Accounts team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants