aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-05-10 20:59:54 +0800
committerFabio Berger <me@fabioberger.com>2018-05-10 20:59:54 +0800
commit7b726650e9668297b3d599b38b324a8a690d80c8 (patch)
treec56126245c9f6c3b3960194187ad14b29524608e /packages
parentd3adb48c2eefb5754acb654994cab3f1b94a2e38 (diff)
downloaddexon-sol-tools-7b726650e9668297b3d599b38b324a8a690d80c8.tar
dexon-sol-tools-7b726650e9668297b3d599b38b324a8a690d80c8.tar.gz
dexon-sol-tools-7b726650e9668297b3d599b38b324a8a690d80c8.tar.bz2
dexon-sol-tools-7b726650e9668297b3d599b38b324a8a690d80c8.tar.lz
dexon-sol-tools-7b726650e9668297b3d599b38b324a8a690d80c8.tar.xz
dexon-sol-tools-7b726650e9668297b3d599b38b324a8a690d80c8.tar.zst
dexon-sol-tools-7b726650e9668297b3d599b38b324a8a690d80c8.zip
Improve createOrderWatcherAsync
Diffstat (limited to 'packages')
-rw-r--r--packages/0x.js/src/0x.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/packages/0x.js/src/0x.ts b/packages/0x.js/src/0x.ts
index 7850a782d..c68a17015 100644
--- a/packages/0x.js/src/0x.ts
+++ b/packages/0x.js/src/0x.ts
@@ -218,11 +218,12 @@ export class ZeroEx {
* @param config The configuration object. Look up the type for the description.
* @return An instance of the 0x.js OrderWatcher class.
*/
- public async createOrderWatcherAsync(config?: OrderWatcherConfig) {
+ public async createOrderWatcherAsync(config?: OrderWatcherConfig): Promise<OrderWatcher> {
// Hack: Get Web3Wrapper from ZeroExContract
- const web3Wrapper = (this._contractWrappers as any)._web3Wrapper;
- const networkId = web3Wrapper.getNetworkIdAsync();
+ const web3Wrapper: Web3Wrapper = (this._contractWrappers as any)._web3Wrapper;
+ const networkId = await web3Wrapper.getNetworkIdAsync();
const provider = this._contractWrappers.getProvider();
- return new OrderWatcher(provider, networkId, config);
+ const orderWatcher = new OrderWatcher(provider, networkId, config);
+ return orderWatcher;
}
}