diff options
author | Fabio Berger <me@fabioberger.com> | 2018-01-30 20:26:46 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-01-30 20:26:46 +0800 |
commit | c6dece6bd1e5f5afa56b290557eb7a6245c76cb6 (patch) | |
tree | ad7a33ffe5d80c0eb41ae10fbc8314f193e52383 /packages/contracts/util/balances.ts | |
parent | 93a5b3f457c1211676296840c285759007a55500 (diff) | |
download | dexon-0x-contracts-c6dece6bd1e5f5afa56b290557eb7a6245c76cb6.tar.gz dexon-0x-contracts-c6dece6bd1e5f5afa56b290557eb7a6245c76cb6.tar.zst dexon-0x-contracts-c6dece6bd1e5f5afa56b290557eb7a6245c76cb6.zip |
Add config file specifically in prettier command and fix files
Diffstat (limited to 'packages/contracts/util/balances.ts')
-rw-r--r-- | packages/contracts/util/balances.ts | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/packages/contracts/util/balances.ts b/packages/contracts/util/balances.ts index f8c103670..6a1659ab1 100644 --- a/packages/contracts/util/balances.ts +++ b/packages/contracts/util/balances.ts @@ -4,24 +4,24 @@ import * as _ from 'lodash'; import { BalancesByOwner, ContractInstance } from './types'; export class Balances { - private _tokenContractInstances: ContractInstance[]; - private _ownerAddresses: string[]; - constructor(tokenContractInstances: ContractInstance[], ownerAddresses: string[]) { - this._tokenContractInstances = tokenContractInstances; - this._ownerAddresses = ownerAddresses; - } - public async getAsync(): Promise<BalancesByOwner> { - const balancesByOwner: BalancesByOwner = {}; - for (const tokenContractInstance of this._tokenContractInstances) { - for (const ownerAddress of this._ownerAddresses) { - let balance = await tokenContractInstance.balanceOf(ownerAddress); - balance = new BigNumber(balance); - if (_.isUndefined(balancesByOwner[ownerAddress])) { - balancesByOwner[ownerAddress] = {}; - } - balancesByOwner[ownerAddress][tokenContractInstance.address] = balance; - } - } - return balancesByOwner; - } + private _tokenContractInstances: ContractInstance[]; + private _ownerAddresses: string[]; + constructor(tokenContractInstances: ContractInstance[], ownerAddresses: string[]) { + this._tokenContractInstances = tokenContractInstances; + this._ownerAddresses = ownerAddresses; + } + public async getAsync(): Promise<BalancesByOwner> { + const balancesByOwner: BalancesByOwner = {}; + for (const tokenContractInstance of this._tokenContractInstances) { + for (const ownerAddress of this._ownerAddresses) { + let balance = await tokenContractInstance.balanceOf(ownerAddress); + balance = new BigNumber(balance); + if (_.isUndefined(balancesByOwner[ownerAddress])) { + balancesByOwner[ownerAddress] = {}; + } + balancesByOwner[ownerAddress][tokenContractInstance.address] = balance; + } + } + return balancesByOwner; + } } |