BaseSubstrateSigner.fromBytes constructor

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

Implementation

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