-
-
Notifications
You must be signed in to change notification settings - Fork 262
feat: fake the rwaData returned from backend to make sure it work for mobile frontend. #7548
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
base: main
Are you sure you want to change the base?
Conversation
|
@metamaskbot publish-preview |
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
| }, | ||
| "packages/assets-controllers/src/TokenListController.ts": { | ||
| "@typescript-eslint/explicit-function-return-type": { | ||
| "count": 6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change will fix the lint complaining about --prune-suppressions paratmeter, but when we put that parameter to run yarn lint it still complain. the only way is to change the count here to pass the error, if your guys know some better way to fix this issue, i am happy to change it back here.
| (elm) => | ||
| Boolean(elm.aggregators.includes('lineaTeam')) || | ||
| elm.aggregators.length >= 3, | ||
| elm.aggregators.includes('lineaTeam') ?? elm.aggregators.length >= 3, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nullish coalescing breaks token filter logic
High Severity
The filter logic for Linea Mainnet tokens changed from || (logical OR) to ?? (nullish coalescing). The includes() method always returns a boolean (true or false), never null or undefined. Since ?? only evaluates the right-hand side when the left is null/undefined, the condition elm.aggregators.length >= 3 will never be evaluated. Tokens without 'lineaTeam' but with 3+ aggregators will be incorrectly filtered out, breaking the intended behavior documented in the changelog as "lineaTeam aggregator OR more than 3 aggregators".
| minMarketCap, | ||
| maxMarketCap, | ||
| excludeLabels, | ||
| includeRwaData, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API parameter documented but silently ignored
Medium Severity
The getTrendingTokens function's type definition still includes includeRwaData?: boolean at line 281, and the CHANGELOG documents this as an optional parameter. However, includeRwaData is no longer destructured from the function parameters (lines 263-271), meaning any value passed by callers is silently ignored. The parameter is now hardcoded to 'true' at line 109. Callers expecting to control RWA data inclusion will experience unexpected behavior.
This is draft PR to fake the backend returned to provide rwaData metadata to mobile frontend.
Explanation
References
Checklist
Note
Introduces optional
rwaDataacross token types and ensures it is fetched and stored throughout the assets stack.includeRwaData=trueto token-service URLs (/tokens,/token,/tokens/search,/v3/tokens/trending), refactors search URL helper, and adjusts headers handlingTokenListToken,Token(rates), and asset selector items to includerwaData; plumbsrwaDatathroughTokensController(add/import/detected),TokenDetectionController(RPC/WS/polling flows), and caches inTokenListControllervalidatorsschema updated to acceptrwaDataWritten by Cursor Bugbot for commit ffabbd2. This will update automatically on new commits. Configure here.