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') 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