Put the dried lentils and chickpeas in a pot, cover them with a few inches of water and set aside to soak for 2 hours or longer.
Drain the water from the pot of beans, rinse, and replace with fresh water. Bring the water to a boil then down to simmer, covering the pot and letting it cook until the beans are soft, about 1 hour. Drain and rinse.
In a large pan over medium-high heat, add the coconut oil. Add the onion and cook until soft, about 5 minutes.
Add the garlic and optional ginger and cook for another 2-3 minutes, stirring often.
Add the cumin seeds and coriander seeds to the pan and cook until fragrant, about 1 minute.
Add the tomatoes and cook, stirring often, until the oil begins to glisten, about 5 minutes.
Add 1 cup of water, the garam masala, curry powder, turmeric, chili powder, salt, and the cooked lentils and chickpeas to the pan and stir. Bring the pot to a boil then reduce the heat to low. Let it simmer, uncovered, for 20 minutes, stirring occasionally. Using the back of a spoon, mash a few of the lentils. Stir in the coconut milk and heat through. Taste and add more salt if you'd like.