import '../../../utils/types/array.js';
import { valueBytes } from '../../../utils/types/bytes.js';
import { ensureInstanceOf } from '../../../utils/inheritance.js';
import 'bs58';
import 'multiformats/bases/base58';
import 'varint';
import '../../../utils/encoding/ss-58.js';
import '../../generic/typed-enum.js';
import '../../generic/typed-bytes.js';
import '../../generic/typed-string.js';
import '../../generic/typed-array.js';
import '../../generic/typed-tuple.js';
import '../../generic/typed-null.js';
import '../../generic/typed-number.js';
import '../../generic/typed-set.js';
import '../../generic/typed-map.js';
import TypedStruct from '../../generic/typed-struct.js';
import 'uuid';
import 'js-sha256';
import withProp from '../../generic/with-prop.js';
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 SignatureEd25519Value from '../../signatures/signature-ed25519-value.js';
import '../../signatures/signature.js';
import '../../../keypairs/dock-keypair.js';
import '@stablelib/ed25519';
import '../../../keypairs/keypair-secp256k1.js';
import DidKeypair from '../../../keypairs/did-keypair.js';
import { CheqdTestnetVerificationMethodRef, CheqdMainnetVerificationMethodRef, CheqdVerificationMethodRef } from '../document/verification-method-ref.js';
import '../../../utils/types/object.js';
import '../../../utils/types/iterable.js';
import '../../../utils/types/set.js';
import 'crypto';
import '../../../utils/interfaces.js';
import '../../../utils/assert.js';
import '../../../utils/error.js';
import '../../../utils/types/string.js';
import 'blake2b';
import '../../generic/with-base.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 '../../generic/create-placeholder.js';
import '../../generic/with-props.js';
import '../../generic/sized.js';
import '../../../utils/types/number.js';
import '../../../vc/crypto/constants.js';
import '../../signatures/signature-secp256k1-value.js';
import '../../signatures/signature-sr25519-value.js';
import 'elliptic';
import './did-key.js';
import '../../offchain-signatures/params/index.js';
import '../../offchain-signatures/params/value.js';
import '../../generic/option.js';
import '../../offchain-signatures/curve-type.js';
import '../../offchain-signatures/params/id.js';
import '../../generic/typed-uuid.js';
import '../../generic/with-from-dock-id.js';
import './typed-did/index.js';
import './typed-did/did-method-key/did-method-key-public-key.js';
import '../../../utils/encoding/base-58-btc.js';
import '../../generic/with-qualifier.js';
import './constants.js';
import './typed-did/signature.js';
import './typed-did/did-method-key/did-method-key-signature.js';
import './typed-did/dock-did-value.js';
import '../../generic/utils.js';
import '../../generic/typed-bytes-array.js';
import './typed-did/cheqd-did.js';
import '../../offchain-signatures/public-keys/index.js';
import '../../../vc/crypto/Bls12381BBDT16KeyPairDock2024.js';
import '@docknetwork/crypto-wasm-ts';
import '../../../vc/crypto/common/DockCryptoKeyPair.js';
import '../../../vc/crypto/Bls12381BBDT16MACDock2024.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/CustomLinkedDataSignature.js';
import 'base64url';
import 'jsonld';
import '../../../vc/jws.js';
import '../../../vc/crypto/Bls12381BBDT16MACProofDock2024.js';
import '../../../vc/crypto/common/DockCryptoSignatureProof.js';
import '../../../vc/crypto/Bls12381BBSKeyPairDock2023.js';
import '../../../vc/crypto/Bls12381BBSSignatureDock2022.js';
import '../../../vc/crypto/Bls12381G2KeyPairDock2022.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/Bls12381PSKeyPairDock2023.js';
import '../../../vc/crypto/Bls12381PSSignatureDock2023.js';
import '../../../vc/crypto/Bls12381PSSignatureProofDock2023.js';
import '@juanelas/base64';
import '@transmute/json-web-signature';
import '../../offchain-signatures/public-keys/value.js';
import '../../offchain-signatures/public-keys/ref.js';
import '../../offchain-signatures/public-keys/id.js';
import './verification-relationship.js';
import '../document/verification-method-ref-or-ident-ref.js';
import '../document/ident-ref.js';

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

class VerificationMethodSignature extends TypedStruct {
  static Classes = {
    verificationMethodId: CheqdVerificationMethodRef,
    signature: BytesSignatureEd25519Value,
  };

  static fromDidKeypair(signer, bytes) {
    ensureInstanceOf(signer, DidKeypair);

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

class CheqdTestnetVerificationMethodSignature extends withProp(
  VerificationMethodSignature,
  'verificationMethodId',
  CheqdTestnetVerificationMethodRef,
) {}

class CheqdMainnetVerificationMethodSignature extends withProp(
  VerificationMethodSignature,
  'verificationMethodId',
  CheqdMainnetVerificationMethodRef,
) {}

export { CheqdMainnetVerificationMethodSignature, CheqdTestnetVerificationMethodSignature, VerificationMethodSignature };
//# sourceMappingURL=verification-method-signature.js.map
