Skip to content

Conversation

@Prithpal-Sooriya
Copy link
Contributor

@Prithpal-Sooriya Prithpal-Sooriya commented Jan 9, 2026

Explanation

  • Modified token service URLs to append includeRwaData=true for fetching token data.
  • Updated related test cases to reflect the new API request structure.
  • Adjusted TokenListController to support RWA data in token list retrieval.

This change enhances the token service functionality by allowing the inclusion of RWA data in the responses, improving the overall data richness for consumers.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Adds RWA metadata support to token list retrieval and shortens cache refresh window.

  • Append includeRwaData=true to token list API calls in fetchTokenListByChainId; update tests accordingly
  • Extend TokenListController token type with optional rwaData (TokenRwaData)
  • Reduce TokenListController cache interval/threshold from 24h to 4h
  • Update CHANGELOG.md

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

- Modified token service URLs to append `includeRwaData=true` for fetching token data.
- Updated related test cases to reflect the new API request structure.
- Adjusted `TokenListController` to support RWA data in token list retrieval.

This change enhances the token service functionality by allowing the inclusion of RWA data in the responses, improving the overall data richness for consumers.
@Prithpal-Sooriya Prithpal-Sooriya marked this pull request as ready for review January 9, 2026 13:19
@Prithpal-Sooriya Prithpal-Sooriya requested review from a team as code owners January 9, 2026 13:19
Comment on lines +24 to +26
// 4 Hour Interval Cache Refresh Threshold
const DEFAULT_INTERVAL = 4 * 60 * 60 * 1000;
const DEFAULT_THRESHOLD = 4 * 60 * 60 * 1000;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed in slack - we have modified the cache interval from 24 hours to 4 hours.

We should monitor if this causes any performance hits - (mostly from the large writes to state)

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we wanted to pass this in constructor client side instead of updating the controller's default values?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

meeeeh I don't mind either or... But this would minimise client changes required. Open to options on this :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmm agree, tbh doing it on constructor seems to be the proper way to go about this.
Doing it in this controller is less changes for sure;
I don't mind tbh, if you feel like you prefer this one, happy to approve 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sweet, lets do it inside the controller for now -- less changes that devs need to make. We can treat the ones inside the constructor as "overrides" if it needs to be overridden.

return `/tokens/${convertHexToDecimal(
chainId,
)}?occurrenceFloor=3&includeNativeAssets=false&includeTokenFees=false&includeAssetType=false&includeERC20Permit=false&includeStorage=false`;
)}?occurrenceFloor=3&includeNativeAssets=false&includeTokenFees=false&includeAssetType=false&includeERC20Permit=false&includeStorage=false&includeRwaData=true`;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have a PR to update to the new endpoint #7572
However this is postponed to reduce the scope of changes for the RWA feature launch.

@Prithpal-Sooriya Prithpal-Sooriya force-pushed the ASSETS-2205/update-token-metadata-to-support-rwa-data branch from 832bbcc to cfb24ed Compare January 9, 2026 13:29
@Prithpal-Sooriya
Copy link
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/account-tree-controller": "4.0.0-preview-cb897e9",
  "@metamask-previews/accounts-controller": "35.0.0-preview-cb897e9",
  "@metamask-previews/address-book-controller": "7.0.1-preview-cb897e9",
  "@metamask-previews/analytics-controller": "1.0.0-preview-cb897e9",
  "@metamask-previews/announcement-controller": "8.0.0-preview-cb897e9",
  "@metamask-previews/app-metadata-controller": "2.0.0-preview-cb897e9",
  "@metamask-previews/approval-controller": "8.0.0-preview-cb897e9",
  "@metamask-previews/assets-controllers": "95.0.0-preview-cb897e9",
  "@metamask-previews/base-controller": "9.0.0-preview-cb897e9",
  "@metamask-previews/bridge-controller": "64.3.0-preview-cb897e9",
  "@metamask-previews/bridge-status-controller": "64.3.0-preview-cb897e9",
  "@metamask-previews/build-utils": "3.0.4-preview-cb897e9",
  "@metamask-previews/chain-agnostic-permission": "1.4.0-preview-cb897e9",
  "@metamask-previews/claims-controller": "0.4.1-preview-cb897e9",
  "@metamask-previews/composable-controller": "12.0.0-preview-cb897e9",
  "@metamask-previews/controller-utils": "11.18.0-preview-cb897e9",
  "@metamask-previews/core-backend": "5.0.0-preview-cb897e9",
  "@metamask-previews/delegation-controller": "2.0.0-preview-cb897e9",
  "@metamask-previews/earn-controller": "11.0.0-preview-cb897e9",
  "@metamask-previews/eip-5792-middleware": "2.1.0-preview-cb897e9",
  "@metamask-previews/eip-7702-internal-rpc-middleware": "0.1.0-preview-cb897e9",
  "@metamask-previews/eip1193-permission-middleware": "1.0.3-preview-cb897e9",
  "@metamask-previews/ens-controller": "19.0.0-preview-cb897e9",
  "@metamask-previews/error-reporting-service": "3.0.1-preview-cb897e9",
  "@metamask-previews/eth-block-tracker": "15.0.0-preview-cb897e9",
  "@metamask-previews/eth-json-rpc-middleware": "22.0.1-preview-cb897e9",
  "@metamask-previews/eth-json-rpc-provider": "6.0.0-preview-cb897e9",
  "@metamask-previews/foundryup": "1.0.1-preview-cb897e9",
  "@metamask-previews/gas-fee-controller": "26.0.0-preview-cb897e9",
  "@metamask-previews/gator-permissions-controller": "0.8.0-preview-cb897e9",
  "@metamask-previews/json-rpc-engine": "10.2.0-preview-cb897e9",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.8-preview-cb897e9",
  "@metamask-previews/keyring-controller": "25.0.0-preview-cb897e9",
  "@metamask-previews/logging-controller": "7.0.1-preview-cb897e9",
  "@metamask-previews/message-manager": "14.1.0-preview-cb897e9",
  "@metamask-previews/messenger": "0.3.0-preview-cb897e9",
  "@metamask-previews/multichain-account-service": "5.0.0-preview-cb897e9",
  "@metamask-previews/multichain-api-middleware": "1.2.5-preview-cb897e9",
  "@metamask-previews/multichain-network-controller": "3.0.0-preview-cb897e9",
  "@metamask-previews/multichain-transactions-controller": "7.0.0-preview-cb897e9",
  "@metamask-previews/name-controller": "9.0.0-preview-cb897e9",
  "@metamask-previews/network-controller": "27.2.0-preview-cb897e9",
  "@metamask-previews/network-enablement-controller": "4.0.0-preview-cb897e9",
  "@metamask-previews/notification-services-controller": "21.0.0-preview-cb897e9",
  "@metamask-previews/permission-controller": "12.2.0-preview-cb897e9",
  "@metamask-previews/permission-log-controller": "5.0.0-preview-cb897e9",
  "@metamask-previews/phishing-controller": "16.1.0-preview-cb897e9",
  "@metamask-previews/polling-controller": "16.0.0-preview-cb897e9",
  "@metamask-previews/preferences-controller": "22.0.0-preview-cb897e9",
  "@metamask-previews/profile-metrics-controller": "2.0.0-preview-cb897e9",
  "@metamask-previews/profile-sync-controller": "27.0.0-preview-cb897e9",
  "@metamask-previews/ramps-controller": "2.1.0-preview-cb897e9",
  "@metamask-previews/rate-limit-controller": "7.0.0-preview-cb897e9",
  "@metamask-previews/remote-feature-flag-controller": "4.0.0-preview-cb897e9",
  "@metamask-previews/sample-controllers": "4.0.0-preview-cb897e9",
  "@metamask-previews/seedless-onboarding-controller": "7.1.0-preview-cb897e9",
  "@metamask-previews/selected-network-controller": "26.0.0-preview-cb897e9",
  "@metamask-previews/shield-controller": "4.1.0-preview-cb897e9",
  "@metamask-previews/signature-controller": "38.0.0-preview-cb897e9",
  "@metamask-previews/storage-service": "0.0.1-preview-cb897e9",
  "@metamask-previews/subscription-controller": "5.4.0-preview-cb897e9",
  "@metamask-previews/token-search-discovery-controller": "4.0.0-preview-cb897e9",
  "@metamask-previews/transaction-controller": "62.7.0-preview-cb897e9",
  "@metamask-previews/transaction-pay-controller": "10.6.0-preview-cb897e9",
  "@metamask-previews/user-operation-controller": "41.0.0-preview-cb897e9"
}

@Prithpal-Sooriya
Copy link
Contributor Author

Preview build here: MetaMask/metamask-extension#39129

@Prithpal-Sooriya
Copy link
Contributor Author

Demo on extension with tokens that have RWA data.
https://consensys.zoom.us/clips/share/pzaFgzKXQY6OwMtIEv_jEg

@Prithpal-Sooriya Prithpal-Sooriya added this pull request to the merge queue Jan 9, 2026
Merged via the queue into main with commit 460f31b Jan 9, 2026
286 checks passed
@Prithpal-Sooriya Prithpal-Sooriya deleted the ASSETS-2205/update-token-metadata-to-support-rwa-data branch January 9, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants