aboutsummaryrefslogtreecommitdiffstats
path: root/src/0x.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-09-18 21:55:26 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-09-18 21:55:26 +0800
commit504e7a25a5ee138941ca35d4aad1b63444e47033 (patch)
treec60208acd76a53cae30050ebd768d9fa0562f88e /src/0x.ts
parent8db90538a17a0458fba6d2ed8a8b51bf9edf0fa4 (diff)
downloaddexon-sol-tools-504e7a25a5ee138941ca35d4aad1b63444e47033.tar
dexon-sol-tools-504e7a25a5ee138941ca35d4aad1b63444e47033.tar.gz
dexon-sol-tools-504e7a25a5ee138941ca35d4aad1b63444e47033.tar.bz2
dexon-sol-tools-504e7a25a5ee138941ca35d4aad1b63444e47033.tar.lz
dexon-sol-tools-504e7a25a5ee138941ca35d4aad1b63444e47033.tar.xz
dexon-sol-tools-504e7a25a5ee138941ca35d4aad1b63444e47033.tar.zst
dexon-sol-tools-504e7a25a5ee138941ca35d4aad1b63444e47033.zip
Make contract addresses configurable
Diffstat (limited to 'src/0x.ts')
-rw-r--r--src/0x.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/0x.ts b/src/0x.ts
index 8a69bec30..37e25eb0f 100644
--- a/src/0x.ts
+++ b/src/0x.ts
@@ -198,13 +198,16 @@ export class ZeroEx {
this._web3Wrapper,
this._getTokenTransferProxyAddressAsync.bind(this),
);
- this.exchange = new ExchangeWrapper(this._web3Wrapper, this.token);
+ const exchangeContractAddress = _.isUndefined(config) ? undefined : config.exchangeContractAddress;
+ this.exchange = new ExchangeWrapper(this._web3Wrapper, this.token, exchangeContractAddress);
this.proxy = new TokenTransferProxyWrapper(
this._web3Wrapper,
this._getTokenTransferProxyAddressAsync.bind(this),
);
- this.tokenRegistry = new TokenRegistryWrapper(this._web3Wrapper);
- this.etherToken = new EtherTokenWrapper(this._web3Wrapper, this.token);
+ const tokenRegistryContractAddress = _.isUndefined(config) ? undefined : config.tokenRegistryContractAddress;
+ this.tokenRegistry = new TokenRegistryWrapper(this._web3Wrapper, tokenRegistryContractAddress);
+ const etherTokenContractAddress = _.isUndefined(config) ? undefined : config.etherTokenContractAddress;
+ this.etherToken = new EtherTokenWrapper(this._web3Wrapper, this.token, etherTokenContractAddress);
}
/**
* Sets a new web3 provider for 0x.js. Updating the provider will stop all