aboutsummaryrefslogtreecommitdiffstats
path: root/src/0x.js.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/0x.js.ts')
-rw-r--r--src/0x.js.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/0x.js.ts b/src/0x.js.ts
index fa52d4ad8..7b53b70ea 100644
--- a/src/0x.js.ts
+++ b/src/0x.js.ts
@@ -16,6 +16,8 @@ import {ecSignatureSchema} from './schemas/ec_signature_schema';
import {TokenWrapper} from './contract_wrappers/token_wrapper';
import {ECSignature, ZeroExError, Order, SignedOrder} from './types';
import * as ExchangeArtifacts from './artifacts/Exchange.json';
+import {SchemaValidator} from './utils/schema_validator';
+import {orderSchema} from './schemas/order_schemas';
// Customize our BigNumber instances
bigNumberConfigs.configure();
@@ -128,6 +130,8 @@ export class ZeroEx {
* Computes the orderHash for a given order and returns it as a hex encoded string.
*/
public async getOrderHashHexAsync(order: Order|SignedOrder): Promise<string> {
+ assert.doesConformToSchema(
+ 'order', SchemaValidator.convertToJSONSchemaCompatibleObject(order as object), orderSchema);
const exchangeContractAddr = await this.getExchangeAddressAsync();
const hashHex = utils.getOrderHashHex(order, exchangeContractAddr);
return hashHex;