import TypedEnum from '../../generic/typed-enum.js';
import '../../generic/typed-bytes.js';
import '../../generic/typed-string.js';
import { maybeToJSONString } from '../../../utils/interfaces.js';
import '../../generic/typed-array.js';
import '../../generic/typed-tuple.js';
import '../../generic/typed-null.js';
import option from '../../generic/option.js';
import '../../../utils/types/array.js';
import 'crypto';
import 'bs58';
import 'multiformats/bases/base58';
import 'varint';
import '../../../utils/encoding/ss-58.js';
import '../../generic/typed-number.js';
import '../../generic/typed-set.js';
import '../../generic/typed-map.js';
import '../../generic/typed-struct.js';
import 'uuid';
import 'js-sha256';
import withProp from '../../generic/with-prop.js';
import '../../../vc/crypto/Bls12381BBDT16KeyPairDock2024.js';
import '../../../vc/crypto/Bls12381BBDT16MACDock2024.js';
import '../../../vc/crypto/Bls12381BBDT16MACProofDock2024.js';
import '../../../vc/crypto/Bls12381BBSKeyPairDock2023.js';
import '../../../vc/crypto/Bls12381BBSSignatureDock2022.js';
import '../../../vc/crypto/Bls12381BBSSignatureDock2023.js';
import '../../../vc/crypto/Bls12381BBSSignatureProofDock2022.js';
import '../../../vc/crypto/Bls12381BBSSignatureProofDock2023.js';
import '../../../vc/crypto/Bls12381BDDT16KeyPairDock2024.js';
import '../../../vc/crypto/Bls12381BDDT16MACDock2024.js';
import '../../../vc/crypto/Bls12381BDDT16MACProofDock2024.js';
import '../../../vc/crypto/Bls12381G2KeyPairDock2022.js';
import '../../../vc/crypto/Bls12381PSKeyPairDock2023.js';
import '../../../vc/crypto/Bls12381PSSignatureDock2023.js';
import '../../../vc/crypto/Bls12381PSSignatureProofDock2023.js';
import { Bls12381BBS23DockVerKeyName, Bls12381BBSDockVerKeyName, Bls12381PSDockVerKeyName, Bls12381BBDT16DockVerKeyName } from '../../../vc/crypto/constants.js';
import '@juanelas/base64';
import '../../../keypairs/keypair-secp256k1.js';
import '../../../vc/crypto/common/CustomLinkedDataSignature.js';
import '@stablelib/ed25519';
import '../../public-keys/public-key.js';
import '../../public-keys/public-key-sr25519-value.js';
import '../../public-keys/public-key-ed25519-value.js';
import '../../public-keys/public-key-secp256k1-value.js';
import '../../public-keys/public-key-x25519-value.js';
import '../../signatures/signature-value.js';
import '../../signatures/signature.js';
import '../../../keypairs/dock-keypair.js';
import '@transmute/json-web-signature';
import { BBSPublicKeyValue, BBSPlusPublicKeyValue, PSPublicKeyValue, BBDT16PublicKeyValue } from './value.js';
export { CheqdMainnetOffchainSignaturePublicKeyValue, CheqdOffchainSignaturePublicKeyValue, CheqdTestnetOffchainSignaturePublicKeyValue, DockOffchainSignaturePublicKeyValue, OffchainSignaturePublicKeyValue } from './value.js';
import { DockOffchainSignatureParamsRef, CheqdOffchainSignatureParamsRef, CheqdTestnetOffchainSignatureParamsRef, CheqdMainnetOffchainSignatureParamsRef } from './ref.js';
export { CheqdMainnetOffchainSignatureKeyRef, CheqdOffchainSignatureKeyRef, CheqdTestnetOffchainSignatureKeyRef, DockOffchainSignatureKeyRef, DockOrCheqdOffchainSignatureParamsRef } from './ref.js';
import { BBSParams, BBSPlusParams, PSParams, BBDT16Params } from '../params/index.js';
export { CheqdPublicKeyId, DockOrCheqdPublicKeyId, DockPublicKeyId } from './id.js';
import '../../../utils/types/iterable.js';
import '../../../utils/types/object.js';
import '../../../utils/inheritance.js';
import '../../../utils/types/set.js';
import '../../generic/with-base.js';
import '../../../utils/types/bytes.js';
import '../../../utils/types/string.js';
import '../../../utils/assert.js';
import '../../../utils/error.js';
import '../../generic/with-catch-null.js';
import '../../generic/with-eq.js';
import '../../generic/any-of.js';
import '../../generic/with-from.js';
import '../../generic/with-from-json-bytes.js';
import 'blake2b';
import '../../generic/create-placeholder.js';
import '../../generic/with-props.js';
import '@docknetwork/crypto-wasm-ts';
import '../../../vc/crypto/common/DockCryptoKeyPair.js';
import '@docknetwork/crypto-wasm-ts/lib/index.js';
import '../../../vc/crypto/common/DockCryptoSignature.js';
import 'jsonld-signatures';
import 'json-stringify-deterministic';
import 'semver/preload.js';
import '../../../vc/crypto/common/DockCryptoSignatureProof.js';
import 'elliptic';
import 'base64url';
import 'jsonld';
import '../../did/document/verification-method-ref.js';
import '../../generic/with-qualifier.js';
import '../../generic/utils.js';
import '../../generic/typed-bytes-array.js';
import '../../did/onchain/typed-did/index.js';
import '../../did/onchain/typed-did/did-method-key/did-method-key-public-key.js';
import '../../../utils/encoding/base-58-btc.js';
import '../../generic/sized.js';
import '../../../utils/types/number.js';
import '../../did/onchain/constants.js';
import '../../did/onchain/typed-did/signature.js';
import '../../did/onchain/typed-did/did-method-key/did-method-key-signature.js';
import '../../signatures/signature-ed25519-value.js';
import '../../signatures/signature-secp256k1-value.js';
import '../../did/onchain/typed-did/dock-did-value.js';
import '../../generic/typed-uuid.js';
import '../../did/onchain/typed-did/cheqd-did.js';
import '../../signatures/signature-sr25519-value.js';
import '../../../vc/jws.js';
import '../curve-type.js';
import '../params/id.js';
import '../../generic/with-from-dock-id.js';
import '../params/value.js';

