aboutsummaryrefslogtreecommitdiffstats
path: root/packages/connect/src
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-08-16 08:18:19 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-08-16 08:18:19 +0800
commitc325d638c98a990f2d0e991f2e03287183ba292f (patch)
tree59a9ad610c8d58fe471807683e918feb73c171ec /packages/connect/src
parente7f19e350ed9374729e73320d569294e88fde236 (diff)
downloaddexon-sol-tools-c325d638c98a990f2d0e991f2e03287183ba292f.tar
dexon-sol-tools-c325d638c98a990f2d0e991f2e03287183ba292f.tar.gz
dexon-sol-tools-c325d638c98a990f2d0e991f2e03287183ba292f.tar.bz2
dexon-sol-tools-c325d638c98a990f2d0e991f2e03287183ba292f.tar.lz
dexon-sol-tools-c325d638c98a990f2d0e991f2e03287183ba292f.tar.xz
dexon-sol-tools-c325d638c98a990f2d0e991f2e03287183ba292f.tar.zst
dexon-sol-tools-c325d638c98a990f2d0e991f2e03287183ba292f.zip
getAssetPairsAsync tests passing
Diffstat (limited to 'packages/connect/src')
-rw-r--r--packages/connect/src/http_client.ts2
-rw-r--r--packages/connect/src/schemas/asset_pairs_request_opts_schema.ts4
-rw-r--r--packages/connect/src/utils/relayer_response_json_parsers.ts10
3 files changed, 8 insertions, 8 deletions
diff --git a/packages/connect/src/http_client.ts b/packages/connect/src/http_client.ts
index e8b82f0b2..35d7ee77e 100644
--- a/packages/connect/src/http_client.ts
+++ b/packages/connect/src/http_client.ts
@@ -70,7 +70,7 @@ export class HttpClient implements Client {
const httpRequestOpts = {
params: _.defaults({}, requestOpts, DEFAULT_PAGED_REQUEST_OPTS),
};
- const responseJson = await this._requestAsync('/assetData_pairs', HttpRequestType.Get, httpRequestOpts);
+ const responseJson = await this._requestAsync('/asset_pairs', HttpRequestType.Get, httpRequestOpts);
const assetDataPairs = relayerResponseJsonParsers.parseAssetDataPairsJson(responseJson);
return assetDataPairs;
}
diff --git a/packages/connect/src/schemas/asset_pairs_request_opts_schema.ts b/packages/connect/src/schemas/asset_pairs_request_opts_schema.ts
index f224503cc..a9e3942a4 100644
--- a/packages/connect/src/schemas/asset_pairs_request_opts_schema.ts
+++ b/packages/connect/src/schemas/asset_pairs_request_opts_schema.ts
@@ -2,7 +2,7 @@ export const assetPairsRequestOptsSchema = {
id: '/AssetPairsRequestOpts',
type: 'object',
properties: {
- assetDataA: { $ref: '/Address' },
- assetDataB: { $ref: '/Address' },
+ assetDataA: { $ref: '/hexSchema' },
+ assetDataB: { $ref: '/hexSchema' },
},
};
diff --git a/packages/connect/src/utils/relayer_response_json_parsers.ts b/packages/connect/src/utils/relayer_response_json_parsers.ts
index 9a17b23d3..37099384f 100644
--- a/packages/connect/src/utils/relayer_response_json_parsers.ts
+++ b/packages/connect/src/utils/relayer_response_json_parsers.ts
@@ -7,10 +7,10 @@ import { typeConverters } from './type_converters';
export const relayerResponseJsonParsers = {
parseAssetDataPairsJson(json: any): AssetPairsResponse {
- assert.doesConformToSchema('assetDataPairs', json, schemas.relayerApiAssetDataPairsResponseSchema);
- return { ...json, records: relayerResponseJsonParsers.parseAssetDataPairsJson(json.records) };
+ assert.doesConformToSchema('assetDataPairsResponse', json, schemas.relayerApiAssetDataPairsResponseSchema);
+ return { ...json, records: relayerResponseJsonParsers.parseAssetPairsItemsJson(json.records) };
},
- parseAssetPairsItemJson(json: any): AssetPairsItem[] {
+ parseAssetPairsItemsJson(json: any): AssetPairsItem[] {
return json.map((assetDataPair: any) => {
return typeConverters.convertStringsFieldsToBigNumbers(assetDataPair, [
'assetDataA.minAmount',
@@ -29,11 +29,11 @@ export const relayerResponseJsonParsers = {
return typeConverters.convertOrderStringFieldsToBigNumber(json);
},
parseOrderbookResponseJson(json: any): OrderbookResponse {
- assert.doesConformToSchema('orderBook', json, schemas.relayerApiOrderbookResponseSchema);
+ assert.doesConformToSchema('orderBookResponse', json, schemas.relayerApiOrderbookResponseSchema);
return typeConverters.convertOrderbookStringFieldsToBigNumber(json);
},
parseOrderConfigResponseJson(json: any): OrderConfigResponse {
- assert.doesConformToSchema('orderConfig', json, schemas.relayerApiOrderConfigResponseSchema);
+ assert.doesConformToSchema('orderConfigResponse', json, schemas.relayerApiOrderConfigResponseSchema);
return typeConverters.convertStringsFieldsToBigNumbers(json, ['makerFee', 'takerFee']);
},
};