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

/** Class to create and update Blobs on chain. */
class AbstractBlobModule extends 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$1 = withExtendedPrototypeProperties(
  ['newTx', 'get'],
  AbstractBlobModule,
);

export { AbstractBlobModule$1 as default };
//# sourceMappingURL=module.js.map
