'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');
var modules_abstract_blob_module = require('../../modules/abstract/blob/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('../../utils/types/string.cjs');
require('../../modules/abstract/common/abstract-api-provider.cjs');
require('../../modules/abstract/common/abstract-base-module.cjs');
require('../generic/const.cjs');

class DockBlobResolver extends resolver_generic_resolver {
  prefix = 'blob';

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

  /**
   * @param {AbstractBlobModule}
   * @constructor
   */
  constructor(blobModule) {
    super();

    /**
     * @type {AbstractBlobModule}
     */
    this.blobModule = utils_inheritance.ensureInstanceOf(blobModule, modules_abstract_blob_module);
  }

  async resolve(blobUri) {
    const [author, blob] = await this.blobModule.get(blobUri);

    return [String(author), blob.toObjectOrBytes()];
  }
}

module.exports = DockBlobResolver;
//# sourceMappingURL=blob-resolver.cjs.map
