Skip to main content
Home
This release is 2 versions behind 2.41.2 — the latest version of @wevm/viem. Jump to latest

@wevm/viem@2.40.4
Built and signed on GitHub Actions

TypeScript Interface for Ethereum

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
41%
Published
a week ago (2.40.4)

viem logo

TypeScript Interface for Ethereum

Version Code coverage MIT License Downloads per month Best of JS


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:

Support

Sponsors

paradigm logo ithaca logo
family logo context logo WalletConnect logo PartyDAO logo Dynamic logo Sushi logo Stripe logo Privy logo pancake logo celo logo rainbow logo pimlico logo zora logo lattice logo supa logo ZKsync logo syndicate logo reservoir logo linea logo uniswap logo biconomy logo thirdweb logo polymarket logo routescan logo sequence logo gemini logo

Contributing

If you're interested in contributing, please read the contributing docs before submitting a pull request.

Authors

License

MIT License



Powered by Vercel
Built and signed on
GitHub Actions

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@wevm/viem

Import symbol

import * as viem from "@wevm/viem";
or

Import directly with a jsr specifier

import * as viem from "jsr:@wevm/viem";

Add Package

pnpm i jsr:@wevm/viem
or (using pnpm 10.8 or older)
pnpm dlx jsr add @wevm/viem

Import symbol

import * as viem from "@wevm/viem";

Add Package

yarn add jsr:@wevm/viem
or (using Yarn 4.8 or older)
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";