[!重要]
Viem 正在参与 Gitcoin Grants 第21轮。请考虑<a href="https://explorer.gitcoin.co/#/round/42161/389/73">支持该项目</a>。非常感谢。🙏
<br/>
<p align="center">
<a href="https://viem.sh">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wevm/viem/main/.github/gh-logo-dark.svg">
<img alt="viem 标志" src="https://yellow-cdn.veclightyear.com/835a84d5/645aa794-14c3-425a-901d-35c202ca51cb.svg" width="auto" height="60">
</picture>
</a>
</p>
<p align="center">
以太坊的TypeScript接口
<p>
<p align="center">
<a href="https://www.npmjs.com/package/viem">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/v/viem?colorA=21262d&colorB=21262d&style=flat">
<img src="https://img.shields.io/npm/v/viem?colorA=f6f8fa&colorB=f6f8fa&style=flat" alt="版本">
</picture>
</a>
<a href="https://app.codecov.io/gh/wevm/viem">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/codecov/c/github/wevm/viem?colorA=21262d&colorB=21262d&style=flat">
<img src="https://img.shields.io/codecov/c/github/wevm/viem?colorA=f6f8fa&colorB=f6f8fa&style=flat" alt="代码覆盖率">
</picture>
</a>
<a href="https://github.com/wevm/viem/blob/main/LICENSE">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/l/viem?colorA=21262d&colorB=21262d&style=flat">
<img src="https://img.shields.io/npm/l/viem?colorA=f6f8fa&colorB=f6f8fa&style=flat" alt="MIT 许可证">
</picture>
</a>
<a href="https://www.npmjs.com/package/viem">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/dm/viem?colorA=21262d&colorB=21262d&style=flat">
<img src="https://img.shields.io/npm/dm/viem?colorA=f6f8fa&colorB=f6f8fa&style=flat" alt="每月下载量">
</picture>
</a>
<a href="https://bestofjs.org/projects/viem">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/endpoint?colorA=21262d&colorB=21262d&style=flat&url=https://bestofjs-serverless.now.sh/api/project-badge?fullName=wevm%2Fviem%26since=daily">
<img src="https://img.shields.io/endpoint?colorA=f6f8fa&colorB=f6f8fa&style=flat&url=https://bestofjs-serverless.now.sh/api/project-badge?fullName=wevm%2Fviem%26since=daily" alt="Best of JS">
</picture>
</a>
</p>
<br>
特性
... 以及更多功能。
概述
// 1. 导入模块。
import { createPublicClient, http } from 'viem';
import { mainnet } from 'viem/chains';
// 2. 使用所需的链和传输设置您的客户端。
const client = createPublicClient({
chain: mainnet,
transport: http(),
});
// 3. 调用一个操作!
const blockNumber = await client.getBlockNumber();
文档
前往文档阅读并了解更多关于viem的信息。
社区
查看以下地方获取更多viem相关内容:
支持
赞助商
<a href="https://paradigm.xyz">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/paradigm-dark.svg">
<img alt="paradigm 标志" src="https://yellow-cdn.veclightyear.com/835a84d5/bf9e1412-e0f7-4a3e-8a42-0dd30ed0bb1e.svg" width="auto" height="70">
</picture>
</a>
<br>
<a href="https://twitter.com/family">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/family-dark.svg">
<img alt="family标志" src="https://yellow-cdn.veclightyear.com/835a84d5/1a8f44c0-6659-4906-8a78-841d8fb91689.svg" width="auto" height="50">
</picture>
</a>
<a href="https://twitter.com/context">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/context-dark.svg">
<img alt="context标志" src="https://yellow-cdn.veclightyear.com/835a84d5/44ebfb06-31a1-49f8-b649-601dd224cd76.svg" width="auto" height="50">
</picture>
</a>
<a href="https://walletconnect.com">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/walletconnect-dark.svg">
<img alt="WalletConnect标志" src="https://yellow-cdn.veclightyear.com/835a84d5/b63636d9-e208-4e85-9cac-3788fa4e18d8.svg" width="auto" height="50">
</picture>
</a>
<a href="https://zksync.io">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/zksync-dark.svg">
<img alt="ZKsync标志" src="https://yellow-cdn.veclightyear.com/835a84d5/92038fa3-7aab-42fb-aecc-8460fab2ac60.svg" width="auto" height="50">
</picture>
</a>
<a href="https://twitter.com/prtyDAO">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/partydao-dark.svg">
<img alt="PartyDAO标志" src="https://yellow-cdn.veclightyear.com/835a84d5/7ba1b206-282e-43fd-8782-993f442aff7d.svg" width="auto" height="50">
</picture>
</a>
<a href="https://dynamic.xyz">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/dynamic-dark.svg">
<img alt="Dynamic标志" src="https://yellow-cdn.veclightyear.com/835a84d5/7dcec5c1-b7ec-4bee-a807-48f3b03ee4fc.svg" width="auto" height="50">
</picture>
</a>
<a href="https://sushi.com">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/sushi-dark.svg">
<img alt="Sushi标志" src="https://yellow-cdn.veclightyear.com/835a84d5/b8cf0753-9a99-4e3d-8225-78642d2ffd3a.svg" width="auto" height="50">
</picture>
</a>
<a href="https://stripe.com">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/stripe-dark.svg">
<img alt="Stripe标志" src="https://yellow-cdn.veclightyear.com/835a84d5/5db8d589-61eb-4ee0-8eaa-6e8d4f7dd0a9.svg" width="auto" height="50">
</picture>
</a>
<a href="https://privy.io">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/privy-dark.svg">
<img alt="Privy标志" src="https://yellow-cdn.veclightyear.com/835a84d5/f43ee0ce-e8e3-47e3-9ee7-fcee0e842ec8.svg" width="auto" height="50">
</picture>
</a>
<a href="https://pancakeswap.finance">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/pancake-dark.svg">
<img alt="pancake标志" src="https://yellow-cdn.veclightyear.com/835a84d5/b07d9c68-037e-4c5f-ba7a-d35fe8180330.svg" width="auto" height="50">
</picture>
</a>
<a href="https://celo.org">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/celo-dark.svg">
<img alt="celo标志" src="https://yellow-cdn.veclightyear.com/835a84d5/8baa9f77-f825-4bd0-a133-533e3f81d5d9.svg" width="auto" height="50">
</picture>
</a>
<a href="https://pimlico.io">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/pimlico-dark.svg">
<img alt="pimlico标志" src="https://yellow-cdn.veclightyear.com/835a84d5/5c3f07f3-c6da-4dcd-8cdd-85537e5e0190.svg" width="auto" height="50">
</picture>
</a>
<a href="https://zora.co">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/zora-dark.svg">
<img alt="zora标志" src="https://yellow-cdn.veclightyear.com/835a84d5/c0ab6f4a-6d8d-4b53-a0fb-c27781f6d91f.svg" width="auto" height="50">
</picture>
</a>
<a href="https://lattice.xyz">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/lattice-dark.svg">
<img alt="lattice标志" src="https://yellow-cdn.veclightyear.com/835a84d5/8016c649-0a15-40e5-9528-0e0c6040c006.svg" width="auto" height="50">
</picture>
</a>
<a href="https://twitter.com/supafinance">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/supa-dark.svg">
<img alt="supa标志" src="https://yellow-cdn.veclightyear.com/835a84d5/8e2863a6-a361-40a7-addf-9abbf7ad4452.svg" width="auto" height="50">
</picture>
</a>
<a href="https://syndicate.io">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/syndicate-dark.svg">
<img alt="syndicate标志" src="https://yellow-cdn.veclightyear.com/835a84d5/ede24576-ce7c-4398-8f76-55640009028b.svg" width="auto" height="50">
</picture>
</a>
<a href="https://reservoir.tools">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/reservoir-dark.svg">
<img alt="reservoir标志" src="https://yellow-cdn.veclightyear.com/835a84d5/420fec3f-5709-4c23-9d0b-7f77f7ca08ed.svg" width="auto" height="50">
</picture>
</a>
<a href="https://brave.com">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/brave-dark.svg">
<img alt="brave标志" src="https://yellow-cdn.veclightyear.com/835a84d5/b75e7bc8-62c3-4db4-b283-e83c574caa4f.svg" width="auto" height="50">
</picture>
</a>
<a href="https://linea.build">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/linea-dark.svg">
<img alt="linea标志" src="https://yellow-cdn.veclightyear.com/835a84d5/fa1f5bc7-7884-46bb-9e8a-b13de1799042.svg" width="auto" height="50">
</picture>
</a>
<a href="https://uniswap.org">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/wevm/.github/main/content/sponsors/uniswap-dark.svg">
<img alt="uniswap标志" src="https://yellow-cdn.veclightyear.com/835a84d5/afef4042-ad9c-4513-8d25-9c4a595fecdb.svg" width="auto" height="50">
</picture>
</a>
贡献
如果你有兴趣贡献,请在提交拉取请求之前阅读贡献文档。
作者
许可证
MIT 许可证