aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/util/order_factory.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/contracts/util/order_factory.ts')
-rw-r--r--packages/contracts/util/order_factory.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/contracts/util/order_factory.ts b/packages/contracts/util/order_factory.ts
index a45877de0..fa12889ca 100644
--- a/packages/contracts/util/order_factory.ts
+++ b/packages/contracts/util/order_factory.ts
@@ -1,5 +1,6 @@
import { ZeroEx } from '0x.js';
import { BigNumber } from '@0xproject/utils';
+import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as _ from 'lodash';
import { Order } from './order';
@@ -7,8 +8,10 @@ import { DefaultOrderParams, OptionalOrderParams, OrderParams } from './types';
export class OrderFactory {
private _defaultOrderParams: DefaultOrderParams;
- constructor(defaultOrderParams: DefaultOrderParams) {
+ private _web3Wrapper: Web3Wrapper;
+ constructor(web3Wrapper: Web3Wrapper, defaultOrderParams: DefaultOrderParams) {
this._defaultOrderParams = defaultOrderParams;
+ this._web3Wrapper = web3Wrapper;
}
public async newSignedOrderAsync(customOrderParams: OptionalOrderParams = {}) {
const randomExpiration = new BigNumber(Math.floor((Date.now() + Math.random() * 100000000000) / 1000));
@@ -22,7 +25,7 @@ export class OrderFactory {
this._defaultOrderParams,
customOrderParams,
);
- const order = new Order(orderParams);
+ const order = new Order(this._web3Wrapper, orderParams);
await order.signAsync();
return order;
}