Merge pull request #1250 from 0xProject/feature/json-schemas-connect
Move @0x/connect schemas to @0x/json-schemas
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
[
|
||||
{
|
||||
"version": "2.0.1",
|
||||
"version": "2.1.0",
|
||||
"changes": [
|
||||
{
|
||||
"note":
|
||||
"Improve schemas by enforcing that amounts that must be whole numbers (e.g Order asset amounts) no longer allow decimal amounts",
|
||||
"pr": 1173
|
||||
},
|
||||
{
|
||||
"note": "Add schemas from @0x/connect",
|
||||
"pr": 1250
|
||||
}
|
||||
],
|
||||
"timestamp": 1541740904
|
||||
|
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"id": "/AssetPairsRequestOpts",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"assetDataA": { "$ref": "/hexSchema" },
|
||||
"assetDataB": { "$ref": "/hexSchema" }
|
||||
}
|
||||
}
|
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"id": "/OrderConfigRequest",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"makerAddress": { "$ref": "/addressSchema" },
|
||||
"takerAddress": { "$ref": "/addressSchema" },
|
||||
"makerAssetAmount": { "$ref": "/wholeNumberSchema" },
|
||||
"takerAssetAmount": { "$ref": "/wholeNumberSchema" },
|
||||
"makerAssetData": { "$ref": "/hexSchema" },
|
||||
"takerAssetData": { "$ref": "/hexSchema" },
|
||||
"exchangeAddress": { "$ref": "/addressSchema" },
|
||||
"expirationTimeSeconds": { "$ref": "/wholeNumberSchema" }
|
||||
},
|
||||
"required": [
|
||||
"makerAddress",
|
||||
"takerAddress",
|
||||
"makerAssetAmount",
|
||||
"takerAssetAmount",
|
||||
"makerAssetData",
|
||||
"takerAssetData",
|
||||
"exchangeAddress",
|
||||
"expirationTimeSeconds"
|
||||
]
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"id": "/OrderBookRequest",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"baseAssetData": { "$ref": "/hexSchema" },
|
||||
"quoteAssetData": { "$ref": "/hexSchema" }
|
||||
},
|
||||
"required": ["baseAssetData", "quoteAssetData"]
|
||||
}
|
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"id": "/OrdersRequestOpts",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"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" }
|
||||
}
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"id": "/PagedRequestOpts",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"page": { "type": "number" },
|
||||
"perPage": { "type": "number" }
|
||||
}
|
||||
}
|
7
packages/json-schemas/schemas/request_opts_schema.json
Normal file
7
packages/json-schemas/schemas/request_opts_schema.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"id": "/RequestOpts",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"networkId": { "type": "number" }
|
||||
}
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
import * as addressSchema from '../schemas/address_schema.json';
|
||||
import * as assetPairsRequestOptsSchema from '../schemas/asset_pairs_request_opts_schema.json';
|
||||
import * as blockParamSchema from '../schemas/block_param_schema.json';
|
||||
import * as blockRangeSchema from '../schemas/block_range_schema.json';
|
||||
import * as callDataSchema from '../schemas/call_data_schema.json';
|
||||
@@ -10,11 +11,15 @@ import * as indexFilterValuesSchema from '../schemas/index_filter_values_schema.
|
||||
import * as jsNumber from '../schemas/js_number.json';
|
||||
import * as numberSchema from '../schemas/number_schema.json';
|
||||
import * as orderCancellationRequestsSchema from '../schemas/order_cancel_schema.json';
|
||||
import * as orderConfigRequestSchema from '../schemas/order_config_request_schema.json';
|
||||
import * as orderFillOrKillRequestsSchema from '../schemas/order_fill_or_kill_requests_schema.json';
|
||||
import * as orderFillRequestsSchema from '../schemas/order_fill_requests_schema.json';
|
||||
import * as orderHashSchema from '../schemas/order_hash_schema.json';
|
||||
import * as orderSchema from '../schemas/order_schema.json';
|
||||
import * as orderBookRequestSchema from '../schemas/orderbook_request_schema.json';
|
||||
import * as ordersRequestOptsSchema from '../schemas/orders_request_opts_schema.json';
|
||||
import * as ordersSchema from '../schemas/orders_schema.json';
|
||||
import * as pagedRequestOptsSchema from '../schemas/paged_request_opts_schema.json';
|
||||
import * as paginatedCollectionSchema from '../schemas/paginated_collection_schema.json';
|
||||
import * as relayerApiAssetDataPairsResponseSchema from '../schemas/relayer_api_asset_data_pairs_response_schema.json';
|
||||
import * as relayerApiAssetDataPairsSchema from '../schemas/relayer_api_asset_data_pairs_schema.json';
|
||||
@@ -30,6 +35,7 @@ import * as relayerApiOrdersChannelSubscribeSchema from '../schemas/relayer_api_
|
||||
import * as relayerApiOrdersChannelUpdateSchema from '../schemas/relayer_api_orders_channel_update_response_schema.json';
|
||||
import * as relayerApiOrdersResponseSchema from '../schemas/relayer_api_orders_response_schema.json';
|
||||
import * as relayerApiOrdersSchema from '../schemas/relayer_api_orders_schema.json';
|
||||
import * as requestOptsSchema from '../schemas/request_opts_schema.json';
|
||||
import * as signedOrderSchema from '../schemas/signed_order_schema.json';
|
||||
import * as signedOrdersSchema from '../schemas/signed_orders_schema.json';
|
||||
import * as tokenSchema from '../schemas/token_schema.json';
|
||||
@@ -58,6 +64,12 @@ export const schemas = {
|
||||
blockRangeSchema,
|
||||
tokenSchema,
|
||||
jsNumber,
|
||||
requestOptsSchema,
|
||||
pagedRequestOptsSchema,
|
||||
ordersRequestOptsSchema,
|
||||
orderBookRequestSchema,
|
||||
orderConfigRequestSchema,
|
||||
assetPairsRequestOptsSchema,
|
||||
txDataSchema,
|
||||
paginatedCollectionSchema,
|
||||
relayerApiErrorResponseSchema,
|
||||
|
@@ -44,6 +44,12 @@
|
||||
"./schemas/zero_ex_transaction_schema.json",
|
||||
"./schemas/tx_data_schema.json",
|
||||
"./schemas/index_filter_values_schema.json",
|
||||
"./schemas/whole_number_schema.json"
|
||||
"./schemas/whole_number_schema.json",
|
||||
"./schemas/asset_pairs_request_opts_schema.json",
|
||||
"./schemas/orderbook_request_schema.json",
|
||||
"./schemas/orders_request_opts_schema.json",
|
||||
"./schemas/paged_request_opts_schema.json",
|
||||
"./schemas/request_opts_schema.json",
|
||||
"./schemas/order_config_request_schema.json"
|
||||
]
|
||||
}
|
||||
|
Reference in New Issue
Block a user