Skip to content

Conversation

@NidhiKJha
Copy link
Member

@NidhiKJha NidhiKJha commented Dec 4, 2025

This PR is to fix the link of "View Asset" button in asset-details page

Changelog

CHANGELOG entry:null

Related issues

Fixes: #34698

Manual testing steps

  1. Go to asset-details page
  2. View Asset in Explorer links to asset on block explorer specified in Network details for the asset chain ID

Screenshots/Recordings

Before

After

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.

Note

Uses a new helper to generate asset-details explorer links (EVM uses configured explorer with fallback; non-EVM uses format URLs) and updates token asset to use it, with tests added.

  • Multichain utils:
    • Add getAssetDetailsAccountUrl(address, network) using @metamask/etherscan-link#getAccountLink for EVM (uses configured rpcPrefs.blockExplorerUrl, falls back to Etherscan multichain) and formatBlockExplorerAddressUrl for non-EVM.
  • Asset page:
    • Update token-asset.tsx to use getAssetDetailsAccountUrl for non-EVM explorer links; adjust import.
  • Tests:
    • Extend blockExplorer.test.ts to cover getAssetDetailsAccountUrl for EVM with configured explorer, EVM without explorer (fallback), and non-EVM.

Written by Cursor Bugbot for commit f0cabe2. This will update automatically on new commits. Configure here.

@metamaskbot metamaskbot added team-core-extension-ux Core Extension UX team INVALID-PR-TEMPLATE PR's body doesn't match template labels Dec 4, 2025
@github-actions github-actions bot added the size-S label Dec 4, 2025
const result = getAssetDetailsAccountUrl(address, networkWithoutExplorer);

expect(result).toBe(expectedUrl);
});
Copy link

Choose a reason for hiding this comment

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

Bug: Test expectation mismatch for missing block explorer fallback

The test at line 107 expects getAssetDetailsAccountUrl to return a URL ending with #asset-multichain when no blockExplorerUrl is configured, but the implementation simply calls getAccountLink from @metamask/etherscan-link which won't append this fragment. Either the test expectation is incorrect, or the implementation needs to detect when no block explorer is configured and add the #asset-multichain suffix to match the expected fallback behavior documented in the test name "falls back to Etherscan multichain".

Additional Locations (1)

Fix in Cursor Fix in Web

@metamaskbot
Copy link
Collaborator

Builds ready [f0cabe2]
UI Startup Metrics (1219 ± 92 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1219103014669212871374
load102085211957910621171
domContentLoaded101484711877910571167
domInteractive251594192288
firstPaint50810412013929941108
backgroundConnect21219225712217239
firstReactRender28206593049
getState3515108184067
initialActions104112
loadScripts80864698376851962
setupStore1163341319
numNetworkReqs1056315557
BrowserifyPower User HomeuiStartup20421709260620921842448
load1040900141012711011323
domContentLoaded1027891140312510881315
domInteractive3217103203292
firstPaint53212713844019651298
backgroundConnect276202854139241692
firstReactRender53429085770
getState19114631135205280
initialActions102112
loadScripts81269011851188811088
setupStore1674071635
numNetworkReqs79641542175143
WebpackStandard HomeuiStartup811691115874837969
load63256291068658784
domContentLoaded62855590368654779
domInteractive2615115212289
firstPaint23874811176207645
backgroundConnect1166991227
firstReactRender27206573137
getState2713110133746
initialActions104112
loadScripts62555389366652771
setupStore1062531217
numNetworkReqs1057116560
WebpackPower User HomeuiStartup16421288219923418562088
load690597119796716911
domContentLoaded681589119296703905
domInteractive35191432831115
firstPaint29893793192367696
backgroundConnect1459711228116583
firstReactRender58488986373
getState17614330823186212
initialActions102112
loadScripts678587118294701895
setupStore1775391640
numNetworkReqs80652682974148
FirefoxBrowserifyStandard HomeuiStartup12991060180914614101559
load107090912808811401232
domContentLoaded107090512808811401232
domInteractive56311402783108
firstPaint------
backgroundConnect45221813343134
firstReactRender22183842433
getState136152171135
initialActions102012
loadScripts104389312457811091166
setupStore1862723610110
numNetworkReqs1256817664
BrowserifyPower User HomeuiStartup30401955500188239284539
load1410965267650514202519
domContentLoaded1410965267650414202518
domInteractive1043276493112263
firstPaint------
backgroundConnect2802912823703421192
firstReactRender67352984077134
getState3407911372895291000
initialActions214123
loadScripts1234945256034412772145
setupStore1156101718798607
numNetworkReqs77521442275127
WebpackStandard HomeuiStartup14951263192014515831844
load12281058154310512861427
domContentLoaded12271058154310512851427
domInteractive55241503077113
firstPaint------
backgroundConnect56202504066135
firstReactRender282192103037
getState186197341349
initialActions103112
loadScripts1197104415069812611359
setupStore12673101134
numNetworkReqs1256517761
WebpackPower User HomeuiStartup33932361582596543615337
load16891220302757719802888
domContentLoaded16891220302757719802888
domInteractive1093160481115253
firstPaint------
backgroundConnect2303016093072231055
firstReactRender80434716374200
getState337801946311498919
initialActions4165927
loadScripts15601185290746016312792
setupStore12961039197113694
numNetworkReqs77571512373132
📊 Page Load Benchmark Results

Current Commit: f0cabe2 | Date: 12/4/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±52ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 727ms (±50ms) 🟢 | historical mean value: 729ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±14ms) 🟢 | historical mean value: 80ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 52ms 1.01s 1.32s 1.09s 1.32s
domContentLoaded 727ms 50ms 703ms 998ms 766ms 998ms
firstPaint 77ms 14ms 56ms 200ms 84ms 200ms
firstContentfulPaint 77ms 14ms 56ms 200ms 84ms 200ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 94.19 KiB (1.81%)
  • ui: -604 Bytes (-0.01%)
  • common: 4.47 KiB (0.05%)

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

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template size-S team-core-extension-ux Core Extension UX team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Token list: View asset in explorer Etherscan rather than chain Blockexplorer

3 participants