Heat the oil in a large pan over a medium heat and cook three-quarters of the onion with a pinch of salt for 10 minutes, stirring regularly, until softened. Add the garlic, ginger and curry leaves, if using, and cook for 2 minutes. Add in the spices and cook for 1 minute. Stir in the sweet potato and lentils, then add the coconut milk and stock. Stir well, bring to the boil, then simmer for 15-20 minutes, adding a splash of water if it’s getting dry, until the potatoes and lentils are cooked through. Season.