The Wayback Machine - https://web.archive.org/web/20230606232451/https://github.com/wagmi-dev/viem
Skip to content

wagmi-dev/viem

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
June 2, 2023 20:21
March 22, 2023 12:03
June 7, 2023 06:45
src
June 7, 2023 06:34
June 5, 2023 08:11
January 30, 2023 16:59
May 25, 2023 11:32
June 5, 2023 08:11

viem logo

TypeScript Interface for Ethereum

Version Code coverage MIT License 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 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();

Community

Check out the following places for more viem-related content:

Support

Sponsors

paradigm logo
family logo context logo WalletConnect logo LooksRare logo PartyDAO logo Dynamic logo Sushi logo Stripe logo BitKeep logo Privy logo Spruce logo rollup.id logo pancake logo celo logo

Contributing

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

Authors

License

MIT License