Open
Conversation
4 tasks
SteP-n-s
previously approved these changes
Apr 17, 2026
SteP-n-s
previously approved these changes
Apr 20, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1af1228. Configure here.
SteP-n-s
previously approved these changes
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Explanation
Previously, the bridge analytics pipeline tracked hardware wallet participation as a simple boolean (
is_hardware_wallet: true/false). This was sufficient to answer "did a hardware wallet user complete this swap?" but not "which hardware wallet did they use?" — a signal needed for device-specific debugging and segmentation.This PR adds an
account_hardware_typefield (typed as'Ledger' | 'Trezor' | 'QR Hardware' | 'Lattice' | null) alongside the existingis_hardware_walletboolean across all bridge/swap analytics events. The two fields are kept in sync:is_hardware_walletis now always derived asaccountHardwareType !== null, so they can never disagree.Key implementation details:
getAccountHardwareType()— new helper inbridge-controller/src/utils/metrics/properties.tsthat maps raw keyring type strings (e.g.'Ledger Hardware') to the analytics enum values.isHardwareWalletis updated to delegate to it.RequestMetadatagainsaccount_hardware_type, andEventPropertiesFromControllerState[PageViewed]is widened to include the full request-metadata subset (hardware type, slippage, swap type) since that event was previously missing those fields.BridgeController#getRequestMetadatanow resolvesaccount_hardware_typeandis_hardware_walletin one place and propagates them to all events that call it, replacing the scattered inlineisHardwareWallet(this.#getMultichainSelectedAccount())calls. The lookup is guarded by awalletAddresscheck to prevent#getMultichainSelectedAccountfrom throwing when the quote request hasn't been populated yet (which would silently suppress event tracking via the catch block).getEVMTxPropertiesFromTransactionMetagains an optionalaccountparameter so thetransactionFailedsubscription can pass the resolved account for hardware-type enrichment.#onTransactionFailedwas extracted from the constructor into a private class field to comply with the no-messenger-calls-in-constructor lint rule. It also gains an upfrontfeatureIdguard so theAccountsController:getAccountByAddresscall is never made for PERPS transactions (where tracking is intentionally skipped), and usestxParams?.fromoptional chaining to handle fixtures wheretxParamsis absent.References
mainforbridge-controllerandbridge-status-controller. Replaced Swaps 3894 normalize bridge hardware type #8155Checklist
Note
Medium Risk
Touches analytics event schemas and the bridge/swap event construction paths, so downstream consumers and tracking validation could break if any property expectations diverge. Runtime risk is limited but includes account lookup/metadata edge cases in failure tracking.
Overview
Adds normalized hardware wallet branding to unified bridge/swap analytics by introducing
AccountHardwareTypeand emittingaccount_hardware_type(Ledger/Trezor/QR Hardware/Lattice/null) alongside a derivedis_hardware_walletacross events.Refactors metrics property building to centralize this derivation in
BridgeController/metrics utils (including wideningPageViewedcontroller-derived properties), updatesBridgeStatusControllerfailure handling to optionally look up the submitting account (without callinggetAccountByAddresswhenfromis missing), and adjusts exports, types, and snapshots/tests accordingly.Reviewed by Cursor Bugbot for commit 2f5ed17. Bugbot is set up for automated code reviews on this repo. Configure here.