signPersonalMessage method

String signPersonalMessage(
  1. List<int> message, {
  2. int? payloadLength,
  3. bool useEthereumPrefix = false,
})

Signs a personal message using the private key and returns the signature as a hexadecimal string.

Optionally, payloadLength can be set to specify the payload length for the message.

Implementation

String signPersonalMessage(List<int> message,
    {int? payloadLength, bool useEthereumPrefix = false}) {
  final ethsigner = TronSigner.fromKeyBytes(toBytes());
  final sign = ethsigner.signProsonalMessage(message,
      payloadLength: payloadLength, useEthPrefix: useEthereumPrefix);
  return BytesUtils.toHexString(sign);
}