diff --git a/src/components/transactions/Swap/constants/cow.constants.ts b/src/components/transactions/Swap/constants/cow.constants.ts index 9681e6f62c..6297805ff2 100644 --- a/src/components/transactions/Swap/constants/cow.constants.ts +++ b/src/components/transactions/Swap/constants/cow.constants.ts @@ -13,10 +13,10 @@ export const HOOK_ADAPTER_PER_TYPE: Record = { [SupportedChainId.BNB]: '0xdeCC46a4b09162F5369c5C80383AAa9159bCf192', [SupportedChainId.POLYGON]: '0xdeCC46a4b09162F5369c5C80383AAa9159bCf192', [SupportedChainId.BASE]: '0xdeCC46a4b09162F5369c5C80383AAa9159bCf192', + [SupportedChainId.LINEA]: '0xdeCC46a4b09162F5369c5C80383AAa9159bCf192', + [SupportedChainId.PLASMA]: '0xdeCC46a4b09162F5369c5C80383AAa9159bCf192', [SupportedChainId.LENS]: '', - [SupportedChainId.LINEA]: '', - [SupportedChainId.PLASMA]: '', [SupportedChainId.SEPOLIA]: '', }; @@ -115,8 +115,6 @@ export const COW_UNSUPPORTED_ASSETS: Partial< // Safe checks, not supported [SupportedChainId.LENS]: 'ALL', - [SupportedChainId.LINEA]: 'ALL', - [SupportedChainId.PLASMA]: 'ALL', }, }; @@ -129,6 +127,8 @@ export const CoWProtocolSupportedNetworks = [ SupportedChainId.AVALANCHE, SupportedChainId.POLYGON, SupportedChainId.BNB, + SupportedChainId.LINEA, + SupportedChainId.PLASMA, ] as const; export const isChainIdSupportedByCoWProtocol = (chainId: number): chainId is SupportedChainId => { diff --git a/src/components/transactions/Swap/helpers/cow/orders.helpers.ts b/src/components/transactions/Swap/helpers/cow/orders.helpers.ts index 4d271d702a..e7f868d5e8 100644 --- a/src/components/transactions/Swap/helpers/cow/orders.helpers.ts +++ b/src/components/transactions/Swap/helpers/cow/orders.helpers.ts @@ -440,6 +440,10 @@ export const generateCoWExplorerLink = (chainId: SupportedChainId, orderId?: str return `${base}/pol/orders/${orderId}`; case SupportedChainId.BNB: return `${base}/bnb/orders/${orderId}`; + case SupportedChainId.LINEA: + return `${base}/linea/orders/${orderId}`; + case SupportedChainId.PLASMA: + return `${base}/plasma/orders/${orderId}`; default: throw new Error('Define explorer link for chainId: ' + chainId); } diff --git a/src/components/transactions/Swap/helpers/shared/provider.helpers.ts b/src/components/transactions/Swap/helpers/shared/provider.helpers.ts index 181c5ab2d9..baaea7c726 100644 --- a/src/components/transactions/Swap/helpers/shared/provider.helpers.ts +++ b/src/components/transactions/Swap/helpers/shared/provider.helpers.ts @@ -2,6 +2,7 @@ import { COW_UNSUPPORTED_ASSETS, isChainIdSupportedByCoWProtocol, } from '../../constants/cow.constants'; +import { ParaswapSupportedNetworks } from '../../constants/paraswap.constants'; import { SwapProvider, SwapType } from '../../types'; /** @@ -51,7 +52,7 @@ export const isSwapSupportedByCowProtocol = ( * Picks the provider for the current swap based on chain, assets and flow. * * Notes: - * - CoW is preferred when supported; fallback to ParaSwap + * - CoW is preferred when supported; fallback to ParaSwap if supported on chain */ export const getSwitchProvider = ({ chainId, @@ -72,5 +73,9 @@ export const getSwitchProvider = ({ return SwapProvider.COW_PROTOCOL; } - return SwapProvider.PARASWAP; + // Fallback to ParaSwap only if supported on this chain + if (ParaswapSupportedNetworks.includes(chainId)) { + return SwapProvider.PARASWAP; + } + return undefined; }; diff --git a/src/layouts/AppHeader.tsx b/src/layouts/AppHeader.tsx index 8d164e2c81..9902de7bfb 100644 --- a/src/layouts/AppHeader.tsx +++ b/src/layouts/AppHeader.tsx @@ -28,7 +28,7 @@ import { useModalContext } from 'src/hooks/useModal'; import { useSwapOrdersTracking } from 'src/hooks/useSwapOrdersTracking'; import { useWeb3Context } from 'src/libs/hooks/useWeb3Context'; import { useRootStore } from 'src/store/root'; -import { ENABLE_TESTNET, FORK_ENABLED } from 'src/utils/marketsAndNetworksConfig'; +import { ENABLE_TESTNET, FORK_ENABLED, isFeatureEnabled } from 'src/utils/marketsAndNetworksConfig'; import { useShallow } from 'zustand/shallow'; import { Link } from '../components/primitives/Link'; @@ -107,6 +107,8 @@ export function AppHeader() { ]) ); + const showSwitchButton = isFeatureEnabled.switch(currentMarketData); + const { openSwitch, openBridge, openReadMode } = useModalContext(); const { readOnlyMode } = useWeb3Context(); const [walletWidgetOpen, setWalletWidgetOpen] = useState(false); @@ -312,6 +314,7 @@ export function AppHeader() { variant="surface" sx={{ p: '7px 8px', minWidth: 'unset', gap: 2, alignItems: 'center' }} aria-label="Switch tool" + disabled={!showSwitchButton} > {!smd && ( diff --git a/src/ui-config/TokenList.ts b/src/ui-config/TokenList.ts index 0a970c7746..198432d414 100644 --- a/src/ui-config/TokenList.ts +++ b/src/ui-config/TokenList.ts @@ -171,6 +171,29 @@ const NETWORK_ASSETS: TokenInfo[] = [ isNative: true, }, }, + { + name: 'XPL', + symbol: 'XPL', + decimals: 18, + address: API_ETH_MOCK_ADDRESS, + chainId: 9745, + logoURI: '/icons/networks/plasma.svg', + extensions: { + isNative: true, + }, + }, + { + name: 'ETH', + symbol: 'ETH', + decimals: 18, + address: API_ETH_MOCK_ADDRESS, + chainId: 59144, + logoURI: + 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png', + extensions: { + isNative: true, + }, + }, ]; export const TOKEN_LIST: TokenList = { @@ -13004,6 +13027,167 @@ export const TOKEN_LIST: TokenList = { chainId: 1, logoURI: 'https://assets.coingecko.com/coins/images/32254/standard/sdai.png?1697015278', }, + // Plasma + { + chainId: 9745, + address: '0x9895D81bB462A195b4922ED7De0e3ACD007c32CB', + name: 'Wrapped Ether', + symbol: 'WETH', + decimals: 18, + logoURI: 'https://assets.coingecko.com/coins/images/2518/standard/weth.png?1696503332', + }, + { + chainId: 9745, + address: '0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb', + name: 'Tether USD', + symbol: 'USDT0', + decimals: 6, + logoURI: + 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png', + }, + { + chainId: 9745, + address: '0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34', + name: 'USDe', + symbol: 'USDe', + decimals: 18, + }, + { + chainId: 9745, + address: '0x211Cc4DD073734dA055fbF44a2b4667d5E5fE5d2', + name: 'Staked USDe', + symbol: 'sUSDe', + decimals: 18, + }, + { + chainId: 9745, + address: '0x1B64B9025EEbb9A6239575dF9Ea4b9Ac46D4d193', + name: 'Tether Gold', + symbol: 'XAUt0', + decimals: 6, + }, + { + chainId: 9745, + address: '0xA3D68b74bF0528fdD07263c60d6488749044914b', + name: 'Wrapped eETH', + symbol: 'weETH', + decimals: 18, + }, + { + chainId: 9745, + address: '0xe48D935e6C9e735463ccCf29a7F11e32bC09136E', + name: 'Wrapped liquid staked Ether 2.0', + symbol: 'wstETH', + decimals: 18, + logoURI: 'https://assets.coingecko.com/coins/images/18834/standard/wstETH.png?1696518295', + }, + { + chainId: 9745, + address: '0xe561FE05C39075312Aa9Bc6af79DdaE981461359', + name: 'Wrapped rsETH', + symbol: 'wrsETH', + decimals: 18, + }, + { + chainId: 9745, + address: '0x93B544c330F60A2aa05ceD87aEEffB8D38FD8c9a', + name: 'Pendle USDe PT 15JAN2026', + symbol: 'PT_USDe_15JAN2026', + decimals: 18, + }, + { + chainId: 9745, + address: '0x02FCC4989B4C9D435b7ceD3fE1Ba4CF77BBb5Dd8', + name: 'Pendle sUSDe PT 15JAN2026', + symbol: 'PT_sUSDE_15JAN2026', + decimals: 18, + }, + { + chainId: 9745, + address: '0xC4374775489CB9C56003BF2C9b12495fC64F0771', + name: 'syrupUSDT', + symbol: 'syrupUSDT', + decimals: 6, + }, + { + chainId: 9745, + address: '0x6100E367285b01F48D07953803A2d8dCA5D19873', + name: 'Wrapped XPL', + symbol: 'WXPL', + decimals: 18, + }, + // Linea + { + chainId: 59144, + address: '0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f', + name: 'Wrapped Ether', + symbol: 'WETH', + decimals: 18, + logoURI: 'https://assets.coingecko.com/coins/images/2518/standard/weth.png?1696503332', + }, + { + chainId: 59144, + address: '0x3aAB2285ddcDdaD8edf438C1bAB47e1a9D05a9b4', + name: 'Wrapped BTC', + symbol: 'WBTC', + decimals: 8, + logoURI: + 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png', + }, + { + chainId: 59144, + address: '0x176211869cA2b568f2A7D4EE941E073a821EE1ff', + name: 'USDCoin', + symbol: 'USDC', + decimals: 6, + logoURI: + 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png', + }, + { + chainId: 59144, + address: '0xA219439258ca9da29E9Cc4cE5596924745e12B93', + name: 'Tether USD', + symbol: 'USDT', + decimals: 6, + logoURI: + 'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png', + }, + { + chainId: 59144, + address: '0xB5beDd42000b71FddE22D3eE8a79Bd49A568fC8F', + name: 'Wrapped liquid staked Ether 2.0', + symbol: 'wstETH', + decimals: 18, + logoURI: 'https://assets.coingecko.com/coins/images/18834/standard/wstETH.png?1696518295', + }, + { + chainId: 59144, + address: '0x2416092f143378750bb29b79eD961ab195CcEea5', + name: 'Renzo Restaked ETH', + symbol: 'ezETH', + decimals: 18, + }, + { + chainId: 59144, + address: '0x1Bf74C010E6320bab11e2e5A532b5AC15e0b8aA6', + name: 'Wrapped eETH', + symbol: 'weETH', + decimals: 18, + }, + { + chainId: 59144, + address: '0xD2671165570f41BBB3B0097893300b6EB6101E6C', + name: 'Wrapped rsETH', + symbol: 'wrsETH', + decimals: 18, + }, + { + chainId: 59144, + address: '0xacA92E438df0B2401fF60dA7E4337B687a2435DA', + name: 'mUSD', + symbol: 'mUSD', + decimals: 6, + }, // Sonic { name: 'USDC', diff --git a/src/ui-config/marketsConfig.tsx b/src/ui-config/marketsConfig.tsx index 16d1591e8f..b56d8541e1 100644 --- a/src/ui-config/marketsConfig.tsx +++ b/src/ui-config/marketsConfig.tsx @@ -368,6 +368,13 @@ export const marketsData: { UI_INCENTIVE_DATA_PROVIDER: AaveV3Linea.UI_INCENTIVE_DATA_PROVIDER, COLLECTOR: AaveV3Linea.COLLECTOR, }, + enabledFeatures: { + liquiditySwap: true, + withdrawAndSwitch: true, + collateralRepay: true, + debtSwitch: true, + switch: true, + }, }, [CustomMarket.proto_sonic_v3]: { marketTitle: 'Sonic', @@ -458,6 +465,13 @@ export const marketsData: { UI_INCENTIVE_DATA_PROVIDER: AaveV3Plasma.UI_INCENTIVE_DATA_PROVIDER, COLLECTOR: AaveV3Plasma.COLLECTOR, }, + enabledFeatures: { + // liquiditySwap: true, + // withdrawAndSwitch: true, + // collateralRepay: true, + // debtSwitch: true, + // switch: true, + }, }, [CustomMarket.proto_polygon_v3]: { marketTitle: 'Polygon',