Skip to content

feat: add cross chain swaps link in extension#23437

Merged
BZahory merged 6 commits intodevelopfrom
bridge-experiment-1
Mar 13, 2024
Merged

feat: add cross chain swaps link in extension#23437
BZahory merged 6 commits intodevelopfrom
bridge-experiment-1

Conversation

@BZahory
Copy link
Copy Markdown
Contributor

@BZahory BZahory commented Mar 12, 2024

Description

As part of ongoing monetization efforts, Portfolio primitives are looking for opportunities to enable new revenue-generating flows. One area is the swaps page, where we can recommend users navigate to MetaMask Bridges if they wish to complete a cross-chain swap. Our hypothesis is that this will allow us to better target users that wish to complete both a swap and a bridge.

Open in GitHub Codespaces

Related issues

METABRIDGE-846

Manual testing steps

  1. Go to the Swaps page on any network support by both Bridges and Swaps (e.g., Ethereum Mainnet)
  2. Verify that the button is available
  3. Verify that it links to MetaMask Bridges, with the correct token and chain selected
    • Verify that the MetaMetrics ID is passed as a query parameter when the page is first loaded
  4. Verify that it disappears when you begin to fetch a quote
  5. Verify that it doesn't appear at all for networks supported by Swaps but unsupported by Bridges
    • You may need to remove a Swaps-supported network from ALLOWED_BRIDGE_CHAIN_IDS, or add a Swaps Testnet (chain ID 1337) to MetaMask to test this.

Screenshots/Recordings

Before

Screenshot 2024-03-12 at 5 20 17 PM

After

Screenshot 2024-03-12 at 6 28 45 PM Screenshot 2024-03-12 at 6 29 07 PM

After clicking the link in either state:

Screenshot 2024-03-12 at 5 18 03 PM

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@BZahory BZahory requested a review from a team as a code owner March 12, 2024 21:06
@github-actions
Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@BZahory BZahory added the team-bridge-deprecated DEPRECATED: please use "team-swaps-and-bridge" instead label Mar 12, 2024
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [ace446b]
Page Load Metrics (1162 ± 388 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint732001134019
domContentLoaded973282110
load5819511162808388
domInteractive97326199
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 808 Bytes (0.01%)
  • common: 77 Bytes (0.00%)

micaelae
micaelae previously approved these changes Mar 12, 2024
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 12, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 68.73%. Comparing base (6e397d0) to head (2d52296).

Files Patch % Lines
...pages/swaps/prepare-swap-page/prepare-swap-page.js 66.67% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #23437   +/-   ##
========================================
  Coverage    68.72%   68.73%           
========================================
  Files         1124     1124           
  Lines        43606    43618   +12     
  Branches     11669    11675    +6     
========================================
+ Hits         29967    29977   +10     
- Misses       13639    13641    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

micaelae
micaelae previously approved these changes Mar 12, 2024
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [ace446b]
Page Load Metrics (1081 ± 441 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint732391203818
domContentLoaded106829157
load5625181081919441
domInteractive96829157
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 808 Bytes (0.01%)
  • common: 77 Bytes (0.00%)

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [2d52296]
Page Load Metrics (972 ± 385 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint591771223818
domContentLoaded96734199
load461890972802385
domInteractive96734199
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 853 Bytes (0.01%)
  • common: 77 Bytes (0.00%)

@BZahory BZahory merged commit 5349e6a into develop Mar 13, 2024
@BZahory BZahory deleted the bridge-experiment-1 branch March 13, 2024 05:23
@github-actions github-actions bot locked and limited conversation to collaborators Mar 13, 2024
@metamaskbot metamaskbot added the release-11.14.0 Issue or pull request that will be included in release 11.14.0 label Mar 13, 2024
onClick={() => {
const portfolioUrl = getPortfolioUrl(
'bridge',
'ext_bridge_button',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we should change this to differentiate between these clicks and those from the overview page buttons

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-11.14.0 Issue or pull request that will be included in release 11.14.0 team-bridge-deprecated DEPRECATED: please use "team-swaps-and-bridge" instead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants