'use strict';

require('../../../utils/types/array.cjs');
require('crypto');
var utils_inheritance = require('../../../utils/inheritance.cjs');
require('bs58');
require('multiformats/bases/base58');
require('varint');
require('../../../utils/encoding/ss-58.cjs');
require('../../../utils/types/object.cjs');
require('../../../utils/types/iterable.cjs');
require('../../../utils/types/set.cjs');
require('blake2b');
require('../../../utils/types/bytes.cjs');
require('../../../utils/interfaces.cjs');
require('../../../utils/assert.cjs');
require('../../../utils/error.cjs');
require('../../../utils/types/string.cjs');

let AbstractApiProvider$1 = class AbstractApiProvider {
  /**
   * Returns array of the methods supported by the given API.
   * @returns {Array<string>}
   */
  methods() {
    throw new Error('Unimplemented');
  }

  /**
   * Returns `true` in case the provided identifier is supported by the given API.
   * @param {*} id
   * @returns {boolean}
   */
  supportsIdentifier(_id) {
    throw new Error('Unimplemented');
  }

  /**
   * Returns `true` is the API was initialized.
   * @returns {boolean}
   */
  isInitialized() {
    throw new Error('Unimplemented');
  }

  /**
   * Ensures that the SDK is initialized, throws an error otherwise.
   *
   * @returns {this}
   */
  ensureInitialized() {
    if (!this.isInitialized()) {
      throw new Error('SDK is not initialized');
    }

    return this;
  }

  /**
   * Ensures that the SDK is not initialized, throws an error otherwise.
   *
   * @returns {this}
   */
  ensureNotInitialized() {
    if (this.isInitialized()) {
      throw new Error('SDK is already initialized');
    }

    return this;
  }
};

/**
 * Base class that must be extended by all API providers.
 */
var AbstractApiProvider = utils_inheritance.withExtendedPrototypeProperties(
  [
    'methods',
    'isInitialized',
    'supportsIdentifier',
    'stateChangeBytes',
    'signAndSend',
  ],
  AbstractApiProvider$1,
);

module.exports = AbstractApiProvider;
//# sourceMappingURL=abstract-api-provider.cjs.map
