TronPrivateKey.fromBytes constructor
Factory method to create a TronPrivateKey from a list of key bytes
Implementation
factory TronPrivateKey.fromBytes(List<int> keyBytes) {
try {
final Secp256k1PrivateKeyEcdsa key =
Secp256k1PrivateKeyEcdsa.fromBytes(keyBytes);
return TronPrivateKey._(key);
} catch (e) {
// Throw a MessageException with details if an error occurs during the creation
throw TronPluginException("invalid tron private key",
details: {"input": BytesUtils.toHexString(keyBytes)});
}
}