diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-11-24 03:56:28 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-11-24 05:15:47 +0800 |
commit | 062f85e5069d0c2d56cd10bdb8a31a6d0a6c88dc (patch) | |
tree | 26223d066ed15aec3e50eca1ecb4da0fa649cef7 /packages/0x.js/src/0x.ts | |
parent | b3c0d54acd1f4853f3b9dfbcf68bc90d17d586e0 (diff) | |
download | dexon-sol-tools-062f85e5069d0c2d56cd10bdb8a31a6d0a6c88dc.tar dexon-sol-tools-062f85e5069d0c2d56cd10bdb8a31a6d0a6c88dc.tar.gz dexon-sol-tools-062f85e5069d0c2d56cd10bdb8a31a6d0a6c88dc.tar.bz2 dexon-sol-tools-062f85e5069d0c2d56cd10bdb8a31a6d0a6c88dc.tar.lz dexon-sol-tools-062f85e5069d0c2d56cd10bdb8a31a6d0a6c88dc.tar.xz dexon-sol-tools-062f85e5069d0c2d56cd10bdb8a31a6d0a6c88dc.tar.zst dexon-sol-tools-062f85e5069d0c2d56cd10bdb8a31a6d0a6c88dc.zip |
Pass networkId on provider update
Diffstat (limited to 'packages/0x.js/src/0x.ts')
-rw-r--r-- | packages/0x.js/src/0x.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/packages/0x.js/src/0x.ts b/packages/0x.js/src/0x.ts index 3dc98d5da..0616b3078 100644 --- a/packages/0x.js/src/0x.ts +++ b/packages/0x.js/src/0x.ts @@ -205,12 +205,13 @@ export class ZeroEx { * Sets a new web3 provider for 0x.js. Updating the provider will stop all * subscriptions so you will need to re-subscribe to all events relevant to your app after this call. * @param provider The Web3Provider you would like the 0x.js library to use from now on. + * @param networkId The id of the network your provider is connected to */ - public async setProviderAsync(provider: Web3Provider) { - this._web3Wrapper.setProvider(provider); - await (this.exchange as any)._invalidateContractInstancesAsync(); + public setProvider(provider: Web3Provider, networkId: number): void { + this._web3Wrapper.setProvider(provider, networkId); + (this.exchange as any)._invalidateContractInstances(); (this.tokenRegistry as any)._invalidateContractInstance(); - await (this.token as any)._invalidateContractInstancesAsync(); + (this.token as any)._invalidateContractInstances(); (this.proxy as any)._invalidateContractInstance(); (this.etherToken as any)._invalidateContractInstance(); } |