The master of the treasury or treasurer (German: Königliche Ober-Schatzmeister,Hungarian: tárnokmester,Latin: magister tavarnicorum, magister tavernocorum regalium or summus camerarius,Slovak: taverníkCroatian: tavernik) was a royal official in the Kingdom of Hungary from the 12th century. Although treasurers were initially responsible for collecting and administering royal revenues, they adopted more and more judiciary functions and turned into the highest judges of the realm. From the 14th century, treasurers presided over the court of appeals for a group of the free royal cities, including Buda (Budapest, Hungary), Bártfa (Bardejov, Slovakia), Eperjes (Prešov, Slovakia), Kassa (Košice, Slovakia), Nagyszombat (Trnava, Slovakia), and Pressburg (Pozsony, Bratislava, Slovakia).
The name is derived from the Slavic word tovor ("casket", "strong-box").
Initially, the treasurer (taverník) was the administrator of the royal treasury (i.e. the financial manager of the royal Court (curia regis)) in the early Hungarian state. In the 12th and 13th century, besides the curia regis, he became also responsible for the remaining properties of the king. When the royal properties were considerably reduced under King Andrew II of Hungary (1205-1235; see Comitatus (Kingdom of Hungary) for details), the treasurer also became responsible for all royal income from royal régales (coinage, exchange of coins, precious metals management, mining monopoly, salt monopoly, customs duty), from the taxes of royal towns etc.