ETHPublicKey.fromBytes constructor

ETHPublicKey.fromBytes(
  1. List<int> keyBytes
)

Creates an ETHPublicKey instance from a list of bytes representing the public key.

Implementation

factory ETHPublicKey.fromBytes(List<int> keyBytes) {
  try {
    final pubKey = Secp256k1PublicKeyEcdsa.fromBytes(keyBytes);
    return ETHPublicKey._(pubKey);
  } catch (e) {
    throw MessageException("invalid public key",
        details: {"input": BytesUtils.toHexString(keyBytes)});
  }
}