signTransaction method

Map<String, dynamic> signTransaction(
  1. Map<String, dynamic> transaction,
  2. Map<String, dynamic> encodedTransaction
)

To sign transaction with babyjubjub keys @param {object} transaction - Transaction object @param {Object} encodedTransaction - Transaction encoded object @returns {object} The signed transaction object

Implementation

Map<String, dynamic> signTransaction(Map<String, dynamic> transaction,
    Map<String, dynamic> encodedTransaction) {
  final hashMessage = buildTransactionHashMessage(encodedTransaction);
  final privKey = new eddsaBabyJub.PrivateKey(this.privateKey);
  final signature = privKey.sign(hashMessage);
  transaction['signature'] = signature;
  return transaction;
}