The production of a $W$ boson in association with a single charm quark is studied using 140 $\mathrm{fb}^{-1}$ of $\sqrt{s} = 13\,\mathrm{TeV}$ proton-proton collision data collected with the ATLAS detector at the Large Hadron Collider. The charm quark is tagged by a charmed hadron, reconstructed with a secondary-vertex fit. The $W$ boson is reconstructed from an electron/muon decay and the missing transverse momentum. The mesons reconstructed are $D^{±} \to K^∓ π^± π^±$ and $D^{*±} \to D^{0} π^± \to (K^∓ π^±) π^±$, where $p_{\text{T}}(e, μ) > 30\,\mathrm{GeV}$, $|η(e, μ)| < 2.5$, $p_{\text{T}}(D) > 8\,\mathrm{GeV}$, and $|η(D)| < 2.2$. The integrated and normalized differential cross-sections as a function of the pseudorapidity of the lepton from the $W$ boson decay, and of the transverse momentum of the meson, are extracted from the data using a profile likelihood fit. The measured fiducial cross-sections are $σ^{\mathrm{OS-SS}}_{\mathrm{fid}}(W^{-}{+}D^{+}) = 50.2±0.2\,\mathrm{(stat.)}\,^{+2.4}_{-2.3}\,\mathrm{(syst.)}\,\mathrm{pb}$, $σ^{\mathrm{OS-SS}}_{\mathrm{fid}}(W^{+}{+}D^{-}) = 48.5±0.2\,\mathrm{(stat.)}\,^{+2.3}_{-2.2}\,\mathrm{(syst.)}\,\mathrm{pb}$, $σ^{\mathrm{OS-SS}}_{\mathrm{fid}}(W^{-}{+}D^{*+}) = 51.1±0.4\,\mathrm{(stat.)}\,^{+1.9}_{-1.8}\,\mathrm{(syst.)}\,\mathrm{pb}$, and $σ^{\mathrm{OS-SS}}_{\mathrm{fid}}(W^{+}{+}D^{*-}) = 50.0±0.4\,\mathrm{(stat.)}\,^{+1.9}_{-1.8}\,\mathrm{(syst.)}\,\mathrm{pb}$. Results are compared with the predictions of next-to-leading-order quantum chromodynamics calculations performed using state-of-the-art parton distribution functions. The ratio of charm to anti-charm production cross-sections is studied to probe the $s$-$\bar{s}$ quark asymmetry and is found to be $R_c^± = 0.971±0.006\,\mathrm{(stat.)}±0.011\,\mathrm{(syst.)}$.