Heat the coconut oil in a wok over medium heat.
Add the white onion and cook for 3–4 minutes until softened.
Add the kroeung curry paste and stir-fry for 2 minutes until fragrant.
Add the chicken or tofu, sugar and shrimp paste or miso paste.
Stir-fry for 4–5 minutes until the chicken is cooked through or the tofu is lightly browned.
Add the fish sauce, tamarind concentrate, Thai basil, Thai chilli and white pepper.
Stir-fry for 1–2 minutes until combined.
Season with sea salt to taste.
Remove from the heat and squeeze over the juice of half the lime.
Serve immediately with rice and the remaining lime on the side.