Skip to content

Commit

Permalink
feat: use new uni and coingecko token lists (#5225)
Browse files Browse the repository at this point in the history
* feat: use new uni and coingecko token lists

* fix: linter errors
  • Loading branch information
alfetopito authored Dec 18, 2024
1 parent a308904 commit 411df4d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useEffect, useState } from 'react'

import { Command } from '@cowprotocol/types'
import { TruncatedText } from '@cowprotocol/ui/pure/TruncatedText'

import { faExchangeAlt } from '@fortawesome/free-solid-svg-icons'
Expand All @@ -23,11 +24,10 @@ import { getLimitPrice } from 'utils/getLimitPrice'
import { OrderSurplusDisplayStyledByRow } from './OrderSurplusTooltipStyledByRow'
import { ToggleFilter } from './ToggleFilter'

import { TableState } from '../../../explorer/components/TokensTableWidget/useTable'
import { SimpleTable, SimpleTableProps } from '../../common/SimpleTable'
import { StatusLabel } from '../StatusLabel'
import { UnsignedOrderWarning } from '../UnsignedOrderWarning'
import { TableState } from '../../../explorer/components/TokensTableWidget/useTable'
import { Command } from '@cowprotocol/types'

const EXPIRED_CANCELED_STATES: OrderStatus[] = ['cancelled', 'cancelling', 'expired']

Expand All @@ -37,7 +37,7 @@ function isExpiredOrCanceled(order: Order): boolean {
if (!executedSellAmount.isZero() || !executedBuyAmount.isZero()) return false

// Otherwise, return if the order is expired or canceled
return EXPIRED_CANCELED_STATES.includes(order.status)
return EXPIRED_CANCELED_STATES.includes(status)
}

const tooltip = {
Expand Down
17 changes: 11 additions & 6 deletions libs/tokens/src/const/tokensList.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{
"priority": 2,
"enabledByDefault": true,
"source": "https://files.cow.fi/tokens/CoinGecko.json"
"source": "https://raw.githubusercontent.com/cowprotocol/token-lists/main/src/public/CoinGecko.1.json"
},
{
"priority": 3,
Expand Down Expand Up @@ -65,12 +65,12 @@
{
"priority": 3,
"enabledByDefault": true,
"source": "https://raw.githubusercontent.com/cowprotocol/token-lists/main/src/public/GnosisUniswapTokensList.json"
"source": "https://raw.githubusercontent.com/cowprotocol/token-lists/main/src/public/Uniswap.100.json"
},
{
"priority": 4,
"enabledByDefault": true,
"source": "https://raw.githubusercontent.com/cowprotocol/token-lists/main/src/public/GnosisCoingeckoTokensList.json"
"source": "https://raw.githubusercontent.com/cowprotocol/token-lists/main/src/public/CoinGecko.100.json"
},
{
"priority": 5,
Expand All @@ -86,12 +86,12 @@
{
"priority": 2,
"enabledByDefault": true,
"source": "https://raw.githubusercontent.com/cowprotocol/token-lists/main/src/public/ArbitrumOneUniswapTokensList.json"
"source": "https://raw.githubusercontent.com/cowprotocol/token-lists/main/src/public/Uniswap.42161.json"
},
{
"priority": 3,
"enabledByDefault": true,
"source": "https://raw.githubusercontent.com/cowprotocol/token-lists/main/src/public/ArbitrumOneCoingeckoTokensList.json"
"source": "https://raw.githubusercontent.com/cowprotocol/token-lists/main/src/public/CoinGecko.42161.json"
},
{
"priority": 4,
Expand Down Expand Up @@ -119,6 +119,11 @@
"priority": 2,
"source": "https://raw.githubusercontent.com/cowprotocol/token-lists/main/src/public/CoinGecko.8453.json",
"enabledByDefault": true
},
{
"priority": 3,
"enabledByDefault": true,
"source": "https://raw.githubusercontent.com/cowprotocol/token-lists/main/src/public/Uniswap.8453.json"
}
]
}
}
3 changes: 0 additions & 3 deletions libs/tokens/src/const/tokensLists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,3 @@ export const LP_TOKEN_LISTS = lpTokensList as Array<ListSourceConfig>
export const DEFAULT_TOKENS_LISTS: ListsSourcesByNetwork = mapSupportedNetworks((chainId) => tokensList[chainId])

export const UNISWAP_TOKENS_LIST = 'https://ipfs.io/ipns/tokens.uniswap.org'

export const GNOSIS_UNISWAP_TOKENS_LIST =
'https://raw.githubusercontent.com/cowprotocol/token-lists/main/src/public/GnosisUniswapTokensList.json'
16 changes: 7 additions & 9 deletions libs/tokens/src/state/tokenLists/tokenListsStateAtom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@ import { atomWithStorage } from 'jotai/utils'
import { getJotaiMergerStorage } from '@cowprotocol/core'
import { mapSupportedNetworks, SupportedChainId } from '@cowprotocol/cow-sdk'

import {
DEFAULT_TOKENS_LISTS,
GNOSIS_UNISWAP_TOKENS_LIST,
LP_TOKEN_LISTS,
UNISWAP_TOKENS_LIST,
} from '../../const/tokensLists'
import { DEFAULT_TOKENS_LISTS, LP_TOKEN_LISTS, UNISWAP_TOKENS_LIST } from '../../const/tokensLists'
import {
ListSourceConfig,
ListsSourcesByNetwork,
Expand All @@ -21,9 +16,12 @@ import { environmentAtom } from '../environmentAtom'

const UNISWAP_TOKEN_LIST_URL: Record<SupportedChainId, string> = {
[SupportedChainId.MAINNET]: UNISWAP_TOKENS_LIST,
[SupportedChainId.GNOSIS_CHAIN]: GNOSIS_UNISWAP_TOKENS_LIST,
[SupportedChainId.ARBITRUM_ONE]: UNISWAP_TOKENS_LIST,
[SupportedChainId.BASE]: UNISWAP_TOKENS_LIST,
[SupportedChainId.GNOSIS_CHAIN]:
'https://raw.githubusercontent.com/cowprotocol/token-lists/main/src/public/Uniswap.100.json',
[SupportedChainId.ARBITRUM_ONE]:
'https://raw.githubusercontent.com/cowprotocol/token-lists/main/src/public/Uniswap.42161.json',
[SupportedChainId.BASE]:
'https://raw.githubusercontent.com/cowprotocol/token-lists/main/src/public/Uniswap.8453.json',
[SupportedChainId.SEPOLIA]: UNISWAP_TOKENS_LIST,
}

Expand Down

0 comments on commit 411df4d

Please sign in to comment.