aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-08-25 17:59:23 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-08-29 16:01:13 +0800
commita8fd3f30cf87660f08fa7b1c249606b7f8872ba1 (patch)
treebb02a4aec1492a9e33159739090bcd32684ff015 /src
parent05ce9733dadd1f83afa2d96ff55a23cd1477216d (diff)
downloaddexon-sol-tools-a8fd3f30cf87660f08fa7b1c249606b7f8872ba1.tar.gz
dexon-sol-tools-a8fd3f30cf87660f08fa7b1c249606b7f8872ba1.tar.zst
dexon-sol-tools-a8fd3f30cf87660f08fa7b1c249606b7f8872ba1.zip
Add a unit parameter to web3Wrapper.toWei
Diffstat (limited to 'src')
-rw-r--r--src/web3_wrapper.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/web3_wrapper.ts b/src/web3_wrapper.ts
index 61bac45c9..1f8038700 100644
--- a/src/web3_wrapper.ts
+++ b/src/web3_wrapper.ts
@@ -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> {