A React hooks library for Ethereum development that's now on v3 with some smart breaking changes. The hooks are clean (useAccount, useReadContract, useWriteContract) and they moved connectors to a separate package to keep dependencies lean. Built on TanStack Query, so you get proper caching and refetching behavior. The type inference with ABIs is excellent if you remember the "as const" annotation. One thing that trips people up is the migration from v2: useContractRead is now useReadContract, and connectors come from useConnectors() instead of useConnect(). If you're building a React or Next.js app that talks to EVM chains, this is the standard. For Node scripts or backend work, skip this and use viem directly.
$ npx -y skills add 0xsardius/onchain-typescript-skills --skill wagmi --agent claude-codeInstalls into .claude/skills of the current project.
Version: Wagmi 3.x | Official Docs | Requires TypeScript 5.7.3+
Wagmi provides React hooks for Ethereum. This skill ensures correct patterns for provider setup, hooks usage, and React-specific pitfalls.
// config.ts
import { http, createConfig } from 'wagmi'
import { mainnet, polygon, arbitrum } from 'wagmi/chains'
// v3: Install connectors separately: npm i @wagmi/connectors
import { injected, coinbaseWallet, walletConnect } from '@wagmi/connectors'
export const config = createConfig({
chains: [mainnet, polygon, arbitrum],
connectors: [
injected(),
coinbaseWallet({ appName: 'My App' }),
walletConnect({ projectId: 'YOUR_PROJECT_ID' }),
],
transports: {
[mainnet.id]: http('https://eth-mainnet.g.alchemy.com/v2/KEY'),
[polygon.id]: http('https://polygon-mainnet.g.alchemy.com/v2/KEY'),
[arbitrum.id]: http('https://arb-mainnet.g.alchemy.com/v2/KEY'),
},
})
v3 Note: Connectors are now in
@wagmi/connectorspackage for better dependency control.
Sponsors