import '../common/abstract-api-provider.js';
import AbstractBaseModule from '../common/abstract-base-module.js';
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';

/**
 * Module supporting `StatusList2021Credential` and `RevocationList2020Credential`.
 */
class AbstractStatusListCredentialModule extends 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$1 = withExtendedPrototypeProperties(
  [
    'getStatusListCredential',
    'createStatusListCredentialTx',
    'updateStatusListCredentialTx',
    'removeStatusListCredentialTx',
  ],
  AbstractStatusListCredentialModule,
);

export { AbstractStatusListCredentialModule$1 as default };
//# sourceMappingURL=module.js.map
