aboutsummaryrefslogtreecommitdiffstats
path: root/src/0x.ts
diff options
context:
space:
mode:
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;
+ }
}