Skip to content
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions apps/cowswap-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@cowprotocol/common-utils": "workspace:*",
"@cowprotocol/core": "workspace:*",
"@cowprotocol/cow-runner-game": "https://registry.npmjs.org/@cowprotocol/cow-runner-game/-/cow-runner-game-0.2.9.tgz",
"@cowprotocol/cow-sdk": "9.1.5",
"@cowprotocol/cow-sdk": "9.2.0",
"@cowprotocol/cowswap-abis": "workspace:*",
"@cowprotocol/currency": "workspace:*",
"@cowprotocol/ens": "workspace:*",
Expand All @@ -49,12 +49,12 @@
"@cowprotocol/iframe-transport": "workspace:*",
"@cowprotocol/multicall": "workspace:*",
"@cowprotocol/permit-utils": "workspace:*",
"@cowprotocol/sdk-bridging": "4.1.3",
"@cowprotocol/sdk-contracts-ts": "3.1.2",
"@cowprotocol/sdk-cow-shed": "0.3.13",
"@cowprotocol/sdk-order-book": "3.2.2",
"@cowprotocol/sdk-trading": "2.1.2",
"@cowprotocol/sdk-viem-adapter": "0.3.23",
"@cowprotocol/sdk-bridging": "4.2.0",
"@cowprotocol/sdk-contracts-ts": "3.2.0",
"@cowprotocol/sdk-cow-shed": "0.4.0",
"@cowprotocol/sdk-order-book": "4.0.0",
"@cowprotocol/sdk-trading": "2.2.0",
"@cowprotocol/sdk-viem-adapter": "0.3.24",
"@cowprotocol/snackbars": "workspace:*",
"@cowprotocol/tokens": "workspace:*",
"@cowprotocol/types": "workspace:*",
Expand Down
8 changes: 4 additions & 4 deletions apps/cowswap-frontend/src/locales/en-US.po
Original file line number Diff line number Diff line change
Expand Up @@ -3211,8 +3211,8 @@ msgid "Rewards will be sent on Ethereum to"
msgstr "Rewards will be sent on Ethereum to"

#: apps/cowswap-frontend/src/modules/tradeFormValidation/pure/QuoteApiErrorButton.pure.tsx
msgid "Bridging without swapping is not yet supported. Let us know if you want this feature!"
msgstr "Bridging without swapping is not yet supported. Let us know if you want this feature!"
#~ msgid "Bridging without swapping is not yet supported. Let us know if you want this feature!"
#~ msgstr "Bridging without swapping is not yet supported. Let us know if you want this feature!"

#: apps/cowswap-frontend/src/modules/affiliate/containers/AffiliateTraderCodeInfo.tsx
msgid "Rewards end"
Expand Down Expand Up @@ -7185,8 +7185,8 @@ msgid "Advanced"
msgstr "Advanced"

#: apps/cowswap-frontend/src/modules/tradeFormValidation/pure/QuoteApiErrorButton.pure.tsx
msgid "Not yet supported"
msgstr "Not yet supported"
#~ msgid "Not yet supported"
#~ msgstr "Not yet supported"

