-
Notifications
You must be signed in to change notification settings - Fork 68
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
XLS-33 Multi Purpose token #989
Conversation
Yes. I would prefer seeing the scaled amount. We are also showing scaled amount in PriceOracles tx. |
…pled` (ripple#1033) ## High Level Overview of Change <!-- Please include a summary/list of the changes. If too broad, please consider splitting into multiple PRs. --> Resolve ripple#358 ### Type of Change <!-- Please check relevant options, delete irrelevant ones. --> - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Refactor (non-breaking change that only restructures code) - [ ] Tests (You added tests for code that already exists, or your new feature included in this PR) - [ ] Documentation Updates - [ ] Translation Updates - [ ] Release ## Before / After <!-- If just refactoring / back-end changes, this can be just an in-English description of the change at a technical level. If a UI change, screenshots should be included. --> ### Before ![Screenshot 2024-08-26 at 4 51 58 PM](https://github.com/user-attachments/assets/7ead2467-486a-45df-ae42-009545ff626c) ### After ![Screenshot 2024-08-26 at 5 20 23 PM](https://github.com/user-attachments/assets/46a21400-90d2-45bd-b948-32d4770defb4)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just left a comment and may be get the linting fixed
Not quite sure why the lint fails, the ones that are failing are the ones that my local linter told me to fix. |
<div className="title">{t('issuer_address')}</div> | ||
<div className="value"> | ||
<div className="mpt-issuer"> | ||
<Account account={issuer!} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: are we guaranteed to have data/issuer here, or could we validate here instead of suppressing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, issuer is a required field in the MPTokenIssuance object. So if the fetch request is successful, we are guaranteed that we have the issuer field.
src/containers/shared/utils.js
Outdated
export const localizeMPTNumber = (num, scale, lang = 'en-US', options = {}) => { | ||
const number = Number.parseFloat(num) | ||
const config = { ...NUMBER_DEFAULT_OPTIONS, ...options } | ||
|
||
if (Number.isNaN(number)) { | ||
return null | ||
} | ||
return new Intl.NumberFormat(lang, config).format(number) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we reuse the localizeNumber helper instead here? seems like the scale prop is the main difference but its not used in the logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for catching this. I removed this function in this commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
High Level Overview of Change
Context of Change
Spec: https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0033d-multi-purpose-tokens
MPT page
Ledger view
MPTokenIssuance
MPTokenAuthorize
MPTokenIssuanceSet
Payment (with scaling MPT amount)
Clawback
Account MPT list view (shows scaled amount)
Type of Change
TypeScript/Hooks Update
Before / After
Test Plan