Skip to content

chore: add getTrendingTokens wrapper - #7054

Merged
sahar-fehri merged 8 commits into
mainfrom
ASSETS-1516-controllers-add-trending-tokens-fetcher-service-in-assets-controllers-to-consume-get-trending-tokens-v-3
Nov 5, 2025
Merged

sahar-fehri merged 8 commits into
mainfrom
ASSETS-1516-controllers-add-trending-tokens-fetcher-service-in-assets-controllers-to-consume-get-trending-tokens-v-3

Conversation

@sahar-fehri

@sahar-fehri sahar-fehri commented Nov 4, 2025 •

Copy link
Copy Markdown
Contributor

Explanation

Creates a new function to fetch trending tokens.

The function accepts an array of CAIP chainIds along with other optional filtering query params.

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, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

Note

Adds getTrendingTokens to fetch multi-chain trending tokens with optional filters, and exports new SortTrendingBy/TrendingAsset types.

  • Token service (src/token-service.ts):
    • Implement getTrendingTokens to fetch trending tokens across CAIP chainIds with optional filters (sortBy, liquidity, 24h volume, market cap).
    • Add getTrendingTokensURL helper.
    • Introduce types SortTrendingBy and TrendingAsset.
  • Exports (src/index.ts):
    • Export getTrendingTokens and types SortTrendingBy, TrendingAsset.
  • Tests (src/token-service.test.ts):
    • Add coverage for getTrendingTokens success, empty inputs, non-array and error responses.
  • Docs/Changelog:
    • Update CHANGELOG.md under Unreleased with new API and types.

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

@sahar-fehri
sahar-fehri force-pushed the ASSETS-1516-controllers-add-trending-tokens-fetcher-service-in-assets-controllers-to-consume-get-trending-tokens-v-3 branch from 0d72294 to 265e648 Compare November 4, 2025 18:49
@sahar-fehri
sahar-fehri marked this pull request as ready for review November 4, 2025 18:51
@sahar-fehri
sahar-fehri requested review from a team as code owners November 4, 2025 18:51
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Comment thread packages/assets-controllers/src/token-service.test.ts
Comment thread packages/assets-controllers/src/token-service.ts Outdated
Comment thread packages/assets-controllers/src/token-service.ts Outdated
@sahar-fehri
sahar-fehri force-pushed the ASSETS-1516-controllers-add-trending-tokens-fetcher-service-in-assets-controllers-to-consume-get-trending-tokens-v-3 branch from e38e534 to da456e8 Compare November 4, 2025 21:01
Comment thread packages/assets-controllers/src/token-service.ts Outdated
salimtb
salimtb previously approved these changes Nov 5, 2025
Comment thread packages/assets-controllers/src/token-service.ts Outdated
salimtb
salimtb previously approved these changes Nov 5, 2025
salimtb
salimtb previously approved these changes Nov 5, 2025
Comment thread packages/assets-controllers/src/token-service.ts Outdated
Comment thread packages/assets-controllers/src/token-service.ts Outdated
Comment thread packages/assets-controllers/src/token-service.ts Outdated
Comment thread packages/assets-controllers/src/token-service.ts Outdated
…fetcher-service-in-assets-controllers-to-consume-get-trending-tokens-v-3

@cryptodev-2s cryptodev-2s left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@sahar-fehri
sahar-fehri merged commit a776088 into main Nov 5, 2025
262 checks passed
@sahar-fehri
sahar-fehri deleted the ASSETS-1516-controllers-add-trending-tokens-fetcher-service-in-assets-controllers-to-consume-get-trending-tokens-v-3 branch November 5, 2025 10:11
@sahar-fehri

Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

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