diff options
author | Fabio Berger <me@fabioberger.com> | 2018-11-19 20:49:16 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-11-19 20:49:16 +0800 |
commit | 8175192f60e2c2827f6e7d664fbe8bf2d9ddee9c (patch) | |
tree | 587ce5e026674e5665ad164995aac69462290aed /packages/connect/src/http_client.ts | |
parent | 7d2c975d7335155b85a7549c25b953d0afacf5cf (diff) | |
parent | 94de441de744ed53470335122a38e265c3a71aff (diff) | |
download | dexon-0x-contracts-8175192f60e2c2827f6e7d664fbe8bf2d9ddee9c.tar.gz dexon-0x-contracts-8175192f60e2c2827f6e7d664fbe8bf2d9ddee9c.tar.zst dexon-0x-contracts-8175192f60e2c2827f6e7d664fbe8bf2d9ddee9c.zip |
Merge branch 'development'
* development: (957 commits)
fix(order_utils.py): publish docs to S3, not RTD (#1264)
fix: make instant package private
feat: refer to map file in postpublish configs
feat: add new bundle name to bundle watch
fix: tslint ignore rule in wrong place
Update blog post feature
Fix disclaimer on mobile
Add smart contract docs to Developer Home
Add Apache license link
Fix capitalization in title
Remove excess semi-colon
Point directly to README for docs link
Update icons
Update LICENSE
Fix disclaimer
Add blogpost URL
Add disclaimer
Add launch kit to Developer home list of tools
feat: Deploy contracts to Rinkeby
fix: fix exceeds block gas limit error
...
Diffstat (limited to 'packages/connect/src/http_client.ts')
-rw-r--r-- | packages/connect/src/http_client.ts | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/packages/connect/src/http_client.ts b/packages/connect/src/http_client.ts index bbd0d2042..c52425431 100644 --- a/packages/connect/src/http_client.ts +++ b/packages/connect/src/http_client.ts @@ -1,5 +1,5 @@ -import { assert } from '@0xproject/assert'; -import { schemas } from '@0xproject/json-schemas'; +import { assert } from '@0x/assert'; +import { schemas } from '@0x/json-schemas'; import { APIOrder, AssetPairsRequestOpts, @@ -14,12 +14,11 @@ import { PagedRequestOpts, RequestOpts, SignedOrder, -} from '@0xproject/types'; -import { fetchAsync } from '@0xproject/utils'; +} from '@0x/types'; +import { fetchAsync } from '@0x/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'; @@ -61,9 +60,9 @@ export class HttpClient implements Client { requestOpts?: RequestOpts & AssetPairsRequestOpts & PagedRequestOpts, ): Promise<AssetPairsResponse> { if (!_.isUndefined(requestOpts)) { - assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.assetPairsRequestOptsSchema); - assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.pagedRequestOptsSchema); - assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.requestOptsSchema); + assert.doesConformToSchema('requestOpts', requestOpts, schemas.assetPairsRequestOptsSchema); + assert.doesConformToSchema('requestOpts', requestOpts, schemas.pagedRequestOptsSchema); + assert.doesConformToSchema('requestOpts', requestOpts, schemas.requestOptsSchema); } const httpRequestOpts = { params: requestOpts, @@ -81,9 +80,9 @@ export class HttpClient implements Client { requestOpts?: RequestOpts & OrdersRequestOpts & PagedRequestOpts, ): Promise<OrdersResponse> { if (!_.isUndefined(requestOpts)) { - assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.ordersRequestOptsSchema); - assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.pagedRequestOptsSchema); - assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.requestOptsSchema); + assert.doesConformToSchema('requestOpts', requestOpts, schemas.ordersRequestOptsSchema); + assert.doesConformToSchema('requestOpts', requestOpts, schemas.pagedRequestOptsSchema); + assert.doesConformToSchema('requestOpts', requestOpts, schemas.requestOptsSchema); } const httpRequestOpts = { params: requestOpts, @@ -99,7 +98,7 @@ export class HttpClient implements Client { */ public async getOrderAsync(orderHash: string, requestOpts?: RequestOpts): Promise<APIOrder> { if (!_.isUndefined(requestOpts)) { - assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.requestOptsSchema); + assert.doesConformToSchema('requestOpts', requestOpts, schemas.requestOptsSchema); } assert.doesConformToSchema('orderHash', orderHash, schemas.orderHashSchema); const httpRequestOpts = { @@ -119,10 +118,10 @@ export class HttpClient implements Client { request: OrderbookRequest, requestOpts?: RequestOpts & PagedRequestOpts, ): Promise<OrderbookResponse> { - assert.doesConformToSchema('request', request, clientSchemas.orderBookRequestSchema); + assert.doesConformToSchema('request', request, schemas.orderBookRequestSchema); if (!_.isUndefined(requestOpts)) { - assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.pagedRequestOptsSchema); - assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.requestOptsSchema); + assert.doesConformToSchema('requestOpts', requestOpts, schemas.pagedRequestOptsSchema); + assert.doesConformToSchema('requestOpts', requestOpts, schemas.requestOptsSchema); } const httpRequestOpts = { params: _.defaults({}, request, requestOpts), @@ -142,9 +141,9 @@ export class HttpClient implements Client { requestOpts?: RequestOpts, ): Promise<OrderConfigResponse> { if (!_.isUndefined(requestOpts)) { - assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.requestOptsSchema); + assert.doesConformToSchema('requestOpts', requestOpts, schemas.requestOptsSchema); } - assert.doesConformToSchema('request', request, clientSchemas.orderConfigRequestSchema); + assert.doesConformToSchema('request', request, schemas.orderConfigRequestSchema); const httpRequestOpts = { params: requestOpts, payload: request, @@ -160,8 +159,8 @@ export class HttpClient implements Client { */ public async getFeeRecipientsAsync(requestOpts?: RequestOpts & PagedRequestOpts): Promise<FeeRecipientsResponse> { if (!_.isUndefined(requestOpts)) { - assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.pagedRequestOptsSchema); - assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.requestOptsSchema); + assert.doesConformToSchema('requestOpts', requestOpts, schemas.pagedRequestOptsSchema); + assert.doesConformToSchema('requestOpts', requestOpts, schemas.requestOptsSchema); } const httpRequestOpts = { params: requestOpts, |