aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts')
-rw-r--r--packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts b/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts
index b03571636..1373e7baf 100644
--- a/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts
+++ b/packages/0x.js/src/contract_wrappers/ether_token_wrapper.ts
@@ -163,6 +163,15 @@ export class EtherTokenWrapper extends ContractWrapper {
public unsubscribeAll(): void {
super.unsubscribeAll();
}
+ /**
+ * Retrieves the Ethereum address of the EtherToken contract deployed on the network
+ * that the user-passed web3 provider is connected to. If it's an unknown private network - undefined is returned.
+ * @returns The Ethereum address of the EtherToken contract or undefined.
+ */
+ public getContractAddressIfExists(): string | undefined {
+ const contractAddress = artifacts.EtherTokenArtifact.networks[this._networkId].address;
+ return contractAddress;
+ }
private _invalidateContractInstance(): void {
this.unsubscribeAll();
this._etherTokenContractsByAddress = {};