Catalyzes the hydrolysis of nucleoside triphosphates and diphosphates in a calcium- or magnesium-dependent manner. Preferentially hydrolyzes nucleoside 5'-triphosphates, with substrate preference for UTP > GTP > CTP. Hydrolyzes ATP and nucleoside diphosphates only to a minor extent. a ribonucleoside 5'-triphosphate + H2O = a ribonucleoside 5'-diphosphate + H(+) + phosphate H2O + UTP = H(+) + phosphate + UDP GTP + H2O = GDP + H(+) + phosphate CTP + H2O = CDP + H(+) + phosphate Belongs to the GDA1/CD39 NTPase family.