viem
78.5kstarscachedTypeScript Interface for Ethereum
Frontend
Official links
About viem
viem is a TypeScript-first Ethereum library with a strong emphasis on type safety, tree-shakeability, and modern DX. It is the foundation many newer libraries (including wagmi) build on, and exposes a clean public/wallet client split that maps naturally to the JSON-RPC world.
Quickstarts
A fast path from zero to running code.
npm install viemimport { createPublicClient, http } from "viem";
import { mainnet } from "viem/chains";
const client = createPublicClient({
chain: mainnet,
transport: http(),
});
const block = await client.getBlock();Documentation
viem.sh documents Public / Wallet / Test clients, Actions, Contracts, and Utilities. The Contract section's type-inference examples are required reading before writing production read/write flows.
Read full docsCommunity Notes
Tips, gotchas, and updated examples from the community.
No community notes yet.
Be the first to share a tip, gotcha, or updated example.