The Gift of the Magi, written by O. Henry (the pen name for William Sydney Porter, 1862–1910) is one of his best-known works and has become a favorite Christmas story. As the title suggests, its a story of unselfish love, as exemplified by the precious gifts that the Oriental kings leave as presents at the birth of Jesus.
The irony in the story is due to the sacrifice each of the characters makes for the other -- Jim sells his valued pocketwatch to buy hair combs for Delia, and she cuts and sells her beautiful hair to buy an expensive chain for Jim's watch. In trying to enhance the precious possession of the other, each sold what was precious to them.
And the kind of irony in this story is Situation irony.