diff --git a/src/assets/svg/xdai_logo.svg b/src/assets/svg/xdai_logo.svg new file mode 100644 index 00000000000..4a958dca209 --- /dev/null +++ b/src/assets/svg/xdai_logo.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/src/components/AccountDrawer/MiniPortfolio/Pools/useMultiChainPositions.tsx b/src/components/AccountDrawer/MiniPortfolio/Pools/useMultiChainPositions.tsx index e433848fc59..97201f491d0 100644 --- a/src/components/AccountDrawer/MiniPortfolio/Pools/useMultiChainPositions.tsx +++ b/src/components/AccountDrawer/MiniPortfolio/Pools/useMultiChainPositions.tsx @@ -48,6 +48,7 @@ const DEFAULT_CHAINS = [ ChainId.BNB, ChainId.AVALANCHE, ChainId.BASE, + ChainId.GNOSIS, ] type UseMultiChainPositionsData = { positions?: PositionInfo[]; loading: boolean } diff --git a/src/components/FeeSelector/shared.tsx b/src/components/FeeSelector/shared.tsx index b2ca763bc30..77b28568170 100644 --- a/src/components/FeeSelector/shared.tsx +++ b/src/components/FeeSelector/shared.tsx @@ -21,6 +21,7 @@ export const FEE_AMOUNT_DETAIL: Record< ChainId.POLYGON_MUMBAI, ChainId.AVALANCHE, ChainId.BASE, + ChainId.GNOSIS, ], }, [FeeAmount.LOW]: { diff --git a/src/components/Logo/ChainLogo.tsx b/src/components/Logo/ChainLogo.tsx index b15b135e259..274a6e2219b 100644 --- a/src/components/Logo/ChainLogo.tsx +++ b/src/components/Logo/ChainLogo.tsx @@ -12,6 +12,7 @@ import { ReactComponent as bnb } from './ChainSymbols/bnb.svg' import { ReactComponent as celo } from './ChainSymbols/celo.svg' import { ReactComponent as celoLight } from './ChainSymbols/celo_light.svg' import { ReactComponent as ethereum } from './ChainSymbols/ethereum.svg' +import { ReactComponent as gnosis } from './ChainSymbols/gnosis.svg' import { ReactComponent as optimism } from './ChainSymbols/optimism.svg' import { ReactComponent as polygon } from './ChainSymbols/polygon.svg' @@ -81,6 +82,12 @@ export function getChainUI(chainId: ChainId, darkMode: boolean): ChainUI | undef bgColor: '#0052FF33', textColor: '#0052FF', } + case ChainId.GNOSIS: + return { + Symbol: gnosis, + bgColor: '#04795B33', + textColor: '#04795B', + } default: return undefined } diff --git a/src/components/Logo/ChainSymbols/gnosis.svg b/src/components/Logo/ChainSymbols/gnosis.svg new file mode 100644 index 00000000000..dd0f53eff98 --- /dev/null +++ b/src/components/Logo/ChainSymbols/gnosis.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/components/Tokens/constants.ts b/src/components/Tokens/constants.ts index e549d5097be..e97649c062b 100644 --- a/src/components/Tokens/constants.ts +++ b/src/components/Tokens/constants.ts @@ -8,4 +8,4 @@ export const SMALL_MEDIA_BREAKPOINT = '540px' export const MOBILE_MEDIA_BREAKPOINT = '420px' // includes chains that the backend does not current source off-chain metadata for -export const UNSUPPORTED_METADATA_CHAINS = [ChainId.BNB, ChainId.AVALANCHE] +export const UNSUPPORTED_METADATA_CHAINS = [ChainId.BNB, ChainId.AVALANCHE, ChainId.GNOSIS] diff --git a/src/constants/chainInfo.ts b/src/constants/chainInfo.ts index 6166348dfcd..3361eff37f6 100644 --- a/src/constants/chainInfo.ts +++ b/src/constants/chainInfo.ts @@ -17,6 +17,7 @@ export const START_BLOCKS: { [key: number]: number } = { [ChainId.BNB]: 26324014, [ChainId.AVALANCHE]: 31422450, [ChainId.BASE]: 1371680, + [ChainId.GNOSIS]: 27416614, } export enum NetworkType { @@ -224,6 +225,18 @@ const CHAIN_INFO: ChainInfoMap = { nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 }, color: darkTheme.chain_84531, }, + [ChainId.GNOSIS]: { + networkType: NetworkType.L1, + blockWaitMsBeforeWarning: ms(`10m`), + bridge: 'https://omnibridge.gnosischain.com/bridge', + docs: 'https://docs.gnosischain.com/', + explorer: 'https://gnosisscan.io/', + infoLink: 'https://info.uniswap.org/#/gnosis/', + label: 'Gnosis', + nativeCurrency: { name: 'Gnosis', symbol: 'xDAI', decimals: 18 }, + color: darkTheme.chain_100, + backgroundColor: darkTheme.chain_100_background, + }, } as const export function getChainInfo( diff --git a/src/constants/chains.ts b/src/constants/chains.ts index b914531d2a1..27694577b8d 100644 --- a/src/constants/chains.ts +++ b/src/constants/chains.ts @@ -15,6 +15,7 @@ export const CHAIN_IDS_TO_NAMES = { [ChainId.BNB]: 'bnb', [ChainId.AVALANCHE]: 'avalanche', [ChainId.BASE]: 'base', + [ChainId.GNOSIS]: 'gnosis', } as const // Include ChainIds in this array if they are not supported by the UX yet, but are already in the SDK. @@ -53,6 +54,7 @@ export const SUPPORTED_GAS_ESTIMATE_CHAIN_IDS = [ ChainId.BNB, ChainId.AVALANCHE, ChainId.BASE, + ChainId.GNOSIS, ] as const /** @@ -82,6 +84,7 @@ export const L1_CHAIN_IDS = [ ChainId.CELO_ALFAJORES, ChainId.BNB, ChainId.AVALANCHE, + ChainId.GNOSIS, ] as const export type SupportedL1ChainId = (typeof L1_CHAIN_IDS)[number] @@ -129,8 +132,10 @@ export function getChainPriority(chainId: ChainId): number { case ChainId.CELO: case ChainId.CELO_ALFAJORES: return 7 - default: + case ChainId.GNOSIS: return 8 + default: + return 9 } } diff --git a/src/constants/lists.ts b/src/constants/lists.ts index 385dbcdb143..fd6216d27fe 100644 --- a/src/constants/lists.ts +++ b/src/constants/lists.ts @@ -12,6 +12,7 @@ const COINGECKO_OPTIMISM_LIST = 'https://tokens.coingecko.com/optimistic-ethereu const COINGECKO_CELO_LIST = 'https://tokens.coingecko.com/celo/all.json' const COINGECKO_POLYGON_LIST = 'https://tokens.coingecko.com/polygon-pos/all.json' const COINGECKO_AVAX_LIST = 'https://tokens.coingecko.com/avalanche/all.json' +const COINGECKO_GNOSIS_LIST = 'https://tokens.coingecko.com/xdai/all.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 KLEROS_LIST = 't2crtokens.eth' @@ -43,6 +44,7 @@ export const DEFAULT_INACTIVE_LIST_URLS: string[] = [ COINGECKO_CELO_LIST, COINGECKO_POLYGON_LIST, COINGECKO_AVAX_LIST, + COINGECKO_GNOSIS_LIST, KLEROS_LIST, GEMINI_LIST, WRAPPED_LIST, diff --git a/src/constants/networks.ts b/src/constants/networks.ts index d7cbb103fbc..763cd6159d6 100644 --- a/src/constants/networks.ts +++ b/src/constants/networks.ts @@ -119,6 +119,12 @@ export const FALLBACK_URLS = { 'https://1rpc.io/base', 'https://base.meowrpc.com', ], + [ChainId.GNOSIS]: [ + // "Safe" URLs + 'https://rpc.gnosischain.com', + 'https://rpc.gnosis.gateway.fm', + 'https://rpc.ankr.com/gnosis', + ], } /** @@ -156,4 +162,5 @@ export const RPC_URLS = { [ChainId.BNB]: [QUICKNODE_BNB_RPC_URL, ...FALLBACK_URLS[ChainId.BNB]], [ChainId.AVALANCHE]: [`https://avalanche-mainnet.infura.io/v3/${INFURA_KEY}`, ...FALLBACK_URLS[ChainId.AVALANCHE]], [ChainId.BASE]: [`https://base-mainnet.infura.io/v3/${INFURA_KEY}`, ...FALLBACK_URLS[ChainId.BASE]], + [ChainId.GNOSIS]: FALLBACK_URLS[ChainId.GNOSIS], } diff --git a/src/constants/providers.ts b/src/constants/providers.ts index 5d902e374fa..90398258ac1 100644 --- a/src/constants/providers.ts +++ b/src/constants/providers.ts @@ -30,6 +30,7 @@ export const RPC_PROVIDERS: { [key in SupportedInterfaceChain]: StaticJsonRpcPro [ChainId.BNB]: providerFactory(ChainId.BNB), [ChainId.AVALANCHE]: providerFactory(ChainId.AVALANCHE), [ChainId.BASE]: providerFactory(ChainId.BASE), + [ChainId.GNOSIS]: providerFactory(ChainId.GNOSIS), } export const DEPRECATED_RPC_PROVIDERS: { [key in SupportedInterfaceChain]: AppStaticJsonRpcProvider } = { @@ -47,4 +48,5 @@ export const DEPRECATED_RPC_PROVIDERS: { [key in SupportedInterfaceChain]: AppSt [ChainId.BNB]: providerFactory(ChainId.BNB), [ChainId.AVALANCHE]: providerFactory(ChainId.AVALANCHE), [ChainId.BASE]: providerFactory(ChainId.BASE), + [ChainId.GNOSIS]: providerFactory(ChainId.GNOSIS), } diff --git a/src/constants/routing.ts b/src/constants/routing.ts index 283e8a238eb..d87908151b9 100644 --- a/src/constants/routing.ts +++ b/src/constants/routing.ts @@ -25,6 +25,7 @@ import { USDC_AVALANCHE, USDC_BASE, USDC_BSC, + USDC_GNOSIS, USDC_MAINNET, USDC_OPTIMISM, USDC_POLYGON, @@ -32,14 +33,17 @@ import { USDT_ARBITRUM_ONE, USDT_AVALANCHE, USDT_BSC, + USDT_GNOSIS, USDT_OPTIMISM, USDT_POLYGON, WBTC, WBTC_ARBITRUM_ONE, WBTC_CELO, + WBTC_GNOSIS, WBTC_OPTIMISM, WBTC_POLYGON, WETH_AVALANCHE, + WETH_GNOSIS, WETH_POLYGON, WETH_POLYGON_MUMBAI, WRAPPED_NATIVE_CURRENCY, @@ -115,6 +119,7 @@ export const COMMON_BASES: ChainCurrencyList = { USDT_AVALANCHE, WETH_AVALANCHE, ], + [ChainId.GNOSIS]: [nativeOnChain(ChainId.GNOSIS), USDC_GNOSIS, USDT_GNOSIS, WETH_GNOSIS, WBTC_GNOSIS], } // used to construct the list of all pairs we consider by default in the frontend @@ -137,6 +142,13 @@ export const BASES_TO_TRACK_LIQUIDITY_FOR: ChainTokenList = { USDT_AVALANCHE, WETH_AVALANCHE, ], + [ChainId.GNOSIS]: [ + ...WRAPPED_NATIVE_CURRENCIES_ONLY[ChainId.GNOSIS], + USDC_GNOSIS, + USDT_GNOSIS, + WETH_GNOSIS, + WBTC_GNOSIS, + ], } export const PINNED_PAIRS: { readonly [chainId: number]: [Token, Token][] } = { [ChainId.MAINNET]: [ diff --git a/src/constants/tokens.ts b/src/constants/tokens.ts index 05767faf3cd..a0ad6b12c91 100644 --- a/src/constants/tokens.ts +++ b/src/constants/tokens.ts @@ -250,6 +250,29 @@ export const DAI_AVALANCHE = new Token( 'Dai.e Token' ) +export const USDC_GNOSIS = new Token(ChainId.GNOSIS, '0xddafbb505ad214d7b80b1f830fccc89b60fb7a83', 6, 'USDC', 'USD//C') +export const USDT_GNOSIS = new Token( + ChainId.GNOSIS, + '0x4ecaba5870353805a9f068101a40e0f32ed605c6', + 6, + 'USDT', + 'Tether USD' +) +export const WETH_GNOSIS = new Token( + ChainId.GNOSIS, + '0x6a023ccd1ff6f2045c3309768ead9e68f978f6e1', + 18, + 'WETH', + 'Wrapped Ether' +) +export const WBTC_GNOSIS = new Token( + ChainId.GNOSIS, + '0x8e5bbbb09ed1ebde8674cda39a0c169401db4252', + 8, + 'WBT', + 'Wrapped BTC' +) + export const UNI: { [chainId: number]: Token } = { [ChainId.MAINNET]: new Token(ChainId.MAINNET, UNI_ADDRESSES[ChainId.MAINNET], 18, 'UNI', 'Uniswap'), [ChainId.GOERLI]: new Token(ChainId.GOERLI, UNI_ADDRESSES[ChainId.GOERLI], 18, 'UNI', 'Uniswap'), @@ -336,6 +359,13 @@ export const WRAPPED_NATIVE_CURRENCY: { [chainId: number]: Token | undefined } = 'WAVAX', 'Wrapped AVAX' ), + [ChainId.GNOSIS]: new Token( + ChainId.GNOSIS, + '0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d', + 18, + 'WXDAI', + 'Wrapped XDAI' + ), } export function isCelo(chainId: number): chainId is ChainId.CELO | ChainId.CELO_ALFAJORES { @@ -419,6 +449,28 @@ class AvaxNativeCurrency extends NativeCurrency { } } +export function isGnosis(chainId: number): chainId is ChainId.GNOSIS { + return chainId === ChainId.GNOSIS +} + +class GnosisNativeCurrency extends NativeCurrency { + equals(other: Currency): boolean { + return other.isNative && other.chainId === this.chainId + } + + get wrapped(): Token { + if (!isGnosis(this.chainId)) throw new Error('Not gnosis') + const wrapped = WRAPPED_NATIVE_CURRENCY[this.chainId] + invariant(wrapped instanceof Token) + return wrapped + } + + public constructor(chainId: number) { + if (!isGnosis(chainId)) throw new Error('Not gnosis') + super(chainId, 18, 'xDAI', 'xDAI') + } +} + class ExtendedEther extends Ether { public get wrapped(): Token { const wrapped = WRAPPED_NATIVE_CURRENCY[this.chainId] @@ -445,6 +497,8 @@ export function nativeOnChain(chainId: number): NativeCurrency | Token { nativeCurrency = new BscNativeCurrency(chainId) } else if (isAvalanche(chainId)) { nativeCurrency = new AvaxNativeCurrency(chainId) + } else if (isGnosis(chainId)) { + nativeCurrency = new GnosisNativeCurrency(chainId) } else { nativeCurrency = ExtendedEther.onChain(chainId) } @@ -473,5 +527,6 @@ export const TOKEN_SHORTHANDS: { [shorthand: string]: { [chainId in ChainId]?: s [ChainId.GOERLI]: USDC_GOERLI.address, [ChainId.SEPOLIA]: USDC_SEPOLIA.address, [ChainId.AVALANCHE]: USDC_AVALANCHE.address, + [ChainId.GNOSIS]: USDC_GNOSIS.address, }, } diff --git a/src/graphql/data/util.tsx b/src/graphql/data/util.tsx index d5088efbecb..5db93f8df54 100644 --- a/src/graphql/data/util.tsx +++ b/src/graphql/data/util.tsx @@ -66,6 +66,7 @@ export const GQL_MAINNET_CHAINS = [ Chain.Bnb, Chain.Avalanche, Chain.Base, + Chain.Gnosis, ] as const const GQL_TESTNET_CHAINS = [Chain.EthereumGoerli, Chain.EthereumSepolia] as const @@ -88,6 +89,7 @@ export const CHAIN_ID_TO_BACKEND_NAME: { [key: number]: InterfaceGqlChain } = { [ChainId.BNB]: Chain.Bnb, [ChainId.AVALANCHE]: Chain.Avalanche, [ChainId.BASE]: Chain.Base, + [ChainId.GNOSIS]: Chain.Gnosis, } export function chainIdToBackendName(chainId: number | undefined) { @@ -164,6 +166,7 @@ const CHAIN_NAME_TO_CHAIN_ID: { [key in InterfaceGqlChain]: ChainId } = { [Chain.Bnb]: ChainId.BNB, [Chain.Avalanche]: ChainId.AVALANCHE, [Chain.Base]: ChainId.BASE, + [Chain.Gnosis]: ChainId.GNOSIS, } export function isSupportedGQLChain(chain: Chain): chain is InterfaceGqlChain { diff --git a/src/hooks/useStablecoinPrice.ts b/src/hooks/useStablecoinPrice.ts index d20250c4d03..63e07ea7bf8 100644 --- a/src/hooks/useStablecoinPrice.ts +++ b/src/hooks/useStablecoinPrice.ts @@ -25,6 +25,7 @@ const STABLECOIN_AMOUNT_OUT: { [chainId: number]: CurrencyAmount } = { [ChainId.CELO]: CurrencyAmount.fromRawAmount(CUSD_CELO, 10_000e18), [ChainId.BNB]: CurrencyAmount.fromRawAmount(USDT_BSC, 100e18), [ChainId.AVALANCHE]: CurrencyAmount.fromRawAmount(USDC_AVALANCHE, 10_000e6), + [ChainId.GNOSIS]: CurrencyAmount.fromRawAmount(USDC_AVALANCHE, 10_000e6), } /** diff --git a/src/lib/hooks/useCurrencyLogoURIs.ts b/src/lib/hooks/useCurrencyLogoURIs.ts index f3e693b22ee..0cc8e2685b3 100644 --- a/src/lib/hooks/useCurrencyLogoURIs.ts +++ b/src/lib/hooks/useCurrencyLogoURIs.ts @@ -8,9 +8,10 @@ import AvaxLogo from '../../assets/svg/avax_logo.svg' import BnbLogo from '../../assets/svg/bnb-logo.svg' import CeloLogo from '../../assets/svg/celo_logo.svg' import MaticLogo from '../../assets/svg/matic-token-icon.svg' +import GnosisLogo from '../../assets/svg/xdai_logo.svg' import { isCelo, NATIVE_CHAIN_ID, nativeOnChain } from '../../constants/tokens' -type Network = 'ethereum' | 'arbitrum' | 'optimism' | 'polygon' | 'smartchain' | 'celo' | 'avalanchec' +type Network = 'ethereum' | 'arbitrum' | 'optimism' | 'polygon' | 'smartchain' | 'celo' | 'avalanchec' | 'gnosis' export function chainIdToNetworkName(networkId: ChainId): Network { switch (networkId) { @@ -28,6 +29,8 @@ export function chainIdToNetworkName(networkId: ChainId): Network { return 'celo' case ChainId.AVALANCHE: return 'avalanchec' + case ChainId.GNOSIS: + return 'gnosis' default: return 'ethereum' } @@ -45,6 +48,8 @@ export function getNativeLogoURI(chainId: ChainId = ChainId.MAINNET): string { return CeloLogo case ChainId.AVALANCHE: return AvaxLogo + case ChainId.GNOSIS: + return GnosisLogo default: return EthereumLogo } diff --git a/src/lib/state/multicall.tsx b/src/lib/state/multicall.tsx index 354211b0676..cc206ef0743 100644 --- a/src/lib/state/multicall.tsx +++ b/src/lib/state/multicall.tsx @@ -25,6 +25,8 @@ function getBlocksPerFetchForChainId(chainId: number | undefined): number { case ChainId.CELO: case ChainId.CELO_ALFAJORES: return 5 + case ChainId.GNOSIS: + return 2 default: return 1 } diff --git a/src/state/routing/types.ts b/src/state/routing/types.ts index 5742fc60d74..44c813d9535 100644 --- a/src/state/routing/types.ts +++ b/src/state/routing/types.ts @@ -486,6 +486,7 @@ export enum SwapRouterNativeAssets { BNB = 'BNB', AVAX = 'AVAX', ETH = 'ETH', + XDAI = 'xDAI', } export enum URAQuoteType { diff --git a/src/state/routing/utils.ts b/src/state/routing/utils.ts index 5c0a14b55e4..5375cc64bf3 100644 --- a/src/state/routing/utils.ts +++ b/src/state/routing/utils.ts @@ -4,7 +4,7 @@ import { Currency, CurrencyAmount, Token, TradeType } from '@uniswap/sdk-core' import { DutchOrderInfo, DutchOrderInfoJSON } from '@uniswap/uniswapx-sdk' import { Pair, Route as V2Route } from '@uniswap/v2-sdk' import { FeeAmount, Pool, Route as V3Route } from '@uniswap/v3-sdk' -import { isAvalanche, isBsc, isMatic, nativeOnChain } from 'constants/tokens' +import { isAvalanche, isBsc, isGnosis, isMatic, nativeOnChain } from 'constants/tokens' import { toSlippagePercent } from 'utils/slippage' import { getApproveInfo, getWrapInfo } from './gas' @@ -318,6 +318,7 @@ export function currencyAddressForSwapQuote(currency: Currency): string { if (isMatic(currency.chainId)) return SwapRouterNativeAssets.MATIC if (isBsc(currency.chainId)) return SwapRouterNativeAssets.BNB if (isAvalanche(currency.chainId)) return SwapRouterNativeAssets.AVAX + if (isGnosis(currency.chainId)) return SwapRouterNativeAssets.XDAI return SwapRouterNativeAssets.ETH } diff --git a/src/theme/colors.ts b/src/theme/colors.ts index ad0422e40aa..6d4e89c5fd6 100644 --- a/src/theme/colors.ts +++ b/src/theme/colors.ts @@ -97,6 +97,7 @@ export const colors = { networkPolygonSoft: 'rgba(164, 87, 255, 0.16)', networkEthereumSoft: 'rgba(98, 126, 234, 0.16)', networkBase: '#0052FF', + networkGnosis: '#04795B', //NEW COLORS FOR SPORE - need to define light/dark here cause they are root colors now (different system) neutral1_dark: '#FFFFFF', neutral2_dark: '#9B9B9B', @@ -137,6 +138,7 @@ const commonTheme = { chain_137: colors.networkPolygon, chain_42: colors.networkArbitrum, chain_56: colors.networkBsc, + chain_100: colors.networkGnosis, chain_420: colors.networkOptimism, chain_42161: colors.networkArbitrum, chain_421613: colors.networkArbitrum, @@ -148,6 +150,7 @@ const commonTheme = { chain_42161_background: colors.blue900, chain_84531: colors.networkBase, chain_56_background: colors.networkBsc, + chain_100_background: colors.green700, promotional: colors.magenta300, brandedGradient: 'linear-gradient(139.57deg, #FF79C9 4.35%, #FFB8E2 96.44%);', diff --git a/src/theme/components/RadialGradientByChainUpdater.ts b/src/theme/components/RadialGradientByChainUpdater.ts index 02f8e995471..1253ee6ecce 100644 --- a/src/theme/components/RadialGradientByChainUpdater.ts +++ b/src/theme/components/RadialGradientByChainUpdater.ts @@ -120,6 +120,15 @@ export default function RadialGradientByChainUpdater(): null { backgroundRadialGradientElement.style.background = darkMode ? baseDarkGradient : baseLightGradient break } + case ChainId.GNOSIS: { + setBackground(backgroundResetStyles) + const gnosisightGradient = + 'radial-gradient(100% 100% at 50% 0%, rgba(0, 82, 255, 0) 0%, rgba(0, 82, 255, 0) 40.0%, rgba(252, 255, 82, 0.00) 100%), rgb(255, 255, 255)' + const gnosisDarkGradient = + 'radial-gradient(100% 100% at 50% 0%, rgba(10, 41, 75, 0) 0%, rgba(0, 82, 255, 0) 40%, rgba(0, 82, 255, 0) 100%), rgb(13, 14, 14)' + backgroundRadialGradientElement.style.background = darkMode ? gnosisDarkGradient : gnosisightGradient + break + } default: { setDefaultBackground(backgroundRadialGradientElement, darkMode) } diff --git a/src/utils/anonymizeLink.ts b/src/utils/anonymizeLink.ts index 4fd94400ed6..d8a81d8fd1f 100644 --- a/src/utils/anonymizeLink.ts +++ b/src/utils/anonymizeLink.ts @@ -7,6 +7,7 @@ const EXPLORER_HOSTNAMES: { [hostname: string]: true } = { 'goerli-optimism.etherscan.io': true, 'arbiscan.io': true, 'snowtrace.io': true, + 'gnosisscan.io': true, } /** diff --git a/src/utils/getExplorerLink.test.ts b/src/utils/getExplorerLink.test.ts index 0ffc6b585ef..a7afc862a57 100644 --- a/src/utils/getExplorerLink.test.ts +++ b/src/utils/getExplorerLink.test.ts @@ -38,4 +38,9 @@ describe('#getExplorerLink', () => { it('base', () => { expect(getExplorerLink(ChainId.BASE, 'abc', ExplorerDataType.ADDRESS)).toEqual('https://basescan.org/address/abc') }) + it('gnosis', () => { + expect(getExplorerLink(ChainId.GNOSIS, 'abc', ExplorerDataType.ADDRESS)).toEqual( + 'https://gnosisscan.io/address/abc' + ) + }) })