To make the relish, julienne the onions and rinse well under cold water. Squeeze the juice of the two Peruvian limes over the onions and add a pinch of salt. Set aside.
To make the tamales, start by heating a medium pot of water until hot. Add the chickpeas and bring to a boil. Cook for 30 minutes or until tender. Drain the chickpeas but reserve the water that you used for cooking.
Process the chickpeas, adding approximately two cups of cooking water to form a smooth paste (the paste should be somewhat liquid at this stage and not at all stiff).
Aside in a heavy pot, add the ají Amarillo paste, the garlic paste, the cilantro and then the processed chickpeas. Salt to taste.
Cook, stirring, over low heat until the dough becomes dry and slightly sticky. Add the oil and continue to stir – total time should be about 15 minutes. Your dough will be ready once it starts to hold together well and lift off the bottom of the bowl as you stir.
Place approximately 3 tablespoons of dough in each maize leaf. In the middle, place 1 tablespoon of shredded chicken, a slice of egg and half an olive, if using.
Cover with a thin layer of dough and fold the edges of the leaf back over the tamale as if wrapping a gift. Tie with a string across the length and width.
Place the tamales in a steamer for half an hour to cook.
Serve with the onion relish.