Add a unit parameter to web3Wrapper.toWei

This commit is contained in:
Leonid Logvinov
2017-08-25 11:59:23 +02:00
parent 05ce9733da
commit a8fd3f30cf

View File

@@ -41,8 +41,8 @@ export class Web3Wrapper {
return undefined;
}
}
public toWei(ethAmount: BigNumber.BigNumber): BigNumber.BigNumber {
const balanceWei = this.web3.toWei(ethAmount, 'ether');
public toWei(amount: BigNumber.BigNumber, unit?: Web3.Unit): BigNumber.BigNumber {
const balanceWei = this.web3.toWei(amount, unit || 'ether');
return balanceWei;
}
public async getBalanceInWeiAsync(owner: string): Promise<BigNumber.BigNumber> {