xrpl.js now types ten ledger fields as optional because rippled leaves them out at zero
The xrpl.js JavaScript library merged pull request #3534 on 20 November. It marks ten fields of XRP Ledger objects as optional, because rippled, the server software, does not include them in JSON when their value is zero. The fields are MPTAmount on MPToken, DebtMaximum on LoanBroker, three trading fee fields on AMM objects, and PaymentRemaining, PrincipalOutstanding, TotalValueOutstanding, NextPaymentDueDate and GracePeriod on Loan.
The description, by kuan121, explains that rippled declares these fields as SoeDefault, while xrpl.js typed them as always present. The result was code that compiled but could not behave as written: a comparison such as loan.PaymentRemaining === 0 passed the type checker yet was never true on a loan that had been repaid, because the field is simply missing. According to the pull request these were the last SoeDefault fields still typed as required; an earlier change, #3153, did the same for Vault. RPC response models are not affected.
The change touches types only and has no effect at runtime, but TypeScript projects that read these fields with strictNullChecks now have to handle undefined. Integration tests check that each field disappears once its value reaches zero, using a fully repaid loan, a broker set to a DebtMaximum of 0, a newly authorized MPToken with no balance and an AMM pool after every liquidity provider voted a fee of 0. GracePeriod is not tested because LoanSet requires at least 60, so a real loan never stores 0.

Why it matters
The error showed up exactly where an application checks whether a loan has been repaid. Developers who wrote such checks against the old types should look for comparisons with zero that silently never matched.