Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

web3-core

Package Overview
Dependencies
Maintainers
4
Versions
476
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web3-core

Web3 core tools for sub-packages. This is an internal package.

  • 1.10.4
  • legacy
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created

What is web3-core?

The web3-core package is a core module of the Web3.js library, which is used to interact with the Ethereum blockchain. It provides essential functionalities such as managing accounts, sending transactions, and interacting with smart contracts.

What are web3-core's main functionalities?

Managing Accounts

This feature allows you to create and manage Ethereum accounts. The code sample demonstrates how to create a new Ethereum account using the web3-core package.

const Web3 = require('web3');
const web3 = new Web3('https://mainnet.infura.io/v3/YOUR_INFURA_PROJECT_ID');

// Create a new account
const account = web3.eth.accounts.create();
console.log(account);

Sending Transactions

This feature allows you to send transactions on the Ethereum network. The code sample demonstrates how to sign and send a transaction using the web3-core package.

const Web3 = require('web3');
const web3 = new Web3('https://mainnet.infura.io/v3/YOUR_INFURA_PROJECT_ID');

const transaction = {
  to: '0xRecipientAddress',
  value: web3.utils.toWei('0.1', 'ether'),
  gas: 2000000
};

web3.eth.accounts.signTransaction(transaction, 'YOUR_PRIVATE_KEY').then(signedTx => {
  web3.eth.sendSignedTransaction(signedTx.rawTransaction).on('receipt', console.log);
});

Interacting with Smart Contracts

This feature allows you to interact with smart contracts deployed on the Ethereum network. The code sample demonstrates how to call a method on a smart contract using the web3-core package.

const Web3 = require('web3');
const web3 = new Web3('https://mainnet.infura.io/v3/YOUR_INFURA_PROJECT_ID');

const contractABI = [/* ABI array */];
const contractAddress = '0xContractAddress';
const contract = new web3.eth.Contract(contractABI, contractAddress);

contract.methods.myMethod().call().then(console.log);

Other packages similar to web3-core

FAQs

Package last updated on 05 Feb 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc