From ffbe56f9a2949f90620e6d8983e33ac3d7894e3e Mon Sep 17 00:00:00 2001 From: Alexandr Kazachenko Date: Mon, 9 Oct 2023 14:38:27 +0600 Subject: [PATCH] fix: fix goerli list url --- .../src/modules/tokensList/mocks.ts | 2 +- libs/common-const/src/index.ts | 1 - libs/common-const/src/lists.ts | 79 ------------------- libs/tokens/src/const/tokensList.json | 2 +- src/tokens/README.md | 2 - src/tokens/goerli-token-list.json | 69 ---------------- 6 files changed, 2 insertions(+), 153 deletions(-) delete mode 100644 libs/common-const/src/lists.ts delete mode 100644 src/tokens/README.md delete mode 100644 src/tokens/goerli-token-list.json diff --git a/apps/cowswap-frontend/src/modules/tokensList/mocks.ts b/apps/cowswap-frontend/src/modules/tokensList/mocks.ts index e8e3e42d11..31464da0f8 100644 --- a/apps/cowswap-frontend/src/modules/tokensList/mocks.ts +++ b/apps/cowswap-frontend/src/modules/tokensList/mocks.ts @@ -102,7 +102,7 @@ export const listsMock: TokenListInfo[] = [ id: '1', name: 'CowSwap Goerli', source: { - url: 'https://tokenlists.org/token-list?url=https://raw.githubusercontent.com/cowprotocol/cowswap/develop/apps/cowswap-frontend/src/tokens/goerli-token-list.json', + url: 'https://tokenlists.org/token-list?url=https://raw.githubusercontent.com/cowprotocol/token-lists/main/src/public/CowSwapGoerli.json', }, logoUrl: 'https://gnosis.mypinata.cloud/ipfs/Qme9B6jRpGtZsRFcPjHvA5T4ugFuL4c3SzWfxyMPa59AMo', tokensCount: 7, diff --git a/libs/common-const/src/index.ts b/libs/common-const/src/index.ts index 1a76933a56..d53aff0ca8 100644 --- a/libs/common-const/src/index.ts +++ b/libs/common-const/src/index.ts @@ -1,7 +1,6 @@ export * from './types' export * from './common' export * from './locales' -export * from './lists' export * from './tokens' export * from './intl' export * from './addresses' diff --git a/libs/common-const/src/lists.ts b/libs/common-const/src/lists.ts deleted file mode 100644 index 353754237f..0000000000 --- a/libs/common-const/src/lists.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { SupportedChainId as ChainId } from '@cowprotocol/cow-sdk' - -import { RAW_CODE_LINK } from './common' - -export type NetworkLists = { - [chain in ChainId]: string[] -} - -const COW_DAO_LIST = 'https://files.cow.fi/tokens/CowSwap.json' -const COW_COINGECKO_LIST = 'https://files.cow.fi/tokens/CoinGecko.json' - -const COMPOUND_LIST = 'https://raw.githubusercontent.com/compound-finance/token-list/master/compound.tokenlist.json' -const AAVE_LIST = 'tokenlist.aave.eth' -const SYNTHETIX_LIST = 'synths.snx.eth' -const WRAPPED_LIST = 'wrapped.tokensoft.eth' -const SET_LIST = 'https://raw.githubusercontent.com/SetProtocol/uniswap-tokenlist/main/set.tokenlist.json' -const OPYN_LIST = 'https://raw.githubusercontent.com/opynfinance/opyn-tokenlist/master/opyn-squeeth-tokenlist.json' -const ROLL_LIST = 'https://app.tryroll.com/tokens.json' -// const COINGECKO_LIST = 'https://tokens.coingecko.com/uniswap/all.json' -const CMC_ALL_LIST = 'defi.cmc.eth' -const CMC_STABLECOIN = 'stablecoin.cmc.eth' -const KLEROS_LIST = 't2crtokens.eth' -const BA_LIST = 'https://raw.githubusercontent.com/The-Blockchain-Association/sec-notice-list/master/ba-sec-list.json' - -// Goerli Default -const GOERLI_LIST = RAW_CODE_LINK + '/develop/apps/cowswap-frontend/src/tokens/goerli-token-list.json' - -// XDAI Default -const HONEY_SWAP_XDAI = 'https://tokens.honeyswap.org' - -export const UNSUPPORTED_LIST_URLS: NetworkLists = { - [ChainId.MAINNET]: [BA_LIST], - [ChainId.GOERLI]: [BA_LIST], - [ChainId.GNOSIS_CHAIN]: [BA_LIST], -} - -function buildNetworkDefaultLists({ networkLists, chainId }: { chainId: ChainId; networkLists: string[] }) { - // need to add unsupported lists as well - return [...UNSUPPORTED_LIST_URLS[chainId], ...networkLists] -} - -// lower index == higher priority for token import -export const DEFAULT_LIST_OF_LISTS_BY_NETWORK: NetworkLists = { - [ChainId.MAINNET]: buildNetworkDefaultLists({ - chainId: ChainId.MAINNET, - networkLists: [ - COW_DAO_LIST, - COW_COINGECKO_LIST, - COMPOUND_LIST, - AAVE_LIST, - SYNTHETIX_LIST, - WRAPPED_LIST, - SET_LIST, - OPYN_LIST, - ROLL_LIST, - CMC_ALL_LIST, - CMC_STABLECOIN, - KLEROS_LIST, - ], - }), - [ChainId.GOERLI]: buildNetworkDefaultLists({ - chainId: ChainId.GOERLI, - networkLists: [GOERLI_LIST, COMPOUND_LIST], - }), - [ChainId.GNOSIS_CHAIN]: buildNetworkDefaultLists({ - chainId: ChainId.GNOSIS_CHAIN, - networkLists: [COW_DAO_LIST, HONEY_SWAP_XDAI], - }), -} - -// default lists to be 'active' aka searched across -export const DEFAULT_ACTIVE_LIST_URLS_BY_NETWORK: NetworkLists = { - [ChainId.MAINNET]: [COW_DAO_LIST, COW_COINGECKO_LIST], - [ChainId.GNOSIS_CHAIN]: [COW_DAO_LIST, HONEY_SWAP_XDAI], - [ChainId.GOERLI]: [COW_DAO_LIST, GOERLI_LIST], -} - -// Set what we want as the default list when no chain id available: default = MAINNET -export const DEFAULT_NETWORK_FOR_LISTS = ChainId.MAINNET diff --git a/libs/tokens/src/const/tokensList.json b/libs/tokens/src/const/tokensList.json index 7b776b1eb4..616275f99e 100644 --- a/libs/tokens/src/const/tokensList.json +++ b/libs/tokens/src/const/tokensList.json @@ -68,7 +68,7 @@ "id": "VZ--hetNymtoeZ5QUVhRT", "priority": 1, "enabledByDefault": true, - "url": "https://raw.githubusercontent.com/cowprotocol/cowswap/develop/apps/cowswap-frontend/src/tokens/goerli-token-list.json" + "url": "https://raw.githubusercontent.com/cowprotocol/token-lists/main/src/public/CowSwapGoerli.json" }, { "id": "uJcgDR4A3MLQTrDsO34bA", diff --git a/src/tokens/README.md b/src/tokens/README.md deleted file mode 100644 index 203cd64185..0000000000 --- a/src/tokens/README.md +++ /dev/null @@ -1,2 +0,0 @@ -This is temporary Goerli tokens file for backward compatibility. -It should be removed after the first release with the GOERLI_LIST update. diff --git a/src/tokens/goerli-token-list.json b/src/tokens/goerli-token-list.json deleted file mode 100644 index c304206a8a..0000000000 --- a/src/tokens/goerli-token-list.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "CoW Swap Goerli", - "version": { - "major": 0, - "minor": 0, - "patch": 0 - }, - "keywords": ["CowSwap", "Goerli", "tokens", "trusted"], - "logoURI": "https://gnosis.mypinata.cloud/ipfs/Qme9B6jRpGtZsRFcPjHvA5T4ugFuL4c3SzWfxyMPa59AMo", - "timestamp": "2022-05-26T10:45:01.151Z", - "tokens": [ - { - "name": "Gnosis", - "chainId": 5, - "symbol": "GNO", - "decimals": 18, - "address": "0x02abbdbaaa7b1bb64b5c878f7ac17f8dda169532", - "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6810e776880C02933D47DB1b9fc05908e5386b96/logo.png" - }, - { - "name": "CoW Protocol Token", - "chainId": 5, - "symbol": "COW", - "decimals": 18, - "address": "0x91056D4A53E1faa1A84306D4deAEc71085394bC8", - "logoURI": "https://gnosis.mypinata.cloud/ipfs/Qme9B6jRpGtZsRFcPjHvA5T4ugFuL4c3SzWfxyMPa59AMo" - }, - { - "name": "USD Coin", - "chainId": 5, - "symbol": "USDC", - "decimals": 6, - "address": "0xD87Ba7A50B2E7E660f678A895E4B72E7CB4CCd9C", - "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png" - }, - { - "name": "DAI", - "chainId": 5, - "symbol": "DAI", - "decimals": 18, - "address": "0xdc31Ee1784292379Fbb2964b3B9C4124D8F89C60", - "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x6B175474E89094C44Da98b954EedeAC495271d0F/logo.png" - }, - { - "name": "0x", - "chainId": 5, - "symbol": "ZRX", - "decimals": 18, - "address": "0xe4E81Fa6B16327D4B78CFEB83AAdE04bA7075165", - "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xE41d2489571d322189246DaFA5ebDe1F4699F498/logo.png" - }, - { - "name": "Basic Attention Token", - "chainId": 5, - "symbol": "BAT", - "decimals": 18, - "address": "0x70cBa46d2e933030E2f274AE58c951C800548AeF", - "logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x0D8775F648430679A709E98d2b0Cb6250d2887EF/logo.png" - }, - { - "name": "Polymath Network", - "chainId": 5, - "symbol": "POLY", - "decimals": 18, - "address": "0x9e32c0EfF886B6Ccae99350Fd5e7002dCED55F15", - "logoURI": "https://assets.coingecko.com/coins/images/2784/thumb/inKkF01.png?1605007034" - } - ] -}