Catalyzes the hydrolysis of nucleoside triphosphates and diphosphates in a calcium- or magnesium-dependent manner. Has a strong preference for nucleoside diphosphates, preferentially hydrolyzes GDP, IDP, and UDP, with slower hydrolysis of CDP, ITP, GTP, CTP, ADP, and UTP and virtually no hydrolysis of ATP. The membrane bound form might support glycosylation reactions in the Golgi apparatus and, when released from cells, might catalyze the hydrolysis of extracellular nucleotides.