Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

token-js: Support InterestBearingMint amount conversions #3265

@joncinque

Description

@joncinque

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions