  We define a vertex algebra on the moduli stack of the auxiliary abelian
category of pairs to give a precise formulation of the wall-crossing conjecture
for Calabi--Yau 4-folds proposed by Gross--Joyce--Tanaka arXiv:2005.05637.
Assuming that it holds, we prove the conjecture of Cao--Kool arXiv:1712.07347
for 0-dimensional DT4 invariants on projective Calabi--Yau 4-folds. We also
give formulae for generating series of topological virtual fundamental classes
of Hilbert schemes of points and 0-dimensional sheaves. Using these, we prove a
version of Nekrasov's conjecture arXiv:1712.08128 for compacts and its
generalization to K-theory classes of higher rank. We compute higher rank Segre
series. After defining the correct generalization of virtual Verlinde series
for 4-folds, we obtain a very simple Segre--Verlinde correspondence. Finally,
we relate universal series of general invariants for elliptic surfaces and
elliptic curves to those on CY 4-folds via a universal transformation.
