'use strict';

require('../../../utils/types/array.cjs');
var utils_types_bytes = require('../../../utils/types/bytes.cjs');
var utils_inheritance = require('../../../utils/inheritance.cjs');
require('bs58');
require('multiformats/bases/base58');
require('varint');
require('../../../utils/encoding/ss-58.cjs');
require('../../generic/typed-enum.cjs');
require('../../generic/typed-bytes.cjs');
require('../../generic/typed-string.cjs');
require('../../generic/typed-array.cjs');
require('../../generic/typed-tuple.cjs');
require('../../generic/typed-null.cjs');
require('../../generic/typed-number.cjs');
require('../../generic/typed-set.cjs');
require('../../generic/typed-map.cjs');
var types_generic_typedStruct = require('../../generic/typed-struct.cjs');
require('uuid');
require('js-sha256');
var types_generic_withProp = require('../../generic/with-prop.cjs');
require('../../public-keys/public-key.cjs');
require('../../public-keys/public-key-sr25519-value.cjs');
require('../../public-keys/public-key-ed25519-value.cjs');
require('../../public-keys/public-key-secp256k1-value.cjs');
require('../../public-keys/public-key-x25519-value.cjs');
require('../../signatures/signature-value.cjs');
var types_signatures_signatureEd25519Value = require('../../signatures/signature-ed25519-value.cjs');
require('../../signatures/signature.cjs');
require('../../../keypairs/dock-keypair.cjs');
require('@stablelib/ed25519');
require('../../../keypairs/keypair-secp256k1.cjs');
var keypairs_didKeypair = require('../../../keypairs/did-keypair.cjs');
var types_did_document_verificationMethodRef = require('../document/verification-method-ref.cjs');
require('../../../utils/types/object.cjs');
require('../../../utils/types/iterable.cjs');
require('../../../utils/types/set.cjs');
require('crypto');
require('../../../utils/interfaces.cjs');
require('../../../utils/assert.cjs');
require('../../../utils/error.cjs');
require('../../../utils/types/string.cjs');
require('blake2b');
require('../../generic/with-base.cjs');
require('../../generic/with-catch-null.cjs');
require('../../generic/with-eq.cjs');
require('../../generic/any-of.cjs');
require('../../generic/with-from.cjs');
require('../../generic/with-from-json-bytes.cjs');
require('../../generic/create-placeholder.cjs');
require('../../generic/with-props.cjs');
require('../../generic/sized.cjs');
require('../../../utils/types/number.cjs');
require('../../../vc/crypto/constants.cjs');
require('../../signatures/signature-secp256k1-value.cjs');
require('../../signatures/signature-sr25519-value.cjs');
require('elliptic');
require('./did-key.cjs');
require('../../offchain-signatures/params/index.cjs');
require('../../offchain-signatures/params/value.cjs');
require('../../generic/option.cjs');
require('../../offchain-signatures/curve-type.cjs');
require('../../offchain-signatures/params/id.cjs');
require('../../generic/typed-uuid.cjs');
require('../../generic/with-from-dock-id.cjs');
require('./typed-did/index.cjs');
require('./typed-did/did-method-key/did-method-key-public-key.cjs');
require('../../../utils/encoding/base-58-btc.cjs');
require('../../generic/with-qualifier.cjs');
require('./constants.cjs');
require('./typed-did/signature.cjs');
require('./typed-did/did-method-key/did-method-key-signature.cjs');
require('./typed-did/dock-did-value.cjs');
require('../../generic/utils.cjs');
require('../../generic/typed-bytes-array.cjs');
require('./typed-did/cheqd-did.cjs');
require('../../offchain-signatures/public-keys/index.cjs');
require('../../../vc/crypto/Bls12381BBDT16KeyPairDock2024.cjs');
require('@docknetwork/crypto-wasm-ts');
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('../../../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('@transmute/json-web-signature');
require('../../offchain-signatures/public-keys/value.cjs');
require('../../offchain-signatures/public-keys/ref.cjs');
require('../../offchain-signatures/public-keys/id.cjs');
require('./verification-relationship.cjs');
require('../document/verification-method-ref-or-ident-ref.cjs');
require('../document/ident-ref.cjs');

class BytesSignatureEd25519Value extends types_signatures_signatureEd25519Value {
  toCheqdPayload() {
    return this.bytes;
  }
}

class VerificationMethodSignature extends types_generic_typedStruct {
  static Classes = {
    verificationMethodId: types_did_document_verificationMethodRef.CheqdVerificationMethodRef,
    signature: BytesSignatureEd25519Value,
  };

  static fromDidKeypair(signer, bytes) {
    utils_inheritance.ensureInstanceOf(signer, keypairs_didKeypair);

    return new this(
      signer.verificationMethodId,
      utils_types_bytes.valueBytes(signer.sign(bytes)),
    );
  }
}

class CheqdTestnetVerificationMethodSignature extends types_generic_withProp(
  VerificationMethodSignature,
  'verificationMethodId',
  types_did_document_verificationMethodRef.CheqdTestnetVerificationMethodRef,
) {}

class CheqdMainnetVerificationMethodSignature extends types_generic_withProp(
  VerificationMethodSignature,
  'verificationMethodId',
  types_did_document_verificationMethodRef.CheqdMainnetVerificationMethodRef,
) {}

exports.CheqdMainnetVerificationMethodSignature = CheqdMainnetVerificationMethodSignature;
exports.CheqdTestnetVerificationMethodSignature = CheqdTestnetVerificationMethodSignature;
exports.VerificationMethodSignature = VerificationMethodSignature;
//# sourceMappingURL=verification-method-signature.cjs.map
