What is Wanja's function in the narrative?
You can find the character analysis of Wanja and other characters on the link below. Here is eNotes description of Wanja:
Wanja is the central female character in the novel, a bar-girl-turned-prostitute who is one of the four murder suspects. She moves to Ilmorog to escape life in her native Limuru and Nairobi, where she worked as a bar-girl, and join her grandmother on her plot of land. As a schoolgirl Wanja was seduced by the wealthy Kimeria, who abandoned her when she became pregnant. During the course of the novel she reveals that she disposed of her baby in a drain, and has carried the guilt of her action with her for many years. In Ilmorog Wanja works at Abdullah's shop and eventually begins a successful distillery. When her business is not allowed to continue she makes herself into a high-class prostitute servicing the urban elite who have transformed Ilmorog. Wanja is at once an innocent and wise woman, a temptress and protector of the downtrodden. She is a woman of action, as she convinces Abdullah to send Joseph to school and rescues her grandmother's ancestral land from being repossessed by the banks. She is intelligent and remarkably resilient, and has a sensuality and physical presence that makes her desirable to all the principle male characters of the novel. She also exerts a strong psychological influence on the villagers of Ilmorog, and they assume that her name comes from "Wanjiku," the mother of the nine clans of the Gikuyu people. Her name also means ‘‘stranger or outsider,’’ which is appropriate as she moves from city to city and town to town trying to find her place in the New Kenya.
Well, Wanja is the story's main female character, and she shows the struggles of those like her. She is a woman of action, and she never gives up, even as the world throws her some horrible turns. She is also very intelligent. Wanja leads the narrative, as it follows her from place to place, wherever she moves. She is also a desire for all of the main male characters in the novel.