Skip to content

feat: add fallback for restricted ondo token list#6978

Open
limitofzero wants to merge 1 commit intodevelopfrom
feat/fallback-for-rwa
Open

feat: add fallback for restricted ondo token list#6978
limitofzero wants to merge 1 commit intodevelopfrom
feat/fallback-for-rwa

Conversation

@limitofzero
Copy link
Contributor

@limitofzero limitofzero commented Feb 6, 2026

Summary

Adds hardcoded fallback for Ondo tokenized list when CMS fetch fails

To Test

  1. Test fallback behavior
    • Simulate CMS failure (block cms request)
    • Verify that the Ondo token list is returned as fallback - restricted list should require the consent

Summary by CodeRabbit

  • Bug Fixes
    • Improved error handling for token list retrieval to gracefully fall back to a default Ondo token list instead of returning null on fetch failures, ensuring better resilience.

@vercel
Copy link

vercel bot commented Feb 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cowfi Ready Ready Preview Feb 6, 2026 6:30pm
explorer-dev Ready Ready Preview Feb 6, 2026 6:30pm
sdk-tools Ready Ready Preview Feb 6, 2026 6:30pm
swap-dev Ready Ready Preview Feb 6, 2026 6:30pm
widget-configurator Ready Ready Preview Feb 6, 2026 6:30pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
cosmos Ignored Ignored Feb 6, 2026 6:30pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 6, 2026

Walkthrough

This change introduces Ondo token list configuration constants and updates error handling in the restricted token list fetcher to return a default Ondo token list as fallback instead of null on fetch failures.

Changes

Cohort / File(s) Summary
Ondo Token Constants
libs/core/src/cms/consts.ts
Added ONDO_TOKEN_LIST_URL constant pointing to Ondo token list JSON and ONDO_RESTRICTED_COUNTRIES array of country codes with literal type enforcement.
Token List Fetch Error Handling
libs/core/src/cms/utils/getRestrictedTokenLists.ts
Updated error handling to return a default Ondo token list (with name, URL, and restricted countries) instead of null on fetch failure.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • elena-zh
  • shoom3301

Poem

🐰 Constants hop into place with care,
Ondo tokens listed here and there,
When fetch calls stumble, don't despair—
A fallback waits with country-aware flair!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a fallback mechanism for the restricted Ondo token list.
Description check ✅ Passed The description covers the summary and testing steps, though it omits the optional Background section. Core content is present and appropriate.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/fallback-for-rwa

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant