deserializeTransaction static method

Tuple<VersionedMessage, List<List<int>>> deserializeTransaction(
  1. List<int> serializedTransaction
)

convert bytes to Message

Implementation

static Tuple<VersionedMessage, List<List<int>>> deserializeTransaction(
    List<int> serializedTransaction) {
  List<int> byteArray = [...serializedTransaction];
  List<List<int>> signatures = [];
  int signaturesLength = _decodeLength(byteArray);
  for (int i = 0; i < signaturesLength; i++) {
    int offset = i * SolanaTransactionConstant.signatureLengthInBytes;
    signatures.add(byteArray.sublist(
        offset, offset + SolanaTransactionConstant.signatureLengthInBytes));
  }
  final message = VersionedMessage.fromBuffer(byteArray.sublist(
      signatures.length * SolanaTransactionConstant.signatureLengthInBytes));
  return Tuple(message, signatures);
}