signEvmMessage function

String signEvmMessage({
  1. required String message,
  2. required Uint8List seed,
})

Implementation

String signEvmMessage({
  required String message,
  required Uint8List seed,
}) {
  final payload = Uint8List.fromList(utf8.encode(message));
  final privateKey = derivePrivateKeyETH(seed);
  final sig = Signature.signPersonalMessageToUint8List(payload, privateKey);
  return "0x" + HEX.encode(sig);
}