diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1ea01b3a4f..dcaadb95bd 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,7 +1,7 @@ { - "apps/cowswap-frontend": "1.55.0", - "apps/explorer": "2.27.0", - "libs/permit-utils": "0.1.0", - "libs/widget-lib": "0.3.0", + "apps/cowswap-frontend": "1.54.2", + "apps/explorer": "2.26.0", + "libs/permit-utils": "0.0.2", + "libs/widget-lib": "0.2.1", "libs/widget-react": "0.2.3" } diff --git a/apps/cowswap-frontend/CHANGELOG.md b/apps/cowswap-frontend/CHANGELOG.md index b4098470d2..e49a640479 100644 --- a/apps/cowswap-frontend/CHANGELOG.md +++ b/apps/cowswap-frontend/CHANGELOG.md @@ -1,33 +1,5 @@ # Changelog -## [1.55.0](https://github.com/cowprotocol/cowswap/compare/cowswap-v1.54.2...cowswap-v1.55.0) (2024-01-15) - - -### Features - -* **explorer:** update project and migrate to vite ([#3579](https://github.com/cowprotocol/cowswap/issues/3579)) ([3056162](https://github.com/cowprotocol/cowswap/commit/30561629f872612e85d64757004d9400f1600781)) -* **fee=0:** classify order types ([#3559](https://github.com/cowprotocol/cowswap/issues/3559)) ([a2f8def](https://github.com/cowprotocol/cowswap/commit/a2f8def2f203301885e4548b49f73336abbabe21)) -* **limit:** max limit order deadline ([#3567](https://github.com/cowprotocol/cowswap/issues/3567)) ([1428596](https://github.com/cowprotocol/cowswap/commit/1428596de28027ea36edbb8a912e7d27750b70d3)) -* **networks:** support Sepolia ([#3558](https://github.com/cowprotocol/cowswap/issues/3558)) ([ab8b179](https://github.com/cowprotocol/cowswap/commit/ab8b1794fb60da851f3fccdd861ebef4b18df30e)) -* sell eth warning for limit/twap ([#3573](https://github.com/cowprotocol/cowswap/issues/3573)) ([ff14c4b](https://github.com/cowprotocol/cowswap/commit/ff14c4b40a4b356a11b4b746d3240c2660dc0060)) -* **surplus:** update surplus percentage calculation ([#3548](https://github.com/cowprotocol/cowswap/issues/3548)) ([3d6dc3d](https://github.com/cowprotocol/cowswap/commit/3d6dc3da1927b9debcbb0458991f18a90c749ca8)) -* **twap:** unlimited twap deadline ([#3568](https://github.com/cowprotocol/cowswap/issues/3568)) ([378977c](https://github.com/cowprotocol/cowswap/commit/378977cf0a4d71f165d968d5b665ad6bb524ba67)) -* update docs/learn.cow.fi URLs ([#3611](https://github.com/cowprotocol/cowswap/issues/3611)) ([af0ff6b](https://github.com/cowprotocol/cowswap/commit/af0ff6b71de422e43aab987287f780d26a17ac73)) -* **widget:** custom token lists in widget ([#3390](https://github.com/cowprotocol/cowswap/issues/3390)) ([7eabe06](https://github.com/cowprotocol/cowswap/commit/7eabe06d043703718d742809791eda555dff5058)) - - -### Bug Fixes - -* disable Christmas theme ([#3582](https://github.com/cowprotocol/cowswap/issues/3582)) ([94643fb](https://github.com/cowprotocol/cowswap/commit/94643fb3ca77aea37b772d823cc48665b441eeaa)) -* display cow token logo in header ([#3608](https://github.com/cowprotocol/cowswap/issues/3608)) ([f374960](https://github.com/cowprotocol/cowswap/commit/f3749601f0105f815ca32d744bb68568be3f7f84)) -* don't crash when permittable tokens atom doesn't contain new network ([#3603](https://github.com/cowprotocol/cowswap/issues/3603)) ([ac517e8](https://github.com/cowprotocol/cowswap/commit/ac517e8656e6c0a42d3b3e4eb25318d5bc4c69db)) -* **limit:** show price impact warning for Safe App when bundling ([#3571](https://github.com/cowprotocol/cowswap/issues/3571)) ([98a11e7](https://github.com/cowprotocol/cowswap/commit/98a11e7f9d41442db9c2ced08430813afce85572)) -* merge localStorage state with initial state to prevent empty states ([#3604](https://github.com/cowprotocol/cowswap/issues/3604)) ([9cd4bf5](https://github.com/cowprotocol/cowswap/commit/9cd4bf53807e307c213c547c762907b71bb5b343)) -* **permit:** report wrong permit to sentry for limit and swap flows ([#3565](https://github.com/cowprotocol/cowswap/issues/3565)) ([7067919](https://github.com/cowprotocol/cowswap/commit/706791978ca2e3412ceb33b5a1ff1ed878dd7f84)) -* **swap:** disable eth flow selling on buy orders ([#3574](https://github.com/cowprotocol/cowswap/issues/3574)) ([17f484b](https://github.com/cowprotocol/cowswap/commit/17f484b4162f0a25f655b49902cf4a33b468db33)) -* **swap:** fix swap out of market ([#3576](https://github.com/cowprotocol/cowswap/issues/3576)) ([878e99f](https://github.com/cowprotocol/cowswap/commit/878e99f1cb0079c37ff5b163f31fd1dda578f6c9)) -* **token-search:** fix token search results ([#3607](https://github.com/cowprotocol/cowswap/issues/3607)) ([955d93f](https://github.com/cowprotocol/cowswap/commit/955d93fd2fce614ff6eb85b358f72ba6c77a1f51)) - ## [1.54.2](https://github.com/cowprotocol/cowswap/compare/v1.54.1...v1.54.2) (2024-01-08) diff --git a/apps/cowswap-frontend/package.json b/apps/cowswap-frontend/package.json index 21be7ebe8a..395fa75e80 100644 --- a/apps/cowswap-frontend/package.json +++ b/apps/cowswap-frontend/package.json @@ -1,6 +1,6 @@ { "name": "@cowprotocol/cowswap", - "version": "1.55.0", + "version": "1.54.2", "description": "CoW Swap", "main": "index.js", "author": "", diff --git a/apps/cowswap-frontend/src/common/containers/WalletUnsupportedNetworkBanner/index.tsx b/apps/cowswap-frontend/src/common/containers/WalletUnsupportedNetworkBanner/index.tsx index e9806127cf..1e4ec70561 100644 --- a/apps/cowswap-frontend/src/common/containers/WalletUnsupportedNetworkBanner/index.tsx +++ b/apps/cowswap-frontend/src/common/containers/WalletUnsupportedNetworkBanner/index.tsx @@ -1,22 +1,11 @@ -import { getChainInfo } from '@cowprotocol/common-const' -import { ALL_SUPPORTED_CHAIN_IDS } from '@cowprotocol/cow-sdk' import { UI } from '@cowprotocol/ui' -import { Trans } from '@lingui/macro' import { AlertCircle } from 'react-feather' import styled from 'styled-components/macro' import { useIsProviderNetworkUnsupported } from 'common/hooks/useIsProviderNetworkUnsupported' -export const UNSUPPORTED_WALLET_TEXT = ( - - Please connect your wallet to one of our supported networks: -
- {ALL_SUPPORTED_CHAIN_IDS.map((chainId) => getChainInfo(chainId)?.label) - .filter(Boolean) - .join(', ')} -
-) +import { useUnsupportedNetworksText } from '../../hooks/useUnsupportedNetworksText' const Wrapper = styled.div` position: fixed; @@ -43,6 +32,7 @@ const StyledAlertCircle = styled(AlertCircle)` export function WalletUnsupportedNetworkBanner() { const isChainIdUnsupported = useIsProviderNetworkUnsupported() + const unsupportedNetworksText = useUnsupportedNetworksText() return ( <> @@ -51,7 +41,7 @@ export function WalletUnsupportedNetworkBanner() {
-
{UNSUPPORTED_WALLET_TEXT}
+
{unsupportedNetworksText}
)} diff --git a/apps/cowswap-frontend/src/common/hooks/useUnsupportedNetworksText.tsx b/apps/cowswap-frontend/src/common/hooks/useUnsupportedNetworksText.tsx new file mode 100644 index 0000000000..be1d15addc --- /dev/null +++ b/apps/cowswap-frontend/src/common/hooks/useUnsupportedNetworksText.tsx @@ -0,0 +1,25 @@ +import { getChainInfo } from '@cowprotocol/common-const' +import { ALL_SUPPORTED_CHAIN_IDS, SupportedChainId } from '@cowprotocol/cow-sdk' + +import { Trans } from '@lingui/macro' + +import { useFeatureFlags } from './featureFlags/useFeatureFlags' + +export function useUnsupportedNetworksText(): JSX.Element { + const { isSepoliaEnabled } = useFeatureFlags() + + const allNetworks = isSepoliaEnabled + ? ALL_SUPPORTED_CHAIN_IDS + : ALL_SUPPORTED_CHAIN_IDS.filter((id) => id !== SupportedChainId.SEPOLIA) + + return ( + + Please connect your wallet to one of our supported networks: +
+ {allNetworks + .map((chainId) => getChainInfo(chainId)?.label) + .filter(Boolean) + .join(', ')} +
+ ) +} diff --git a/apps/cowswap-frontend/src/modules/account/containers/AccountDetails/index.tsx b/apps/cowswap-frontend/src/modules/account/containers/AccountDetails/index.tsx index 0c653be3b0..dcab58f672 100644 --- a/apps/cowswap-frontend/src/modules/account/containers/AccountDetails/index.tsx +++ b/apps/cowswap-frontend/src/modules/account/containers/AccountDetails/index.tsx @@ -38,7 +38,6 @@ import { import Activity from 'modules/account/containers/Transaction' -import { UNSUPPORTED_WALLET_TEXT } from 'common/containers/WalletUnsupportedNetworkBanner' import { useIsProviderNetworkUnsupported } from 'common/hooks/useIsProviderNetworkUnsupported' import { @@ -63,6 +62,7 @@ import { } from './styled' import { SurplusCard } from './SurplusCard' +import { useUnsupportedNetworksText } from '../../../../common/hooks/useUnsupportedNetworksText' import { useDisconnectWallet } from '../../hooks/useDisconnectWallet' import { CreationDateText } from '../Transaction/styled' @@ -158,6 +158,8 @@ export function AccountDetails({ const connection = useMemo(() => getWeb3ReactConnection(connector), [connector]) const isInjectedMobileBrowser = (isMetaMask || isCoinbaseWallet) && isMobile + const unsupportedNetworksText = useUnsupportedNetworksText() + function formatConnectorName() { const name = walletDetails?.walletName || getConnectionName(connection.type, getIsMetaMask()) // In case the wallet is connected via WalletConnect and has wallet name set, add the suffix to be clear @@ -246,7 +248,7 @@ export function AccountDetails({ {isChainIdUnsupported ? ( - {UNSUPPORTED_WALLET_TEXT} + {unsupportedNetworksText} ) : ( <> diff --git a/apps/explorer/CHANGELOG.md b/apps/explorer/CHANGELOG.md deleted file mode 100644 index 3c03f39438..0000000000 --- a/apps/explorer/CHANGELOG.md +++ /dev/null @@ -1,16 +0,0 @@ -# Changelog - -## [2.27.0](https://github.com/cowprotocol/cowswap/compare/explorer-v2.26.0...explorer-v2.27.0) (2024-01-15) - - -### Features - -* cleanup and minify assets ([#3609](https://github.com/cowprotocol/cowswap/issues/3609)) ([62dd797](https://github.com/cowprotocol/cowswap/commit/62dd79796047500dd10b13a53a581c68ef8fc7c1)) -* **explorer:** copy-paste files from previous repo ([#3578](https://github.com/cowprotocol/cowswap/issues/3578)) ([9561bcb](https://github.com/cowprotocol/cowswap/commit/9561bcb42dd835197e272c734691a854ef089c7b)) -* **explorer:** support Sepolia network ([#3580](https://github.com/cowprotocol/cowswap/issues/3580)) ([d744c4a](https://github.com/cowprotocol/cowswap/commit/d744c4adc595b93b55310fd5d4e57594f45d9b26)) -* **explorer:** update project and migrate to vite ([#3579](https://github.com/cowprotocol/cowswap/issues/3579)) ([3056162](https://github.com/cowprotocol/cowswap/commit/30561629f872612e85d64757004d9400f1600781)) - - -### Bug Fixes - -* **explorer:** cast string SupportedChainId to number ([#3624](https://github.com/cowprotocol/cowswap/issues/3624)) ([784ce32](https://github.com/cowprotocol/cowswap/commit/784ce32bcfa7908999f3130357582602f02802a5)) diff --git a/apps/explorer/package.json b/apps/explorer/package.json index 3e70e8f743..86c09713aa 100644 --- a/apps/explorer/package.json +++ b/apps/explorer/package.json @@ -1,6 +1,6 @@ { "name": "@cowprotocol/explorer", - "version": "2.27.0", + "version": "2.26.0", "description": "CoW Swap Explorer", "main": "src/main.tsx", "author": "", diff --git a/apps/explorer/src/components/layout/GenericLayout/Footer/config.ts b/apps/explorer/src/components/layout/GenericLayout/Footer/config.ts index 479fdd0f42..6c26f62ed1 100644 --- a/apps/explorer/src/components/layout/GenericLayout/Footer/config.ts +++ b/apps/explorer/src/components/layout/GenericLayout/Footer/config.ts @@ -1,7 +1,7 @@ export const footerConfig = { isBeta: false, url: { - web: 'https://github.com/cowprotocol/explorer/tree/v', + web: 'https://github.com/cowprotocol/cowswap/releases/tag/explorer-v', // TODO: Pending to move and adapt the wiki appId: null, // appId: 'https://github.com/gnosis/gp-v1-ui/wiki/App-Ids-for-Forks', diff --git a/apps/widget-configurator/src/app/configurator/hooks/useWidgetParamsAndSettings.ts b/apps/widget-configurator/src/app/configurator/hooks/useWidgetParamsAndSettings.ts index 3f51ef3a2a..814e460a7d 100644 --- a/apps/widget-configurator/src/app/configurator/hooks/useWidgetParamsAndSettings.ts +++ b/apps/widget-configurator/src/app/configurator/hooks/useWidgetParamsAndSettings.ts @@ -44,7 +44,7 @@ export function useWidgetParamsAndSettings( height: '640px', provider, chainId, - tokenLists: tokenLists.filter((list) => list.enabled).map((list) => ({ url: list.url })), + tokenLists: tokenLists.filter((list) => list.enabled).map((list) => list.url), env: getEnv(), tradeType: currentTradeType, sell: { asset: sellToken, amount: sellTokenAmount ? sellTokenAmount.toString() : undefined }, diff --git a/libs/permit-utils/CHANGELOG.md b/libs/permit-utils/CHANGELOG.md deleted file mode 100644 index 8b4e42f048..0000000000 --- a/libs/permit-utils/CHANGELOG.md +++ /dev/null @@ -1,13 +0,0 @@ -# Changelog - -## [0.1.0](https://github.com/cowprotocol/cowswap/compare/permit-utils-v0.0.2...permit-utils-v0.1.0) (2024-01-15) - - -### Features - -* **networks:** support Sepolia ([#3558](https://github.com/cowprotocol/cowswap/issues/3558)) ([ab8b179](https://github.com/cowprotocol/cowswap/commit/ab8b1794fb60da851f3fccdd861ebef4b18df30e)) - - -### Bug Fixes - -* **permit:** replace permit signer used for quoting ([#3562](https://github.com/cowprotocol/cowswap/issues/3562)) ([907d908](https://github.com/cowprotocol/cowswap/commit/907d90825643a5ad5824ed4ff5d24a9227f96f71)) diff --git a/libs/permit-utils/package.json b/libs/permit-utils/package.json index a4a2925d3a..3f4303b106 100644 --- a/libs/permit-utils/package.json +++ b/libs/permit-utils/package.json @@ -1,6 +1,6 @@ { "name": "@cowprotocol/permit-utils", - "version": "0.1.0", + "version": "0.0.2", "type": "module", "dependencies": { "ethers": "^5.7.2", diff --git a/libs/tokens/src/state/tokens/favouriteTokensAtom.ts b/libs/tokens/src/state/tokens/favouriteTokensAtom.ts index cc8f926f67..d5c4b478f1 100644 --- a/libs/tokens/src/state/tokens/favouriteTokensAtom.ts +++ b/libs/tokens/src/state/tokens/favouriteTokensAtom.ts @@ -6,10 +6,12 @@ import { TokensMap } from '../../types' import { environmentAtom } from '../environmentAtom' import { TokenWithLogo } from '@cowprotocol/common-const' import { DEFAULT_FAVOURITE_TOKENS } from '../../const/defaultFavouriteTokens' +import { getJotaiMergerStorage } from '@cowprotocol/core' export const favouriteTokensAtom = atomWithStorage>( 'favouriteTokensAtom:v1', - DEFAULT_FAVOURITE_TOKENS + DEFAULT_FAVOURITE_TOKENS, + getJotaiMergerStorage() ) export const favouriteTokensListAtom = atom((get) => { diff --git a/libs/tokens/src/updaters/WidgetTokensListsUpdater/index.tsx b/libs/tokens/src/updaters/WidgetTokensListsUpdater/index.tsx index 6248fc99e4..e64a124a28 100644 --- a/libs/tokens/src/updaters/WidgetTokensListsUpdater/index.tsx +++ b/libs/tokens/src/updaters/WidgetTokensListsUpdater/index.tsx @@ -10,12 +10,8 @@ import { useSetAtom } from 'jotai' import { useRemoveList } from '../../hooks/lists/useRemoveList' import { getFulfilledResults } from '../TokensListsUpdater/helpers' -interface TokenList { - url: string -} - export interface CustomTokensListsUpdaterProps { - tokenLists?: TokenList[] + tokenLists?: string[] appCode?: string } @@ -33,7 +29,7 @@ export function WidgetTokensListsUpdater(props: CustomTokensListsUpdaterProps) { const setEnvironment = useSetAtom(updateEnvironmentAtom) useEffect(() => { - const selectedLists = tokenLists ? { selectedLists: tokenLists.map((list) => list.url.toLowerCase()) } : undefined + const selectedLists = tokenLists ? { selectedLists: tokenLists.map((list) => list.toLowerCase()) } : undefined setEnvironment({ widgetAppCode: appCode, ...selectedLists }) }, [setEnvironment, appCode, tokenLists]) @@ -43,7 +39,7 @@ export function WidgetTokensListsUpdater(props: CustomTokensListsUpdaterProps) { if (!tokenLists?.length) return undefined return tokenLists.filter((list) => { - const listUrl = list.url.toLowerCase() + const listUrl = list.toLowerCase() const listExists = allTokensLists.find((list) => list.source.toLowerCase() === listUrl) @@ -57,7 +53,7 @@ export function WidgetTokensListsUpdater(props: CustomTokensListsUpdaterProps) { if (!listsToImport) return null return Promise.allSettled( - listsToImport.map(({ url }) => { + listsToImport.map((url) => { return fetchTokenList({ source: url }).catch((error) => { console.error('Failed to fetch token list: ' + url, error) @@ -87,7 +83,7 @@ export function WidgetTokensListsUpdater(props: CustomTokensListsUpdaterProps) { useEffect(() => { if (!appCode || !tokenLists?.length) return - const enabledTokenListsUrls = tokenLists.map((list) => list.url.toLowerCase()) + const enabledTokenListsUrls = tokenLists.map((list) => list.toLowerCase()) // Find all lists that are added for this widget and are not in the provided token lists const listsToRemove = allTokensLists.filter((list) => { diff --git a/libs/widget-lib/CHANGELOG.md b/libs/widget-lib/CHANGELOG.md deleted file mode 100644 index 59457e338c..0000000000 --- a/libs/widget-lib/CHANGELOG.md +++ /dev/null @@ -1,9 +0,0 @@ -# Changelog - -## [0.3.0](https://github.com/cowprotocol/cowswap/compare/widget-lib-v0.2.1...widget-lib-v0.3.0) (2024-01-15) - - -### Features - -* update docs/learn.cow.fi URLs ([#3611](https://github.com/cowprotocol/cowswap/issues/3611)) ([af0ff6b](https://github.com/cowprotocol/cowswap/commit/af0ff6b71de422e43aab987287f780d26a17ac73)) -* **widget:** custom token lists in widget ([#3390](https://github.com/cowprotocol/cowswap/issues/3390)) ([7eabe06](https://github.com/cowprotocol/cowswap/commit/7eabe06d043703718d742809791eda555dff5058)) diff --git a/libs/widget-lib/package.json b/libs/widget-lib/package.json index e44d0c4946..5cd29df5a0 100644 --- a/libs/widget-lib/package.json +++ b/libs/widget-lib/package.json @@ -1,6 +1,6 @@ { "name": "@cowprotocol/widget-lib", - "version": "0.3.0", + "version": "0.2.1", "type": "commonjs", "description": "CoW Swap Widget Library. Allows you to easily embed a CoW Swap widget on your website.", "main": "index.js", diff --git a/libs/widget-lib/src/types.ts b/libs/widget-lib/src/types.ts index 0b2d66b29a..099e3223b8 100644 --- a/libs/widget-lib/src/types.ts +++ b/libs/widget-lib/src/types.ts @@ -1,9 +1,5 @@ import type { SupportedChainId } from '@cowprotocol/cow-sdk' -export interface TokenList { - url: string -} - export interface JsonRpcRequest { id: number method: string @@ -100,9 +96,9 @@ interface CowSwapWidgetConfig { */ chainId: SupportedChainId /** - * The token lists to use in the widget + * The token lists urls to use in the widget */ - tokenLists: TokenList[] + tokenLists: string[] /** * Swap, Limit or Advanced (Twap). */