Skip to content

Mobula_Url_Updated#504

Merged
vignesha22 merged 3 commits into
stagingfrom
Updated_Mobula_Endpoint
Apr 15, 2026
Merged

Mobula_Url_Updated#504
vignesha22 merged 3 commits into
stagingfrom
Updated_Mobula_Endpoint

Conversation

@vignesha22
Copy link
Copy Markdown
Contributor

@vignesha22 vignesha22 commented Apr 10, 2026

Description

-Added a new env called VITE_MOBULA_API_KEY for mobula api key and changed the mobula endpoint to current public endpoint

How Has This Been Tested?

Screenshot 2026-04-10 at 4 24 00 PM

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Summary by CodeRabbit

  • Refactor

    • Updated logo retrieval with new API endpoint and authentication headers.
  • Chores

    • Added API key configuration requirement to environment settings for logo service.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 10, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (2)
  • src/apps/pillarx-app/components/TokenMarketDataRow/tests/__snapshots__/LeftColumnTokenMarketDataRow.test.tsx.snap is excluded by !**/*.snap
  • src/apps/pillarx-app/components/TokensWithMarketDataTile/test/__snapshots__/TokensWithMarketDataTile.test.tsx.snap is excluded by !**/*.snap

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 371bb178-33ec-4e0d-914e-0f140c464d36

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds VITE_MOBULA_API_KEY to .env.example and updates logoUtils.ts to call a different Mobula API host (api.mobula.io) with an Authorization header sourced from import.meta.env.VITE_MOBULA_API_KEY; function signatures were reformatted only.

Changes

Cohort / File(s) Summary
Environment Configuration
.env.example
Added VITE_MOBULA_API_KEY="your_api_key_here" placeholder.
Logo Utilities
src/apps/insights/utils/logoUtils.ts
Switched Mobula request URL from explorer-api.mobula.io to api.mobula.io; added Authorization header using import.meta.env.VITE_MOBULA_API_KEY with a fallback string; reformatted getCachedLogo and fetchLogoFromMobula signatures across multiple lines. Cache, selection logic, TTL, and error handling remain unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A tiny key I tuck away, 🥕
To fetch fine marks in bright array,
I hop to api with a cheerful blink,
Headers set — no missing link!
Logos found, then home I sink.

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Mobula_Url_Updated' is partially related to the changeset but lacks clarity and conciseness; it refers to the URL endpoint change but misses the equally important API key configuration addition. Consider a more descriptive title like 'Update Mobula API endpoint and add API key configuration' to clearly capture both main changes.
Description check ❓ Inconclusive The description addresses the main changes but lacks detailed testing information and only provides a screenshot without written explanation of the test process. Please provide written details about your testing environment, test cases, and how you verified that the Mobula API integration works correctly with the new endpoint and API key configuration.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch Updated_Mobula_Endpoint

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.env.example:
- Line 14: The environment variable MOBULA_API_KEY must be renamed to
VITE_MOBULA_API_KEY to follow Vite's VITE_ exposure convention; update the
.env.example entry to VITE_MOBULA_API_KEY="your_api_key_here" and then update
all code references that read MOBULA_API_KEY (e.g., any places accessing
import.meta.env.MOBULA_API_KEY or process.env.MOBULA_API_KEY) to use
VITE_MOBULA_API_KEY (import.meta.env.VITE_MOBULA_API_KEY) so the key is properly
exposed at build/runtime.

In `@src/apps/insights/utils/logoUtils.ts`:
- Around line 71-76: Fail fast if the MOBULA API key is missing and URL-encode
the search input: in src/apps/insights/utils/logoUtils.ts update the fetch logic
that constructs the URL using the variable symbol and sets Authorization from
import.meta.env.MOBULA_API_KEY so that you first throw or return an explicit
error when import.meta.env.MOBULA_API_KEY is empty/undefined (do not send a
placeholder), and use encodeURIComponent(symbol) when interpolating the symbol
into the request URL; ensure the Authorization header uses the real key value
only.
- Line 71: Replace the deprecated v1 URL template
`https://api.mobula.io/api/1/search?mode=og&sortBy=volume_24h&input=${symbol}`
with the v2 endpoint `https://api.mobula.io/api/2/fast-search` while keeping the
same query parameters (`input`, `mode`, `sortBy`) so the request becomes
`.../api/2/fast-search?mode=og&sortBy=volume_24h&input=${symbol}`; then update
the response parsing logic (where you currently expect v1 fields) to read the v2
response properties `symbol`, `logo`, and `marketCapUSD` (adjust any variable
names or object destructuring in the function that builds or consumes this URL
and the subsequent parsing code that uses the `symbol` variable) so the function
that constructs this template literal and the consumer of its response use the
new endpoint and fields.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 554aca5a-d736-485c-8b8f-25ccaa7632b9

📥 Commits

Reviewing files that changed from the base of the PR and between 4e87410 and 0424078.

📒 Files selected for processing (2)
  • .env.example
  • src/apps/insights/utils/logoUtils.ts

Comment thread .env.example Outdated
Comment thread src/apps/insights/utils/logoUtils.ts
Comment thread src/apps/insights/utils/logoUtils.ts
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 14, 2026

Deploying x with  Cloudflare Pages  Cloudflare Pages

Latest commit: d16a42b
Status: ✅  Deploy successful!
Preview URL: https://54f187a5.x-e62.pages.dev
Branch Preview URL: https://updated-mobula-endpoint.x-e62.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 14, 2026

Deploying pillarx-debug with  Cloudflare Pages  Cloudflare Pages

Latest commit: d16a42b
Status: ✅  Deploy successful!
Preview URL: https://97e198c4.pillarx-debug.pages.dev
Branch Preview URL: https://updated-mobula-endpoint.pillarx-debug.pages.dev

View logs

Copy link
Copy Markdown

@ch4r10t33r ch4r10t33r left a comment

Choose a reason for hiding this comment

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

looks good

@vignesha22 vignesha22 merged commit b88a701 into staging Apr 15, 2026
6 of 7 checks passed
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.

2 participants