internal override byte[] GenerateBytes() { var builder = new FlatBufferBuilder(1); var transactionsBytes = new byte[0]; transactionsBytes = InnerTransactions.Aggregate(transactionsBytes, (current, innerTransaction) => current.Concat(innerTransaction.ToAggregate()).ToArray()); // Create Vectors var signatureVector = AggregateTransactionBuffer.CreateSignatureVector(builder, new byte[64]); var signerVector = AggregateTransactionBuffer.CreateSignerVector(builder, GetSigner()); var deadlineVector = AggregateTransactionBuffer.CreateDeadlineVector(builder, Deadline.Ticks.ToUInt8Array()); var feeVector = AggregateTransactionBuffer.CreateFeeVector(builder, Fee.ToUInt8Array()); var transactionsVector = AggregateTransactionBuffer.CreateTransactionsVector(builder, transactionsBytes); ushort version = ushort.Parse(NetworkType.GetNetworkByte().ToString("X") + "0" + Version.ToString("X"), System.Globalization.NumberStyles.HexNumber); // add vectors AggregateTransactionBuffer.StartAggregateTransactionBuffer(builder); AggregateTransactionBuffer.AddSize(builder, (uint)(120 + 4 + transactionsBytes.Length)); AggregateTransactionBuffer.AddSignature(builder, signatureVector); AggregateTransactionBuffer.AddSigner(builder, signerVector); AggregateTransactionBuffer.AddVersion(builder, version); AggregateTransactionBuffer.AddType(builder, TransactionType.GetValue()); AggregateTransactionBuffer.AddFee(builder, feeVector); AggregateTransactionBuffer.AddDeadline(builder, deadlineVector); AggregateTransactionBuffer.AddTransactionsSize(builder, (uint)transactionsBytes.Length); AggregateTransactionBuffer.AddTransactions(builder, transactionsVector); // end build var codedTransaction = AggregateTransactionBuffer.EndAggregateTransactionBuffer(builder).Value; builder.Finish(codedTransaction); return(new AggregateTransactionSchema().Serialize(builder.SizedByteArray())); }