import '../../utils/types/array.js';
import { ensureString } from '../../utils/types/string.js';
import 'crypto';
import { ensureInstanceOf } from '../../utils/inheritance.js';
import 'bs58';
import 'multiformats/bases/base58';
import 'varint';
import '../../utils/encoding/ss-58.js';
import AbstractStatusListCredentialModule from '../../modules/abstract/status-list-credential/module.js';
import Resolver from '../generic/resolver.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 '../../modules/abstract/common/abstract-api-provider.js';
import '../../modules/abstract/common/abstract-base-module.js';
import '../generic/const.js';

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

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

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

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

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

    return cred?.toJSON();
  }
}

export { StatusListResolver as default };
//# sourceMappingURL=status-list2021-resolver.js.map
