Drain the tofu in a sieve over a bowl then squeeze out as much liquid as you can until you get crumbles resembling curd-cheese. Put it into a mixing bowl.
Finely chop the onions and beans, Blanch the beans in boiling water for a minute, then drain and season. Add both to the tofu.
Add the cooked rice, miso, flour and sesame seeds.
Form 4 large or 8 balls and flatten them a little between your palms.
Dip them in in a little flour, then fry in oil until browned on both sides. Drain on paper towels.
Serve warm or at room temperature with your favourite dipping sauce.