aboutsummaryrefslogtreecommitdiffstats
path: root/src/schemas
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-08-28 22:47:49 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-08-28 22:49:57 +0800
commit96da2c26dceca03340a213baae5a490df2f7183c (patch)
tree6c984b77c1cd5ca312310d7f72ad4b512ecb9df5 /src/schemas
parent0afc95982b195378653e15697f65d4ad3bf48e66 (diff)
downloaddexon-sol-tools-96da2c26dceca03340a213baae5a490df2f7183c.tar
dexon-sol-tools-96da2c26dceca03340a213baae5a490df2f7183c.tar.gz
dexon-sol-tools-96da2c26dceca03340a213baae5a490df2f7183c.tar.bz2
dexon-sol-tools-96da2c26dceca03340a213baae5a490df2f7183c.tar.lz
dexon-sol-tools-96da2c26dceca03340a213baae5a490df2f7183c.tar.xz
dexon-sol-tools-96da2c26dceca03340a213baae5a490df2f7183c.tar.zst
dexon-sol-tools-96da2c26dceca03340a213baae5a490df2f7183c.zip
Use 0x-json-schemas
Diffstat (limited to 'src/schemas')
-rw-r--r--src/schemas/basic_type_schemas.ts11
-rw-r--r--src/schemas/ec_signature_schema.ts20
-rw-r--r--src/schemas/index_filter_values_schema.ts11
-rw-r--r--src/schemas/order_cancel_schema.ts12
-rw-r--r--src/schemas/order_fill_or_kill_requests_schema.ts12
-rw-r--r--src/schemas/order_fill_requests_schema.ts12
-rw-r--r--src/schemas/order_hash_schema.ts5
-rw-r--r--src/schemas/order_schemas.ts39
-rw-r--r--src/schemas/signed_orders_schema.ts5
-rw-r--r--src/schemas/subscription_opts_schema.ts20
-rw-r--r--src/schemas/token_schema.ts11
11 files changed, 0 insertions, 158 deletions
diff --git a/src/schemas/basic_type_schemas.ts b/src/schemas/basic_type_schemas.ts
deleted file mode 100644
index 5d66cf79b..000000000
--- a/src/schemas/basic_type_schemas.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-export const addressSchema = {
- id: '/addressSchema',
- type: 'string',
- pattern: '^0x[0-9a-f]{40}$',
-};
-
-export const numberSchema = {
- id: '/numberSchema',
- type: 'string',
- pattern: '^\\d+(\\.\\d+)?$',
-};
diff --git a/src/schemas/ec_signature_schema.ts b/src/schemas/ec_signature_schema.ts
deleted file mode 100644
index df1121989..000000000
--- a/src/schemas/ec_signature_schema.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-export const ecSignatureParameterSchema = {
- id: '/ecSignatureParameter',
- type: 'string',
- pattern: '^0[xX][0-9A-Fa-f]{64}$',
-};
-
-export const ecSignatureSchema = {
- id: '/ECSignature',
- properties: {
- v: {
- type: 'number',
- minimum: 27,
- maximum: 28,
- },
- r: {$ref: '/ecSignatureParameter'},
- s: {$ref: '/ecSignatureParameter'},
- },
- required: ['v', 'r', 's'],
- type: 'object',
-};
diff --git a/src/schemas/index_filter_values_schema.ts b/src/schemas/index_filter_values_schema.ts
deleted file mode 100644
index 7c8d3f943..000000000
--- a/src/schemas/index_filter_values_schema.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-export const indexFilterValuesSchema = {
- id: '/indexFilterValues',
- additionalProperties: {
- oneOf: [
- {$ref: '/numberSchema'},
- {$ref: '/addressSchema'},
- {$ref: '/orderHashSchema'},
- ],
- },
- type: 'object',
-};
diff --git a/src/schemas/order_cancel_schema.ts b/src/schemas/order_cancel_schema.ts
deleted file mode 100644
index 04b2c179f..000000000
--- a/src/schemas/order_cancel_schema.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-export const orderCancellationRequestsSchema = {
- id: '/OrderCancellationRequests',
- type: 'array',
- items: {
- properties: {
- order: {$ref: '/orderSchema'},
- takerTokenCancelAmount: {$ref: '/numberSchema'},
- },
- required: ['order', 'takerTokenCancelAmount'],
- type: 'object',
- },
-};
diff --git a/src/schemas/order_fill_or_kill_requests_schema.ts b/src/schemas/order_fill_or_kill_requests_schema.ts
deleted file mode 100644
index 6f7878c45..000000000
--- a/src/schemas/order_fill_or_kill_requests_schema.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-export const orderFillOrKillRequestsSchema = {
- id: '/OrderFillOrKillRequests',
- type: 'array',
- items: {
- properties: {
- signedOrder: {$ref: '/signedOrderSchema'},
- fillTakerAmount: {$ref: '/numberSchema'},
- },
- required: ['signedOrder', 'fillTakerAmount'],
- type: 'object',
- },
-};
diff --git a/src/schemas/order_fill_requests_schema.ts b/src/schemas/order_fill_requests_schema.ts
deleted file mode 100644
index 0f3ee1e99..000000000
--- a/src/schemas/order_fill_requests_schema.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-export const orderFillRequestsSchema = {
- id: '/OrderFillRequests',
- type: 'array',
- items: {
- properties: {
- signedOrder: {$ref: '/signedOrderSchema'},
- takerTokenFillAmount: {$ref: '/numberSchema'},
- },
- required: ['signedOrder', 'takerTokenFillAmount'],
- type: 'object',
- },
-};
diff --git a/src/schemas/order_hash_schema.ts b/src/schemas/order_hash_schema.ts
deleted file mode 100644
index 9773a88f9..000000000
--- a/src/schemas/order_hash_schema.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export const orderHashSchema = {
- id: '/orderHashSchema',
- type: 'string',
- pattern: '^0x[0-9a-fA-F]{64}$',
-};
diff --git a/src/schemas/order_schemas.ts b/src/schemas/order_schemas.ts
deleted file mode 100644
index c346687b5..000000000
--- a/src/schemas/order_schemas.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-export const orderSchema = {
- id: '/orderSchema',
- properties: {
- maker: {$ref: '/addressSchema'},
- taker: {$ref: '/addressSchema'},
-
- makerFee: {$ref: '/numberSchema'},
- takerFee: {$ref: '/numberSchema'},
-
- makerTokenAmount: {$ref: '/numberSchema'},
- takerTokenAmount: {$ref: '/numberSchema'},
-
- makerTokenAddress: {$ref: '/addressSchema'},
- takerTokenAddress: {$ref: '/addressSchema'},
-
- salt: {$ref: '/numberSchema'},
- feeRecipient: {$ref: '/addressSchema'},
- expirationUnixTimestampSec: {$ref: '/numberSchema'},
- exchangeContractAddress: {$ref: '/addressSchema'},
- },
- required: [
- 'maker', 'taker', 'makerFee', 'takerFee', 'makerTokenAmount', 'takerTokenAmount',
- 'salt', 'feeRecipient', 'expirationUnixTimestampSec', 'exchangeContractAddress',
- ],
- type: 'object',
-};
-
-export const signedOrderSchema = {
- id: '/signedOrderSchema',
- allOf: [
- { $ref: '/orderSchema' },
- {
- properties: {
- ecSignature: {$ref: '/ECSignature'},
- },
- required: ['ecSignature'],
- },
- ],
-};
diff --git a/src/schemas/signed_orders_schema.ts b/src/schemas/signed_orders_schema.ts
deleted file mode 100644
index 3b3b23649..000000000
--- a/src/schemas/signed_orders_schema.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-export const signedOrdersSchema = {
- id: '/signedOrdersSchema',
- type: 'array',
- items: {$ref: '/signedOrderSchema'},
-};
diff --git a/src/schemas/subscription_opts_schema.ts b/src/schemas/subscription_opts_schema.ts
deleted file mode 100644
index 0bb44fecf..000000000
--- a/src/schemas/subscription_opts_schema.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-export const blockParamSchema = {
- id: '/blockParam',
- oneOf: [
- {
- type: 'number',
- },
- {
- enum: ['latest', 'earliest', 'pending'],
- },
- ],
-};
-
-export const subscriptionOptsSchema = {
- id: '/subscriptionOpts',
- properties: {
- fromBlock: {$ref: '/blockParam'},
- toBlock: {$ref: '/blockParam'},
- },
- type: 'object',
-};
diff --git a/src/schemas/token_schema.ts b/src/schemas/token_schema.ts
deleted file mode 100644
index e9e359fdf..000000000
--- a/src/schemas/token_schema.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-export const tokenSchema = {
- id: '/token',
- properties: {
- name: {type: 'string'},
- symbol: {type: 'string'},
- decimals: {type: 'number'},
- address: {$ref: '/addressSchema'},
- },
- required: ['name', 'symbol', 'decimals', 'address'],
- type: 'object',
-};