aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/0x.js/src')
-rw-r--r--packages/0x.js/src/contract_wrappers/contract_wrapper.ts23
-rw-r--r--packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts12
-rw-r--r--packages/0x.js/src/contract_wrappers/exchange_wrapper.ts46
-rw-r--r--packages/0x.js/src/contract_wrappers/token_registry_wrapper.ts10
-rw-r--r--packages/0x.js/src/contract_wrappers/token_transfer_proxy_wrapper.ts8
-rw-r--r--packages/0x.js/src/contract_wrappers/token_wrapper.ts30
-rw-r--r--packages/0x.js/src/order_watcher/event_watcher.ts7
-rw-r--r--packages/0x.js/src/order_watcher/expiration_watcher.ts9
-rw-r--r--packages/0x.js/src/order_watcher/order_state_watcher.ts48
-rw-r--r--packages/0x.js/src/stores/balance_proxy_allowance_lazy_store.ts3
-rw-r--r--packages/0x.js/src/stores/order_filled_cancelled_lazy_store.ts3
-rw-r--r--packages/0x.js/src/utils/abi_decoder.ts7
-rw-r--r--packages/0x.js/src/utils/assert.ts11
-rw-r--r--packages/0x.js/src/utils/decorators.ts4
-rw-r--r--packages/0x.js/src/utils/exchange_transfer_simulator.ts5
-rw-r--r--packages/0x.js/src/utils/filter_utils.ts7
-rw-r--r--packages/0x.js/src/utils/order_state_utils.ts23
-rw-r--r--packages/0x.js/src/utils/order_validation_utils.ts10
-rw-r--r--packages/0x.js/src/utils/signature_utils.ts1
-rw-r--r--packages/0x.js/src/utils/utils.ts7
20 files changed, 151 insertions, 123 deletions
diff --git a/packages/0x.js/src/contract_wrappers/contract_wrapper.ts b/packages/0x.js/src/contract_wrappers/contract_wrapper.ts
index 93912c3d9..2b99cfe4c 100644
--- a/packages/0x.js/src/contract_wrappers/contract_wrapper.ts
+++ b/packages/0x.js/src/contract_wrappers/contract_wrapper.ts
@@ -1,24 +1,25 @@
+import {Block, BlockAndLogStreamer} from 'ethereumjs-blockstream';
import * as _ from 'lodash';
import * as Web3 from 'web3';
-import {BlockAndLogStreamer, Block} from 'ethereumjs-blockstream';
-import {Web3Wrapper} from '../web3_wrapper';
-import {AbiDecoder} from '../utils/abi_decoder';
+
import {
- ZeroExError,
- InternalZeroExError,
Artifact,
+ BlockParamLiteral,
+ ContractEventArgs,
+ ContractEvents,
+ EventCallback,
+ IndexedFilterValues,
+ InternalZeroExError,
LogWithDecodedArgs,
RawLog,
- ContractEvents,
SubscriptionOpts,
- IndexedFilterValues,
- EventCallback,
- BlockParamLiteral,
- ContractEventArgs,
+ ZeroExError,
} from '../types';
+import {AbiDecoder} from '../utils/abi_decoder';
import {constants} from '../utils/constants';
-import {intervalUtils} from '../utils/interval_utils';
import {filterUtils} from '../utils/filter_utils';
+import {intervalUtils} from '../utils/interval_utils';
+import {Web3Wrapper} from '../web3_wrapper';
export class ContractWrapper {
protected _web3Wrapper: Web3Wrapper;
diff --git a/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts b/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts
index 9867e9a23..0ac21cb78 100644
--- a/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts
+++ b/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts
@@ -1,11 +1,13 @@
-import * as _ from 'lodash';
import BigNumber from 'bignumber.js';
+import * as _ from 'lodash';
+
+import {artifacts} from '../artifacts';
+import {EtherTokenContract, ZeroExError} from '../types';
+import {assert} from '../utils/assert';
import {Web3Wrapper} from '../web3_wrapper';
+
import {ContractWrapper} from './contract_wrapper';
import {TokenWrapper} from './token_wrapper';
-import {EtherTokenContract, ZeroExError} from '../types';
-import {assert} from '../utils/assert';
-import {artifacts} from '../artifacts';
/**
* This class includes all the functionality related to interacting with a wrapped Ether ERC20 token contract.
@@ -89,7 +91,7 @@ export class EtherTokenWrapper extends ContractWrapper {
const contractInstance = await this._instantiateContractIfExistsAsync<EtherTokenContract>(
artifacts.EtherTokenArtifact, this._contractAddressIfExists,
);
- this._etherTokenContractIfExists = contractInstance as EtherTokenContract;
+ this._etherTokenContractIfExists = contractInstance;
return this._etherTokenContractIfExists;
}
}
diff --git a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts
index 604c53e3a..97ea54362 100644
--- a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts
+++ b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts
@@ -1,44 +1,46 @@
+import {schemas} from '@0xproject/json-schemas';
+import BigNumber from 'bignumber.js';
import * as _ from 'lodash';
import * as Web3 from 'web3';
-import BigNumber from 'bignumber.js';
-import {schemas} from '@0xproject/json-schemas';
-import {Web3Wrapper} from '../web3_wrapper';
+
+import {artifacts} from '../artifacts';
import {
+ DecodedLogArgs,
ECSignature,
+ EventCallback,
ExchangeContract,
ExchangeContractErrCodes,
ExchangeContractErrs,
- ZeroExError,
- OrderValues,
- OrderAddresses,
- Order,
- SignedOrder,
+ ExchangeContractEventArgs,
ExchangeEvents,
- SubscriptionOpts,
IndexedFilterValues,
- OrderCancellationRequest,
- OrderFillRequest,
+ LogCancelContractEventArgs,
LogErrorContractEventArgs,
LogFillContractEventArgs,
- LogCancelContractEventArgs,
LogWithDecodedArgs,
MethodOpts,
- ValidateOrderFillableOpts,
+ Order,
+ OrderAddresses,
+ OrderCancellationRequest,
+ OrderFillRequest,
OrderTransactionOpts,
+ OrderValues,
RawLog,
- EventCallback,
- ExchangeContractEventArgs,
- DecodedLogArgs,
+ SignedOrder,
+ SubscriptionOpts,
+ ValidateOrderFillableOpts,
+ ZeroExError,
} from '../types';
+import {AbiDecoder} from '../utils/abi_decoder';
import {assert} from '../utils/assert';
-import {utils} from '../utils/utils';
+import {decorators} from '../utils/decorators';
+import {ExchangeTransferSimulator} from '../utils/exchange_transfer_simulator';
import {OrderValidationUtils} from '../utils/order_validation_utils';
+import {utils} from '../utils/utils';
+import {Web3Wrapper} from '../web3_wrapper';
+
import {ContractWrapper} from './contract_wrapper';
import {TokenWrapper} from './token_wrapper';
-import {decorators} from '../utils/decorators';
-import {AbiDecoder} from '../utils/abi_decoder';
-import {ExchangeTransferSimulator} from '../utils/exchange_transfer_simulator';
-import {artifacts} from '../artifacts';
const SHOULD_VALIDATE_BY_DEFAULT = true;
@@ -873,7 +875,7 @@ export class ExchangeWrapper extends ContractWrapper {
const contractInstance = await this._instantiateContractIfExistsAsync<ExchangeContract>(
artifacts.ExchangeArtifact, this._contractAddressIfExists,
);
- this._exchangeContractIfExists = contractInstance as ExchangeContract;
+ this._exchangeContractIfExists = contractInstance;
return this._exchangeContractIfExists;
}
private async _getTokenTransferProxyAddressAsync(): Promise<string> {
diff --git a/packages/0x.js/src/contract_wrappers/token_registry_wrapper.ts b/packages/0x.js/src/contract_wrappers/token_registry_wrapper.ts
index 50871d3f2..60fe7f33a 100644
--- a/packages/0x.js/src/contract_wrappers/token_registry_wrapper.ts
+++ b/packages/0x.js/src/contract_wrappers/token_registry_wrapper.ts
@@ -1,10 +1,12 @@
import * as _ from 'lodash';
-import {Web3Wrapper} from '../web3_wrapper';
+
+import {artifacts} from '../artifacts';
+import {Token, TokenMetadata, TokenRegistryContract, ZeroExError} from '../types';
import {assert} from '../utils/assert';
-import {Token, TokenRegistryContract, TokenMetadata, ZeroExError} from '../types';
import {constants} from '../utils/constants';
+import {Web3Wrapper} from '../web3_wrapper';
+
import {ContractWrapper} from './contract_wrapper';
-import {artifacts} from '../artifacts';
/**
* This class includes all the functionality related to interacting with the 0x Token Registry smart contract.
@@ -123,7 +125,7 @@ export class TokenRegistryWrapper extends ContractWrapper {
const contractInstance = await this._instantiateContractIfExistsAsync<TokenRegistryContract>(
artifacts.TokenRegistryArtifact, this._contractAddressIfExists,
);
- this._tokenRegistryContractIfExists = contractInstance as TokenRegistryContract;
+ this._tokenRegistryContractIfExists = contractInstance;
return this._tokenRegistryContractIfExists;
}
}
diff --git a/packages/0x.js/src/contract_wrappers/token_transfer_proxy_wrapper.ts b/packages/0x.js/src/contract_wrappers/token_transfer_proxy_wrapper.ts
index 6970d5433..33adc0a9b 100644
--- a/packages/0x.js/src/contract_wrappers/token_transfer_proxy_wrapper.ts
+++ b/packages/0x.js/src/contract_wrappers/token_transfer_proxy_wrapper.ts
@@ -1,8 +1,10 @@
import * as _ from 'lodash';
-import {Web3Wrapper} from '../web3_wrapper';
-import {ContractWrapper} from './contract_wrapper';
+
import {artifacts} from '../artifacts';
import {TokenTransferProxyContract, ZeroExError} from '../types';
+import {Web3Wrapper} from '../web3_wrapper';
+
+import {ContractWrapper} from './contract_wrapper';
/**
* This class includes the functionality related to interacting with the TokenTransferProxy contract.
@@ -60,7 +62,7 @@ export class TokenTransferProxyWrapper extends ContractWrapper {
const contractInstance = await this._instantiateContractIfExistsAsync<TokenTransferProxyContract>(
artifacts.TokenTransferProxyArtifact, this._contractAddressIfExists,
);
- this._tokenTransferProxyContractIfExists = contractInstance as TokenTransferProxyContract;
+ this._tokenTransferProxyContractIfExists = contractInstance;
return this._tokenTransferProxyContractIfExists;
}
}
diff --git a/packages/0x.js/src/contract_wrappers/token_wrapper.ts b/packages/0x.js/src/contract_wrappers/token_wrapper.ts
index 5fd3a2a5d..4b359d069 100644
--- a/packages/0x.js/src/contract_wrappers/token_wrapper.ts
+++ b/packages/0x.js/src/contract_wrappers/token_wrapper.ts
@@ -1,23 +1,25 @@
-import * as _ from 'lodash';
-import BigNumber from 'bignumber.js';
import {schemas} from '@0xproject/json-schemas';
-import {Web3Wrapper} from '../web3_wrapper';
-import {assert} from '../utils/assert';
-import {constants} from '../utils/constants';
-import {ContractWrapper} from './contract_wrapper';
-import {AbiDecoder} from '../utils/abi_decoder';
+import BigNumber from 'bignumber.js';
+import * as _ from 'lodash';
+
import {artifacts} from '../artifacts';
import {
- TokenContract,
- ZeroExError,
- TokenEvents,
+ EventCallback,
IndexedFilterValues,
- SubscriptionOpts,
- MethodOpts,
LogWithDecodedArgs,
- EventCallback,
+ MethodOpts,
+ SubscriptionOpts,
+ TokenContract,
TokenContractEventArgs,
+ TokenEvents,
+ ZeroExError,
} from '../types';
+import {AbiDecoder} from '../utils/abi_decoder';
+import {assert} from '../utils/assert';
+import {constants} from '../utils/constants';
+import {Web3Wrapper} from '../web3_wrapper';
+
+import {ContractWrapper} from './contract_wrapper';
const ALLOWANCE_TO_ZERO_GAS_AMOUNT = 47275;
@@ -302,7 +304,7 @@ export class TokenWrapper extends ContractWrapper {
const contractInstance = await this._instantiateContractIfExistsAsync<TokenContract>(
artifacts.TokenArtifact, tokenAddress,
);
- tokenContract = contractInstance as TokenContract;
+ tokenContract = contractInstance;
this._tokenContractsByAddress[tokenAddress] = tokenContract;
return tokenContract;
}
diff --git a/packages/0x.js/src/order_watcher/event_watcher.ts b/packages/0x.js/src/order_watcher/event_watcher.ts
index ecbab0cd5..831f19da5 100644
--- a/packages/0x.js/src/order_watcher/event_watcher.ts
+++ b/packages/0x.js/src/order_watcher/event_watcher.ts
@@ -1,6 +1,6 @@
-import * as Web3 from 'web3';
import * as _ from 'lodash';
-import {Web3Wrapper} from '../web3_wrapper';
+import * as Web3 from 'web3';
+
import {
BlockParamLiteral,
EventCallback,
@@ -8,9 +8,10 @@ import {
ZeroExError,
} from '../types';
import {AbiDecoder} from '../utils/abi_decoder';
-import {intervalUtils} from '../utils/interval_utils';
import {assert} from '../utils/assert';
+import {intervalUtils} from '../utils/interval_utils';
import {utils} from '../utils/utils';
+import {Web3Wrapper} from '../web3_wrapper';
const DEFAULT_EVENT_POLLING_INTERVAL_MS = 200;
diff --git a/packages/0x.js/src/order_watcher/expiration_watcher.ts b/packages/0x.js/src/order_watcher/expiration_watcher.ts
index 2ea7835d9..9a1bb1ca4 100644
--- a/packages/0x.js/src/order_watcher/expiration_watcher.ts
+++ b/packages/0x.js/src/order_watcher/expiration_watcher.ts
@@ -1,10 +1,11 @@
-import * as _ from 'lodash';
import {BigNumber} from 'bignumber.js';
import {RBTree} from 'bintrees';
-import {utils} from '../utils/utils';
-import {intervalUtils} from '../utils/interval_utils';
-import {SignedOrder, ZeroExError} from '../types';
+import * as _ from 'lodash';
+
import {ZeroEx} from '../0x';
+import {SignedOrder, ZeroExError} from '../types';
+import {intervalUtils} from '../utils/interval_utils';
+import {utils} from '../utils/utils';
const DEFAULT_EXPIRATION_MARGIN_MS = 0;
const DEFAULT_ORDER_EXPIRATION_CHECKING_INTERVAL_MS = 50;
diff --git a/packages/0x.js/src/order_watcher/order_state_watcher.ts b/packages/0x.js/src/order_watcher/order_state_watcher.ts
index 287172ff1..4d57935a1 100644
--- a/packages/0x.js/src/order_watcher/order_state_watcher.ts
+++ b/packages/0x.js/src/order_watcher/order_state_watcher.ts
@@ -1,37 +1,39 @@
-import * as _ from 'lodash';
import {schemas} from '@0xproject/json-schemas';
+import * as _ from 'lodash';
+
import {ZeroEx} from '../0x';
-import {EventWatcher} from './event_watcher';
-import {assert} from '../utils/assert';
-import {utils} from '../utils/utils';
import {artifacts} from '../artifacts';
-import {AbiDecoder} from '../utils/abi_decoder';
-import {intervalUtils} from '../utils/interval_utils';
-import {OrderStateUtils} from '../utils/order_state_utils';
+import {ExchangeWrapper} from '../contract_wrappers/exchange_wrapper';
+import {TokenWrapper} from '../contract_wrappers/token_wrapper';
+import {BalanceAndProxyAllowanceLazyStore} from '../stores/balance_proxy_allowance_lazy_store';
+import {OrderFilledCancelledLazyStore} from '../stores/order_filled_cancelled_lazy_store';
import {
- LogEvent,
- OrderState,
- SignedOrder,
- Web3Provider,
+ ApprovalContractEventArgs,
BlockParamLiteral,
- LogWithDecodedArgs,
ContractEventArgs,
+ ExchangeContractErrs,
+ ExchangeEvents,
+ LogCancelContractEventArgs,
+ LogEvent,
+ LogFillContractEventArgs,
+ LogWithDecodedArgs,
OnOrderStateChangeCallback,
+ OrderState,
OrderStateWatcherConfig,
- ApprovalContractEventArgs,
- TransferContractEventArgs,
- LogFillContractEventArgs,
- LogCancelContractEventArgs,
- ExchangeEvents,
+ SignedOrder,
TokenEvents,
+ TransferContractEventArgs,
+ Web3Provider,
ZeroExError,
- ExchangeContractErrs,
} from '../types';
+import {AbiDecoder} from '../utils/abi_decoder';
+import {assert} from '../utils/assert';
+import {intervalUtils} from '../utils/interval_utils';
+import {OrderStateUtils} from '../utils/order_state_utils';
+import {utils} from '../utils/utils';
import {Web3Wrapper} from '../web3_wrapper';
-import {TokenWrapper} from '../contract_wrappers/token_wrapper';
-import {ExchangeWrapper} from '../contract_wrappers/exchange_wrapper';
-import {OrderFilledCancelledLazyStore} from '../stores/order_filled_cancelled_lazy_store';
-import {BalanceAndProxyAllowanceLazyStore} from '../stores/balance_proxy_allowance_lazy_store';
+
+import {EventWatcher} from './event_watcher';
import {ExpirationWatcher} from './expiration_watcher';
interface DependentOrderHashes {
@@ -238,7 +240,7 @@ export class OrderStateWatcher {
}
private async _emitRevalidateOrdersAsync(orderHashes: string[]): Promise<void> {
for (const orderHash of orderHashes) {
- const signedOrder = this._orderByOrderHash[orderHash] as SignedOrder;
+ const signedOrder = this._orderByOrderHash[orderHash];
// Most of these calls will never reach the network because the data is fetched from stores
// and only updated when cache is invalidated
const orderState = await this._orderStateUtils.getOrderStateAsync(signedOrder);
diff --git a/packages/0x.js/src/stores/balance_proxy_allowance_lazy_store.ts b/packages/0x.js/src/stores/balance_proxy_allowance_lazy_store.ts
index c83e61606..293f75db9 100644
--- a/packages/0x.js/src/stores/balance_proxy_allowance_lazy_store.ts
+++ b/packages/0x.js/src/stores/balance_proxy_allowance_lazy_store.ts
@@ -1,6 +1,7 @@
+import {BigNumber} from 'bignumber.js';
import * as _ from 'lodash';
import * as Web3 from 'web3';
-import {BigNumber} from 'bignumber.js';
+
import {TokenWrapper} from '../contract_wrappers/token_wrapper';
import {BlockParamLiteral} from '../types';
diff --git a/packages/0x.js/src/stores/order_filled_cancelled_lazy_store.ts b/packages/0x.js/src/stores/order_filled_cancelled_lazy_store.ts
index 666d8363c..59c1bb7a7 100644
--- a/packages/0x.js/src/stores/order_filled_cancelled_lazy_store.ts
+++ b/packages/0x.js/src/stores/order_filled_cancelled_lazy_store.ts
@@ -1,6 +1,7 @@
+import {BigNumber} from 'bignumber.js';
import * as _ from 'lodash';
import * as Web3 from 'web3';
-import {BigNumber} from 'bignumber.js';
+
import {ExchangeWrapper} from '../contract_wrappers/exchange_wrapper';
import {BlockParamLiteral} from '../types';
diff --git a/packages/0x.js/src/utils/abi_decoder.ts b/packages/0x.js/src/utils/abi_decoder.ts
index df0fb2d6f..f027026da 100644
--- a/packages/0x.js/src/utils/abi_decoder.ts
+++ b/packages/0x.js/src/utils/abi_decoder.ts
@@ -1,9 +1,10 @@
-import * as Web3 from 'web3';
-import * as _ from 'lodash';
import BigNumber from 'bignumber.js';
-import {AbiType, DecodedLogArgs, LogWithDecodedArgs, RawLog, SolidityTypes, ContractEventArgs} from '../types';
+import * as _ from 'lodash';
+import * as Web3 from 'web3';
import * as SolidityCoder from 'web3/lib/solidity/coder';
+import {AbiType, ContractEventArgs, DecodedLogArgs, LogWithDecodedArgs, RawLog, SolidityTypes} from '../types';
+
export class AbiDecoder {
private savedABIs: Web3.AbiDefinition[] = [];
private methodIds: {[signatureHash: string]: Web3.EventAbi} = {};
diff --git a/packages/0x.js/src/utils/assert.ts b/packages/0x.js/src/utils/assert.ts
index 55912525c..3cff9d2cf 100644
--- a/packages/0x.js/src/utils/assert.ts
+++ b/packages/0x.js/src/utils/assert.ts
@@ -1,11 +1,12 @@
+import {assert as sharedAssert} from '@0xproject/assert';
+import {Schema, SchemaValidator} from '@0xproject/json-schemas';
+import BigNumber from 'bignumber.js';
import * as _ from 'lodash';
import * as Web3 from 'web3';
-import BigNumber from 'bignumber.js';
-import {SchemaValidator, Schema} from '@0xproject/json-schemas';
-import {assert as sharedAssert} from '@0xproject/assert';
-import {Web3Wrapper} from '../web3_wrapper';
-import {signatureUtils} from '../utils/signature_utils';
+
import {ECSignature} from '../types';
+import {signatureUtils} from '../utils/signature_utils';
+import {Web3Wrapper} from '../web3_wrapper';
const HEX_REGEX = /^0x[0-9A-F]*$/i;
diff --git a/packages/0x.js/src/utils/decorators.ts b/packages/0x.js/src/utils/decorators.ts
index ec750b891..1760d8872 100644
--- a/packages/0x.js/src/utils/decorators.ts
+++ b/packages/0x.js/src/utils/decorators.ts
@@ -1,7 +1,9 @@
import * as _ from 'lodash';
-import {constants} from './constants';
+
import {AsyncMethod, ZeroExError} from '../types';
+import {constants} from './constants';
+
export const decorators = {
/**
* Source: https://stackoverflow.com/a/29837695/3546986
diff --git a/packages/0x.js/src/utils/exchange_transfer_simulator.ts b/packages/0x.js/src/utils/exchange_transfer_simulator.ts
index cadded224..c3a2d1585 100644
--- a/packages/0x.js/src/utils/exchange_transfer_simulator.ts
+++ b/packages/0x.js/src/utils/exchange_transfer_simulator.ts
@@ -1,8 +1,9 @@
-import * as _ from 'lodash';
import BigNumber from 'bignumber.js';
-import {ExchangeContractErrs, TradeSide, TransferType, BlockParamLiteral} from '../types';
+import * as _ from 'lodash';
+
import {TokenWrapper} from '../contract_wrappers/token_wrapper';
import {BalanceAndProxyAllowanceLazyStore} from '../stores/balance_proxy_allowance_lazy_store';
+import {BlockParamLiteral, ExchangeContractErrs, TradeSide, TransferType} from '../types';
enum FailureReason {
Balance = 'balance',
diff --git a/packages/0x.js/src/utils/filter_utils.ts b/packages/0x.js/src/utils/filter_utils.ts
index e09a95a6e..57c3ee71c 100644
--- a/packages/0x.js/src/utils/filter_utils.ts
+++ b/packages/0x.js/src/utils/filter_utils.ts
@@ -1,8 +1,9 @@
-import * as _ from 'lodash';
-import * as Web3 from 'web3';
-import * as uuid from 'uuid/v4';
import * as ethUtil from 'ethereumjs-util';
import * as jsSHA3 from 'js-sha3';
+import * as _ from 'lodash';
+import * as uuid from 'uuid/v4';
+import * as Web3 from 'web3';
+
import {ContractEvents, IndexedFilterValues, SubscriptionOpts} from '../types';
const TOPIC_LENGTH = 32;
diff --git a/packages/0x.js/src/utils/order_state_utils.ts b/packages/0x.js/src/utils/order_state_utils.ts
index 891849424..6654b9ae1 100644
--- a/packages/0x.js/src/utils/order_state_utils.ts
+++ b/packages/0x.js/src/utils/order_state_utils.ts
@@ -1,23 +1,24 @@
+import BigNumber from 'bignumber.js';
import * as _ from 'lodash';
import * as Web3 from 'web3';
-import BigNumber from 'bignumber.js';
+
+import {ZeroEx} from '../0x';
+import {ExchangeWrapper} from '../contract_wrappers/exchange_wrapper';
+import {TokenWrapper} from '../contract_wrappers/token_wrapper';
+import {RemainingFillableCalculator} from '../order_watcher/remaining_fillable_calculator';
+import {BalanceAndProxyAllowanceLazyStore} from '../stores/balance_proxy_allowance_lazy_store';
+import {OrderFilledCancelledLazyStore} from '../stores/order_filled_cancelled_lazy_store';
import {
ExchangeContractErrs,
- SignedOrder,
- OrderRelevantState,
MethodOpts,
+ OrderRelevantState,
OrderState,
- OrderStateValid,
OrderStateInvalid,
+ OrderStateValid,
+ SignedOrder,
} from '../types';
-import {ZeroEx} from '../0x';
-import {TokenWrapper} from '../contract_wrappers/token_wrapper';
-import {ExchangeWrapper} from '../contract_wrappers/exchange_wrapper';
-import {utils} from '../utils/utils';
import {constants} from '../utils/constants';
-import {OrderFilledCancelledLazyStore} from '../stores/order_filled_cancelled_lazy_store';
-import {BalanceAndProxyAllowanceLazyStore} from '../stores/balance_proxy_allowance_lazy_store';
-import {RemainingFillableCalculator} from '../order_watcher/remaining_fillable_calculator';
+import {utils} from '../utils/utils';
const ACCEPTABLE_RELATIVE_ROUNDING_ERROR = 0.0001;
diff --git a/packages/0x.js/src/utils/order_validation_utils.ts b/packages/0x.js/src/utils/order_validation_utils.ts
index 4822f66e2..06cfca7bd 100644
--- a/packages/0x.js/src/utils/order_validation_utils.ts
+++ b/packages/0x.js/src/utils/order_validation_utils.ts
@@ -1,11 +1,13 @@
-import * as _ from 'lodash';
import BigNumber from 'bignumber.js';
-import {ExchangeContractErrs, SignedOrder, Order, ZeroExError, TradeSide, TransferType} from '../types';
+import * as _ from 'lodash';
+
import {ZeroEx} from '../0x';
-import {TokenWrapper} from '../contract_wrappers/token_wrapper';
import {ExchangeWrapper} from '../contract_wrappers/exchange_wrapper';
-import {utils} from '../utils/utils';
+import {TokenWrapper} from '../contract_wrappers/token_wrapper';
+import {ExchangeContractErrs, Order, SignedOrder, TradeSide, TransferType, ZeroExError} from '../types';
import {constants} from '../utils/constants';
+import {utils} from '../utils/utils';
+
import {ExchangeTransferSimulator} from './exchange_transfer_simulator';
export class OrderValidationUtils {
diff --git a/packages/0x.js/src/utils/signature_utils.ts b/packages/0x.js/src/utils/signature_utils.ts
index d066f8bf0..aaf04e7b0 100644
--- a/packages/0x.js/src/utils/signature_utils.ts
+++ b/packages/0x.js/src/utils/signature_utils.ts
@@ -1,4 +1,5 @@
import * as ethUtil from 'ethereumjs-util';
+
import {ECSignature} from '../types';
export const signatureUtils = {
diff --git a/packages/0x.js/src/utils/utils.ts b/packages/0x.js/src/utils/utils.ts
index 5370c3b4b..04ae34aac 100644
--- a/packages/0x.js/src/utils/utils.ts
+++ b/packages/0x.js/src/utils/utils.ts
@@ -1,9 +1,10 @@
-import * as _ from 'lodash';
+import BigNumber from 'bignumber.js';
+import BN = require('bn.js');
import * as ethABI from 'ethereumjs-abi';
import * as ethUtil from 'ethereumjs-util';
+import * as _ from 'lodash';
+
import {Order, SignedOrder, SolidityTypes} from '../types';
-import BigNumber from 'bignumber.js';
-import BN = require('bn.js');
export const utils = {
/**