How to use the @taquito/http-utils.STATUS_CODE.NOT_FOUND function in @taquito/http-utils

To help you get started, we’ve selected a few @taquito/http-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ecadlabs / taquito / packages / taquito-remote-signer / src / taquito-remote-signer.ts View on Github external
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;
    }
  }

@taquito/http-utils

*TypeDoc style documentation is available [here](https://taquito.io/typedoc/modules/_taquito_http_utils.html)*

Apache-2.0
Latest version published 1 month ago

Package Health Score

66 / 100
Full package analysis