-
Notifications
You must be signed in to change notification settings - Fork 69
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
base: dev-upgrade
Are you sure you want to change the base?
Conversation
adds support for the 0x0008 / 0x8000 product ID (Ledger Apex | Nano Gen5).
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 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.
Pull request overview
Adds Ledger device detection support for the new Ledger Nano Gen5 / Apex product IDs, ensuring the USB wallet hub can discover these devices across HID/WebUSB variants.
Changes:
- Add Ledger Nano Gen5 product IDs
0x0008and WebUSB0x8000to the Ledger hub discovery list. - Introduce named constants for Ledger’s HID usage page and Linux interface matching parameters, and use them in
NewLedgerHub.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 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 | ||
| ) |
Copilot
AI
Feb 10, 2026
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 / deviceInterface are 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 to ledgerUsagePage and ledgerInterface (or ledgerInterfaceNumber) to make the scope explicit.
| 0x7000, /* WebUSB Ledger Flex */ | ||
| }, 0xffa0, 0, newLedgerDriver) | ||
| 0x8000, /* WebUSB Ledger Nano Gen5 */ | ||
| }, deviceUsagePage, deviceInterface, newLedgerDriver) |
Copilot
AI
Feb 10, 2026
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.
newHub’s last two numeric parameters are named usageID and endpointID, but endpointID is actually compared against hid.DeviceInfo.Interface during enumeration. With the new deviceInterface constant, the naming mismatch becomes more visible; consider renaming endpointID (and the Hub.endpointID field) to interfaceID/interfaceNumber to reflect how it’s used and avoid future confusion.
Proposed changes
adds support for the 0x0008 / 0x8000 product ID (Ledger Apex | Nano Gen5).
Ref: ethereum#33297
Types of changes
What types of changes does your code introduce to XDC network?
Put an
✅in the boxes that applyImpacted Components
Which part of the codebase this PR will touch base on,
Put an
✅in the boxes that applyChecklist
Put an
✅in the boxes once you have confirmed below actions (or provide reasons on not doing so) that