- Category
- Crypto
- Rank
- No. 293Tools index
- Pricing
- Open Source
- Type
- TOOL
- Builder
- wevm
- GitHub
- 3.6k stars
- Latest release
- viem@2.56.3
- Date
About
TypeScript interface for Ethereum — typesafe, lightweight, and tree-shakable contract interactions. The modern alternative to ethers.js.
What it does
Viem wraps Ethereum JSON-RPC behind configurable clients that combine a chain with an HTTP, WebSocket, custom, fallback, or IPC transport. It handles contract calls, wallet access, ABI encoding and decoding, account operations, events, signatures, ENS, and chain-specific behavior.
Why it's ranked here
The case for viem rests on unusually broad, explicit coverage. Its exports span routine reads, transaction handling, event watching, contract simulation, account abstraction, ENS, SIWE, test-node controls, and several chain-specific modules. ABI and typed-data inference make TypeScript useful at protocol boundaries where mistakes are costly.
What's good
The API uses official Ethereum terminology and native BigInt instead of a separate large-number abstraction. ABI utilities cover parsing, inspection, encoding, and decoding. Dedicated entry points separate chains, accounts, actions, ENS, SIWE, utilities, tokens, and network extensions. Bundle-size checks enforce small targeted imports.
Tradeoffs
The public surface is large, with experimental areas, chain-specific modules, and deprecated compatibility aliases. That breadth raises discovery and migration costs. Building the repository requires pnpm, a modern Node runtime, Bun-driven scripts, Git submodules, and Foundry contract generation. Some focused imports remain sizable according to configured limits.
How to use it well
It suits TypeScript teams building Ethereum clients, contract integrations, wallets, indexers, or test tooling. Configure a client around an explicit chain and transport, import narrow entry points, and infer types from ABIs. Use the forked-network and environment tests for integration confidence. Treat it as a library, not a command-line application.
Technical notes+
package.json declares an ESM, private development package managed by pnpm and builds CommonJS, ESM, and declaration outputs under src/_cjs, src/_esm, and src/_types. It runs Vitest, type checks, package validation, environment tests, fuzz tests, and size-limit checks. src/index.ts is a broad barrel for clients, actions, accounts, contracts, and types, while src/ens/index.ts, src/siwe/index.ts, src/node/index.ts, src/tempo/index.ts, src/zksync/index.ts, src/tokens/index.ts, and src/utils/index.ts provide focused entry points. src/chains/index.ts exposes a large catalog of chain definitions. The Node entry adds IPC transport and trusted setup access.
Observed
- License
- MIT License
- Primary language
- TypeScript
- Packaging
- npm package with ESM, CommonJS, and TypeScript declaration builds; repository development uses pnpm
- Interface
- Importable library organized into root and focused module entry points; no product CLI is presented
- Runtime surfaces
- Supports HTTP, WebSocket, custom, fallback, and Node IPC transports
- Wallet support
- Browser extension, WalletConnect, and private-key wallets are supported
- Testing
- Vitest suite includes forked Ethereum network testing, type checks, fuzzing, and Bun, Next, Node, TSC, and Vite environment tests
Read from README.md, package.json, src/index.ts, src/ens/index.ts, src/celo/index.ts, src/node/index.ts, src/siwe/index.ts, src/linea/index.ts, src/nonce/index.ts, src/tempo/index.ts, src/utils/index.ts, src/chains/index.ts, src/tokens/index.ts, src/window/index.ts, src/zksync/index.ts.
What it can do
Read data from Ethereum smart contracts
Contract address and function parameters → Contract state data with TypeScript types
Send transactions to Ethereum contracts
Contract address, function name, and transaction parameters → Transaction hash and confirmation
Listen for Ethereum contract events
Contract address and event filter criteria → Real-time event data stream
Connect to Ethereum wallet providers
Wallet provider configuration → Authenticated wallet connection instance
Encode and decode Ethereum transaction data
Raw transaction data or structured parameters → Formatted transaction objects or encoded bytes
Query Ethereum blockchain data
Block numbers, transaction hashes, or addresses → Blockchain state information with type safety
Generate TypeScript types from contract ABIs
Smart contract ABI definitions → TypeScript interface definitions
Tags
Tech Stack
Media

Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.
