From mesoscopic magnet to quantum wire. The Bethe Ansatz application