.claude/skills/wagmi-config/SKILL.md
Wagmi createConfig setup with chains and transports. Use when configuring multi-chain support and network connections.
npx skillsauth add cyotee/crane wagmi-configInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Setup wagmi with chains and transports.
import { createConfig, http } from '@wagmi/core'
import { mainnet, sepolia, base } from '@wagmi/core/chains'
export const config = createConfig({
chains: [mainnet, sepolia, base],
transports: {
[mainnet.id]: http('https://mainnet.example.com'),
[sepolia.id]: http('https://sepolia.example.com'),
[base.id]: http('https://base.example.com'),
},
})
import { createConfig, http } from '@wagmi/core'
import { mainnet, sepolia } from '@wagmi/core/chains'
import { injected } from '@wagmi/connectors'
import { walletConnect } from '@wagmi/connectors'
export const config = createConfig({
chains: [mainnet, sepolia],
connectors: [
injected(),
walletConnect({ projectId: '...' })
],
transports: {
[mainnet.id]: http(),
[sepolia.id]: http(),
},
})
import { createConfig, createStorage, http } from '@wagmi/core'
import { mainnet, sepolia } from '@wagmi/core/chains'
export const config = createConfig({
chains: [mainnet, sepolia],
storage: createStorage({ storage: window.localStorage }),
transports: {
[mainnet.id]: http(),
[sepolia.id]: http(),
},
})
import { config } from './config'
// Get viem client
const client = config.getClient({ chainId: 1 })
// Subscribe to state changes
const unsubscribe = config.subscribe(
(state) => state.chainId,
(chainId) => console.log('Chain changed:', chainId)
)
// Manually set state
config.setState((state) => ({ ...state, chainId: 1 }))
Enable EIP-6963 multi-injected provider discovery:
export const config = createConfig({
chains: [mainnet, sepolia],
multiInjectedProviderDiscovery: true, // default
transports: { ... },
})
export const config = createConfig({
chains: [mainnet, sepolia],
pollingInterval: 4_000, // polling interval in ms
cacheTime: 4_000, // cache duration
batch: { multicall: true }, // enable multicall batching
transports: { ... },
})
development
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
documentation
Write to contracts and send transactions. Use when executing state-changing contract functions.
development
HTTP and WebSocket transports for blockchain connectivity. Use when configuring network connections.
data-ai
Read contract data with type-safe ABI. Use when querying smart contract view/pure functions.