Skip to content

Commit cefdb55

Browse files
authored
fix: add safe apps fee in Base network (#5161)
1 parent fa7a5f5 commit cefdb55

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

apps/cowswap-frontend/src/modules/volumeFee/state/safeAppFeeAtom.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import { atom } from 'jotai'
22

33
import { STABLECOINS } from '@cowprotocol/common-const'
4-
import { getCurrencyAddress } from '@cowprotocol/common-utils'
5-
import { OrderKind, SupportedChainId } from '@cowprotocol/cow-sdk'
4+
import { getCurrencyAddress, isInjectedWidget } from '@cowprotocol/common-utils'
5+
import { OrderKind } from '@cowprotocol/cow-sdk'
66
import { walletDetailsAtom, walletInfoAtom } from '@cowprotocol/wallet'
77

8-
import { featureFlagsAtom } from '../../../common/state/featureFlagsState'
9-
import { derivedTradeStateAtom } from '../../trade'
8+
import { derivedTradeStateAtom } from 'modules/trade'
9+
10+
import { featureFlagsAtom } from 'common/state/featureFlagsState'
11+
1012
import { VolumeFee } from '../types'
1113

1214
const SAFE_FEE_RECIPIENT = '0x63695Eee2c3141BDE314C5a6f89B98E62808d716'
@@ -39,9 +41,8 @@ export const safeAppFeeAtom = atom<VolumeFee | null>((get) => {
3941
const { isSafeAppFeeEnabled } = get(featureFlagsAtom)
4042
const { inputCurrency, outputCurrency, inputCurrencyFiatAmount, outputCurrencyFiatAmount, orderKind } =
4143
get(derivedTradeStateAtom) || {}
42-
const isBaseNetwork = chainId === SupportedChainId.BASE
4344

44-
if (!isSafeApp || !isSafeAppFeeEnabled || isBaseNetwork) return null
45+
if (!isSafeApp || !isSafeAppFeeEnabled || isInjectedWidget()) return null
4546

4647
const fiatCurrencyValue = orderKind === OrderKind.SELL ? inputCurrencyFiatAmount : outputCurrencyFiatAmount
4748
const fiatAmount = fiatCurrencyValue ? +fiatCurrencyValue.toExact() : null

0 commit comments

Comments
 (0)