-
Notifications
You must be signed in to change notification settings - Fork 5.5k
feat: support OneKey Hardware #32739
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
base: main
Are you sure you want to change the base?
Conversation
|
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. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Caution MetaMask internal reviewing guidelines:
|
176f528 to
7c0bfbd
Compare
dcfa5c0 to
c7ee989
Compare
|
@ByteZhang1024 The CI fails because of a failing This command is running fine on |
|
@Akaryatrh I see it, but this error message is pretty vague, and I don’t have a direction for troubleshooting. Do you have any hints you can give me? |
|
hello, @ByteZhang1024 the reason |
81a08a1 to
2b110e0
Compare
ef818e6 to
c8acc57
Compare
c8acc57 to
e873cce
Compare
| if ( | ||
| this.state.selectedDevice === HardwareDeviceNames.oneKey && | ||
| isUSBSupported | ||
| ) { | ||
| this.setState({ trezorRequestDevicePending: true }); | ||
| try { | ||
| const connectedDevice = await window.navigator.usb.requestDevice({ | ||
| filters: ONEKEY_WEBUSB_FILTER, | ||
| }); | ||
| if (!connectedDevice) { | ||
| throw new Error('No device selected'); | ||
| } | ||
| } finally { | ||
| this.setState({ trezorRequestDevicePending: false }); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ByteZhang1024 Why do we need to keep Trezor compatibility here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| ? history.push(previousPage) | ||
| : history.push(DEFAULT_ROUTE); | ||
| } | ||
| }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ByteZhang1024 I think this comment is relevant to modifications applied on ui/pages/create-account/connect-hardware/select-hardware.js
1e70ede to
b3e6e15
Compare
aaaf7da to
5c63ead
Compare
dawnseeker8
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, Please resolve the conflict to process further.
c923e7d to
23bc064
Compare
23bc064 to
d34f225
Compare
d34f225 to
7362ef7
Compare
|
@dawnseeker8 How to fix the ‘Check template and add labels / check-template-and-add-labels (pull_request_target)’ CI workflow? |
1e99d9f to
1e983b5
Compare
| case KeyringType.oneKey: { | ||
| return new Promise((_, reject) => { | ||
| reject( | ||
| new Error('OneKey does not support eth_getEncryptionPublicKey.'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error should be localized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote this by imitating the code above. Do we need to create a separate localized version for OneKey?
1e983b5 to
ebb168a
Compare
ebb168a to
5de7bbf
Compare
| LedgerKeyring as unknown as KeyringClass, | ||
| keyringOverrides?.ledgerBridge || LedgerIframeBridge, | ||
| ), | ||
| hardwareKeyringBuilderFactory( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Duplicate OneKeyKeyring registration with wrong bridge
In the non-MV3 path (isManifestV3 === false), OneKeyKeyring is registered twice in the additionalKeyrings array. The first registration at lines 82-85 incorrectly uses TrezorConnectBridge as the fallback bridge, while the second registration at lines 90-93 correctly uses OneKeyWebBridge. The first registration with TrezorConnectBridge appears to be leftover code that should have been removed when adding the proper OneKey bridge implementation. This duplication could cause unpredictable behavior when connecting OneKey hardware wallets in non-MV3 builds.
Description
This pull request adds support for connecting OneKey hardware wallets to the extension.
eth-onekey-bridge-keyring
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Adds OneKey hardware wallet support with offscreen bridge, keyring integration, UI flow and error pages, localization, and dependencies.
@metamask/eth-onekey-keyringwith newOneKeyOffscreenBridgeandhardware-onekey-keyring-builder-factory; wires intoKeyringControllerInit(MV2/MV3) and addsconnectHardwareBeforeCheck.app/offscreen/onekey.ts; initializes inoffscreen.ts; defines OneKey actions/events/targets inshared/constants/offscreen-communication.eth_getEncryptionPublicKey.LogoOnekey.@onekeyfe/hd-web-sdket al.) and@metamask/eth-onekey-keyring; updates LavaMoat policy andyarn.lock.Written by Cursor Bugbot for commit a53d769. This will update automatically on new commits. Configure here.