Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
38c3e93
feat: enable MetaMask support for second-class EVM chains
gomesalexandre Dec 12, 2025
2833d07
feat: enable Ledger support for second-class EVM chains
gomesalexandre Dec 12, 2025
e8444d7
fix: Ledger app validation for second-class EVM chains
gomesalexandre Dec 12, 2025
9da7d5b
refactor: use isEvmChainId for Ledger app gating
gomesalexandre Dec 12, 2025
0a579a9
fix: missing HyperEVM addresses in account import and send flow
gomesalexandre Dec 12, 2025
da23f60
feat: enable Trezor support for second-class EVM chains
gomesalexandre Dec 12, 2025
9e2d28b
feat: enable WalletConnect V2 support for second-class EVM chains
gomesalexandre Dec 12, 2025
7056684
chore: revert verdaccio config and version bumps
gomesalexandre Dec 12, 2025
2014470
[skip ci] feat: bump hdwallet versions to 1.62.29
gomesalexandre Dec 12, 2025
32f10e8
[skip ci] chore: temporarily disable second-class EVM chains for testing
gomesalexandre Dec 12, 2025
6d4bcbd
Revert "[skip ci] chore: temporarily disable second-class EVM chains …
gomesalexandre Dec 12, 2025
d2eb119
chore: trigger CI
gomesalexandre Dec 12, 2025
290eacc
Merge remote-tracking branch 'origin/develop' into feat_second_class_mm
gomesalexandre Dec 12, 2025
8a56626
[skip ci] chore: cancel CI
gomesalexandre Dec 12, 2025
8fdf1db
feat: bump
gomesalexandre Dec 16, 2025
c969bbc
feat: tron app gate
gomesalexandre Dec 16, 2025
0d17176
fix: add ledger app gate to tron chain adapter
gomesalexandre Dec 16, 2025
b90d4bb
fix: add Sui to ledger app gates
gomesalexandre Dec 16, 2025
e403651
Merge branch 'develop' into feat_second_class_mm
NeOMakinG Dec 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 43 additions & 7 deletions .claude/skills/chain-integration/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,21 +327,30 @@ export function supports[ChainName](wallet: HDWallet): wallet is ETHWallet {

**Set flags on ALL wallet implementations** (~12 files):

**For second-class EVM chains (HyperEVM, Monad, Plasma):**

Set `readonly _supports[ChainName] = true` on:
- packages/hdwallet-native/src/ethereum.ts
- packages/hdwallet-metamask-multichain/src/shapeshift-multichain.ts (uses standard EVM cryptography)
- packages/hdwallet-ledger/src/ledger.ts (uses Ethereum app, supports all EVM chains)
- packages/hdwallet-trezor/src/trezor.ts (uses Ethereum app, supports all EVM chains)
- packages/hdwallet-walletconnectv2/src/walletconnectv2.ts (chain-agnostic, supports all EVM chains)

Set `readonly _supports[ChainName] = false` on:
- packages/hdwallet-coinbase/src/coinbase.ts
- packages/hdwallet-gridplus/src/gridplus.ts
- packages/hdwallet-keepkey/src/keepkey.ts
- packages/hdwallet-keplr/src/keplr.ts
- packages/hdwallet-ledger/src/ledger.ts
- packages/hdwallet-metamask-multichain/src/shapeshift-multichain.ts
- packages/hdwallet-phantom/src/phantom.ts
- packages/hdwallet-trezor/src/trezor.ts
- packages/hdwallet-vultisig/src/vultisig.ts
- packages/hdwallet-walletconnect/src/walletconnect.ts
- packages/hdwallet-walletconnectv2/src/walletconnectv2.ts
- packages/hdwallet-walletconnect/src/walletconnect.ts (deprecated, use V2)

**Set `readonly _supports[ChainName] = true` for Native**:
- packages/hdwallet-native/src/ethereum.ts
**For non-EVM chains:**

Set `readonly _supports[ChainName] = true` for Native only:
- packages/hdwallet-native/src/ethereum.ts (or appropriate chain file)

Set `readonly _supports[ChainName] = false` on all other wallet types listed above.

**Then**: Skip to Step 1.6 (Version Bump)

Expand Down Expand Up @@ -1738,6 +1747,33 @@ case [chainLower]ChainId:

**CRITICAL**: Missing even ONE of these causes cryptic type errors! All 4 are required for ALL chains (EVM and non-EVM).

### Gotcha 17: Missing accountIdToLabel Case (BLOCKS ADDRESS DISPLAY!)

**Problem**: Addresses don't display in:
- Account import UI (shows blank address in table)
- Send flow "from" address row (shows empty from address)
- Account dropdowns throughout the app

**Root Cause**: Missing chainId case in `accountIdToLabel()` function
**File**: `src/state/slices/portfolioSlice/utils/index.ts` (around line 80-125)

**Solution**:
1. Add chainId import: `import { [chainLower]ChainId } from '@shapeshiftoss/caip'`
2. Add case to switch statement: `case [chainLower]ChainId:`
3. Place it with other EVM chains (before thorchainChainId)

**Example**:
```typescript
case baseChainId:
case hyperEvmChainId: // ← ADD THIS
case monadChainId:
case plasmaChainId:
```

**Why**: This function converts accountId to human-readable label. Without the case, it hits the `default` and returns `''` (empty string), causing blank addresses everywhere in the UI.

**Note**: This affects ALL wallet types (Native, Ledger, Trezor, MetaMask), not just one wallet.

---

## Quick Reference: File Checklist
Expand Down
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,24 +100,24 @@
"@shapeshiftoss/chain-adapters": "workspace:^",
"@shapeshiftoss/contracts": "workspace:^",
"@shapeshiftoss/errors": "workspace:^",
"@shapeshiftoss/hdwallet-coinbase": "1.62.28",
"@shapeshiftoss/hdwallet-core": "1.62.28",
"@shapeshiftoss/hdwallet-gridplus": "1.62.28",
"@shapeshiftoss/hdwallet-keepkey": "1.62.28",
"@shapeshiftoss/hdwallet-keepkey-webusb": "1.62.28",
"@shapeshiftoss/hdwallet-keplr": "1.62.28",
"@shapeshiftoss/hdwallet-ledger": "1.62.28",
"@shapeshiftoss/hdwallet-ledger-webhid": "1.62.28",
"@shapeshiftoss/hdwallet-ledger-webusb": "1.62.28",
"@shapeshiftoss/hdwallet-metamask-multichain": "1.62.28",
"@shapeshiftoss/hdwallet-native": "1.62.28",
"@shapeshiftoss/hdwallet-native-vault": "1.62.28",
"@shapeshiftoss/hdwallet-phantom": "1.62.28",
"@shapeshiftoss/hdwallet-trezor": "1.62.28",
"@shapeshiftoss/hdwallet-trezor-connect": "1.62.28",
"@shapeshiftoss/hdwallet-vultisig": "1.62.28",
"@shapeshiftoss/hdwallet-walletconnect": "1.62.28",
"@shapeshiftoss/hdwallet-walletconnectv2": "1.62.28",
"@shapeshiftoss/hdwallet-coinbase": "1.62.29",
"@shapeshiftoss/hdwallet-core": "1.62.29",
"@shapeshiftoss/hdwallet-gridplus": "1.62.29",
"@shapeshiftoss/hdwallet-keepkey": "1.62.29",
"@shapeshiftoss/hdwallet-keepkey-webusb": "1.62.29",
"@shapeshiftoss/hdwallet-keplr": "1.62.29",
"@shapeshiftoss/hdwallet-ledger": "1.62.29",
"@shapeshiftoss/hdwallet-ledger-webhid": "1.62.29",
"@shapeshiftoss/hdwallet-ledger-webusb": "1.62.29",
"@shapeshiftoss/hdwallet-metamask-multichain": "1.62.29",
"@shapeshiftoss/hdwallet-native": "1.62.29",
"@shapeshiftoss/hdwallet-native-vault": "1.62.29",
"@shapeshiftoss/hdwallet-phantom": "1.62.29",
"@shapeshiftoss/hdwallet-trezor": "1.62.29",
"@shapeshiftoss/hdwallet-trezor-connect": "1.62.29",
"@shapeshiftoss/hdwallet-vultisig": "1.62.29",
"@shapeshiftoss/hdwallet-walletconnect": "1.62.29",
"@shapeshiftoss/hdwallet-walletconnectv2": "1.62.29",
"@shapeshiftoss/swapper": "workspace:^",
"@shapeshiftoss/types": "workspace:^",
"@shapeshiftoss/unchained-client": "workspace:^",
Expand Down
4 changes: 2 additions & 2 deletions packages/chain-adapters/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"dependencies": {
"@mysten/sui": "1.45.0",
"@shapeshiftoss/caip": "workspace:^",
"@shapeshiftoss/hdwallet-core": "1.62.28",
"@shapeshiftoss/hdwallet-ledger": "1.62.28",
"@shapeshiftoss/hdwallet-core": "1.62.29",
"@shapeshiftoss/hdwallet-ledger": "1.62.29",
"@shapeshiftoss/types": "workspace:^",
"@shapeshiftoss/unchained-client": "workspace:^",
"@shapeshiftoss/utils": "workspace:^",
Expand Down
3 changes: 3 additions & 0 deletions packages/chain-adapters/src/tron/TronChainAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import type {
} from '../types'
import { ChainAdapterDisplayName, CONTRACT_INTERACTION, ValidAddressResultType } from '../types'
import { toAddressNList } from '../utils'
import { verifyLedgerAppOpen } from '../utils/ledgerAppGate'
import { assertAddressNotSanctioned } from '../utils/validateAddress'
import type { TronSignTx, TronUnsignedTx } from './types'

Expand Down Expand Up @@ -115,6 +116,8 @@ export class ChainAdapter implements IChainAdapter<KnownChainIds.TronMainnet> {
if (!wallet) throw new Error('wallet is required')
this.assertSupportsChain(wallet)

await verifyLedgerAppOpen(this.chainId, wallet)

const address = await wallet.tronGetAddress({
addressNList: toAddressNList(this.getBip44Params({ accountNumber })),
showDisplay: showOnDevice,
Expand Down
52 changes: 15 additions & 37 deletions packages/chain-adapters/src/utils/ledgerAppGate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { KnownChainIds } from '@shapeshiftoss/types'
import { EventEmitter } from 'node:events'

import { ChainAdapterError } from '../error/ErrorHandler'
import { isEvmChainId } from '../evm/EvmBaseAdapter'

export const emitter = new EventEmitter()

Expand All @@ -14,20 +15,10 @@ export type LedgerOpenAppEventArgs = {
}

export const getLedgerAppName = (chainId: ChainId | KnownChainIds | undefined) => {
// All EVM chains use the Ethereum Ledger app
if (chainId && isEvmChainId(chainId)) return 'Ethereum'

switch (chainId as KnownChainIds) {
case KnownChainIds.ArbitrumMainnet:
case KnownChainIds.AvalancheMainnet:
case KnownChainIds.ArbitrumNovaMainnet:
case KnownChainIds.BaseMainnet:
case KnownChainIds.BnbSmartChainMainnet:
case KnownChainIds.EthereumMainnet:
case KnownChainIds.GnosisMainnet:
case KnownChainIds.MonadMainnet:
case KnownChainIds.HyperEvmMainnet:
case KnownChainIds.OptimismMainnet:
case KnownChainIds.PlasmaMainnet:
case KnownChainIds.PolygonMainnet:
return 'Ethereum'
case KnownChainIds.BitcoinCashMainnet:
return 'Bitcoin Cash'
case KnownChainIds.BitcoinMainnet:
Expand All @@ -42,15 +33,22 @@ export const getLedgerAppName = (chainId: ChainId | KnownChainIds | undefined) =
return 'Zcash'
case KnownChainIds.SolanaMainnet:
return 'Solana'
case KnownChainIds.SuiMainnet:
return 'Sui'
case KnownChainIds.ThorchainMainnet:
case KnownChainIds.MayachainMainnet:
return 'THORChain'
case KnownChainIds.TronMainnet:
return 'Tron'
default:
throw Error(`Unsupported chainId: ${chainId}`)
}
}

const getCoin = (chainId: ChainId | KnownChainIds) => {
// All EVM chains use the Ethereum Ledger app
if (isEvmChainId(chainId)) return 'Ethereum'

switch (chainId as KnownChainIds) {
case KnownChainIds.BitcoinMainnet:
return 'Bitcoin'
Expand All @@ -62,30 +60,6 @@ const getCoin = (chainId: ChainId | KnownChainIds) => {
return 'Litecoin'
case KnownChainIds.ZcashMainnet:
return 'Zcash'
case KnownChainIds.EthereumMainnet:
return 'Ethereum'
case KnownChainIds.AvalancheMainnet:
return 'Avalanche'
case KnownChainIds.OptimismMainnet:
return 'Optimism'
case KnownChainIds.BnbSmartChainMainnet:
return 'BnbSmartChain'
case KnownChainIds.PolygonMainnet:
return 'Polygon'
case KnownChainIds.GnosisMainnet:
return 'Gnosis'
case KnownChainIds.ArbitrumMainnet:
return 'Arbitrum'
case KnownChainIds.ArbitrumNovaMainnet:
return 'ArbitrumNova'
case KnownChainIds.BaseMainnet:
return 'Base'
case KnownChainIds.MonadMainnet:
return 'Monad'
case KnownChainIds.HyperEvmMainnet:
return 'HyperEVM'
case KnownChainIds.PlasmaMainnet:
return 'Plasma'
case KnownChainIds.ThorchainMainnet:
return 'Rune'
case KnownChainIds.MayachainMainnet:
Expand All @@ -94,6 +68,10 @@ const getCoin = (chainId: ChainId | KnownChainIds) => {
return 'Atom'
case KnownChainIds.SolanaMainnet:
return 'Solana'
case KnownChainIds.SuiMainnet:
return 'Sui'
case KnownChainIds.TronMainnet:
return 'Tron'
default:
throw Error(`Unsupported chainId: ${chainId}`)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/swapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@shapeshiftoss/caip": "workspace:^",
"@shapeshiftoss/chain-adapters": "workspace:^",
"@shapeshiftoss/contracts": "workspace:^",
"@shapeshiftoss/hdwallet-core": "1.62.28",
"@shapeshiftoss/hdwallet-core": "1.62.29",
"@shapeshiftoss/types": "workspace:^",
"@shapeshiftoss/unchained-client": "workspace:^",
"@shapeshiftoss/utils": "workspace:^",
Expand Down
2 changes: 2 additions & 0 deletions src/state/slices/portfolioSlice/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
fromAssetId,
fromChainId,
gnosisChainId,
hyperEvmChainId,
isNft,
ltcChainId,
mayachainChainId,
Expand Down Expand Up @@ -89,6 +90,7 @@ export const accountIdToLabel = (accountId: AccountId): string => {
case arbitrumChainId:
case arbitrumNovaChainId:
case baseChainId:
case hyperEvmChainId:
case monadChainId:
case plasmaChainId:
case thorchainChainId:
Expand Down
Loading