sodax-wallet-sdk-react-switch-chain
Installation
SKILL.md
Switch chain (wallet-sdk-react granular skill)
Granular skill for useEvmSwitchChain — EVM wrong-network detection + switching. EVM-only. Source-of-truth reference lives in the parent broad skill's knowledge tree; this file is the focused workflow only.
Step 1 — Clarify with user before coding
- New code or v1 → v2 port? New → § Integration. Port v1 → § Migration.
- Target chain is EVM? This hook only covers EVM networks (and the Injective + MetaMask Ethereum-mainnet auto-switch). Non-EVM chains have no switch concept.
- Gate a signed action? Typical flow:
const { isWrongChain, handleSwitchChain } = useEvmSwitchChain({ xChainId }); block the action and show a switch CTA whileisWrongChain.
Integration workflow (new v2 code)
../integration/knowledge/ai-rules.md— DO / DON'T (read first).../integration/knowledge/recipes/setup.md— prerequisite: provider mounted with theEVMslot.../integration/knowledge/recipes/switch-chain.md— the full wrong-network → switch pattern.- Lookups →
../integration/knowledge/reference/hooks.md(EVM-specific section).