Closed davekaj closed 5 years ago
In web3 v1.0, you should call fromWei
through utils
.
let getOneTime = this.state.web3.eth.utils.fromWei(result, "ether");
https://web3js.readthedocs.io/en/1.0/web3-utils.html#fromwei
That's correct, thanks @Mizumaki!
I keep getting this weird bug where I am calling web3.eth.fromWei:
getOneTimecontribution() { singleContract.setProvider(this.state.web3.currentProvider) var contractInstance;
}
And then I get an error that is the following:
Uncaught (in promise) TypeError: _this10.state.web3.eth.fromWei is not a function
I think this is a truffle box issue because I am using the same code in a js test script and it works properly.