aboutsummaryrefslogtreecommitdiffstats
path: root/src/web3_wrapper.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-06-26 05:50:11 +0800
committerFabio Berger <me@fabioberger.com>2017-06-26 05:50:11 +0800
commit60b3f3e6dd39afe12884a17f9d978dd604a138b5 (patch)
treed19ef9da0fa6a5010806bde6a82d23d8ffe7988e /src/web3_wrapper.ts
parent7d001240c1dae380294cf5664abaf5997e61c61c (diff)
downloaddexon-sol-tools-60b3f3e6dd39afe12884a17f9d978dd604a138b5.tar
dexon-sol-tools-60b3f3e6dd39afe12884a17f9d978dd604a138b5.tar.gz
dexon-sol-tools-60b3f3e6dd39afe12884a17f9d978dd604a138b5.tar.bz2
dexon-sol-tools-60b3f3e6dd39afe12884a17f9d978dd604a138b5.tar.lz
dexon-sol-tools-60b3f3e6dd39afe12884a17f9d978dd604a138b5.tar.xz
dexon-sol-tools-60b3f3e6dd39afe12884a17f9d978dd604a138b5.tar.zst
dexon-sol-tools-60b3f3e6dd39afe12884a17f9d978dd604a138b5.zip
Implement EtherTokenWrapper and tests, with deposit and withdraw methods
Diffstat (limited to 'src/web3_wrapper.ts')
-rw-r--r--src/web3_wrapper.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/web3_wrapper.ts b/src/web3_wrapper.ts
index afecbec7f..0a310aeee 100644
--- a/src/web3_wrapper.ts
+++ b/src/web3_wrapper.ts
@@ -34,6 +34,10 @@ export class Web3Wrapper {
return undefined;
}
}
+ public toWei(ethAmount: BigNumber.BigNumber): BigNumber.BigNumber {
+ const balanceWei = this.web3.toWei(ethAmount, 'ether');
+ return balanceWei;
+ }
public async getBalanceInEthAsync(owner: string): Promise<BigNumber.BigNumber> {
const balanceInWei = await promisify(this.web3.eth.getBalance)(owner);
let balanceEth = this.web3.fromWei(balanceInWei, 'ether');