MetaMask / MetaMask/metamask-extension
Add a key in window.ethereum if hardware wallet is connected
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
**Describe the bug**
When a user connects a hardware wallet (trezor/ledger) with Metamask, `window.ethereum` object doesn't have any key to indicate which hardware wallet is connected.
Use case: since EIP712 signature is not yet fully supported by harware wallets, we might want to conditionally check based on a flag and display a normal signature to the HW users.
**Steps to reproduce (REQUIRED)**
Steps to reproduce the behavior, libraries used with version number, and/or any setup information to easily reproduce:
1. Follow steps from [this link](https://metamask.zendesk.com/hc/en-us/articles/360020394612-How-to-connect-a-Trezor-or-Ledger-Hardware-Wallet) to connect a hardware wallet
2. In the browser console, type window.ethereum
3. No key found for hardware wallet connection
**Expected behavior**
`window.ethereum` should have some keys like `isHardwareWallet: true` and `hardwareWalletName: "ledger"`
(open to suggestions for the key names)
**Screenshots**

**Browser details (please complete the following information):**
- OS: macOS Big Sur
- Hardware Wallet: Ledger Nano X
- Browser: Chrome
- MetaMask Version: 9.2.0
Contributor guide
Research direction
Start by reviewing how MetaMask exposes window.ethereum after a Ledger or Trezor connection, using the hardware-wallet setup link in the issue to reproduce it. Define the provider keys and values needed to identify the connected wallet, then verify that the provider exposes them after connection and that the reported wallet name is accurate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100