Enzyme that can either act as an ADP-sugar pyrophosphatase in absence of diphosphate or catalyze the synthesis of ATP in presence of diphosphate.In absence of diphosphate, hydrolyzes with similar activities various modified nucleoside diphosphates such as ADP-ribose, ADP-mannose, ADP-glucose, 8-oxo-GDP and 8-oxo-dGDP.