mirror of
https://github.com/hanzoai/viem.git
synced 2026-10-30 19:36:39 +00:00
2.8 KiB
2.8 KiB
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
- Test suite running against forked Ethereum network
... and a lot more.
Overview
// 1. Import modules.
import { Client, http, publicActions } from 'viem'
import { mainnet } from 'viem/chains'
// 2. Set up your client with desired chain & transport.
const client = Client.create({
chain: mainnet,
transport: http(),
}).extend(publicActions())
// 3. Consume an action!
const blockNumber = await client.block.getNumber()
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
Contributing
If you're interested in contributing, please read the contributing docs before submitting a pull request.
Authors
License
MIT License