TronPublicKey.fromBytes constructor

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

Factory method to create a TronPublicKey from a list of key bytes

Implementation

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