Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
web3-core-helpers
Advanced tools
Web3 core tools helper for sub packages. This is an internal package.
The web3-core-helpers package is a part of the Web3.js library, which provides utility functions and helpers for interacting with the Ethereum blockchain. It includes features for managing errors, formatting data, and other core functionalities that support the main Web3.js modules.
Error Management
This feature provides utilities for managing and formatting errors that occur during interactions with the Ethereum blockchain.
const { errors } = require('web3-core-helpers');
try {
// Some code that might throw an error
} catch (error) {
const formattedError = errors.ErrorResponse(error);
console.error(formattedError);
}
Data Formatting
This feature includes functions for formatting data, such as converting between different units of Ethereum (e.g., from Wei to Ether).
const { formatters } = require('web3-core-helpers');
const weiValue = '1000000000000000000';
const etherValue = formatters.fromWei(weiValue, 'ether');
console.log(etherValue); // Outputs: 1
Utility Functions
This feature provides various utility functions, such as checking if a string is a valid Ethereum address.
const { utils } = require('web3-core-helpers');
const isAddress = utils.isAddress('0x742d35Cc6634C0532925a3b844Bc454e4438f44e');
console.log(isAddress); // Outputs: true
The ethers.js library is a complete and compact library for interacting with the Ethereum blockchain. It provides similar functionalities to web3-core-helpers, including error management, data formatting, and utility functions, but is known for its smaller size and ease of use.
Ethjs is a highly modular and lightweight library for Ethereum. It offers similar functionalities to web3-core-helpers, such as data formatting and utility functions, but is designed to be more modular and minimalistic.
The web3-utils package is another part of the Web3.js library that provides utility functions for Ethereum. It overlaps with some of the functionalities of web3-core-helpers, such as data formatting and utility functions.
This is a sub-package of web3.js with useful helper functions.
Please read the documentation for more.
You can install the package either using NPM or using Yarn
npm install web3-core-helpers
yarn add web3-core-helpers
const helpers = require('web3-core-helpers');
helpers.formatters;
helpers.errors;
...
All the TypeScript typings are placed in the types
folder.
FAQs
Web3 core tools helper for sub packages. This is an internal package.
The npm package web3-core-helpers receives a total of 334,140 weekly downloads. As such, web3-core-helpers popularity was classified as popular.
We found that web3-core-helpers demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.