sign static method

String sign({
  1. required Uint8List message,
  2. String? privateKey,
  3. Uint8List? privateKeyInBytes,
})

Implementation

static String sign(
    {required Uint8List message,
    String? privateKey,
    Uint8List? privateKeyInBytes}) {
  if (privateKey == null && privateKeyInBytes == null)
    throw ArgumentError('Missing private key to sign');
  final sig =
      signToSignature(message, privateKeyInBytes ?? hexToBytes(privateKey!));
  return concatSig(toBuffer(sig.r), toBuffer(sig.s), toBuffer(sig.v));
}