Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
45 changes: 45 additions & 0 deletions .claude/skills/chain-integration/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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`
Expand Down
12 changes: 12 additions & 0 deletions src/state/slices/portfolioSlice/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
}
Expand Down