BaseSubstrateVerifier.fromBytes constructor

BaseSubstrateVerifier.fromBytes(
  1. List<int> keyBytes,
  2. EllipticCurveTypes algorithm
)

Implementation

factory BaseSubstrateVerifier.fromBytes(
    List<int> keyBytes, EllipticCurveTypes algorithm) {
  switch (algorithm) {
    case EllipticCurveTypes.ed25519:
      return SubstrateED25519Verifier.fromKeyBytes(keyBytes);
    case EllipticCurveTypes.secp256k1:
      return SubstrateEcdsaVerifier.fromKeyBytes(keyBytes);
    case EllipticCurveTypes.sr25519:
      return SubstrateSr25519Verifier.fromKeyBytes(keyBytes);
    default:
      throw ArgumentException(
          "Invalid substrate signing key algorithm. Excepted: ed25519, secp256k1, or sr25519. Got: ${algorithm.name}");
  }
}