sign method

Future<Signature> sign(
  1. Uint8List bytes
)

Sign the given bytes with the secret key.

Implementation

Future<crypto.Signature> sign(Uint8List bytes) async {
  // Sign the transaction with secret key
  final signature = await Ed25519().sign(
    bytes,
    keyPair: keyPair,
  );

  return crypto.Signature(bytes: Uint8List.fromList(signature.bytes));
}