Fix the imports order
This commit is contained in:
		| @@ -16,7 +16,7 @@ | |||||||
|     "build": "run-p build:umd:prod build:commonjs; exit 0;", |     "build": "run-p build:umd:prod build:commonjs; exit 0;", | ||||||
|     "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_DIR", |     "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_DIR", | ||||||
|     "upload_docs_json": "aws s3 cp docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type aplication/json", |     "upload_docs_json": "aws s3 cp docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type aplication/json", | ||||||
|     "lint": "tslint --project . src/**/*.ts test/**/*.ts", |     "lint": "tslint --project . 'src/**/*.ts' 'test/**/*.ts'", | ||||||
|     "test:circleci": "run-s test:coverage report_test_coverage && if [ $CIRCLE_BRANCH = \"development\" ]; then yarn test:umd; fi", |     "test:circleci": "run-s test:coverage report_test_coverage && if [ $CIRCLE_BRANCH = \"development\" ]; then yarn test:umd; fi", | ||||||
|     "test": "run-s clean test:commonjs", |     "test": "run-s clean test:commonjs", | ||||||
|     "test:umd": "./scripts/test_umd.sh", |     "test:umd": "./scripts/test_umd.sh", | ||||||
|   | |||||||
| @@ -1,34 +1,35 @@ | |||||||
| import * as _ from 'lodash'; | import {schemas, SchemaValidator} from '@0xproject/json-schemas'; | ||||||
| import BigNumber from 'bignumber.js'; | import BigNumber from 'bignumber.js'; | ||||||
| import {SchemaValidator, schemas} from '@0xproject/json-schemas'; |  | ||||||
| import {bigNumberConfigs} from './bignumber_config'; |  | ||||||
| import * as ethUtil from 'ethereumjs-util'; | import * as ethUtil from 'ethereumjs-util'; | ||||||
| import {Web3Wrapper} from './web3_wrapper'; | import * as _ from 'lodash'; | ||||||
| import {constants} from './utils/constants'; |  | ||||||
| import {utils} from './utils/utils'; |  | ||||||
| import {signatureUtils} from './utils/signature_utils'; |  | ||||||
| import {assert} from './utils/assert'; |  | ||||||
| import {AbiDecoder} from './utils/abi_decoder'; |  | ||||||
| import {intervalUtils} from './utils/interval_utils'; |  | ||||||
| import {artifacts} from './artifacts'; | import {artifacts} from './artifacts'; | ||||||
|  | import {bigNumberConfigs} from './bignumber_config'; | ||||||
|  | import {EtherTokenWrapper} from './contract_wrappers/ether_token_wrapper'; | ||||||
| import {ExchangeWrapper} from './contract_wrappers/exchange_wrapper'; | import {ExchangeWrapper} from './contract_wrappers/exchange_wrapper'; | ||||||
| import {TokenRegistryWrapper} from './contract_wrappers/token_registry_wrapper'; | import {TokenRegistryWrapper} from './contract_wrappers/token_registry_wrapper'; | ||||||
| import {EtherTokenWrapper} from './contract_wrappers/ether_token_wrapper'; |  | ||||||
| import {TokenWrapper} from './contract_wrappers/token_wrapper'; |  | ||||||
| import {TokenTransferProxyWrapper} from './contract_wrappers/token_transfer_proxy_wrapper'; | import {TokenTransferProxyWrapper} from './contract_wrappers/token_transfer_proxy_wrapper'; | ||||||
|  | import {TokenWrapper} from './contract_wrappers/token_wrapper'; | ||||||
| import {OrderStateWatcher} from './order_watcher/order_state_watcher'; | import {OrderStateWatcher} from './order_watcher/order_state_watcher'; | ||||||
| import {OrderStateUtils} from './utils/order_state_utils'; | import {zeroExConfigSchema} from './schemas/zero_ex_config_schema'; | ||||||
| import { | import { | ||||||
|     ECSignature, |     ECSignature, | ||||||
|     ZeroExError, |  | ||||||
|     Order, |     Order, | ||||||
|  |     OrderStateWatcherConfig, | ||||||
|     SignedOrder, |     SignedOrder, | ||||||
|  |     TransactionReceiptWithDecodedLogs, | ||||||
|     Web3Provider, |     Web3Provider, | ||||||
|     ZeroExConfig, |     ZeroExConfig, | ||||||
|     OrderStateWatcherConfig, |     ZeroExError, | ||||||
|     TransactionReceiptWithDecodedLogs, |  | ||||||
| } from './types'; | } from './types'; | ||||||
| import {zeroExConfigSchema} from './schemas/zero_ex_config_schema'; | import {AbiDecoder} from './utils/abi_decoder'; | ||||||
|  | import {assert} from './utils/assert'; | ||||||
|  | import {constants} from './utils/constants'; | ||||||
|  | import {intervalUtils} from './utils/interval_utils'; | ||||||
|  | import {OrderStateUtils} from './utils/order_state_utils'; | ||||||
|  | import {signatureUtils} from './utils/signature_utils'; | ||||||
|  | import {utils} from './utils/utils'; | ||||||
|  | import {Web3Wrapper} from './web3_wrapper'; | ||||||
|  |  | ||||||
| // Customize our BigNumber instances | // Customize our BigNumber instances | ||||||
| bigNumberConfigs.configure(); | bigNumberConfigs.configure(); | ||||||
| @@ -179,10 +180,14 @@ export class ZeroEx { | |||||||
|             gasPrice: config.gasPrice, |             gasPrice: config.gasPrice, | ||||||
|         }; |         }; | ||||||
|         this._web3Wrapper = new Web3Wrapper(provider, config.networkId, defaults); |         this._web3Wrapper = new Web3Wrapper(provider, config.networkId, defaults); | ||||||
|  |         this.proxy = new TokenTransferProxyWrapper( | ||||||
|  |             this._web3Wrapper, | ||||||
|  |             config.tokenTransferProxyContractAddress, | ||||||
|  |         ); | ||||||
|         this.token = new TokenWrapper( |         this.token = new TokenWrapper( | ||||||
|             this._web3Wrapper, |             this._web3Wrapper, | ||||||
|             this._abiDecoder, |             this._abiDecoder, | ||||||
|             this._getTokenTransferProxyAddressAsync.bind(this), |             this.proxy, | ||||||
|         ); |         ); | ||||||
|         this.exchange = new ExchangeWrapper( |         this.exchange = new ExchangeWrapper( | ||||||
|             this._web3Wrapper, |             this._web3Wrapper, | ||||||
| @@ -190,10 +195,6 @@ export class ZeroEx { | |||||||
|             this.token, |             this.token, | ||||||
|             config.exchangeContractAddress, |             config.exchangeContractAddress, | ||||||
|         ); |         ); | ||||||
|         this.proxy = new TokenTransferProxyWrapper( |  | ||||||
|             this._web3Wrapper, |  | ||||||
|             this._getTokenTransferProxyAddressAsync.bind(this), |  | ||||||
|         ); |  | ||||||
|         this.tokenRegistry = new TokenRegistryWrapper(this._web3Wrapper, config.tokenRegistryContractAddress); |         this.tokenRegistry = new TokenRegistryWrapper(this._web3Wrapper, config.tokenRegistryContractAddress); | ||||||
|         this.etherToken = new EtherTokenWrapper(this._web3Wrapper, this.token, config.etherTokenContractAddress); |         this.etherToken = new EtherTokenWrapper(this._web3Wrapper, this.token, config.etherTokenContractAddress); | ||||||
|         this.orderStateWatcher = new OrderStateWatcher( |         this.orderStateWatcher = new OrderStateWatcher( | ||||||
|   | |||||||
| @@ -1,10 +1,10 @@ | |||||||
| import {Artifact} from './types'; |  | ||||||
| import * as ZRXArtifact from './artifacts/ZRX.json'; |  | ||||||
| import * as TokenArtifact from './artifacts/Token.json'; |  | ||||||
| import * as ExchangeArtifact from './artifacts/Exchange.json'; |  | ||||||
| import * as EtherTokenArtifact from './artifacts/EtherToken.json'; | import * as EtherTokenArtifact from './artifacts/EtherToken.json'; | ||||||
|  | import * as ExchangeArtifact from './artifacts/Exchange.json'; | ||||||
|  | import * as TokenArtifact from './artifacts/Token.json'; | ||||||
| import * as TokenRegistryArtifact from './artifacts/TokenRegistry.json'; | import * as TokenRegistryArtifact from './artifacts/TokenRegistry.json'; | ||||||
| import * as TokenTransferProxyArtifact from './artifacts/TokenTransferProxy.json'; | import * as TokenTransferProxyArtifact from './artifacts/TokenTransferProxy.json'; | ||||||
|  | import * as ZRXArtifact from './artifacts/ZRX.json'; | ||||||
|  | import {Artifact} from './types'; | ||||||
|  |  | ||||||
| export const artifacts = { | export const artifacts = { | ||||||
|     ZRXArtifact: ZRXArtifact as any as Artifact, |     ZRXArtifact: ZRXArtifact as any as Artifact, | ||||||
|   | |||||||
| @@ -233,213 +233,18 @@ | |||||||
|       "type": "event" |       "type": "event" | ||||||
|     } |     } | ||||||
|   ], |   ], | ||||||
|   "unlinked_binary": "0x6060604052341561000c57fe5b5b6107598061001c6000396000f300606060405236156100935763ffffffff60e060020a60003504166306fdde0381146100a4578063095ea7b31461013457806318160ddd1461016757806323b872dd146101895780632e1a7d4d146101c2578063313ce567146101d757806370a08231146101fd57806395d89b411461022b578063a9059cbb146102bb578063d0e30db0146102ee578063dd62ed3e146102f8575b6100a25b61009f61032c565b5b565b005b34156100ac57fe5b6100b461037b565b6040805160208082528351818301528351919283929083019185019080838382156100fa575b8051825260208311156100fa57601f1990920191602091820191016100da565b505050905090810190601f1680156101265780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561013c57fe5b610153600160a060020a03600435166024356103a3565b604080519115158252519081900360200190f35b341561016f57fe5b61017761040e565b60408051918252519081900360200190f35b341561019157fe5b610153600160a060020a0360043581169060243516604435610414565b604080519115158252519081900360200190f35b34156101ca57fe5b6100a2600435610537565b005b34156101df57fe5b6101e76105b8565b6040805160ff9092168252519081900360200190f35b341561020557fe5b610177600160a060020a03600435166105bd565b60408051918252519081900360200190f35b341561023357fe5b6100b46105dc565b6040805160208082528351818301528351919283929083019185019080838382156100fa575b8051825260208311156100fa57601f1990920191602091820191016100da565b505050905090810190601f1680156101265780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156102c357fe5b610153600160a060020a03600435166024356105fd565b604080519115158252519081900360200190f35b6100a261032c565b005b341561030057fe5b610177600160a060020a03600435811690602435166106af565b60408051918252519081900360200190f35b600160a060020a03331660009081526020819052604090205461034f90346106dc565b600160a060020a03331660009081526020819052604090205560025461037590346106dc565b6002555b565b60408051808201909152600b815260a960020a6a22ba3432b9102a37b5b2b702602082015281565b600160a060020a03338116600081815260016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60025481565b600160a060020a03808416600081815260016020908152604080832033909516835293815283822054928252819052918220548390108015906104575750828110155b801561047d5750600160a060020a03841660009081526020819052604090205483810110155b1561052957600160a060020a03808516600090815260208190526040808220805487019055918716815220805484900390556000198110156104e757600160a060020a03808616600090815260016020908152604080832033909416835292905220805484900390555b83600160a060020a031685600160a060020a031660008051602061070e833981519152856040518082815260200191505060405180910390a36001915061052e565b600091505b5b509392505050565b600160a060020a03331660009081526020819052604090205461055a90826106f6565b600160a060020a03331660009081526020819052604090205560025461058090826106f6565b600255604051600160a060020a0333169082156108fc029083906000818181858888f1935050505015156105b45760006000fd5b5b50565b601281565b600160a060020a0381166000908152602081905260409020545b919050565b604080518082019091526004815260e360020a630ae8aa8902602082015281565b600160a060020a0333166000908152602081905260408120548290108015906106405750600160a060020a03831660009081526020819052604090205482810110155b156106a057600160a060020a03338116600081815260208181526040808320805488900390559387168083529184902080548701905583518681529351919360008051602061070e833981519152929081900390910190a3506001610408565b506000610408565b5b92915050565b600160a060020a038083166000908152600160209081526040808320938516835292905220545b92915050565b6000828201838110156106eb57fe5b8091505b5092915050565b60008282111561070257fe5b508082035b929150505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820ec42c469bb8ddd5de28c55b9cc393c812397c063a57fb88926e3f6de246318b70029", |  | ||||||
|   "networks": { |   "networks": { | ||||||
|     "1": { |     "1": { | ||||||
|       "links": {}, |  | ||||||
|       "events": { |  | ||||||
|         "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": { |  | ||||||
|           "anonymous": false, |  | ||||||
|           "inputs": [ |  | ||||||
|             { |  | ||||||
|               "indexed": true, |  | ||||||
|               "name": "_from", |  | ||||||
|               "type": "address" |  | ||||||
|             }, |  | ||||||
|             { |  | ||||||
|               "indexed": true, |  | ||||||
|               "name": "_to", |  | ||||||
|               "type": "address" |  | ||||||
|             }, |  | ||||||
|             { |  | ||||||
|               "indexed": false, |  | ||||||
|               "name": "_value", |  | ||||||
|               "type": "uint256" |  | ||||||
|             } |  | ||||||
|           ], |  | ||||||
|           "name": "Transfer", |  | ||||||
|           "type": "event" |  | ||||||
|         }, |  | ||||||
|         "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": { |  | ||||||
|           "anonymous": false, |  | ||||||
|           "inputs": [ |  | ||||||
|             { |  | ||||||
|               "indexed": true, |  | ||||||
|               "name": "_owner", |  | ||||||
|               "type": "address" |  | ||||||
|             }, |  | ||||||
|             { |  | ||||||
|               "indexed": true, |  | ||||||
|               "name": "_spender", |  | ||||||
|               "type": "address" |  | ||||||
|             }, |  | ||||||
|             { |  | ||||||
|               "indexed": false, |  | ||||||
|               "name": "_value", |  | ||||||
|               "type": "uint256" |  | ||||||
|             } |  | ||||||
|           ], |  | ||||||
|           "name": "Approval", |  | ||||||
|           "type": "event" |  | ||||||
|         } |  | ||||||
|       }, |  | ||||||
|       "updated_at": 1502488087000, |  | ||||||
|       "address": "0x2956356cd2a2bf3202f771f50d3d14a367b48070" |       "address": "0x2956356cd2a2bf3202f771f50d3d14a367b48070" | ||||||
|     }, |     }, | ||||||
|     "3": { |     "3": { | ||||||
|       "links": {}, |  | ||||||
|       "events": { |  | ||||||
|         "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": { |  | ||||||
|           "anonymous": false, |  | ||||||
|           "inputs": [ |  | ||||||
|             { |  | ||||||
|               "indexed": true, |  | ||||||
|               "name": "_from", |  | ||||||
|               "type": "address" |  | ||||||
|             }, |  | ||||||
|             { |  | ||||||
|               "indexed": true, |  | ||||||
|               "name": "_to", |  | ||||||
|               "type": "address" |  | ||||||
|             }, |  | ||||||
|             { |  | ||||||
|               "indexed": false, |  | ||||||
|               "name": "_value", |  | ||||||
|               "type": "uint256" |  | ||||||
|             } |  | ||||||
|           ], |  | ||||||
|           "name": "Transfer", |  | ||||||
|           "type": "event" |  | ||||||
|         }, |  | ||||||
|         "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": { |  | ||||||
|           "anonymous": false, |  | ||||||
|           "inputs": [ |  | ||||||
|             { |  | ||||||
|               "indexed": true, |  | ||||||
|               "name": "_owner", |  | ||||||
|               "type": "address" |  | ||||||
|             }, |  | ||||||
|             { |  | ||||||
|               "indexed": true, |  | ||||||
|               "name": "_spender", |  | ||||||
|               "type": "address" |  | ||||||
|             }, |  | ||||||
|             { |  | ||||||
|               "indexed": false, |  | ||||||
|               "name": "_value", |  | ||||||
|               "type": "uint256" |  | ||||||
|             } |  | ||||||
|           ], |  | ||||||
|           "name": "Approval", |  | ||||||
|           "type": "event" |  | ||||||
|         } |  | ||||||
|       }, |  | ||||||
|       "updated_at": 1506602007000, |  | ||||||
|       "address": "0xc00fd9820cd2898cc4c054b7bf142de637ad129a" |       "address": "0xc00fd9820cd2898cc4c054b7bf142de637ad129a" | ||||||
|     }, |     }, | ||||||
|     "42": { |     "42": { | ||||||
|       "links": {}, |  | ||||||
|       "events": { |  | ||||||
|         "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": { |  | ||||||
|           "anonymous": false, |  | ||||||
|           "inputs": [ |  | ||||||
|             { |  | ||||||
|               "indexed": true, |  | ||||||
|               "name": "_from", |  | ||||||
|               "type": "address" |  | ||||||
|             }, |  | ||||||
|             { |  | ||||||
|               "indexed": true, |  | ||||||
|               "name": "_to", |  | ||||||
|               "type": "address" |  | ||||||
|             }, |  | ||||||
|             { |  | ||||||
|               "indexed": false, |  | ||||||
|               "name": "_value", |  | ||||||
|               "type": "uint256" |  | ||||||
|             } |  | ||||||
|           ], |  | ||||||
|           "name": "Transfer", |  | ||||||
|           "type": "event" |  | ||||||
|         }, |  | ||||||
|         "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": { |  | ||||||
|           "anonymous": false, |  | ||||||
|           "inputs": [ |  | ||||||
|             { |  | ||||||
|               "indexed": true, |  | ||||||
|               "name": "_owner", |  | ||||||
|               "type": "address" |  | ||||||
|             }, |  | ||||||
|             { |  | ||||||
|               "indexed": true, |  | ||||||
|               "name": "_spender", |  | ||||||
|               "type": "address" |  | ||||||
|             }, |  | ||||||
|             { |  | ||||||
|               "indexed": false, |  | ||||||
|               "name": "_value", |  | ||||||
|               "type": "uint256" |  | ||||||
|             } |  | ||||||
|           ], |  | ||||||
|           "name": "Approval", |  | ||||||
|           "type": "event" |  | ||||||
|         } |  | ||||||
|       }, |  | ||||||
|       "updated_at": 1502391794392, |  | ||||||
|       "address": "0x05d090b51c40b020eab3bfcb6a2dff130df22e9c" |       "address": "0x05d090b51c40b020eab3bfcb6a2dff130df22e9c" | ||||||
|     }, |     }, | ||||||
|     "50": { |     "50": { | ||||||
|       "links": {}, |  | ||||||
|       "events": { |  | ||||||
|         "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef": { |  | ||||||
|           "anonymous": false, |  | ||||||
|           "inputs": [ |  | ||||||
|             { |  | ||||||
|               "indexed": true, |  | ||||||
|               "name": "_from", |  | ||||||
|               "type": "address" |  | ||||||
|             }, |  | ||||||
|             { |  | ||||||
|               "indexed": true, |  | ||||||
|               "name": "_to", |  | ||||||
|               "type": "address" |  | ||||||
|             }, |  | ||||||
|             { |  | ||||||
|               "indexed": false, |  | ||||||
|               "name": "_value", |  | ||||||
|               "type": "uint256" |  | ||||||
|             } |  | ||||||
|           ], |  | ||||||
|           "name": "Transfer", |  | ||||||
|           "type": "event" |  | ||||||
|         }, |  | ||||||
|         "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925": { |  | ||||||
|           "anonymous": false, |  | ||||||
|           "inputs": [ |  | ||||||
|             { |  | ||||||
|               "indexed": true, |  | ||||||
|               "name": "_owner", |  | ||||||
|               "type": "address" |  | ||||||
|             }, |  | ||||||
|             { |  | ||||||
|               "indexed": true, |  | ||||||
|               "name": "_spender", |  | ||||||
|               "type": "address" |  | ||||||
|             }, |  | ||||||
|             { |  | ||||||
|               "indexed": false, |  | ||||||
|               "name": "_value", |  | ||||||
|               "type": "uint256" |  | ||||||
|             } |  | ||||||
|           ], |  | ||||||
|           "name": "Approval", |  | ||||||
|           "type": "event" |  | ||||||
|         } |  | ||||||
|       }, |  | ||||||
|       "updated_at": 1503318938233, |  | ||||||
|       "address": "0x48bacb9266a570d521063ef5dd96e61686dbe788" |       "address": "0x48bacb9266a570d521063ef5dd96e61686dbe788" | ||||||
|     } |     } | ||||||
|   }, |   } | ||||||
|   "schema_version": "0.0.5", |  | ||||||
|   "updated_at": 1503318938233 |  | ||||||
| } | } | ||||||
|   | |||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -168,9 +168,5 @@ | |||||||
|       "name": "Approval", |       "name": "Approval", | ||||||
|       "type": "event" |       "type": "event" | ||||||
|     } |     } | ||||||
|   ], |   ] | ||||||
|   "unlinked_binary": "0x6060604052341561000c57fe5b5b6101e08061001c6000396000f3006060604052361561005c5763ffffffff60e060020a600035041663095ea7b3811461005e57806318160ddd1461009157806323b872dd146100b357806370a08231146100ec578063a9059cbb1461005e578063dd62ed3e1461014d575bfe5b341561006657fe5b61007d600160a060020a0360043516602435610181565b604080519115158252519081900360200190f35b341561009957fe5b6100a161018a565b60408051918252519081900360200190f35b34156100bb57fe5b61007d600160a060020a0360043581169060243516604435610190565b604080519115158252519081900360200190f35b34156100f457fe5b6100a1600160a060020a036004351661019a565b60408051918252519081900360200190f35b341561006657fe5b61007d600160a060020a0360043516602435610181565b604080519115158252519081900360200190f35b341561015557fe5b6100a1600160a060020a0360043581169060243516610181565b60408051918252519081900360200190f35b60005b92915050565b60005b90565b60005b9392505050565b60005b919050565b60005b92915050565b60005b929150505600a165627a7a723058202e3f7ac17048343c0d0ea24fccb64620577374eeeed61539e543df4025d7d0db0029", | } | ||||||
|   "networks": {}, |  | ||||||
|   "schema_version": "0.0.5", |  | ||||||
|   "updated_at": 1503317882695 |  | ||||||
| } |  | ||||||
|   | |||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -167,8 +167,18 @@ | |||||||
|       "type": "event" |       "type": "event" | ||||||
|     } |     } | ||||||
|   ], |   ], | ||||||
|   "unlinked_binary": "0x60606040525b60008054600160a060020a03191633600160a060020a03161790555b5b6106e6806100316000396000f300606060405236156100725763ffffffff60e060020a60003504166315dacbea811461007457806342f1181e146100b3578063494503d4146100d157806370712939146101005780638da5cb5b1461011e578063b91816111461014a578063d39de6e91461017a578063f2fde38b146101e5575bfe5b341561007c57fe5b61009f600160a060020a0360043581169060243581169060443516606435610203565b604080519115158252519081900360200190f35b34156100bb57fe5b6100cf600160a060020a03600435166102ae565b005b34156100d957fe5b6100e4600435610390565b60408051600160a060020a039092168252519081900360200190f35b341561010857fe5b6100cf600160a060020a03600435166103c2565b005b341561012657fe5b6100e461055a565b60408051600160a060020a039092168252519081900360200190f35b341561015257fe5b61009f600160a060020a0360043516610569565b604080519115158252519081900360200190f35b341561018257fe5b61018a61057e565b60408051602080825283518183015283519192839290830191858101910280838382156101d2575b8051825260208311156101d257601f1990920191602091820191016101b2565b5050509050019250505060405180910390f35b34156101ed57fe5b6100cf600160a060020a03600435166105e7565b005b600160a060020a03331660009081526001602052604081205460ff16151561022b5760006000fd5b6040805160006020918201819052825160e060020a6323b872dd028152600160a060020a0388811660048301528781166024830152604482018790529351938916936323b872dd9360648084019491938390030190829087803b151561028d57fe5b6102c65a03f1151561029b57fe5b5050604051519150505b5b949350505050565b60005433600160a060020a039081169116146102ca5760006000fd5b600160a060020a038116600090815260016020526040902054819060ff16156102f35760006000fd5b600160a060020a0382166000908152600160208190526040909120805460ff191682179055600280549091810161032a8382610633565b916000526020600020900160005b81546101009190910a600160a060020a0381810219909216868316918202179092556040513390911692507f94bb87f4c15c4587ff559a7584006fa01ddf9299359be6b512b94527aa961aca90600090a35b5b505b50565b600280548290811061039e57fe5b906000526020600020900160005b915054906101000a9004600160a060020a031681565b6000805433600160a060020a039081169116146103df5760006000fd5b600160a060020a038216600090815260016020526040902054829060ff1615156104095760006000fd5b600160a060020a0383166000908152600160205260408120805460ff1916905591505b6002548210156105195782600160a060020a031660028381548110151561044f57fe5b906000526020600020900160005b9054906101000a9004600160a060020a0316600160a060020a0316141561050d5760028054600019810190811061049057fe5b906000526020600020900160005b9054906101000a9004600160a060020a03166002838154811015156104bf57fe5b906000526020600020900160005b6101000a815481600160a060020a030219169083600160a060020a0316021790555060016002818180549050039150816105079190610633565b50610519565b5b60019091019061042c565b604051600160a060020a0333811691908516907ff5b347a1e40749dd050f5f07fbdbeb7e3efa9756903044dd29401fd1d4bb4a1c90600090a35b5b505b5050565b600054600160a060020a031681565b60016020526000908152604090205460ff1681565b610586610687565b60028054806020026020016040519081016040528092919081815260200182805480156105dc57602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116105be575b505050505090505b90565b60005433600160a060020a039081169116146106035760006000fd5b600160a060020a0381161561038d5760008054600160a060020a031916600160a060020a0383161790555b5b5b50565b81548183558181151161055357600083815260209020610553918101908301610699565b5b505050565b81548183558181151161055357600083815260209020610553918101908301610699565b5b505050565b60408051602081019091526000815290565b6105e491905b808211156106b3576000815560010161069f565b5090565b905600a165627a7a72305820d2924957bb88a128789172e164d874fe5445218fc2dde2f5eb265839a1f341a20029", |   "networks": { | ||||||
|   "networks": {}, |       "1": { | ||||||
|   "schema_version": "0.0.5", |         "address": "0x8da0d80f5007ef1e431dd2127178d224e32c2ef4" | ||||||
|   "updated_at": 1503318938227 |       }, | ||||||
|  |       "3": { | ||||||
|  |         "address": "0x4e9aad8184de8833365fea970cd9149372fdf1e6" | ||||||
|  |       }, | ||||||
|  |       "42": { | ||||||
|  |         "address": "0x087eed4bc1ee3de49Befbd66c662b434b15d49d4" | ||||||
|  |       }, | ||||||
|  |       "50": { | ||||||
|  |         "address": "0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c" | ||||||
|  |       } | ||||||
|  |   } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -1,7 +1,8 @@ | |||||||
| import * as Web3 from 'web3'; | import {schemas, SchemaValidator} from '@0xproject/json-schemas'; | ||||||
| import * as _ from 'lodash'; |  | ||||||
| import promisify = require('es6-promisify'); | import promisify = require('es6-promisify'); | ||||||
| import {SchemaValidator, schemas} from '@0xproject/json-schemas'; | import * as _ from 'lodash'; | ||||||
|  | import * as Web3 from 'web3'; | ||||||
|  |  | ||||||
| import {AbiType} from './types'; | import {AbiType} from './types'; | ||||||
|  |  | ||||||
| export class Contract implements Web3.ContractInstance { | export class Contract implements Web3.ContractInstance { | ||||||
| @@ -47,7 +48,7 @@ export class Contract implements Web3.ContractInstance { | |||||||
|         }); |         }); | ||||||
|     } |     } | ||||||
|     private promisifyWithDefaultParams(fn: (...args: any[]) => void): (...args: any[]) => Promise<any> { |     private promisifyWithDefaultParams(fn: (...args: any[]) => void): (...args: any[]) => Promise<any> { | ||||||
|         const promisifiedWithDefaultParams = (...args: any[]) => { |         const promisifiedWithDefaultParams = async (...args: any[]) => { | ||||||
|             const promise = new Promise((resolve, reject) => { |             const promise = new Promise((resolve, reject) => { | ||||||
|                 const lastArg = args[args.length - 1]; |                 const lastArg = args[args.length - 1]; | ||||||
|                 let txData: Partial<Web3.TxData> = {}; |                 let txData: Partial<Web3.TxData> = {}; | ||||||
|   | |||||||
| @@ -20,6 +20,7 @@ import {constants} from '../utils/constants'; | |||||||
| import {Web3Wrapper} from '../web3_wrapper'; | import {Web3Wrapper} from '../web3_wrapper'; | ||||||
|  |  | ||||||
| import {ContractWrapper} from './contract_wrapper'; | import {ContractWrapper} from './contract_wrapper'; | ||||||
|  | import {TokenTransferProxyWrapper} from './token_transfer_proxy_wrapper'; | ||||||
|  |  | ||||||
| const ALLOWANCE_TO_ZERO_GAS_AMOUNT = 47275; | const ALLOWANCE_TO_ZERO_GAS_AMOUNT = 47275; | ||||||
|  |  | ||||||
| @@ -31,12 +32,12 @@ const ALLOWANCE_TO_ZERO_GAS_AMOUNT = 47275; | |||||||
| export class TokenWrapper extends ContractWrapper { | export class TokenWrapper extends ContractWrapper { | ||||||
|     public UNLIMITED_ALLOWANCE_IN_BASE_UNITS = constants.UNLIMITED_ALLOWANCE_IN_BASE_UNITS; |     public UNLIMITED_ALLOWANCE_IN_BASE_UNITS = constants.UNLIMITED_ALLOWANCE_IN_BASE_UNITS; | ||||||
|     private _tokenContractsByAddress: {[address: string]: TokenContract}; |     private _tokenContractsByAddress: {[address: string]: TokenContract}; | ||||||
|     private _tokenTransferProxyContractAddressFetcher: () => Promise<string>; |     private _tokenTransferProxyWrapper: TokenTransferProxyWrapper; | ||||||
|     constructor(web3Wrapper: Web3Wrapper, abiDecoder: AbiDecoder, |     constructor(web3Wrapper: Web3Wrapper, abiDecoder: AbiDecoder, | ||||||
|                 tokenTransferProxyContractAddressFetcher: () => Promise<string>) { |                 tokenTransferProxyWrapper: TokenTransferProxyWrapper) { | ||||||
|         super(web3Wrapper, abiDecoder); |         super(web3Wrapper, abiDecoder); | ||||||
|         this._tokenContractsByAddress = {}; |         this._tokenContractsByAddress = {}; | ||||||
|         this._tokenTransferProxyContractAddressFetcher = tokenTransferProxyContractAddressFetcher; |         this._tokenTransferProxyWrapper = tokenTransferProxyWrapper; | ||||||
|     } |     } | ||||||
|     /** |     /** | ||||||
|      * Retrieves an owner's ERC20 token balance. |      * Retrieves an owner's ERC20 token balance. | ||||||
| @@ -135,7 +136,7 @@ export class TokenWrapper extends ContractWrapper { | |||||||
|         assert.isETHAddressHex('ownerAddress', ownerAddress); |         assert.isETHAddressHex('ownerAddress', ownerAddress); | ||||||
|         assert.isETHAddressHex('tokenAddress', tokenAddress); |         assert.isETHAddressHex('tokenAddress', tokenAddress); | ||||||
|  |  | ||||||
|         const proxyAddress = await this._getTokenTransferProxyAddressAsync(); |         const proxyAddress = this._tokenTransferProxyWrapper.getContractAddress(); | ||||||
|         const allowanceInBaseUnits = await this.getAllowanceAsync(tokenAddress, ownerAddress, proxyAddress, methodOpts); |         const allowanceInBaseUnits = await this.getAllowanceAsync(tokenAddress, ownerAddress, proxyAddress, methodOpts); | ||||||
|         return allowanceInBaseUnits; |         return allowanceInBaseUnits; | ||||||
|     } |     } | ||||||
| @@ -154,7 +155,7 @@ export class TokenWrapper extends ContractWrapper { | |||||||
|         assert.isETHAddressHex('tokenAddress', tokenAddress); |         assert.isETHAddressHex('tokenAddress', tokenAddress); | ||||||
|         assert.isValidBaseUnitAmount('amountInBaseUnits', amountInBaseUnits); |         assert.isValidBaseUnitAmount('amountInBaseUnits', amountInBaseUnits); | ||||||
|  |  | ||||||
|         const proxyAddress = await this._getTokenTransferProxyAddressAsync(); |         const proxyAddress = this._tokenTransferProxyWrapper.getContractAddress(); | ||||||
|         const txHash = await this.setAllowanceAsync(tokenAddress, ownerAddress, proxyAddress, amountInBaseUnits); |         const txHash = await this.setAllowanceAsync(tokenAddress, ownerAddress, proxyAddress, amountInBaseUnits); | ||||||
|         return txHash; |         return txHash; | ||||||
|     } |     } | ||||||
| @@ -308,8 +309,4 @@ export class TokenWrapper extends ContractWrapper { | |||||||
|         this._tokenContractsByAddress[tokenAddress] = tokenContract; |         this._tokenContractsByAddress[tokenAddress] = tokenContract; | ||||||
|         return tokenContract; |         return tokenContract; | ||||||
|     } |     } | ||||||
|     private async _getTokenTransferProxyAddressAsync(): Promise<string> { |  | ||||||
|         const tokenTransferProxyContractAddress = await this._tokenTransferProxyContractAddressFetcher(); |  | ||||||
|         return tokenTransferProxyContractAddress; |  | ||||||
|     } |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| import * as Web3 from 'web3'; |  | ||||||
| import BigNumber from 'bignumber.js'; | import BigNumber from 'bignumber.js'; | ||||||
|  | import * as Web3 from 'web3'; | ||||||
|  |  | ||||||
| export enum ZeroExError { | export enum ZeroExError { | ||||||
|     ContractDoesNotExist = 'CONTRACT_DOES_NOT_EXIST', |     ContractDoesNotExist = 'CONTRACT_DOES_NOT_EXIST', | ||||||
| @@ -413,6 +413,7 @@ export interface OrderStateWatcherConfig { | |||||||
|  * exchangeContractAddress: The address of an exchange contract to use |  * exchangeContractAddress: The address of an exchange contract to use | ||||||
|  * tokenRegistryContractAddress: The address of a token registry contract to use |  * tokenRegistryContractAddress: The address of a token registry contract to use | ||||||
|  * etherTokenContractAddress: The address of an ether token contract to use |  * etherTokenContractAddress: The address of an ether token contract to use | ||||||
|  |  * tokenTransferProxyContractAddress: The address of the token transfer proxy contract to use | ||||||
|  * orderWatcherConfig: All the configs related to the orderWatcher |  * orderWatcherConfig: All the configs related to the orderWatcher | ||||||
|  */ |  */ | ||||||
| export interface ZeroExConfig { | export interface ZeroExConfig { | ||||||
| @@ -421,6 +422,7 @@ export interface ZeroExConfig { | |||||||
|     exchangeContractAddress?: string; |     exchangeContractAddress?: string; | ||||||
|     tokenRegistryContractAddress?: string; |     tokenRegistryContractAddress?: string; | ||||||
|     etherTokenContractAddress?: string; |     etherTokenContractAddress?: string; | ||||||
|  |     tokenTransferProxyContractAddress?: string; | ||||||
|     orderWatcherConfig?: OrderStateWatcherConfig; |     orderWatcherConfig?: OrderStateWatcherConfig; | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -443,9 +445,11 @@ export interface TransactionReceiptWithDecodedLogs extends TransactionReceipt { | |||||||
|  |  | ||||||
| export interface Artifact { | export interface Artifact { | ||||||
|     abi: Web3.ContractAbi; |     abi: Web3.ContractAbi; | ||||||
|     networks: {[networkId: number]: { |     networks: { | ||||||
|         address: string; |         [networkId: number]: { | ||||||
|     }}; |             address: string; | ||||||
|  |         }; | ||||||
|  |     }; | ||||||
| } | } | ||||||
|  |  | ||||||
| /* | /* | ||||||
| @@ -527,4 +531,4 @@ export interface TransactionReceipt { | |||||||
|     gasUsed: number; |     gasUsed: number; | ||||||
|     contractAddress: string|null; |     contractAddress: string|null; | ||||||
|     logs: Web3.LogEntry[]; |     logs: Web3.LogEntry[]; | ||||||
| } | } // tslint:disable:max-file-line-count | ||||||
|   | |||||||
| @@ -1,9 +1,10 @@ | |||||||
| import * as _ from 'lodash'; |  | ||||||
| import * as Web3 from 'web3'; |  | ||||||
| import BigNumber from 'bignumber.js'; | import BigNumber from 'bignumber.js'; | ||||||
| import promisify = require('es6-promisify'); | import promisify = require('es6-promisify'); | ||||||
| import {ZeroExError, Artifact, TransactionReceipt} from './types'; | import * as _ from 'lodash'; | ||||||
|  | import * as Web3 from 'web3'; | ||||||
|  |  | ||||||
| import {Contract} from './contract'; | import {Contract} from './contract'; | ||||||
|  | import {Artifact, TransactionReceipt, ZeroExError} from './types'; | ||||||
|  |  | ||||||
| interface RawLogEntry { | interface RawLogEntry { | ||||||
|     logIndex: string|null; |     logIndex: string|null; | ||||||
|   | |||||||
| @@ -1,14 +1,16 @@ | |||||||
| import * as _ from 'lodash'; |  | ||||||
| import * as chai from 'chai'; |  | ||||||
| import {chaiSetup} from './utils/chai_setup'; |  | ||||||
| import 'mocha'; |  | ||||||
| import BigNumber from 'bignumber.js'; | import BigNumber from 'bignumber.js'; | ||||||
|  | import * as chai from 'chai'; | ||||||
|  | import * as _ from 'lodash'; | ||||||
|  | import 'mocha'; | ||||||
| import * as Sinon from 'sinon'; | import * as Sinon from 'sinon'; | ||||||
| import {ZeroEx, Order, ZeroExError, LogWithDecodedArgs, ApprovalContractEventArgs, TokenEvents} from '../src'; |  | ||||||
|  | import {ApprovalContractEventArgs, LogWithDecodedArgs, Order, TokenEvents, ZeroEx, ZeroExError} from '../src'; | ||||||
|  |  | ||||||
|  | import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; | ||||||
|  | import {chaiSetup} from './utils/chai_setup'; | ||||||
| import {constants} from './utils/constants'; | import {constants} from './utils/constants'; | ||||||
| import {TokenUtils} from './utils/token_utils'; | import {TokenUtils} from './utils/token_utils'; | ||||||
| import {web3Factory} from './utils/web3_factory'; | import {web3Factory} from './utils/web3_factory'; | ||||||
| import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; |  | ||||||
|  |  | ||||||
| const blockchainLifecycle = new BlockchainLifecycle(); | const blockchainLifecycle = new BlockchainLifecycle(); | ||||||
| chaiSetup.configure(); | chaiSetup.configure(); | ||||||
| @@ -39,11 +41,11 @@ describe('ZeroEx library', () => { | |||||||
|  |  | ||||||
|             // Check that all nested web3 wrapper instances return the updated provider |             // Check that all nested web3 wrapper instances return the updated provider | ||||||
|             const nestedWeb3WrapperProvider = (zeroEx as any)._web3Wrapper.getCurrentProvider(); |             const nestedWeb3WrapperProvider = (zeroEx as any)._web3Wrapper.getCurrentProvider(); | ||||||
|             expect((nestedWeb3WrapperProvider as any).zeroExTestId).to.be.a('number'); |             expect((nestedWeb3WrapperProvider).zeroExTestId).to.be.a('number'); | ||||||
|             const exchangeWeb3WrapperProvider = (zeroEx.exchange as any)._web3Wrapper.getCurrentProvider(); |             const exchangeWeb3WrapperProvider = (zeroEx.exchange as any)._web3Wrapper.getCurrentProvider(); | ||||||
|             expect((exchangeWeb3WrapperProvider as any).zeroExTestId).to.be.a('number'); |             expect((exchangeWeb3WrapperProvider).zeroExTestId).to.be.a('number'); | ||||||
|             const tokenRegistryWeb3WrapperProvider = (zeroEx.tokenRegistry as any)._web3Wrapper.getCurrentProvider(); |             const tokenRegistryWeb3WrapperProvider = (zeroEx.tokenRegistry as any)._web3Wrapper.getCurrentProvider(); | ||||||
|             expect((tokenRegistryWeb3WrapperProvider as any).zeroExTestId).to.be.a('number'); |             expect((tokenRegistryWeb3WrapperProvider).zeroExTestId).to.be.a('number'); | ||||||
|         }); |         }); | ||||||
|     }); |     }); | ||||||
|     describe('#isValidSignature', () => { |     describe('#isValidSignature', () => { | ||||||
|   | |||||||
| @@ -1,8 +1,10 @@ | |||||||
| import * as fs from 'fs'; |  | ||||||
| import * as chai from 'chai'; | import * as chai from 'chai'; | ||||||
| import {chaiSetup} from './utils/chai_setup'; | import * as fs from 'fs'; | ||||||
| import HDWalletProvider = require('truffle-hdwallet-provider'); | import HDWalletProvider = require('truffle-hdwallet-provider'); | ||||||
|  |  | ||||||
| import {ZeroEx} from '../src'; | import {ZeroEx} from '../src'; | ||||||
|  |  | ||||||
|  | import {chaiSetup} from './utils/chai_setup'; | ||||||
| import {constants} from './utils/constants'; | import {constants} from './utils/constants'; | ||||||
|  |  | ||||||
| chaiSetup.configure(); | chaiSetup.configure(); | ||||||
| @@ -26,7 +28,7 @@ describe('Artifacts', () => { | |||||||
|             await (zeroEx.tokenRegistry as any)._getTokenRegistryContractAsync(); |             await (zeroEx.tokenRegistry as any)._getTokenRegistryContractAsync(); | ||||||
|         }).timeout(TIMEOUT); |         }).timeout(TIMEOUT); | ||||||
|         it('proxy contract is deployed', async () => { |         it('proxy contract is deployed', async () => { | ||||||
|             await (zeroEx.token as any)._getTokenTransferProxyAddressAsync(); |             await (zeroEx.proxy as any)._getTokenTransferProxyContractAsync(); | ||||||
|         }).timeout(TIMEOUT); |         }).timeout(TIMEOUT); | ||||||
|         it('exchange contract is deployed', async () => { |         it('exchange contract is deployed', async () => { | ||||||
|             await (zeroEx.exchange as any)._getExchangeContractAsync(); |             await (zeroEx.exchange as any)._getExchangeContractAsync(); | ||||||
| @@ -46,7 +48,7 @@ describe('Artifacts', () => { | |||||||
|             await (zeroEx.tokenRegistry as any)._getTokenRegistryContractAsync(); |             await (zeroEx.tokenRegistry as any)._getTokenRegistryContractAsync(); | ||||||
|         }).timeout(TIMEOUT); |         }).timeout(TIMEOUT); | ||||||
|         it('proxy contract is deployed', async () => { |         it('proxy contract is deployed', async () => { | ||||||
|             await (zeroEx.token as any)._getTokenTransferProxyAddressAsync(); |             await (zeroEx.proxy as any)._getTokenTransferProxyContractAsync(); | ||||||
|         }).timeout(TIMEOUT); |         }).timeout(TIMEOUT); | ||||||
|         it('exchange contract is deployed', async () => { |         it('exchange contract is deployed', async () => { | ||||||
|             await (zeroEx.exchange as any)._getExchangeContractAsync(); |             await (zeroEx.exchange as any)._getExchangeContractAsync(); | ||||||
|   | |||||||
| @@ -1,7 +1,9 @@ | |||||||
| import * as chai from 'chai'; | import * as chai from 'chai'; | ||||||
| import 'mocha'; | import 'mocha'; | ||||||
|  |  | ||||||
| import {ZeroEx} from '../src'; | import {ZeroEx} from '../src'; | ||||||
| import {assert} from '../src/utils/assert'; | import {assert} from '../src/utils/assert'; | ||||||
|  |  | ||||||
| import {constants} from './utils/constants'; | import {constants} from './utils/constants'; | ||||||
| import {web3Factory} from './utils/web3_factory'; | import {web3Factory} from './utils/web3_factory'; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,12 +1,14 @@ | |||||||
| import 'mocha'; |  | ||||||
| import * as chai from 'chai'; |  | ||||||
| import {chaiSetup} from './utils/chai_setup'; |  | ||||||
| import * as Web3 from 'web3'; |  | ||||||
| import BigNumber from 'bignumber.js'; | import BigNumber from 'bignumber.js'; | ||||||
| import {web3Factory} from './utils/web3_factory'; | import * as chai from 'chai'; | ||||||
| import {constants} from './utils/constants'; | import 'mocha'; | ||||||
|  | import * as Web3 from 'web3'; | ||||||
|  |  | ||||||
| import {ZeroEx, ZeroExError} from '../src'; | import {ZeroEx, ZeroExError} from '../src'; | ||||||
|  |  | ||||||
| import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; | import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; | ||||||
|  | import {chaiSetup} from './utils/chai_setup'; | ||||||
|  | import {constants} from './utils/constants'; | ||||||
|  | import {web3Factory} from './utils/web3_factory'; | ||||||
|  |  | ||||||
| chaiSetup.configure(); | chaiSetup.configure(); | ||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
|   | |||||||
| @@ -1,20 +1,22 @@ | |||||||
| import 'mocha'; | import BigNumber from 'bignumber.js'; | ||||||
| import * as chai from 'chai'; | import * as chai from 'chai'; | ||||||
| import * as _ from 'lodash'; | import * as _ from 'lodash'; | ||||||
|  | import 'mocha'; | ||||||
| import * as Sinon from 'sinon'; | import * as Sinon from 'sinon'; | ||||||
| import * as Web3 from 'web3'; | import * as Web3 from 'web3'; | ||||||
| import BigNumber from 'bignumber.js'; |  | ||||||
|  | import { | ||||||
|  |     DecodedLogEvent, | ||||||
|  |     LogEvent, | ||||||
|  |     ZeroEx, | ||||||
|  | } from '../src'; | ||||||
|  | import {EventWatcher} from '../src/order_watcher/event_watcher'; | ||||||
|  | import {DoneCallback} from '../src/types'; | ||||||
|  | import {Web3Wrapper} from '../src/web3_wrapper'; | ||||||
|  |  | ||||||
| import {chaiSetup} from './utils/chai_setup'; | import {chaiSetup} from './utils/chai_setup'; | ||||||
| import {constants} from './utils/constants'; | import {constants} from './utils/constants'; | ||||||
| import {web3Factory} from './utils/web3_factory'; | import {web3Factory} from './utils/web3_factory'; | ||||||
| import {Web3Wrapper} from '../src/web3_wrapper'; |  | ||||||
| import {EventWatcher} from '../src/order_watcher/event_watcher'; |  | ||||||
| import { |  | ||||||
|     ZeroEx, |  | ||||||
|     LogEvent, |  | ||||||
|     DecodedLogEvent, |  | ||||||
| } from '../src'; |  | ||||||
| import {DoneCallback} from '../src/types'; |  | ||||||
|  |  | ||||||
| chaiSetup.configure(); | chaiSetup.configure(); | ||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
|   | |||||||
| @@ -1,13 +1,15 @@ | |||||||
| import * as chai from 'chai'; |  | ||||||
| import BigNumber from 'bignumber.js'; | import BigNumber from 'bignumber.js'; | ||||||
| import {chaiSetup} from './utils/chai_setup'; | import * as chai from 'chai'; | ||||||
| import {web3Factory} from './utils/web3_factory'; |  | ||||||
| import {constants} from './utils/constants'; | import {ExchangeContractErrs, Token, ZeroEx} from '../src'; | ||||||
| import {ZeroEx, ExchangeContractErrs, Token} from '../src'; |  | ||||||
| import {TradeSide, TransferType} from '../src/types'; | import {TradeSide, TransferType} from '../src/types'; | ||||||
| import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; |  | ||||||
| import {ExchangeTransferSimulator} from '../src/utils/exchange_transfer_simulator'; | import {ExchangeTransferSimulator} from '../src/utils/exchange_transfer_simulator'; | ||||||
|  |  | ||||||
|  | import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; | ||||||
|  | import {chaiSetup} from './utils/chai_setup'; | ||||||
|  | import {constants} from './utils/constants'; | ||||||
|  | import {web3Factory} from './utils/web3_factory'; | ||||||
|  |  | ||||||
| chaiSetup.configure(); | chaiSetup.configure(); | ||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
| const blockchainLifecycle = new BlockchainLifecycle(); | const blockchainLifecycle = new BlockchainLifecycle(); | ||||||
|   | |||||||
| @@ -1,28 +1,30 @@ | |||||||
| import 'mocha'; |  | ||||||
| import * as chai from 'chai'; |  | ||||||
| import * as Web3 from 'web3'; |  | ||||||
| import BigNumber from 'bignumber.js'; | import BigNumber from 'bignumber.js'; | ||||||
| import {chaiSetup} from './utils/chai_setup'; | import * as chai from 'chai'; | ||||||
| import {web3Factory} from './utils/web3_factory'; | import 'mocha'; | ||||||
| import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; | import * as Web3 from 'web3'; | ||||||
|  |  | ||||||
| import { | import { | ||||||
|     ZeroEx, |     DecodedLogEvent, | ||||||
|     Token, |  | ||||||
|     SignedOrder, |  | ||||||
|     SubscriptionOpts, |  | ||||||
|     ExchangeEvents, |  | ||||||
|     ExchangeContractErrs, |     ExchangeContractErrs, | ||||||
|     OrderCancellationRequest, |     ExchangeEvents, | ||||||
|     OrderFillRequest, |  | ||||||
|     LogFillContractEventArgs, |  | ||||||
|     LogCancelContractEventArgs, |     LogCancelContractEventArgs, | ||||||
|     LogEvent, |     LogEvent, | ||||||
|     DecodedLogEvent, |     LogFillContractEventArgs, | ||||||
|  |     OrderCancellationRequest, | ||||||
|  |     OrderFillRequest, | ||||||
|  |     SignedOrder, | ||||||
|  |     SubscriptionOpts, | ||||||
|  |     Token, | ||||||
|  |     ZeroEx, | ||||||
| } from '../src'; | } from '../src'; | ||||||
| import {DoneCallback, BlockParamLiteral} from '../src/types'; | import {BlockParamLiteral, DoneCallback} from '../src/types'; | ||||||
|  |  | ||||||
|  | import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; | ||||||
|  | import {chaiSetup} from './utils/chai_setup'; | ||||||
|  | import {constants} from './utils/constants'; | ||||||
| import {FillScenarios} from './utils/fill_scenarios'; | import {FillScenarios} from './utils/fill_scenarios'; | ||||||
| import {TokenUtils} from './utils/token_utils'; | import {TokenUtils} from './utils/token_utils'; | ||||||
| import {constants} from './utils/constants'; | import {web3Factory} from './utils/web3_factory'; | ||||||
|  |  | ||||||
| chaiSetup.configure(); | chaiSetup.configure(); | ||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
| @@ -825,4 +827,4 @@ describe('ExchangeWrapper', () => { | |||||||
|             expect(args.maker).to.be.equal(differentMakerAddress); |             expect(args.maker).to.be.equal(differentMakerAddress); | ||||||
|         }); |         }); | ||||||
|     }); |     }); | ||||||
| }); | }); // tslint:disable:max-file-line-count | ||||||
|   | |||||||
| @@ -1,21 +1,23 @@ | |||||||
| import 'mocha'; | import BigNumber from 'bignumber.js'; | ||||||
| import * as chai from 'chai'; | import * as chai from 'chai'; | ||||||
| import * as _ from 'lodash'; | import * as _ from 'lodash'; | ||||||
|  | import 'mocha'; | ||||||
| import * as Sinon from 'sinon'; | import * as Sinon from 'sinon'; | ||||||
| import * as Web3 from 'web3'; | import * as Web3 from 'web3'; | ||||||
| import BigNumber from 'bignumber.js'; |  | ||||||
| import {chaiSetup} from './utils/chai_setup'; |  | ||||||
| import {web3Factory} from './utils/web3_factory'; |  | ||||||
| import {utils} from '../src/utils/utils'; |  | ||||||
| import {constants} from '../src/utils/constants'; |  | ||||||
| import {Web3Wrapper} from '../src/web3_wrapper'; |  | ||||||
| import {TokenUtils} from './utils/token_utils'; |  | ||||||
| import {ExpirationWatcher} from '../src/order_watcher/expiration_watcher'; |  | ||||||
| import {Token, DoneCallback} from '../src/types'; |  | ||||||
| import {ZeroEx} from '../src/0x'; | import {ZeroEx} from '../src/0x'; | ||||||
|  | import {ExpirationWatcher} from '../src/order_watcher/expiration_watcher'; | ||||||
|  | import {DoneCallback, Token} from '../src/types'; | ||||||
|  | import {constants} from '../src/utils/constants'; | ||||||
|  | import {utils} from '../src/utils/utils'; | ||||||
|  | import {Web3Wrapper} from '../src/web3_wrapper'; | ||||||
|  |  | ||||||
| import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; | import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; | ||||||
|  | import {chaiSetup} from './utils/chai_setup'; | ||||||
| import {FillScenarios} from './utils/fill_scenarios'; | import {FillScenarios} from './utils/fill_scenarios'; | ||||||
| import {reportCallbackErrors} from './utils/report_callback_errors'; | import {reportCallbackErrors} from './utils/report_callback_errors'; | ||||||
|  | import {TokenUtils} from './utils/token_utils'; | ||||||
|  | import {web3Factory} from './utils/web3_factory'; | ||||||
|  |  | ||||||
| chaiSetup.configure(); | chaiSetup.configure(); | ||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
| @@ -46,7 +48,7 @@ describe('ExpirationWatcher', () => { | |||||||
|             networkId: constants.TESTRPC_NETWORK_ID, |             networkId: constants.TESTRPC_NETWORK_ID, | ||||||
|         }; |         }; | ||||||
|         zeroEx = new ZeroEx(web3.currentProvider, config); |         zeroEx = new ZeroEx(web3.currentProvider, config); | ||||||
|         exchangeContractAddress = await zeroEx.exchange.getContractAddress(); |         exchangeContractAddress = zeroEx.exchange.getContractAddress(); | ||||||
|         userAddresses = await zeroEx.getAvailableAddressesAsync(); |         userAddresses = await zeroEx.getAvailableAddressesAsync(); | ||||||
|         tokens = await zeroEx.tokenRegistry.getTokensAsync(); |         tokens = await zeroEx.tokenRegistry.getTokensAsync(); | ||||||
|         tokenUtils = new TokenUtils(tokens); |         tokenUtils = new TokenUtils(tokens); | ||||||
|   | |||||||
| @@ -1,17 +1,19 @@ | |||||||
| import * as chai from 'chai'; |  | ||||||
| import * as Web3 from 'web3'; |  | ||||||
| import BigNumber from 'bignumber.js'; | import BigNumber from 'bignumber.js'; | ||||||
|  | import * as chai from 'chai'; | ||||||
| import * as Sinon from 'sinon'; | import * as Sinon from 'sinon'; | ||||||
| import {chaiSetup} from './utils/chai_setup'; | import * as Web3 from 'web3'; | ||||||
| import {web3Factory} from './utils/web3_factory'; |  | ||||||
| import {ZeroEx, SignedOrder, Token, ExchangeContractErrs, ZeroExError} from '../src'; | import {ExchangeContractErrs, SignedOrder, Token, ZeroEx, ZeroExError} from '../src'; | ||||||
| import {TradeSide, TransferType} from '../src/types'; | import {TradeSide, TransferType} from '../src/types'; | ||||||
| import {TokenUtils} from './utils/token_utils'; |  | ||||||
| import {constants} from './utils/constants'; |  | ||||||
| import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; |  | ||||||
| import {FillScenarios} from './utils/fill_scenarios'; |  | ||||||
| import {OrderValidationUtils} from '../src/utils/order_validation_utils'; |  | ||||||
| import {ExchangeTransferSimulator} from '../src/utils/exchange_transfer_simulator'; | import {ExchangeTransferSimulator} from '../src/utils/exchange_transfer_simulator'; | ||||||
|  | import {OrderValidationUtils} from '../src/utils/order_validation_utils'; | ||||||
|  |  | ||||||
|  | import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; | ||||||
|  | import {chaiSetup} from './utils/chai_setup'; | ||||||
|  | import {constants} from './utils/constants'; | ||||||
|  | import {FillScenarios} from './utils/fill_scenarios'; | ||||||
|  | import {TokenUtils} from './utils/token_utils'; | ||||||
|  | import {web3Factory} from './utils/web3_factory'; | ||||||
|  |  | ||||||
| chaiSetup.configure(); | chaiSetup.configure(); | ||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
|   | |||||||
| @@ -1,24 +1,26 @@ | |||||||
| import 'mocha'; |  | ||||||
| import * as _ from 'lodash'; |  | ||||||
| import * as chai from 'chai'; |  | ||||||
| import * as Sinon from 'sinon'; |  | ||||||
| import {chaiSetup} from './utils/chai_setup'; |  | ||||||
| import * as Web3 from 'web3'; |  | ||||||
| import BigNumber from 'bignumber.js'; | import BigNumber from 'bignumber.js'; | ||||||
|  | import * as chai from 'chai'; | ||||||
| import promisify = require('es6-promisify'); | import promisify = require('es6-promisify'); | ||||||
| import {web3Factory} from './utils/web3_factory'; | import * as _ from 'lodash'; | ||||||
| import {constants} from './utils/constants'; | import 'mocha'; | ||||||
|  | import * as Sinon from 'sinon'; | ||||||
|  | import * as Web3 from 'web3'; | ||||||
|  |  | ||||||
| import { | import { | ||||||
|  |     ApprovalContractEventArgs, | ||||||
|  |     DecodedLogEvent, | ||||||
|  |     Token, | ||||||
|  |     TokenEvents, | ||||||
|     ZeroEx, |     ZeroEx, | ||||||
|     ZeroExError, |     ZeroExError, | ||||||
|     Token, |  | ||||||
|     ApprovalContractEventArgs, |  | ||||||
|     TokenEvents, |  | ||||||
|     DecodedLogEvent, |  | ||||||
| } from '../src'; | } from '../src'; | ||||||
|  | import {BlockParamLiteral, DoneCallback} from '../src/types'; | ||||||
|  |  | ||||||
| import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; | import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; | ||||||
|  | import {chaiSetup} from './utils/chai_setup'; | ||||||
|  | import {constants} from './utils/constants'; | ||||||
| import {TokenUtils} from './utils/token_utils'; | import {TokenUtils} from './utils/token_utils'; | ||||||
| import {DoneCallback, BlockParamLiteral} from '../src/types'; | import {web3Factory} from './utils/web3_factory'; | ||||||
|  |  | ||||||
| chaiSetup.configure(); | chaiSetup.configure(); | ||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
|   | |||||||
| @@ -1,12 +1,14 @@ | |||||||
|  | import {schemas, SchemaValidator} from '@0xproject/json-schemas'; | ||||||
|  | import * as chai from 'chai'; | ||||||
| import * as _ from 'lodash'; | import * as _ from 'lodash'; | ||||||
| import 'mocha'; | import 'mocha'; | ||||||
| import * as chai from 'chai'; |  | ||||||
| import {SchemaValidator, schemas} from '@0xproject/json-schemas'; | import {Token, ZeroEx} from '../src'; | ||||||
| import {constants} from './utils/constants'; |  | ||||||
| import {chaiSetup} from './utils/chai_setup'; |  | ||||||
| import {web3Factory} from './utils/web3_factory'; |  | ||||||
| import {ZeroEx, Token} from '../src'; |  | ||||||
| import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; | import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; | ||||||
|  | import {chaiSetup} from './utils/chai_setup'; | ||||||
|  | import {constants} from './utils/constants'; | ||||||
|  | import {web3Factory} from './utils/web3_factory'; | ||||||
|  |  | ||||||
| chaiSetup.configure(); | chaiSetup.configure(); | ||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
|   | |||||||
| @@ -1,10 +1,12 @@ | |||||||
| import * as chai from 'chai'; | import * as chai from 'chai'; | ||||||
| import {chaiSetup} from './utils/chai_setup'; |  | ||||||
| import {web3Factory} from './utils/web3_factory'; |  | ||||||
| import {ZeroEx} from '../src'; | import {ZeroEx} from '../src'; | ||||||
| import {constants} from './utils/constants'; |  | ||||||
| import {TokenTransferProxyWrapper} from '../src/contract_wrappers/token_transfer_proxy_wrapper'; | import {TokenTransferProxyWrapper} from '../src/contract_wrappers/token_transfer_proxy_wrapper'; | ||||||
|  |  | ||||||
|  | import {chaiSetup} from './utils/chai_setup'; | ||||||
|  | import {constants} from './utils/constants'; | ||||||
|  | import {web3Factory} from './utils/web3_factory'; | ||||||
|  |  | ||||||
| chaiSetup.configure(); | chaiSetup.configure(); | ||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,28 +1,30 @@ | |||||||
| import 'mocha'; |  | ||||||
| import * as chai from 'chai'; |  | ||||||
| import {chaiSetup} from './utils/chai_setup'; |  | ||||||
| import * as Web3 from 'web3'; |  | ||||||
| import BigNumber from 'bignumber.js'; | import BigNumber from 'bignumber.js'; | ||||||
|  | import * as chai from 'chai'; | ||||||
| import promisify = require('es6-promisify'); | import promisify = require('es6-promisify'); | ||||||
| import {web3Factory} from './utils/web3_factory'; | import 'mocha'; | ||||||
|  | import * as Web3 from 'web3'; | ||||||
|  |  | ||||||
| import { | import { | ||||||
|  |     ApprovalContractEventArgs, | ||||||
|  |     ContractEvent, | ||||||
|  |     DecodedLogEvent, | ||||||
|  |     LogEvent, | ||||||
|  |     LogWithDecodedArgs, | ||||||
|  |     SubscriptionOpts, | ||||||
|  |     Token, | ||||||
|  |     TokenContractEventArgs, | ||||||
|  |     TokenEvents, | ||||||
|  |     TransferContractEventArgs, | ||||||
|     ZeroEx, |     ZeroEx, | ||||||
|     ZeroExError, |     ZeroExError, | ||||||
|     Token, |  | ||||||
|     SubscriptionOpts, |  | ||||||
|     TokenEvents, |  | ||||||
|     ContractEvent, |  | ||||||
|     TransferContractEventArgs, |  | ||||||
|     ApprovalContractEventArgs, |  | ||||||
|     TokenContractEventArgs, |  | ||||||
|     LogWithDecodedArgs, |  | ||||||
|     LogEvent, |  | ||||||
|     DecodedLogEvent, |  | ||||||
| } from '../src'; | } from '../src'; | ||||||
| import {constants} from './utils/constants'; | import {BlockParamLiteral, DoneCallback} from '../src/types'; | ||||||
|  |  | ||||||
| import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; | import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; | ||||||
|  | import {chaiSetup} from './utils/chai_setup'; | ||||||
|  | import {constants} from './utils/constants'; | ||||||
| import {TokenUtils} from './utils/token_utils'; | import {TokenUtils} from './utils/token_utils'; | ||||||
| import {DoneCallback, BlockParamLiteral} from '../src/types'; | import {web3Factory} from './utils/web3_factory'; | ||||||
|  |  | ||||||
| chaiSetup.configure(); | chaiSetup.configure(); | ||||||
| const expect = chai.expect; | const expect = chai.expect; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user