signPersonalMessage method

String signPersonalMessage(
  1. List<int> message, {
  2. int? payloadLength,
})

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}) {
  final ethsigner = ETHSigner.fromKeyBytes(toBytes());
  final sign =
      ethsigner.signProsonalMessage(message, payloadLength: payloadLength);
  return BytesUtils.toHexString(sign);
}