aboutsummaryrefslogtreecommitdiffstats
path: root/src/web3_wrapper.ts
diff options
context:
space:
mode:
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[]> {