#: apps/cowswap-frontend/src/modules/affiliate/pure/AffiliateTraderModal/AffiliateTradeCodeForm.tsx
#: apps/cowswap-frontend/src/modules/hooksStore/pure/HookListItem/index.tsx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ export function HooksStoreWidget(): ReactNode {
return (
<>
<TradeWidgetWrapper visible$={!hideSwapWidget}>
{/*TODO: sell=buy feature. Add allowSwapSameToken attribute again when feature is ready */}
<SwapWidget topContent={TopContent} bottomContent={BottomContent} />
<SwapWidget topContent={TopContent} bottomContent={BottomContent} allowSwapSameToken />
</TradeWidgetWrapper>
<IframeDappsManifestUpdater />
{isHookSelectionOpen && (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
import { ReactNode } from 'react'

import { BridgeQuoteErrors } from '@cowprotocol/sdk-bridging'
import { HelpTooltip } from '@cowprotocol/ui'

import { t } from '@lingui/core/macro'

import { QuoteApiError, QuoteApiErrorCodes, UNHANDLED_ERROR_CODE } from 'api/cowProtocol/errors/QuoteError'

import {
getBridgeQuoteErrorTexts,
getDefaultQuoteError,
getQuoteErrorTexts,
} from './QuoteErrorsButton/quoteErrors.utils'
import { getDefaultQuoteError, getQuoteErrorTexts } from './QuoteErrorsButton/quoteErrors.utils'
import { TradeFormBlankButton } from './TradeFormBlankButton'
import { UnsupportedTokenButton } from './UnsupportedTokenButton.pure'

Expand All @@ -26,19 +19,6 @@ export function QuoteApiErrorButton(props: TradeFormButtonContext): ReactNode {

const quoteErrorTexts = getQuoteErrorTexts()

{
/*TODO: sell=buy feature. Remove all SameBuyAndSellToken usages once feature is ready */
}
const quoteErrorTextsForBridges: Partial<Record<QuoteApiErrorCodes, string>> = {
[QuoteApiErrorCodes.SameBuyAndSellToken]: t`Not yet supported`,
}

const errorTooltipContentForBridges: Partial<Record<QuoteApiErrorCodes, string>> = {
[QuoteApiErrorCodes.SameBuyAndSellToken]: t`Bridging without swapping is not yet supported. Let us know if you want this feature!`,
}

const bridgeQuoteErrorTexts = getBridgeQuoteErrorTexts()

const errorType = quote.error.type
const errorDescription = quote.error.description

Expand All @@ -54,33 +34,9 @@ export function QuoteApiErrorButton(props: TradeFormButtonContext): ReactNode {
)
}

const isBridge = quote.isBridgeQuote
const errorText = (() => {
const quoteErrorText = quoteErrorTexts[errorType]
const bridgeQuoteErrorText = quoteErrorTextsForBridges[errorType]

if (isBridge && bridgeQuoteErrorText) {
// Do not display "Not yet supported" when sell and intermediate tokens are the same
// Because user doesn't see intermediate token
if (errorType === QuoteApiErrorCodes.SameBuyAndSellToken) {
const areSwapAssetsDifferent =
props.derivedState.inputCurrency?.symbol?.toLowerCase() !==
props.derivedState.outputCurrency?.symbol?.toLowerCase()

if (areSwapAssetsDifferent) {
return bridgeQuoteErrorTexts[BridgeQuoteErrors.NO_ROUTES]
}
}

return bridgeQuoteErrorText
}

return quoteErrorText ?? DEFAULT_ERROR_TEXT
})()
const errorText = quoteErrorTexts[errorType] ?? DEFAULT_ERROR_TEXT

const errorTooltipText =
(isBridge ? errorTooltipContentForBridges[errorType] : null) ??
(errorText === DEFAULT_ERROR_TEXT ? errorDescription : null)
const errorTooltipText = errorText === DEFAULT_ERROR_TEXT ? errorDescription : null

return (
<TradeFormBlankButton disabled>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ export async function fetchAndProcessQuote(
quoteSigner: isBridge ? getBridgeQuoteSigner(chainId) : undefined,
getSlippageSuggestion: useSuggestedSlippageApi ? coWBFFClient.getSlippageTolerance.bind(coWBFFClient) : undefined,
getCorrelatedTokens,
// TODO: sell=buy feature. Set allowIntermediateEqSellToken: true once the feature is ready
// allowIntermediateEqSellToken: true
allowIntermediateEqSellToken: true,
}

const processQuoteError = (errorLocation: string, error: unknown): void => {
Expand Down
10 changes: 5 additions & 5 deletions apps/explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
"@cowprotocol/common-hooks": "workspace:*",
"@cowprotocol/common-utils": "workspace:*",
"@cowprotocol/core": "workspace:*",
"@cowprotocol/cow-sdk": "9.1.5",
"@cowprotocol/cow-sdk": "9.2.0",
"@cowprotocol/hook-dapp-lib": "workspace:*",
"@cowprotocol/sdk-bridging": "4.1.3",
"@cowprotocol/sdk-contracts-ts": "3.1.2",
"@cowprotocol/sdk-subgraph": "1.1.2",
"@cowprotocol/sdk-viem-adapter": "0.3.23",
"@cowprotocol/sdk-bridging": "4.2.0",
"@cowprotocol/sdk-contracts-ts": "3.2.0",
"@cowprotocol/sdk-subgraph": "1.2.0",
"@cowprotocol/sdk-viem-adapter": "0.3.24",
"@cowprotocol/types": "workspace:*",
"@cowprotocol/ui": "workspace:*",
"@fortawesome/fontawesome-svg-core": "6.7.2",
Expand Down
6 changes: 3 additions & 3 deletions apps/sdk-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
},
"dependencies": {
"@cowprotocol/common-const": "workspace:*",
"@cowprotocol/cow-sdk": "9.1.5",
"@cowprotocol/sdk-composable": "1.0.6",
"@cowprotocol/sdk-viem-adapter": "0.3.23",
"@cowprotocol/cow-sdk": "9.2.0",
"@cowprotocol/sdk-composable": "1.1.0",
"@cowprotocol/sdk-viem-adapter": "0.3.24",
"@cowprotocol/wallet": "workspace:*",
"viem": "2.48.8",
"wagmi": "3.6.9",
Expand Down
2 changes: 1 addition & 1 deletion apps/widget-configurator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@cowprotocol/common-const": "workspace:*",
"@cowprotocol/common-hooks": "workspace:*",
"@cowprotocol/common-utils": "workspace:*",
"@cowprotocol/cow-sdk": "9.1.5",
"@cowprotocol/cow-sdk": "9.2.0",
"@cowprotocol/events": "workspace:*",
"@cowprotocol/types": "workspace:*",
"@cowprotocol/widget-lib": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion libs/analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}
},
"dependencies": {
"@cowprotocol/cow-sdk": "9.1.5",
"@cowprotocol/cow-sdk": "9.2.0",
"@cowprotocol/common-const": "workspace:*",
"@cowprotocol/common-hooks": "workspace:*",
"@cowprotocol/common-utils": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion libs/balances-and-allowances/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}
},
"dependencies": {
"@cowprotocol/cow-sdk": "9.1.5",
"@cowprotocol/cow-sdk": "9.2.0",
"@cowprotocol/common-const": "workspace:*",
"@cowprotocol/common-hooks": "workspace:*",
"@cowprotocol/common-utils": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion libs/common-const/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}
},
"dependencies": {
"@cowprotocol/cow-sdk": "9.1.5",
"@cowprotocol/cow-sdk": "9.2.0",
"viem": "2.48.8",
"@cowprotocol/types": "workspace:*",
"@lingui/core": "5.5.1",
Expand Down
2 changes: 1 addition & 1 deletion libs/common-hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}
},
"dependencies": {
"@cowprotocol/cow-sdk": "9.1.5",
"@cowprotocol/cow-sdk": "9.2.0",
"@cowprotocol/common-const": "workspace:*",
"@cowprotocol/common-utils": "workspace:*",
"@cowprotocol/types": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion libs/common-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}
},
"dependencies": {
"@cowprotocol/cow-sdk": "9.1.5",
"@cowprotocol/cow-sdk": "9.2.0",
"@cowprotocol/common-const": "workspace:*",
"@cowprotocol/types": "workspace:*",
"@lingui/core": "5.5.1",
Expand Down
2 changes: 1 addition & 1 deletion libs/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}
},
"dependencies": {
"@cowprotocol/cow-sdk": "9.1.5",
"@cowprotocol/cow-sdk": "9.2.0",
"@cowprotocol/cms": "https://registry.npmjs.org/@cowprotocol/cms/-/cms-0.11.0.tgz",
"@cowprotocol/common-const": "workspace:*",
"@safe-global/api-kit": "4.0.1",
Expand Down
2 changes: 1 addition & 1 deletion libs/currency/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}
},
"dependencies": {
"@cowprotocol/cow-sdk": "9.1.5",
"@cowprotocol/cow-sdk": "9.2.0",
"jsbi": "3.2.5"
}
}
2 changes: 1 addition & 1 deletion libs/ens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}
},
"dependencies": {
"@cowprotocol/cow-sdk": "9.1.5",
"@cowprotocol/cow-sdk": "9.2.0",
"@cowprotocol/common-const": "workspace:*",
"@cowprotocol/common-utils": "workspace:*",
"@cowprotocol/cowswap-abis": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions libs/events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
}
},
"dependencies": {
"@cowprotocol/cow-sdk": "9.1.5",
"@cowprotocol/sdk-bridging": "4.1.3",
"@cowprotocol/cow-sdk": "9.2.0",
"@cowprotocol/sdk-bridging": "4.2.0",
"@cowprotocol/types": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion libs/multicall/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}
},
"dependencies": {
"@cowprotocol/cow-sdk": "9.1.5",
"@cowprotocol/cow-sdk": "9.2.0",
"@cowprotocol/common-const": "workspace:*",
"@cowprotocol/cowswap-abis": "workspace:*",
"@cowprotocol/types": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion libs/permit-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}
},
"dependencies": {
"@cowprotocol/cow-sdk": "9.1.5",
"@cowprotocol/cow-sdk": "9.2.0",
"@1inch/permit-signed-approvals-utils": "1.5.2",
"@cowprotocol/hook-dapp-lib": "workspace:*",
"ms.macro": "2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion libs/tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}
},
"dependencies": {
"@cowprotocol/cow-sdk": "9.1.5",
"@cowprotocol/cow-sdk": "9.2.0",
"@cowprotocol/common-const": "workspace:*",
"@cowprotocol/common-hooks": "workspace:*",
"@cowprotocol/common-utils": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions libs/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
}
},
"dependencies": {
"@cowprotocol/cow-sdk": "9.1.5",
"@cowprotocol/sdk-bridging": "4.1.3",
"@cowprotocol/cow-sdk": "9.2.0",
"@cowprotocol/sdk-bridging": "4.2.0",
Comment thread
coderabbitai[bot] marked this conversation as resolved.
"@cowprotocol/currency": "workspace:*",
"eventemitter3": "4.0.7"
}
Expand Down
2 changes: 1 addition & 1 deletion libs/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@cowprotocol/common-hooks": "workspace:*",
"@cowprotocol/common-utils": "workspace:*",
"@cowprotocol/core": "workspace:*",
"@cowprotocol/cow-sdk": "9.1.5",
"@cowprotocol/cow-sdk": "9.2.0",
"@cowprotocol/currency": "workspace:*",
"@cowprotocol/types": "workspace:*",
"@cowprotocol/ui-utils": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion libs/wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@cowprotocol/common-hooks": "workspace:*",
"@cowprotocol/common-utils": "workspace:*",
"@cowprotocol/core": "workspace:*",
"@cowprotocol/cow-sdk": "9.1.5",
"@cowprotocol/cow-sdk": "9.2.0",
"@cowprotocol/currency": "workspace:*",
"@cowprotocol/ens": "workspace:*",
"@cowprotocol/iframe-transport": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion libs/widget-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}
},
"dependencies": {
"@cowprotocol/cow-sdk": "9.1.5",
"@cowprotocol/cow-sdk": "9.2.0",
"@cowprotocol/events": "workspace:*",
"@cowprotocol/iframe-transport": "workspace:*"
}
Expand Down
Loading
Loading