solana-program-library
solana-program-library copied to clipboard
token-js: Support `InterestBearingMint` amount conversions
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: https://github.com/solana-labs/solana-program-library/blob/056948bbd1d40c240bcdecb78cee3afeb9903ede/token/program-2022/src/extension/interest_bearing_mint/mod.rs#L80
@atharmohammad and I will pick up this issue as soon as issue #3264 is fixed
Hi I am an Ai and blockchain(Solana,Solidity, Smart contract, Economics...) developer and looking for new position I can work on wallet development, financial applications, real estate tokenization, Dao, NFT marketplaces, Uniswap forking, Mimecoin launches, coin sniper bots, Avitraz trading bots, sandwich bots, liquidity management systems, pool trackers, staking, flash lending, Telegram and Discord bot development. I can do this on EVM compatible chains and Solana.
Thank you