aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/schemas/order_schemas.ts6
-rw-r--r--src/utils/schema_validator.ts3
2 files changed, 8 insertions, 1 deletions
diff --git a/src/schemas/order_schemas.ts b/src/schemas/order_schemas.ts
index 133736b3d..fa9866abe 100644
--- a/src/schemas/order_schemas.ts
+++ b/src/schemas/order_schemas.ts
@@ -24,6 +24,12 @@ export const orderSchema = {
type: 'object',
};
+export const orderHashSchema = {
+ id: '/orderHashSchema',
+ type: 'string',
+ pattern: '^0x[0-9a-fA-F]{64}$',
+};
+
export const signedOrderSchema = {
id: '/signedOrderSchema',
allOf: [
diff --git a/src/utils/schema_validator.ts b/src/utils/schema_validator.ts
index 609d11a1a..20c160068 100644
--- a/src/utils/schema_validator.ts
+++ b/src/utils/schema_validator.ts
@@ -1,6 +1,6 @@
import {Validator, ValidatorResult, Schema} from 'jsonschema';
import {ecSignatureSchema, ecSignatureParameterSchema} from '../schemas/ec_signature_schema';
-import {orderSchema, signedOrderSchema} from '../schemas/order_schemas';
+import {orderSchema, signedOrderSchema, orderHashSchema} from '../schemas/order_schemas';
import {addressSchema, numberSchema} from '../schemas/basic_type_schemas';
import {tokenSchema} from '../schemas/token_schema';
import {subscriptionOptsSchema, blockParamSchema} from '../schemas/subscription_opts_schema';
@@ -15,6 +15,7 @@ export class SchemaValidator {
this.validator.addSchema(orderSchema, orderSchema.id);
this.validator.addSchema(numberSchema, numberSchema.id);
this.validator.addSchema(addressSchema, addressSchema.id);
+ this.validator.addSchema(orderHashSchema, orderHashSchema.id);
this.validator.addSchema(blockParamSchema, blockParamSchema.id);
this.validator.addSchema(ecSignatureSchema, ecSignatureSchema.id);
this.validator.addSchema(signedOrderSchema, signedOrderSchema.id);