Skip to content

Commit d003f05

Browse files
authored
chore: bump CowSwap.json version with new Ink tokens and updated WETH logos (#1353)
* chore: bump CowSwap.json version with new Ink tokens and updated WETH logos * fix: updae cowFi-tokens to account for missing addresses
1 parent 646c053 commit d003f05

File tree

2 files changed

+23
-12
lines changed

2 files changed

+23
-12
lines changed

src/public/CowSwap.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "CoW Swap",
3-
"timestamp": "2026-01-29T16:30:00+00:00",
3+
"timestamp": "2026-02-05T10:45:00+00:00",
44
"version": {
55
"major": 6,
6-
"minor": 9,
6+
"minor": 10,
77
"patch": 0
88
},
99
"logoURI": "https://files.cow.fi/token-lists/images/list-logo.png",
@@ -2133,4 +2133,4 @@
21332133
"logoURI": "https://files.cow.fi/token-lists/images/59144/0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f/logo.png"
21342134
}
21352135
]
2136-
}
2136+
}

src/scripts/cowFi-tokens.js

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ const USE_CACHE = (process.env.USE_CACHE ?? 'true') === 'true'
88

99
const cowListUrl = 'https://files.cow.fi/tokens/CowSwap.json'
1010
// const coinGeckoListUrl = "https://files.cow.fi/tokens/CoinGecko.json";
11-
const coinGeckoIdListUrl = 'https://api.coingecko.com/api/v3/coins/list'
11+
const coinGeckoCoinsUrl = 'https://api.coingecko.com/api/v3/coins'
12+
const coinGeckoCoinsQuoteParams = `localization=false&tickers=false&market_data=true&community_data=false&developer_data=false&sparkline=false`
13+
const coinGeckoIdListUrl = `${coinGeckoCoinsUrl}/list`
1214

1315
const LIST_DIR = path.join('src', 'cowFi')
1416

@@ -123,10 +125,10 @@ async function getStaticData(idsData) {
123125

124126
let index = 0
125127
const totalTokens = idsData.length + 1
128+
126129
while (index < idsData.length) {
127130
const idItem = idsData[index]
128-
const quoteParams = `localization=false&tickers=false&market_data=true&community_data=false&developer_data=false&sparkline=false`
129-
const url = `https://api.coingecko.com/api/v3/coins/${idItem.id}?${quoteParams}`
131+
const url = `${coinGeckoCoinsUrl}/${idItem.id}?${coinGeckoCoinsQuoteParams}`
130132

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

@@ -182,13 +184,22 @@ async function getStaticDataFinal(data) {
182184

183185
// Filter current static list with only tokens from our 2 exists list
184186
const filtered = parsed.filter(({ platforms, description, id }) => {
185-
return (
186-
description?.en?.trim().length &&
187-
!TOKENS_TO_REMOVE.includes(id) &&
188-
Object.entries(platforms).some(
189-
([chain, address]) => combined_ids[address.toLowerCase()] && ['ethereum', 'xdai'].includes(chain),
187+
if (!description?.en?.trim().length || TOKENS_TO_REMOVE.includes(id) || !platforms) {
188+
return false
189+
}
190+
191+
return Object.entries(platforms).some(([chain, address]) => {
192+
if (typeof address !== 'string' || !address) {
193+
console.warn(
194+
`Platform entry for chain="${chain}" has no address. Skipping... Debug URL: ${coinGeckoCoinsUrl}/${id}?${coinGeckoCoinsQuoteParams}`,
195+
)
196+
return false
197+
}
198+
199+
return (
200+
combined_ids[address.toLowerCase()] && ['ethereum', 'xdai'].includes(chain)
190201
)
191-
)
202+
})
192203
})
193204

194205
// Sort the data by market cap and take limit the list

0 commit comments

Comments
 (0)