signTransaction function

Transaction signTransaction({
  1. required Transaction_raw rawTx,
  2. required Uint8List seed,
})

Implementation

Transaction signTransaction({
  required Transaction_raw rawTx,
  required Uint8List seed,
}) {
  final txId = sha256Hash(rawTx.writeToBuffer());

  final signature = createTxSignature(
    txID: txId,
    seed: seed,
  );

  final tx = tron.Transaction(
    rawData: rawTx,
    signature: [signature],
  );

  return tx;
}