diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-01-09 08:35:12 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-01-09 08:35:12 +0800 |
commit | 734cf5819aee5d46719d1ca387666bfda6e475bd (patch) | |
tree | 264785cb0666e011b49842b47ac4b2408dddaa28 /packages/website/ts/web3_wrapper.ts | |
parent | 9f3acf8e2888b6105062e47664ecd5adaaf3c889 (diff) | |
parent | 35e0b6143ab1405259471e1c9c698bfcd869df5a (diff) | |
download | dexon-sol-tools-734cf5819aee5d46719d1ca387666bfda6e475bd.tar dexon-sol-tools-734cf5819aee5d46719d1ca387666bfda6e475bd.tar.gz dexon-sol-tools-734cf5819aee5d46719d1ca387666bfda6e475bd.tar.bz2 dexon-sol-tools-734cf5819aee5d46719d1ca387666bfda6e475bd.tar.lz dexon-sol-tools-734cf5819aee5d46719d1ca387666bfda6e475bd.tar.xz dexon-sol-tools-734cf5819aee5d46719d1ca387666bfda6e475bd.tar.zst dexon-sol-tools-734cf5819aee5d46719d1ca387666bfda6e475bd.zip |
Merge branch 'development' into fix/mutatedInput
* development:
Changes to abi-gen after code review
Added constructor ABIs to abi-gen
Describe #295 in a CHANGELOG
Add #302 description to changelog
Fix formatting
Apply prettier config
Install prettier
Remove formatting esilnt rules
sendTransactionAsync should return txHash string
Added Event generation to abi-gen
Publish
Add dates to CHANGELOG entries
Update subproviders CHANGELOG
Support both personal_sign and eth_sign
Fix Ledger tests given change from `personal_sign` to `eth_sign`
Update subprovider to catch correct RPC method
Rename guide
Update contribution guide
Fix broken links in the abi-gen README
Fix typing generation for arrays in which types separated by |s
Diffstat (limited to 'packages/website/ts/web3_wrapper.ts')
-rw-r--r-- | packages/website/ts/web3_wrapper.ts | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/packages/website/ts/web3_wrapper.ts b/packages/website/ts/web3_wrapper.ts index 0dd24fde1..232f12138 100644 --- a/packages/website/ts/web3_wrapper.ts +++ b/packages/website/ts/web3_wrapper.ts @@ -1,7 +1,7 @@ -import {intervalUtils, promisify} from '@0xproject/utils'; +import { intervalUtils, promisify } from '@0xproject/utils'; import BigNumber from 'bignumber.js'; import * as _ from 'lodash'; -import {Dispatcher} from 'ts/redux/dispatcher'; +import { Dispatcher } from 'ts/redux/dispatcher'; import * as Web3 from 'web3'; export class Web3Wrapper { @@ -12,8 +12,12 @@ export class Web3Wrapper { private _watchNetworkAndBalanceIntervalId: NodeJS.Timer; private _prevUserEtherBalanceInEth: BigNumber; private _prevUserAddress: string; - constructor(dispatcher: Dispatcher, provider: Web3.Provider, networkIdIfExists: number, - shouldPollUserAddress: boolean) { + constructor( + dispatcher: Dispatcher, + provider: Web3.Provider, + networkIdIfExists: number, + shouldPollUserAddress: boolean, + ) { this._dispatcher = dispatcher; this._prevNetworkId = networkIdIfExists; this._shouldPollUserAddress = shouldPollUserAddress; @@ -36,7 +40,7 @@ export class Web3Wrapper { if (_.isEmpty(addresses)) { return ''; } - return (addresses)[0]; + return addresses[0]; } public async getNodeVersionAsync(): Promise<string> { const nodeVersion = await promisify<string>(this._web3.version.getNode)(); @@ -71,7 +75,7 @@ export class Web3Wrapper { return signData; } public async getBlockTimestampAsync(blockHash: string): Promise<number> { - const {timestamp} = await promisify<Web3.BlockWithoutTransactionData>(this._web3.eth.getBlock)(blockHash); + const { timestamp } = await promisify<Web3.BlockWithoutTransactionData>(this._web3.eth.getBlock)(blockHash); return timestamp; } public destroy() { |