aboutsummaryrefslogtreecommitdiffstats
path: root/packages/connect
diff options
context:
space:
mode:
Diffstat (limited to 'packages/connect')
-rw-r--r--packages/connect/CHANGELOG.md4
-rw-r--r--packages/connect/package.json27
-rw-r--r--packages/connect/src/http_client.ts2
-rw-r--r--packages/connect/src/index.ts5
-rw-r--r--packages/connect/src/types.ts30
-rw-r--r--packages/connect/src/utils/relayer_response_json_parsers.ts3
6 files changed, 24 insertions, 47 deletions
diff --git a/packages/connect/CHANGELOG.md b/packages/connect/CHANGELOG.md
index e1fb7c795..bd5a8eafc 100644
--- a/packages/connect/CHANGELOG.md
+++ b/packages/connect/CHANGELOG.md
@@ -1,5 +1,9 @@
# CHANGELOG
+## v0.6.4 - _March 18, 2018_
+
+ * Consolidate `Order`, `SignedOrder`, and `ECSignature` into the `@0xproject/types` package (#456)
+
## v0.6.2 - _February 16, 2018_
* Fix JSON parse empty response (#407)
diff --git a/packages/connect/package.json b/packages/connect/package.json
index e0478b42a..3861ecb3e 100644
--- a/packages/connect/package.json
+++ b/packages/connect/package.json
@@ -1,6 +1,6 @@
{
"name": "@0xproject/connect",
- "version": "0.6.3",
+ "version": "0.6.6",
"description": "A javascript library for interacting with the standard relayer api",
"keywords": [
"connect",
@@ -14,7 +14,7 @@
"scripts": {
"build:watch": "tsc -w",
"build": "tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts",
- "clean": "shx rm -rf _bundles lib test_temp scripts",
+ "clean": "shx rm -rf lib test_temp scripts",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES",
"upload_docs_json": "aws s3 cp generated_docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type application/json",
"copy_test_fixtures": "copyfiles -u 2 './test/fixtures/**/*.json' ./lib/test/fixtures",
@@ -27,7 +27,7 @@
},
"config": {
"postpublish": {
- "assets": ["_bundles/index.js", "_bundles/index.min.js"],
+ "assets": [],
"docPublishConfigs": {
"s3BucketPath": "s3://connect-docs-jsons/",
"s3StagingBucketPath": "s3://staging-connect-docs-jsons/"
@@ -48,40 +48,41 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/connect/README.md",
"dependencies": {
- "@0xproject/assert": "^0.2.0",
- "@0xproject/json-schemas": "^0.7.14",
- "@0xproject/utils": "^0.4.1",
+ "@0xproject/assert": "^0.2.3",
+ "@0xproject/json-schemas": "^0.7.17",
+ "@0xproject/types": "^0.4.1",
+ "@0xproject/utils": "^0.4.3",
"isomorphic-fetch": "^2.2.1",
"lodash": "^4.17.4",
"query-string": "^5.0.1",
"websocket": "^1.0.25"
},
"devDependencies": {
- "@0xproject/monorepo-scripts": "^0.1.12",
- "@0xproject/tslint-config": "^0.4.10",
+ "@0xproject/monorepo-scripts": "^0.1.14",
+ "@0xproject/tslint-config": "^0.4.12",
"@types/fetch-mock": "^5.12.1",
"@types/lodash": "^4.14.86",
"@types/mocha": "^2.2.42",
"@types/query-string": "^5.0.1",
"@types/websocket": "^0.0.34",
- "nyc": "^11.0.1",
"async-child-process": "^1.1.1",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
- "chai-as-promised-typescript-typings": "^0.0.10",
- "chai-typescript-typings": "^0.0.4",
+ "chai-as-promised-typescript-typings": "^0.0.12",
+ "chai-typescript-typings": "^0.0.6",
"copyfiles": "^1.2.0",
"dirty-chai": "^2.0.1",
"fetch-mock": "^5.13.1",
"mocha": "^4.0.1",
"npm-run-all": "^4.1.2",
+ "nyc": "^11.0.1",
"shx": "^0.2.2",
"tslint": "5.8.0",
"typedoc": "~0.8.0",
"typescript": "2.7.1",
- "web3-typescript-typings": "^0.10.0"
+ "web3-typescript-typings": "^0.10.2"
},
"publishConfig": {
- "access": "public"
+ "access": "public"
}
}
diff --git a/packages/connect/src/http_client.ts b/packages/connect/src/http_client.ts
index a221b54e8..5806f1d43 100644
--- a/packages/connect/src/http_client.ts
+++ b/packages/connect/src/http_client.ts
@@ -1,5 +1,6 @@
import { assert } from '@0xproject/assert';
import { schemas } from '@0xproject/json-schemas';
+import { SignedOrder } from '@0xproject/types';
import 'isomorphic-fetch';
import * as _ from 'lodash';
import * as queryString from 'query-string';
@@ -15,7 +16,6 @@ import {
OrderbookResponse,
OrdersRequestOpts,
PagedRequestOpts,
- SignedOrder,
TokenPairsItem,
TokenPairsRequestOpts,
} from './types';
diff --git a/packages/connect/src/index.ts b/packages/connect/src/index.ts
index bb42384f9..135b5b5f6 100644
--- a/packages/connect/src/index.ts
+++ b/packages/connect/src/index.ts
@@ -2,10 +2,8 @@ export { HttpClient } from './http_client';
export { WebSocketOrderbookChannel } from './ws_orderbook_channel';
export {
Client,
- ECSignature,
FeesRequest,
FeesResponse,
- Order,
OrderbookChannel,
OrderbookChannelHandler,
OrderbookChannelSubscriptionOpts,
@@ -13,9 +11,10 @@ export {
OrderbookResponse,
OrdersRequestOpts,
PagedRequestOpts,
- SignedOrder,
TokenPairsItem,
TokenPairsRequestOpts,
TokenTradeInfo,
WebSocketOrderbookChannelConfig,
} from './types';
+
+export { ECSignature, Order, SignedOrder } from '@0xproject/types';
diff --git a/packages/connect/src/types.ts b/packages/connect/src/types.ts
index 5f837b0b3..5c344e328 100644
--- a/packages/connect/src/types.ts
+++ b/packages/connect/src/types.ts
@@ -1,34 +1,6 @@
+import { ECSignature, Order, SignedOrder } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
-// TODO: Consolidate Order, SignedOrder and ECSignature into a shared package instead of duplicating them from 0x.js
-export interface Order {
- maker: string;
- taker: string;
- makerFee: BigNumber;
- takerFee: BigNumber;
- makerTokenAmount: BigNumber;
- takerTokenAmount: BigNumber;
- makerTokenAddress: string;
- takerTokenAddress: string;
- salt: BigNumber;
- exchangeContractAddress: string;
- feeRecipient: string;
- expirationUnixTimestampSec: BigNumber;
-}
-
-export interface SignedOrder extends Order {
- ecSignature: ECSignature;
-}
-
-/**
- * Elliptic Curve signature
- */
-export interface ECSignature {
- v: number;
- r: string;
- s: string;
-}
-
export interface Client {
getTokenPairsAsync: (requestOpts?: TokenPairsRequestOpts & PagedRequestOpts) => Promise<TokenPairsItem[]>;
getOrdersAsync: (requestOpts?: OrdersRequestOpts & PagedRequestOpts) => Promise<SignedOrder[]>;
diff --git a/packages/connect/src/utils/relayer_response_json_parsers.ts b/packages/connect/src/utils/relayer_response_json_parsers.ts
index 668461bf4..cf1c07bd9 100644
--- a/packages/connect/src/utils/relayer_response_json_parsers.ts
+++ b/packages/connect/src/utils/relayer_response_json_parsers.ts
@@ -1,8 +1,9 @@
import { assert } from '@0xproject/assert';
import { schemas } from '@0xproject/json-schemas';
+import { SignedOrder } from '@0xproject/types';
import * as _ from 'lodash';
-import { FeesResponse, OrderbookResponse, SignedOrder, TokenPairsItem } from '../types';
+import { FeesResponse, OrderbookResponse, TokenPairsItem } from '../types';
import { typeConverters } from './type_converters';