This release is 2 versions behind 2.41.2 — the latest version of @wevm/viem. Jump to latest
TypeScript Interface for Ethereum
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers




JSR Score
41%
Published
a week ago (2.40.4)
TypeScript Interface for Ethereum
Features
- Abstractions over the JSON-RPC API to make your life easier
- First-class APIs for interacting with Smart Contracts
- Language closely aligned to official Ethereum terminology
- Import your Browser Extension, WalletConnect or Private Key Wallet
- Browser native BigInt, instead of large BigNumber libraries
- Utilities for working with ABIs (encoding/decoding/inspection)
- TypeScript ready (infer types from ABIs and EIP-712 Typed Data)
- First-class support for Anvil, Hardhat & Ganache
- Test suite running against forked Ethereum network
... and a lot more.
Overview
// 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();
Documentation
Head to the documentation to read and learn more about viem.
Community
Check out the following places for more viem-related content:
- Follow @wevm_dev, @_jxom, and @awkweb on Twitter for project updates
- Join the discussions on GitHub
- Share your project/organization that uses viem
Support
Sponsors
Contributing
If you're interested in contributing, please read the contributing docs before submitting a pull request.
Authors
License
MIT License
Built and signed on
GitHub Actions
Add Package
deno add jsr:@wevm/viem
Import symbol
import * as viem from "@wevm/viem";
Import directly with a jsr specifier
import * as viem from "jsr:@wevm/viem";
Add Package
pnpm i jsr:@wevm/viem
pnpm dlx jsr add @wevm/viem
Import symbol
import * as viem from "@wevm/viem";
Add Package
yarn add jsr:@wevm/viem
yarn dlx jsr add @wevm/viem
Import symbol
import * as viem from "@wevm/viem";
Add Package
vlt install jsr:@wevm/viem
Import symbol
import * as viem from "@wevm/viem";
Add Package
npx jsr add @wevm/viem
Import symbol
import * as viem from "@wevm/viem";
Add Package
bunx jsr add @wevm/viem
Import symbol
import * as viem from "@wevm/viem";