aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/util/balances.ts
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2017-11-30 14:26:51 +0800
committerAmir Bandeali <abandeali1@gmail.com>2017-11-30 23:10:18 +0800
commite85a69655c29a04b7f1a3506c5ecb55433425f7f (patch)
treed085c0f6fd46980c85f92f60adf95a6b8f272c49 /packages/contracts/util/balances.ts
parent4b3e0383235ca4ca0127f24c2e05543bb45a56bb (diff)
downloaddexon-sol-tools-e85a69655c29a04b7f1a3506c5ecb55433425f7f.tar
dexon-sol-tools-e85a69655c29a04b7f1a3506c5ecb55433425f7f.tar.gz
dexon-sol-tools-e85a69655c29a04b7f1a3506c5ecb55433425f7f.tar.bz2
dexon-sol-tools-e85a69655c29a04b7f1a3506c5ecb55433425f7f.tar.lz
dexon-sol-tools-e85a69655c29a04b7f1a3506c5ecb55433425f7f.tar.xz
dexon-sol-tools-e85a69655c29a04b7f1a3506c5ecb55433425f7f.tar.zst
dexon-sol-tools-e85a69655c29a04b7f1a3506c5ecb55433425f7f.zip
Fix indentations
Diffstat (limited to 'packages/contracts/util/balances.ts')
-rw-r--r--packages/contracts/util/balances.ts36
1 files changed, 18 insertions, 18 deletions
diff --git a/packages/contracts/util/balances.ts b/packages/contracts/util/balances.ts
index ef4abd7bf..fce15db6d 100644
--- a/packages/contracts/util/balances.ts
+++ b/packages/contracts/util/balances.ts
@@ -7,24 +7,24 @@ import {BalancesByOwner, ContractInstance} from './types';
bigNumberConfigs.configure();
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] = {};
+ 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;
+ }
}
- balancesByOwner[ownerAddress][tokenContractInstance.address] = balance;
- }
+ return balancesByOwner;
}
- return balancesByOwner;
- }
}