//Solutions>Builder's Guide>Tools>Viem
Viem

Viem

A lightweight, composable, and type-safe TypeScript interface for building reliable Ethereum apps and libraries.

originN/A
users2.4k
launched2022
Submit or update a tool
Audience
๐Ÿ’ธDeFi Developers
๐Ÿ› ๏ธInfrastructure Developers
๐Ÿ—ณ๏ธDAO Tooling Developers
๐Ÿ–ผ๏ธNFT Platform Developers
๐ŸญEnterprise Blockchain Teams
websitexgithubdiscord

Overview

Viem is a TypeScript interface designed to provide developers with a reliable, efficient, and modular way to interact with the Ethereum blockchain. It offers lightweight, composable modules that enable building Ethereum applications and libraries with a focus on type safety and developer experience. Viem addresses common issues found in existing Ethereum libraries such as ethers.js and web3.js by emphasizing stability, minimal bundle size, and performance. Its APIs are designed to be explicit and flexible, allowing developers to understand Ethereum concepts deeply while maintaining strong typing and autocomplete support.

The tool supports abstractions over the JSON-RPC API, first-class smart contract interaction APIs, and utilities for ABI encoding and decoding. It integrates seamlessly with popular Ethereum development environments like Anvil, Hardhat, and Ganache, and supports importing wallets via browser extensions, WalletConnect, or private keys. Viemโ€™s modular architecture enables tree-shaking to keep final bundle sizes small, which is critical for web applications targeting users on slow networks.

Viem stands out by combining a test-driven development approach with comprehensive documentation and stable, deterministic APIs. It is built by the same team behind wagmi, a popular React hooks library for Ethereum, ensuring tight integration and a smooth developer experience. Developers can get started quickly by installing the package via npm and creating clients configured for specific Ethereum chains and transports. Extensive guides and examples are available to ease onboarding and migration from other libraries.

The Problem

Existing low-level Ethereum interface libraries often suffer from poor developer experience, large bundle sizes, unstable APIs, and suboptimal performance. These issues complicate building reliable and efficient Ethereum applications, especially when strong typing and modularity are required.

Unstable and unpredictable API behavior
Excessive bundle size impacting web app load times
Lack of comprehensive TypeScript support and type inference

The Solution

Key Features

JSON-RPC API Abstractions

Simplifies interaction with Ethereum nodes by wrapping low-level JSON-RPC calls into easy-to-use functions.

Smart Contract Interaction

First-class support for contract calls, transactions, and event handling with ABI encoding and decoding utilities.

Wallet Integration

Supports importing wallets from browser extensions, WalletConnect, and private keys for signing transactions.

Compatibility with Ethereum Development Tools

Works seamlessly with Anvil, Hardhat, and Ganache for testing and development.

Key Strengths

Modular and Composable Architecture
Type-Safe APIs with TypeScript
Stable and Predictable Behavior
Performance Optimizations

How Developers Use Viem

๐Ÿ‘จโ€๐Ÿ’ป

Building Type-Safe Ethereum Dapps

Developers use viem to create decentralized applications with strong TypeScript support, ensuring fewer bugs and better maintainability.

๐Ÿ“ฆ

Creating Modular Ethereum Libraries

Library authors leverage viemโ€™s composable modules to build reusable Ethereum interaction components with minimal dependencies.

๐Ÿ”

Integrating Wallets and Smart Contracts

Teams integrate wallet connections and smart contract calls into their apps using viemโ€™s wallet client and contract APIs.

Ship faster than your competition

Free RPC across 76+ chains. Spin up an endpoint in under 30 seconds.

Get your endpoint

Viem Alternatives

Explore web3 competitors and apps like Viem.

Streams
Tool logo

Streams

Quicknode provides fast, reliable, and scalable blockchain infrastructure and developer tools to build and scale onchain applications.
+30
View
Hosted Hardhat
Tool logo

Hosted Hardhat

An Ethereum development environment for compiling, testing, debugging, and deploying smart contracts with advanced Solidity and TypeScript support.
+6
View
Virtual TestNets
Tool logo

Virtual TestNets

Virtually operated Web3 networks that replicate real blockchain networks for development, testing, and staging without using real assets.
+21
View
Rarible
Tool logo

Rarible

Rarible API is a fast, unified NFT API infrastructure providing real-time data and executable market features across Ethereum, Base, Polygon, and more than 10 other chains.
+10
View
MyWish
Tool logo

MyWish

MyWish is a no-code platform for creating, deploying, and managing smart contracts and crypto assets across multiple blockchains.
+5
View
Network APIs
Tool logo

Network APIs

Network APIs provides web3 developer tools focused on blockchain network interactions and API services.
+7
View
Tenderly Monitoring
Tool logo

Tenderly Monitoring

Tenderly Monitoring is a full-stack Web3 development platform offering customizable node RPC, virtual testnets, debugging, simulation, and monitoring tools for smart contract lifecycle management.
+21
View
0x
Tool logo

0x

0x provides battle-tested APIs to embed fast, gasless, and deeply liquid crypto trading into decentralized applications.
+9
View
Blockchain Data Indexing
Tool logo

Blockchain Data Indexing

SubQuery is a decentralized data indexing and RPC infrastructure platform that enables fast, flexible, and scalable access to blockchain data for Web3 applications.
+10
View
Balancer
Tool logo

Balancer

Automated market maker with customizable, multi-token liquidity pools for swaps and yield.
+6
View

Pricing

Open Source
Price (Monthly)Free
Price (Annual)Free
MessagingN/A
SupportCommunity support via GitHub and Discord
Analytics

Start Building Now

Reliable RPC, powerful APIs, and zero hassle.

Resources

Viem offers comprehensive documentation, examples, and community support to help developers get started and migrate from other Ethereum libraries. The project maintains a high test coverage and provides guides on advanced topics such as error handling, EIP-7702, and blob transactions.