'use strict';

require('../common/abstract-api-provider.cjs');
var modules_abstract_common_abstractBaseModule = require('../common/abstract-base-module.cjs');
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');
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');

/** Class to create and update Blobs on chain. */
let AbstractBlobModule$1 = class AbstractBlobModule extends modules_abstract_common_abstractBaseModule {
  /**
   * Write a new blob on chain.
   * @param blobWithId
   * @param targetDid - Signer of the blob
   * @param signingKeyRef - The key id used by the signer. This will be used by the verifier (node) to fetch the public key for verification
   * @returns {Promise<*>}
   */
  async new(blobWithId, didKeypair, params = {}) {
    return await this.signAndSend(
      await this.newTx(blobWithId, didKeypair),
      params,
    );
  }

  /**
   * Get blob with given id from the chain. Throws if the blob can't be found.
   * @param {string} id - Can either be a full blob id like blob:dock:0x... or just the hex identifier
   * @returns {Promise<Blob>} - A 2-element array where the first is the author and the second is the blob contents.
   */
  async get(_id) {
    throw new Error('Unimplemented');
  }
};

var AbstractBlobModule = utils_inheritance.withExtendedPrototypeProperties(
  ['newTx', 'get'],
  AbstractBlobModule$1,
);

module.exports = AbstractBlobModule;
//# sourceMappingURL=module.cjs.map
