aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-11-30 05:15:35 +0800
committerFabio Berger <me@fabioberger.com>2017-11-30 05:15:35 +0800
commit3d73167f535f00047a03620aa584307d083b4840 (patch)
treeb300171803d486c1a119fbc21856831d687d3a61 /packages
parent2eefec54b44915d93ce8b7cbcc240d15f8652775 (diff)
parentab72656fdf476c2a79737b3f7b52ee918985f3e9 (diff)
downloaddexon-0x-contracts-3d73167f535f00047a03620aa584307d083b4840.tar.gz
dexon-0x-contracts-3d73167f535f00047a03620aa584307d083b4840.tar.zst
dexon-0x-contracts-3d73167f535f00047a03620aa584307d083b4840.zip
Merge branch 'development' of github.com:0xProject/0x.js into development
* 'development' of github.com:0xProject/0x.js: Publish Update CHANGELOG.md Redeclare Order, SignedOrder, and ECSignature types in connect, remove 0x.js dependency Add SignedOrder and TokenTradeInfo to public interface and fix a HttpClient comment
Diffstat (limited to 'packages')
-rw-r--r--packages/connect/CHANGELOG.md6
-rw-r--r--packages/connect/package.json3
-rw-r--r--packages/connect/src/http_client.ts4
-rw-r--r--packages/connect/src/index.ts4
-rw-r--r--packages/connect/src/types.ts30
-rw-r--r--packages/connect/src/utils/orderbook_channel_message_parsers.ts2
-rw-r--r--packages/connect/src/ws_orderbook_channel.ts2
-rw-r--r--packages/website/package.json2
8 files changed, 45 insertions, 8 deletions
diff --git a/packages/connect/CHANGELOG.md b/packages/connect/CHANGELOG.md
index ec6727a12..b6a9eb6ea 100644
--- a/packages/connect/CHANGELOG.md
+++ b/packages/connect/CHANGELOG.md
@@ -1,5 +1,11 @@
# CHANGELOG
+v0.2.0 - _November 29, 2017_
+------------------------
+ * Add SignedOrder and TokenTradeInfo to the public interface
+ * Add ECSignature and Order to the public interface
+ * Remove dependency on 0x.js
+
v0.1.0 - _November 22, 2017_
------------------------
* Provide a HttpClient class for interacting with standard relayer api compliant HTTP urls
diff --git a/packages/connect/package.json b/packages/connect/package.json
index 4048ab186..c46d00e7b 100644
--- a/packages/connect/package.json
+++ b/packages/connect/package.json
@@ -1,6 +1,6 @@
{
"name": "@0xproject/connect",
- "version": "0.1.2",
+ "version": "0.2.0",
"description": "A javascript library for interacting with the standard relayer api",
"keywords": [
"connect",
@@ -36,7 +36,6 @@
},
"homepage": "https://github.com/0xProject/0x.js/packages/connect/README.md",
"dependencies": {
- "0x.js": "^0.27.1",
"@0xproject/assert": "^0.0.6",
"@0xproject/json-schemas": "^0.6.9",
"bignumber.js": "~4.1.0",
diff --git a/packages/connect/src/http_client.ts b/packages/connect/src/http_client.ts
index 3a9e11a7d..252c9e9dd 100644
--- a/packages/connect/src/http_client.ts
+++ b/packages/connect/src/http_client.ts
@@ -1,4 +1,3 @@
-import {SignedOrder} from '0x.js';
import {assert} from '@0xproject/assert';
import {schemas} from '@0xproject/json-schemas';
import {BigNumber} from 'bignumber.js';
@@ -16,6 +15,7 @@ import {
OrderbookRequest,
OrderbookResponse,
OrdersRequest,
+ SignedOrder,
TokenPairsItem,
TokenPairsRequest,
} from './types';
@@ -34,7 +34,7 @@ export class HttpClient implements Client {
private apiEndpointUrl: string;
/**
* Instantiates a new HttpClient instance
- * @param url The base url for making API calls
+ * @param url The relayer API base HTTP url you would like to interact with
* @return An instance of HttpClient
*/
constructor(url: string) {
diff --git a/packages/connect/src/index.ts b/packages/connect/src/index.ts
index c9ebde510..aabf233fe 100644
--- a/packages/connect/src/index.ts
+++ b/packages/connect/src/index.ts
@@ -1,11 +1,15 @@
export {HttpClient} from './http_client';
export {
Client,
+ ECSignature,
FeesRequest,
FeesResponse,
+ Order,
OrderbookRequest,
OrderbookResponse,
OrdersRequest,
+ SignedOrder,
TokenPairsItem,
TokenPairsRequest,
+ TokenTradeInfo,
} from './types';
diff --git a/packages/connect/src/types.ts b/packages/connect/src/types.ts
index eb6df3ba9..71dd8dac2 100644
--- a/packages/connect/src/types.ts
+++ b/packages/connect/src/types.ts
@@ -1,6 +1,34 @@
-import {SignedOrder} from '0x.js';
import {BigNumber} from 'bignumber.js';
+// 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: (request?: TokenPairsRequest) => Promise<TokenPairsItem[]>;
getOrdersAsync: (request?: OrdersRequest) => Promise<SignedOrder[]>;
diff --git a/packages/connect/src/utils/orderbook_channel_message_parsers.ts b/packages/connect/src/utils/orderbook_channel_message_parsers.ts
index f3497db34..9cd160428 100644
--- a/packages/connect/src/utils/orderbook_channel_message_parsers.ts
+++ b/packages/connect/src/utils/orderbook_channel_message_parsers.ts
@@ -1,4 +1,3 @@
-import {SignedOrder} from '0x.js';
import {assert} from '@0xproject/assert';
import {schemas} from '@0xproject/json-schemas';
import * as _ from 'lodash';
@@ -6,6 +5,7 @@ import * as _ from 'lodash';
import {
OrderbookChannelMessage,
OrderbookChannelMessageTypes,
+ SignedOrder,
} from '../types';
import {typeConverters} from './type_converters';
diff --git a/packages/connect/src/ws_orderbook_channel.ts b/packages/connect/src/ws_orderbook_channel.ts
index f5badf624..d9cc1b4c5 100644
--- a/packages/connect/src/ws_orderbook_channel.ts
+++ b/packages/connect/src/ws_orderbook_channel.ts
@@ -1,4 +1,3 @@
-import {SignedOrder} from '0x.js';
import {assert} from '@0xproject/assert';
import {schemas} from '@0xproject/json-schemas';
import * as _ from 'lodash';
@@ -9,6 +8,7 @@ import {
OrderbookChannelHandler,
OrderbookChannelMessageTypes,
OrderbookChannelSubscriptionOpts,
+ SignedOrder,
WebsocketClientEventType,
WebsocketConnectionEventType,
} from './types';
diff --git a/packages/website/package.json b/packages/website/package.json
index 8cde4b8e1..9444b5dbc 100644
--- a/packages/website/package.json
+++ b/packages/website/package.json
@@ -1,6 +1,6 @@
{
"name": "website",
- "version": "0.0.0",
+ "version": "0.0.1",
"private": true,
"description": "Website and 0x portal dapp",
"scripts": {