Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"recheckPermitInfo:sepolia": "yarn run fetchPermitInfo -- 11155111 '' '' true",
"recheckPermitInfo:avalanche": "yarn run fetchPermitInfo -- 43114 '' '' true",
"recheckPermitInfo:polygon": "yarn run fetchPermitInfo -- 137 '' '' true",
"run-script": "node --loader ts-node/esm --experimental-json-modules --experimental-specifier-resolution=node",
"run-script": "tsx",
"test": "node --test"
},
"license": "(MIT OR Apache-2.0)",
Expand All @@ -52,14 +52,14 @@
"lodash": "^4.17.21",
"p-retry": "^6.1.0",
"p-throttle": "^5.1.0",
"ts-node": "^10.9.1",
"winston": "^3.17.0"
},
"devDependencies": {
"@types/node": "^20.8.7",
"copyfiles": "^2.4.1",
"eslint": "^8.52.0",
"prettier": "^3.0.3",
"tsx": "^4.20.3",
"typescript": "^5.2.2"
}
}
}
10 changes: 1 addition & 9 deletions src/public/CoinGecko.137.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"defi"
],
"version": {
"major": 28,
"major": 29,
"minor": 0,
"patch": 0
},
Expand Down Expand Up @@ -98,14 +98,6 @@
"decimals": 18,
"logoURI": "https://assets.coingecko.com/coins/images/38680/large/sophon_logo_200.png?1747898236"
},
{
"chainId": 137,
"address": "0x0000000000000000000000000000000000001010",
"name": "POL ex MATIC ",
"symbol": "POL",
"decimals": 18,
"logoURI": "https://assets.coingecko.com/coins/images/32440/large/polygon.png?1698233684"
},
{
"chainId": 137,
"address": "0x8505b9d2254a7ae468c0e9dd10ccea3a837aef5c",
Expand Down
19 changes: 2 additions & 17 deletions src/public/Uniswap.137.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"defi"
],
"version": {
"major": 0,
"minor": 2,
"major": 1,
"minor": 0,
"patch": 0
},
"tokens": [
Expand Down Expand Up @@ -1510,21 +1510,6 @@
}
}
},
{
"chainId": 137,
"address": "0x0000000000000000000000000000000000001010",
"name": "Polygon",
"symbol": "MATIC",
"decimals": 18,
"logoURI": "https://assets.coingecko.com/coins/images/4713/large/matic-token-icon.png?1624446912",
"extensions": {
"bridgeInfo": {
"1": {
"tokenAddress": "0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0"
}
}
}
},
{
"chainId": 137,
"address": "0xAa7DbD1598251f856C12f63557A4C4397c253Cea",
Expand Down
1 change: 1 addition & 0 deletions src/scripts/auxLists/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ OVERRIDES[SupportedChainId.GNOSIS_CHAIN]['0xe91d153e0b41518a2ce8dd3d7944fa863463
symbol: 'wxDAI',
name: 'Wrapped xDAI',
} // incorrect symbol and name set on CoinGecko's list
OVERRIDES[SupportedChainId.POLYGON]['0x0000000000000000000000000000000000001010'] = null // POL native token address

async function main(): Promise<void> {
const COINGECKO_IDS_MAP = await getCoingeckoTokenIdsMap()
Expand Down
24 changes: 15 additions & 9 deletions src/scripts/auxLists/processTokenList.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Logger } from 'winston'
import { SupportedChainId } from '@cowprotocol/cow-sdk'
import { TokenList } from '@uniswap/token-lists'
import * as fs from 'fs'
import path from 'path'
import { Logger } from 'winston'
import { DISPLAY_CHAIN_NAMES, Overrides, TokenInfo } from './utils'

const FORMATTER = new Intl.NumberFormat('en-us', { style: 'currency', currency: 'USD' })
Expand Down Expand Up @@ -153,14 +153,20 @@ export async function processTokenList({
logger.info(`\t-${(index + 1).toString().padStart(3, '0')}) ${token.name} (${token.symbol})${volumeStr}`)
})

const updatedTokens = tokens.map(({ volume: _, ...token }) => {
const override = overrides[token.address.toLowerCase()]
return {
...token,
...override,
logoURI: token.logoURI ? token.logoURI.replace(/thumb/, 'large') : undefined,
}
})
const updatedTokens = tokens
.map(({ volume: _, ...token }) => {
const override = overrides[token.address.toLowerCase()]
if (override === null) {
// remove token from list
return null
}
return {
...token,
...override,
logoURI: token.logoURI ? token.logoURI.replace(/thumb/, 'large') : undefined,
}
})
.filter((token) => token !== null)

const listName = getListName(chainId, prefix)
saveUpdatedTokens({ chainId, prefix, logo, tokens: updatedTokens, listName, replaceExisting })
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/auxLists/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { mapSupportedNetworks, SupportedChainId } from '@cowprotocol/cow-sdk'
import assert from 'assert'
import fs from 'fs'
import winston, { Logger } from 'winston'
import { mapSupportedNetworks, SupportedChainId } from '@cowprotocol/cow-sdk'

export interface TokenInfo {
chainId: SupportedChainId
Expand All @@ -13,7 +13,7 @@ export interface TokenInfo {
volume?: number
}

export type Overrides = Record<string, Partial<TokenInfo>>
export type Overrides = Record<string, Partial<TokenInfo> | null>
export type OverridesPerChain = Record<SupportedChainId, Overrides>

interface CoingeckoToken {
Expand Down
Loading