From 27d9fba785a5a53550be53b12baf9069bda8d160 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 4 Jan 2018 18:56:30 +0100 Subject: Include web3 types via typeRoots and factor out common parts of tsconfig.json --- packages/0x.js/src/0x.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'packages/0x.js/src/0x.ts') diff --git a/packages/0x.js/src/0x.ts b/packages/0x.js/src/0x.ts index 67b75df95..244b77a85 100644 --- a/packages/0x.js/src/0x.ts +++ b/packages/0x.js/src/0x.ts @@ -213,12 +213,17 @@ export class ZeroEx { * @param networkId The id of the network your provider is connected to */ public setProvider(provider: Web3Provider, networkId: number): void { - this._web3Wrapper.setProvider(provider, networkId); + this._web3Wrapper.setProvider(provider); (this.exchange as any)._invalidateContractInstances(); + (this.exchange as any)._setNetworkId(networkId); (this.tokenRegistry as any)._invalidateContractInstance(); + (this.tokenRegistry as any)._setNetworkId(networkId); (this.token as any)._invalidateContractInstances(); + (this.token as any)._setNetworkId(networkId); (this.proxy as any)._invalidateContractInstance(); + (this.proxy as any)._setNetworkId(networkId); (this.etherToken as any)._invalidateContractInstance(); + (this.etherToken as any)._setNetworkId(networkId); } /** * Get user Ethereum addresses available through the supplied web3 provider available for sending transactions. -- cgit