encode method

Uint8List encode()

Encode a tx into bytes.

Implementation

Uint8List encode() {
  List unsignedTxBody = packUnsignedTxBody();

  // Pack more: append the sig bytes at the end.
  if (signature != null) {
    unsignedTxBody.add(signature!);
  }

  // RLP encode the packed body.

  return Uint8List.fromList(rlp2.encode(unsignedTxBody));
}