aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src/utils/exchange_wrapper.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-05-23 02:18:50 +0800
committerFabio Berger <me@fabioberger.com>2018-05-23 02:18:50 +0800
commita682b5d90e4c651e4e5d5d7c700237a9b6fe22bf (patch)
tree35690db865d8ed5ba859d9e0d9d1cd1050425c4f /packages/contracts/src/utils/exchange_wrapper.ts
parent4a0c8d72b05152ee2fd71245873d5a70f7281058 (diff)
downloaddexon-sol-tools-a682b5d90e4c651e4e5d5d7c700237a9b6fe22bf.tar.gz
dexon-sol-tools-a682b5d90e4c651e4e5d5d7c700237a9b6fe22bf.tar.zst
dexon-sol-tools-a682b5d90e4c651e4e5d5d7c700237a9b6fe22bf.zip
Remove 0x.js dep from contracts
Diffstat (limited to 'packages/contracts/src/utils/exchange_wrapper.ts')
-rw-r--r--packages/contracts/src/utils/exchange_wrapper.ts11
1 files changed, 5 insertions, 6 deletions
diff --git a/packages/contracts/src/utils/exchange_wrapper.ts b/packages/contracts/src/utils/exchange_wrapper.ts
index 46531fa3f..98d5e27f9 100644
--- a/packages/contracts/src/utils/exchange_wrapper.ts
+++ b/packages/contracts/src/utils/exchange_wrapper.ts
@@ -1,5 +1,6 @@
-import { TransactionReceiptWithDecodedLogs, ZeroEx } from '0x.js';
+import { TransactionReceiptWithDecodedLogs } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
+import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as _ from 'lodash';
import * as Web3 from 'web3';
@@ -14,10 +15,8 @@ import { AssetProxyId, OrderInfo, SignedOrder, SignedTransaction } from './types
export class ExchangeWrapper {
private _exchange: ExchangeContract;
private _logDecoder: LogDecoder = new LogDecoder(constants.TESTRPC_NETWORK_ID);
- private _zeroEx: ZeroEx;
- constructor(exchangeContract: ExchangeContract, zeroEx: ZeroEx) {
+ constructor(exchangeContract: ExchangeContract) {
this._exchange = exchangeContract;
- this._zeroEx = zeroEx;
}
public async fillOrderAsync(
signedOrder: SignedOrder,
@@ -196,7 +195,7 @@ export class ExchangeWrapper {
opts: { oldAssetProxyAddressIfExists?: string } = {},
): Promise<TransactionReceiptWithDecodedLogs> {
const oldAssetProxyAddress = _.isUndefined(opts.oldAssetProxyAddressIfExists)
- ? ZeroEx.NULL_ADDRESS
+ ? constants.NULL_ADDRESS
: opts.oldAssetProxyAddressIfExists;
const txHash = await this._exchange.registerAssetProxy.sendTransactionAsync(
assetProxyId,
@@ -246,7 +245,7 @@ export class ExchangeWrapper {
return tx;
}
private async _getTxWithDecodedExchangeLogsAsync(txHash: string) {
- const tx = await this._zeroEx.awaitTransactionMinedAsync(txHash);
+ const tx = await Web3Wrapper.awaitTransactionMinedAsync(txHash);
tx.logs = _.filter(tx.logs, log => log.address === this._exchange.address);
tx.logs = _.map(tx.logs, log => this._logDecoder.decodeLogOrThrow(log));
return tx;