'use strict';

require('../../utils/types/array.cjs');
var utils_types_string = require('../../utils/types/string.cjs');
require('crypto');
var utils_inheritance = require('../../utils/inheritance.cjs');
require('bs58');
require('multiformats/bases/base58');
require('varint');
require('../../utils/encoding/ss-58.cjs');
var modules_abstract_statusListCredential_module = require('../../modules/abstract/status-list-credential/module.cjs');
var resolver_generic_resolver = require('../generic/resolver.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('../../modules/abstract/common/abstract-api-provider.cjs');
require('../../modules/abstract/common/abstract-base-module.cjs');
require('../generic/const.cjs');

class StatusListResolver extends resolver_generic_resolver {
  prefix = 'status-list2021';

  get method() {
    return this.statusListCredentialModule.methods();
  }

  /**
   * @param {AbstractStatusListCredentialModule} statusListCredentialModule
   * @constructor
   */
  constructor(statusListCredentialModule) {
    super();

    /**
     * @type {AbstractStatusListCredentialModule}
     */
    this.statusListCredentialModule = utils_inheritance.ensureInstanceOf(
      statusListCredentialModule,
      modules_abstract_statusListCredential_module,
    );
  }

  async resolve(id) {
    const cred = await this.statusListCredentialModule.getStatusListCredential(utils_types_string.ensureString(id));

    return cred?.toJSON();
  }
}

module.exports = StatusListResolver;
//# sourceMappingURL=status-list2021-resolver.cjs.map
