'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('../common/abstract-api-provider.cjs');
var modules_abstract_common_abstractBaseModule = require('../common/abstract-base-module.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');

/**
 * `Trust Registry` module.
 */
let AbstractTrustRegistryModule$1 = class AbstractTrustRegistryModule extends modules_abstract_common_abstractBaseModule {
  /**
   * Retrieves registry with provided identifier owned by supplied convener did.
   * @param {*} did
   * @param {*} id
   */
  async getRegistry(_did, _id) {
    throw new Error('Unimplemented');
  }

  /**
   * Retrieves all registries owned by supplied convener did.
   * @param {*} did
   */
  async getAllRegistriesByDid(_did) {
    throw new Error('Unimplemented');
  }

  /**
   * Creates new registry.
   *
   * @param {*} id
   * @param {*} info
   * @param {*} schemas
   * @param {*} didKeypair
   * @param {*} params
   * @returns Promise<*>
   */
  async createRegistry(id, info, schemas, didKeypair, params) {
    return await this.signAndSend(
      await this.createRegistryTx(id, info, schemas, didKeypair),
      params,
    );
  }

  /**
   * Updates existing registry.
   *
   * @param {*} id
   * @param {*} info
   * @param {*} schemas
   * @param {*} signerDid
   * @param {*} signingKeyRef
   * @param {*} params
   * @returns Promise<*>
   */
  async updateRegistry(id, info, schemas, didKeypair, params) {
    return await this.signAndSend(
      await this.updateRegistryTx(id, info, schemas, didKeypair),
      params,
    );
  }
};

var AbstractTrustRegistryModule = utils_inheritance.withExtendedPrototypeProperties(
  [
    'getRegistry',
    'getAllRegistriesByDid',
    'createRegistryTx',
    'updateRegistryTx',
  ],
  AbstractTrustRegistryModule$1,
);

module.exports = AbstractTrustRegistryModule;
//# sourceMappingURL=module.cjs.map
