Put the fish, curry paste and egg into the food processor and blend. You want it to make a homogenised paste. Put into a bowl and stir in the beans and the lime leaves and then add the sugar, a pinch of salt and 1 tablespoon of fish sauce.
Heat a little oil at this point, and fry off a tiny piece to check the seasoning. Different curry pastes have different balances of flavour. Add more fish sauce or sugar if you need to.
Now swirl the mixture around the bowl a bit to aerate the mixture. It shoould be Thai-style, slightly puffy, springy textured cakes. At this stage you can cover and refrigerate the mixture. You can even do this the day ahead.
Make the sauce by heating the vinegar and the sugar in a small pan over a low heat until the sugar has dissolved. Let it bubble a bit just to thicken it slightly. Take off the heat and let it cool.
Peel the cucumber and cut it lengthways into four then slice it. Peel the carrot and quarter that and then slice it. Slice the shallot thinly. Add these to the vinegar and sugar mixture, along with the peanuts (if using).
Now wet your hands slightly, and form the fish paste into flattened patties.
Heat the oil for deep frying over a medium heat and fry the fish cakes until puffy and brown. Transfer them onto paper towel as you go, then eat them straight away with the dipping sauce on the side.
Note: If you roll the lime leaves up tightly then slice across you will get lovely thin slithers.
Recipe by Kay Plunkett-Hogge as part of the Senses of Thailand promotion at Selfridges.