aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonid <logvinov.leon@gmail.com>2017-06-13 01:07:40 +0800
committerGitHub <noreply@github.com>2017-06-13 01:07:40 +0800
commit2cac659f8b5766e8009210cee6054bb27616097c (patch)
tree5bd556655eb8d0d0ceacf87b81def08826349675
parentb1ab696fdd16157702192e280c2e0a840950288a (diff)
parent6cdd90e18b3a830423ef6b44d02648a98442ba54 (diff)
downloaddexon-sol-tools-2cac659f8b5766e8009210cee6054bb27616097c.tar
dexon-sol-tools-2cac659f8b5766e8009210cee6054bb27616097c.tar.gz
dexon-sol-tools-2cac659f8b5766e8009210cee6054bb27616097c.tar.bz2
dexon-sol-tools-2cac659f8b5766e8009210cee6054bb27616097c.tar.lz
dexon-sol-tools-2cac659f8b5766e8009210cee6054bb27616097c.tar.xz
dexon-sol-tools-2cac659f8b5766e8009210cee6054bb27616097c.tar.zst
dexon-sol-tools-2cac659f8b5766e8009210cee6054bb27616097c.zip
Merge pull request #63 from 0xProject/api-refactor
Api refactor
-rw-r--r--package.json4
-rw-r--r--src/index.ts25
-rw-r--r--test/0x.js_test.ts4
-rw-r--r--test/assert_test.ts2
-rw-r--r--test/exchange_wrapper_test.ts4
-rw-r--r--test/token_registry_wrapper_test.ts2
-rw-r--r--test/token_wrapper_test.ts3
-rw-r--r--test/utils/fill_scenarios.ts3
-rw-r--r--test/utils/order_factory.ts3
-rw-r--r--test/utils/token_utils.ts2
-rw-r--r--webpack.config.js4
11 files changed, 38 insertions, 18 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..16e48862b
--- /dev/null
+++ b/src/index.ts
@@ -0,0 +1,25 @@
+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,
+ DoneCallback,
+} 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/assert_test.ts b/test/assert_test.ts
index dd03f5b19..25d9a8d16 100644
--- a/test/assert_test.ts
+++ b/test/assert_test.ts
@@ -1,6 +1,6 @@
import * as chai from 'chai';
import 'mocha';
-import {ZeroEx} from '../src/0x';
+import {ZeroEx} from '../src';
import {assert} from '../src/utils/assert';
import {web3Factory} from './utils/web3_factory';
diff --git a/test/exchange_wrapper_test.ts b/test/exchange_wrapper_test.ts
index 62b36fce4..deb76447e 100644
--- a/test/exchange_wrapper_test.ts
+++ b/test/exchange_wrapper_test.ts
@@ -6,9 +6,9 @@ import {chaiSetup} from './utils/chai_setup';
import ChaiBigNumber = require('chai-bignumber');
import promisify = require('es6-promisify');
import {web3Factory} from './utils/web3_factory';
-import {ZeroEx} from '../src/0x';
import {BlockchainLifecycle} from './utils/blockchain_lifecycle';
import {
+ ZeroEx,
Token,
Order,
SignedOrder,
@@ -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..a23e78027 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',
+ 'index': './src/index.ts',
};
if (production) {
- entry = _.assign({}, entry, {'0x.min': './src/0x.ts'});
+ entry = _.assign({}, entry, {'index.min': './src/index.ts'});
}
module.exports = {