-
Notifications
You must be signed in to change notification settings - Fork 37
feat: display a warning if the output amount changes on the confirm swap page #943
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
feat: display a warning if the output amount changes on the confirm swap page #943
Conversation
af6bada to
fc81615
Compare
mikasackermn
left a comment
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
nikaaru
left a comment
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,
I left a comment.
nikaaru
left a comment
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
d372dd5 to
6a03976
Compare
6a03976 to
fcee144
Compare
Summary
If the user proceeds to the confirm swap page and the output amount differs from the previous quote response, or if the output amount changes when the quote refreshes on the confirm swap page and these changes meet certain criteria, we should display an appropriate warning to prevent potential loss for the user:
usdInput >= 1000 and percentageChange >= 1usdInput >= 500 and percentageChange >= 2In this pull request, I also removed some unused code that was previously needed for route update situations. Additionally, I worked on refactoring and cleaning up how we retrieve the USD value of the source or destination token.
How did you test this change?
To test these changes, it’s best to manipulate the quote response in the confirm swap flow, as the real scenario may not occur frequently.
Make this changes to
generateQuoteWarningsfunction :Checklist: