npm i viem
pnpm i viem
yarn add viem
// 1. Import modules.
import { createPublicClient, http } from 'viem'
import { mainnet } from 'viem/chains'
// 2. Set up your client with desired chain & transport.
const client = createPublicClient({
chain: mainnet,
transport: http(),
})
// 3. Consume an action!
const blockNumber = await client.getBlockNumber()
viem supports all these features out-of-the-box:
Check out the following places for more wagmi-related content:
Help support future development and make wagmi a sustainable open-source project: