百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
W

web3.js

> 编程语言
开源

收集与Ethereum JSON RPC API互动的综合TypeScript库和公用功能.

19.9K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

收集与Ethereum JSON RPC API互动的综合TypeScript库和公用功能.

# Web3.js ### Web3.js libraries are being sunset on March 4th, 2025. For migration guides and more details please refer to [Chainsafe blog](https://blog.chainsafe.io/web3-js-sunset/) [![Dependency Status][downloads-image]][npm-url] Web3.js is a TypeScript implementation of the [Ethereum JSON RPC API](https://eth.wiki/json-rpc/API) and related tooling maintained by [ChainSafe Systems](https://chainsafe.io). ## Installation You can install the package either using [NPM](https://www.npmjs.com/package/web3) or using [Yarn](https://yarnpkg.com/package/web3) > If you wanna checkout latest bugfix or feature, use `npm install web3@dev` ### Using NPM ```bash npm install web3 ``` ### Using Yarn ```bash yarn add web3 ``` ## Getting Started - :writing_hand: If you have questions [submit an issue](https://github.com/ChainSafe/web3.js/issues/new/choose) or join us on [Discord](https://discord.gg/yjyvFRP) ## Prerequisites - :gear: [NodeJS](https://nodejs.org/) (LTS/Fermium) - :toolbox: [Yarn](https://yarnpkg.com/)/[Lerna](https://lerna.js.org/) ## Migration Guide - [Migration Guide from Web3.js 1.x to 4.x](https://docs.web3js.org/guides/web3_upgrade_guide/index) Breaking changes are listed in migration guide and its first step for migrating from Web3.js 1.x to 4.x. If there is any question or discussion feel free to ask in [Discord](https://discord.gg/yjyvFRP), and in case of any bug or new feature request [open issue](https://github.com/web3/web3.js/issues/new) or create a pull request for [contributions](https://github.com/web3/web3.js/blob/4.x/.github/CONTRIBUTING.md). ## Useful links - [Web3 tree shaking support guide](https://docs.web3js.org/guides/advanced/tree_shaking/) - [React App Example](https://github.com/ChainSafe/web3js-example-react-app) ## Architecture Overview | Package | Version | License | Docs | Description | | ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | [web3](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3) | [](https://www.npmjs.com/package/web3) | [](https://www.gnu.org/licenses/lgpl-3.0) | [](https://docs.web3js.org/api/web3) | :rotating_light: Entire Web3.js offering (includes all packages) | | [web3-core](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-core) | [](https://www.npmjs.com/package/web3-core) | [](https://www.gnu.org/licenses/lgpl-3.0) | [](https://docs.web3js.org/api/web3-core) | Core functions for web3.js packages | | [web3-errors](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-errors) | [](https://www.npmjs.com/package/web3-core) | [](https://www.gnu.org/licenses/lgpl-3.0) | [](https://docs.web3js.org/api/web3-errors) | Errors Objects | | [web3-eth](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-eth) | [](https://www.npmjs.com/package/web3-eth) | [](https://www.gnu.org/licenses/lgpl-3.0) | [](https://docs.web3js.org/api/web3-eth) | Modules to interact with the Ethereum blockchain and smart contracts | | [web3-eth-abi](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-eth-abi) | [](https://www.npmjs.com/package/web3-eth-abi) | [](https://www.gnu.org/licenses/lgpl-3.0) | [](https://docs.web3js.org/api/web3-eth-abi) | Functions for encoding and decoding EVM in/output | | [web3-eth-accounts](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-eth-accounts) | [](https://www.npmjs.com/package/web3-eth-accounts) | [](https://www.gnu.org/licenses/lgpl-3.0) | [](https://docs.web3js.org/api/web3-eth-accounts) | Functions for managing Ethereum accounts and signing | | [web3-eth-contract](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-eth-contract) | [](https://www.npmjs.com/package/web3-eth-contract) | [](https://www.gnu.org/licenses/lgpl-3.0) | [](https://docs.web3js.org/api/web3-eth-contract) | The contract package contained in [web3-eth](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-eth) | | [web3-eth-ens](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-eth-ens) | [](https://www.npmjs.com/package/web3-eth-ens) | [](https://www.gnu.org/licenses/lgpl-3.0) | [](https://docs.web3js.org/api/web3-eth-ens) | Functions for interacting with the Ethereum Name Service | | [web3-eth-iban](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-eth-iban) | [](https://www.npmjs.com/package/web3-eth-iban) | [](https://www.gnu.org/licenses/lgpl-3.0) | [](https://docs.web3js.org/api/web3-eth-iban) | Functionality for converting Ethereum addressed to IBAN addressed and vice versa | | [web3-eth-personal](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-eth-personal) | [](https://www.npmjs.com/package/web3-eth-personal) | [](https://www.gnu.org/licenses/lgpl-3.0) | [](https://docs.web3js.org/api/web3-eth-personal) | Module to interact with the Ethereum blockchain accounts stored in the node | | [web3-net](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-net) | [](https://www.npmjs.com/package/web3-net) | [](https://www.gnu.org/licenses/lgpl-3.0) | [](https://docs.web3js.org/api/web3-net) | Functions to interact with an Ethereum node's network properties | | [web3-providers-http](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-providers-http) | [](https://www.npmjs.com/package/web3-providers-http) | [](https://www.gnu.org/licenses/lgpl-3.0) | [](https://docs.web3js.org/api/web3-providers-http) | Web3.js provider for the HTTP protocol | | [web3-providers-ipc](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-providers-ipc) | [](https://www.npmjs.com/package/web3-providers-ipc) | [](https://www.gnu.org/licenses/lgpl-3.0) | [](https://docs.web3js.org/api/web3-providers-ipc) | Web3.js provider for IPC | | [web3-providers-ws](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-providers-ws) | [](https://www.npmjs.com/package/web3-providers-ws) | [](https://www.gnu.org/licenses/lgpl-3.0) | [](https://docs.web3js.org/api/web3-providers-ws) | Web3.js provider for the Websocket protocol | | [web3-rpc-methods](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-rpc-methods) | [](https://www.npmjs.com/package/web3-types) | [](https://www.gnu.org/licenses/lgpl-3.0) | [](https://docs.web3js.org/api/) | RPC Methods | | [web3-types](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-types) | [](https://www.npmjs.com/package/web3-types) | [](https://www.gnu.org/licenses/lgpl-3.0) | [](https://docs.web3js.org/api/web3-types) | Shared useable types | | [web3-utils](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-utils) | [](https://www.npmjs.com/package/web3-utils) | [](https://www.gnu.org/licenses/lgpl-3.0) | [](https://docs.web3js.org/api/web3-utils) | Useful utility functions for Dapp developers | | [web3-validator](https://github.com/ChainSafe/web3.js/tree/4.x/packages/web3-validator) | [](https://www.npmjs.com/package/web3-validator) | [](https://www.gnu.org/licenses/lgpl-3.0) | [](https://docs.web3js.org/api/web3-validator) | Utilities for validating objects | ## Package.json Scripts | Script | Description | | ------------------------------ | ------------------------------------------------------------------ | | clean | Uses `rimraf` to remove `dist/` | | build | Uses `tsc` to build all packages | | lint | Uses `eslint` to lint all packages | | lint:fix | Uses `eslint` to check and fix any warnings | | format | Uses `prettier` to format the code | | test | Uses `jest` to run unit tests in each package | | test:integration | Uses `jest` to run tests under `/test/integration` in each package | | test:unit | Uses `jest` to run tests under `/test/unit` in each package | | test:manual:long-connection-ws | Runs manual tests for keeping a long WebSocket connection | | test:manual | Runs manual tests under `test/manual` in the web3 package | [npm-url]: https://npmjs.org/package/web3 [downloads-image]: https://img.shields.io/npm/dm/web3?label=npm%20downloads

Issues· 144 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptabi-decodersabi-encodersapiethereum

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言