Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async publicKey(): Promise {
try {
const { public_key } = await this.http.createRequest({
url: this.createURL(`/keys/${this.pkh}`),
method: 'GET',
});
return public_key;
} catch (ex) {
if (ex instanceof HttpResponseError) {
if (ex.status === STATUS_CODE.NOT_FOUND) {
throw new KeyNotFoundError(`Key not found: ${this.pkh}`, ex);
}
}
throw ex;
}
}