{"version":3,"file":"abstract-api-provider.cjs","sources":["../../../../../src/modules/abstract/common/abstract-api-provider.js"],"sourcesContent":["import { withExtendedPrototypeProperties } from '../../../utils';\n\nclass AbstractApiProvider {\n  /**\n   * Returns array of the methods supported by the given API.\n   * @returns {Array<string>}\n   */\n  methods() {\n    throw new Error('Unimplemented');\n  }\n\n  /**\n   * Returns `true` in case the provided identifier is supported by the given API.\n   * @param {*} id\n   * @returns {boolean}\n   */\n  supportsIdentifier(_id) {\n    throw new Error('Unimplemented');\n  }\n\n  /**\n   * Returns `true` is the API was initialized.\n   * @returns {boolean}\n   */\n  isInitialized() {\n    throw new Error('Unimplemented');\n  }\n\n  /**\n   * Ensures that the SDK is initialized, throws an error otherwise.\n   *\n   * @returns {this}\n   */\n  ensureInitialized() {\n    if (!this.isInitialized()) {\n      throw new Error('SDK is not initialized');\n    }\n\n    return this;\n  }\n\n  /**\n   * Ensures that the SDK is not initialized, throws an error otherwise.\n   *\n   * @returns {this}\n   */\n  ensureNotInitialized() {\n    if (this.isInitialized()) {\n      throw new Error('SDK is already initialized');\n    }\n\n    return this;\n  }\n}\n\n/**\n * Base class that must be extended by all API providers.\n */\nexport default withExtendedPrototypeProperties(\n  [\n    'methods',\n    'isInitialized',\n    'supportsIdentifier',\n    'stateChangeBytes',\n    'signAndSend',\n  ],\n  AbstractApiProvider,\n);\n"],"names":["withExtendedPrototypeProperties","AbstractApiProvider"],"mappings":";;;;;;;;;;;;4BAEA,MAAM,mBAAmB,CAAC;AAC1B;AACA;AACA;AACA;AACA,EAAE,OAAO,GAAG;AACZ,IAAI,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC;AACpC,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE,kBAAkB,CAAC,GAAG,EAAE;AAC1B,IAAI,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC;AACpC,EAAE;;AAEF;AACA;AACA;AACA;AACA,EAAE,aAAa,GAAG;AAClB,IAAI,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC;AACpC,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE,iBAAiB,GAAG;AACtB,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE;AAC/B,MAAM,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC;AAC/C,IAAI;;AAEJ,IAAI,OAAO,IAAI;AACf,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE,oBAAoB,GAAG;AACzB,IAAI,IAAI,IAAI,CAAC,aAAa,EAAE,EAAE;AAC9B,MAAM,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC;AACnD,IAAI;;AAEJ,IAAI,OAAO,IAAI;AACf,EAAE;AACF;;AAEA;AACA;AACA;AACA,0BAAeA,qCAA+B;AAC9C,EAAE;AACF,IAAI,SAAS;AACb,IAAI,eAAe;AACnB,IAAI,oBAAoB;AACxB,IAAI,kBAAkB;AACtB,IAAI,aAAa;AACjB,GAAG;AACH,EAAEC,qBAAmB;AACrB,CAAC;;;;"}