diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-06-13 00:20:43 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-06-13 00:20:43 +0800 |
commit | 365548e1269cc854275a09b6235d2d096b05ee20 (patch) | |
tree | ec536cf7bdbec3e7fb45ed12c7344adc0b8d6b73 | |
parent | b1ab696fdd16157702192e280c2e0a840950288a (diff) | |
download | dexon-0x-contracts-365548e1269cc854275a09b6235d2d096b05ee20.tar.gz dexon-0x-contracts-365548e1269cc854275a09b6235d2d096b05ee20.tar.zst dexon-0x-contracts-365548e1269cc854275a09b6235d2d096b05ee20.zip |
Introduce index.ts file which defines public interface
-rw-r--r-- | package.json | 4 | ||||
-rw-r--r-- | src/index.ts | 24 | ||||
-rw-r--r-- | test/0x.js_test.ts | 4 | ||||
-rw-r--r-- | test/exchange_wrapper_test.ts | 2 | ||||
-rw-r--r-- | test/token_registry_wrapper_test.ts | 2 | ||||
-rw-r--r-- | test/token_wrapper_test.ts | 3 | ||||
-rw-r--r-- | test/utils/fill_scenarios.ts | 3 | ||||
-rw-r--r-- | test/utils/order_factory.ts | 3 | ||||
-rw-r--r-- | test/utils/token_utils.ts | 2 | ||||
-rw-r--r-- | webpack.config.js | 4 |
10 files changed, 35 insertions, 16 deletions
diff --git a/package.json b/package.json index 6406621e5..be86af900 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,8 @@ "tokens", "exchange" ], - "main": "lib/src/0x.js", - "types": "lib/src/0x.d.ts", + "main": "lib/src/index.js", + "types": "lib/src/index.d.ts", "scripts": { "prebuild": "npm run clean", "build": "run-p build:*:prod", diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 000000000..9916faed7 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,24 @@ +export {ZeroEx} from './0x'; + +export { + Order, + SignedOrder, + ECSignature, + ZeroExError, + EventCallback, + EventCallbackAsync, + EventCallbackSync, + ContractEventObj, + CreateContractEvent, + ExchangeContractErrCodes, + ExchangeContractErrs, + ContractEvent, + Token, + ExchangeEvents, + IndexFilterValues, + SubscriptionOpts, + BlockParam, + OrderFillOrKillRequest, + OrderCancellationRequest, + OrderFillRequest, +} from './types'; diff --git a/test/0x.js_test.ts b/test/0x.js_test.ts index f60bf01f8..42ab46cc9 100644 --- a/test/0x.js_test.ts +++ b/test/0x.js_test.ts @@ -4,10 +4,8 @@ import {chaiSetup} from './utils/chai_setup'; import 'mocha'; import * as BigNumber from 'bignumber.js'; import * as Sinon from 'sinon'; -import {ZeroEx} from '../src/0x'; +import {ZeroEx, Order, ECSignature} from '../src'; import {constants} from './utils/constants'; -import {Order} from '../src/types'; -import {ECSignature} from '../src/types'; import {web3Factory} from './utils/web3_factory'; chaiSetup.configure(); diff --git a/test/exchange_wrapper_test.ts b/test/exchange_wrapper_test.ts index 62b36fce4..2f79f351c 100644 --- a/test/exchange_wrapper_test.ts +++ b/test/exchange_wrapper_test.ts @@ -19,7 +19,7 @@ import { ExchangeContractErrs, OrderCancellationRequest, OrderFillRequest, -} from '../src/types'; +} from '../src'; import {FillScenarios} from './utils/fill_scenarios'; import {TokenUtils} from './utils/token_utils'; diff --git a/test/token_registry_wrapper_test.ts b/test/token_registry_wrapper_test.ts index b12b92dc4..158a02596 100644 --- a/test/token_registry_wrapper_test.ts +++ b/test/token_registry_wrapper_test.ts @@ -3,7 +3,7 @@ import 'mocha'; import * as chai from 'chai'; import {chaiSetup} from './utils/chai_setup'; import {web3Factory} from './utils/web3_factory'; -import {ZeroEx} from '../src/0x'; +import {ZeroEx} from '../src'; import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; import {SchemaValidator} from '../src/utils/schema_validator'; import {tokenSchema} from '../src/schemas/token_schema'; diff --git a/test/token_wrapper_test.ts b/test/token_wrapper_test.ts index 18bbd8e43..308d3b634 100644 --- a/test/token_wrapper_test.ts +++ b/test/token_wrapper_test.ts @@ -5,8 +5,7 @@ import * as Web3 from 'web3'; import * as BigNumber from 'bignumber.js'; import promisify = require('es6-promisify'); import {web3Factory} from './utils/web3_factory'; -import {ZeroEx} from '../src/0x'; -import {ZeroExError, Token} from '../src/types'; +import {ZeroEx, ZeroExError, Token} from '../src'; import {BlockchainLifecycle} from './utils/blockchain_lifecycle'; chaiSetup.configure(); diff --git a/test/utils/fill_scenarios.ts b/test/utils/fill_scenarios.ts index d1e5f2b18..b8ad7eb12 100644 --- a/test/utils/fill_scenarios.ts +++ b/test/utils/fill_scenarios.ts @@ -1,6 +1,5 @@ import * as BigNumber from 'bignumber.js'; -import {ZeroEx} from '../../src/0x'; -import {Token, SignedOrder} from '../../src/types'; +import {ZeroEx, Token, SignedOrder} from '../../src'; import {orderFactory} from '../utils/order_factory'; import {constants} from './constants'; diff --git a/test/utils/order_factory.ts b/test/utils/order_factory.ts index 909a3c75e..ef19f2c4c 100644 --- a/test/utils/order_factory.ts +++ b/test/utils/order_factory.ts @@ -1,7 +1,6 @@ import * as _ from 'lodash'; import * as BigNumber from 'bignumber.js'; -import {SignedOrder} from '../../src/types'; -import {ZeroEx} from '../../src/0x'; +import {ZeroEx, SignedOrder} from '../../src'; export const orderFactory = { async createSignedOrderAsync( diff --git a/test/utils/token_utils.ts b/test/utils/token_utils.ts index 14788b299..f4fa7ac31 100644 --- a/test/utils/token_utils.ts +++ b/test/utils/token_utils.ts @@ -1,5 +1,5 @@ import * as _ from 'lodash'; -import {Token, ZeroExError} from '../../src/types'; +import {Token, ZeroExError} from '../../src'; const PROTOCOL_TOKEN_SYMBOL = 'ZRX'; diff --git a/webpack.config.js b/webpack.config.js index c1f1a97df..3295c59c6 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -7,10 +7,10 @@ const path = require('path'); const production = process.env.NODE_ENV === 'production'; let entry = { - '0x': './src/0x.ts', + '0x': './src/index.ts', }; if (production) { - entry = _.assign({}, entry, {'0x.min': './src/0x.ts'}); + entry = _.assign({}, entry, {'0x.min': './src/index.ts'}); } module.exports = { |