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

class DockBlobResolver extends Resolver {
  prefix = 'blob';

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

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

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

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

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

export { DockBlobResolver as default };
//# sourceMappingURL=blob-resolver.js.map
