diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-10-04 20:36:57 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-10-05 20:35:37 +0800 |
commit | e37a3155cd52d35da3eef9a8dc450b9b3df0b888 (patch) | |
tree | de2e57b09c63e734d81f7635d7cd9c2ffe2a46de /src/web3_wrapper.ts | |
parent | 542cf7b1cb04cd86da86fc1ff39fdcbd1b9b0403 (diff) | |
download | dexon-0x-contracts-e37a3155cd52d35da3eef9a8dc450b9b3df0b888.tar.gz dexon-0x-contracts-e37a3155cd52d35da3eef9a8dc450b9b3df0b888.tar.zst dexon-0x-contracts-e37a3155cd52d35da3eef9a8dc450b9b3df0b888.zip |
Instantiate logAndBlockStreamer
Diffstat (limited to 'src/web3_wrapper.ts')
-rw-r--r-- | src/web3_wrapper.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/web3_wrapper.ts b/src/web3_wrapper.ts index 7576f3d40..fd9b74b8b 100644 --- a/src/web3_wrapper.ts +++ b/src/web3_wrapper.ts @@ -94,8 +94,12 @@ export class Web3Wrapper { const signData = await promisify(this.web3.eth.sign)(address, message); return signData; } - public async getBlockTimestampAsync(blockHash: string): Promise<number> { - const {timestamp} = await promisify(this.web3.eth.getBlock)(blockHash); + public async getBlockAsync(blockParam: string|Web3.BlockParam): Promise<Web3.BlockWithoutTransactionData> { + const block = await promisify(this.web3.eth.getBlock)(blockParam); + return block; + } + public async getBlockTimestampAsync(blockParam: string|Web3.BlockParam): Promise<number> { + const {timestamp} = await this.getBlockAsync(blockParam); return timestamp; } public async getAvailableAddressesAsync(): Promise<string[]> { |