diff --git a/.claude/skills/chain-integration/SKILL.md b/.claude/skills/chain-integration/SKILL.md index 9e54b7d0614..e6cca54c23d 100644 --- a/.claude/skills/chain-integration/SKILL.md +++ b/.claude/skills/chain-integration/SKILL.md @@ -961,6 +961,50 @@ case KnownChainIds.[ChainName]Mainnet: return supports[Chain](wallet) // from hdwallet-core ``` +### Step 3.8: Add Asset Support Detection (CRITICAL!) + +**IMPORTANT**: This was missing for recent chains (Tron, SUI, Monad, HyperEVM, Plasma) and caused assets not to show up properly! + +**File**: `src/state/slices/portfolioSlice/utils/index.ts` + +Add your chain to the `isAssetSupportedByWallet` function around line 367: + +```typescript +// 1. Import your chain ID at the top +import { + // ... existing imports + [chainLower]ChainId, +} from '@shapeshiftoss/caip' + +// 2. Import the support function from hdwallet-core +import { + // ... existing imports + supports[ChainName], +} from '@shapeshiftoss/hdwallet-core' + +// 3. Add case to the switch statement in isAssetSupportedByWallet +export const isAssetSupportedByWallet = (assetId: AssetId, wallet: HDWallet): boolean => { + if (!assetId) return false + const { chainId } = fromAssetId(assetId) + switch (chainId) { + // ... existing cases + case [chainLower]ChainId: + return supports[ChainName](wallet) + // ... rest of cases + default: + return false + } +} +``` + +**Why this matters**: This function determines if a wallet can use a particular asset. Without it, assets for your chain won't appear in wallet UIs even if everything else is configured correctly! + +**Example**: For HyperEVM, add: +```typescript +case hyperEvmChainId: + return supportsHyperEvm(wallet) +``` + --- ## Phase 4: Web Plugin & Feature Flags @@ -1922,6 +1966,7 @@ case plasmaChainId: - [ ] `src/context/PluginProvider/PluginProvider.tsx` - [ ] `src/hooks/useWalletSupportsChain/useWalletSupportsChain.ts` - [ ] `src/hooks/useActionCenterSubscribers/useSendActionSubscriber.tsx` +- [ ] `src/state/slices/portfolioSlice/utils/index.ts` (isAssetSupportedByWallet function) ### Web Files (Config) - [ ] `.env` diff --git a/src/state/slices/portfolioSlice/utils/index.ts b/src/state/slices/portfolioSlice/utils/index.ts index 0f344d64a74..1bacea1a81d 100644 --- a/src/state/slices/portfolioSlice/utils/index.ts +++ b/src/state/slices/portfolioSlice/utils/index.ts @@ -45,12 +45,16 @@ import { supportsCosmos, supportsETH, supportsGnosis, + supportsHyperEvm, supportsMayachain, + supportsMonad, supportsOptimism, + supportsPlasma, supportsPolygon, supportsSolana, supportsSui, supportsThorchain, + supportsTron, } from '@shapeshiftoss/hdwallet-core' import { GridPlusHDWallet } from '@shapeshiftoss/hdwallet-gridplus' import { PhantomHDWallet } from '@shapeshiftoss/hdwallet-phantom' @@ -418,6 +422,14 @@ export const isAssetSupportedByWallet = (assetId: AssetId, wallet: HDWallet): bo return supportsSolana(wallet) case suiChainId: return supportsSui(wallet) + case monadChainId: + return supportsMonad(wallet) + case hyperEvmChainId: + return supportsHyperEvm(wallet) + case plasmaChainId: + return supportsPlasma(wallet) + case tronChainId: + return supportsTron(wallet) default: return false }