Skip to content

Commit

Permalink
Merge pull request #3654 from cowprotocol/release/15.01.2024-1
Browse files Browse the repository at this point in the history
Release main
  • Loading branch information
shoom3301 authored Jan 15, 2024
2 parents 3239364 + baa4df9 commit 174b311
Show file tree
Hide file tree
Showing 17 changed files with 52 additions and 107 deletions.
8 changes: 4 additions & 4 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -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"
}
28 changes: 0 additions & 28 deletions apps/cowswap-frontend/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)


Expand Down
2 changes: 1 addition & 1 deletion apps/cowswap-frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cowprotocol/cowswap",
"version": "1.55.0",
"version": "1.54.2",
"description": "CoW Swap",
"main": "index.js",
"author": "",
Expand Down
Original file line number Diff line number Diff line change
@@ -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 = (
<Trans>
Please connect your wallet to one of our supported networks:
<br />
{ALL_SUPPORTED_CHAIN_IDS.map((chainId) => getChainInfo(chainId)?.label)
.filter(Boolean)
.join(', ')}
</Trans>
)
import { useUnsupportedNetworksText } from '../../hooks/useUnsupportedNetworksText'

const Wrapper = styled.div`
position: fixed;
Expand All @@ -43,6 +32,7 @@ const StyledAlertCircle = styled(AlertCircle)`

export function WalletUnsupportedNetworkBanner() {
const isChainIdUnsupported = useIsProviderNetworkUnsupported()
const unsupportedNetworksText = useUnsupportedNetworksText()

return (
<>
Expand All @@ -51,7 +41,7 @@ export function WalletUnsupportedNetworkBanner() {
<div>
<StyledAlertCircle size={24} />
</div>
<div>{UNSUPPORTED_WALLET_TEXT}</div>
<div>{unsupportedNetworksText}</div>
</Wrapper>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
@@ -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 (
<Trans>
Please connect your wallet to one of our supported networks:
<br />
{allNetworks
.map((chainId) => getChainInfo(chainId)?.label)
.filter(Boolean)
.join(', ')}
</Trans>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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'

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -246,7 +248,7 @@ export function AccountDetails({
</InfoCard>

{isChainIdUnsupported ? (
<UnsupportedWalletBox>{UNSUPPORTED_WALLET_TEXT}</UnsupportedWalletBox>
<UnsupportedWalletBox>{unsupportedNetworksText}</UnsupportedWalletBox>
) : (
<>
<SurplusCard />
Expand Down
16 changes: 0 additions & 16 deletions apps/explorer/CHANGELOG.md

This file was deleted.

2 changes: 1 addition & 1 deletion apps/explorer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cowprotocol/explorer",
"version": "2.27.0",
"version": "2.26.0",
"description": "CoW Swap Explorer",
"main": "src/main.tsx",
"author": "",
Expand Down
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
13 changes: 0 additions & 13 deletions libs/permit-utils/CHANGELOG.md

This file was deleted.

2 changes: 1 addition & 1 deletion libs/permit-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cowprotocol/permit-utils",
"version": "0.1.0",
"version": "0.0.2",
"type": "module",
"dependencies": {
"ethers": "^5.7.2",
Expand Down
4 changes: 3 additions & 1 deletion libs/tokens/src/state/tokens/favouriteTokensAtom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Record<SupportedChainId, TokensMap>>(
'favouriteTokensAtom:v1',
DEFAULT_FAVOURITE_TOKENS
DEFAULT_FAVOURITE_TOKENS,
getJotaiMergerStorage()
)

export const favouriteTokensListAtom = atom((get) => {
Expand Down
14 changes: 5 additions & 9 deletions libs/tokens/src/updaters/WidgetTokensListsUpdater/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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])
Expand All @@ -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)

Expand All @@ -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)

Expand Down Expand Up @@ -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) => {
Expand Down
9 changes: 0 additions & 9 deletions libs/widget-lib/CHANGELOG.md

This file was deleted.

2 changes: 1 addition & 1 deletion libs/widget-lib/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 2 additions & 6 deletions libs/widget-lib/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import type { SupportedChainId } from '@cowprotocol/cow-sdk'

export interface TokenList {
url: string
}

export interface JsonRpcRequest {
id: number
method: string
Expand Down Expand Up @@ -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).
*/
Expand Down

0 comments on commit 174b311

Please sign in to comment.