aboutsummaryrefslogtreecommitdiffstats
path: root/src/0x.js.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/0x.js.ts')
-rw-r--r--src/0x.js.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/0x.js.ts b/src/0x.js.ts
index f3da005f8..3dfdfbfcd 100644
--- a/src/0x.js.ts
+++ b/src/0x.js.ts
@@ -137,6 +137,14 @@ export class ZeroEx {
this.tokenRegistry = new TokenRegistryWrapper(this.web3Wrapper);
}
/**
+ * Sets a new provider for the web3 instance used by 0x.js internally and invalidates any instantiated
+ * contract instances created with the old provider.
+ */
+ public setProvider(provider: Web3.Provider) {
+ this.web3Wrapper.setProvider(provider);
+ this.exchange.invalidateExchangeContract();
+ }
+ /**
* Signs an orderHash and returns it's elliptic curve signature
* This method currently supports TestRPC, Geth and Parity above and below V1.6.6
*/