aboutsummaryrefslogtreecommitdiffstats
path: root/src/0x.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-06-19 23:42:25 +0800
committerFabio Berger <me@fabioberger.com>2017-06-19 23:42:25 +0800
commita8f706c79fb4244119a6d4ad03ea666689cc63fc (patch)
treef370ede530e5ae6f9b3530f7983c3e71e164156c /src/0x.ts
parentfe63a81f6a15a521c643b74f4442cdbf037202cf (diff)
parent36fe4c01aa5a86ef820c11bb0b2e4724c68e40b5 (diff)
downloaddexon-sol-tools-a8f706c79fb4244119a6d4ad03ea666689cc63fc.tar
dexon-sol-tools-a8f706c79fb4244119a6d4ad03ea666689cc63fc.tar.gz
dexon-sol-tools-a8f706c79fb4244119a6d4ad03ea666689cc63fc.tar.bz2
dexon-sol-tools-a8f706c79fb4244119a6d4ad03ea666689cc63fc.tar.lz
dexon-sol-tools-a8f706c79fb4244119a6d4ad03ea666689cc63fc.tar.xz
dexon-sol-tools-a8f706c79fb4244119a6d4ad03ea666689cc63fc.tar.zst
dexon-sol-tools-a8f706c79fb4244119a6d4ad03ea666689cc63fc.zip
Merge branch 'master' of github.com:0xProject/0x.js
Diffstat (limited to 'src/0x.ts')
-rw-r--r--src/0x.ts15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/0x.ts b/src/0x.ts
index d9e7b1b82..b75486902 100644
--- a/src/0x.ts
+++ b/src/0x.ts
@@ -14,9 +14,8 @@ import {ExchangeWrapper} from './contract_wrappers/exchange_wrapper';
import {TokenRegistryWrapper} from './contract_wrappers/token_registry_wrapper';
import {ecSignatureSchema} from './schemas/ec_signature_schema';
import {TokenWrapper} from './contract_wrappers/token_wrapper';
-import {ECSignature, ZeroExError, Order, SignedOrder} from './types';
+import {ECSignature, ZeroExError, Order, SignedOrder, Web3Provider} from './types';
import * as ExchangeArtifacts from './artifacts/Exchange.json';
-import {SchemaValidator} from './utils/schema_validator';
import {orderSchema} from './schemas/order_schemas';
// Customize our BigNumber instances
@@ -136,12 +135,12 @@ export class ZeroEx {
}
/**
* Instantiates a new ZeroEx instance that provides the public interface to the 0x.js library.
- * @param web3 The Web3.js instance you would like the 0x.js library to use for interacting with
- * the Ethereum network.
+ * @param provider The Web3.js Provider instance you would like the 0x.js library to use for interacting with
+ * the Ethereum network.
* @return An instance of the 0x.js ZeroEx class.
*/
- constructor(web3: Web3) {
- this._web3Wrapper = new Web3Wrapper(web3);
+ constructor(provider: Web3Provider) {
+ this._web3Wrapper = new Web3Wrapper(provider);
this.token = new TokenWrapper(this._web3Wrapper);
this.exchange = new ExchangeWrapper(this._web3Wrapper, this.token);
this.tokenRegistry = new TokenRegistryWrapper(this._web3Wrapper);
@@ -149,9 +148,9 @@ export class ZeroEx {
/**
* Sets a new provider for the web3 instance used by 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 Web3.Provider you would like the 0x.js library to use from now on.
+ * @param provider The Web3Provider you would like the 0x.js library to use from now on.
*/
- public async setProviderAsync(provider: Web3.Provider) {
+ public async setProviderAsync(provider: Web3Provider) {
this._web3Wrapper.setProvider(provider);
await this.exchange.invalidateContractInstanceAsync();
this.tokenRegistry.invalidateContractInstance();