aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-05-11 21:24:31 +0800
committerFabio Berger <me@fabioberger.com>2018-05-11 21:24:31 +0800
commit63cd5a629615bd1f30a8cb0e57649efcaefcd940 (patch)
tree8476bafe0503ab0adbf51a3332e98697fa31a2d2
parent657dc785ea0d0010f3186a820604441d12f91808 (diff)
downloaddexon-sol-tools-63cd5a629615bd1f30a8cb0e57649efcaefcd940.tar
dexon-sol-tools-63cd5a629615bd1f30a8cb0e57649efcaefcd940.tar.gz
dexon-sol-tools-63cd5a629615bd1f30a8cb0e57649efcaefcd940.tar.bz2
dexon-sol-tools-63cd5a629615bd1f30a8cb0e57649efcaefcd940.tar.lz
dexon-sol-tools-63cd5a629615bd1f30a8cb0e57649efcaefcd940.tar.xz
dexon-sol-tools-63cd5a629615bd1f30a8cb0e57649efcaefcd940.tar.zst
dexon-sol-tools-63cd5a629615bd1f30a8cb0e57649efcaefcd940.zip
Get rid of hack
-rw-r--r--packages/0x.js/src/0x.ts13
1 files changed, 6 insertions, 7 deletions
diff --git a/packages/0x.js/src/0x.ts b/packages/0x.js/src/0x.ts
index a4ca3efc2..8883dca53 100644
--- a/packages/0x.js/src/0x.ts
+++ b/packages/0x.js/src/0x.ts
@@ -162,8 +162,8 @@ export class ZeroEx {
* @return An array of available user Ethereum addresses.
*/
public async getAvailableAddressesAsync(): Promise<string[]> {
- // Hack: Get Web3Wrapper from ZeroExContract
- const web3Wrapper: Web3Wrapper = (this._contractWrappers as any)._web3Wrapper;
+ const provider = this._contractWrappers.getProvider();
+ const web3Wrapper = new Web3Wrapper(provider);
const availableAddresses = await web3Wrapper.getAvailableAddressesAsync();
return availableAddresses;
}
@@ -203,8 +203,8 @@ export class ZeroEx {
pollingIntervalMs = 1000,
timeoutMs?: number,
): Promise<TransactionReceiptWithDecodedLogs> {
- // Hack: Get Web3Wrapper from ZeroExContract
- const web3Wrapper: Web3Wrapper = (this._contractWrappers as any)._web3Wrapper;
+ const provider = this._contractWrappers.getProvider();
+ const web3Wrapper = new Web3Wrapper(provider);
const transactionReceiptWithDecodedLogs = await web3Wrapper.awaitTransactionMinedAsync(
txHash,
pollingIntervalMs,
@@ -219,10 +219,9 @@ export class ZeroEx {
* @return An instance of the 0x.js OrderWatcher class.
*/
public async createOrderWatcherAsync(config?: OrderWatcherConfig): Promise<OrderWatcher> {
- // Hack: Get Web3Wrapper from ZeroExContract
- const web3Wrapper: Web3Wrapper = (this._contractWrappers as any)._web3Wrapper;
- const networkId = await web3Wrapper.getNetworkIdAsync();
const provider = this._contractWrappers.getProvider();
+ const web3Wrapper = new Web3Wrapper(provider);
+ const networkId = await web3Wrapper.getNetworkIdAsync();
const orderWatcher = new OrderWatcher(provider, networkId, config);
return orderWatcher;
}