Cook the beans. Put them in the pot, pour water (if possible, bottle water) until covered a couple of fingers. Put to the boil with live fire. Once it starts to boil, lower the heat so that it boils very slowly (this is the success of which they are well cooked). If while the beans are cooked, they will be left with little water, add cold water, raise the fire and when they boil return it to lower.
While the beans are cooked, we open the clams with steam, with a little water. When they are opening, we will separate them from the fire as they can not be overcooked. We reserve them.
Grate the onions and chop the garlic and parsley. Put everything in a pan with a little oil and saute. Add the chilli. It is not necessary that the onion is very golden, then to take a spoonful of flour, stir well so that there are not lumps. Pour the wine, let it reduce and if the sauce is too thick throw a little fish broth.
When the beans are cooked, pour the sauce over. Cook for about 10 minutes all together. Add the clams you have reserved, cover and let stand. Not serve immediately.