aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js/src
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-01-05 01:56:30 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-01-10 18:24:31 +0800
commit27d9fba785a5a53550be53b12baf9069bda8d160 (patch)
treebde34d668e53832dd03dd279992721d56291124b /packages/0x.js/src
parente6a783aff803c276392efec93571d24fc96feb6e (diff)
downloaddexon-sol-tools-27d9fba785a5a53550be53b12baf9069bda8d160.tar
dexon-sol-tools-27d9fba785a5a53550be53b12baf9069bda8d160.tar.gz
dexon-sol-tools-27d9fba785a5a53550be53b12baf9069bda8d160.tar.bz2
dexon-sol-tools-27d9fba785a5a53550be53b12baf9069bda8d160.tar.lz
dexon-sol-tools-27d9fba785a5a53550be53b12baf9069bda8d160.tar.xz
dexon-sol-tools-27d9fba785a5a53550be53b12baf9069bda8d160.tar.zst
dexon-sol-tools-27d9fba785a5a53550be53b12baf9069bda8d160.zip
Include web3 types via typeRoots and factor out common parts of tsconfig.json
Diffstat (limited to 'packages/0x.js/src')
-rw-r--r--packages/0x.js/src/0x.ts7
-rw-r--r--packages/0x.js/src/contract_wrappers/contract_wrapper.ts3
2 files changed, 9 insertions, 1 deletions
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.
diff --git a/packages/0x.js/src/contract_wrappers/contract_wrapper.ts b/packages/0x.js/src/contract_wrappers/contract_wrapper.ts
index eb7e042e7..d308d207e 100644
--- a/packages/0x.js/src/contract_wrappers/contract_wrapper.ts
+++ b/packages/0x.js/src/contract_wrappers/contract_wrapper.ts
@@ -177,6 +177,9 @@ export class ContractWrapper {
this._onLogStateChanged.bind(this, isRemoved),
);
}
+ private _setNetworkId(networkId: number): void {
+ this._networkId = networkId;
+ }
private _stopBlockAndLogStream(): void {
if (_.isUndefined(this._blockAndLogStreamerIfExists)) {
throw new Error(ZeroExError.SubscriptionNotFound);