Apply a program-owned account's pending balance, and say what its available balance will be.
On its own an apply is not checked: a credit that lands between the read and the transaction is
applied without being in the AES copy written. Put it in the same transaction as an instruction
whose proof is about availableBalance (prepareWithdraw with amount 0 does that), so that such
a credit makes Token-2022 refuse the whole transaction.
Apply a program-owned account's pending balance, and say what its available balance will be. On its own an apply is not checked: a credit that lands between the read and the transaction is applied without being in the AES copy written. Put it in the same transaction as an instruction whose proof is about
availableBalance(prepareWithdraw with amount 0 does that), so that such a credit makes Token-2022 refuse the whole transaction.