diff options
Diffstat (limited to 'packages/contracts/util/balances.ts')
-rw-r--r-- | packages/contracts/util/balances.ts | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/packages/contracts/util/balances.ts b/packages/contracts/util/balances.ts index fce15db6d..6a1659ab1 100644 --- a/packages/contracts/util/balances.ts +++ b/packages/contracts/util/balances.ts @@ -1,22 +1,19 @@ -import {BigNumber} from 'bignumber.js'; +import { BigNumber } from '@0xproject/utils'; import * as _ from 'lodash'; -import {bigNumberConfigs} from './bignumber_config'; -import {BalancesByOwner, ContractInstance} from './types'; - -bigNumberConfigs.configure(); +import { BalancesByOwner, ContractInstance } from './types'; export class Balances { - private tokenContractInstances: ContractInstance[]; - private ownerAddresses: string[]; + private _tokenContractInstances: ContractInstance[]; + private _ownerAddresses: string[]; constructor(tokenContractInstances: ContractInstance[], ownerAddresses: string[]) { - this.tokenContractInstances = tokenContractInstances; - this.ownerAddresses = ownerAddresses; + 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) { + 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])) { |