A new theoretical framework has been established and applied in the calculation of electron capture (EC) and β-decay rates in stellar environment, characterized by high density and temperature. For the description of the nuclear properties, the finite-temperature Hartree Bardeen-Cooper-Schrieffer (FT-HBCS) theory based on the relativistic derivative-coupling D3C* interaction is employed. In order to describe the charge-exchange transitions, the finite temperature proton-neutron quasi-particle random-phase approximation is developed (FT-PNRQRPA) which includes both temperature and pairing correlations. In the FT-HBCS calculations, only the isovector pairing is included, while in the residual interaction of the FT-PNRQRPA both the isovector and isoscalar pairing contribute. In this work, results for EC and β-decay rates are presented in the temperature interval T = 0–1.5 MeV and stellar density ρYe = 107 and 109 g/cm3 . Both allowed 0+ , 1 + and first-forbidden transitions 0− , 1 − and 2− are included in the calculations. It is shown that interplay between pairing correlations and finite-temperature effects can lead to significant changes in rates. It is also important to include de-excitations, i.e. transitions with negative Q-value, that become increasingly significant at higher temperatures especially for p f-shell nuclei.