From bcf25135a16f8d343d1e26c17fd56e6e541da99b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Stuczy=C5=84ski?= Date: Wed, 31 Mar 2021 10:15:42 +0100 Subject: [PATCH] Feature/validator client address getter (#554) * Added address getter for the client * Might as well bump the version number --- clients/validator/package.json | 2 +- clients/validator/src/index.ts | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/clients/validator/package.json b/clients/validator/package.json index 644ac097dc..8ef5351bfc 100644 --- a/clients/validator/package.json +++ b/clients/validator/package.json @@ -1,6 +1,6 @@ { "name": "@nymproject/nym-validator-client", - "version": "0.10.0-rc3", + "version": "0.10.0-rc4", "description": "A TypeScript client for interacting with smart contracts in Nym validators", "repository": "https://github.com/nymtech/nym", "main": "./dist/index.js", diff --git a/clients/validator/src/index.ts b/clients/validator/src/index.ts index 049e491a58..40874ea94d 100644 --- a/clients/validator/src/index.ts +++ b/clients/validator/src/index.ts @@ -43,6 +43,14 @@ export default class ValidatorClient { return new ValidatorClient(url, queryClient, contractAddress, stakeDenom) } + public get address(): string { + if (this.client instanceof NetClient) { + return this.client.clientAddress + } else { + return "" + } + } + /** * TODO: re-enable this once we move back to client-side wallets running on people's machines * instead of the web wallet.