We consider the currents formed by a heavy and a light quark within Quantum Chromodynamics and compute the matching to Heavy Quark Effective Theory to three-loop accuracy. As an application we obtain the third-order perturbative corrections to ratios of $B$-meson decay constants.