viem

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Skill based on viem, generated 2026-02-09. Docs: https://viem.sh
viem is a TypeScript client for Ethereum: Public/Wallet/Test clients, transports (HTTP, WebSocket, custom), type-safe contract reads/writes, local and JSON-RPC accounts, chains, ENS, and encoding/unit helpers.
基于viem的Skill,生成于2026-02-09。文档:https://viem.sh
viem是一款面向以太坊的TypeScript客户端:包含公共/钱包/测试客户端、传输方式(HTTP、WebSocket、自定义)、类型安全的合约读/写、本地及JSON-RPC账户、链、ENS,以及编码/单位辅助工具。

Core References

核心参考

TopicDescriptionReference
Clients & TransportsPublic/Wallet/Test clients, HTTP/WS/custom transports, multicall batchingcore-clients-transports
ContractgetContract, readContract, writeContract, simulateContractcore-contract
AccountsLocal (privateKey, mnemonic) and JSON-RPC accounts, extend with publicActionscore-accounts
主题描述参考
客户端与传输公共/钱包/测试客户端、HTTP/WS/自定义传输、多调用批处理core-clients-transports
合约getContract、readContract、writeContract、simulateContractcore-contract
账户本地(私钥、助记词)及JSON-RPC账户,可通过publicActions扩展core-accounts

Features

功能特性

Chains & ENS

链与ENS

TopicDescriptionReference
ChainsBuilt-in chains (viem/chains), defineChain for customfeatures-chains
ENSgetEnsAddress, getEnsName, getEnsAvatar, normalizefeatures-ens
主题描述参考
内置链(viem/chains)、用于自定义链的defineChainfeatures-chains
ENSgetEnsAddress、getEnsName、getEnsAvatar、normalizefeatures-ens

Utilities

实用工具

TopicDescriptionReference
UtilitiesgetAddress, parseEther/formatEther, encoding, keccak256, ABI helpersfeatures-utilities
ABIparseAbi, encodeAbiParameters, decodeAbiParameters, getAbiItemfeatures-abi
主题描述参考
实用工具getAddress、parseEther/formatEther、编码、keccak256、ABI辅助工具features-utilities
ABIparseAbi、encodeAbiParameters、decodeAbiParameters、getAbiItemfeatures-abi

Auth

认证

TopicDescriptionReference
SIWEcreateSiweMessage, verifySiweMessage, parseSiweMessage, validateSiweMessagefeatures-siwe
主题描述参考
SIWEcreateSiweMessage、verifySiweMessage、parseSiweMessage、validateSiweMessagefeatures-siwe

Public data

公共数据

TopicDescriptionReference
Public ActionsgetBalance, getLogs, getBlock, estimateGas, waitForTransactionReceipt, watchEventfeatures-public-actions
主题描述参考
公共操作getBalance、getLogs、getBlock、estimateGas、waitForTransactionReceipt、watchEventfeatures-public-actions

Best Practices

最佳实践

TopicDescriptionReference
Contract & ErrorsSimulate before write, typed error handling, RPC/securitybest-practices-contract-and-errors
主题描述参考
合约与错误写入前模拟、类型化错误处理、RPC/安全best-practices-contract-and-errors

External Links

外部链接