From c1cc92a46f9ebfa4408a5dc515f1e100fe3a7054 Mon Sep 17 00:00:00 2001 From: fragosti Date: Tue, 14 Aug 2018 14:00:16 -0700 Subject: Change names of basic types in Client interface --- packages/connect/src/schemas/schemas.ts | 4 ++-- packages/connect/src/schemas/token_pairs_request_opts_schema.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/connect/src/schemas') diff --git a/packages/connect/src/schemas/schemas.ts b/packages/connect/src/schemas/schemas.ts index 0b8b798a9..e6ca010ae 100644 --- a/packages/connect/src/schemas/schemas.ts +++ b/packages/connect/src/schemas/schemas.ts @@ -2,12 +2,12 @@ import { feesRequestSchema } from './fees_request_schema'; import { orderBookRequestSchema } from './orderbook_request_schema'; import { ordersRequestOptsSchema } from './orders_request_opts_schema'; import { pagedRequestOptsSchema } from './paged_request_opts_schema'; -import { tokenPairsRequestOptsSchema } from './token_pairs_request_opts_schema'; +import { AssetPairsRequestOptsSchema } from './token_pairs_request_opts_schema'; export const schemas = { feesRequestSchema, orderBookRequestSchema, ordersRequestOptsSchema, pagedRequestOptsSchema, - tokenPairsRequestOptsSchema, + AssetPairsRequestOptsSchema, }; diff --git a/packages/connect/src/schemas/token_pairs_request_opts_schema.ts b/packages/connect/src/schemas/token_pairs_request_opts_schema.ts index 9b73a917b..dffd063d0 100644 --- a/packages/connect/src/schemas/token_pairs_request_opts_schema.ts +++ b/packages/connect/src/schemas/token_pairs_request_opts_schema.ts @@ -1,5 +1,5 @@ -export const tokenPairsRequestOptsSchema = { - id: '/TokenPairsRequestOpts', +export const AssetPairsRequestOptsSchema = { + id: '/AssetPairsRequestOpts', type: 'object', properties: { tokenA: { $ref: '/Address' }, -- cgit v1.2.3 From ce88086e080e05ed71c1ef4e31f2d0ce530af67f Mon Sep 17 00:00:00 2001 From: fragosti Date: Tue, 14 Aug 2018 14:40:52 -0700 Subject: Update types to reflect v2 --- packages/connect/src/schemas/fees_request_schema.ts | 18 +++++++++--------- .../connect/src/schemas/orderbook_request_schema.ts | 6 +++--- .../connect/src/schemas/orders_request_opts_schema.ts | 6 +++--- .../src/schemas/token_pairs_request_opts_schema.ts | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) (limited to 'packages/connect/src/schemas') diff --git a/packages/connect/src/schemas/fees_request_schema.ts b/packages/connect/src/schemas/fees_request_schema.ts index ff3d7b9d3..e41e49e09 100644 --- a/packages/connect/src/schemas/fees_request_schema.ts +++ b/packages/connect/src/schemas/fees_request_schema.ts @@ -1,26 +1,26 @@ export const feesRequestSchema = { - id: '/FeesRequest', + id: '/OrderConfigRequest', type: 'object', properties: { - exchangeContractAddress: { $ref: '/Address' }, + exchangeAddress: { $ref: '/Address' }, maker: { $ref: '/Address' }, taker: { $ref: '/Address' }, makerTokenAddress: { $ref: '/Address' }, takerTokenAddress: { $ref: '/Address' }, - makerTokenAmount: { $ref: '/Number' }, - takerTokenAmount: { $ref: '/Number' }, - expirationUnixTimestampSec: { $ref: '/Number' }, + makerAssetAmount: { $ref: '/Number' }, + takerAssetAmount: { $ref: '/Number' }, + expirationTimeSeconds: { $ref: '/Number' }, salt: { $ref: '/Number' }, }, required: [ - 'exchangeContractAddress', + 'exchangeAddress', 'maker', 'taker', 'makerTokenAddress', 'takerTokenAddress', - 'makerTokenAmount', - 'takerTokenAmount', - 'expirationUnixTimestampSec', + 'makerAssetAmount', + 'takerAssetAmount', + 'expirationTimeSeconds', 'salt', ], }; diff --git a/packages/connect/src/schemas/orderbook_request_schema.ts b/packages/connect/src/schemas/orderbook_request_schema.ts index 5f3463242..cc75ada5c 100644 --- a/packages/connect/src/schemas/orderbook_request_schema.ts +++ b/packages/connect/src/schemas/orderbook_request_schema.ts @@ -2,8 +2,8 @@ export const orderBookRequestSchema = { id: '/OrderBookRequest', type: 'object', properties: { - baseTokenAddress: { $ref: '/Address' }, - quoteTokenAddress: { $ref: '/Address' }, + baseAssetData: { $ref: '/Address' }, + quoteAssetData: { $ref: '/Address' }, }, - required: ['baseTokenAddress', 'quoteTokenAddress'], + required: ['baseAssetData', 'quoteAssetData'], }; diff --git a/packages/connect/src/schemas/orders_request_opts_schema.ts b/packages/connect/src/schemas/orders_request_opts_schema.ts index 5facbc959..1a9f74f7f 100644 --- a/packages/connect/src/schemas/orders_request_opts_schema.ts +++ b/packages/connect/src/schemas/orders_request_opts_schema.ts @@ -2,12 +2,12 @@ export const ordersRequestOptsSchema = { id: '/OrdersRequestOpts', type: 'object', properties: { - exchangeContractAddress: { $ref: '/Address' }, + exchangeAddress: { $ref: '/Address' }, tokenAddress: { $ref: '/Address' }, makerTokenAddress: { $ref: '/Address' }, takerTokenAddress: { $ref: '/Address' }, - tokenA: { $ref: '/Address' }, - tokenB: { $ref: '/Address' }, + assetDataA: { $ref: '/Address' }, + assetDataB: { $ref: '/Address' }, maker: { $ref: '/Address' }, taker: { $ref: '/Address' }, trader: { $ref: '/Address' }, diff --git a/packages/connect/src/schemas/token_pairs_request_opts_schema.ts b/packages/connect/src/schemas/token_pairs_request_opts_schema.ts index dffd063d0..bf1caa20d 100644 --- a/packages/connect/src/schemas/token_pairs_request_opts_schema.ts +++ b/packages/connect/src/schemas/token_pairs_request_opts_schema.ts @@ -2,7 +2,7 @@ export const AssetPairsRequestOptsSchema = { id: '/AssetPairsRequestOpts', type: 'object', properties: { - tokenA: { $ref: '/Address' }, - tokenB: { $ref: '/Address' }, + assetDataA: { $ref: '/Address' }, + assetDataB: { $ref: '/Address' }, }, }; -- cgit v1.2.3 From 3eeb9ddfa6440d9287c0b2e6c6c51847cedf8b96 Mon Sep 17 00:00:00 2001 From: fragosti Date: Tue, 14 Aug 2018 17:31:19 -0700 Subject: Update connect json-schemas --- .../src/schemas/asset_pairs_request_opts_schema.ts | 8 +++++++ .../connect/src/schemas/fees_request_schema.ts | 26 ---------------------- .../src/schemas/order_config_request_schema.ts | 24 ++++++++++++++++++++ .../src/schemas/orderbook_request_schema.ts | 4 ++-- .../src/schemas/orders_request_opts_schema.ts | 23 ++++++++++--------- packages/connect/src/schemas/schemas.ts | 8 +++---- .../src/schemas/token_pairs_request_opts_schema.ts | 8 ------- 7 files changed, 51 insertions(+), 50 deletions(-) create mode 100644 packages/connect/src/schemas/asset_pairs_request_opts_schema.ts delete mode 100644 packages/connect/src/schemas/fees_request_schema.ts create mode 100644 packages/connect/src/schemas/order_config_request_schema.ts delete mode 100644 packages/connect/src/schemas/token_pairs_request_opts_schema.ts (limited to 'packages/connect/src/schemas') diff --git a/packages/connect/src/schemas/asset_pairs_request_opts_schema.ts b/packages/connect/src/schemas/asset_pairs_request_opts_schema.ts new file mode 100644 index 000000000..f224503cc --- /dev/null +++ b/packages/connect/src/schemas/asset_pairs_request_opts_schema.ts @@ -0,0 +1,8 @@ +export const assetPairsRequestOptsSchema = { + id: '/AssetPairsRequestOpts', + type: 'object', + properties: { + assetDataA: { $ref: '/Address' }, + assetDataB: { $ref: '/Address' }, + }, +}; diff --git a/packages/connect/src/schemas/fees_request_schema.ts b/packages/connect/src/schemas/fees_request_schema.ts deleted file mode 100644 index e41e49e09..000000000 --- a/packages/connect/src/schemas/fees_request_schema.ts +++ /dev/null @@ -1,26 +0,0 @@ -export const feesRequestSchema = { - id: '/OrderConfigRequest', - type: 'object', - properties: { - exchangeAddress: { $ref: '/Address' }, - maker: { $ref: '/Address' }, - taker: { $ref: '/Address' }, - makerTokenAddress: { $ref: '/Address' }, - takerTokenAddress: { $ref: '/Address' }, - makerAssetAmount: { $ref: '/Number' }, - takerAssetAmount: { $ref: '/Number' }, - expirationTimeSeconds: { $ref: '/Number' }, - salt: { $ref: '/Number' }, - }, - required: [ - 'exchangeAddress', - 'maker', - 'taker', - 'makerTokenAddress', - 'takerTokenAddress', - 'makerAssetAmount', - 'takerAssetAmount', - 'expirationTimeSeconds', - 'salt', - ], -}; diff --git a/packages/connect/src/schemas/order_config_request_schema.ts b/packages/connect/src/schemas/order_config_request_schema.ts new file mode 100644 index 000000000..8f6b19500 --- /dev/null +++ b/packages/connect/src/schemas/order_config_request_schema.ts @@ -0,0 +1,24 @@ +export const orderConfigRequestSchema = { + id: '/OrderConfigRequest', + type: 'object', + properties: { + makerAddress: { $ref: '/addressSchema' }, + takerAddress: { $ref: '/addressSchema' }, + makerAssetAmount: { $ref: '/numberSchema' }, + takerAssetAmount: { $ref: '/numberSchema' }, + makerAssetData: { $ref: '/hexSchema'}, + takerAssetData: { $ref: '/hexSchema' }, + exchangeAddress: { $ref: '/addressSchema' }, + expirationTimeSeconds: { $ref: '/numberSchema' }, + }, + required: [ + 'makerAddress', + 'takerAddress', + 'makerAssetAmount', + 'takerAssetAmount', + 'makerAssetData', + 'takerAssetData', + 'exchangeAddress', + 'expirationTimeSeconds', + ], +}; diff --git a/packages/connect/src/schemas/orderbook_request_schema.ts b/packages/connect/src/schemas/orderbook_request_schema.ts index cc75ada5c..0c9389d50 100644 --- a/packages/connect/src/schemas/orderbook_request_schema.ts +++ b/packages/connect/src/schemas/orderbook_request_schema.ts @@ -2,8 +2,8 @@ export const orderBookRequestSchema = { id: '/OrderBookRequest', type: 'object', properties: { - baseAssetData: { $ref: '/Address' }, - quoteAssetData: { $ref: '/Address' }, + baseAssetData: { $ref: '/hexSchema' }, + quoteAssetData: { $ref: '/hexSchema' }, }, required: ['baseAssetData', 'quoteAssetData'], }; diff --git a/packages/connect/src/schemas/orders_request_opts_schema.ts b/packages/connect/src/schemas/orders_request_opts_schema.ts index 1a9f74f7f..71ce3d06f 100644 --- a/packages/connect/src/schemas/orders_request_opts_schema.ts +++ b/packages/connect/src/schemas/orders_request_opts_schema.ts @@ -2,15 +2,18 @@ export const ordersRequestOptsSchema = { id: '/OrdersRequestOpts', type: 'object', properties: { - exchangeAddress: { $ref: '/Address' }, - tokenAddress: { $ref: '/Address' }, - makerTokenAddress: { $ref: '/Address' }, - takerTokenAddress: { $ref: '/Address' }, - assetDataA: { $ref: '/Address' }, - assetDataB: { $ref: '/Address' }, - maker: { $ref: '/Address' }, - taker: { $ref: '/Address' }, - trader: { $ref: '/Address' }, - feeRecipient: { $ref: '/Address' }, + makerAssetProxyId: { $ref: '/hexSchema' }, + takerAssetProxyId: { $ref: '/hexSchema' }, + makerAssetAddress: { $ref: '/addressSchema' }, + takerAssetAddress: { $ref: '/addressSchema' }, + exchangeAddress: { $ref: '/addressSchema' }, + senderAddress: { $ref: '/addressSchema' }, + makerAssetData: { $ref: '/hexSchema' }, + takerAssetData: { $ref: '/hexSchema' }, + traderAssetData: { $ref: '/hexSchema' }, + makerAddress: { $ref: '/addressSchema' }, + takerAddress: { $ref: '/addressSchema' }, + traderAddress: { $ref: '/addressSchema' }, + feeRecipientAddress: { $ref: '/addressSchema' }, }, }; diff --git a/packages/connect/src/schemas/schemas.ts b/packages/connect/src/schemas/schemas.ts index e6ca010ae..a7e968a01 100644 --- a/packages/connect/src/schemas/schemas.ts +++ b/packages/connect/src/schemas/schemas.ts @@ -1,13 +1,13 @@ -import { feesRequestSchema } from './fees_request_schema'; +import { assetPairsRequestOptsSchema } from './asset_pairs_request_opts_schema'; +import { orderConfigRequestSchema } from './order_config_request_schema'; import { orderBookRequestSchema } from './orderbook_request_schema'; import { ordersRequestOptsSchema } from './orders_request_opts_schema'; import { pagedRequestOptsSchema } from './paged_request_opts_schema'; -import { AssetPairsRequestOptsSchema } from './token_pairs_request_opts_schema'; export const schemas = { - feesRequestSchema, + orderConfigRequestSchema, orderBookRequestSchema, ordersRequestOptsSchema, pagedRequestOptsSchema, - AssetPairsRequestOptsSchema, + assetPairsRequestOptsSchema, }; diff --git a/packages/connect/src/schemas/token_pairs_request_opts_schema.ts b/packages/connect/src/schemas/token_pairs_request_opts_schema.ts deleted file mode 100644 index bf1caa20d..000000000 --- a/packages/connect/src/schemas/token_pairs_request_opts_schema.ts +++ /dev/null @@ -1,8 +0,0 @@ -export const AssetPairsRequestOptsSchema = { - id: '/AssetPairsRequestOpts', - type: 'object', - properties: { - assetDataA: { $ref: '/Address' }, - assetDataB: { $ref: '/Address' }, - }, -}; -- cgit v1.2.3 From c325d638c98a990f2d0e991f2e03287183ba292f Mon Sep 17 00:00:00 2001 From: fragosti Date: Wed, 15 Aug 2018 17:18:19 -0700 Subject: getAssetPairsAsync tests passing --- packages/connect/src/schemas/asset_pairs_request_opts_schema.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/connect/src/schemas') 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' }, }, }; -- cgit v1.2.3 From 48ec78d3aaa5dcef8544d17f26ef8ea8b31661e5 Mon Sep 17 00:00:00 2001 From: fragosti Date: Fri, 17 Aug 2018 10:43:44 -0700 Subject: Add networkId request param option --- packages/connect/src/schemas/schemas.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'packages/connect/src/schemas') diff --git a/packages/connect/src/schemas/schemas.ts b/packages/connect/src/schemas/schemas.ts index a7e968a01..8d101ed6f 100644 --- a/packages/connect/src/schemas/schemas.ts +++ b/packages/connect/src/schemas/schemas.ts @@ -3,11 +3,13 @@ import { orderConfigRequestSchema } from './order_config_request_schema'; import { orderBookRequestSchema } from './orderbook_request_schema'; import { ordersRequestOptsSchema } from './orders_request_opts_schema'; import { pagedRequestOptsSchema } from './paged_request_opts_schema'; +import { requestOptsSchema } from './request_opts_schema'; export const schemas = { orderConfigRequestSchema, orderBookRequestSchema, ordersRequestOptsSchema, pagedRequestOptsSchema, + requestOptsSchema, assetPairsRequestOptsSchema, }; -- cgit v1.2.3 From f2d1d953553adfa59f0a39bf2cf98817fae0a4ff Mon Sep 17 00:00:00 2001 From: fragosti Date: Fri, 17 Aug 2018 13:58:55 -0700 Subject: Remove default query parameters --- packages/connect/src/schemas/request_opts_schema.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 packages/connect/src/schemas/request_opts_schema.ts (limited to 'packages/connect/src/schemas') diff --git a/packages/connect/src/schemas/request_opts_schema.ts b/packages/connect/src/schemas/request_opts_schema.ts new file mode 100644 index 000000000..a51e98069 --- /dev/null +++ b/packages/connect/src/schemas/request_opts_schema.ts @@ -0,0 +1,7 @@ +export const requestOptsSchema = { + id: '/RequestOpts', + type: 'object', + properties: { + networkId: { type: 'number' }, + }, +}; -- cgit v1.2.3 From 44cc5e45cc3a3ed7db2691a287500e5d61a2d0c1 Mon Sep 17 00:00:00 2001 From: fragosti Date: Mon, 20 Aug 2018 11:53:49 -0700 Subject: Run prettier --- packages/connect/src/schemas/order_config_request_schema.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/connect/src/schemas') diff --git a/packages/connect/src/schemas/order_config_request_schema.ts b/packages/connect/src/schemas/order_config_request_schema.ts index 8f6b19500..0eda430e8 100644 --- a/packages/connect/src/schemas/order_config_request_schema.ts +++ b/packages/connect/src/schemas/order_config_request_schema.ts @@ -6,7 +6,7 @@ export const orderConfigRequestSchema = { takerAddress: { $ref: '/addressSchema' }, makerAssetAmount: { $ref: '/numberSchema' }, takerAssetAmount: { $ref: '/numberSchema' }, - makerAssetData: { $ref: '/hexSchema'}, + makerAssetData: { $ref: '/hexSchema' }, takerAssetData: { $ref: '/hexSchema' }, exchangeAddress: { $ref: '/addressSchema' }, expirationTimeSeconds: { $ref: '/numberSchema' }, -- cgit v1.2.3