What paymentMiddleware's onAfterSettle hook receives as its third
argument when settlement raised MppSettlementOutcomeUnknownError.
That parameter's declared type is unknown (shared with the x402 hook of
the same name — out of scope to narrow here), so nothing stops a consumer
from casting straight to MppSettleResult and silently reading
undefined for creditsRedeemed on this branch. Exporting this shape
gives a consumer something concrete to check for instead — e.g.
if ((result as MppSettlementOutcomeUnknown).outcome === 'unknown') —
and documents, at the type level, that the branch exists at all.
What
paymentMiddleware'sonAfterSettlehook receives as its third argument when settlement raised MppSettlementOutcomeUnknownError. That parameter's declared type isunknown(shared with the x402 hook of the same name — out of scope to narrow here), so nothing stops a consumer from casting straight toMppSettleResultand silently readingundefinedforcreditsRedeemedon this branch. Exporting this shape gives a consumer something concrete to check for instead — e.g.if ((result as MppSettlementOutcomeUnknown).outcome === 'unknown')— and documents, at the type level, that the branch exists at all.