Skip to content

Commit 9d80dd4

Browse files
committed
feat: activate swaps on linea and plasma
1 parent bdeb421 commit 9d80dd4

File tree

5 files changed

+225
-12
lines changed

5 files changed

+225
-12
lines changed

src/components/transactions/Swap/constants/cow.constants.ts

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ export const HOOK_ADAPTER_PER_TYPE: Record<AaveFlashLoanType, Record<SupportedCh
1313
[SupportedChainId.BNB]: '0x029d584E847373B6373b01dfaD1a0C9BfB916382',
1414
[SupportedChainId.POLYGON]: '0x029d584E847373B6373b01dfaD1a0C9BfB916382',
1515
[SupportedChainId.BASE]: '0x029d584E847373B6373b01dfaD1a0C9BfB916382',
16+
[SupportedChainId.LINEA]: '0x029d584E847373B6373b01dfaD1a0C9BfB916382',
17+
[SupportedChainId.PLASMA]: '0x029d584E847373B6373b01dfaD1a0C9BfB916382',
1618
[SupportedChainId.SEPOLIA]: '',
1719
[SupportedChainId.LENS]: '',
18-
[SupportedChainId.LINEA]: '',
19-
[SupportedChainId.PLASMA]: '',
2020
},
2121
[AaveFlashLoanType.DebtSwap]: {
2222
[SupportedChainId.MAINNET]: '0x73e7aF13Ef172F13d8FEfEbfD90C7A6530096344',
@@ -26,10 +26,10 @@ export const HOOK_ADAPTER_PER_TYPE: Record<AaveFlashLoanType, Record<SupportedCh
2626
[SupportedChainId.BNB]: '0x73e7aF13Ef172F13d8FEfEbfD90C7A6530096344',
2727
[SupportedChainId.POLYGON]: '0x73e7aF13Ef172F13d8FEfEbfD90C7A6530096344',
2828
[SupportedChainId.BASE]: '0x73e7aF13Ef172F13d8FEfEbfD90C7A6530096344',
29+
[SupportedChainId.LINEA]: '0x73e7aF13Ef172F13d8FEfEbfD90C7A6530096344',
30+
[SupportedChainId.PLASMA]: '0x73e7aF13Ef172F13d8FEfEbfD90C7A6530096344',
2931
[SupportedChainId.SEPOLIA]: '',
3032
[SupportedChainId.LENS]: '',
31-
[SupportedChainId.LINEA]: '',
32-
[SupportedChainId.PLASMA]: '',
3333
},
3434
[AaveFlashLoanType.RepayCollateral]: {
3535
[SupportedChainId.MAINNET]: '0xAc27F3f86e78B14721d07C4f9CE999285f9AAa06',
@@ -39,10 +39,10 @@ export const HOOK_ADAPTER_PER_TYPE: Record<AaveFlashLoanType, Record<SupportedCh
3939
[SupportedChainId.BNB]: '0xAc27F3f86e78B14721d07C4f9CE999285f9AAa06',
4040
[SupportedChainId.POLYGON]: '0xAc27F3f86e78B14721d07C4f9CE999285f9AAa06',
4141
[SupportedChainId.BASE]: '0xAc27F3f86e78B14721d07C4f9CE999285f9AAa06',
42+
[SupportedChainId.LINEA]: '0xAc27F3f86e78B14721d07C4f9CE999285f9AAa06',
43+
[SupportedChainId.PLASMA]: '0xAc27F3f86e78B14721d07C4f9CE999285f9AAa06',
4244
[SupportedChainId.SEPOLIA]: '',
4345
[SupportedChainId.LENS]: '',
44-
[SupportedChainId.LINEA]: '',
45-
[SupportedChainId.PLASMA]: '',
4646
},
4747
};
4848

