Buidler plugin for using Web3 0.20.x
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
scripts
src
test
.env
.gitignore
.travis.yml
LICENSE
README.md
package.json
tsconfig.json
tslint.json
yarn.lock

README.md

npm Build Status

buidler-web3-legacy

This plugin integrates Web3.js 0.20x into Buidler.

What

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

Installation

To install this plugin follow these steps:

  1. Install it in your Buidler project with npm install @nomiclabs/buidler-web3-legacy
  2. Install Web3.js with npm install web3@^0.20.7
  3. Import the plugin in your buidler.config.js by adding require("@nomiclabs/buidler-web3-legacy")

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.
  • pweb3: A promisified version of web3.

Usage

In Web3 0.20x some features are synchronous and some are asynchronous. For example web3.eth.accounts and web3.eth.blockNumber are synchronous and not supported. You'll get a Synchronous requests are not supported, use pweb3 instead error when trying to access them. To use these you need to use the promisified web3 and call the getter version of the property instead: await pweb3.eth.getAccounts().