14

Using Web3 version 1.0 and getting the following error:

web3.toWei is not a function

Muhammad Altabba
  • 2,157
  • 1
  • 15
  • 31

1 Answers1

22

At Web3 version 1.0, utility functions like toWei and many others have been moved to the web3.utils.

To check all utility functions refer to:

https://web3js.readthedocs.io/en/1.0/web3-utils.html

Ivan
  • 277
  • 2
  • 10
Muhammad Altabba
  • 2,157
  • 1
  • 15
  • 31