aboutsummaryrefslogtreecommitdiffstats
path: root/src/0x.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-09-18 18:26:16 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-09-18 21:18:04 +0800
commit8db90538a17a0458fba6d2ed8a8b51bf9edf0fa4 (patch)
tree0b7eecf9ec6b3f394203d6f3f6240eb2825ae9a9 /src/0x.ts
parentfe9f692a4f472e5decbda96aad6afaf98c10d850 (diff)
downloaddexon-sol-tools-8db90538a17a0458fba6d2ed8a8b51bf9edf0fa4.tar
dexon-sol-tools-8db90538a17a0458fba6d2ed8a8b51bf9edf0fa4.tar.gz
dexon-sol-tools-8db90538a17a0458fba6d2ed8a8b51bf9edf0fa4.tar.bz2
dexon-sol-tools-8db90538a17a0458fba6d2ed8a8b51bf9edf0fa4.tar.lz
dexon-sol-tools-8db90538a17a0458fba6d2ed8a8b51bf9edf0fa4.tar.xz
dexon-sol-tools-8db90538a17a0458fba6d2ed8a8b51bf9edf0fa4.tar.zst
dexon-sol-tools-8db90538a17a0458fba6d2ed8a8b51bf9edf0fa4.zip
Fetch tokenTransferProxy address from exchange contract
Diffstat (limited to 'src/0x.ts')
-rw-r--r--src/0x.ts14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/0x.ts b/src/0x.ts
index 5d5604780..8a69bec30 100644
--- a/src/0x.ts
+++ b/src/0x.ts
@@ -194,9 +194,15 @@ export class ZeroEx {
gasPrice,
};
this._web3Wrapper = new Web3Wrapper(provider, defaults);
- this.token = new TokenWrapper(this._web3Wrapper);
- this.proxy = new TokenTransferProxyWrapper(this._web3Wrapper);
+ this.token = new TokenWrapper(
+ this._web3Wrapper,
+ this._getTokenTransferProxyAddressAsync.bind(this),
+ );
this.exchange = new ExchangeWrapper(this._web3Wrapper, this.token);
+ this.proxy = new TokenTransferProxyWrapper(
+ this._web3Wrapper,
+ this._getTokenTransferProxyAddressAsync.bind(this),
+ );
this.tokenRegistry = new TokenRegistryWrapper(this._web3Wrapper);
this.etherToken = new EtherTokenWrapper(this._web3Wrapper, this.token);
}
@@ -306,4 +312,8 @@ export class ZeroEx {
});
return txReceiptPromise;
}
+ private async _getTokenTransferProxyAddressAsync(): Promise<string> {
+ const tokenTransferProxyAddress = await (this.exchange as any)._getTokenTransferProxyAddressAsync();
+ return tokenTransferProxyAddress;
+ }
}