diff options
Diffstat (limited to 'src/0x.ts')
-rw-r--r-- | src/0x.ts | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -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; + } } |