Skip to content
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: warn users about metamask transactions #5362

Merged
merged 5 commits into from
Jan 31, 2025
Merged

Conversation

shoom3301
Copy link
Collaborator

@shoom3301 shoom3301 commented Jan 31, 2025

Edit

Updated message:
image

Summary

Fixes: https://docs.google.com/document/d/1q4R99t3BQlX_n7cEZlG0PzOvepg6kxsyatm2VxGANG4/edit?tab=t.0#heading=h.wjw6vqd8yw40

The banner should be displayed only when

  • Connected to Metamask
  • Selling ETH flow (only in Swap) or Wrapping ETH flow
image image

To Test

  1. Sell ETH
  2. Wrap ETH

@shoom3301 shoom3301 added the RELEASE Included in the release that is being closed label Jan 31, 2025
@shoom3301 shoom3301 requested a review from a team January 31, 2025 11:51
@shoom3301 shoom3301 self-assigned this Jan 31, 2025
Copy link

vercel bot commented Jan 31, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
cowfi 🛑 Canceled (Inspect) Jan 31, 2025 3:48pm
explorer-dev ✅ Ready (Inspect) Visit Preview Jan 31, 2025 3:48pm
swap-dev ✅ Ready (Inspect) Visit Preview Jan 31, 2025 3:48pm
3 Skipped Deployments
Name Status Preview Updated (UTC)
cosmos ⬜️ Ignored (Inspect) Visit Preview Jan 31, 2025 3:48pm
sdk-tools ⬜️ Ignored (Inspect) Visit Preview Jan 31, 2025 3:48pm
widget-configurator ⬜️ Ignored (Inspect) Visit Preview Jan 31, 2025 3:48pm

const priceImpactIsHighEnough = +priceImpact.toFixed(2) > PRICE_IMPACT_LIMIT
const buyAmountIsBigEnough = +(buyingFiatAmount?.toExact() || 0) > AMOUNT_LIMIT[chainId]

const shouldSuggestTwap = !isSellNative && priceImpactIsHighEnough && buyAmountIsBigEnough
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

A small enhancement: do not show the twap suggestion banner when selling ETH

Copy link
Collaborator

@alfetopito alfetopito left a comment

Choose a reason for hiding this comment

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

Working great!

@vercel vercel bot temporarily deployed to Preview – cowfi January 31, 2025 15:48 Inactive
@alfetopito alfetopito merged commit 55e71b0 into main Jan 31, 2025
12 of 13 checks passed
@alfetopito alfetopito deleted the feat/eth-send-warning branch January 31, 2025 17:43
@github-actions github-actions bot locked and limited conversation to collaborators Jan 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
RELEASE Included in the release that is being closed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants