Skip to content

Commit d501a02

Browse files
authored
feat(COW-163): Add Ink network (#6877)
Add Ink network.
1 parent d05c150 commit d501a02

File tree

48 files changed

+419
-397
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+419
-397
lines changed

.github/workflows/vercel.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,11 @@ jobs:
6161
REACT_APP_NETWORK_URL_137: ${{ secrets.REACT_APP_NETWORK_URL_137 }}
6262
REACT_APP_NETWORK_URL_232: ${{ secrets.REACT_APP_NETWORK_URL_232 }}
6363
REACT_APP_NETWORK_URL_8453: ${{ secrets.REACT_APP_NETWORK_URL_8453 }}
64+
REACT_APP_NETWORK_URL_9745: ${{ secrets.REACT_APP_NETWORK_URL_9745 }}
6465
REACT_APP_NETWORK_URL_42161: ${{ secrets.REACT_APP_NETWORK_URL_42161 }}
6566
REACT_APP_NETWORK_URL_43114: ${{ secrets.REACT_APP_NETWORK_URL_43114 }}
67+
REACT_APP_NETWORK_URL_57073: ${{ secrets.REACT_APP_NETWORK_URL_57073 }}
68+
REACT_APP_NETWORK_URL_59144: ${{ secrets.REACT_APP_NETWORK_URL_59144 }}
6669
REACT_APP_NETWORK_URL_11155111: ${{ secrets.REACT_APP_NETWORK_URL_11155111 }}
6770
REACT_APP_WC_PROJECT_ID: ${{ secrets.REACT_APP_WC_PROJECT_ID }}
6871
REACT_APP_IPFS_READ_URI: ${{ secrets.REACT_APP_IPFS_READ_URI }}

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,17 @@ environment variables:
161161

162162
```ini
163163
REACT_APP_NETWORK_URL_1: https://...
164-
REACT_APP_NETWORK_URL_11155111: https://...
165-
REACT_APP_NETWORK_URL_100: https://...
164+
REACT_APP_NETWORK_URL_56: https://...
165+
REACT_APP_NETWORK_URL_100: https://rpc.gnosis.gateway.fm
166166
REACT_APP_NETWORK_URL_137: https://...
167+
REACT_APP_NETWORK_URL_232: https://rpc.lens.xyz
167168
REACT_APP_NETWORK_URL_8453: https://...
169+
REACT_APP_NETWORK_URL_9745: https://rpc.plasma.to
168170
REACT_APP_NETWORK_URL_42161: https://...
169171
REACT_APP_NETWORK_URL_43114: https://...
172+
REACT_APP_NETWORK_URL_57073: https://rpc-ten.inkonchain.com
173+
REACT_APP_NETWORK_URL_59144: https://rpc.linea.build
174+
REACT_APP_NETWORK_URL_11155111: https://...
170175
```
171176

172177
Additionally, if you plan to run the integration tests locally you must define:

apps/cowswap-frontend/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,21 @@
3939
"@cowprotocol/common-utils": "workspace:*",
4040
"@cowprotocol/core": "workspace:*",
4141
"@cowprotocol/cow-runner-game": "^0.2.9",
42-
"@cowprotocol/cow-sdk": "7.2.13",
42+
"@cowprotocol/cow-sdk": "~7.3.1",
4343
"@cowprotocol/cowswap-abis": "workspace:*",
4444
"@cowprotocol/ens": "workspace:*",
4545
"@cowprotocol/events": "workspace:*",
4646
"@cowprotocol/hook-dapp-lib": "workspace:*",
4747
"@cowprotocol/iframe-transport": "workspace:*",
4848
"@cowprotocol/multicall": "workspace:*",
4949
"@cowprotocol/permit-utils": "workspace:*",
50-
"@cowprotocol/sdk-bridging": "1.5.0",
51-
"@cowprotocol/sdk-contracts-ts": "^1.1.0",
52-
"@cowprotocol/sdk-cow-shed": "0.2.12",
53-
"@cowprotocol/sdk-ethers-v5-adapter": "0.3.1",
54-
"@cowprotocol/sdk-order-book": "^0.5.1",
55-
"@cowprotocol/sdk-trading": "^0.8.1",
56-
"@cowprotocol/sdk-viem-adapter": "^0.3.1",
50+
"@cowprotocol/sdk-bridging": "1.7.0",
51+
"@cowprotocol/sdk-contracts-ts": "^1.4.0",
52+
"@cowprotocol/sdk-cow-shed": "0.2.14",
53+
"@cowprotocol/sdk-ethers-v5-adapter": "0.3.3",
54+
"@cowprotocol/sdk-order-book": "^0.6.1",
55+
"@cowprotocol/sdk-trading": "^0.9.2",
56+
"@cowprotocol/sdk-viem-adapter": "^0.3.3",
5757
"@cowprotocol/snackbars": "workspace:*",
5858
"@cowprotocol/tokens": "workspace:*",
5959
"@cowprotocol/types": "workspace:*",

apps/cowswap-frontend/src/common/pure/NetworksList/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Trans } from '@lingui/react/macro'
99

1010
import * as styledEl from './styled'
1111

12-
const NEW_NETWORK_IDS = [SupportedChainId.LINEA, SupportedChainId.PLASMA]
12+
const NEW_NETWORK_IDS = new Set([SupportedChainId.PLASMA, SupportedChainId.INK])
1313

