Found in Wikipedia;
The earliest known reference to the leprechaun appears in the medieval tale known as the Echtra Fergus mac Léti (English: Adventure of Fergus son of Léti). The text contains an episode in which Fergus mac Léti, King of Ulster, falls asleep on the beach and wakes to find himself being dragged into the sea by three lúchorpáin. He captures his abductors, who grant him three wishes in exchange for release.
The leprechaun is said to be a solitary creature, whose principal occupation is making and mending shoes, and who enjoys practical jokes. According to William Butler Yeats, the great wealth of these fairies comes from the "treasure-crocks, buried of old in war-time", which they have uncovered and appropriated. According to McAnally the leprechaun is the son of an "evil spirit" and a "degenerate fairy" and is "not wholly good nor wholly evil".