Skip to content

chore: bump CowSwap.json version with new Ink tokens and updated WETH logos#1353

Merged
alfetopito merged 2 commits intomainfrom
feat/bump-version-ink-tokens
Feb 5, 2026
Merged

chore: bump CowSwap.json version with new Ink tokens and updated WETH logos#1353
alfetopito merged 2 commits intomainfrom
feat/bump-version-ink-tokens

Conversation

@Danziger
Copy link
Contributor

@Danziger Danziger commented Feb 5, 2026

@Danziger Danziger requested a review from alfetopito February 5, 2026 10:48
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 5, 2026

📝 Walkthrough

Walkthrough

Updated CoinGecko URL handling and token validation in src/scripts/cowFi-tokens.js (added centralized endpoints, quote params, and runtime warnings), and bumped metadata/timestamp and EOF newline in src/public/CowSwap.json.

Changes

Cohort / File(s) Summary
CowSwap metadata update
src/public/CowSwap.json
Bumped minor version 9→10, updated timestamp to 2026-02-05T10:45:00+00:00, and adjusted end-of-file newline.
CoinGecko endpoints & token validation
src/scripts/cowFi-tokens.js
Added coinGeckoCoinsUrl and coinGeckoCoinsQuoteParams, rebuilt coinGeckoIdListUrl, switched to centralized quote params when requesting coin data, added platform address validation and debug warnings, and refactored final filtering logic.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • alfetopito

Poem

🐰 I found new URLs beneath the log,
Quotes gathered neatly like clover in fog,
Warnings I trumpet for addresses astray,
A JSON bumped forward, hopping into the day,
Debug carrots trail the coder's way.

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title mentions bumping CowSwap.json version with new Ink tokens and updated WETH logos, but the actual changes include substantive refactoring of src/scripts/cowFi-tokens.js with new constants and enhanced data filtering logic that are not reflected in the title. Update the title to accurately reflect all significant changes, such as: 'chore: refactor CoinGecko endpoints and add platform validation to cowFi-tokens, bump CowSwap.json version'
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 (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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/bump-version-ink-tokens

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
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: 1

🤖 Fix all issues with AI agents
In `@src/scripts/cowFi-tokens.js`:
- Around line 127-133: The progress counter is off because totalTokens is set to
idsData.length + 1; change totalTokens to compute from idsData.length (e.g.,
totalTokens = idsData.length) so the console log inside the while loop that
prints `[${index + 1}/${totalTokens}]` shows correct n/n on the final item;
update the variable assignment near where totalTokens, idsData, index and the
while loop are defined (ensure no other logic depends on the +1).
🧹 Nitpick comments (1)
src/scripts/cowFi-tokens.js (1)

187-203: Add normalization for platform chain keys to match codebase patterns.
While CoinGecko's API currently returns lowercase platform keys (ethereum, xdai), normalizing the chain parameter with .toLowerCase() improves consistency with how addresses and symbols are handled elsewhere in the file and adds defensive resilience against potential future API changes.

🔧 Suggested change
    return Object.entries(platforms).some(([chain, address]) => {
      if (typeof address !== 'string' || !address) {
        console.warn(
          `Platform entry for chain="${chain}" has no address. Skipping... Debug URL: ${coinGeckoCoinsUrl}/${id}?${coinGeckoCoinsQuoteParams}`,
        )
        return false
      }

+     const normalizedChain = chain.toLowerCase()
      return (
        combined_ids[address.toLowerCase()] &&
-       ['ethereum', 'xdai'].includes(chain)
+       ['ethereum', 'xdai'].includes(normalizedChain)
      )
    })

Comment on lines 127 to 133
const totalTokens = idsData.length + 1

while (index < idsData.length) {
const idItem = idsData[index]
const quoteParams = `localization=false&tickers=false&market_data=true&community_data=false&developer_data=false&sparkline=false`
const url = `https://api.coingecko.com/api/v3/coins/${idItem.id}?${quoteParams}`
const url = `${coinGeckoCoinsUrl}/${idItem.id}?${coinGeckoCoinsQuoteParams}`

console.log(`[${index + 1}/${totalTokens}] Fetching data for ID: ${idItem.id}`)
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Progress counter is off by one.
totalTokens is idsData.length + 1, so logs show n/(n+1) on the last item. If there’s no extra item, use idsData.length.

🧮 Suggested fix
-  const totalTokens = idsData.length + 1
+  const totalTokens = idsData.length
🤖 Prompt for AI Agents
In `@src/scripts/cowFi-tokens.js` around lines 127 - 133, The progress counter is
off because totalTokens is set to idsData.length + 1; change totalTokens to
compute from idsData.length (e.g., totalTokens = idsData.length) so the console
log inside the while loop that prints `[${index + 1}/${totalTokens}]` shows
correct n/n on the final item; update the variable assignment near where
totalTokens, idsData, index and the while loop are defined (ensure no other
logic depends on the +1).

@alfetopito alfetopito merged commit d003f05 into main Feb 5, 2026
5 checks passed
@alfetopito alfetopito deleted the feat/bump-version-ink-tokens branch February 5, 2026 16:48
@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants