viem

78.5kstarscached

TypeScript 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.

Installbash
npm install viem
Read a blockts
import { 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 docs

Community Notes

Tips, gotchas, and updated examples from the community.

No community notes yet.

Be the first to share a tip, gotcha, or updated example.

Share a note

Related Tools

Browse all →