Skip to content

feat: Enable MetaMask, WalletConnect, Coinbase, Ledger, and Trezor support for second-class EVM chains #11371

@coderabbitai

Description

@coderabbitai

Context

Currently, second-class EVM chains (HyperEVM, Monad, Plasma) only have explicit support enabled for Native wallets in hdwallet. However, these chains use standard Ethereum cryptography and should work with other wallet types.

Related PRs:

Problem

In the current implementation, these wallet types have _supportsHyperEvm = false (and same for Monad/Plasma):

  • hdwallet-metamask-multichain
  • hdwallet-walletconnectv2
  • hdwallet-coinbase
  • hdwallet-ledger
  • hdwallet-trezor

But they should all support these chains because:

  1. MetaMask/WC/Coinbase: These are chain-agnostic and work with any EVM chain
  2. Ledger/Trezor: Use their Ethereum app which supports all EVM chains

Tasks

1. Update Chain Integration Skill Document

  • Revamp .claude/skills/chain-integration/SKILL.md Step 1.2-EVM section
  • Move second-class EVM chains (HyperEVM, Monad, Plasma) from "false" list (L330) to "true" list (L343)
  • Update guidance to reflect that these wallets support all EVM chains

Permalink to current section: https://github.com/shapeshift/web/blob/feat_chain_hyperliquid/.claude/skills/chain-integration/SKILL.md#L324-L343

2. Implement HDWallet Support

For each of HyperEVM, Monad, and Plasma, set readonly _supports[ChainName] = true in:

  • packages/hdwallet-metamask-multichain/src/shapeshift-multichain.ts
  • packages/hdwallet-walletconnectv2/src/walletconnectv2.ts (verify chain-agnostic support first)
  • packages/hdwallet-coinbase/src/coinbase.ts (verify support first)
  • packages/hdwallet-ledger/src/ledger.ts
  • packages/hdwallet-trezor/src/trezor.ts

Note: For WalletConnect and Coinbase, verify they can handle arbitrary EVM chains before enabling.

3. Local Testing with Verdaccio

  • Commit hdwallet changes separately
  • Run Verdaccio publish pipeline
  • Test in web with local hdwallet packages
  • Verify account derivation works for all wallet types
  • Verify transaction signing works

4. Feature Flag Testing

  • Test with feature flags ON (e.g., VITE_FEATURE_HYPEREVM=true)
    • Verify accounts appear
    • Verify transactions can be signed
    • Verify no errors in console
  • Test with feature flags OFF
    • Verify no crashes when attempting Ledger import
    • Verify graceful degradation
    • Verify no chain-related errors

5. Regression Testing

  • Test existing EVM chains (Ethereum, Base, Arbitrum, etc.) still work
  • Test account import/derivation doesn't crash
  • Test wallet switching works correctly
  • Verify UI doesn't show unsupported chains when flags are off

Implementation Notes

  1. Start with the skill update - this documents the pattern
  2. Implement in hdwallet - single commit per wallet type or combined
  3. Test locally - use Verdaccio to avoid publishing
  4. Test thoroughly - flags on/off, multiple wallets, no regressions
  5. Clean commits - revert Verdaccio bumps before final PR

Reference Implementation

See HyperEVM Native wallet implementation for pattern:

AI Agent Prompt

You are implementing expanded wallet support for second-class EVM chains (HyperEVM, Monad, Plasma).

Current state: Only Native wallets support these chains.
Goal: Enable MetaMask, WalletConnect V2, Coinbase, Ledger, and Trezor support.

Steps:
1. Update .claude/skills/chain-integration/SKILL.md to move chains from "unsupported" to "supported" lists
2. In hdwallet repo, set _supportsHyperEvm = true (and Monad/Plasma) for each wallet type
3. Publish to Verdaccio, test in web locally
4. Test with feature flags on/off
5. Verify no regressions on existing chains

Reference: 
- Skill doc: https://github.com/shapeshift/web/blob/feat_chain_hyperliquid/.claude/skills/chain-integration/SKILL.md
- HDWallet PR: https://github.com/shapeshift/hdwallet/pull/756

Success Criteria

  • All five wallet types support HyperEVM, Monad, and Plasma
  • Skill document accurately reflects supported wallets
  • No regressions on existing EVM chains
  • Feature flag gating works correctly
  • Local Verdaccio testing validates changes before npm publish

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions