'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var cryptoWasmTs = require('@docknetwork/crypto-wasm-ts');
var utils_types_bytes = require('../../../utils/types/bytes.cjs');
require('../common/abstract-api-provider.cjs');
var modules_abstract_common_abstractBaseModule = require('../common/abstract-base-module.cjs');
var modules_abstract_common_withAbstractParams = require('../common/with-abstract-params.cjs');
var modules_abstract_common_withAbstractPublicKeys = require('../common/with-abstract-public-keys.cjs');
require('../../../types/blob/index.cjs');
require('../../../types/attest/index.cjs');
require('../../../types/did/index.cjs');
require('../../../types/generic/typed-enum.cjs');
require('../../../types/generic/typed-bytes.cjs');
require('../../../types/generic/typed-string.cjs');
require('../../../types/generic/typed-array.cjs');
require('../../../types/generic/typed-tuple.cjs');
require('../../../types/generic/typed-null.cjs');
require('../../../utils/types/array.cjs');
var utils_inheritance = require('../../../utils/inheritance.cjs');
require('bs58');
require('multiformats/bases/base58');
require('varint');
require('../../../utils/encoding/ss-58.cjs');
require('../../../types/generic/typed-number.cjs');
require('../../../types/generic/typed-set.cjs');
require('../../../types/generic/typed-map.cjs');
require('../../../types/generic/typed-struct.cjs');
require('uuid');
require('js-sha256');
require('../../../types/offchain-signatures/params/index.cjs');
require('../../../types/offchain-signatures/public-keys/index.cjs');
require('../../../types/offchain-signatures/curve-type.cjs');
require('../../../types/payload/cheqd.cjs');
require('../../../types/policy/index.cjs');
require('../../../types/public-keys/public-key.cjs');
require('../../../types/public-keys/public-key-sr25519-value.cjs');
require('../../../types/public-keys/public-key-ed25519-value.cjs');
require('../../../types/public-keys/public-key-secp256k1-value.cjs');
require('../../../types/public-keys/public-key-x25519-value.cjs');
require('../../../types/signatures/signature-value.cjs');
require('../../../types/signatures/signature.cjs');
require('../../../types/status-list-credential/index.cjs');
require('../../../types/anchor/index.cjs');
require('../../../types/accumulator/keys.cjs');
var types_accumulator_params = require('../../../types/accumulator/params.cjs');
var types_accumulator_publicKey = require('../../../types/accumulator/public-key.cjs');
var types_accumulator_accumulator = require('../../../types/accumulator/accumulator.cjs');
require('../../../types/accumulator/id.cjs');
require('../../../types/trust-registry/id.cjs');
require('crypto');
require('../../../utils/interfaces.cjs');
require('../../../utils/assert.cjs');
require('../../../utils/error.cjs');
require('../../../utils/types/string.cjs');
require('../../../utils/types/iterable.cjs');
require('../../../utils/types/object.cjs');
require('../../../utils/types/set.cjs');
require('../../../types/generic/with-prop.cjs');
require('../../../types/generic/with-props.cjs');
require('blake2b');
require('../../../types/generic/with-base.cjs');
require('../../../types/generic/with-catch-null.cjs');
require('../../../types/generic/with-eq.cjs');
require('../../../types/generic/any-of.cjs');
require('../../../types/generic/with-from.cjs');
require('../../../types/generic/with-from-json-bytes.cjs');
require('../../../types/generic/create-placeholder.cjs');
require('../../../types/blob/id.cjs');
require('../../../types/generic/sized.cjs');
require('../../../utils/types/number.cjs');
require('../../../types/generic/typed-uuid.cjs');
require('../../../types/generic/with-qualifier.cjs');
require('../../../types/generic/with-from-dock-id.cjs');
require('../../../types/did/onchain/typed-did/index.cjs');
require('../../../types/did/onchain/typed-did/did-method-key/did-method-key-public-key.cjs');
require('../../../utils/encoding/base-58-btc.cjs');
require('../../../types/did/onchain/constants.cjs');
require('../../../types/did/onchain/typed-did/signature.cjs');
require('../../../types/did/onchain/typed-did/did-method-key/did-method-key-signature.cjs');
require('../../../types/signatures/signature-ed25519-value.cjs');
require('../../../vc/crypto/constants.cjs');
require('../../../types/signatures/signature-secp256k1-value.cjs');
require('../../../types/signatures/signature-sr25519-value.cjs');
require('../../../types/did/onchain/typed-did/dock-did-value.cjs');
require('../../../types/generic/utils.cjs');
require('../../../types/generic/typed-bytes-array.cjs');
require('../../../types/did/onchain/typed-did/cheqd-did.cjs');
require('../../../types/blob/const.cjs');
require('../../../utils/mappings/dock-did-by-id.cjs');
require('../../../types/blob/blob.cjs');
require('../../../types/generic/option.cjs');
require('../../../types/did/offchain/index.cjs');
require('../../../types/did/offchain/doc-ref.cjs');
require('../../../types/did/onchain/index.cjs');
require('../../../types/did/onchain/controllers.cjs');
require('../../../types/did/onchain/verification-relationship.cjs');
require('../../../types/did/onchain/did-key.cjs');
require('../../../vc/crypto/Bls12381BBDT16KeyPairDock2024.cjs');
require('../../../vc/crypto/common/DockCryptoKeyPair.cjs');
require('../../../vc/crypto/Bls12381BBDT16MACDock2024.cjs');
require('@docknetwork/crypto-wasm-ts/lib/index.js');
require('../../../vc/crypto/common/DockCryptoSignature.cjs');
require('jsonld-signatures');
require('json-stringify-deterministic');
require('semver/preload.js');
require('../../../vc/crypto/common/CustomLinkedDataSignature.cjs');
require('base64url');
require('jsonld');
require('../../../types/did/document/verification-method-ref.cjs');
require('../../../vc/jws.cjs');
require('../../../vc/crypto/Bls12381BBDT16MACProofDock2024.cjs');
require('../../../vc/crypto/common/DockCryptoSignatureProof.cjs');
require('../../../vc/crypto/Bls12381BBSKeyPairDock2023.cjs');
require('../../../vc/crypto/Bls12381BBSSignatureDock2022.cjs');
require('../../../vc/crypto/Bls12381G2KeyPairDock2022.cjs');
require('../../../vc/crypto/Bls12381BBSSignatureDock2023.cjs');
require('../../../vc/crypto/Bls12381BBSSignatureProofDock2022.cjs');
require('../../../vc/crypto/Bls12381BBSSignatureProofDock2023.cjs');
require('../../../vc/crypto/Bls12381BDDT16KeyPairDock2024.cjs');
require('../../../vc/crypto/Bls12381BDDT16MACDock2024.cjs');
require('../../../vc/crypto/Bls12381BDDT16MACProofDock2024.cjs');
require('../../../vc/crypto/Bls12381PSKeyPairDock2023.cjs');
require('../../../vc/crypto/Bls12381PSSignatureDock2023.cjs');
require('../../../vc/crypto/Bls12381PSSignatureProofDock2023.cjs');
require('@juanelas/base64');
require('../../../keypairs/keypair-secp256k1.cjs');
require('elliptic');
require('../../../keypairs/dock-keypair.cjs');
require('@stablelib/ed25519');
require('@transmute/json-web-signature');
require('../../../types/offchain-signatures/public-keys/value.cjs');
require('../../../types/offchain-signatures/public-keys/ref.cjs');
require('../../../types/offchain-signatures/params/id.cjs');
require('../../../types/offchain-signatures/params/value.cjs');
require('../../../types/offchain-signatures/public-keys/id.cjs');
require('../../../types/did/onchain/verification-method-signature.cjs');
require('../../../keypairs/did-keypair.cjs');
require('../../../types/did/document/verification-method-ref-or-ident-ref.cjs');
require('../../../types/did/document/ident-ref.cjs');
require('../../../types/did/document/index.cjs');
require('../../../types/did/document/service-endpoint.cjs');
require('../../../types/did/document/verification-method.cjs');
require('../../../utils/encoding/base-58.cjs');
require('../../../types/generic/with-base58.cjs');
require('../../../types/generic/with-base58btc.cjs');
require('../../../types/generic/with-multibase.cjs');
require('../../../utils/encoding/multibase.cjs');
require('../../../types/did/document/verification-method-type.cjs');
require('../../../types/did/document/verification-method-ref-or-cheqd-verification-method.cjs');
require('../../../types/did/document/const.cjs');
require('../../../types/policy/one-of-policy-value.cjs');
require('../../../types/status-list-credential/status-list-credential-value.cjs');
require('../../../vc/status-list2021-credential.cjs');
require('@digitalcredentials/vc-status-list');
require('pako');
require('../../../vc/verifiable-credential.cjs');
require('../../../vc/helpers.cjs');
require('../../../vc/document-loader.cjs');
require('../../../vc/contexts.cjs');
require('../../../vc/contexts/vc-examples-v1.cjs');
require('../../../vc/contexts/security_context.cjs');
require('../../../vc/contexts/status-list-21.cjs');
require('../../../vc/contexts/private-status-list-21.cjs');
require('../../../utils/json-fetch.cjs');
require('../../../vc/crypto/EcdsaSecp256k1Signature2019.cjs');
require('../../../vc/crypto/EcdsaSecp256k1VerificationKey2019.cjs');
require('../../../vc/crypto/Ed25519Signature2018.cjs');
require('../../../vc/crypto/Ed25519VerificationKey2018.cjs');
require('../../../keypairs/keypair-ed25519.cjs');
require('../../../vc/crypto/Ed25519Signature2020.cjs');
require('../../../vc/crypto/Ed25519VerificationKey2020.cjs');
require('../../../vc/crypto/JsonWebSignature2020.cjs');
require('../../../vc/credentials.cjs');
require('../../../vc/CredentialIssuancePurpose.cjs');
require('../../../vc/schema.cjs');
require('jsonschema');
require('../../../vc/constants.cjs');
require('../../../vc/revocation.cjs');
require('blakejs');
require('../../../utils/ident/ensure-ident.cjs');
require('../../../utils/ident/matchers.cjs');
require('../../../types/status-list-credential/id.cjs');
require('../../../types/accumulator/variants.cjs');

/* eslint-disable camelcase */


const AccumulatorType = {
  VBPos: 0,
  VBUni: 1,
  KBUni: 2,
};

/** Class to manage accumulators on chain */
let AbstractAccumulatorModule$1 = class AbstractAccumulatorModule extends modules_abstract_common_withAbstractParams(
  modules_abstract_common_withAbstractPublicKeys(modules_abstract_common_abstractBaseModule),
) {
  static Params = types_accumulator_params.AccumulatorParams;

  static PublicKey = types_accumulator_publicKey.AccumulatorPublicKey;

  /**
   * Return the accumulated value as hex
   * @param accumulated {Uint8Array|KBUniversalAccumulatorValue}
   * @param typ {number} - Type of the accumulator
   * @returns {string}
   */
  static accumulatedAsHex(accumulated, typ = AccumulatorType.VBPos) {
    if (typ === AccumulatorType.VBPos || typ === AccumulatorType.VBUni) {
      return utils_types_bytes.normalizeToHex(accumulated);
    } else if (typ === AccumulatorType.KBUni) {
      return utils_types_bytes.normalizeToHex(accumulated.toBytes());
    } else {
      throw new Error(`Unknown accumulator type ${typ}`);
    }
  }

  /**
   * Parse the given accumulated value in hex form
   * @param accumulated {string}
   * @param typ {number} - Type of the accumulator
   * @returns {Uint8Array|KBUniversalAccumulatorValue}
   */
  static accumulatedFromHex(accumulated, typ = AccumulatorType.VBPos) {
    if (typ === AccumulatorType.VBPos || typ === AccumulatorType.VBUni) {
      return utils_types_bytes.normalizeToU8a(accumulated);
    } else if (typ === AccumulatorType.KBUni) {
      return cryptoWasmTs.KBUniversalAccumulatorValue.fromBytes(utils_types_bytes.normalizeToU8a(accumulated));
    } else {
      throw new Error(`Unknown accumulator type ${typ}`);
    }
  }

  /**
   * Creates and stores a new accumulator on the blockchain
   *
   * An accumulator is a cryptographic data structure used to maintain an aggregate value that can be updated incrementally.
   * This method creates a new accumulator instance with the given ID and initial state.
   *
   * @param {string} id - Unique identifier for the accumulator
   * @param {Accumulator} accumulator - Initial accumulator value to store
   * @param {DidKeypair} didKeypair - Keypair used to sign the transaction
   * @returns {Promise<*>} Promise resolving to the transaction result
   */
  async addAccumulator(id, accumulator, didKeypair, params) {
    return await this.signAndSend(
      await this.addAccumulatorTx(id, accumulator, didKeypair),
      params,
    );
  }

  /**
   * Updates an existing accumulator on the blockchain
   *
   * This method replaces the current state of an accumulator with a new value.
   * The accumulator must already exist (be previously created) to be updated.
   *
   * @param {string} id - Unique identifier of the accumulator to update
   * @param {AccumulatorValue} accumulator - New accumulator value to set
   * @param {DidKeypair} didKeypair - Keypair used to sign the transaction
   * @returns {Promise<*>} Promise resolving to the transaction result
   */
  async updateAccumulator(
    id,
    accumulator,
    { additions, removals, witnessUpdateInfo },
    didKeypair,
    params,
  ) {
    return await this.signAndSend(
      await this.updateAccumulatorTx(
        id,
        accumulator,
        { additions, removals, witnessUpdateInfo },
        didKeypair,
      ),
      params,
    );
  }

  /**
   * Remove the accumulator from chain. This frees up the id for reuse.
   *
   * @param id - id to remove
   * @param didKeypair - Signer's keypair reference
   * @param params - Transaction parameters.
   * @returns {Promise<*>}
   */
  async removeAccumulator(id, didKeypair, params) {
    return await this.signAndSend(
      await this.removeAccumulatorTx(id, didKeypair),
      params,
    );
  }

  /**
   * Add a positive (add-only) accumulator
   * @param id - Unique accumulator id
   * @param accumulated - Current accumulated value.
   * @param publicKeyRef - Reference to accumulator public key. If the reference contains the key id 0, it means the accumulator does not
   * have any public key on the chain. This is useful for KVAC.
   * @param didKeypair - Signer's keypair reference
   * @param params - Transaction parameters.
   * @returns {Promise<*>}
   */
  async addPositiveAccumulator(
    id,
    accumulated,
    publicKeyRef,
    didKeypair,
    params,
  ) {
    return await this.signAndSend(
      await this.addPositiveAccumulatorTx(
        id,
        accumulated,
        publicKeyRef,
        didKeypair,
      ),
      params,
    );
  }

  /**
   * Add universal (supports add/remove) accumulator
   * @param id - Unique accumulator id
   * @param accumulated - Current accumulated value.
   * @param publicKeyRef - Reference to accumulator public key. If the reference contains the key id 0, it means the accumulator does not
   * have any public key on the chain. This is useful for KVAC.
   * @param maxSize - Maximum size of the accumulator
   * @param didKeypair - Signer's keypair reference
   * @param params - Transaction parameters.
   * @returns {Promise<*>}
   */
  async addUniversalAccumulator(
    id,
    accumulated,
    publicKeyRef,
    maxSize,
    didKeypair,
    params,
  ) {
    return await this.signAndSend(
      await this.addUniversalAccumulatorTx(
        id,
        accumulated,
        publicKeyRef,
        maxSize,
        didKeypair,
      ),
      params,
    );
  }

  /**
   * Add KB universal (supports add/remove) accumulator
   * @param id - Unique accumulator id
   * @param accumulated - Current accumulated value.
   * @param publicKeyRef - Reference to accumulator public key. If the reference contains the key id 0, it means the accumulator does not
   * have any public key on the chain. This is useful for KVAC.
   * @param didKeypair - Signer's keypair reference
   * @param params - Transaction parameters.
   * @returns {Promise<*>}
   */
  async addKBUniversalAccumulator(
    id,
    accumulated,
    publicKeyRef,
    didKeypair,
    params,
  ) {
    return await this.signAndSend(
      await this.addKBUniversalAccumulatorTx(
        id,
        accumulated,
        publicKeyRef,
        didKeypair,
      ),
      params,
    );
  }

  /**
   * Update existing positive (add-only) accumulator
   * @param id - Unique accumulator id
   * @param accumulated - Current accumulated value.
   * @param publicKeyRef - Reference to accumulator public key. If the reference contains the key id 0, it means the accumulator does not
   * have any public key on the chain. This is useful for KVAC.
   * @param didKeypair - Signer's keypair reference
   * @param params - Transaction parameters.
   * @returns {Promise<*>}
   */
  async updatePositiveAccumulator(
    id,
    accumulated,
    { additions, removals, witnessUpdateInfo },
    publicKeyRef,
    didKeypair,
    params,
  ) {
    return await this.signAndSend(
      await this.updatePositiveAccumulatorTx(
        id,
        accumulated,
        { additions, removals, witnessUpdateInfo },
        publicKeyRef,
        didKeypair,
      ),
      params,
    );
  }

  /**
   * Update existing universal (supports update/remove) accumulator
   * @param id - Unique accumulator id
   * @param accumulated - Current accumulated value.
   * @param publicKeyRef - Reference to accumulator public key. If the reference contains the key id 0, it means the accumulator does not
   * have any public key on the chain. This is useful for KVAC.
   * @param maxSize - Maximum size of the accumulator
   * @param didKeypair - Signer's keypair reference
   * @param params - Transaction parameters.
   * @returns {Promise<*>}
   */
  async updateUniversalAccumulator(
    id,
    accumulated,
    { additions, removals, witnessUpdateInfo },
    publicKeyRef,
    maxSize,
    didKeypair,
    params,
  ) {
    return await this.signAndSend(
      await this.updateUniversalAccumulatorTx(
        id,
        accumulated,
        { additions, removals, witnessUpdateInfo },
        publicKeyRef,
        maxSize,
        didKeypair,
      ),
      params,
    );
  }

  /**
   * Update existing KB universal (supports update/remove) accumulator
   * @param id - Unique accumulator id
   * @param accumulated - Current accumulated value.
   * @param publicKeyRef - Reference to accumulator public key. If the reference contains the key id 0, it means the accumulator does not
   * have any public key on the chain. This is useful for KVAC.
   * @param didKeypair - Signer's keypair reference
   * @returns {Promise<*>}
   */
  async updateKBUniversalAccumulator(
    id,
    accumulated,
    { additions, removals, witnessUpdateInfo },
    publicKeyRef,
    didKeypair,
    params,
  ) {
    return await this.signAndSend(
      await this.updateKBUniversalAccumulatorTx(
        id,
        accumulated,
        { additions, removals, witnessUpdateInfo },
        publicKeyRef,
        didKeypair,
      ),
      params,
    );
  }

  /**
   * Add a positive (add-only) accumulator
   * @param id - Unique accumulator id
   * @param accumulated - Current accumulated value.
   * @param publicKeyRef - Reference to accumulator public key. If the reference contains the key id 0, it means the accumulator does not
   * have any public key on the chain. This is useful for KVAC.
   * @param didKeypair - Signer's keypair reference
   * @returns {Promise<*>}
   */
  async addPositiveAccumulatorTx(id, accumulated, publicKeyRef, didKeypair) {
    return await this.addAccumulatorTx(
      id,
      new types_accumulator_accumulator.PositiveAccumulator(new types_accumulator_accumulator.AccumulatorCommon(accumulated, publicKeyRef)),
      didKeypair,
    );
  }

  /**
   * Add universal (supports add/remove) accumulator
   * @param id - Unique accumulator id
   * @param accumulated - Current accumulated value.
   * @param publicKeyRef - Reference to accumulator public key. If the reference contains the key id 0, it means the accumulator does not
   * have any public key on the chain. This is useful for KVAC.
   * @param maxSize - Maximum size of the accumulator
   * @param didKeypair - Signer's keypair reference
   * @returns {Promise<*>}
   */
  async addUniversalAccumulatorTx(
    id,
    accumulated,
    publicKeyRef,
    maxSize,
    didKeypair,
  ) {
    return await this.addAccumulatorTx(
      id,
      new types_accumulator_accumulator.UniversalAccumulator(
        new types_accumulator_accumulator.UniversalAccumulator.Class(
          new types_accumulator_accumulator.AccumulatorCommon(accumulated, publicKeyRef),
          maxSize,
        ),
      ),
      didKeypair,
    );
  }

  /**
   * Add KB universal (supports add/remove) accumulator
   * @param id - Unique accumulator id
   * @param accumulated - Current accumulated value.
   * @param publicKeyRef - Reference to accumulator public key. If the reference contains the key id 0, it means the accumulator does not
   * have any public key on the chain. This is useful for KVAC.
   * @param didKeypair - Signer's keypair reference
   * @returns {Promise<*>}
   */
  async addKBUniversalAccumulatorTx(id, accumulated, publicKeyRef, didKeypair) {
    return await this.addAccumulatorTx(
      id,
      new types_accumulator_accumulator.KBUniversalAccumulator(
        new types_accumulator_accumulator.AccumulatorCommon(accumulated, publicKeyRef),
      ),
      didKeypair,
    );
  }

  /**
   * Update a positive (add-only) accumulator
   * @param id - Unique accumulator id
   * @param accumulated - Current accumulated value.
   * @param publicKeyRef - Reference to accumulator public key. If the reference contains the key id 0, it means the accumulator does not
   * have any public key on the chain. This is useful for KVAC.
   * @param didKeypair - Signer's keypair reference
   * @returns {Promise<*>}
   */
  async updatePositiveAccumulatorTx(
    id,
    accumulated,
    { additions, removals, witnessUpdateInfo },
    publicKeyRef,
    didKeypair,
  ) {
    return await this.updateAccumulatorTx(
      id,
      new types_accumulator_accumulator.PositiveAccumulator(new types_accumulator_accumulator.AccumulatorCommon(accumulated, publicKeyRef)),
      {
        additions,
        removals,
        witnessUpdateInfo,
      },
      didKeypair,
    );
  }

  /**
   * Update universal (supports add/remove) accumulator
   * @param id - Unique accumulator id
   * @param accumulated - Current accumulated value.
   * @param publicKeyRef - Reference to accumulator public key. If the reference contains the key id 0, it means the accumulator does not
   * have any public key on the chain. This is useful for KVAC.
   * @param maxSize - Maximum size of the accumulator
   * @param didKeypair - Signer's keypair reference
   * @returns {Promise<*>}
   */
  // eslint-disable-next-line sonarjs/no-identical-functions
  async updateUniversalAccumulatorTx(
    id,
    accumulated,
    { additions, removals, witnessUpdateInfo },
    publicKeyRef,
    maxSize,
    didKeypair,
  ) {
    return await this.updateAccumulatorTx(
      id,
      new types_accumulator_accumulator.UniversalAccumulator(
        new types_accumulator_accumulator.UniversalAccumulator.Class(
          new types_accumulator_accumulator.AccumulatorCommon(accumulated, publicKeyRef),
          maxSize,
        ),
      ),
      {
        additions,
        removals,
        witnessUpdateInfo,
      },
      didKeypair,
    );
  }

  /**
   * Update KB universal (supports add/remove) accumulator
   * @param id - Unique accumulator id
   * @param accumulated - Current accumulated value.
   * @param publicKeyRef - Reference to accumulator public key. If the reference contains the key id 0, it means the accumulator does not
   * have any public key on the chain. This is useful for KVAC.
   * @param didKeypair - Signer's keypair reference
   * @returns {Promise<*>}
   */
  // eslint-disable-next-line sonarjs/no-identical-functions
  async updateKBUniversalAccumulatorTx(
    id,
    accumulated,
    { additions, removals, witnessUpdateInfo },
    publicKeyRef,
    didKeypair,
  ) {
    return await this.updateAccumulatorTx(
      id,
      new types_accumulator_accumulator.KBUniversalAccumulator(
        new types_accumulator_accumulator.AccumulatorCommon(accumulated, publicKeyRef),
      ),
      {
        additions,
        removals,
        witnessUpdateInfo,
      },
      didKeypair,
    );
  }

  /**
   * Add an accumulator to the chain.
   *
   * @param id - Unique accumulator id
   * @param accumulator - Accumulator value.
   * @param signingKeyRef - Signer's keypair reference
   * @returns {Promise<*>}
   */
  async addAccumulatorTx(_id, _accumulator, _didKeypair) {
    throw new Error('Unimplemented');
  }

  /**
   * Update existing accumulator on the chain.
   *
   * @param id - Unique accumulator id
   * @param accumulator - Accumulator value.
   * @param {object} changes
   * @param signingKeyRef - Signer's keypair reference
   * @returns {Promise<*>}
   */
  async updateAccumulatorTx(
    _id,
    _accumulator,
    { additions: _, removals: __, witnessUpdateInfo: ___ },
    _didKeypair,
  ) {
    throw new Error('Unimplemented');
  }

  /**
   * Get the accumulator as an object. The field `type` in object specifies whether it is "positive" or "universal".
   * Fields `created` and `lastModified` are identifiers where the accumulator was created and last updated respectively.
   * Field `accumulated` contains the current accumulated value.
   * @param id
   * @param includeKey - Fetch public key for the given accumulator.
   * @param includeKeyParams - Fetch public key params.
   * @returns {Promise<Accumulator|null>}
   */
  async getAccumulator(_id, _includeKey = false, _includeKeyParams = false) {
    throw new Error('Unimplemented');
  }

  /**
   * Update given witness by downloading necessary accumulators (blocks) and applying the updates if found.
   * **Both `from` and `to` are inclusive.**
   *
   * @param accumulatorId
   * @param member
   * @param witness - this will be updated to the latest witness
   * @param from - identifier to start from (block number or collection item id)
   * @param to - identifier to end in (block number or collection item id)
   * @returns {Promise<void>}
   */
  async updateWitness(_accumulatorId, _member, _witness, _from, _to) {
    throw new Error('Unimplemented');
  }

  /**
   * Retrieves history for the accumulator with supplied identifier.
   *
   * @param {*} _accumulatorId
   * @returns {?{ created: *, updates: Array<*> }}
   */
  async accumulatorHistory(_accumulatorId) {
    throw new Error('Unimplemented');
  }

  /**
   * Retrieves `Array` containing all versions of the accumulator with supplied identifier.
   *
   * @param {*} _accumulatorId
   * @returns {Array<*>}
   */
  async accumulatorVersions(_accumulatorId) {
    throw new Error('Unimplemented');
  }
};

var AbstractAccumulatorModule = utils_inheritance.withExtendedPrototypeProperties(
  [
    'getAccumulator',
    'addAccumulatorTx',
    'updateAccumulatorTx',
    'removeAccumulatorTx',
    'updateWitness',
  ],
  AbstractAccumulatorModule$1,
);

exports.AccumulatorType = AccumulatorType;
exports.default = AbstractAccumulatorModule;
//# sourceMappingURL=module.cjs.map