class OffchainSignaturePublicKey extends TypedEnum {
  get bytes() {
    return this.value.bytes;
  }

  get paramsRef() {
    return this.value.paramsRef;
  }

  get curveType() {
    return this.value.curveType;
  }

  get participantId() {
    return this.value.participantId;
  }

  get params() {
    return this.value.params;
  }

  setParams(params) {
    const WithParams = withProp(
      this.constructor,
      'params',
      option(this.constructor.Params),
    );

    const withParams = WithParams.from(this);
    withParams.value.params = params;

    return withParams;
  }

  async withParams(paramsModule) {
    let params = null;
    if (this.paramsRef != null) {
      params = await paramsModule.getParams(...this.paramsRef);

      if (params == null) {
        throw new Error(
          `Parameters with reference (${maybeToJSONString(
            this.paramsRef,
          )}) not found on chain`,
        );
      }
    }

    return this.setParams(params);
  }
}
class BBSPublicKey extends OffchainSignaturePublicKey {
  static Class = BBSPublicKeyValue;

  static Params = BBSParams;

  static Type = 'bbs';

  static VerKeyType = Bls12381BBS23DockVerKeyName;
}
class BBSPlusPublicKey extends OffchainSignaturePublicKey {
  static Class = BBSPlusPublicKeyValue;

  static Params = BBSPlusParams;

  static Type = 'bbsPlus';

  static VerKeyType = Bls12381BBSDockVerKeyName;
}
class PSPublicKey extends OffchainSignaturePublicKey {
  static Class = PSPublicKeyValue;

  static Params = PSParams;

  static Type = 'ps';

  static VerKeyType = Bls12381PSDockVerKeyName;
}
class BBDT16PublicKey extends OffchainSignaturePublicKey {
  static Class = BBDT16PublicKeyValue;

  static Params = BBDT16Params;

  static Type = 'bbdt16';

  static VerKeyType = Bls12381BBDT16DockVerKeyName;
}

OffchainSignaturePublicKey.bindVariants(
  BBSPublicKey,
  BBSPlusPublicKey,
  PSPublicKey,
  BBDT16PublicKey,
);

class DockOffchainSignaturePublicKey extends withProp(
  OffchainSignaturePublicKey,
  'paramsRef',
  option(DockOffchainSignatureParamsRef),
) {}

class CheqdOffchainSignaturePublicKey extends withProp(
  OffchainSignaturePublicKey,
  'paramsRef',
  option(CheqdOffchainSignatureParamsRef),
) {}

class CheqdTestnetOffchainSignaturePublicKey extends withProp(
  OffchainSignaturePublicKey,
  'paramsRef',
  option(CheqdTestnetOffchainSignatureParamsRef),
) {}
class CheqdMainnetOffchainSignaturePublicKey extends withProp(
  OffchainSignaturePublicKey,
  'paramsRef',
  option(CheqdMainnetOffchainSignatureParamsRef),
) {}

export { BBDT16PublicKey, BBDT16PublicKeyValue, BBSPlusPublicKey, BBSPlusPublicKeyValue, BBSPublicKey, BBSPublicKeyValue, CheqdMainnetOffchainSignatureParamsRef, CheqdMainnetOffchainSignaturePublicKey, CheqdOffchainSignatureParamsRef, CheqdOffchainSignaturePublicKey, CheqdTestnetOffchainSignatureParamsRef, CheqdTestnetOffchainSignaturePublicKey, DockOffchainSignatureParamsRef, DockOffchainSignaturePublicKey, OffchainSignaturePublicKey, PSPublicKey, PSPublicKeyValue };
//# sourceMappingURL=index.js.map
