Skip to content

Commit 7ab51ce

Browse files
Merge branch 'feat/internationalization-setup-for-swap-cow-fi' into feat/update-lingui
2 parents bb971d9 + f309ad7 commit 7ab51ce

File tree

65 files changed

+507
-620
lines changed

Some content is hidden

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

65 files changed

+507
-620
lines changed

.github/workflows/vercel.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ jobs:
4646
REACT_APP_LAUNCH_DARKLY_KEY=${{ secrets.REACT_APP_LAUNCH_DARKLY_KEY }}
4747
REACT_APP_INFURA_KEY=${{ secrets.REACT_APP_INFURA_KEY }}
4848
REACT_APP_NETWORK_URL_1=${{ secrets.REACT_APP_NETWORK_URL_1 }}
49+
REACT_APP_NETWORK_URL_56=${{ secrets.REACT_APP_NETWORK_URL_56 }}
4950
REACT_APP_NETWORK_URL_100=${{ secrets.REACT_APP_NETWORK_URL_100 }}
5051
REACT_APP_NETWORK_URL_137=${{ secrets.REACT_APP_NETWORK_URL_137 }}
52+
REACT_APP_NETWORK_URL_232=${{ secrets.REACT_APP_NETWORK_URL_232 }}
5153
REACT_APP_NETWORK_URL_8453=${{ secrets.REACT_APP_NETWORK_URL_8453 }}
5254
REACT_APP_NETWORK_URL_42161=${{ secrets.REACT_APP_NETWORK_URL_42161 }}
5355
REACT_APP_NETWORK_URL_43114=${{ secrets.REACT_APP_NETWORK_URL_43114 }}

.release-please-manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"apps/cowswap-frontend": "1.117.0",
2+
"apps/cowswap-frontend": "1.117.1",
33
"apps/explorer": "2.51.0",
44
"libs/permit-utils": "0.8.0",
55
"libs/widget-lib": "0.20.0",
@@ -14,7 +14,7 @@
1414
"libs/ens": "1.4.0",
1515
"libs/events": "1.7.0",
1616
"libs/snackbars": "1.1.3",
17-
"libs/tokens": "1.24.1",
17+
"libs/tokens": "1.24.2",
1818
"libs/types": "1.9.0",
1919
"libs/ui": "1.26.1",
2020
"libs/wallet": "1.14.0",

apps/cowswap-frontend/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [1.117.1](https://github.com/cowprotocol/cowswap/compare/cowswap-v1.117.0...cowswap-v1.117.1) (2025-08-14)
4+
5+
6+
### Bug Fixes
7+
8+
* **token-search:** increase results limit from 10 to 100 ([#6158](https://github.com/cowprotocol/cowswap/issues/6158)) ([b81c459](https://github.com/cowprotocol/cowswap/commit/b81c4598475a0b5097d7ff05046f41c8a3270ed8))
9+
310
## [1.117.0](https://github.com/cowprotocol/cowswap/compare/cowswap-v1.116.0...cowswap-v1.117.0) (2025-08-12)
411

512

apps/cowswap-frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cowprotocol/cowswap",
3-
"version": "1.117.0",
3+
"version": "1.117.1",
44
"description": "CoW Swap",
55
"main": "index.js",
66
"author": "",

apps/cowswap-frontend/src/common/hooks/useContract.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ import {
1717
V_COW_CONTRACT_ADDRESS,
1818
WRAPPED_NATIVE_CURRENCIES,
1919
} from '@cowprotocol/common-const'
20-
import { getContract } from '@cowprotocol/common-utils'
21-
import { isEns, isProd, isStaging } from '@cowprotocol/common-utils'
20+
import { getContract, isEns, isProd, isStaging } from '@cowprotocol/common-utils'
2221
import { COW_PROTOCOL_SETTLEMENT_CONTRACT_ADDRESS, CowEnv, SupportedChainId } from '@cowprotocol/cow-sdk'
2322
import { useWalletInfo } from '@cowprotocol/wallet'
2423
import { useWalletProvider } from '@cowprotocol/wallet-provider'
@@ -107,7 +106,9 @@ export function useWethContract(withSignerIfPossible?: boolean): UseContractResu
107106
export function useEthFlowContract(): {
108107
result: UseContractResult<CoWSwapEthFlow>
109108
} {
110-
const contractAddress = getEthFlowContractAddresses(ethFlowEnv)
109+
const { chainId } = useWalletInfo()
110+
111+
const contractAddress = getEthFlowContractAddresses(ethFlowEnv, chainId)
111112

112113
return {
113114
result: useContract<CoWSwapEthFlow>(contractAddress, CoWSwapEthFlowAbi, true),

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { ReactNode } from 'react'
2+
13
import { getChainInfo } from '@cowprotocol/common-const'
24
import { getExplorerBaseUrl } from '@cowprotocol/common-utils'
35
import { SupportedChainId } from '@cowprotocol/cow-sdk'
@@ -7,25 +9,23 @@ import { Trans } from '@lingui/macro'
79

810
import * as styledEl from './styled'
911

10-
const NEW_NETWORK_IDS = [137, 43114] // Avalanche, Polygon
12+
const NEW_NETWORK_IDS = [SupportedChainId.BNB, SupportedChainId.LENS] // BNB, Lens
1113

1214
export interface NetworksListProps {
1315
currentChainId: SupportedChainId | null
1416
isDarkMode: boolean
1517
availableChains: SupportedChainId[]
18+
1619
onSelectChain(targetChainId: SupportedChainId): void
1720
}
1821

1922
// TODO: Break down this large function into smaller functions
20-
// TODO: Add proper return type annotation
21-
// eslint-disable-next-line max-lines-per-function, @typescript-eslint/explicit-function-return-type
22-
export function NetworksList(props: NetworksListProps) {
23+
export function NetworksList(props: NetworksListProps): ReactNode {
2324
const { currentChainId, isDarkMode, availableChains, onSelectChain } = props
2425

2526
return (
2627
<>
2728
{/* TODO: Break down this large function into smaller functions */}
28-
{/* eslint-disable-next-line max-lines-per-function */}
2929
{availableChains.map((targetChainId: SupportedChainId) => {
3030
const info = getChainInfo(targetChainId)
3131
const { label, logo, bridge, explorer, explorerTitle, helpCenterUrl } = info

apps/cowswap-frontend/src/legacy/components/Header/NetworkSelector/index.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { useRef } from 'react'
1+
import { ReactNode, useRef } from 'react'
22

33
import { getChainInfo } from '@cowprotocol/common-const'
44
import { useAvailableChains } from '@cowprotocol/common-hooks'
55
import { useOnClickOutside } from '@cowprotocol/common-hooks'
66
import { useMediaQuery } from '@cowprotocol/common-hooks'
77
import { UI } from '@cowprotocol/ui'
88
import { Media } from '@cowprotocol/ui'
9-
import { useIsRabbyWallet, useIsSmartContractWallet, useWalletInfo } from '@cowprotocol/wallet'
9+
import { useIsRabbyWallet, useIsSmartContractWallet, useWalletInfo, useIsSafeViaWc } from '@cowprotocol/wallet'
1010
import { useWalletProvider } from '@cowprotocol/wallet-provider'
1111

1212
import { Trans } from '@lingui/macro'
@@ -154,17 +154,15 @@ const NetworkAlertLabel = styled.div`
154154
}
155155
`
156156

157-
// TODO: Break down this large function into smaller functions
158-
// TODO: Add proper return type annotation
159-
// eslint-disable-next-line max-lines-per-function, @typescript-eslint/explicit-function-return-type
160-
export function NetworkSelector() {
157+
export function NetworkSelector(): ReactNode {
161158
const provider = useWalletProvider()
162159
const { chainId } = useWalletInfo()
163160
const node = useRef<HTMLDivElement>(null)
164161
const nodeMobile = useRef<HTMLDivElement>(null)
165162
const isOpen = useModalIsOpen(ApplicationModal.NETWORK_SELECTOR)
166163
const toggleModal = useToggleModal(ApplicationModal.NETWORK_SELECTOR)
167164

165+
const isSafeViaWc = useIsSafeViaWc()
168166
const isSmartContractWallet = useIsSmartContractWallet()
169167
const isRabbyWallet = useIsRabbyWallet()
170168
const isChainIdUnsupported = useIsProviderNetworkUnsupported()
@@ -183,7 +181,7 @@ export function NetworkSelector() {
183181

184182
const availableChains = useAvailableChains()
185183

186-
if (!provider || (isSmartContractWallet && !isRabbyWallet)) {
184+
if (!provider || (isSmartContractWallet && !isRabbyWallet && !isSafeViaWc)) {
187185
return null
188186
}
189187

apps/cowswap-frontend/src/legacy/hooks/useWrapCallback.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useCowAnalytics } from '@cowprotocol/analytics'
2-
import { getChainCurrencySymbols, RADIX_HEX } from '@cowprotocol/common-const'
2+
import { RADIX_HEX } from '@cowprotocol/common-const'
33
import {
44
calculateGasMargin,
55
formatTokenAmount,
@@ -8,6 +8,7 @@ import {
88
isRejectRequestProviderError,
99
} from '@cowprotocol/common-utils'
1010
import { SupportedChainId } from '@cowprotocol/cow-sdk'
11+
import { getChainCurrencySymbols } from '@cowprotocol/tokens'
1112
import { Command } from '@cowprotocol/types'
1213
import { BigNumber } from '@ethersproject/bignumber'
1314
import { Contract } from '@ethersproject/contracts'
@@ -50,14 +51,12 @@ export interface WrapUnwrapContext {
5051

5152
type WrapAction = 'Send' | 'Sign' | 'Reject' | 'Error'
5253

53-
// TODO: Add proper return type annotation
54-
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
5554
function sendWrapEvent(
5655
analytics: WrapUnwrapContext['analytics'],
5756
action: WrapAction,
5857
operationMessage: string,
5958
amount: CurrencyAmount<Currency>,
60-
) {
59+
): void {
6160
analytics.sendEvent({
6261
category: CowSwapAnalyticsCategory.WRAP_NATIVE_TOKEN,
6362
action,
@@ -108,9 +107,7 @@ export async function wrapUnwrapCallback(
108107
useModals && closeModals()
109108

110109
return txResponse
111-
// TODO: Replace any with proper type definitions
112-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
113-
} catch (error: any) {
110+
} catch (error: unknown) {
114111
useModals && closeModals()
115112

116113
const isRejected = isRejectRequestProviderError(error)
@@ -197,9 +194,7 @@ async function unwrapContractCall(
197194
}
198195
}
199196

200-
// TODO: Replace any with proper type definitions
201-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
202-
function _handleGasEstimateError(error: any): BigNumber {
197+
function _handleGasEstimateError(error: unknown): BigNumber {
203198
console.log(
204199
'[useWrapCallback] Error estimating gas for wrap/unwrap. Using default gas limit ' +
205200
WRAP_UNWRAP_GAS_LIMIT_DEFAULT.toString(),

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ const ARBITRUM_ONE_START_DATE = 'May 2024'
2424
const BASE_START_DATE = 'December 2024'
2525
const POLYGON_START_DATE = 'June 2025'
2626
const AVALANCHE_START_DATE = 'June 2025'
27+
const LENS_START_DATE = 'August 2025'
28+
const BNB_START_DATE = 'September 2025' // TODO: Update when BNB is supported
2729

2830
const START_DATE: Record<SupportedChainId, string> = {
2931
[SupportedChainId.MAINNET]: DEFAULT_START_DATE,
@@ -33,6 +35,8 @@ const START_DATE: Record<SupportedChainId, string> = {
3335
[SupportedChainId.SEPOLIA]: DEFAULT_START_DATE,
3436
[SupportedChainId.POLYGON]: POLYGON_START_DATE,
3537
[SupportedChainId.AVALANCHE]: AVALANCHE_START_DATE,
38+
[SupportedChainId.LENS]: LENS_START_DATE,
39+
[SupportedChainId.BNB]: BNB_START_DATE,
3640
}
3741

3842
// TODO: Break down this large function into smaller functions

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

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -156,24 +156,20 @@ export function AccountDetails({
156156
<AccountGroupingRow>
157157
<AccountControl>
158158
<WalletSecondaryActions>
159-
{!isInjectedMobileBrowser && (
160-
<>
161-
{account && !isChainIdUnsupported && (
162-
<AddressLink
163-
hasENS={!!ENSName}
164-
isENS={!!ENSName}
165-
href={getEtherscanLink(chainId, 'address', ENSName ? ENSName : account)}
166-
>
167-
{explorerLabel}
168-
</AddressLink>
169-
)}
170-
171-
{standaloneMode !== false && connectionType !== ConnectionType.GNOSIS_SAFE && (
172-
<WalletAction onClick={handleDisconnectClick}>
173-
<Trans>Disconnect</Trans>
174-
</WalletAction>
175-
)}
176-
</>
159+
{!isInjectedMobileBrowser && account && !isChainIdUnsupported && (
160+
<AddressLink
161+
hasENS={!!ENSName}
162+
isENS={!!ENSName}
163+
href={getEtherscanLink(chainId, 'address', ENSName ? ENSName : account)}
164+
>
165+
{explorerLabel}
166+
</AddressLink>
167+
)}
168+
169+
{standaloneMode !== false && connectionType !== ConnectionType.GNOSIS_SAFE && (
170+
<WalletAction onClick={handleDisconnectClick}>
171+
<Trans>Disconnect</Trans>
172+
</WalletAction>
177173
)}
178174
</WalletSecondaryActions>
179175
</AccountControl>

0 commit comments

Comments
 (0)