feat: ondo rwa ui - stock / after-hours badges#40493
Conversation
|
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. |
✨ Files requiring CODEOWNER review ✨👨🔧 @MetaMask/core-extension-ux (5 files, +121 -2)
💎 @MetaMask/metamask-assets (5 files, +395 -5)
🔄 @MetaMask/swaps-engineers (11 files, +1615 -33)
|
Builds ready [34a3600]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
ae4a07d to
ea0c298
Compare
Builds ready [a9ee224]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
There was a problem hiding this comment.
Pull request overview
This PR adds UI components to display stock/after-hours badges for Ondo RWA (Real-World Asset) tokens across multiple views: the bridge token picker, the bridge prepare page (with a market-closed banner and disabled CTA), the asset detail page, and the token cell in the wallet list. It introduces a new useRWAToken hook that computes whether a token is a stock instrument and whether its market is currently open.
Changes:
- Adds
useRWATokenhook with logic to determine stock token status and market open/closed state based onrwaDatatimestamps. - Adds stock/after-hours badge UI to the bridge asset picker, bridge prepare page (CTA button disabled + BannerAlert), asset detail page, and token cell title.
- Updates
fetchBridgeTokenscall inuseTokensWithFilteringto support a new 6-argument API signature alongside the old 5-argument one, via a runtimeFunction.lengthcheck.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
ui/pages/bridge/hooks/useRWAToken.ts |
New hook for determining stock token status and trading hours |
ui/pages/bridge/prepare/prepare-bridge-page.tsx |
Market-closed banner and CTA disabled state |
ui/pages/bridge/prepare/bridge-cta-button.tsx |
Disables CTA and shows "Market is closed" label when market is closed |
ui/pages/bridge/prepare/components/bridge-asset-picker/asset.tsx |
Stock/clock badge in bridge token picker |
ui/components/app/assets/token-cell/cells/token-cell-title.tsx |
Stock/clock badge in wallet token list |
ui/components/app/assets/types.ts |
Adds rwaData to TokenWithFiatAmount type |
ui/pages/asset/components/asset-page.tsx |
Stock/clock badge on asset detail page |
ui/pages/asset/types/asset.ts |
Adds rwaData to Asset type |
ui/hooks/bridge/useTokensWithFiltering.ts |
Adds 6-arg fetchBridgeTokens compatibility shim |
app/_locales/en/messages.json |
Adds locale keys for market-closed UI |
app/_locales/en_GB/messages.json |
Adds locale keys for market-closed UI |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Builds ready [c479b85]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Updated the formatting of the test cases in the TokenCellTitle component to enhance readability. This includes consistent indentation and line breaks for better code clarity without altering the test logic.
Updated the mock functions for isStockToken and isTokenTradingOpen in the TokenCellTitle unit tests to remove default return values. This change enhances flexibility for future test scenarios without altering existing test logic.
Builds ready [6771e8c]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 5 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 4 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
|
Builds ready [00ddd4e]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚀 Bundle size reduced!]
|
Has addressed above comments at this commit 9c93687 |





Description
Changelog
CHANGELOG entry: Added market-closed handling and stock badges for Ondo RWA tokens in token details and token selection views.
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Introduces new market-hours gating that can block token selection and bridge submission, and adds time-based logic to selectors/hooks that could affect warnings/metrics and user flows if timestamps or feature-flag behavior are incorrect.
Overview
Adds an RWA stock-token UI layer gated by a new remote feature flag
rwaTokensEnabled, including new i18n strings and agetIsRWATokensEnabledselector.Introduces
useRWAToken(plus pure helpers) to detect stock tokens viarwaDataand compute trading-open status (including pauses/overnight windows), then surfaces this across token lists and the asset details page via a newStockBadgeand a reusableMarketClosedModal.Updates bridge flow to detect market closed as a validation state (
getIsStockMarketClosed+getValidationErrors/getWarningLabelstime-param), show a banner, emit a newmarket_closedwarning label for metrics, and change the CTA to open the modal instead of submitting when closed; also disables swapping from the asset page when market-closed. Includes extensive unit test coverage and minor selector subscription tweaks (shallowEqual) to reduce rerenders.Written by Cursor Bugbot for commit 00ddd4e. This will update automatically on new commits. Configure here.