@@ -54,9 +54,9 @@ export const ADAPTER_FACTORY: Record<SupportedChainId, string> = {
5454
[SupportedChainId.BNB]: '0xdeCC46a4b09162F5369c5C80383AAa9159bCf192',
5555
[SupportedChainId.POLYGON]: '0xdeCC46a4b09162F5369c5C80383AAa9159bCf192',
5656
[SupportedChainId.BASE]: '0xdeCC46a4b09162F5369c5C80383AAa9159bCf192',
57+
[SupportedChainId.LINEA]: '0xdeCC46a4b09162F5369c5C80383AAa9159bCf192',
58+
[SupportedChainId.PLASMA]: '0xdeCC46a4b09162F5369c5C80383AAa9159bCf192',
5759
[SupportedChainId.LENS]: '',
58-
[SupportedChainId.LINEA]: '',
59-
[SupportedChainId.PLASMA]: '',
6060
[SupportedChainId.SEPOLIA]: '',
6161
};
6262

@@ -113,10 +113,12 @@ export const COW_UNSUPPORTED_ASSETS: Partial<
113113
'0xd190eF37dB51Bb955A680fF1A85763CC72d083D4'.toLowerCase(), // aGHO not supported
114114
],
115115

116+
[SupportedChainId.LINEA]: [
117+
'0xacA92E438df0B2401fF60dA7E4337B687a2435DA'.toLowerCase(), // mUSD, to test no provider supported, remove before prod
118+
],
119+
116120
// Safe checks, not supported
117121
[SupportedChainId.LENS]: 'ALL',
118-
[SupportedChainId.LINEA]: 'ALL',
119-
[SupportedChainId.PLASMA]: 'ALL',
120122
},
121123
};
122124

@@ -129,6 +131,8 @@ export const CoWProtocolSupportedNetworks = [
129131
SupportedChainId.AVALANCHE,
130132
SupportedChainId.POLYGON,
131133
SupportedChainId.BNB,
134+
SupportedChainId.LINEA,
135+
SupportedChainId.PLASMA,
132136
] as const;
133137

134138
export const isChainIdSupportedByCoWProtocol = (chainId: number): chainId is SupportedChainId => {

src/components/transactions/Swap/helpers/cow/orders.helpers.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,10 @@ export const generateCoWExplorerLink = (chainId: SupportedChainId, orderId?: str
440440
return `${base}/pol/orders/${orderId}`;
441441
case SupportedChainId.BNB:
442442
return `${base}/bnb/orders/${orderId}`;
443+
case SupportedChainId.LINEA:
444+
return `${base}/linea/orders/${orderId}`;
445+
case SupportedChainId.PLASMA:
446+
return `${base}/plasma/orders/${orderId}`;
443447
default:
444448
throw new Error('Define explorer link for chainId: ' + chainId);
445449
}

src/components/transactions/Swap/helpers/shared/provider.helpers.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {
22
COW_UNSUPPORTED_ASSETS,
33
isChainIdSupportedByCoWProtocol,
44
} from '../../constants/cow.constants';
5+
import { ParaswapSupportedNetworks } from '../../constants/paraswap.constants';
56
import { SwapProvider, SwapType } from '../../types';
67

78
/**
@@ -51,7 +52,7 @@ export const isSwapSupportedByCowProtocol = (
5152
* Picks the provider for the current swap based on chain, assets and flow.
5253
*
5354
* Notes:
54-
* - CoW is preferred when supported; fallback to ParaSwap
55+
* - CoW is preferred when supported; fallback to ParaSwap if supported on chain
5556
*/
5657
export const getSwitchProvider = ({
5758
chainId,
@@ -72,5 +73,9 @@ export const getSwitchProvider = ({
7273
return SwapProvider.COW_PROTOCOL;
7374
}
7475

75-
return SwapProvider.PARASWAP;
76+
// Fallback to ParaSwap only if supported on this chain
77+
if (ParaswapSupportedNetworks.includes(chainId)) {
78+
return SwapProvider.PARASWAP;
79+
}
80+
return undefined;
7681
};

src/ui-config/TokenList.ts

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,29 @@ const NETWORK_ASSETS: TokenInfo[] = [
171171
isNative: true,
172172
},
173173
},
174+
{
175+
name: 'XPL',
176+
symbol: 'XPL',
177+
decimals: 18,
178+
address: API_ETH_MOCK_ADDRESS,
179+
chainId: 9745,
180+
logoURI: '/icons/networks/plasma.svg',
181+
extensions: {
182+
isNative: true,
183+
},
184+
},
185+
{
186+
name: 'ETH',
187+
symbol: 'ETH',
188+
decimals: 18,
189+
address: API_ETH_MOCK_ADDRESS,
190+
chainId: 59144,
191+
logoURI:
192+
'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png',
193+
extensions: {
194+
isNative: true,
195+
},
196+
},
174197
];
175198

176199
export const TOKEN_LIST: TokenList = {
@@ -13004,6 +13027,167 @@ export const TOKEN_LIST: TokenList = {
1300413027
chainId: 1,
1300513028
logoURI: 'https://assets.coingecko.com/coins/images/32254/standard/sdai.png?1697015278',
1300613029
},
13030+
// Plasma
13031+
{
13032+
chainId: 9745,
13033+
address: '0x9895D81bB462A195b4922ED7De0e3ACD007c32CB',
13034+
name: 'Wrapped Ether',
13035+
symbol: 'WETH',
13036+
decimals: 18,
13037+
logoURI: 'https://assets.coingecko.com/coins/images/2518/standard/weth.png?1696503332',
13038+
},
13039+
{
13040+
chainId: 9745,
13041+
address: '0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb',
13042+
name: 'Tether USD',
13043+
symbol: 'USDT0',
13044+
decimals: 6,
13045+
logoURI:
13046+
'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png',
13047+
},
13048+
{
13049+
chainId: 9745,
13050+
address: '0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34',
13051+
name: 'USDe',
13052+
symbol: 'USDe',
13053+
decimals: 18,
13054+
},
13055+
{
13056+
chainId: 9745,
13057+
address: '0x211Cc4DD073734dA055fbF44a2b4667d5E5fE5d2',
13058+
name: 'Staked USDe',
13059+
symbol: 'sUSDe',
13060+
decimals: 18,
13061+
},
13062+
{
13063+
chainId: 9745,
13064+
address: '0x1B64B9025EEbb9A6239575dF9Ea4b9Ac46D4d193',
13065+
name: 'Tether Gold',
13066+
symbol: 'XAUt0',
13067+
decimals: 6,
13068+
},
13069+
{
13070+
chainId: 9745,
13071+
address: '0xA3D68b74bF0528fdD07263c60d6488749044914b',
13072+
name: 'Wrapped eETH',
13073+
symbol: 'weETH',
13074+
decimals: 18,
13075+
},
13076+
{
13077+
chainId: 9745,
13078+
address: '0xe48D935e6C9e735463ccCf29a7F11e32bC09136E',
13079+
name: 'Wrapped liquid staked Ether 2.0',
13080+
symbol: 'wstETH',
13081+
decimals: 18,
13082+
logoURI: 'https://assets.coingecko.com/coins/images/18834/standard/wstETH.png?1696518295',
13083+
},
13084+
{
13085+
chainId: 9745,
13086+
address: '0xe561FE05C39075312Aa9Bc6af79DdaE981461359',
13087+
name: 'Wrapped rsETH',
13088+
symbol: 'wrsETH',
13089+
decimals: 18,
13090+
},
13091+
{
13092+
chainId: 9745,
13093+
address: '0x93B544c330F60A2aa05ceD87aEEffB8D38FD8c9a',
13094+
name: 'Pendle USDe PT 15JAN2026',
13095+
symbol: 'PT_USDe_15JAN2026',
13096+
decimals: 18,
13097+
},
13098+
{
13099+
chainId: 9745,
13100+
address: '0x02FCC4989B4C9D435b7ceD3fE1Ba4CF77BBb5Dd8',
13101+
name: 'Pendle sUSDe PT 15JAN2026',
13102+
symbol: 'PT_sUSDE_15JAN2026',
13103+
decimals: 18,
13104+
},
13105+
{
13106+
chainId: 9745,
13107+
address: '0xC4374775489CB9C56003BF2C9b12495fC64F0771',
13108+
name: 'syrupUSDT',
13109+
symbol: 'syrupUSDT',
13110+
decimals: 6,
13111+
},
13112+
{
13113+
chainId: 9745,
13114+
address: '0x6100E367285b01F48D07953803A2d8dCA5D19873',
13115+
name: 'Wrapped XPL',
13116+
symbol: 'WXPL',
13117+
decimals: 18,
13118+
},
13119+
// Linea
13120+
{
13121+
chainId: 59144,
13122+
address: '0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f',
13123+
name: 'Wrapped Ether',
13124+
symbol: 'WETH',
13125+
decimals: 18,
13126+
logoURI: 'https://assets.coingecko.com/coins/images/2518/standard/weth.png?1696503332',
13127+
},
13128+
{
13129+
chainId: 59144,
13130+
address: '0x3aAB2285ddcDdaD8edf438C1bAB47e1a9D05a9b4',
13131+
name: 'Wrapped BTC',
13132+
symbol: 'WBTC',
13133+
decimals: 8,
13134+
logoURI:
13135+
'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/logo.png',
13136+
},
13137+
{
13138+
chainId: 59144,
13139+
address: '0x176211869cA2b568f2A7D4EE941E073a821EE1ff',
13140+
name: 'USDCoin',
13141+
symbol: 'USDC',
13142+
decimals: 6,
13143+
logoURI:
13144+
'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png',
13145+
},
13146+
{
13147+
chainId: 59144,
13148+
address: '0xA219439258ca9da29E9Cc4cE5596924745e12B93',
13149+
name: 'Tether USD',
13150+
symbol: 'USDT',
13151+
decimals: 6,
13152+
logoURI:
13153+
'https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xdAC17F958D2ee523a2206206994597C13D831ec7/logo.png',
13154+
},
13155+
{
13156+
chainId: 59144,
13157+
address: '0xB5beDd42000b71FddE22D3eE8a79Bd49A568fC8F',
13158+
name: 'Wrapped liquid staked Ether 2.0',
13159+
symbol: 'wstETH',
13160+
decimals: 18,
13161+
logoURI: 'https://assets.coingecko.com/coins/images/18834/standard/wstETH.png?1696518295',
13162+
},
13163+
{
13164+
chainId: 59144,
13165+
address: '0x2416092f143378750bb29b79eD961ab195CcEea5',
13166+
name: 'Renzo Restaked ETH',
13167+
symbol: 'ezETH',
13168+
decimals: 18,
13169+
},
13170+
{
13171+
chainId: 59144,
13172+
address: '0x1Bf74C010E6320bab11e2e5A532b5AC15e0b8aA6',
13173+
name: 'Wrapped eETH',
13174+
symbol: 'weETH',
13175+
decimals: 18,
13176+
},
13177+
{
13178+
chainId: 59144,
13179+
address: '0xD2671165570f41BBB3B0097893300b6EB6101E6C',
13180+
name: 'Wrapped rsETH',
13181+
symbol: 'wrsETH',
13182+
decimals: 18,
13183+
},
13184+
{
13185+
chainId: 59144,
13186+
address: '0xacA92E438df0B2401fF60dA7E4337B687a2435DA',
13187+
name: 'mUSD',
13188+
symbol: 'mUSD',
13189+
decimals: 6,
13190+
},
1300713191
// Sonic
1300813192
{
1300913193
name: 'USDC',

src/ui-config/marketsConfig.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,14 @@ export const marketsData: {
462462
UI_INCENTIVE_DATA_PROVIDER: AaveV3Linea.UI_INCENTIVE_DATA_PROVIDER,
463463
COLLECTOR: AaveV3Linea.COLLECTOR,
464464
},
465+
enabledFeatures: {
466+
incentives: true,
467+
liquiditySwap: true,
468+
withdrawAndSwitch: true,
469+
collateralRepay: true,
470+
debtSwitch: true,
471+
switch: true,
472+
},
465473
},
466474
[CustomMarket.proto_fuji_v3]: {
467475
marketTitle: 'Avalanche Fuji',
@@ -608,6 +616,14 @@ export const marketsData: {
608616
UI_INCENTIVE_DATA_PROVIDER: AaveV3Plasma.UI_INCENTIVE_DATA_PROVIDER,
609617
COLLECTOR: AaveV3Plasma.COLLECTOR,
610618
},
619+
enabledFeatures: {
620+
incentives: true,
621+
liquiditySwap: true,
622+
withdrawAndSwitch: true,
623+
collateralRepay: true,
624+
debtSwitch: true,
625+
switch: true,
626+
},
611627
},
612628
[CustomMarket.proto_polygon_v3]: {
613629
marketTitle: 'Polygon',

0 commit comments

Comments
 (0)