You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: use hw wallet error for ledger keyring and add getAppNameAndVersion and getAppConfiguration (#446)
<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:
* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?
Are there any issues or other links reviewers should consult to
understand this pull request better? For instance:
* Fixes #12345
* See: #67890
-->
This PR add a new method `getAppNameAndVersion` and
`getAppConfiguration` to the ledger keyring and uses the hardware wallet
errors.
## Examples
<!--
Are there any examples of this change being used in another repository?
When considering changes to the MetaMask module template, it's strongly
preferred that the change be experimented with in another repository
first. This gives reviewers a better sense of how the change works,
making it less likely the change will need to be reverted or adjusted
later.
-->
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Touches Ledger signing error handling and public error
shapes/messages, which can affect downstream consumers’ error parsing
and UX; adds new bridge commands that depend on correct iframe/mobile
transport support.
>
> **Overview**
> Switches `@metamask/eth-ledger-bridge-keyring` from its custom
`LedgerStatusError` flow to **standardized** `@metamask/hw-wallet-sdk`
error mapping, introducing
`createLedgerError`/`handleLedgerTransportError` that consistently
throws `HardwareWalletError` (with selective `Ledger:` message prefixing
for compatibility) and updating tests/messages accordingly.
>
> Extends the Ledger bridge/keyring surface area with
`getAppNameAndVersion()` and `getAppConfiguration()` across iframe and
mobile bridges (new iframe message actions included), and wires
workspace dependency/build references so the keyring consumes the shared
SDK types/mappings (including exporting the new `ErrorMapping` type from
the SDK).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
61d895d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
0 commit comments