aboutsummaryrefslogtreecommitdiffstats
path: root/packages/json-schemas/schemas
diff options
context:
space:
mode:
Diffstat (limited to 'packages/json-schemas/schemas')
-rw-r--r--packages/json-schemas/schemas/basic_type_schemas.ts8
-rw-r--r--packages/json-schemas/schemas/block_range_schema.ts8
-rw-r--r--packages/json-schemas/schemas/call_data_schema.ts12
-rw-r--r--packages/json-schemas/schemas/ec_signature_schema.ts6
-rw-r--r--packages/json-schemas/schemas/index_filter_values_schema.ts4
-rw-r--r--packages/json-schemas/schemas/order_cancel_schema.ts6
-rw-r--r--packages/json-schemas/schemas/order_fill_or_kill_requests_schema.ts6
-rw-r--r--packages/json-schemas/schemas/order_fill_requests_schema.ts6
-rw-r--r--packages/json-schemas/schemas/order_hash_schema.ts2
-rw-r--r--packages/json-schemas/schemas/order_schemas.ts34
-rw-r--r--packages/json-schemas/schemas/orders_schema.ts2
-rw-r--r--packages/json-schemas/schemas/paginated_collection_schema.ts10
-rw-r--r--packages/json-schemas/schemas/relayer_api_asset_pairs_response_schema.ts38
-rw-r--r--packages/json-schemas/schemas/relayer_api_error_response_schema.ts6
-rw-r--r--packages/json-schemas/schemas/relayer_api_fee_recipients_response_schema.ts13
-rw-r--r--packages/json-schemas/schemas/relayer_api_fees_payload_schema.ts24
-rw-r--r--packages/json-schemas/schemas/relayer_api_fees_response_schema.ts10
-rw-r--r--packages/json-schemas/schemas/relayer_api_orberbook_channel_subscribe_schema.ts23
-rw-r--r--packages/json-schemas/schemas/relayer_api_order_config_payload_schema.ts24
-rw-r--r--packages/json-schemas/schemas/relayer_api_order_config_response_schema.ts11
-rw-r--r--packages/json-schemas/schemas/relayer_api_order_schema.ts9
-rw-r--r--packages/json-schemas/schemas/relayer_api_orderbook_channel_snapshot_schema.ts21
-rw-r--r--packages/json-schemas/schemas/relayer_api_orderbook_channel_update_response_schema.ts11
-rw-r--r--packages/json-schemas/schemas/relayer_api_orderbook_response_schema.ts8
-rw-r--r--packages/json-schemas/schemas/relayer_api_orders_channel_subscribe_schema.ts26
-rw-r--r--packages/json-schemas/schemas/relayer_api_orders_channel_update_response_schema.ts11
-rw-r--r--packages/json-schemas/schemas/relayer_api_orders_response_schema.ts13
-rw-r--r--packages/json-schemas/schemas/relayer_api_orders_schema.ts5
-rw-r--r--packages/json-schemas/schemas/relayer_api_token_pairs_response_schema.ts24
-rw-r--r--packages/json-schemas/schemas/signed_orders_schema.ts2
-rw-r--r--packages/json-schemas/schemas/token_schema.ts4
-rw-r--r--packages/json-schemas/schemas/tx_data_schema.ts15
32 files changed, 224 insertions, 178 deletions
diff --git a/packages/json-schemas/schemas/basic_type_schemas.ts b/packages/json-schemas/schemas/basic_type_schemas.ts
index 7565df9e0..a59afaef8 100644
--- a/packages/json-schemas/schemas/basic_type_schemas.ts
+++ b/packages/json-schemas/schemas/basic_type_schemas.ts
@@ -1,17 +1,17 @@
export const addressSchema = {
- id: '/Address',
+ id: '/addressSchema',
type: 'string',
pattern: '^0x[0-9a-f]{40}$',
};
export const hexSchema = {
- id: '/Hex',
+ id: '/hexSchema',
type: 'string',
- pattern: '^0x([0-9a-f][0-9a-f])+$',
+ pattern: '^0x(([0-9a-f][0-9a-f])+)?$',
};
export const numberSchema = {
- id: '/Number',
+ id: '/numberSchema',
type: 'string',
pattern: '^\\d+(\\.\\d+)?$',
};
diff --git a/packages/json-schemas/schemas/block_range_schema.ts b/packages/json-schemas/schemas/block_range_schema.ts
index 1f6a63151..9eb242fc6 100644
--- a/packages/json-schemas/schemas/block_range_schema.ts
+++ b/packages/json-schemas/schemas/block_range_schema.ts
@@ -1,5 +1,5 @@
export const blockParamSchema = {
- id: '/BlockParam',
+ id: '/blockParamSchema',
oneOf: [
{
type: 'number',
@@ -11,10 +11,10 @@ export const blockParamSchema = {
};
export const blockRangeSchema = {
- id: '/BlockRange',
+ id: '/blockRangeSchema',
properties: {
- fromBlock: { $ref: '/BlockParam' },
- toBlock: { $ref: '/BlockParam' },
+ fromBlock: { $ref: '/blockParamSchema' },
+ toBlock: { $ref: '/blockParamSchema' },
},
type: 'object',
};
diff --git a/packages/json-schemas/schemas/call_data_schema.ts b/packages/json-schemas/schemas/call_data_schema.ts
index b9d00ad2a..4c77d9f9d 100644
--- a/packages/json-schemas/schemas/call_data_schema.ts
+++ b/packages/json-schemas/schemas/call_data_schema.ts
@@ -1,16 +1,16 @@
export const callDataSchema = {
- id: '/CallData',
+ id: '/callDataSchema',
properties: {
- from: { $ref: '/Address' },
- to: { $ref: '/Address' },
+ from: { $ref: '/addressSchema' },
+ to: { $ref: '/addressSchema' },
value: {
- oneOf: [{ $ref: '/Number' }, { $ref: '/JsNumber' }],
+ oneOf: [{ $ref: '/numberSchema' }, { $ref: '/jsNumber' }],
},
gas: {
- oneOf: [{ $ref: '/Number' }, { $ref: '/JsNumber' }],
+ oneOf: [{ $ref: '/numberSchema' }, { $ref: '/jsNumber' }],
},
gasPrice: {
- oneOf: [{ $ref: '/Number' }, { $ref: '/JsNumber' }],
+ oneOf: [{ $ref: '/numberSchema' }, { $ref: '/jsNumber' }],
},
data: {
type: 'string',
diff --git a/packages/json-schemas/schemas/ec_signature_schema.ts b/packages/json-schemas/schemas/ec_signature_schema.ts
index 71b840dd8..c59532f09 100644
--- a/packages/json-schemas/schemas/ec_signature_schema.ts
+++ b/packages/json-schemas/schemas/ec_signature_schema.ts
@@ -1,5 +1,5 @@
export const ecSignatureParameterSchema = {
- id: '/ECSignatureParameter',
+ id: '/ecSignatureParameterSchema',
type: 'string',
pattern: '^0[xX][0-9A-Fa-f]{64}$',
};
@@ -12,8 +12,8 @@ export const ecSignatureSchema = {
minimum: 27,
maximum: 28,
},
- r: { $ref: '/ECSignatureParameter' },
- s: { $ref: '/ECSignatureParameter' },
+ r: { $ref: '/ecSignatureParameterSchema' },
+ s: { $ref: '/ecSignatureParameterSchema' },
},
required: ['v', 'r', 's'],
type: 'object',
diff --git a/packages/json-schemas/schemas/index_filter_values_schema.ts b/packages/json-schemas/schemas/index_filter_values_schema.ts
index 3374d63e0..f3c8cef68 100644
--- a/packages/json-schemas/schemas/index_filter_values_schema.ts
+++ b/packages/json-schemas/schemas/index_filter_values_schema.ts
@@ -1,7 +1,7 @@
export const indexFilterValuesSchema = {
- id: '/IndexFilterValues',
+ id: '/indexFilterValuesSchema',
additionalProperties: {
- oneOf: [{ $ref: '/Number' }, { $ref: '/Address' }, { $ref: '/OrderHashSchema' }],
+ oneOf: [{ $ref: '/numberSchema' }, { $ref: '/addressSchema' }, { $ref: '/orderHashSchema' }],
},
type: 'object',
};
diff --git a/packages/json-schemas/schemas/order_cancel_schema.ts b/packages/json-schemas/schemas/order_cancel_schema.ts
index ad23d01cc..e4edfbca9 100644
--- a/packages/json-schemas/schemas/order_cancel_schema.ts
+++ b/packages/json-schemas/schemas/order_cancel_schema.ts
@@ -1,10 +1,10 @@
export const orderCancellationRequestsSchema = {
- id: '/OrderCancellationRequests',
+ id: '/orderCancellationRequestsSchema',
type: 'array',
items: {
properties: {
- order: { $ref: '/Order' },
- takerTokenCancelAmount: { $ref: '/Number' },
+ order: { $ref: '/orderSchema' },
+ takerTokenCancelAmount: { $ref: '/numberSchema' },
},
required: ['order', 'takerTokenCancelAmount'],
type: 'object',
diff --git a/packages/json-schemas/schemas/order_fill_or_kill_requests_schema.ts b/packages/json-schemas/schemas/order_fill_or_kill_requests_schema.ts
index 61f2c8849..e2c18ef0a 100644
--- a/packages/json-schemas/schemas/order_fill_or_kill_requests_schema.ts
+++ b/packages/json-schemas/schemas/order_fill_or_kill_requests_schema.ts
@@ -1,10 +1,10 @@
export const orderFillOrKillRequestsSchema = {
- id: '/OrderFillOrKillRequests',
+ id: '/orderFillOrKillRequestsSchema',
type: 'array',
items: {
properties: {
- signedOrder: { $ref: '/SignedOrder' },
- fillTakerAmount: { $ref: '/Number' },
+ signedOrder: { $ref: '/signedOrderSchema' },
+ fillTakerAmount: { $ref: '/numberSchema' },
},
required: ['signedOrder', 'fillTakerAmount'],
type: 'object',
diff --git a/packages/json-schemas/schemas/order_fill_requests_schema.ts b/packages/json-schemas/schemas/order_fill_requests_schema.ts
index 419d0670f..ea8b35e54 100644
--- a/packages/json-schemas/schemas/order_fill_requests_schema.ts
+++ b/packages/json-schemas/schemas/order_fill_requests_schema.ts
@@ -1,10 +1,10 @@
export const orderFillRequestsSchema = {
- id: '/OrderFillRequests',
+ id: '/orderFillRequestsSchema',
type: 'array',
items: {
properties: {
- signedOrder: { $ref: '/SignedOrder' },
- takerTokenFillAmount: { $ref: '/Number' },
+ signedOrder: { $ref: '/signedOrderSchema' },
+ takerTokenFillAmount: { $ref: '/numberSchema' },
},
required: ['signedOrder', 'takerTokenFillAmount'],
type: 'object',
diff --git a/packages/json-schemas/schemas/order_hash_schema.ts b/packages/json-schemas/schemas/order_hash_schema.ts
index 6af06927f..9773a88f9 100644
--- a/packages/json-schemas/schemas/order_hash_schema.ts
+++ b/packages/json-schemas/schemas/order_hash_schema.ts
@@ -1,5 +1,5 @@
export const orderHashSchema = {
- id: '/OrderHashSchema',
+ id: '/orderHashSchema',
type: 'string',
pattern: '^0x[0-9a-fA-F]{64}$',
};
diff --git a/packages/json-schemas/schemas/order_schemas.ts b/packages/json-schemas/schemas/order_schemas.ts
index dcbfde6e0..eb7fdaf5a 100644
--- a/packages/json-schemas/schemas/order_schemas.ts
+++ b/packages/json-schemas/schemas/order_schemas.ts
@@ -1,19 +1,19 @@
export const orderSchema = {
- id: '/Order',
+ id: '/orderSchema',
properties: {
- makerAddress: { $ref: '/Address' },
- takerAddress: { $ref: '/Address' },
- makerFee: { $ref: '/Number' },
- takerFee: { $ref: '/Number' },
- senderAddress: { $ref: '/Address' },
- makerAssetAmount: { $ref: '/Number' },
- takerAssetAmount: { $ref: '/Number' },
- makerAssetData: { $ref: '/Hex' },
- takerAssetData: { $ref: '/Hex' },
- salt: { $ref: '/Number' },
- exchangeAddress: { $ref: '/Address' },
- feeRecipientAddress: { $ref: '/Address' },
- expirationTimeSeconds: { $ref: '/Number' },
+ makerAddress: { $ref: '/addressSchema' },
+ takerAddress: { $ref: '/addressSchema' },
+ makerFee: { $ref: '/numberSchema' },
+ takerFee: { $ref: '/numberSchema' },
+ senderAddress: { $ref: '/addressSchema' },
+ makerAssetAmount: { $ref: '/numberSchema' },
+ takerAssetAmount: { $ref: '/numberSchema' },
+ makerAssetData: { $ref: '/hexSchema' },
+ takerAssetData: { $ref: '/hexSchema' },
+ salt: { $ref: '/numberSchema' },
+ exchangeAddress: { $ref: '/addressSchema' },
+ feeRecipientAddress: { $ref: '/addressSchema' },
+ expirationTimeSeconds: { $ref: '/numberSchema' },
},
required: [
'makerAddress',
@@ -34,12 +34,12 @@ export const orderSchema = {
};
export const signedOrderSchema = {
- id: '/SignedOrder',
+ id: '/signedOrderSchema',
allOf: [
- { $ref: '/Order' },
+ { $ref: '/orderSchema' },
{
properties: {
- signature: { $ref: '/Hex' },
+ signature: { $ref: '/hexSchema' },
},
required: ['signature'],
},
diff --git a/packages/json-schemas/schemas/orders_schema.ts b/packages/json-schemas/schemas/orders_schema.ts
index 3ba3291a2..de0abcf00 100644
--- a/packages/json-schemas/schemas/orders_schema.ts
+++ b/packages/json-schemas/schemas/orders_schema.ts
@@ -1,5 +1,5 @@
export const ordersSchema = {
id: '/ordersSchema',
type: 'array',
- items: { $ref: '/Order' },
+ items: { $ref: '/orderSchema' },
};
diff --git a/packages/json-schemas/schemas/paginated_collection_schema.ts b/packages/json-schemas/schemas/paginated_collection_schema.ts
new file mode 100644
index 000000000..16044c70a
--- /dev/null
+++ b/packages/json-schemas/schemas/paginated_collection_schema.ts
@@ -0,0 +1,10 @@
+export const paginatedCollectionSchema = {
+ id: '/paginatedCollectionSchema',
+ type: 'object',
+ properties: {
+ total: { type: 'number' },
+ perPage: { type: 'number' },
+ page: { type: 'number' },
+ },
+ required: ['total', 'perPage', 'page'],
+};
diff --git a/packages/json-schemas/schemas/relayer_api_asset_pairs_response_schema.ts b/packages/json-schemas/schemas/relayer_api_asset_pairs_response_schema.ts
new file mode 100644
index 000000000..c13396d29
--- /dev/null
+++ b/packages/json-schemas/schemas/relayer_api_asset_pairs_response_schema.ts
@@ -0,0 +1,38 @@
+export const relayerApiAssetDataPairsResponseSchema = {
+ id: '/relayerApiAssetDataPairsResponseSchema',
+ type: 'object',
+ allOf: [
+ { $ref: '/paginatedCollectionSchema' },
+ {
+ properties: {
+ records: { $ref: '/relayerApiAssetDataPairsSchema' },
+ },
+ required: ['records'],
+ },
+ ],
+};
+
+export const relayerApiAssetDataPairsSchema = {
+ id: '/relayerApiAssetDataPairsSchema',
+ type: 'array',
+ items: {
+ properties: {
+ assetDataA: { $ref: '/relayerApiAssetDataTradeInfoSchema' },
+ assetDataB: { $ref: '/relayerApiAssetDataTradeInfoSchema' },
+ },
+ required: ['assetDataA', 'assetDataB'],
+ type: 'object',
+ },
+};
+
+export const relayerApiAssetDataTradeInfoSchema = {
+ id: '/relayerApiAssetDataTradeInfoSchema',
+ type: 'object',
+ properties: {
+ assetData: { $ref: '/hexSchema' },
+ minAmount: { $ref: '/numberSchema' },
+ maxAmount: { $ref: '/numberSchema' },
+ precision: { type: 'number' },
+ },
+ required: ['assetData'],
+};
diff --git a/packages/json-schemas/schemas/relayer_api_error_response_schema.ts b/packages/json-schemas/schemas/relayer_api_error_response_schema.ts
index 27fdb166f..79e33fc85 100644
--- a/packages/json-schemas/schemas/relayer_api_error_response_schema.ts
+++ b/packages/json-schemas/schemas/relayer_api_error_response_schema.ts
@@ -1,8 +1,8 @@
export const relayerApiErrorResponseSchema = {
- id: '/RelayerApiErrorResponse',
+ id: '/relayerApiErrorResponseSchema',
type: 'object',
properties: {
- code: { type: 'number' },
+ code: { type: 'integer', minimum: 100, maximum: 103 },
reason: { type: 'string' },
validationErrors: {
type: 'array',
@@ -10,7 +10,7 @@ export const relayerApiErrorResponseSchema = {
type: 'object',
properties: {
field: { type: 'string' },
- code: { type: 'number' },
+ code: { type: 'integer', minimum: 1000, maximum: 1006 },
reason: { type: 'string' },
},
required: ['field', 'code', 'reason'],
diff --git a/packages/json-schemas/schemas/relayer_api_fee_recipients_response_schema.ts b/packages/json-schemas/schemas/relayer_api_fee_recipients_response_schema.ts
new file mode 100644
index 000000000..84d39eb20
--- /dev/null
+++ b/packages/json-schemas/schemas/relayer_api_fee_recipients_response_schema.ts
@@ -0,0 +1,13 @@
+export const relayerApiFeeRecipientsResponseSchema = {
+ id: '/relayerApiFeeRecipientsResponseSchema',
+ type: 'object',
+ allOf: [
+ { $ref: '/paginatedCollectionSchema' },
+ {
+ properties: {
+ records: { $ref: '/addressSchema' },
+ },
+ required: ['records'],
+ },
+ ],
+};
diff --git a/packages/json-schemas/schemas/relayer_api_fees_payload_schema.ts b/packages/json-schemas/schemas/relayer_api_fees_payload_schema.ts
deleted file mode 100644
index eaaf777a1..000000000
--- a/packages/json-schemas/schemas/relayer_api_fees_payload_schema.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-export const relayerApiFeesPayloadSchema = {
- id: '/RelayerApiFeesPayload',
- 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',
- 'expirationUnixTimestampSec',
- 'salt',
- ],
-};
diff --git a/packages/json-schemas/schemas/relayer_api_fees_response_schema.ts b/packages/json-schemas/schemas/relayer_api_fees_response_schema.ts
deleted file mode 100644
index e7440613f..000000000
--- a/packages/json-schemas/schemas/relayer_api_fees_response_schema.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-export const relayerApiFeesResponseSchema = {
- id: '/RelayerApiFeesResponse',
- type: 'object',
- properties: {
- makerFee: { $ref: '/Number' },
- takerFee: { $ref: '/Number' },
- feeRecipient: { $ref: '/Address' },
- },
- required: ['makerFee', 'takerFee', 'feeRecipient'],
-};
diff --git a/packages/json-schemas/schemas/relayer_api_orberbook_channel_subscribe_schema.ts b/packages/json-schemas/schemas/relayer_api_orberbook_channel_subscribe_schema.ts
deleted file mode 100644
index d93fa73d6..000000000
--- a/packages/json-schemas/schemas/relayer_api_orberbook_channel_subscribe_schema.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-export const relayerApiOrderbookChannelSubscribeSchema = {
- id: '/RelayerApiOrderbookChannelSubscribe',
- type: 'object',
- properties: {
- type: { enum: ['subscribe'] },
- channel: { enum: ['orderbook'] },
- requestId: { type: 'number' },
- payload: { $ref: '/RelayerApiOrderbookChannelSubscribePayload' },
- },
- required: ['type', 'channel', 'requestId', 'payload'],
-};
-
-export const relayerApiOrderbookChannelSubscribePayload = {
- id: '/RelayerApiOrderbookChannelSubscribePayload',
- type: 'object',
- properties: {
- baseTokenAddress: { $ref: '/Address' },
- quoteTokenAddress: { $ref: '/Address' },
- snapshot: { type: 'boolean' },
- limit: { type: 'number' },
- },
- required: ['baseTokenAddress', 'quoteTokenAddress'],
-};
diff --git a/packages/json-schemas/schemas/relayer_api_order_config_payload_schema.ts b/packages/json-schemas/schemas/relayer_api_order_config_payload_schema.ts
new file mode 100644
index 000000000..8d1d408d6
--- /dev/null
+++ b/packages/json-schemas/schemas/relayer_api_order_config_payload_schema.ts
@@ -0,0 +1,24 @@
+export const relayerApiOrderConfigPayloadSchema = {
+ id: '/relayerApiOrderConfigPayloadSchema',
+ 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/json-schemas/schemas/relayer_api_order_config_response_schema.ts b/packages/json-schemas/schemas/relayer_api_order_config_response_schema.ts
new file mode 100644
index 000000000..390d0b262
--- /dev/null
+++ b/packages/json-schemas/schemas/relayer_api_order_config_response_schema.ts
@@ -0,0 +1,11 @@
+export const relayerApiOrderConfigResponseSchema = {
+ id: '/relayerApiOrderConfigResponseSchema',
+ type: 'object',
+ properties: {
+ makerFee: { $ref: '/numberSchema' },
+ takerFee: { $ref: '/numberSchema' },
+ feeRecipientAddress: { $ref: '/addressSchema' },
+ senderAddress: { $ref: '/addressSchema' },
+ },
+ required: ['makerFee', 'takerFee', 'feeRecipientAddress', 'senderAddress'],
+};
diff --git a/packages/json-schemas/schemas/relayer_api_order_schema.ts b/packages/json-schemas/schemas/relayer_api_order_schema.ts
new file mode 100644
index 000000000..3952e9683
--- /dev/null
+++ b/packages/json-schemas/schemas/relayer_api_order_schema.ts
@@ -0,0 +1,9 @@
+export const relayerApiOrderSchema = {
+ id: '/relayerApiOrderSchema',
+ type: 'object',
+ properties: {
+ order: { $ref: '/orderSchema' },
+ metaData: { type: 'object' },
+ },
+ required: ['order', 'metaData'],
+};
diff --git a/packages/json-schemas/schemas/relayer_api_orderbook_channel_snapshot_schema.ts b/packages/json-schemas/schemas/relayer_api_orderbook_channel_snapshot_schema.ts
deleted file mode 100644
index fe1510d5b..000000000
--- a/packages/json-schemas/schemas/relayer_api_orderbook_channel_snapshot_schema.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-export const relayerApiOrderbookChannelSnapshotSchema = {
- id: '/RelayerApiOrderbookChannelSnapshot',
- type: 'object',
- properties: {
- type: { enum: ['snapshot'] },
- channel: { enum: ['orderbook'] },
- requestId: { type: 'number' },
- payload: { $ref: '/RelayerApiOrderbookChannelSnapshotPayload' },
- },
- required: ['type', 'channel', 'requestId', 'payload'],
-};
-
-export const relayerApiOrderbookChannelSnapshotPayload = {
- id: '/RelayerApiOrderbookChannelSnapshotPayload',
- type: 'object',
- properties: {
- bids: { $ref: '/signedOrdersSchema' },
- asks: { $ref: '/signedOrdersSchema' },
- },
- required: ['bids', 'asks'],
-};
diff --git a/packages/json-schemas/schemas/relayer_api_orderbook_channel_update_response_schema.ts b/packages/json-schemas/schemas/relayer_api_orderbook_channel_update_response_schema.ts
deleted file mode 100644
index 9a6d83d4c..000000000
--- a/packages/json-schemas/schemas/relayer_api_orderbook_channel_update_response_schema.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-export const relayerApiOrderbookChannelUpdateSchema = {
- id: '/RelayerApiOrderbookChannelUpdate',
- type: 'object',
- properties: {
- type: { enum: ['update'] },
- channel: { enum: ['orderbook'] },
- requestId: { type: 'number' },
- payload: { $ref: '/SignedOrder' },
- },
- required: ['type', 'channel', 'requestId', 'payload'],
-};
diff --git a/packages/json-schemas/schemas/relayer_api_orderbook_response_schema.ts b/packages/json-schemas/schemas/relayer_api_orderbook_response_schema.ts
index 5c409c807..7c0b8e0df 100644
--- a/packages/json-schemas/schemas/relayer_api_orderbook_response_schema.ts
+++ b/packages/json-schemas/schemas/relayer_api_orderbook_response_schema.ts
@@ -1,9 +1,9 @@
-export const relayerApiOrderBookResponseSchema = {
- id: '/RelayerApiOrderBookResponse',
+export const relayerApiOrderbookResponseSchema = {
+ id: '/relayerApiOrderbookResponseSchema',
type: 'object',
properties: {
- bids: { $ref: '/signedOrdersSchema' },
- asks: { $ref: '/signedOrdersSchema' },
+ bids: { $ref: '/relayerApiOrdersResponseSchema' },
+ asks: { $ref: '/relayerApiOrdersResponseSchema' },
},
required: ['bids', 'asks'],
};
diff --git a/packages/json-schemas/schemas/relayer_api_orders_channel_subscribe_schema.ts b/packages/json-schemas/schemas/relayer_api_orders_channel_subscribe_schema.ts
new file mode 100644
index 000000000..a3b9b6d95
--- /dev/null
+++ b/packages/json-schemas/schemas/relayer_api_orders_channel_subscribe_schema.ts
@@ -0,0 +1,26 @@
+export const relayerApiOrdersChannelSubscribeSchema = {
+ id: '/relayerApiOrdersChannelSubscribeSchema',
+ type: 'object',
+ properties: {
+ type: { enum: ['subscribe'] },
+ channel: { enum: ['orders'] },
+ requestId: { type: 'string' },
+ payload: { $ref: '/relayerApiOrdersChannelSubscribePayload' },
+ },
+ required: ['type', 'channel', 'requestId'],
+};
+
+export const relayerApiOrdersChannelSubscribePayload = {
+ id: '/relayerApiOrdersChannelSubscribePayload',
+ type: 'object',
+ properties: {
+ makerAssetProxyId: { $ref: '/hexSchema' },
+ takerAssetProxyId: { $ref: '/hexSchema' },
+ networkId: { type: 'number' },
+ makerAssetAddress: { $ref: '/addressSchema' },
+ takerAssetAddress: { $ref: '/addressSchema' },
+ makerAssetData: { $ref: '/hexSchema' },
+ takerAssetData: { $ref: '/hexSchema' },
+ traderAssetData: { $ref: '/hexSchema' },
+ },
+};
diff --git a/packages/json-schemas/schemas/relayer_api_orders_channel_update_response_schema.ts b/packages/json-schemas/schemas/relayer_api_orders_channel_update_response_schema.ts
new file mode 100644
index 000000000..800b818e2
--- /dev/null
+++ b/packages/json-schemas/schemas/relayer_api_orders_channel_update_response_schema.ts
@@ -0,0 +1,11 @@
+export const relayerApiOrdersChannelUpdateSchema = {
+ id: '/relayerApiOrdersChannelUpdateSchema',
+ type: 'object',
+ properties: {
+ type: { enum: ['update'] },
+ channel: { enum: ['orders'] },
+ requestId: { type: 'string' },
+ payload: { $ref: '/relayerApiOrdersSchema' },
+ },
+ required: ['type', 'channel', 'requestId'],
+};
diff --git a/packages/json-schemas/schemas/relayer_api_orders_response_schema.ts b/packages/json-schemas/schemas/relayer_api_orders_response_schema.ts
new file mode 100644
index 000000000..c10d64ca9
--- /dev/null
+++ b/packages/json-schemas/schemas/relayer_api_orders_response_schema.ts
@@ -0,0 +1,13 @@
+export const relayerApiOrdersResponseSchema = {
+ id: '/relayerApiOrdersResponseSchema',
+ type: 'object',
+ allOf: [
+ { $ref: '/paginatedCollectionSchema' },
+ {
+ properties: {
+ records: { $ref: '/relayerApiOrdersSchema' },
+ },
+ required: ['records'],
+ },
+ ],
+};
diff --git a/packages/json-schemas/schemas/relayer_api_orders_schema.ts b/packages/json-schemas/schemas/relayer_api_orders_schema.ts
new file mode 100644
index 000000000..ba8ce4722
--- /dev/null
+++ b/packages/json-schemas/schemas/relayer_api_orders_schema.ts
@@ -0,0 +1,5 @@
+export const relayerApiOrdersSchema = {
+ id: '/relayerApiOrdersSchema',
+ type: 'array',
+ items: { $ref: '/relayerApiOrderSchema' },
+};
diff --git a/packages/json-schemas/schemas/relayer_api_token_pairs_response_schema.ts b/packages/json-schemas/schemas/relayer_api_token_pairs_response_schema.ts
deleted file mode 100644
index 5009c7955..000000000
--- a/packages/json-schemas/schemas/relayer_api_token_pairs_response_schema.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-export const relayerApiTokenPairsResponseSchema = {
- id: '/RelayerApiTokenPairsResponse',
- type: 'array',
- items: {
- properties: {
- tokenA: { $ref: '/RelayerApiTokenTradeInfo' },
- tokenB: { $ref: '/RelayerApiTokenTradeInfo' },
- },
- required: ['tokenA', 'tokenB'],
- type: 'object',
- },
-};
-
-export const relayerApiTokenTradeInfoSchema = {
- id: '/RelayerApiTokenTradeInfo',
- type: 'object',
- properties: {
- address: { $ref: '/Address' },
- minAmount: { $ref: '/Number' },
- maxAmount: { $ref: '/Number' },
- precision: { type: 'number' },
- },
- required: ['address'],
-};
diff --git a/packages/json-schemas/schemas/signed_orders_schema.ts b/packages/json-schemas/schemas/signed_orders_schema.ts
index 34d956836..e2a5aeb56 100644
--- a/packages/json-schemas/schemas/signed_orders_schema.ts
+++ b/packages/json-schemas/schemas/signed_orders_schema.ts
@@ -1,5 +1,5 @@
export const signedOrdersSchema = {
id: '/signedOrdersSchema',
type: 'array',
- items: { $ref: '/SignedOrder' },
+ items: { $ref: '/signedOrderSchema' },
};
diff --git a/packages/json-schemas/schemas/token_schema.ts b/packages/json-schemas/schemas/token_schema.ts
index e64565c8b..a0b1ae27f 100644
--- a/packages/json-schemas/schemas/token_schema.ts
+++ b/packages/json-schemas/schemas/token_schema.ts
@@ -1,10 +1,10 @@
export const tokenSchema = {
- id: '/Token',
+ id: '/tokenSchema',
properties: {
name: { type: 'string' },
symbol: { type: 'string' },
decimals: { type: 'number' },
- address: { $ref: '/Address' },
+ address: { $ref: '/addressSchema' },
},
required: ['name', 'symbol', 'decimals', 'address'],
type: 'object',
diff --git a/packages/json-schemas/schemas/tx_data_schema.ts b/packages/json-schemas/schemas/tx_data_schema.ts
index 4274c553f..c57e18461 100644
--- a/packages/json-schemas/schemas/tx_data_schema.ts
+++ b/packages/json-schemas/schemas/tx_data_schema.ts
@@ -1,22 +1,22 @@
export const jsNumber = {
- id: '/JsNumber',
+ id: '/jsNumber',
type: 'number',
minimum: 0,
};
export const txDataSchema = {
- id: '/TxData',
+ id: '/txDataSchema',
properties: {
- from: { $ref: '/Address' },
- to: { $ref: '/Address' },
+ from: { $ref: '/addressSchema' },
+ to: { $ref: '/addressSchema' },
value: {
- oneOf: [{ $ref: '/Number' }, { $ref: '/JsNumber' }],
+ oneOf: [{ $ref: '/numberSchema' }, { $ref: '/jsNumber' }],
},
gas: {
- oneOf: [{ $ref: '/Number' }, { $ref: '/JsNumber' }],
+ oneOf: [{ $ref: '/numberSchema' }, { $ref: '/jsNumber' }],
},
gasPrice: {
- oneOf: [{ $ref: '/Number' }, { $ref: '/JsNumber' }],
+ oneOf: [{ $ref: '/numberSchema' }, { $ref: '/jsNumber' }],
},
data: {
type: 'string',
@@ -29,5 +29,4 @@ export const txDataSchema = {
},
required: ['from'],
type: 'object',
- additionalProperties: false,
};