Registry
Explore community-led codemods to migrate, optimize, and transform your codebase.
Ready to contribute?
Build your own codemod and share it with the community.
Explore community-led codemods to migrate, optimize, and transform your codebase.
Build your own codemod and share it with the community.
Production-grade migration recipe for wagmi v1 → v2. Deterministic hook renames, WagmiProvider swap, connector class→function conversion, connector import consolidation. AI-augmented step for structural edge cases (configureChains, usePrepare+useContractWrite pairs, useNetwork merge, mutation argument relocation, query option wrapping, watch-prop refactor).
npx codemod @zerosky1221/wagmi-v1-to-v2
This is one example from the codemod's test cases. The codemod may handle many more cases.
Build your own codemod and share it with the community.
1 import { useContractRead, useContractReads, useContractWrite, useContractEvent, useWaitForTransaction, useFeeData, useSwitchNetwork } from "wagmi";
2
3 export function Balances() {
4 const { data: balance } = useContractRead({
5 address: "0x0",
6 abi: [],
7 functionName: "balanceOf",
8 });
9
10 const { data: reads } = useContractReads({ contracts: [] });
11 const { writeAsync } = useContractWrite({ address: "0x0", abi: [], functionName: "x" });
12 useContractEvent({ address: "0x0", abi: [], eventName: "Transfer", listener: () => {} });
13
14 const { isLoading } = useWaitForTransaction({ hash: "0x0" });
15 const { data: fee } = useFeeData();
16 const { switchNetwork } = useSwitchNetwork();
17
18 return null;
19 }
20