Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Commit

Permalink
Convert all schemas to json files, so it's easier for devs in other l…
Browse files Browse the repository at this point in the history
…anguages to use it
  • Loading branch information
fabioberger committed Oct 17, 2018
1 parent 78e6063 commit 7d9009b
Show file tree
Hide file tree
Showing 68 changed files with 534 additions and 507 deletions.
5 changes: 5 additions & 0 deletions packages/json-schemas/schemas/address_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"id": "/addressSchema",
"type": "string",
"pattern": "^0x[0-9a-f]{40}$"
}
17 changes: 0 additions & 17 deletions packages/json-schemas/schemas/basic_type_schemas.ts

This file was deleted.

11 changes: 11 additions & 0 deletions packages/json-schemas/schemas/block_param_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"id": "/blockParamSchema",
"oneOf": [
{
"type": "number"
},
{
"enum": ["latest", "earliest", "pending"]
}
]
}
8 changes: 8 additions & 0 deletions packages/json-schemas/schemas/block_range_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "/blockRangeSchema",
"properties": {
"fromBlock": { "$ref": "/blockParamSchema" },
"toBlock": { "$ref": "/blockParamSchema" }
},
"type": "object"
}
20 changes: 0 additions & 20 deletions packages/json-schemas/schemas/block_range_schema.ts

This file was deleted.

27 changes: 27 additions & 0 deletions packages/json-schemas/schemas/call_data_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"id": "/callDataSchema",
"properties": {
"from": { "$ref": "/addressSchema" },
"to": { "$ref": "/addressSchema" },
"value": {
"oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumber" }]
},
"gas": {
"oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumber" }]
},
"gasPrice": {
"oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumber" }]
},
"data": {
"type": "string",
"pattern": "^0x[0-9a-f]*$"
},
"nonce": {
"type": "number",
"minimum": 0
}
},
"required": [],
"type": "object",
"additionalProperties": false
}
27 changes: 0 additions & 27 deletions packages/json-schemas/schemas/call_data_schema.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"id": "/ecSignatureParameterSchema",
"type": "string",
"pattern": "^0[xX][0-9A-Fa-f]{64}$"
}
14 changes: 14 additions & 0 deletions packages/json-schemas/schemas/ec_signature_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"id": "/ECSignature",
"properties": {
"v": {
"type": "number",
"minimum": 27,
"maximum": 28
},
"r": { "$ref": "/ecSignatureParameterSchema" },
"s": { "$ref": "/ecSignatureParameterSchema" }
},
"required": ["v", "r", "s"],
"type": "object"
}
20 changes: 0 additions & 20 deletions packages/json-schemas/schemas/ec_signature_schema.ts

This file was deleted.

28 changes: 0 additions & 28 deletions packages/json-schemas/schemas/eip712_typed_data.ts

This file was deleted.

28 changes: 28 additions & 0 deletions packages/json-schemas/schemas/eip712_typed_data_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"id": "/eip712TypedDataSchema",
"type": "object",
"properties": {
"types": {
"type": "object",
"properties": {
"EIP712Domain": { "type": "array" }
},
"additionalProperties": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"type": { "type": "string" }
},
"required": ["name", "type"]
}
},
"required": ["EIP712Domain"]
},
"primaryType": { "type": "string" },
"domain": { "type": "object" },
"message": { "type": "object" }
},
"required": ["types", "primaryType", "domain", "message"]
}
5 changes: 5 additions & 0 deletions packages/json-schemas/schemas/hex_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"id": "/hexSchema",
"type": "string",
"pattern": "^0x(([0-9a-f][0-9a-f])+)?$"
}
7 changes: 7 additions & 0 deletions packages/json-schemas/schemas/index_filter_values_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"id": "/indexFilterValuesSchema",
"additionalProperties": {
"oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/addressSchema" }, { "$ref": "/orderHashSchema" }]
},
"type": "object"
}
7 changes: 0 additions & 7 deletions packages/json-schemas/schemas/index_filter_values_schema.ts

This file was deleted.

5 changes: 5 additions & 0 deletions packages/json-schemas/schemas/js_number.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"id": "/jsNumber",
"type": "number",
"minimum": 0
}
5 changes: 5 additions & 0 deletions packages/json-schemas/schemas/number_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"id": "/numberSchema",
"type": "string",
"pattern": "^\\d+(\\.\\d+)?$"
}
12 changes: 12 additions & 0 deletions packages/json-schemas/schemas/order_cancel_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "/orderCancellationRequestsSchema",
"type": "array",
"items": {
"properties": {
"order": { "$ref": "/orderSchema" },
"takerTokenCancelAmount": { "$ref": "/numberSchema" }
},
"required": ["order", "takerTokenCancelAmount"],
"type": "object"
}
}
12 changes: 0 additions & 12 deletions packages/json-schemas/schemas/order_cancel_schema.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "/orderFillOrKillRequestsSchema",
"type": "array",
"items": {
"properties": {
"signedOrder": { "$ref": "/signedOrderSchema" },
"fillTakerAmount": { "$ref": "/numberSchema" }
},
"required": ["signedOrder", "fillTakerAmount"],
"type": "object"
}
}

This file was deleted.

12 changes: 12 additions & 0 deletions packages/json-schemas/schemas/order_fill_requests_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "/orderFillRequestsSchema",
"type": "array",
"items": {
"properties": {
"signedOrder": { "$ref": "/signedOrderSchema" },
"takerTokenFillAmount": { "$ref": "/numberSchema" }
},
"required": ["signedOrder", "takerTokenFillAmount"],
"type": "object"
}
}
12 changes: 0 additions & 12 deletions packages/json-schemas/schemas/order_fill_requests_schema.ts

This file was deleted.

5 changes: 5 additions & 0 deletions packages/json-schemas/schemas/order_hash_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"id": "/orderHashSchema",
"type": "string",
"pattern": "^0x[0-9a-fA-F]{64}$"
}
5 changes: 0 additions & 5 deletions packages/json-schemas/schemas/order_hash_schema.ts

This file was deleted.

34 changes: 34 additions & 0 deletions packages/json-schemas/schemas/order_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"id": "/orderSchema",
"properties": {
"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",
"takerAddress",
"makerFee",
"takerFee",
"senderAddress",
"makerAssetAmount",
"takerAssetAmount",
"makerAssetData",
"takerAssetData",
"salt",
"exchangeAddress",
"feeRecipientAddress",
"expirationTimeSeconds"
],
"type": "object"
}
Loading

0 comments on commit 7d9009b

Please sign in to comment.