From fbf89aea1c710f4af131fa8d5653e0f1914ff88a Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 11 Jul 2017 16:23:19 -0700 Subject: Make getOrderHashHex static --- src/0x.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/0x.ts') diff --git a/src/0x.ts b/src/0x.ts index aeed7b042..3d1e8745f 100644 --- a/src/0x.ts +++ b/src/0x.ts @@ -149,6 +149,16 @@ export class ZeroEx { const baseUnitAmount = amount.times(unit); return baseUnitAmount; } + /** + * Computes the orderHash for a supplied order. + * @param order An object that conforms to the Order or SignedOrder interface definitions. + * @return The resulting orderHash from hashing the supplied order. + */ + public static getOrderHashHex(order: Order|SignedOrder): string { + assert.doesConformToSchema('order', order, orderSchema); + const orderHashHex = utils.getOrderHashHex(order); + return orderHashHex; + } /** * Instantiates a new ZeroEx instance that provides the public interface to the 0x.js library. * @param provider The Web3.js Provider instance you would like the 0x.js library to use for interacting with @@ -184,16 +194,6 @@ export class ZeroEx { const availableAddresses = await this._web3Wrapper.getAvailableAddressesAsync(); return availableAddresses; } - /** - * Computes the orderHash for a supplied order. - * @param order An object that conforms to the Order or SignedOrder interface definitions. - * @return The resulting orderHash from hashing the supplied order. - */ - public getOrderHashHex(order: Order|SignedOrder): string { - assert.doesConformToSchema('order', order, orderSchema); - const orderHashHex = utils.getOrderHashHex(order); - return orderHashHex; - } /** * Signs an orderHash and returns it's elliptic curve signature. * This method currently supports TestRPC, Geth and Parity above and below V1.6.6 -- cgit v1.2.3