web3.js README

The project's README from github.com/web3/web3.js. As one markdown file: README.md.

web3.js

Web3.js

Web3.js libraries are being sunset on March 4th, 2025. For migration guides and more details please refer to Chainsafe blog

Dependency Status Unit Test Coverage Commit Activity Contributors

ES Version Node Version

Web3.js is a TypeScript implementation of the Ethereum JSON RPC API and related tooling maintained by ChainSafe Systems.

Installation

You can install the package either using NPM or using Yarn

If you wanna checkout latest bugfix or feature, use npm install web3@dev

Using NPM

npm install web3

Using Yarn

yarn add web3

Getting Started

Prerequisites

Migration Guide

Architecture Overview

Package Version License Docs Description
web3 npm License: LGPL v3 documentation :rotating_light: Entire Web3.js offering (includes all packages)
web3-core npm License: LGPL v3 documentation Core functions for web3.js packages
web3-errors npm License: LGPL v3 documentation Errors Objects
web3-eth npm License: LGPL v3 documentation Modules to interact with the Ethereum blockchain and smart contracts
web3-eth-abi npm License: LGPL v3 documentation Functions for encoding and decoding EVM in/output
web3-eth-accounts npm License: LGPL v3 documentation Functions for managing Ethereum accounts and signing
web3-eth-contract npm License: LGPL v3 documentation The contract package contained in web3-eth
web3-eth-ens npm License: LGPL v3 documentation Functions for interacting with the Ethereum Name Service
web3-eth-iban npm License: LGPL v3 documentation Functionality for converting Ethereum addressed to IBAN addressed and vice versa
web3-eth-personal npm License: LGPL v3 documentation Module to interact with the Ethereum blockchain accounts stored in the node
web3-net npm License: LGPL v3 documentation Functions to interact with an Ethereum node's network properties
web3-providers-http npm License: LGPL v3 documentation Web3.js provider for the HTTP protocol
web3-providers-ipc npm License: LGPL v3 documentation Web3.js provider for IPC
web3-providers-ws npm License: LGPL v3 documentation Web3.js provider for the Websocket protocol
web3-rpc-methods npm License: LGPL v3 documentation RPC Methods
web3-types npm License: LGPL v3 documentation Shared useable types
web3-utils npm License: LGPL v3 documentation Useful utility functions for Dapp developers
web3-validator npm License: LGPL v3 documentation 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

web3.js (web3/web3.js)

Searching Database…

19.9K ·GitHub
archived
Что это такое?Набор библиотек на TypeScript для работы с блокчейном Ethereum через его JSON RPC API, плюс вспомогательные функции для разработчиков Dapp. Проект поддерживала компания ChainSafe Systems.
Это одна большая библиотека или набор отдельных пакетов?Это монорепозиторий примерно из 17 пакетов: основной пакет 'web3' включает всё сразу, а узкоспециализированные, вроде web3-eth, web3-eth-contract и web3-utils, можно использовать по отдельности. Провайдеры подключения по HTTP, IPC и WebSocket — тоже отдельные пакеты.
Как добавить её в проект?Выполните 'npm install web3' или аналогичную команду Yarn; чтобы получить последние исправления, используйте 'npm install web3@dev'.
Что нужно установить, чтобы начать ей пользоваться?Нужен Node.js — код рассчитан на Node >= 14, а в README рекомендуется LTS-версия, например Fermium. Yarn и Lerna тоже указаны в требованиях, но нужны только если вы собираете монорепозиторий сами.
Web3.js ещё активно разрабатывается?Нет — поддержку библиотек прекратят 4 марта 2025 года, а репозиторий на GitHub архивирован, так что новых обновлений ждать не стоит. Анонс и руководства по переходу опубликованы в блоге ChainSafe.
Я учился по старым туториалам с API версии 1.x — мой код продолжит работать?Не без изменений: в релизе 4.x появились несовместимые изменения, и в репозитории есть руководство по миграции, с которого стоит начать. Если останутся вопросы, README отсылает к Discord проекта.
Что ещё можно с ней делать, кроме отправки транзакций?Пакеты покрывают все задачи Dapp: ABI-кодирование и декодирование входных и выходных данных EVM, управление аккаунтами и подписание, работу со смарт-контрактами, запросы к Ethereum Name Service, конвертацию адресов Ethereum в IBAN, а также функции валидации и другие утилиты.
Как моему приложению подключиться к ноде Ethereum через неё?Через подключаемые провайдеры, которые поставляются отдельными пакетами: HTTP, IPC и WebSocket. В репозитории даже есть ручной набор тестов для проверки долгоживущего WebSocket-соединения.
Можно ли использовать её в браузерном приложении, например на React?Да — в README есть ссылка на пример React App Example и руководство по tree-shaking, чтобы в бандл попадали только используемые части, а сборка дополнительно создаёт специальную веб-версию.
Creator
web3
Size
133.9 MB
Stars
19.9K
Age
12y
Commits · 90 Days