From 4b50da857f9b1c574f9dd86663ca1674fa161459 Mon Sep 17 00:00:00 2001 From: Monte Lai Date: Mon, 9 Feb 2026 17:05:12 +0800 Subject: [PATCH 01/10] fix: update mapping --- .../src/hardware-error-mappings.test.ts | 20 +++++++++++++++++-- .../src/hardware-error-mappings.ts | 15 +++++++++++--- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/packages/hw-wallet-sdk/src/hardware-error-mappings.test.ts b/packages/hw-wallet-sdk/src/hardware-error-mappings.test.ts index 9bbb010ca..245a08f1b 100644 --- a/packages/hw-wallet-sdk/src/hardware-error-mappings.test.ts +++ b/packages/hw-wallet-sdk/src/hardware-error-mappings.test.ts @@ -76,9 +76,9 @@ describe('HARDWARE_ERROR_MAPPINGS', () => { }); }); describe('connection errors', () => { - it('map 0x650f to connection issue', () => { + it('map 0x650f to eth app closed', () => { const mapping = getLedgerMapping('0x650f'); - expect(mapping.code).toBe(ErrorCode.ConnectionClosed); + expect(mapping.code).toBe(ErrorCode.DeviceStateEthAppClosed); expect(mapping.category).toBe(Category.Connection); }); }); @@ -91,6 +91,22 @@ describe('HARDWARE_ERROR_MAPPINGS', () => { expect(mapping.category).toBe(Category.DeviceState); expect(mapping.userMessage).toContain('not responding'); }); + + it('maps 0x6a83 to eth app closed (on solana)', () => { + const mapping = getLedgerMapping('0x6a83'); + expect(mapping.code).toBe(ErrorCode.DeviceStateEthAppClosed); + expect(mapping.severity).toBe(Severity.Err); + expect(mapping.category).toBe(Category.DeviceState); + expect(mapping.userMessage).toContain('solana'); + }); + + it('maps 0x6d00 to eth app closed (on bitcoin)', () => { + const mapping = getLedgerMapping('0x6d00'); + expect(mapping.code).toBe(ErrorCode.DeviceStateEthAppClosed); + expect(mapping.severity).toBe(Severity.Err); + expect(mapping.category).toBe(Category.DeviceState); + expect(mapping.userMessage).toContain('bitcoin'); + }); }); it('has valid structure for all mappings', () => { diff --git a/packages/hw-wallet-sdk/src/hardware-error-mappings.ts b/packages/hw-wallet-sdk/src/hardware-error-mappings.ts index 3081d7802..5a55b172f 100644 --- a/packages/hw-wallet-sdk/src/hardware-error-mappings.ts +++ b/packages/hw-wallet-sdk/src/hardware-error-mappings.ts @@ -71,7 +71,7 @@ export const LEDGER_ERROR_MAPPINGS: Record = { 'Your device is blocked due to too many failed attempts. Please follow device recovery procedures.', }, '0x650f': { - code: ErrorCode.ConnectionClosed, + code: ErrorCode.DeviceStateEthAppClosed, message: 'App closed or connection issue', severity: Severity.Err, category: Category.Connection, @@ -100,12 +100,21 @@ export const LEDGER_ERROR_MAPPINGS: Record = { category: Category.DeviceState, userMessage: 'Blind signing is not supported on this device.', }, + '0x6a83': { + code: ErrorCode.DeviceStateEthAppClosed, + message: 'Ethereum app closed', + severity: Severity.Err, + category: Category.DeviceState, + userMessage: + 'Ethereum app is closed. Currently on solana. Please open it to continue.', + }, '0x6d00': { - code: ErrorCode.DeviceStateOnlyV4Supported, + code: ErrorCode.DeviceStateEthAppClosed, message: 'Ledger Only V4 supported', severity: Severity.Err, category: Category.DeviceState, - userMessage: 'Only V4 is supported on this device.', + userMessage: + 'Ethereum app is closed. Currently on bitcoin. Please open it to continue.', }, '0x6e00': { code: ErrorCode.DeviceStateEthAppClosed, From a4844097214e012cd7881ceaf2e24d6535e28a80 Mon Sep 17 00:00:00 2001 From: Monte Lai Date: Mon, 9 Feb 2026 17:17:29 +0800 Subject: [PATCH 02/10] fix: message --- .../hw-wallet-sdk/src/hardware-error-mappings.test.ts | 6 ++---- packages/hw-wallet-sdk/src/hardware-error-mappings.ts | 8 ++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/hw-wallet-sdk/src/hardware-error-mappings.test.ts b/packages/hw-wallet-sdk/src/hardware-error-mappings.test.ts index 245a08f1b..9431b68ab 100644 --- a/packages/hw-wallet-sdk/src/hardware-error-mappings.test.ts +++ b/packages/hw-wallet-sdk/src/hardware-error-mappings.test.ts @@ -75,15 +75,13 @@ describe('HARDWARE_ERROR_MAPPINGS', () => { expect(mapping.severity).toBe(Severity.Warning); }); }); - describe('connection errors', () => { + describe('device state errors', () => { it('map 0x650f to eth app closed', () => { const mapping = getLedgerMapping('0x650f'); expect(mapping.code).toBe(ErrorCode.DeviceStateEthAppClosed); - expect(mapping.category).toBe(Category.Connection); + expect(mapping.category).toBe(Category.DeviceState); }); - }); - describe('device state errors', () => { it('maps 0x6f00 to device unresponsive', () => { const mapping = getLedgerMapping('0x6f00'); expect(mapping.code).toBe(ErrorCode.DeviceUnresponsive); diff --git a/packages/hw-wallet-sdk/src/hardware-error-mappings.ts b/packages/hw-wallet-sdk/src/hardware-error-mappings.ts index 5a55b172f..07dc73781 100644 --- a/packages/hw-wallet-sdk/src/hardware-error-mappings.ts +++ b/packages/hw-wallet-sdk/src/hardware-error-mappings.ts @@ -72,11 +72,11 @@ export const LEDGER_ERROR_MAPPINGS: Record = { }, '0x650f': { code: ErrorCode.DeviceStateEthAppClosed, - message: 'App closed or connection issue', + message: 'Ethereum app closed', severity: Severity.Err, - category: Category.Connection, + category: Category.DeviceState, userMessage: - 'Connection lost or app closed. Please open the corresponding app on your Ledger device.', + 'Ethereum app is closed. Please open it on your Ledger device to continue.', }, '0x5515': { code: ErrorCode.AuthenticationDeviceLocked, @@ -110,7 +110,7 @@ export const LEDGER_ERROR_MAPPINGS: Record = { }, '0x6d00': { code: ErrorCode.DeviceStateEthAppClosed, - message: 'Ledger Only V4 supported', + message: 'Ethereum app closed', severity: Severity.Err, category: Category.DeviceState, userMessage: From b17f5bc2e2dc8f09ae9084beeda9c35349e900e5 Mon Sep 17 00:00:00 2001 From: Monte Lai Date: Mon, 9 Feb 2026 17:39:32 +0800 Subject: [PATCH 03/10] fix: test --- .../src/ledger-error-handler.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/keyring-eth-ledger-bridge/src/ledger-error-handler.test.ts b/packages/keyring-eth-ledger-bridge/src/ledger-error-handler.test.ts index c8214359d..c664c1d9f 100644 --- a/packages/keyring-eth-ledger-bridge/src/ledger-error-handler.test.ts +++ b/packages/keyring-eth-ledger-bridge/src/ledger-error-handler.test.ts @@ -91,8 +91,8 @@ describe('handleLedgerTransportError', () => { tc: 'app closed', inputMessage: 'App closed', status: 0x650f, - expectedCode: ErrorCodeEnum.ConnectionClosed, - expectedMessage: 'Ledger: App closed or connection issue', + expectedCode: ErrorCodeEnum.DeviceStateEthAppClosed, + expectedMessage: 'Ledger: Ethereum app closed', }, { tc: 'unknown status codes by preserving original message', From a4433e595fc8b3fa5dfe936a51df4f70d5909774 Mon Sep 17 00:00:00 2001 From: Monte Lai Date: Mon, 9 Feb 2026 17:53:01 +0800 Subject: [PATCH 04/10] fix: update change log --- packages/hw-wallet-sdk/CHANGELOG.md | 9 +++++++++ packages/keyring-eth-ledger-bridge/CHANGELOG.md | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/packages/hw-wallet-sdk/CHANGELOG.md b/packages/hw-wallet-sdk/CHANGELOG.md index 5e86d172b..0333f3526 100644 --- a/packages/hw-wallet-sdk/CHANGELOG.md +++ b/packages/hw-wallet-sdk/CHANGELOG.md @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Fix error mapping for status code `0x650f` from `ConnectionClosed` to `DeviceStateEthAppClosed` ([#446](https://github.com/MetaMask/accounts/pull/446)) +- Fix error mapping for status code `0x6d00` from `DeviceStateOnlyV4Supported` to `DeviceStateEthAppClosed` ([#446](https://github.com/MetaMask/accounts/pull/446)) + +### Added + +- Add error mapping for status code `0x6a83` indicating Ethereum app closed while on Solana ([#446](https://github.com/MetaMask/accounts/pull/446)) + ## [0.4.0] ### Added diff --git a/packages/keyring-eth-ledger-bridge/CHANGELOG.md b/packages/keyring-eth-ledger-bridge/CHANGELOG.md index dd7ac3749..b95e8584e 100644 --- a/packages/keyring-eth-ledger-bridge/CHANGELOG.md +++ b/packages/keyring-eth-ledger-bridge/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Update error handling for status code `0x650f` to reflect `DeviceStateEthAppClosed` instead of `ConnectionClosed` ([#446](https://github.com/MetaMask/accounts/pull/446)) + ## [11.3.0] ### Changed From 527dae2c9108ef10f17c699fa4af8c59e19f1237 Mon Sep 17 00:00:00 2001 From: Monte Lai Date: Mon, 9 Feb 2026 18:07:37 +0800 Subject: [PATCH 05/10] Update packages/keyring-eth-ledger-bridge/CHANGELOG.md Co-authored-by: Charly Chevalier --- packages/keyring-eth-ledger-bridge/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/keyring-eth-ledger-bridge/CHANGELOG.md b/packages/keyring-eth-ledger-bridge/CHANGELOG.md index b95e8584e..aea90e623 100644 --- a/packages/keyring-eth-ledger-bridge/CHANGELOG.md +++ b/packages/keyring-eth-ledger-bridge/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Update error handling for status code `0x650f` to reflect `DeviceStateEthAppClosed` instead of `ConnectionClosed` ([#446](https://github.com/MetaMask/accounts/pull/446)) +- Update error handling for status code `0x650f` to reflect `DeviceStateEthAppClosed` instead of `ConnectionClosed` ([#466](https://github.com/MetaMask/accounts/pull/466)) ## [11.3.0] From 8c75e5ececa76e0653f19c126d8cec2193a1f12c Mon Sep 17 00:00:00 2001 From: Monte Lai Date: Mon, 9 Feb 2026 18:10:28 +0800 Subject: [PATCH 06/10] fix: changelog --- packages/hw-wallet-sdk/CHANGELOG.md | 7 ++++--- packages/keyring-eth-ledger-bridge/CHANGELOG.md | 4 ---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/hw-wallet-sdk/CHANGELOG.md b/packages/hw-wallet-sdk/CHANGELOG.md index 0333f3526..b9ffbeb9b 100644 --- a/packages/hw-wallet-sdk/CHANGELOG.md +++ b/packages/hw-wallet-sdk/CHANGELOG.md @@ -7,10 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -### Changed +### Fixed -- Fix error mapping for status code `0x650f` from `ConnectionClosed` to `DeviceStateEthAppClosed` ([#446](https://github.com/MetaMask/accounts/pull/446)) -- Fix error mapping for status code `0x6d00` from `DeviceStateOnlyV4Supported` to `DeviceStateEthAppClosed` ([#446](https://github.com/MetaMask/accounts/pull/446)) +6- Fix error mapping for status code `0x650f` from `ConnectionClosed` to `DeviceStateEthAppClosed` ([#466](https://github.com/MetaMask/accounts/pull/466)) + +- Fix error mapping for status code `0x6d00` from `DeviceStateOnlyV4Supported` to `DeviceStateEthAppClosed` ([#466](https://github.com/MetaMask/accounts/pull/466)) ### Added diff --git a/packages/keyring-eth-ledger-bridge/CHANGELOG.md b/packages/keyring-eth-ledger-bridge/CHANGELOG.md index aea90e623..dd7ac3749 100644 --- a/packages/keyring-eth-ledger-bridge/CHANGELOG.md +++ b/packages/keyring-eth-ledger-bridge/CHANGELOG.md @@ -7,10 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -### Changed - -- Update error handling for status code `0x650f` to reflect `DeviceStateEthAppClosed` instead of `ConnectionClosed` ([#466](https://github.com/MetaMask/accounts/pull/466)) - ## [11.3.0] ### Changed From 9f96ffb4b0f8ee0a86069e2814ad6b873375a85c Mon Sep 17 00:00:00 2001 From: Monte Lai Date: Mon, 9 Feb 2026 18:11:30 +0800 Subject: [PATCH 07/10] fix: changelog --- packages/hw-wallet-sdk/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/hw-wallet-sdk/CHANGELOG.md b/packages/hw-wallet-sdk/CHANGELOG.md index b9ffbeb9b..a82179074 100644 --- a/packages/hw-wallet-sdk/CHANGELOG.md +++ b/packages/hw-wallet-sdk/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -6- Fix error mapping for status code `0x650f` from `ConnectionClosed` to `DeviceStateEthAppClosed` ([#466](https://github.com/MetaMask/accounts/pull/466)) +- Fix error mapping for status code `0x650f` from `ConnectionClosed` to `DeviceStateEthAppClosed` ([#466](https://github.com/MetaMask/accounts/pull/466)) - Fix error mapping for status code `0x6d00` from `DeviceStateOnlyV4Supported` to `DeviceStateEthAppClosed` ([#466](https://github.com/MetaMask/accounts/pull/466)) From 1b11c144da5445e8ce3f26f48883cc65c1f208e7 Mon Sep 17 00:00:00 2001 From: Monte Lai Date: Mon, 9 Feb 2026 19:01:24 +0800 Subject: [PATCH 08/10] fix: update chagne log --- packages/hw-wallet-sdk/CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/hw-wallet-sdk/CHANGELOG.md b/packages/hw-wallet-sdk/CHANGELOG.md index a82179074..5cea22b08 100644 --- a/packages/hw-wallet-sdk/CHANGELOG.md +++ b/packages/hw-wallet-sdk/CHANGELOG.md @@ -9,9 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- Fix error mapping for status code `0x650f` from `ConnectionClosed` to `DeviceStateEthAppClosed` ([#466](https://github.com/MetaMask/accounts/pull/466)) - -- Fix error mapping for status code `0x6d00` from `DeviceStateOnlyV4Supported` to `DeviceStateEthAppClosed` ([#466](https://github.com/MetaMask/accounts/pull/466)) +- Fix error mappings for status codes `0x650f` and `0x6d00` to `DeviceStateEthAppClosed` ([#466](https://github.com/MetaMask/accounts/pull/466)) + - `0x650f`: changed from `ConnectionClosed`. + - `0x6d00`: changed from `DeviceStateOnlyV4Supported`. ### Added From 9388962f06c31e17e40b282c92ca9f93f4f2afd5 Mon Sep 17 00:00:00 2001 From: Monte Lai Date: Mon, 9 Feb 2026 19:02:24 +0800 Subject: [PATCH 09/10] fix: add more detail --- packages/hw-wallet-sdk/CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/hw-wallet-sdk/CHANGELOG.md b/packages/hw-wallet-sdk/CHANGELOG.md index 5cea22b08..86f577139 100644 --- a/packages/hw-wallet-sdk/CHANGELOG.md +++ b/packages/hw-wallet-sdk/CHANGELOG.md @@ -9,9 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- Fix error mappings for status codes `0x650f` and `0x6d00` to `DeviceStateEthAppClosed` ([#466](https://github.com/MetaMask/accounts/pull/466)) - - `0x650f`: changed from `ConnectionClosed`. - - `0x6d00`: changed from `DeviceStateOnlyV4Supported`. +- Fix error mappings for status codes `0x650f` and `0x6d00` to map to `DeviceStateEthAppClosed` instead of incorrect error codes ([#466](https://github.com/MetaMask/accounts/pull/466)) + - `0x650f`: changed from `ConnectionClosed` to `DeviceStateEthAppClosed`. + - `0x6d00`: changed from `DeviceStateOnlyV4Supported` to `DeviceStateEthAppClosed`. ### Added From b1e278884498b1f86c5beb17b8aeab926dc02029 Mon Sep 17 00:00:00 2001 From: Monte Lai Date: Mon, 9 Feb 2026 19:16:21 +0800 Subject: [PATCH 10/10] fix: ordering --- packages/hw-wallet-sdk/CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/hw-wallet-sdk/CHANGELOG.md b/packages/hw-wallet-sdk/CHANGELOG.md index 86f577139..3a6d48898 100644 --- a/packages/hw-wallet-sdk/CHANGELOG.md +++ b/packages/hw-wallet-sdk/CHANGELOG.md @@ -7,16 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Add error mapping for status code `0x6a83` indicating Ethereum app closed while on Solana ([#446](https://github.com/MetaMask/accounts/pull/446)) + ### Fixed - Fix error mappings for status codes `0x650f` and `0x6d00` to map to `DeviceStateEthAppClosed` instead of incorrect error codes ([#466](https://github.com/MetaMask/accounts/pull/466)) - `0x650f`: changed from `ConnectionClosed` to `DeviceStateEthAppClosed`. - `0x6d00`: changed from `DeviceStateOnlyV4Supported` to `DeviceStateEthAppClosed`. -### Added - -- Add error mapping for status code `0x6a83` indicating Ethereum app closed while on Solana ([#446](https://github.com/MetaMask/accounts/pull/446)) - ## [0.4.0] ### Added