diff options
author | Fabio Berger <me@fabioberger.com> | 2017-08-23 23:37:31 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-23 23:37:31 +0800 |
commit | bd7102efbee0833bd0274edbe248db27b53aa950 (patch) | |
tree | b1463dd08c613aefddbe0d53ee85ee2cbaf84cc6 /src/contract_wrappers | |
parent | d837e27739614ce6a132e8583409425f726bef89 (diff) | |
parent | f7010dfa3a4bbd00ba1f08b1bed411c6a60008a4 (diff) | |
download | dexon-sol-tools-bd7102efbee0833bd0274edbe248db27b53aa950.tar dexon-sol-tools-bd7102efbee0833bd0274edbe248db27b53aa950.tar.gz dexon-sol-tools-bd7102efbee0833bd0274edbe248db27b53aa950.tar.bz2 dexon-sol-tools-bd7102efbee0833bd0274edbe248db27b53aa950.tar.lz dexon-sol-tools-bd7102efbee0833bd0274edbe248db27b53aa950.tar.xz dexon-sol-tools-bd7102efbee0833bd0274edbe248db27b53aa950.tar.zst dexon-sol-tools-bd7102efbee0833bd0274edbe248db27b53aa950.zip |
Merge pull request #130 from 0xProject/addProxyAddressMethod
Add public TokenTransferProxy address getter
Diffstat (limited to 'src/contract_wrappers')
-rw-r--r-- | src/contract_wrappers/exchange_wrapper.ts | 3 | ||||
-rw-r--r-- | src/contract_wrappers/token_transfer_proxy_wrapper.ts | 10 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts index d5e272c12..7994ee72f 100644 --- a/src/contract_wrappers/exchange_wrapper.ts +++ b/src/contract_wrappers/exchange_wrapper.ts @@ -623,7 +623,8 @@ export class ExchangeWrapper extends ContractWrapper { */ public async getContractAddressAsync(): Promise<string> { const exchangeInstance = await this._getExchangeContractAsync(); - return exchangeInstance.address; + const exchangeAddress = exchangeInstance.address; + return exchangeAddress; } private async _invalidateContractInstancesAsync(): Promise<void> { await this.stopWatchingAllEventsAsync(); diff --git a/src/contract_wrappers/token_transfer_proxy_wrapper.ts b/src/contract_wrappers/token_transfer_proxy_wrapper.ts index 39263efac..da17d79ff 100644 --- a/src/contract_wrappers/token_transfer_proxy_wrapper.ts +++ b/src/contract_wrappers/token_transfer_proxy_wrapper.ts @@ -27,6 +27,16 @@ export class TokenTransferProxyWrapper extends ContractWrapper { const authorizedAddresses = await tokenTransferProxyContractInstance.getAuthorizedAddresses.call(); return authorizedAddresses; } + /** + * Retrieves the Ethereum address of the TokenTransferProxy contract deployed on the network + * that the user-passed web3 provider is connected to. + * @returns The Ethereum address of the TokenTransferProxy contract being used. + */ + public async getContractAddressAsync(): Promise<string> { + const proxyInstance = await this._getTokenTransferProxyContractAsync(); + const proxyAddress = proxyInstance.address; + return proxyAddress; + } private _invalidateContractInstance(): void { delete this._tokenTransferProxyContractIfExists; } |