Skip to content

fix(checkout): Show Price Surge screen when slippage exceeded#2622

Merged
keithbro-imx merged 2 commits into
mainfrom
bug/GFI-337-price-surge
Apr 16, 2025
Merged

fix(checkout): Show Price Surge screen when slippage exceeded#2622
keithbro-imx merged 2 commits into
mainfrom
bug/GFI-337-price-surge

Conversation

@keithbro-imx
Copy link
Copy Markdown
Contributor

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?

@keithbro-imx keithbro-imx requested a review from a team as a code owner April 16, 2025 01:57
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Apr 16, 2025

View your CI Pipeline Execution ↗ for commit fe02906.

Command Status Duration Result
nx affected -t build,lint,test ✅ Succeeded 2m 5s View ↗
nx run-many -p @imtbl/sdk,@imtbl/checkout-widge... ✅ Succeeded 1m 2s View ↗

☁️ Nx Cloud last updated this comment at 2025-04-16 02:01:16 UTC

const handleExceptions = (err: any, swapFormData: PrefilledSwapForm) => {
if (err instanceof CheckoutError
&& err.type === CheckoutErrorType.TRANSACTION_FAILED
&& err.message.startsWith('execution reverted: "STF"')) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not great but the best we can do. The ethers error is not easy to parse.

};

const prepareTransaction = (transaction, isGasFree = false) => ({
const prepareTransaction = (transaction: TransactionRequest, isGasFree = false) => ({
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the type to this. Surprised this isn't enforced.

return;
}
if (actionDisabled) return;
if (actionDisabled || !data.approveTransaction) return;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After adding the type we need to handle this case.

return;
}
handleExceptions(err, data.swapFormInfo as PrefilledSwapForm);
handleExceptions(err, data.swapFormInfo);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unnecessary type assertion

@keithbro-imx keithbro-imx added this pull request to the merge queue Apr 16, 2025
Merged via the queue into main with commit 24d8753 Apr 16, 2025
7 checks passed
@keithbro-imx keithbro-imx deleted the bug/GFI-337-price-surge branch April 16, 2025 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants