aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-05-11 21:40:19 +0800
committerFabio Berger <me@fabioberger.com>2018-05-11 21:40:19 +0800
commitbc3dc52377325d8b60a5227f0ec9bbdd413179f5 (patch)
tree921922c72fb3d1052a1c65481abe2231789cdcab /packages
parentef1d484d9ea9670fd3bfba1c04c7a0b6c3a5e489 (diff)
downloaddexon-sol-tools-bc3dc52377325d8b60a5227f0ec9bbdd413179f5.tar.gz
dexon-sol-tools-bc3dc52377325d8b60a5227f0ec9bbdd413179f5.tar.zst
dexon-sol-tools-bc3dc52377325d8b60a5227f0ec9bbdd413179f5.zip
Revert back to hack, we need the configured web3Wrapper
Diffstat (limited to 'packages')
-rw-r--r--packages/0x.js/src/0x.ts13
1 files changed, 7 insertions, 6 deletions
diff --git a/packages/0x.js/src/0x.ts b/packages/0x.js/src/0x.ts
index 8883dca53..e0192d5ef 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[]> {
- const provider = this._contractWrappers.getProvider();
- const web3Wrapper = new Web3Wrapper(provider);
+ // Hack: Get Web3Wrapper from ContractWrappers
+ const web3Wrapper: Web3Wrapper = (this._contractWrappers as any)._web3Wrapper;
const availableAddresses = await web3Wrapper.getAvailableAddressesAsync();
return availableAddresses;
}
@@ -203,8 +203,8 @@ export class ZeroEx {
pollingIntervalMs = 1000,
timeoutMs?: number,
): Promise<TransactionReceiptWithDecodedLogs> {
- const provider = this._contractWrappers.getProvider();
- const web3Wrapper = new Web3Wrapper(provider);
+ // Hack: Get Web3Wrapper from ContractWrappers
+ const web3Wrapper: Web3Wrapper = (this._contractWrappers as any)._web3Wrapper;
const transactionReceiptWithDecodedLogs = await web3Wrapper.awaitTransactionMinedAsync(
txHash,
pollingIntervalMs,
@@ -219,9 +219,10 @@ export class ZeroEx {
* @return An instance of the 0x.js OrderWatcher class.
*/
public async createOrderWatcherAsync(config?: OrderWatcherConfig): Promise<OrderWatcher> {
- const provider = this._contractWrappers.getProvider();
- const web3Wrapper = new Web3Wrapper(provider);
+ // Hack: Get Web3Wrapper from ContractWrappers
+ const web3Wrapper: Web3Wrapper = (this._contractWrappers as any)._web3Wrapper;
const networkId = await web3Wrapper.getNetworkIdAsync();
+ const provider = this._contractWrappers.getProvider();
const orderWatcher = new OrderWatcher(provider, networkId, config);
return orderWatcher;
}