fix(checkout): Show Price Surge screen when slippage exceeded#2622
Merged
Conversation
|
View your CI Pipeline Execution ↗ for commit fe02906.
☁️ Nx Cloud last updated this comment at |
keithbro-imx
commented
Apr 16, 2025
| const handleExceptions = (err: any, swapFormData: PrefilledSwapForm) => { | ||
| if (err instanceof CheckoutError | ||
| && err.type === CheckoutErrorType.TRANSACTION_FAILED | ||
| && err.message.startsWith('execution reverted: "STF"')) { |
Contributor
Author
There was a problem hiding this comment.
Not great but the best we can do. The ethers error is not easy to parse.
keithbro-imx
commented
Apr 16, 2025
| }; | ||
|
|
||
| const prepareTransaction = (transaction, isGasFree = false) => ({ | ||
| const prepareTransaction = (transaction: TransactionRequest, isGasFree = false) => ({ |
Contributor
Author
There was a problem hiding this comment.
Adding the type to this. Surprised this isn't enforced.
keithbro-imx
commented
Apr 16, 2025
| return; | ||
| } | ||
| if (actionDisabled) return; | ||
| if (actionDisabled || !data.approveTransaction) return; |
Contributor
Author
There was a problem hiding this comment.
After adding the type we need to handle this case.
keithbro-imx
commented
Apr 16, 2025
| return; | ||
| } | ||
| handleExceptions(err, data.swapFormInfo as PrefilledSwapForm); | ||
| handleExceptions(err, data.swapFormInfo); |
Contributor
Author
There was a problem hiding this comment.
Remove unnecessary type assertion
jeetparikh
approved these changes
Apr 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Show Price Surge screen when slippage is exceeded. This behaviour regressed in v2.
Detail and impact of the change
Added
Changed
Deprecated
Removed
Fixed
Security
Anything else worth calling out?