aboutsummaryrefslogtreecommitdiffstats
path: root/src/web3_wrapper.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-10-04 20:36:57 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-10-05 20:35:37 +0800
commite37a3155cd52d35da3eef9a8dc450b9b3df0b888 (patch)
treede2e57b09c63e734d81f7635d7cd9c2ffe2a46de /src/web3_wrapper.ts
parent542cf7b1cb04cd86da86fc1ff39fdcbd1b9b0403 (diff)
downloaddexon-sol-tools-e37a3155cd52d35da3eef9a8dc450b9b3df0b888.tar
dexon-sol-tools-e37a3155cd52d35da3eef9a8dc450b9b3df0b888.tar.gz
dexon-sol-tools-e37a3155cd52d35da3eef9a8dc450b9b3df0b888.tar.bz2
dexon-sol-tools-e37a3155cd52d35da3eef9a8dc450b9b3df0b888.tar.lz
dexon-sol-tools-e37a3155cd52d35da3eef9a8dc450b9b3df0b888.tar.xz
dexon-sol-tools-e37a3155cd52d35da3eef9a8dc450b9b3df0b888.tar.zst
dexon-sol-tools-e37a3155cd52d35da3eef9a8dc450b9b3df0b888.zip
Instantiate logAndBlockStreamer
Diffstat (limited to 'src/web3_wrapper.ts')
-rw-r--r--src/web3_wrapper.ts8
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[]> {