Add getContractAddressAsync public method to proxy instance

This commit is contained in:
Fabio Berger
2017-08-23 17:01:45 +02:00
parent 9dca3b76b5
commit e3f7b18deb

View File

@@ -27,6 +27,15 @@ 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();
return proxyInstance.address;
}
private _invalidateContractInstance(): void {
delete this._tokenTransferProxyContractIfExists;
}