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

@nomiclabs/buidler-web3

Package Overview
Dependencies
Maintainers
2
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nomiclabs/buidler-web3

Buidler plugin for using Web3 1.x

  • 1.3.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
201
decreased by-37.38%
Maintainers
2
Weekly downloads
 
Created
Source

npm buidler

buidler-web3

This plugin integrates Web3.js 1.x into Buidler.

What

This plugin brings to Buidler the Web3 module and an initialized instance of Web3.

Installation

npm install --save-dev @nomiclabs/buidler-web3 web3

And add the following statement to your buidler.config.js:

usePlugin("@nomiclabs/buidler-web3");

Tasks

This plugin creates no additional tasks.

Environment extensions

This plugin adds the following elements to the BuidlerRuntimeEnvironment:

  • Web3: The Web3.js module.
  • web3: An instantiated Web3.js object connected to the selected network.

Usage

Install it and access Web3.js through the Buidler Runtime Environment anywhere you need it (tasks, scripts, tests, etc). For example, in your buidler.config.js:

usePlugin("@nomiclabs/buidler-web3");

// task action function receives the Buidler Runtime Environment as second argument
task("accounts", "Prints accounts", async (_, { web3 }) => {
  
  console.log(await web3.eth.getAccounts());
  
});

module.exports = {};

And then run npx buidler accounts to try it.

Read the documentation on the Buidler Runtime Environment to learn how to access the BRE in different ways to use Web3.js from anywhere the BRE is accessible.

TypeScript support

You need to add this to your tsconfig.json's files array: "node_modules/@nomiclabs/buidler-web3/src/type-extensions.d.ts"

Keywords

FAQs

Package last updated on 28 May 2020

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