Commit 0afeb5ac authored by Jordan Frankfurt's avatar Jordan Frankfurt Committed by GitHub

add arbitrum token list (#2268)

parent 9e8d08e2
...@@ -7,6 +7,7 @@ const CMC_STABLECOIN = 'stablecoin.cmc.eth' ...@@ -7,6 +7,7 @@ const CMC_STABLECOIN = 'stablecoin.cmc.eth'
const COINGECKO_LIST = 'https://tokens.coingecko.com/uniswap/all.json' const COINGECKO_LIST = 'https://tokens.coingecko.com/uniswap/all.json'
const COMPOUND_LIST = 'https://raw.githubusercontent.com/compound-finance/token-list/master/compound.tokenlist.json' const COMPOUND_LIST = 'https://raw.githubusercontent.com/compound-finance/token-list/master/compound.tokenlist.json'
const GEMINI_LIST = 'https://www.gemini.com/uniswap/manifest.json' const GEMINI_LIST = 'https://www.gemini.com/uniswap/manifest.json'
export const ARBITRUM_LIST = 'https://bridge.arbitrum.io/token-list-42161.json'
const KLEROS_LIST = 't2crtokens.eth' const KLEROS_LIST = 't2crtokens.eth'
export const OPTIMISM_LIST = 'https://static.optimism.io/optimism.tokenlist.json' export const OPTIMISM_LIST = 'https://static.optimism.io/optimism.tokenlist.json'
const ROLL_LIST = 'https://app.tryroll.com/tokens.json' const ROLL_LIST = 'https://app.tryroll.com/tokens.json'
...@@ -27,6 +28,7 @@ export const DEFAULT_LIST_OF_LISTS: string[] = [ ...@@ -27,6 +28,7 @@ export const DEFAULT_LIST_OF_LISTS: string[] = [
ROLL_LIST, ROLL_LIST,
COINGECKO_LIST, COINGECKO_LIST,
KLEROS_LIST, KLEROS_LIST,
ARBITRUM_LIST,
OPTIMISM_LIST, OPTIMISM_LIST,
GEMINI_LIST, GEMINI_LIST,
...UNSUPPORTED_LIST_URLS, // need to load unsupported tokens as well ...UNSUPPORTED_LIST_URLS, // need to load unsupported tokens as well
......
import { getVersionUpgrade, minVersionBump, VersionUpgrade } from '@uniswap/token-lists' import { getVersionUpgrade, minVersionBump, VersionUpgrade } from '@uniswap/token-lists'
import { SupportedChainId } from 'constants/chains' import { SupportedChainId } from 'constants/chains'
import { OPTIMISM_LIST, UNSUPPORTED_LIST_URLS } from 'constants/lists' import { ARBITRUM_LIST, OPTIMISM_LIST, UNSUPPORTED_LIST_URLS } from 'constants/lists'
import { useCallback, useEffect } from 'react' import { useCallback, useEffect } from 'react'
import { useAppDispatch } from 'state/hooks' import { useAppDispatch } from 'state/hooks'
import { useAllLists } from 'state/lists/hooks' import { useAllLists } from 'state/lists/hooks'
...@@ -32,6 +32,9 @@ export default function Updater(): null { ...@@ -32,6 +32,9 @@ export default function Updater(): null {
if (chainId && [SupportedChainId.OPTIMISM, SupportedChainId.OPTIMISTIC_KOVAN].includes(chainId)) { if (chainId && [SupportedChainId.OPTIMISM, SupportedChainId.OPTIMISTIC_KOVAN].includes(chainId)) {
dispatch(enableList(OPTIMISM_LIST)) dispatch(enableList(OPTIMISM_LIST))
} }
if (chainId && [SupportedChainId.ARBITRUM_ONE, SupportedChainId.ARBITRUM_RINKEBY].includes(chainId)) {
dispatch(enableList(ARBITRUM_LIST))
}
}, [chainId, dispatch]) }, [chainId, dispatch])
// fetch all lists every 10 minutes, but only after we initialize library // fetch all lists every 10 minutes, but only after we initialize library
useInterval(fetchAllListsCallback, library ? 1000 * 60 * 10 : null) useInterval(fetchAllListsCallback, library ? 1000 * 60 * 10 : null)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment