For a smooth projective toric surface we determine the Donaldson invariants and their wallcrossing in terms of the Nekrasov
partition function. Using the solution of the Nekrasov conjecture [33, 38, 3] and its refinement [34], we apply this result to give a
generating function for the wallcrossing of Donaldson invariants of good walls of simply connected projective surfaces with b+ = 1 in
terms of modular forms. This formula was proved earlier in [19] more generally for simply connected 4-manifolds with b+ = 1, as-
suming the Kotschick-Morgan conjecture, and it was also derived by physical arguments in [31].