aboutsummaryrefslogtreecommitdiffstats
path: root/packages/connect/src/schemas
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-08-24 01:52:09 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-08-24 01:52:09 +0800
commit7ad1a18a4aaa3da23fc013c55babea286a505f9d (patch)
treeae0e8267091b45dcdf661ec8cd76ce7699a82364 /packages/connect/src/schemas
parent572ad4615a3a0fa5649549cbd65eb912ea7a0e92 (diff)
parentb013cf2e145825a9e250c61bc77825384b2af69e (diff)
downloaddexon-0x-contracts-7ad1a18a4aaa3da23fc013c55babea286a505f9d.tar.gz
dexon-0x-contracts-7ad1a18a4aaa3da23fc013c55babea286a505f9d.tar.zst
dexon-0x-contracts-7ad1a18a4aaa3da23fc013c55babea286a505f9d.zip
Merge branch 'development' into feature/forwarder-helper/init
* development: (31 commits) Update CI config to check development instead of v2-prototype branch fix: Make non-interactive npm login for publish tests more robust Run prettier Remove comment in updates json-schemas doc Add documentation for json-schemas Fix typo Remove artifacts Update variable names, make release candidate Update more names in docs Improve documentation Pin sra-report to 0xproject/connect v1.0.4 Run prettier lint everything Update websocket for SRA v2 Remove default query parameters Add networkId request param option Rename websocket files and types Use uuid as string for requestId Update changelogs Add fee recipients test ...
Diffstat (limited to 'packages/connect/src/schemas')
-rw-r--r--packages/connect/src/schemas/asset_pairs_request_opts_schema.ts8
-rw-r--r--packages/connect/src/schemas/fees_request_schema.ts26
-rw-r--r--packages/connect/src/schemas/order_config_request_schema.ts24
-rw-r--r--packages/connect/src/schemas/orderbook_request_schema.ts6
-rw-r--r--packages/connect/src/schemas/orders_request_opts_schema.ts23
-rw-r--r--packages/connect/src/schemas/request_opts_schema.ts7
-rw-r--r--packages/connect/src/schemas/schemas.ts10
-rw-r--r--packages/connect/src/schemas/token_pairs_request_opts_schema.ts8
8 files changed, 61 insertions, 51 deletions
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..a9e3942a4
--- /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: '/hexSchema' },
+ assetDataB: { $ref: '/hexSchema' },
+ },
+};
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 ff3d7b9d3..000000000
--- a/packages/connect/src/schemas/fees_request_schema.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-export const feesRequestSchema = {
- id: '/FeesRequest',
- type: 'object',
- properties: {
- exchangeContractAddress: { $ref: '/Address' },
- maker: { $ref: '/Address' },
- taker: { $ref: '/Address' },
- makerTokenAddress: { $ref: '/Address' },
- takerTokenAddress: { $ref: '/Address' },
- makerTokenAmount: { $ref: '/Number' },
- takerTokenAmount: { $ref: '/Number' },
- expirationUnixTimestampSec: { $ref: '/Number' },
- salt: { $ref: '/Number' },
- },
- required: [
- 'exchangeContractAddress',
- 'maker',
- 'taker',
- 'makerTokenAddress',
- 'takerTokenAddress',
- 'makerTokenAmount',
- 'takerTokenAmount',
- 'expirationUnixTimestampSec',
- '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..0eda430e8
--- /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 5f3463242..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: {
- baseTokenAddress: { $ref: '/Address' },
- quoteTokenAddress: { $ref: '/Address' },
+ baseAssetData: { $ref: '/hexSchema' },
+ quoteAssetData: { $ref: '/hexSchema' },
},
- 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..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: {
- exchangeContractAddress: { $ref: '/Address' },
- tokenAddress: { $ref: '/Address' },
- makerTokenAddress: { $ref: '/Address' },
- takerTokenAddress: { $ref: '/Address' },
- tokenA: { $ref: '/Address' },
- tokenB: { $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/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' },
+ },
+};
diff --git a/packages/connect/src/schemas/schemas.ts b/packages/connect/src/schemas/schemas.ts
index 0b8b798a9..8d101ed6f 100644
--- a/packages/connect/src/schemas/schemas.ts
+++ b/packages/connect/src/schemas/schemas.ts
@@ -1,13 +1,15 @@
-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 { tokenPairsRequestOptsSchema } from './token_pairs_request_opts_schema';
+import { requestOptsSchema } from './request_opts_schema';
export const schemas = {
- feesRequestSchema,
+ orderConfigRequestSchema,
orderBookRequestSchema,
ordersRequestOptsSchema,
pagedRequestOptsSchema,
- tokenPairsRequestOptsSchema,
+ requestOptsSchema,
+ 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 9b73a917b..000000000
--- a/packages/connect/src/schemas/token_pairs_request_opts_schema.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export const tokenPairsRequestOptsSchema = {
- id: '/TokenPairsRequestOpts',
- type: 'object',
- properties: {
- tokenA: { $ref: '/Address' },
- tokenB: { $ref: '/Address' },
- },
-};