Skip to content

fix: show informative error for Ledger V3 typed data signing#31677

Open
dawnseeker8 wants to merge 1 commit into
mainfrom
fix/29044-ledger-v3-typed-data-error
Open

fix: show informative error for Ledger V3 typed data signing#31677
dawnseeker8 wants to merge 1 commit into
mainfrom
fix/29044-ledger-v3-typed-data-error

Conversation

@dawnseeker8

@dawnseeker8 dawnseeker8 commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Ledger only supports V4 EIP-712 typed data. When a dApp requested a V3 (or V1) signature, the keyring threw "Ledger: Only version 4 of typed data signing is supported", which the error parser did not recognize and fell through to a generic "Something went wrong" message.

Map this keyring error to a dedicated DeviceStateOnlyV4Supported code with an informative, localized message and an ACKNOWLEDGE recovery action (retry cannot succeed for an unsupported signature type).

Fixes #29044

Description

Changelog

CHANGELOG entry: Fixed an uninformative "Something went wrong" error shown when signing version 3 (V3) typed data with a Ledger device; the app now explains that Ledger only supports version 4 (V4) typed data signatures.

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Ledger only supports V4 EIP-712 typed data. When a dApp requested a V3
(or V1) signature, the keyring threw "Ledger: Only version 4 of typed
data signing is supported", which the error parser did not recognize and
fell through to a generic "Something went wrong" message.

Map this keyring error to a dedicated DeviceStateOnlyV4Supported code
with an informative, localized message and an ACKNOWLEDGE recovery
action (retry cannot succeed for an unsupported signature type).

Fixes #29044

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

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.

@mm-token-exchange-service mm-token-exchange-service Bot added the team-be-trade BE Trade team label Jun 14, 2026
@mm-token-exchange-service

mm-token-exchange-service Bot commented Jun 14, 2026

Copy link
Copy Markdown

PR template — items to address before "Ready for review"

Warnings — informational, address before merging:

  • Description section is empty. Describe what changed and why.
  • Related issues section is empty. Add Fixes: #123 / Closes: <URL> / Refs: <Jira key>, or write a short rationale after the colon.
  • Manual testing steps still contain template content (the Gherkin example title or a [...] placeholder). Replace with real steps, or write N/A — <reason>.
  • Screenshots/Recordings section is empty. Add an image/video for user-facing changes, logs/console output for non-user-facing changes, or write N/A if no evidence is applicable.

See docs/readme/ready-for-review.md for the full Definition of Ready for Review.

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeConfirmations
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 88%
click to see 🤖 AI reasoning details

E2E Test Selection:
The PR adds a new hardware wallet error code DeviceStateOnlyV4Supported to handle the case where a Ledger device only supports EIP-712 typed data V4 signing but a dApp requests V1/V3. Changes are:

  1. parser.ts: New pattern matching for "version 4 of typed data" / "only version 4" error messages → maps to new ErrorCode.DeviceStateOnlyV4Supported
  2. mappings.ts: New error extension with RecoveryAction.ACKNOWLEDGE, danger icon, and localized strings for the new error code
  3. en.json: Two new localization strings (hardware_wallet.errors.only_v4_supported and hardware_wallet.error.unsupported_signature)
  4. Test files: Unit tests for the new functionality

SmokeAccounts is selected because it tests QR-based hardware wallet accounts (Ledger on mobile uses QR), including adding hardware wallet accounts and their interactions.

SmokeConfirmations is selected because this error specifically occurs during EIP-712 typed data signing flows (V1/V3/V4), which are directly tested in SmokeConfirmations (personal_sign, EIP-712 typed data signing). The new error handling affects what users see when signing typed data with a Ledger device.

The changes are purely additive (new error case, no existing behavior modified), making this low risk. No performance-sensitive code paths are affected.

Performance Test Selection:
The changes are limited to hardware wallet error handling (adding a new error code and its display mapping) and localization strings. These are purely UI/error-display changes with no impact on app performance metrics like launch time, asset loading, account list rendering, or any other performance-measured flows.

View GitHub Actions results

@github-actions github-actions Bot added the risk:low AI analysis: low risk label Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:low AI analysis: low risk size-S team-be-trade BE Trade team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: [Ledger] Uninformative error message appears when signing V3 typed data with ledger

1 participant