web3 0.2.x 和 1.x.x版本之间的差异

版本差异

单位转换

0.2.x

  • web3.fromWei(13144321,'ether')

1.x.x

  • web3.utils.fromWei(13144321,'ether')
  • 1.0以后的版本使用了大量的Promise,可以结合async/await使用,而0.20版本只支持回调函数

猜你喜欢

转载自blog.csdn.net/CHYabc123456hh/article/details/107778798