Skip to content

feat: allows pasting external addresses for crosschain bridges #30995

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

Merged
merged 15 commits into from
Mar 19, 2025

Conversation

ghgoodreau
Copy link
Contributor

@ghgoodreau ghgoodreau commented Mar 13, 2025

Description

• If user has no Solana account: no external account pasting option
• If user has Solana account: user can select dropdown any Solana accounts they have, and otherwise paste in an external account for dest account

Open in GitHub Codespaces

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/MMS-2103

Manual testing steps

  1. Create an EVM <-> SOL bridge (either direction)
  2. In the account picker, paste in an external account
  3. Notice that you can select the external account

Screenshots/Recordings

Before

After

Screen.Recording.2025-03-18.at.1.33.24.PM.mov

Pre-merge author checklist

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.

Copy link
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.

@metamaskbot metamaskbot added the team-swaps-and-bridge For issues with Swaps or Bridging label Mar 13, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [a895d3c]
Page Load Metrics (4262 ± 1809 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint181716859402236441750
domContentLoaded171816361371135391700
load186017092426237681809
domInteractive281472194341164
backgroundConnect911699508410197
firstReactRender28173914019
getState2862923217484
initialActions01000
loadScripts129715076296233021585
setupStore143801109646
uiStartup242217559634543022066
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 971 Bytes (0.01%)
  • common: 45 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [0338d57]
Page Load Metrics (4489 ± 1927 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint50617151401640231932
domContentLoaded160116543373938931870
load168817641448940141927
domInteractive271133147255122
backgroundConnect891790687438210
firstReactRender1956716412057
getState25929390251121
initialActions01000
loadScripts121215109297236711763
setupStore1053719113665
uiStartup196621146744647522282
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 971 Bytes (0.01%)
  • common: 45 Bytes (0.00%)

@ghgoodreau ghgoodreau changed the title feat: allows pasting external addresses and autoselecting them feat: allows pasting external addresses for crosschain bridges Mar 18, 2025
@ghgoodreau ghgoodreau marked this pull request as ready for review March 18, 2025 20:39
@ghgoodreau ghgoodreau requested a review from a team as a code owner March 18, 2025 20:39
@metamaskbot
Copy link
Collaborator

Builds ready [5b9e54b]
Page Load Metrics (2753 ± 984 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1692998625281728830
domContentLoaded1573928723051613775
load17101155827532049984
domInteractive27245525024
backgroundConnect1371938432388186
firstReactRender37298955627
getState421141203233112
initialActions01000
loadScripts1134810317121471706
setupStore19377879546
uiStartup223322667526148282318
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 3.69 KiB (0.05%)
  • common: 45 Bytes (0.00%)

GustavoRSSilva
GustavoRSSilva previously approved these changes Mar 18, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [89b03bb]
Page Load Metrics (2616 ± 395 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint81253332265828398
domContentLoaded162152002190852409
load170753252616823395
domInteractive26202605024
backgroundConnect9384639419292
firstReactRender21203974521
getState1247822614570
initialActions01000
loadScripts118837211572633304
setupStore1039213610752
uiStartup2100829347951667800
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 3.69 KiB (0.05%)
  • common: 45 Bytes (0.00%)

GustavoRSSilva
GustavoRSSilva previously approved these changes Mar 19, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [fd172ee]
Page Load Metrics (3959 ± 1850 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint33114798363538931869
domContentLoaded150914476355437281790
load157714844395938541850
domInteractive2450173271080518
backgroundConnect741067391312150
firstReactRender22212855124
getState13924192234112
initialActions01000
loadScripts110413863288035561708
setupStore1038110210651
uiStartup184219606588948142311
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 3.68 KiB (0.05%)
  • common: 45 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [84a8f23]
Page Load Metrics (2705 ± 473 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint162451952455825396
domContentLoaded154543712118650312
load163557912705985473
domInteractive27296827134
backgroundConnect991218576356171
firstReactRender411731043818
getState3863523516881
initialActions00000
loadScripts114828881455390187
setupStore143271228842
uiStartup226416481578134251645
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: 3.68 KiB (0.05%)
  • common: 45 Bytes (0.00%)

@micaelae micaelae requested a review from Copilot March 19, 2025 22:03
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds functionality to support pasting external addresses for crosschain bridges, allowing users with a Solana account to either select from their accounts or paste an external account.

  • Introduces a new ExternalAccountListItem component to render external accounts.
  • Adds types for ExternalAccount and a union type DestinationAccount.
  • Updates the destination account picker and selected account list item components to support both internal and external accounts, and adjusts the account hook accordingly.

Reviewed Changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
ui/pages/bridge/prepare/components/external-account-list-item.tsx New component to display external account details
ui/pages/bridge/prepare/types.ts Introduces ExternalAccount and DestinationAccount types
ui/pages/bridge/prepare/components/destination-account-picker.tsx Integrates external account creation and selection logic
ui/pages/bridge/prepare/components/destination-selected-account-list-item.tsx Adjusts display logic based on account type
ui/pages/bridge/hooks/useDestinationAccount.ts Updates state type to DestinationAccount (state destructuring issue)
Files not reviewed (2)
  • app/_locales/en/messages.json: Language not supported
  • app/_locales/en_GB/messages.json: Language not supported
Comments suppressed due to low confidence (1)

ui/pages/bridge/hooks/useDestinationAccount.ts:19

  • The state initialization is missing a destructuring assignment. Please update it to '[selectedDestinationAccount, setSelectedDestinationAccount] = useState<DestinationAccount | null>(null);' to properly capture and use the state.
useState<DestinationAccount | null>(null);

@ghgoodreau ghgoodreau added this pull request to the merge queue Mar 19, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 19, 2025
@ghgoodreau ghgoodreau added this pull request to the merge queue Mar 19, 2025
Merged via the queue into main with commit 5fa926d Mar 19, 2025
77 checks passed
@ghgoodreau ghgoodreau deleted the mms-2103-external-accts branch March 19, 2025 23:45
@github-actions github-actions bot locked and limited conversation to collaborators Mar 19, 2025
@metamaskbot metamaskbot added the release-12.16.0 Issue or pull request that will be included in release 12.16.0 label Mar 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.16.0 Issue or pull request that will be included in release 12.16.0 team-swaps-and-bridge For issues with Swaps or Bridging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants