createTxSignature function

Uint8List createTxSignature({
  1. required Uint8List txID,
  2. required Uint8List seed,
})

Implementation

Uint8List createTxSignature({
  required Uint8List txID,
  required Uint8List seed,
}) {
  final credentials = getTronCredentials(seed: seed);

  final sig =
      Signature.createSignature(txID, credentials.$1, hashPayload: false);

  final r = padUint8ListTo32(sig.r.bigIntToBytes);
  final s = padUint8ListTo32(sig.s.bigIntToBytes);
  final v = (BigInt.from(sig.v)).bigIntToBytes;

  final sigBuffer = uint8ListFromList(r + s + v);

  return sigBuffer;
}