public static byte[] EncodeSpentTx(SpentTx spentTx) { using (var stream = new MemoryStream()) using (var writer = new BinaryWriter(stream)) { EncodeSpentTx(writer, spentTx); return stream.ToArray(); } }