@taibiex/web3
v4.14.0
Published
Ethereum JavaScript API
Downloads
65
Readme
web3.js
This is the main package of web3.js, it contains a collection of comprehensive TypeScript libraries for Interaction with the Ethereum JSON RPC API and utility functions.
Features
- Web3.js Plugins🧩: Enhance or add any functionality by creating scalable web3 plugins for any project.
- Abstractions over the JSON-RPC API: Simplifying interaction for your Developer Experience.
- Language aligned to the official Ethereum terminology
- Tree-shaking focus: Include only what you need during bundling for optimized performance.
- Dynamic contract types and full API in TypeScript: Enforced with strict types for enhanced security and safety.
- Complete utilities and functionalities for all your Ethereum needs
- More efficient ABI Encoder & Decoder
- Extensive documentation with guides and APIs
- Large collection of test cases
- First-class APIs for interacting with Smart Contracts
- ESM and CJS module builds: Support for both ECMAScript module and CommonJS module builds for flexible integration with various project setups.
- Contracts dynamic types & full API in TypeScript
- Using native BigInt instead of large BigNumber libraries: Use native BigInt for improved efficiency compared to using large external BigNumber libraries.
- Custom Output formatters: Format any returned value to be a string, number, BigInt, etc., providing flexibility in handling output data.
Installation
You can install the package either using NPM or using Yarn
Using NPM
npm install web3
Using Yarn
yarn add web3
Getting Started
- :writing_hand: If you have questions submit an issue or join us on Discord
Prerequisites
Migration Guide
- Migration Guide from Web3.js 1.x to 4.x 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, and in case of any bug or new feature request open issue or create a pull request for contributions.
Package.json Scripts
| Script | Description |
| ---------------- | -------------------------------------------------- |
| clean | Uses rimraf
to remove dist/
|
| build | Uses tsc
to build package and dependent packages |
| lint | Uses eslint
to lint package |
| lint:fix | Uses eslint
to check and fix any warnings |
| format | Uses prettier
to format the code |
| test | Uses jest
to run unit tests |
| test:integration | Uses jest
to run tests under /test/integration
|
| test:unit | Uses jest
to run tests under /test/unit
|
Web3.js Packages
We encourage users to use only required individual packages listed in following table, for making lightweight application instead of importing main web3 package, and if you don't need functions from most of the packages that are implicitly included with main web3 package.
| Package | Version | License | Docs | Description | | ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | web3 | | | | :rotating_light: Entire Web3.js offering (includes all packages) | | web3-core | | | | Core functions for web3.js packages | | web3-errors | | | | Errors Objects | | web3-eth | | | | Modules to interact with the Ethereum blockchain and smart contracts | | web3-eth-abi | | | | Functions for encoding and decoding EVM in/output | | web3-eth-accounts | | | | Functions for managing Ethereum accounts and signing | | web3-eth-contract | | | | The contract package contained in web3-eth | | web3-eth-ens | | | | Functions for interacting with the Ethereum Name Service | | web3-eth-iban | | | | Functionality for converting Ethereum addressed to IBAN addressed and vice versa | | web3-eth-personal | | | | Module to interact with the Ethereum blockchain accounts stored in the node | | web3-net | | | | Functions to interact with an Ethereum node's network properties | | web3-providers-http | | | | Web3.js provider for the HTTP protocol | | web3-providers-ipc | | | | Web3.js provider for IPC | | web3-providers-ws | | | | Web3.js provider for the Websocket protocol | | @taibiex/web3-rpc-methods | | | | RPC Methods | | web3-types | | | | Shared useable types | | web3-utils | | | | Useful utility functions for Dapp developers | | web3-validator | | | | Utilities for validating objects |