1414
export interface NetworksListProps {
1515
currentChainId: SupportedChainId | null
@@ -32,7 +32,7 @@ export function NetworksList(props: NetworksListProps): ReactNode {
3232

3333
const isActive = targetChainId === currentChainId
3434
const logoUrl = getLogo(isDarkMode, isActive, logo.dark, logo.light)
35-
const isNewNetwork = NEW_NETWORK_IDS.includes(targetChainId)
35+
const isNewNetwork = NEW_NETWORK_IDS.has(targetChainId)
3636

3737
const rowContent = (
3838
<styledEl.FlyoutRow key={targetChainId} onClick={() => onSelectChain(targetChainId)} active={isActive}>

apps/cowswap-frontend/src/modules/account/containers/AccountDetails/SurplusCard.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const LENS_START_DATE = 'September 2025'
3030
const BNB_START_DATE = 'September 2025'
3131
const LINEA_START_DATE = 'November 2025'
3232
const PLASMA_START_DATE = 'January 2026'
33+
const INK_START_DATE = 'February 2026'
3334

3435
const START_DATE: Record<SupportedChainId, string> = {
3536
[SupportedChainId.MAINNET]: DEFAULT_START_DATE,
@@ -43,6 +44,7 @@ const START_DATE: Record<SupportedChainId, string> = {
4344
[SupportedChainId.BNB]: BNB_START_DATE,
4445
[SupportedChainId.LINEA]: LINEA_START_DATE,
4546
[SupportedChainId.PLASMA]: PLASMA_START_DATE,
47+
[SupportedChainId.INK]: INK_START_DATE,
4648
}
4749

4850
const Wrapper = styled.div`

apps/cowswap-frontend/src/modules/appData/utils/buildAppData.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ export async function buildAppData({
5858
replacedOrderUid,
5959
userConsent,
6060
}: BuildAppDataParams): Promise<AppDataInfo> {
61-
const referrerParams =
62-
referrerAccount && chainId === SupportedChainId.MAINNET ? { address: referrerAccount } : undefined
61+
const referrerParams = referrerAccount && chainId === SupportedChainId.MAINNET ? { code: referrerAccount } : undefined
6362

6463
const quoteParams = {
6564
slippageBips,

apps/cowswap-frontend/src/modules/orderProgressBar/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ export const CHAIN_SPECIFIC_BENEFITS: Record<SupportedChainId, MessageDescriptor
107107
[SupportedChainId.BNB]: COW_SWAP_BENEFITS,
108108
[SupportedChainId.LINEA]: COW_SWAP_BENEFITS,
109109
[SupportedChainId.PLASMA]: COW_SWAP_BENEFITS,
110+
[SupportedChainId.INK]: COW_SWAP_BENEFITS,
110111
}
111112

112113
export const SURPLUS_IMAGES = [

apps/cowswap-frontend/src/modules/orders/state/ordersLimitAtom.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,18 @@ export const ordersLimitAtom = atom<OrdersLimitState>(DEFAULT_ORDERS_LIMIT_STATE
2828

2929
const walletKeyAtom = atom((get) => {
3030
const { chainId, account } = get(walletInfoAtom)
31-
return `${chainId}::${account ?? ''}`
31+
return account ? `${chainId}::${account.toLowerCase()}` : ''
3232
})
3333

3434
ordersLimitAtom.onMount = () => {
35+
let prevWalletKey = ''
36+
3537
return observe((get, set) => {
36-
get(walletKeyAtom)
37-
set(ordersLimitAtom, DEFAULT_ORDERS_LIMIT_STATE)
38+
const walletKey = get(walletKeyAtom)
39+
40+
if (prevWalletKey !== walletKey) {
41+
prevWalletKey = walletKey
42+
set(ordersLimitAtom, DEFAULT_ORDERS_LIMIT_STATE)
43+
}
3844
}, jotaiStore)
3945
}

apps/cowswap-frontend/src/modules/swap/containers/NetworkBridgeBanner/NetworkBridgeBanner.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import { useDarkModeManager } from 'legacy/state/user/hooks'
1515
import { useInjectedWidgetParams } from 'modules/injectedWidget'
1616

1717
const HideSmall = styled.span`
18+
width: 100%;
19+
1820
${Media.upToSmall()} {
1921
display: none;
2022
}
@@ -56,6 +58,7 @@ const SHOULD_SHOW_ALERT = {
5658
[SupportedChainId.LENS]: true,
5759
[SupportedChainId.LINEA]: true,
5860
[SupportedChainId.PLASMA]: true,
61+
[SupportedChainId.INK]: true,
5962
}
6063

6164
type NetworkAlertChains = keyof typeof SHOULD_SHOW_ALERT
@@ -119,6 +122,7 @@ const ContentWrapper = styled.div<{ chainId: NetworkAlertChains; darkMode: boole
119122
}
120123
`
121124
const Header = styled.h2`
125+
width: 100%;
122126
font-weight: 600;
123127
font-size: 16px;
124128
margin: 0;

apps/cowswap-frontend/src/modules/tokensList/pure/ChainsSelector/ChainsLoadingList.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import { ReactNode } from 'react'
22

3+
import { ALL_SUPPORTED_CHAIN_IDS } from '@cowprotocol/cow-sdk'
4+
35
import * as styledEl from './styled'
46

5-
const LOADING_ITEMS_COUNT = 10
7+
const LOADING_ITEMS_COUNT = ALL_SUPPORTED_CHAIN_IDS.length
8+
69
const LOADING_SKELETON_INDICES = Array.from({ length: LOADING_ITEMS_COUNT }, (_, index) => index)
710

811
export function ChainsLoadingList(): ReactNode {

0 commit comments

Comments
 (0)