Catalyzes the formation of NAD(+) from nicotinamide mononucleotide (NMN) and ATP (PubMed:17402747). Can also use the deamidated form; nicotinic acid mononucleotide (NaMN) as substrate with the same efficiency (PubMed:17402747). Can use triazofurin monophosphate (TrMP) as substrate (PubMed:17402747). Also catalyzes the reverse reaction, i.e. the pyrophosphorolytic cleavage of NAD(+) (PubMed:17402747). For the pyrophosphorolytic activity, prefers NAD(+) and NaAD as substrates and degrades NADH, nicotinic acid adenine dinucleotide phosphate (NHD) and nicotinamide guanine dinucleotide (NGD) less effectively (PubMed:17402747). Involved in the synthesis of ATP in the nucleus, together with PARP1, PARG and NUDT5 (PubMed:27257257). Nuclear ATP generation is required for extensive chromatin remodeling events that are energy-consuming (PubMed:27257257). Also acts as a cofactor for glutamate and aspartate ADP-ribosylation by directing PARP1 catalytic activity to glutamate and aspartate residues on histones (By similarity). Fails to cleave phosphorylated dinucleotides NADP(+), NADPH and NaADP(+) (PubMed:17402747). Protects against axonal degeneration following mechanical or toxic insults (By similarity).