-
Notifications
You must be signed in to change notification settings - Fork 71
feat(accounts): add support for Ledger Nano Gen5 #33297 #2042
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,6 +43,14 @@ const refreshCycle = time.Second | |
| // trashing. | ||
| const refreshThrottling = 500 * time.Millisecond | ||
|
|
||
| const ( | ||
| // deviceUsagePage identifies Ledger devices by HID usage page (0xffa0) on Windows and macOS. | ||
| // See: https://github.com/LedgerHQ/ledger-live/blob/05a2980e838955a11a1418da638ef8ac3df4fb74/libs/ledgerjs/packages/hw-transport-node-hid-noevents/src/TransportNodeHid.ts | ||
| deviceUsagePage = 0xffa0 | ||
| // deviceInterface identifies Ledger devices by USB interface number (0) on Linux. | ||
| deviceInterface = 0 | ||
| ) | ||
|
|
||
| // Hub is a accounts.Backend that can find and handle generic USB hardware wallets. | ||
| type Hub struct { | ||
| scheme string // Protocol scheme prefixing account and wallet URLs. | ||
|
|
@@ -82,14 +90,16 @@ func NewLedgerHub() (*Hub, error) { | |
| 0x0005, /* Ledger Nano S Plus */ | ||
| 0x0006, /* Ledger Nano FTS */ | ||
| 0x0007, /* Ledger Flex */ | ||
| 0x0008, /* Ledger Nano Gen5 */ | ||
|
|
||
| 0x0000, /* WebUSB Ledger Blue */ | ||
| 0x1000, /* WebUSB Ledger Nano S */ | ||
| 0x4000, /* WebUSB Ledger Nano X */ | ||
| 0x5000, /* WebUSB Ledger Nano S Plus */ | ||
| 0x6000, /* WebUSB Ledger Nano FTS */ | ||
| 0x7000, /* WebUSB Ledger Flex */ | ||
| }, 0xffa0, 0, newLedgerDriver) | ||
| 0x8000, /* WebUSB Ledger Nano Gen5 */ | ||
| }, deviceUsagePage, deviceInterface, newLedgerDriver) | ||
|
||
| } | ||
|
|
||
| // NewTrezorHubWithHID creates a new hardware wallet manager for Trezor devices. | ||
|
|
||
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.
The new constants
deviceUsagePage/deviceInterfaceare Ledger-specific but their names read like generic USBwallet-wide settings; this can become confusing next to the Trezor hubs (which use different usage pages/interfaces). Consider renaming them toledgerUsagePageandledgerInterface(orledgerInterfaceNumber) to make the scope explicit.