Catalyzes the hydrolysis of nucleoside triphosphates and diphosphates in a calcium- or magnesium-dependent manner, with a preference for pyrimidines. Preferentially hydrolyzes UTP and TTP. AMP, ADP, ATP and UMP are not substrates. Preferentially activated by Ca(2+) over Mg(2+).; Has a broad substrate specificity with the ability of cleaving all nucleotide di- and triphosphates with the exception of adenosine di- and triphosphate (ADP and ATP). Preferentially hydrolyzes CTP, UDP, CDP, GTP and GDP. Can use either Ca(2+) or Mg(2+) equally.