@aztec/viem

中文文档
2.38.3发布于 2026/09/18MITTypeScriptESM + CJS近 30 天下载 2.2万

TypeScript Interface for Ethereum

原始使用文档
文档目录9 节
  1. Features
  2. Overview
  3. Documentation
  4. Community
  5. Support
  6. Sponsors
  7. Contributing
  8. Authors
  9. License

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

版本与发布记录

@aztec/viem 共发布 2 个版本,首次发布于 2025/11/26;过去 12 个月发布了 2 个版本。

版本发布日期距今
2.38.3latest2026/09/181 个月前
2.38.22025/11/2611 个月前

关于 @aztec/viem 的常见问题

@aztec/viem 是什么?

TypeScript Interface for Ethereum

如何安装 @aztec/viem?

在项目目录运行 npm install @aztec/viem,或使用 pnpm add / yarn add / bun add。

@aztec/viem 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@aztec/viem 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@aztec/viem 可以商用吗?

@aztec/viem 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@aztec/viem 的下载量有多少?

根据 npm 官方下载统计,@aztec/viem 在 2026/10/08 – 2026/11/06 这 30 天内被下载 21,779 次,日均约 726 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@aztec/viem 还在维护吗?

最新版本 2.38.3 发布于 2026/09/18(1 个月前);至今共发布 2 个版本,其中过去 12 个月发布了 2 个;首次发布于 2025/11/26。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。