-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sui TypeScript SDK: Add formatAmount() util #17791
Labels
Comments
kkomelin
added a commit
to kkomelin/sui
that referenced
this issue
Jul 18, 2024
…dk/typescript (MystenLabs#17791) ## Description Moved formatAmount and formatAmountParts utils from the apps/core package to the sdk/typescript. Set deprecation warnings for the older versions. Added the corresponding automated tests. ## Test plan Run the automated tests for the @mysten/sui package. Make sure the transaction amount is displayed properly in the wallet.
Closed
10 tasks
Considering @hayes-mysten point in the related PR, I think we can close this issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem/Motivation
It would be good to have a standard way to format Sui amounts with TypeScript SDK, like existing
formatDigest()
orformatAddress()
.It's a very trivial operation and it's necessary for many projects, so it deserves to be standardised, in my opinion.
And, moreover, you already have it implemented here: formatAmount()
Look how even example projects now have to copy&paste the code. Not the best way because you cannot pull the latest bug fixes and updates automatically.
Proposed resolution
Move formatAmount() function from apps to TypeScript SDK utils.
The text was updated successfully, but these errors were encountered: