How to wrap the list with custom class using wp_nav_menu?

It is best to loop through all the menu items so you can get them separately, like this. This will give you the possibility to add classes to both your ul and your li items.

    <?php $myMenu = get_nav_menu_locations();

// 'main-menu' is the name of your menu, you can find this under 'menu' in the Dashboard of your WordPress site
$menuID = $myMenu['main-menu'];

$mainNav = wp_get_nav_menu_items($menuID);

?>
<ul>
    <?php foreach ($mainNav as $navItem): ?>

        <li>
            <a href="https://wordpress.stackexchange.com/questions/288486/<?php echo $navItem->url; ?>"
              title="<?php echo $navItem->title; ?>">
              <?php echo $navItem->title; ?>
          </a>
      </li>
  <?php endforeach; ?>
</ul>