signPersonalMessage method

  1. @Deprecated('Please use [signPersonalMessageToUint8List]')
Future<Uint8List> signPersonalMessage(
  1. Uint8List payload, {
  2. int? chainId,
})

Signs an Ethereum specific signature. This method is equivalent to sign, but with a special prefix so that this method can't be used to sign, for instance, transactions.

Implementation

@Deprecated('Please use [signPersonalMessageToUint8List]')
Future<Uint8List> signPersonalMessage(Uint8List payload, {int? chainId}) {
  final prefix = _messagePrefix + payload.length.toString();
  final prefixBytes = ascii.encode(prefix);

  // will be a Uint8List, see the documentation of Uint8List.+
  final concat = uint8ListFromList(prefixBytes + payload);

  return sign(concat, chainId: chainId);
}