From e7d5ceb9c5487a5851dbfc1f8bdbe0182fedaef2 Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Wed, 29 Aug 2018 11:15:30 -0700 Subject: feat: Add support for TypeScript project references (#991) * Update all package.json and tsconfig.json * fix(contracts): Make test/utils/web3_wrapper.ts compatible with project refs * Fix webpack config for 0x.js * Fix linter errors by adding rootDir to tsconfig.json as needed * Add build:ts and watch:ts commands to package.json * Update sra-spec to work with project references * Update tsconfig.json with latest new/removed packages * Add TypeScript as devDependency at root * Add missing rootDir to forwarder-helper package * Use a separate tsconfig file for typedoc * Fix linter errors * Apply PR feedback (add comments) * Fix 0x.js tsconfig --- packages/connect/package.json | 5 ++--- packages/connect/tsconfig.json | 3 ++- packages/connect/typedoc-tsconfig.json | 7 +++++++ 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 packages/connect/typedoc-tsconfig.json (limited to 'packages/connect') diff --git a/packages/connect/package.json b/packages/connect/package.json index 15f537c7d..543852350 100644 --- a/packages/connect/package.json +++ b/packages/connect/package.json @@ -15,8 +15,7 @@ "main": "lib/src/index.js", "types": "lib/src/index.d.ts", "scripts": { - "watch_without_deps": "tsc -w", - "build": "tsc", + "build": "tsc -b", "clean": "shx rm -rf lib test_temp generated_docs", "copy_test_fixtures": "copyfiles -u 2 './test/fixtures/**/*.json' ./lib/test/fixtures", "lint": "tslint --project .", @@ -26,7 +25,7 @@ "test:coverage": "nyc npm run test --all && yarn coverage:report:lcov", "coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info", "test:circleci": "yarn test:coverage", - "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES" + "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES" }, "config": { "postpublish": { diff --git a/packages/connect/tsconfig.json b/packages/connect/tsconfig.json index e35816553..2ee711adc 100644 --- a/packages/connect/tsconfig.json +++ b/packages/connect/tsconfig.json @@ -1,7 +1,8 @@ { "extends": "../../tsconfig", "compilerOptions": { - "outDir": "lib" + "outDir": "lib", + "rootDir": "." }, "include": ["./src/**/*", "./test/**/*"] } diff --git a/packages/connect/typedoc-tsconfig.json b/packages/connect/typedoc-tsconfig.json new file mode 100644 index 000000000..c9b0af1ae --- /dev/null +++ b/packages/connect/typedoc-tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../typedoc-tsconfig", + "compilerOptions": { + "outDir": "lib" + }, + "include": ["./src/**/*", "./test/**/*"] +} -- cgit v1.2.3 From f5237f79716fb9ab5f16a64445fb21ea715d70b8 Mon Sep 17 00:00:00 2001 From: fragosti Date: Tue, 4 Sep 2018 11:55:08 -0700 Subject: Use order parser utils from order utils --- packages/connect/package.json | 1 + .../src/utils/relayer_response_json_parsers.ts | 5 +++-- packages/connect/src/utils/type_converters.ts | 26 ++-------------------- 3 files changed, 6 insertions(+), 26 deletions(-) (limited to 'packages/connect') diff --git a/packages/connect/package.json b/packages/connect/package.json index 543852350..04daaea97 100644 --- a/packages/connect/package.json +++ b/packages/connect/package.json @@ -45,6 +45,7 @@ "dependencies": { "@0xproject/assert": "^1.0.7", "@0xproject/json-schemas": "^1.0.1-rc.6", + "@0xproject/order-utils": "^1.0.1-rc.6", "@0xproject/types": "^1.0.1-rc.6", "@0xproject/typescript-typings": "^1.0.5", "@0xproject/utils": "^1.0.7", diff --git a/packages/connect/src/utils/relayer_response_json_parsers.ts b/packages/connect/src/utils/relayer_response_json_parsers.ts index ebd877b70..bc31f231d 100644 --- a/packages/connect/src/utils/relayer_response_json_parsers.ts +++ b/packages/connect/src/utils/relayer_response_json_parsers.ts @@ -1,5 +1,6 @@ import { assert } from '@0xproject/assert'; import { schemas } from '@0xproject/json-schemas'; +import { orderParsingUtils } from '@0xproject/order-utils'; import { APIOrder, @@ -19,7 +20,7 @@ export const relayerResponseJsonParsers = { }, parseAssetPairsItemsJson(json: any): AssetPairsItem[] { return json.map((assetDataPair: any) => { - return typeConverters.convertStringsFieldsToBigNumbers(assetDataPair, [ + return orderParsingUtils.convertStringsFieldsToBigNumbers(assetDataPair, [ 'assetDataA.minAmount', 'assetDataA.maxAmount', 'assetDataB.minAmount', @@ -44,6 +45,6 @@ export const relayerResponseJsonParsers = { }, parseOrderConfigResponseJson(json: any): OrderConfigResponse { assert.doesConformToSchema('orderConfigResponse', json, schemas.relayerApiOrderConfigResponseSchema); - return typeConverters.convertStringsFieldsToBigNumbers(json, ['makerFee', 'takerFee']); + return orderParsingUtils.convertStringsFieldsToBigNumbers(json, ['makerFee', 'takerFee']); }, }; diff --git a/packages/connect/src/utils/type_converters.ts b/packages/connect/src/utils/type_converters.ts index 4b211a0b2..d57ea00e5 100644 --- a/packages/connect/src/utils/type_converters.ts +++ b/packages/connect/src/utils/type_converters.ts @@ -1,4 +1,4 @@ -import { BigNumber } from '@0xproject/utils'; +import { orderParsingUtils } from '@0xproject/order-utils'; import * as _ from 'lodash'; import { APIOrder } from '../types'; @@ -21,28 +21,6 @@ export const typeConverters = { }; }, convertAPIOrderStringFieldsToBigNumber(apiOrder: any): APIOrder { - return { ...apiOrder, order: typeConverters.convertOrderStringFieldsToBigNumber(apiOrder.order) }; - }, - convertOrderStringFieldsToBigNumber(order: any): any { - return typeConverters.convertStringsFieldsToBigNumbers(order, [ - 'makerAssetAmount', - 'takerAssetAmount', - 'makerFee', - 'takerFee', - 'expirationTimeSeconds', - 'salt', - ]); - }, - convertStringsFieldsToBigNumbers(obj: any, fields: string[]): any { - const result = _.assign({}, obj); - _.each(fields, field => { - _.update(result, field, (value: string) => { - if (_.isUndefined(value)) { - throw new Error(`Could not find field '${field}' while converting string fields to BigNumber.`); - } - return new BigNumber(value); - }); - }); - return result; + return { ...apiOrder, order: orderParsingUtils.convertOrderStringFieldsToBigNumber(apiOrder.order) }; }, }; -- cgit v1.2.3 From 33a45fa7393c8a4c07c5673cf40d501643e505d5 Mon Sep 17 00:00:00 2001 From: fragosti Date: Tue, 4 Sep 2018 14:44:56 -0700 Subject: Use BigNumber instead of string where appropriate in OrderConfigRequest --- packages/connect/src/types.ts | 6 +++--- packages/connect/test/http_client_test.ts | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'packages/connect') diff --git a/packages/connect/src/types.ts b/packages/connect/src/types.ts index 06ae732a5..b76af081c 100644 --- a/packages/connect/src/types.ts +++ b/packages/connect/src/types.ts @@ -126,12 +126,12 @@ export interface PaginatedCollection { export interface OrderConfigRequest { makerAddress: string; takerAddress: string; - makerAssetAmount: string; - takerAssetAmount: string; + makerAssetAmount: BigNumber; + takerAssetAmount: BigNumber; makerAssetData: string; takerAssetData: string; exchangeAddress: string; - expirationTimeSeconds: string; + expirationTimeSeconds: BigNumber; } export interface OrderConfigResponse { diff --git a/packages/connect/test/http_client_test.ts b/packages/connect/test/http_client_test.ts index 5b564e97b..12706fc13 100644 --- a/packages/connect/test/http_client_test.ts +++ b/packages/connect/test/http_client_test.ts @@ -18,6 +18,7 @@ import { orderbookResponse } from './fixtures/standard_relayer_api/orderbook'; import * as orderbookJSON from './fixtures/standard_relayer_api/orderbook.json'; import { ordersResponse } from './fixtures/standard_relayer_api/orders'; import * as ordersResponseJSON from './fixtures/standard_relayer_api/orders.json'; +import { BigNumber } from 'bignumber.js'; chai.config.includeStack = true; chai.use(dirtyChai); @@ -138,9 +139,9 @@ describe('HttpClient', () => { const request = { makerAddress: '0x9e56625509c2f60af937f23b7b532600390e8c8b', takerAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32', - makerAssetAmount: '10000000000000000', - takerAssetAmount: '20000000000000000', - expirationTimeSeconds: '1532560590', + makerAssetAmount: new BigNumber('10000000000000000'), + takerAssetAmount: new BigNumber('20000000000000000'), + expirationTimeSeconds: new BigNumber('1532560590'), makerAssetData: '0xf47261b04c32345ced77393b3530b1eed0f346429d', takerAssetData: '0x0257179264389b814a946f3e92105513705ca6b990', exchangeAddress: '0x12459c951127e0c374ff9105dda097662a027093', -- cgit v1.2.3 From a3527a77a6b1de2a808f6a3100c396cb0e0c617f Mon Sep 17 00:00:00 2001 From: fragosti Date: Tue, 4 Sep 2018 14:49:39 -0700 Subject: Add to CHANGELOG --- packages/connect/CHANGELOG.json | 9 +++++++++ packages/connect/test/http_client_test.ts | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'packages/connect') diff --git a/packages/connect/CHANGELOG.json b/packages/connect/CHANGELOG.json index 8ccb6afe2..cecafc6f7 100644 --- a/packages/connect/CHANGELOG.json +++ b/packages/connect/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.0-rc.3", + "changes": [ + { + "note": "Change `OrderConfigRequest` to use BigNumber instead of string for relevant fields.", + "pr": 1058 + } + ] + }, { "version": "2.0.0-rc.2", "changes": [ diff --git a/packages/connect/test/http_client_test.ts b/packages/connect/test/http_client_test.ts index 12706fc13..e9fc9372e 100644 --- a/packages/connect/test/http_client_test.ts +++ b/packages/connect/test/http_client_test.ts @@ -1,3 +1,4 @@ +import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; import * as chaiAsPromised from 'chai-as-promised'; import * as dirtyChai from 'dirty-chai'; @@ -18,7 +19,6 @@ import { orderbookResponse } from './fixtures/standard_relayer_api/orderbook'; import * as orderbookJSON from './fixtures/standard_relayer_api/orderbook.json'; import { ordersResponse } from './fixtures/standard_relayer_api/orders'; import * as ordersResponseJSON from './fixtures/standard_relayer_api/orders.json'; -import { BigNumber } from 'bignumber.js'; chai.config.includeStack = true; chai.use(dirtyChai); -- cgit v1.2.3 From 69eb820d0dbca63a6725d99d2d547506e60068ce Mon Sep 17 00:00:00 2001 From: fragosti Date: Tue, 4 Sep 2018 15:47:49 -0700 Subject: Change orderConfig from POST to GET like in spec --- packages/connect/src/http_client.ts | 2 +- packages/connect/test/http_client_test.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/connect') diff --git a/packages/connect/src/http_client.ts b/packages/connect/src/http_client.ts index b90c2c35f..87d5c30be 100644 --- a/packages/connect/src/http_client.ts +++ b/packages/connect/src/http_client.ts @@ -151,7 +151,7 @@ export class HttpClient implements Client { params: requestOpts, payload: request, }; - const responseJson = await this._requestAsync('/order_config', HttpRequestType.Post, httpRequestOpts); + const responseJson = await this._requestAsync('/order_config', HttpRequestType.Get, httpRequestOpts); const fees = relayerResponseJsonParsers.parseOrderConfigResponseJson(responseJson); return fees; } diff --git a/packages/connect/test/http_client_test.ts b/packages/connect/test/http_client_test.ts index e9fc9372e..83b77021a 100644 --- a/packages/connect/test/http_client_test.ts +++ b/packages/connect/test/http_client_test.ts @@ -148,12 +148,12 @@ describe('HttpClient', () => { }; const url = `${relayUrl}/order_config`; it('gets order config', async () => { - fetchMock.post(url, orderConfigResponseJSON); + fetchMock.get(url, orderConfigResponseJSON); const fees = await relayerClient.getOrderConfigAsync(request); expect(fees).to.be.deep.equal(orderConfigResponse); }); it('does not mutate input', async () => { - fetchMock.post(url, orderConfigResponseJSON); + fetchMock.get(url, orderConfigResponseJSON); const makerAssetAmountBefore = request.makerAssetAmount; const takerAssetAmountBefore = request.takerAssetAmount; const expirationTimeSecondsBefore = request.expirationTimeSeconds; @@ -163,7 +163,7 @@ describe('HttpClient', () => { expect(expirationTimeSecondsBefore).to.be.deep.equal(request.expirationTimeSeconds); }); it('throws an error for invalid JSON response', async () => { - fetchMock.post(url, { test: 'dummy' }); + fetchMock.get(url, { test: 'dummy' }); expect(relayerClient.getOrderConfigAsync(request)).to.be.rejected(); }); }); -- cgit v1.2.3 From 38acdfd6326af3f5bd865b57bf91080a518305a4 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 5 Sep 2018 11:06:11 +0100 Subject: Update CHANGELOG's to publish non-RC versions --- packages/connect/CHANGELOG.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/connect') diff --git a/packages/connect/CHANGELOG.json b/packages/connect/CHANGELOG.json index cecafc6f7..ca73d6dda 100644 --- a/packages/connect/CHANGELOG.json +++ b/packages/connect/CHANGELOG.json @@ -1,6 +1,6 @@ [ { - "version": "2.0.0-rc.3", + "version": "2.0.0", "changes": [ { "note": "Change `OrderConfigRequest` to use BigNumber instead of string for relevant fields.", -- cgit v1.2.3 From 481a752e70f6d9b558fb0aaadd4de87899fd9b1a Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 5 Sep 2018 11:16:34 +0100 Subject: Updated CHANGELOGS --- packages/connect/CHANGELOG.json | 3 ++- packages/connect/CHANGELOG.md | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'packages/connect') diff --git a/packages/connect/CHANGELOG.json b/packages/connect/CHANGELOG.json index ca73d6dda..5b708c10d 100644 --- a/packages/connect/CHANGELOG.json +++ b/packages/connect/CHANGELOG.json @@ -6,7 +6,8 @@ "note": "Change `OrderConfigRequest` to use BigNumber instead of string for relevant fields.", "pr": 1058 } - ] + ], + "timestamp": 1536142250 }, { "version": "2.0.0-rc.2", diff --git a/packages/connect/CHANGELOG.md b/packages/connect/CHANGELOG.md index a83d31869..17888f36e 100644 --- a/packages/connect/CHANGELOG.md +++ b/packages/connect/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.0 - _September 5, 2018_ + + * Change `OrderConfigRequest` to use BigNumber instead of string for relevant fields. (#1058) + ## v2.0.0-rc.2 - _August 27, 2018_ * Dependencies updated -- cgit v1.2.3 From 174b36059368631eeaec3ec7c0a3847350b55d73 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 5 Sep 2018 11:16:45 +0100 Subject: Publish - 0x.js@1.0.1 - @0xproject/abi-gen@1.0.8 - @0xproject/assert@1.0.8 - @0xproject/base-contract@2.0.2 - @0xproject/connect@2.0.0 - @0xproject/contract-wrappers@1.0.1 - contracts@2.1.43 - @0xproject/dev-utils@1.0.7 - ethereum-types@1.0.6 - @0xproject/fill-scenarios@1.0.1 - @0xproject/forwarder-helper@1.0.1 - @0xproject/json-schemas@1.0.1 - @0xproject/metacoin@0.0.18 - @0xproject/migrations@1.0.7 - @0xproject/monorepo-scripts@1.0.8 - @0xproject/order-utils@1.0.1 - @0xproject/order-watcher@1.0.1 - @0xproject/react-docs@1.0.8 - @0xproject/react-shared@1.0.9 - @0xproject/sol-compiler@1.1.2 - @0xproject/sol-cov@2.1.2 - @0xproject/sol-resolver@1.0.8 - @0xproject/sra-report@1.0.8 - @0xproject/sra-spec@1.0.1 - @0xproject/subproviders@2.0.2 - @0xproject/testnet-faucets@1.0.44 - @0xproject/tslint-config@1.0.7 - @0xproject/types@1.0.1 - @0xproject/typescript-typings@2.0.0 - @0xproject/utils@1.0.8 - @0xproject/web3-wrapper@2.0.2 - @0xproject/website@0.0.47 --- packages/connect/package.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'packages/connect') diff --git a/packages/connect/package.json b/packages/connect/package.json index 04daaea97..cc31afef1 100644 --- a/packages/connect/package.json +++ b/packages/connect/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/connect", - "version": "2.0.0-rc.2", + "version": "2.0.0", "engines": { "node": ">=6.12" }, @@ -43,12 +43,12 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/connect/README.md", "dependencies": { - "@0xproject/assert": "^1.0.7", - "@0xproject/json-schemas": "^1.0.1-rc.6", - "@0xproject/order-utils": "^1.0.1-rc.6", - "@0xproject/types": "^1.0.1-rc.6", - "@0xproject/typescript-typings": "^1.0.5", - "@0xproject/utils": "^1.0.7", + "@0xproject/assert": "^1.0.8", + "@0xproject/json-schemas": "^1.0.1", + "@0xproject/order-utils": "^1.0.1", + "@0xproject/types": "^1.0.1", + "@0xproject/typescript-typings": "^2.0.0", + "@0xproject/utils": "^1.0.8", "lodash": "^4.17.5", "query-string": "^5.0.1", "sinon": "^4.0.0", @@ -56,7 +56,7 @@ "websocket": "^1.0.25" }, "devDependencies": { - "@0xproject/tslint-config": "^1.0.6", + "@0xproject/tslint-config": "^1.0.7", "@types/fetch-mock": "^6.0.3", "@types/lodash": "4.14.104", "@types/mocha": "^2.2.42", -- cgit v1.2.3 From 8687b9533c67a551df928b28a776bfdbe6e3e84f Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Fri, 24 Aug 2018 11:11:29 -0700 Subject: Add getForwarderHelperForMakerAssetDataAsync method to forwarderHelperFactory --- packages/connect/src/http_client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/connect') diff --git a/packages/connect/src/http_client.ts b/packages/connect/src/http_client.ts index 87d5c30be..bdcfdd8d2 100644 --- a/packages/connect/src/http_client.ts +++ b/packages/connect/src/http_client.ts @@ -29,7 +29,7 @@ const TRAILING_SLASHES_REGEX = /\/+$/; /** * This class includes all the functionality related to interacting with a set of HTTP endpoints - * that implement the standard relayer API v0 + * that implement the standard relayer API v2 */ export class HttpClient implements Client { private readonly _apiEndpointUrl: string; -- cgit v1.2.3 From dab7f1a73985876676e84911e6cf686d91d5d26b Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 19 Sep 2018 16:13:15 +0100 Subject: Updated CHANGELOGS --- packages/connect/CHANGELOG.json | 9 +++++++++ packages/connect/CHANGELOG.md | 4 ++++ 2 files changed, 13 insertions(+) (limited to 'packages/connect') diff --git a/packages/connect/CHANGELOG.json b/packages/connect/CHANGELOG.json index 5b708c10d..c6e753261 100644 --- a/packages/connect/CHANGELOG.json +++ b/packages/connect/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1537369748, + "version": "2.0.1", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "version": "2.0.0", "changes": [ diff --git a/packages/connect/CHANGELOG.md b/packages/connect/CHANGELOG.md index 17888f36e..8e9ebe3e0 100644 --- a/packages/connect/CHANGELOG.md +++ b/packages/connect/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.1 - _September 19, 2018_ + + * Dependencies updated + ## v2.0.0 - _September 5, 2018_ * Change `OrderConfigRequest` to use BigNumber instead of string for relevant fields. (#1058) -- cgit v1.2.3 From 3e70ab015ba2cf00064c985c0b76137b182abf7f Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 19 Sep 2018 16:13:24 +0100 Subject: Publish - 0x.js@1.0.3 - @0xproject/connect@2.0.1 - @0xproject/contract-wrappers@1.0.3 - contracts@2.1.44 - @0xproject/fill-scenarios@1.0.2 - @0xproject/forwarder-helper@1.0.3 - @0xproject/migrations@1.0.9 - @0xproject/order-utils@1.0.2 - @0xproject/order-watcher@1.0.3 - @0xproject/testnet-faucets@1.0.46 - @0xproject/website@0.0.49 --- packages/connect/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/connect') diff --git a/packages/connect/package.json b/packages/connect/package.json index cc31afef1..1308aa5b2 100644 --- a/packages/connect/package.json +++ b/packages/connect/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/connect", - "version": "2.0.0", + "version": "2.0.1", "engines": { "node": ">=6.12" }, @@ -45,7 +45,7 @@ "dependencies": { "@0xproject/assert": "^1.0.8", "@0xproject/json-schemas": "^1.0.1", - "@0xproject/order-utils": "^1.0.1", + "@0xproject/order-utils": "^1.0.2", "@0xproject/types": "^1.0.1", "@0xproject/typescript-typings": "^2.0.0", "@0xproject/utils": "^1.0.8", -- cgit v1.2.3 From 5446de630886422f1795e06d638a200ab62763ef Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 21 Sep 2018 16:59:16 +0200 Subject: Updated CHANGELOGS --- packages/connect/CHANGELOG.json | 9 +++++++++ packages/connect/CHANGELOG.md | 4 ++++ 2 files changed, 13 insertions(+) (limited to 'packages/connect') diff --git a/packages/connect/CHANGELOG.json b/packages/connect/CHANGELOG.json index c6e753261..f5ca80279 100644 --- a/packages/connect/CHANGELOG.json +++ b/packages/connect/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1537541580, + "version": "2.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1537369748, "version": "2.0.1", diff --git a/packages/connect/CHANGELOG.md b/packages/connect/CHANGELOG.md index 8e9ebe3e0..1f8116f88 100644 --- a/packages/connect/CHANGELOG.md +++ b/packages/connect/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.2 - _September 21, 2018_ + + * Dependencies updated + ## v2.0.1 - _September 19, 2018_ * Dependencies updated -- cgit v1.2.3 From 29f6adc2ed57720d2c2aab7b760a4bcfec5d7b37 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 21 Sep 2018 16:59:27 +0200 Subject: Publish - 0x.js@1.0.4 - @0xproject/abi-gen@1.0.9 - @0xproject/assert@1.0.9 - @0xproject/base-contract@2.0.3 - @0xproject/connect@2.0.2 - @0xproject/contract-wrappers@1.0.4 - contracts@2.1.45 - @0xproject/dev-utils@1.0.8 - ethereum-types@1.0.7 - @0xproject/fill-scenarios@1.0.3 - @0xproject/forwarder-helper@1.0.4 - @0xproject/json-schemas@1.0.2 - @0xproject/metacoin@0.0.19 - @0xproject/migrations@1.0.10 - @0xproject/monorepo-scripts@1.0.9 - @0xproject/order-utils@1.0.3 - @0xproject/order-watcher@1.0.4 - @0xproject/react-docs@1.0.9 - @0xproject/react-shared@1.0.10 - @0xproject/sol-compiler@1.1.3 - @0xproject/sol-cov@2.1.3 - @0xproject/sol-resolver@1.0.9 - @0xproject/sra-report@1.0.9 - @0xproject/sra-spec@1.0.2 - @0xproject/subproviders@2.0.3 - @0xproject/testnet-faucets@1.0.47 - @0xproject/types@1.0.2 - @0xproject/typescript-typings@2.0.1 - @0xproject/utils@1.0.9 - @0xproject/web3-wrapper@2.0.3 - @0xproject/website@0.0.50 --- packages/connect/package.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'packages/connect') diff --git a/packages/connect/package.json b/packages/connect/package.json index 1308aa5b2..1575afe01 100644 --- a/packages/connect/package.json +++ b/packages/connect/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/connect", - "version": "2.0.1", + "version": "2.0.2", "engines": { "node": ">=6.12" }, @@ -43,12 +43,12 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/connect/README.md", "dependencies": { - "@0xproject/assert": "^1.0.8", - "@0xproject/json-schemas": "^1.0.1", - "@0xproject/order-utils": "^1.0.2", - "@0xproject/types": "^1.0.1", - "@0xproject/typescript-typings": "^2.0.0", - "@0xproject/utils": "^1.0.8", + "@0xproject/assert": "^1.0.9", + "@0xproject/json-schemas": "^1.0.2", + "@0xproject/order-utils": "^1.0.3", + "@0xproject/types": "^1.0.2", + "@0xproject/typescript-typings": "^2.0.1", + "@0xproject/utils": "^1.0.9", "lodash": "^4.17.5", "query-string": "^5.0.1", "sinon": "^4.0.0", -- cgit v1.2.3 From b85db17e75e818b5b554cc2b8068aba980d95804 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 25 Sep 2018 12:47:31 +0200 Subject: Move SRA types from @0xproject/connect to @0xproject/sra-types --- packages/connect/CHANGELOG.json | 9 ++ packages/connect/src/http_client.ts | 18 ++- packages/connect/src/index.ts | 25 ++-- packages/connect/src/types.ts | 145 +++------------------ .../src/utils/orders_channel_message_parser.ts | 2 +- .../src/utils/relayer_response_json_parsers.ts | 2 +- packages/connect/src/utils/type_converters.ts | 2 +- packages/connect/src/ws_orders_channel.ts | 3 +- .../fixtures/standard_relayer_api/asset_pairs.ts | 2 +- .../standard_relayer_api/fee_recipients.ts | 2 +- .../fixtures/standard_relayer_api/order_config.ts | 2 +- .../fixtures/standard_relayer_api/orderbook.ts | 2 +- .../test/fixtures/standard_relayer_api/orders.ts | 2 +- 13 files changed, 53 insertions(+), 163 deletions(-) (limited to 'packages/connect') diff --git a/packages/connect/CHANGELOG.json b/packages/connect/CHANGELOG.json index f5ca80279..b39c8d272 100644 --- a/packages/connect/CHANGELOG.json +++ b/packages/connect/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "2.0.3", + "changes": [ + { + "note": "Import SRA-related types from @0xproject/types", + "pr": 1085 + } + ] + }, { "timestamp": 1537541580, "version": "2.0.2", diff --git a/packages/connect/src/http_client.ts b/packages/connect/src/http_client.ts index bdcfdd8d2..8a68d6c23 100644 --- a/packages/connect/src/http_client.ts +++ b/packages/connect/src/http_client.ts @@ -1,19 +1,10 @@ import { assert } from '@0xproject/assert'; import { schemas } from '@0xproject/json-schemas'; -import { SignedOrder } from '@0xproject/types'; -import { fetchAsync } from '@0xproject/utils'; -import * as _ from 'lodash'; -import * as queryString from 'query-string'; - -import { schemas as clientSchemas } from './schemas/schemas'; import { APIOrder, AssetPairsRequestOpts, AssetPairsResponse, - Client, FeeRecipientsResponse, - HttpRequestOptions, - HttpRequestType, OrderbookRequest, OrderbookResponse, OrderConfigRequest, @@ -22,7 +13,14 @@ import { OrdersResponse, PagedRequestOpts, RequestOpts, -} from './types'; + SignedOrder, +} from '@0xproject/types'; +import { fetchAsync } from '@0xproject/utils'; +import * as _ from 'lodash'; +import * as queryString from 'query-string'; + +import { schemas as clientSchemas } from './schemas/schemas'; +import { Client, HttpRequestOptions, HttpRequestType } from './types'; import { relayerResponseJsonParsers } from './utils/relayer_response_json_parsers'; const TRAILING_SLASHES_REGEX = /\/+$/; diff --git a/packages/connect/src/index.ts b/packages/connect/src/index.ts index 0b9cad038..0ec5a0f68 100644 --- a/packages/connect/src/index.ts +++ b/packages/connect/src/index.ts @@ -1,23 +1,20 @@ export { HttpClient } from './http_client'; export { ordersChannelFactory } from './orders_channel_factory'; +export { Client, OrdersChannel, OrdersChannelHandler } from './types'; export { - Client, + APIOrder, + AssetPairsRequestOpts, + AssetPairsResponse, + FeeRecipientsResponse, + OrderbookRequest, + OrderbookResponse, OrderConfigRequest, OrderConfigResponse, - OrdersChannel, - OrdersChannelHandler, OrdersChannelSubscriptionOpts, - OrderbookRequest, - OrderbookResponse, OrdersRequestOpts, - PagedRequestOpts, - AssetPairsRequestOpts, - RequestOpts, - AssetPairsResponse, - FeeRecipientsResponse, - APIOrder, OrdersResponse, + PagedRequestOpts, PaginatedCollection, -} from './types'; - -export { SignedOrder } from '@0xproject/types'; + RequestOpts, + SignedOrder, +} from '@0xproject/types'; diff --git a/packages/connect/src/types.ts b/packages/connect/src/types.ts index b76af081c..4bb0ae534 100644 --- a/packages/connect/src/types.ts +++ b/packages/connect/src/types.ts @@ -1,5 +1,18 @@ -import { SignedOrder } from '@0xproject/types'; -import { BigNumber } from '@0xproject/utils'; +import { + APIOrder, + AssetPairsItem, + AssetPairsRequestOpts, + FeeRecipientsResponse, + OrderbookRequest, + OrderbookResponse, + OrderConfigRequest, + OrderConfigResponse, + OrdersChannelSubscriptionOpts, + OrdersRequestOpts, + PagedRequestOpts, + PaginatedCollection, + SignedOrder, +} from '@0xproject/types'; export interface Client { getAssetPairsAsync: ( @@ -18,140 +31,12 @@ export interface OrdersChannel { close: () => void; } -/** - * baseAssetData: The address of assetData designated as the baseToken in the currency pair calculation of price - * quoteAssetData: The address of assetData designated as the quoteToken in the currency pair calculation of price - * limit: Maximum number of bids and asks in orderbook snapshot - */ -export interface OrdersChannelSubscriptionOpts { - baseAssetData: string; - quoteAssetData: string; - limit: number; -} - export interface OrdersChannelHandler { onUpdate: (channel: OrdersChannel, subscriptionOpts: OrdersChannelSubscriptionOpts, orders: APIOrder[]) => void; onError: (channel: OrdersChannel, err: Error, subscriptionOpts?: OrdersChannelSubscriptionOpts) => void; onClose: (channel: OrdersChannel) => void; } -export type OrdersChannelMessage = UpdateOrdersChannelMessage | UnknownOrdersChannelMessage; - -export enum OrdersChannelMessageTypes { - Update = 'update', - Unknown = 'unknown', -} - -export interface UpdateOrdersChannelMessage { - type: OrdersChannelMessageTypes.Update; - requestId: string; - payload: APIOrder[]; -} - -export interface UnknownOrdersChannelMessage { - type: OrdersChannelMessageTypes.Unknown; - requestId: string; - payload: undefined; -} - -export enum WebsocketConnectionEventType { - Close = 'close', - Error = 'error', - Message = 'message', -} - -export enum WebsocketClientEventType { - Connect = 'connect', - ConnectFailed = 'connectFailed', -} - -export type OrdersResponse = PaginatedCollection; - -export interface APIOrder { - order: SignedOrder; - metaData: object; -} - -export interface AssetPairsRequestOpts { - assetDataA?: string; - assetDataB?: string; -} - -export type AssetPairsResponse = PaginatedCollection; - -export interface AssetPairsItem { - assetDataA: Asset; - assetDataB: Asset; -} - -export interface Asset { - assetData: string; - minAmount: BigNumber; - maxAmount: BigNumber; - precision: number; -} - -export interface OrdersRequestOpts { - makerAssetProxyId?: string; - takerAssetProxyId?: string; - makerAssetAddress?: string; - takerAssetAddress?: string; - exchangeAddress?: string; - senderAddress?: string; - makerAssetData?: string; - takerAssetData?: string; - makerAddress?: string; - takerAddress?: string; - traderAddress?: string; - feeRecipientAddress?: string; -} - -export interface OrderbookRequest { - baseAssetData: string; - quoteAssetData: string; -} - -export interface OrderbookResponse { - bids: PaginatedCollection; - asks: PaginatedCollection; -} - -export interface PaginatedCollection { - total: number; - page: number; - perPage: number; - records: T[]; -} - -export interface OrderConfigRequest { - makerAddress: string; - takerAddress: string; - makerAssetAmount: BigNumber; - takerAssetAmount: BigNumber; - makerAssetData: string; - takerAssetData: string; - exchangeAddress: string; - expirationTimeSeconds: BigNumber; -} - -export interface OrderConfigResponse { - makerFee: BigNumber; - takerFee: BigNumber; - feeRecipientAddress: string; - senderAddress: string; -} - -export type FeeRecipientsResponse = PaginatedCollection; - -export interface RequestOpts { - networkId?: number; -} - -export interface PagedRequestOpts { - page?: number; - perPage?: number; -} - export interface HttpRequestOptions { params?: object; payload?: object; diff --git a/packages/connect/src/utils/orders_channel_message_parser.ts b/packages/connect/src/utils/orders_channel_message_parser.ts index 1b6cda17b..943d7802e 100644 --- a/packages/connect/src/utils/orders_channel_message_parser.ts +++ b/packages/connect/src/utils/orders_channel_message_parser.ts @@ -2,7 +2,7 @@ import { assert } from '@0xproject/assert'; import { schemas } from '@0xproject/json-schemas'; import * as _ from 'lodash'; -import { OrdersChannelMessage, OrdersChannelMessageTypes } from '../types'; +import { OrdersChannelMessage, OrdersChannelMessageTypes } from '@0xproject/types'; import { relayerResponseJsonParsers } from './relayer_response_json_parsers'; diff --git a/packages/connect/src/utils/relayer_response_json_parsers.ts b/packages/connect/src/utils/relayer_response_json_parsers.ts index bc31f231d..356e2dde6 100644 --- a/packages/connect/src/utils/relayer_response_json_parsers.ts +++ b/packages/connect/src/utils/relayer_response_json_parsers.ts @@ -9,7 +9,7 @@ import { OrderbookResponse, OrderConfigResponse, OrdersResponse, -} from '../types'; +} from '@0xproject/types'; import { typeConverters } from './type_converters'; diff --git a/packages/connect/src/utils/type_converters.ts b/packages/connect/src/utils/type_converters.ts index d57ea00e5..99760cf74 100644 --- a/packages/connect/src/utils/type_converters.ts +++ b/packages/connect/src/utils/type_converters.ts @@ -1,7 +1,7 @@ import { orderParsingUtils } from '@0xproject/order-utils'; import * as _ from 'lodash'; -import { APIOrder } from '../types'; +import { APIOrder } from '@0xproject/types'; export const typeConverters = { convertOrderbookStringFieldsToBigNumber(orderbook: any): any { diff --git a/packages/connect/src/ws_orders_channel.ts b/packages/connect/src/ws_orders_channel.ts index cde4acbc3..bf5e8508d 100644 --- a/packages/connect/src/ws_orders_channel.ts +++ b/packages/connect/src/ws_orders_channel.ts @@ -1,8 +1,9 @@ +import { OrdersChannelMessageTypes, OrdersChannelSubscriptionOpts } from '@0xproject/types'; import * as _ from 'lodash'; import { v4 as uuid } from 'uuid'; import * as WebSocket from 'websocket'; -import { OrdersChannel, OrdersChannelHandler, OrdersChannelMessageTypes, OrdersChannelSubscriptionOpts } from './types'; +import { OrdersChannel, OrdersChannelHandler } from './types'; import { assert } from './utils/assert'; import { ordersChannelMessageParser } from './utils/orders_channel_message_parser'; diff --git a/packages/connect/test/fixtures/standard_relayer_api/asset_pairs.ts b/packages/connect/test/fixtures/standard_relayer_api/asset_pairs.ts index 5ce703317..27216e421 100644 --- a/packages/connect/test/fixtures/standard_relayer_api/asset_pairs.ts +++ b/packages/connect/test/fixtures/standard_relayer_api/asset_pairs.ts @@ -1,6 +1,6 @@ import { BigNumber } from '@0xproject/utils'; -import { AssetPairsResponse } from '../../../src/types'; +import { AssetPairsResponse } from '@0xproject/types'; export const assetDataPairsResponse: AssetPairsResponse = { total: 43, diff --git a/packages/connect/test/fixtures/standard_relayer_api/fee_recipients.ts b/packages/connect/test/fixtures/standard_relayer_api/fee_recipients.ts index e17ffe7a8..6f544e9d3 100644 --- a/packages/connect/test/fixtures/standard_relayer_api/fee_recipients.ts +++ b/packages/connect/test/fixtures/standard_relayer_api/fee_recipients.ts @@ -1,4 +1,4 @@ -import { FeeRecipientsResponse } from '../../../src/types'; +import { FeeRecipientsResponse } from '@0xproject/types'; export const feeRecipientsResponse: FeeRecipientsResponse = { total: 3, diff --git a/packages/connect/test/fixtures/standard_relayer_api/order_config.ts b/packages/connect/test/fixtures/standard_relayer_api/order_config.ts index 36f01a009..56a4ac550 100644 --- a/packages/connect/test/fixtures/standard_relayer_api/order_config.ts +++ b/packages/connect/test/fixtures/standard_relayer_api/order_config.ts @@ -1,6 +1,6 @@ import { BigNumber } from '@0xproject/utils'; -import { OrderConfigResponse } from '../../../src/types'; +import { OrderConfigResponse } from '@0xproject/types'; export const orderConfigResponse: OrderConfigResponse = { senderAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32', diff --git a/packages/connect/test/fixtures/standard_relayer_api/orderbook.ts b/packages/connect/test/fixtures/standard_relayer_api/orderbook.ts index d5f39a51f..21d51da74 100644 --- a/packages/connect/test/fixtures/standard_relayer_api/orderbook.ts +++ b/packages/connect/test/fixtures/standard_relayer_api/orderbook.ts @@ -1,6 +1,6 @@ import { BigNumber } from '@0xproject/utils'; -import { OrderbookResponse } from '../../../src/types'; +import { OrderbookResponse } from '@0xproject/types'; export const orderbookResponse: OrderbookResponse = { bids: { diff --git a/packages/connect/test/fixtures/standard_relayer_api/orders.ts b/packages/connect/test/fixtures/standard_relayer_api/orders.ts index 01f8974b8..fb85990d0 100644 --- a/packages/connect/test/fixtures/standard_relayer_api/orders.ts +++ b/packages/connect/test/fixtures/standard_relayer_api/orders.ts @@ -1,6 +1,6 @@ import { BigNumber } from '@0xproject/utils'; -import { OrdersResponse } from '../../../src/types'; +import { OrdersResponse } from '@0xproject/types'; export const ordersResponse: OrdersResponse = { total: 984, -- cgit v1.2.3 From 411813d8d9f23d535f10dd3fdd9e824b244bf187 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 25 Sep 2018 13:48:44 +0200 Subject: Updated CHANGELOGS --- packages/connect/CHANGELOG.json | 3 ++- packages/connect/CHANGELOG.md | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'packages/connect') diff --git a/packages/connect/CHANGELOG.json b/packages/connect/CHANGELOG.json index b39c8d272..d4c501eb1 100644 --- a/packages/connect/CHANGELOG.json +++ b/packages/connect/CHANGELOG.json @@ -6,7 +6,8 @@ "note": "Import SRA-related types from @0xproject/types", "pr": 1085 } - ] + ], + "timestamp": 1537875740 }, { "timestamp": 1537541580, diff --git a/packages/connect/CHANGELOG.md b/packages/connect/CHANGELOG.md index 1f8116f88..2c2483cb6 100644 --- a/packages/connect/CHANGELOG.md +++ b/packages/connect/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.3 - _September 25, 2018_ + + * Import SRA-related types from @0xproject/types (#1085) + ## v2.0.2 - _September 21, 2018_ * Dependencies updated -- cgit v1.2.3 From 78ef98c27ce954f7e46b261b0809ff9d8d70519b Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 25 Sep 2018 13:48:55 +0200 Subject: Publish - 0x.js@1.0.5 - @0xproject/abi-gen@1.0.10 - @0xproject/assert@1.0.10 - @0xproject/asset-buyer@1.0.0 - @0xproject/base-contract@2.0.4 - @0xproject/connect@2.0.3 - @0xproject/contract-wrappers@1.0.5 - contracts@2.1.46 - @0xproject/dev-utils@1.0.9 - @0xproject/fill-scenarios@1.0.4 - @0xproject/json-schemas@1.0.3 - @0xproject/metacoin@0.0.20 - @0xproject/migrations@1.0.11 - @0xproject/order-utils@1.0.4 - @0xproject/order-watcher@1.0.5 - @0xproject/react-docs@1.0.10 - @0xproject/react-shared@1.0.11 - @0xproject/sol-compiler@1.1.4 - @0xproject/sol-cov@2.1.4 - @0xproject/sol-resolver@1.0.10 - @0xproject/sra-report@1.0.10 - @0xproject/sra-spec@1.0.3 - @0xproject/subproviders@2.0.4 - @0xproject/testnet-faucets@1.0.48 - @0xproject/types@1.1.0 - @0xproject/utils@1.0.10 - @0xproject/web3-wrapper@3.0.0 - @0xproject/website@0.0.51 --- packages/connect/package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'packages/connect') diff --git a/packages/connect/package.json b/packages/connect/package.json index 1575afe01..075089fd2 100644 --- a/packages/connect/package.json +++ b/packages/connect/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/connect", - "version": "2.0.2", + "version": "2.0.3", "engines": { "node": ">=6.12" }, @@ -43,12 +43,12 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/connect/README.md", "dependencies": { - "@0xproject/assert": "^1.0.9", - "@0xproject/json-schemas": "^1.0.2", - "@0xproject/order-utils": "^1.0.3", - "@0xproject/types": "^1.0.2", + "@0xproject/assert": "^1.0.10", + "@0xproject/json-schemas": "^1.0.3", + "@0xproject/order-utils": "^1.0.4", + "@0xproject/types": "^1.1.0", "@0xproject/typescript-typings": "^2.0.1", - "@0xproject/utils": "^1.0.9", + "@0xproject/utils": "^1.0.10", "lodash": "^4.17.5", "query-string": "^5.0.1", "sinon": "^4.0.0", -- cgit v1.2.3 From 900a8aee76237778398a5940e723ce30c4af1860 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 25 Sep 2018 21:33:55 +0100 Subject: Updated CHANGELOGS --- packages/connect/CHANGELOG.json | 9 +++++++++ packages/connect/CHANGELOG.md | 4 ++++ 2 files changed, 13 insertions(+) (limited to 'packages/connect') diff --git a/packages/connect/CHANGELOG.json b/packages/connect/CHANGELOG.json index d4c501eb1..9de956d4d 100644 --- a/packages/connect/CHANGELOG.json +++ b/packages/connect/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1537907159, + "version": "2.0.4", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "version": "2.0.3", "changes": [ diff --git a/packages/connect/CHANGELOG.md b/packages/connect/CHANGELOG.md index 2c2483cb6..75906ff4e 100644 --- a/packages/connect/CHANGELOG.md +++ b/packages/connect/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.0.4 - _September 25, 2018_ + + * Dependencies updated + ## v2.0.3 - _September 25, 2018_ * Import SRA-related types from @0xproject/types (#1085) -- cgit v1.2.3 From 1b35a6e3b5d050fa33097b35e1d739ca13c6806e Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 25 Sep 2018 21:34:14 +0100 Subject: Publish - 0x.js@1.0.6 - @0xproject/abi-gen@1.0.11 - @0xproject/assert@1.0.11 - @0xproject/asset-buyer@1.0.1 - @0xproject/base-contract@2.0.5 - @0xproject/connect@2.0.4 - @0xproject/contract-wrappers@2.0.0 - contracts@2.1.47 - @0xproject/dev-utils@1.0.10 - ethereum-types@1.0.8 - @0xproject/fill-scenarios@1.0.5 - @0xproject/json-schemas@1.0.4 - @0xproject/metacoin@0.0.21 - @0xproject/migrations@1.0.12 - @0xproject/order-utils@1.0.5 - @0xproject/order-watcher@2.0.0 - @0xproject/react-docs@1.0.11 - @0xproject/react-shared@1.0.12 - @0xproject/sol-compiler@1.1.5 - @0xproject/sol-cov@2.1.5 - @0xproject/sol-resolver@1.0.11 - @0xproject/sra-report@1.0.11 - @0xproject/sra-spec@1.0.4 - @0xproject/subproviders@2.0.5 - @0xproject/testnet-faucets@1.0.49 - @0xproject/types@1.1.1 - @0xproject/typescript-typings@2.0.2 - @0xproject/utils@1.0.11 - @0xproject/web3-wrapper@3.0.1 - @0xproject/website@0.0.52 --- packages/connect/package.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'packages/connect') diff --git a/packages/connect/package.json b/packages/connect/package.json index 075089fd2..5e1fa81d4 100644 --- a/packages/connect/package.json +++ b/packages/connect/package.json @@ -1,6 +1,6 @@ { "name": "@0xproject/connect", - "version": "2.0.3", + "version": "2.0.4", "engines": { "node": ">=6.12" }, @@ -43,12 +43,12 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/connect/README.md", "dependencies": { - "@0xproject/assert": "^1.0.10", - "@0xproject/json-schemas": "^1.0.3", - "@0xproject/order-utils": "^1.0.4", - "@0xproject/types": "^1.1.0", - "@0xproject/typescript-typings": "^2.0.1", - "@0xproject/utils": "^1.0.10", + "@0xproject/assert": "^1.0.11", + "@0xproject/json-schemas": "^1.0.4", + "@0xproject/order-utils": "^1.0.5", + "@0xproject/types": "^1.1.1", + "@0xproject/typescript-typings": "^2.0.2", + "@0xproject/utils": "^1.0.11", "lodash": "^4.17.5", "query-string": "^5.0.1", "sinon": "^4.0.0", -- cgit v1.2.3 From e5e439adb9d1ff4395c0ff42ac3a310783b3bd22 Mon Sep 17 00:00:00 2001 From: fragosti Date: Wed, 26 Sep 2018 14:01:51 +0200 Subject: Change /order_config endpoint to POST --- packages/connect/src/http_client.ts | 2 +- packages/connect/test/http_client_test.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/connect') diff --git a/packages/connect/src/http_client.ts b/packages/connect/src/http_client.ts index 8a68d6c23..bbd0d2042 100644 --- a/packages/connect/src/http_client.ts +++ b/packages/connect/src/http_client.ts @@ -149,7 +149,7 @@ export class HttpClient implements Client { params: requestOpts, payload: request, }; - const responseJson = await this._requestAsync('/order_config', HttpRequestType.Get, httpRequestOpts); + const responseJson = await this._requestAsync('/order_config', HttpRequestType.Post, httpRequestOpts); const fees = relayerResponseJsonParsers.parseOrderConfigResponseJson(responseJson); return fees; } diff --git a/packages/connect/test/http_client_test.ts b/packages/connect/test/http_client_test.ts index 83b77021a..e9fc9372e 100644 --- a/packages/connect/test/http_client_test.ts +++ b/packages/connect/test/http_client_test.ts @@ -148,12 +148,12 @@ describe('HttpClient', () => { }; const url = `${relayUrl}/order_config`; it('gets order config', async () => { - fetchMock.get(url, orderConfigResponseJSON); + fetchMock.post(url, orderConfigResponseJSON); const fees = await relayerClient.getOrderConfigAsync(request); expect(fees).to.be.deep.equal(orderConfigResponse); }); it('does not mutate input', async () => { - fetchMock.get(url, orderConfigResponseJSON); + fetchMock.post(url, orderConfigResponseJSON); const makerAssetAmountBefore = request.makerAssetAmount; const takerAssetAmountBefore = request.takerAssetAmount; const expirationTimeSecondsBefore = request.expirationTimeSeconds; @@ -163,7 +163,7 @@ describe('HttpClient', () => { expect(expirationTimeSecondsBefore).to.be.deep.equal(request.expirationTimeSeconds); }); it('throws an error for invalid JSON response', async () => { - fetchMock.get(url, { test: 'dummy' }); + fetchMock.post(url, { test: 'dummy' }); expect(relayerClient.getOrderConfigAsync(request)).to.be.rejected(); }); }); -- cgit v1.2.3 From f15751d800d813e97b72a861547a9caa1d0d5e56 Mon Sep 17 00:00:00 2001 From: fragosti Date: Wed, 26 Sep 2018 14:06:53 +0200 Subject: Add to changelog --- packages/connect/CHANGELOG.json | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'packages/connect') diff --git a/packages/connect/CHANGELOG.json b/packages/connect/CHANGELOG.json index 9de956d4d..4106be881 100644 --- a/packages/connect/CHANGELOG.json +++ b/packages/connect/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "3.0.0", + "changes": [ + { + "note": "Change /order_config request to a POST instead of GET", + "pr": 1091 + } + ] + }, { "timestamp": 1537907159, "version": "2.0.4", -- cgit v1.2.3