diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-08-25 17:59:23 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-08-29 16:01:13 +0800 |
commit | a8fd3f30cf87660f08fa7b1c249606b7f8872ba1 (patch) | |
tree | bb02a4aec1492a9e33159739090bcd32684ff015 /src/web3_wrapper.ts | |
parent | 05ce9733dadd1f83afa2d96ff55a23cd1477216d (diff) | |
download | dexon-sol-tools-a8fd3f30cf87660f08fa7b1c249606b7f8872ba1.tar dexon-sol-tools-a8fd3f30cf87660f08fa7b1c249606b7f8872ba1.tar.gz dexon-sol-tools-a8fd3f30cf87660f08fa7b1c249606b7f8872ba1.tar.bz2 dexon-sol-tools-a8fd3f30cf87660f08fa7b1c249606b7f8872ba1.tar.lz dexon-sol-tools-a8fd3f30cf87660f08fa7b1c249606b7f8872ba1.tar.xz dexon-sol-tools-a8fd3f30cf87660f08fa7b1c249606b7f8872ba1.tar.zst dexon-sol-tools-a8fd3f30cf87660f08fa7b1c249606b7f8872ba1.zip |
Add a unit parameter to web3Wrapper.toWei
Diffstat (limited to 'src/web3_wrapper.ts')
-rw-r--r-- | src/web3_wrapper.ts | 4 |
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> { |