feat(metametrics): use specific `account_hardware_type` for OneKey devices
Description
Currently extension supports connecting to OneKey via Trezor, but we don't have specific metrics to log this when importing the accounts.
Now, the account_hardware_type will be set to OneKey via Trezor for AccountAdded metric when using OneKey devices.
Related issues
Fixes: https://github.com/MetaMask/accounts-planning/issues/586
Manual testing steps
N/A
Screenshots/Recordings
Before
After
Pre-merge author checklist
- [x] I've followed MetaMask Contributor Docs and MetaMask Extension Coding Standards.
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using JSDoc format if applicable
- [x] I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
Pre-merge reviewer checklist
- [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
- [x] 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.
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.
Builds ready [6297cf3]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (1886 ± 61 ms)
| Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
|---|---|---|---|---|---|---|---|
| Chrome | Home | firstPaint | 228 | 2079 | 1716 | 499 | 240 |
| domContentLoaded | 1649 | 2112 | 1853 | 121 | 58 | ||
| load | 1692 | 2137 | 1886 | 128 | 61 | ||
| domInteractive | 17 | 146 | 44 | 28 | 13 |
Bundle size diffs [🚨 Warning! Bundle size has increased!]
- background: 346 Bytes (0.01%)
- ui: 163 Bytes (0.00%)
- common: 163 Bytes (0.00%)
Builds ready [02b8df2]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (1737 ± 97 ms)
| Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
|---|---|---|---|---|---|---|---|
| Chrome | Home | firstPaint | 237 | 2445 | 1658 | 380 | 183 |
| domContentLoaded | 1534 | 2346 | 1702 | 176 | 85 | ||
| load | 1562 | 2455 | 1737 | 202 | 97 | ||
| domInteractive | 26 | 112 | 51 | 23 | 11 |
Bundle size diffs [🚨 Warning! Bundle size has increased!]
- background: 346 Bytes (0.01%)
- ui: 149 Bytes (0.00%)
- common: 329 Bytes (0.00%)
Lint failing
This have been resolved.
Metric verified on Mixpanel using locally deployed build.

Builds ready [410ed88]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (2087 ± 196 ms)
| Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
|---|---|---|---|---|---|---|---|
| Chrome | Home | firstPaint | 1619 | 3066 | 2089 | 419 | 201 |
| domContentLoaded | 1610 | 3053 | 2048 | 393 | 189 | ||
| load | 1618 | 3070 | 2087 | 408 | 196 | ||
| domInteractive | 21 | 98 | 50 | 22 | 10 |
Bundle size diffs [🚨 Warning! Bundle size has increased!]
- background: 428 Bytes (0.01%)
- ui: 149 Bytes (0.00%)
- common: 329 Bytes (0.00%)
Builds ready [826d5c2]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (2016 ± 345 ms)
| Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
|---|---|---|---|---|---|---|---|
| Chrome | Home | firstPaint | 1616 | 4938 | 2023 | 742 | 356 |
| domContentLoaded | 1611 | 4805 | 1994 | 723 | 347 | ||
| load | 1616 | 4819 | 2016 | 719 | 345 | ||
| domInteractive | 18 | 221 | 59 | 48 | 23 |
Bundle size diffs [🚨 Warning! Bundle size has increased!]
- background: 428 Bytes (0.01%)
- ui: 149 Bytes (0.00%)
- common: 329 Bytes (0.00%)
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
86.2% Coverage on New Code
0.0% Duplication on New Code
Builds ready [8d306b2]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (1881 ± 75 ms)
| Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
|---|---|---|---|---|---|---|---|
| Chrome | Home | firstPaint | 281 | 2202 | 1607 | 561 | 269 |
| domContentLoaded | 1635 | 2076 | 1842 | 138 | 66 | ||
| load | 1679 | 2227 | 1881 | 156 | 75 | ||
| domInteractive | 16 | 80 | 43 | 20 | 10 |
Builds ready [c4ebe07]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (1989 ± 109 ms)
| Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
|---|---|---|---|---|---|---|---|
| Chrome | Home | firstPaint | 296 | 2468 | 1905 | 432 | 207 |
| domContentLoaded | 1690 | 2460 | 1949 | 222 | 107 | ||
| load | 1740 | 2473 | 1989 | 227 | 109 | ||
| domInteractive | 20 | 107 | 54 | 22 | 11 | ||
| backgroundConnect | 9 | 134 | 37 | 34 | 16 | ||
| firstReactRender | 50 | 278 | 111 | 56 | 27 | ||
| getState | 4 | 67 | 26 | 23 | 11 | ||
| initialActions | 0 | 1 | 0 | 0 | 0 | ||
| loadScripts | 1232 | 1967 | 1445 | 202 | 97 | ||
| setupStore | 10 | 98 | 33 | 27 | 13 | ||
| uiStartup | 1900 | 2721 | 2239 | 246 | 118 |
Bundle size diffs [🚨 Warning! Bundle size has increased!]
- background: 431 Bytes (0.01%)
- ui: 153 Bytes (0.00%)
- common: 332 Bytes (0.00%)
Builds ready [b786deb]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (1953 ± 118 ms)
| Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
|---|---|---|---|---|---|---|---|
| Chrome | Home | firstPaint | 1712 | 2561 | 1951 | 243 | 117 |
| domContentLoaded | 1702 | 2540 | 1916 | 229 | 110 | ||
| load | 1712 | 2551 | 1953 | 247 | 118 | ||
| domInteractive | 16 | 191 | 63 | 48 | 23 | ||
| backgroundConnect | 8 | 234 | 35 | 49 | 24 | ||
| firstReactRender | 48 | 196 | 100 | 33 | 16 | ||
| getState | 5 | 91 | 23 | 26 | 12 | ||
| initialActions | 0 | 1 | 0 | 0 | 0 | ||
| loadScripts | 1235 | 1970 | 1414 | 175 | 84 | ||
| setupStore | 12 | 97 | 33 | 27 | 13 | ||
| uiStartup | 1923 | 3158 | 2193 | 301 | 145 |
Bundle size diffs [🚨 Warning! Bundle size has increased!]
- background: 431 Bytes (0.01%)
- ui: 153 Bytes (0.00%)
- common: 333 Bytes (0.00%)