Problem
With the interest-bearing mint extension in token-2022, it's possible to create tokens that accrue interest. Since the whole thing revolves around frontend magic to convert token amounts into amount + interest, the JS client needs to handle these amounts.
Possible Solution
This complements #3264 (adding UiAmountToAmount and AmountToUiAmount instructions) by instead doing conversions entirely off-chain, reimplementing the interest-bearing versions of try_ui_amount_to_amount and amount_to_ui_amount in JS:
|
pub fn amount_to_ui_amount( |