feat(accounts): add support for Ledger Nano Gen5 #33297 (#2042)

adds support for the 0x0008 / 0x8000 product ID (Ledger Apex | Nano
Gen5).

Co-authored-by: mmsqe <tqd0800210105@gmail.com>
This commit is contained in:
Daniel Liu 2026-02-28 21:00:13 +08:00 committed by GitHub
parent 2515d6c6c5
commit 2a96ecf87e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,6 +90,7 @@ 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 */
@ -89,7 +98,8 @@ func NewLedgerHub() (*Hub, error) {
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.