'use strict';

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

/**
 * Module supporting `StatusList2021Credential` and `RevocationList2020Credential`.
 */
let AbstractStatusListCredentialModule$1 = class AbstractStatusListCredentialModule extends modules_abstract_common_abstractBaseModule {
  /**
   * Fetches `StatusList2021Credential` with the supplied identifier.
   * @param {*} statusListCredentialId
   * @returns {Promise<StatusList2021Credential | null>}
   */
  async getStatusListCredential(_statusListCredentialId) {
    throw new Error('Unimplemented');
  }

  /**
   * Create a transaction to create a new status list credential on-chain.
   * @param id - is the unique id of the status list credential. The function will check whether `id` is already taken or not.
   * @param statusListCredential - the credential to be associated with the given `id`
   * @param didKeypair
   * @param params
   * @return {Promise<StatusListCredentialId>} - the extrinsic to sign and send.
   */
  async createStatusListCredential(
    id,
    statusListCredential,
    didKeypair,
    params,
  ) {
    return await this.signAndSend(
      await this.createStatusListCredentialTx(
        id,
        statusListCredential,
        didKeypair,
      ),
      params,
    );
  }

  /**
   * Create a transaction to update an existing status list credential on-chain.
   * @param id
   * @param statusListCredentialUpdate - Update for the status list credential.
   * @param didKeypair - `DID` signatures over an action with a nonce authorizing this action according to the existing policy.
   * @param params
   * @return {Promise<object>} - the extrinsic to sign and send.
   */
  async updateStatusListCredential(
    id,
    statusListCredential,
    didKeypair,
    params,
  ) {
    return await this.signAndSend(
      await this.updateStatusListCredentialTx(
        id,
        statusListCredential,
        didKeypair,
      ),
      params,
    );
  }

  /**
   * Create a transaction to remove an existing status list credential from the chain.
   * @param statusListCredentialId - is the unique id of the status list credential. The function will check whether `id` is already taken or not.
   * @param didKeypair - `DID` signatures over an action with a nonce authorizing this action according to the existing policy.
   * @param params
   * @return {Promise<object>} - the extrinsic to sign and send.
   */
  async removeStatusListCredential(
    statusListCredentialId,
    didKeypair,
    params,
  ) {
    return await this.signAndSend(
      await this.removeStatusListCredentialTx(
        statusListCredentialId,
        didKeypair,
      ),
      params,
    );
  }

  /**
   * Create a transaction to create a new status list credential on-chain.
   * @param id - is the unique id of the status list credential. The function will check whether `id` is already taken or not.
   * @param statusListCredential - the credential to be associated with the given `id`
   * @param didKeypair
   * @return {Promise<*>} - the extrinsic to sign and send.
   */
  async createStatusListCredentialTx(
    _id,
    _statusListCredential,
    _didKeypair,
  ) {
    throw new Error('Unimplemented');
  }

  /**
   * Create a transaction to update an existing status list credential on-chain.
   * @param id
   * @param statusListCredentialUpdate - Update for the status list credential.
   * @param didKeypair - `DID` signatures over an action with a nonce authorizing this action according to the existing policy.
   * @param params
   * @return {Promise<*>} - the extrinsic to sign and send.
   */
  async updateStatusListCredentialTx(
    _id,
    _statusListCredential,
    _didKeypair,
  ) {
    throw new Error('Unimplemented');
  }

  /**
   * Create a transaction to remove an existing status list credential from the chain.
   * @param statusListCredentialId - is the unique id of the status list credential. The function will check whether `id` is already taken or not.
   * @param didKeypair - `DID` signatures over an action with a nonce authorizing this action according to the existing policy.
   * @return {Promise<object>} - the extrinsic to sign and send.
   */
  async removeStatusListCredentialTx(
    _statusListCredentialId,
    _didKeypair,
  ) {
    throw new Error('Unimplemented');
  }
};

var AbstractStatusListCredentialModule = utils_inheritance.withExtendedPrototypeProperties(
  [
    'getStatusListCredential',
    'createStatusListCredentialTx',
    'updateStatusListCredentialTx',
    'removeStatusListCredentialTx',
  ],
  AbstractStatusListCredentialModule$1,
);

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