Drain the soaked green gram and transfer it to a pressure cooker. Add salt, and enough water to cover the green gram. Pressure cook until the gram is tender, then drain any excess water and set aside.
In a blender or food processor, combine the grated coconut, green chili, cumin seeds, garlic, and turmeric powder. Blend until you have a coarse mixture.
Heat a pan over medium heat and add a tablespoon of coconut oil. Once the oil is hot, add the mustard seeds. When they start to crackle, add the dried red chilies and sauté for about 30 seconds.
Add the chopped onion or shallots along with the curry leaves to the pan. Sauté until the onions turn translucent but not browned.
Next, add the blended coconut mixture to the pan. Stir continuously until the raw smell disappears, and the mixture is fragrant, 2-3 minutes.
Add the boiled green gram to the pan and mix well with the coconut mixture. Sauté for another 4-5 minutes over low heat, allowing the flavors to meld together. Sprinkle black pepper powder and mix it all.
Adjust seasoning if necessary and drizzle with a little more coconut oil before serving if desired.
Serve hot as a side dish with rice or as a standalone snack. Enjoy your Kerala style green gram thoran!