diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-02-07 19:22:22 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-02-07 19:22:22 +0800 |
commit | fd004032cb23998184a78ac4a0a486ef1bd04c25 (patch) | |
tree | 90f7e64996ccc0fee1e5428b2ced9b2c2b1c3d4a /packages/contracts/util/order_factory.ts | |
parent | 4b6324050da4862f4d8bdb7d6dbd66107929a2b5 (diff) | |
download | dexon-sol-tools-fd004032cb23998184a78ac4a0a486ef1bd04c25.tar dexon-sol-tools-fd004032cb23998184a78ac4a0a486ef1bd04c25.tar.gz dexon-sol-tools-fd004032cb23998184a78ac4a0a486ef1bd04c25.tar.bz2 dexon-sol-tools-fd004032cb23998184a78ac4a0a486ef1bd04c25.tar.lz dexon-sol-tools-fd004032cb23998184a78ac4a0a486ef1bd04c25.tar.xz dexon-sol-tools-fd004032cb23998184a78ac4a0a486ef1bd04c25.tar.zst dexon-sol-tools-fd004032cb23998184a78ac4a0a486ef1bd04c25.zip |
Introduce SignedOrder class and remove type assertions
Diffstat (limited to 'packages/contracts/util/order_factory.ts')
-rw-r--r-- | packages/contracts/util/order_factory.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/contracts/util/order_factory.ts b/packages/contracts/util/order_factory.ts index 2b50f13e8..788f60a88 100644 --- a/packages/contracts/util/order_factory.ts +++ b/packages/contracts/util/order_factory.ts @@ -4,6 +4,7 @@ import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as _ from 'lodash'; import { Order } from './order'; +import { SignedOrder } from './signed_order'; import { DefaultOrderParams, OptionalOrderParams, OrderParams } from './types'; export class OrderFactory { @@ -13,7 +14,7 @@ export class OrderFactory { this._defaultOrderParams = defaultOrderParams; this._web3Wrapper = web3Wrapper; } - public async newSignedOrderAsync(customOrderParams: OptionalOrderParams = {}): Promise<Order> { + public async newSignedOrderAsync(customOrderParams: OptionalOrderParams = {}): Promise<SignedOrder> { const randomExpiration = new BigNumber(Math.floor((Date.now() + Math.random() * 100000000000) / 1000)); const orderParams: OrderParams = _.assign( {}, @@ -26,7 +27,7 @@ export class OrderFactory { customOrderParams, ); const order = new Order(this._web3Wrapper, orderParams); - await order.signAsync(); - return order; + const signedOrder = await order.signAsync(); + return signedOrder; } } |