import '../../../utils/types/array.js';
import 'crypto';
import { withExtendedPrototypeProperties } from '../../../utils/inheritance.js';
import 'bs58';
import 'multiformats/bases/base58';
import 'varint';
import '../../../utils/encoding/ss-58.js';
import '../../../utils/types/object.js';
import '../../../utils/types/iterable.js';
import '../../../utils/types/set.js';
import 'blake2b';
import '../../../utils/types/bytes.js';
import '../../../utils/interfaces.js';
import '../../../utils/assert.js';
import '../../../utils/error.js';
import '../../../utils/types/string.js';

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$1 = withExtendedPrototypeProperties(
  [
    'methods',
    'isInitialized',
    'supportsIdentifier',
    'stateChangeBytes',
    'signAndSend',
  ],
  AbstractApiProvider,
);

export { AbstractApiProvider$1 as default };
//# sourceMappingURL=abstract-api-provider.js.map
