Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CHORE]: Remove Swaps V1 Dead Code #6181

Merged
merged 41 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
4d106b6
start on ripping out old swaps
walmat Oct 4, 2024
9de2d27
Update package.json
walmat Oct 9, 2024
bc0159c
clean up lint
walmat Oct 9, 2024
6817341
add pbx?
walmat Oct 9, 2024
1d6ab62
tslint is a liar
walmat Oct 10, 2024
942dc2b
fixed it
walmat Oct 10, 2024
5092fc2
add a few components back that are used in the expanded asset sheet
walmat Oct 10, 2024
82baa34
rm graph
walmat Oct 10, 2024
f16b2d3
chore: merge
walmat Oct 15, 2024
46b8d32
chore: merge
walmat Oct 16, 2024
e503b17
revert changes to pbx
walmat Oct 16, 2024
1cc9d12
chore: merge
walmat Oct 22, 2024
85bf5ff
Swaps v2 cleanup duplicates / unused utils (#6202)
walmat Oct 22, 2024
dbe91b6
reorder worklets
walmat Oct 22, 2024
c377f2e
remove getCrosschainSwapServiceTime from handlers/swap
walmat Oct 23, 2024
be8186a
remove ExchangeSearch
walmat Oct 23, 2024
41cc71b
remove unused NetworkSwitcher components
walmat Oct 23, 2024
d64be4e
rename useFeePanelInputRefs to useFeesPanelInputRefs
walmat Oct 23, 2024
fba8322
remove swapSearch and walletFilter
walmat Oct 23, 2024
ae8749d
delete unused useMinRefuelAmount hook
walmat Oct 23, 2024
797f5c9
delete unused exchangeModalTypes file
walmat Oct 23, 2024
5602a66
remove unused selectUserAssetsListByChainId selector
walmat Oct 23, 2024
2c11496
chore: merge
walmat Oct 23, 2024
22e0632
change getAddressAndChainIdFromUniqueId to work for both networks and…
walmat Oct 23, 2024
6905dce
remove duplicate buildLocalizedTimeUnitString util
walmat Oct 23, 2024
39db307
remove duplicate buildLocalizedTimeUnitString util
walmat Oct 23, 2024
7849a83
remove TokenSelectionButton
walmat Oct 23, 2024
0332f32
remove SendFab
walmat Oct 23, 2024
039345f
replace a couple accessors to native assets that could be sync
walmat Oct 24, 2024
190d962
chore: merge
walmat Oct 24, 2024
4a2ec01
remove unused fromChainId from useSearchCurrencyList
walmat Oct 25, 2024
67a7776
remove unused isCrosschainSearch from useSearchCurrencyList
walmat Oct 25, 2024
2b5468b
bring back navigation hook that prevents readOnly wallets from naviga…
walmat Oct 25, 2024
2d835f3
clean up crossChainServiceTime and remove traces
walmat Oct 25, 2024
664b42a
Merge branch 'develop' into feat/remove-swaps-v1
walmat Oct 25, 2024
95c19a0
add swaps v2 comment
walmat Oct 25, 2024
5f05caf
Merge branch 'develop' into feat/remove-swaps-v1
walmat Oct 28, 2024
32e48d9
chore: merge
walmat Oct 28, 2024
12880ea
fix initial asset missing on expanded state navigation (#6240)
walmat Oct 28, 2024
12635e4
fix gas button stuck on loading (#6241)
walmat Oct 30, 2024
4094a69
move unused vars to swaps util
walmat Oct 30, 2024
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
4 changes: 0 additions & 4 deletions src/__swaps__/screens/Swap/components/AnimatedBlurView.tsx

This file was deleted.

8 changes: 4 additions & 4 deletions src/__swaps__/screens/Swap/components/EstimatedSwapGasFee.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { SharedValue, useAnimatedStyle, useDerivedValue, withRepeat, withSequenc
import { opacity } from '@/__swaps__/utils/swaps';
import { TIMING_CONFIGS } from '@/components/animations/animationConfigs';
import { useDelayedValue } from '@/hooks/reanimated/useDelayedValue';
import { pulsingConfig, sliderConfig } from '../constants';
import { GasSettings } from '../hooks/useCustomGas';
import { useSwapEstimatedGasFee } from '../hooks/useEstimatedGasFee';
import { useSwapContext } from '../providers/swap-provider';
import { pulsingConfig, sliderConfig } from '@/__swaps__/screens/Swap/constants';
import { GasSettings } from '@/__swaps__/screens/Swap/hooks/useCustomGas';
import { useSwapEstimatedGasFee } from '@/__swaps__/screens/Swap/hooks/useEstimatedGasFee';
import { useSwapContext } from '@/__swaps__/screens/Swap/providers/swap-provider';

type EstimatedSwapGasFeeProps = { gasSettings?: GasSettings } & Partial<
Pick<TextProps, 'align' | 'color' | 'size' | 'weight' | 'tabularNumbers'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { AddressZero } from '@ethersproject/constants';
import { ETH_ADDRESS } from '@/references';
import { DEVICE_WIDTH } from '@/utils/deviceUtils';
import { GestureHandlerButton } from './GestureHandlerButton';
import { convertAmountToNativeDisplayWorklet } from '@/__swaps__/utils/numbers';
import { convertAmountToNativeDisplayWorklet } from '@/helpers/utilities';
import { useAccountSettings } from '@/hooks';

export const ExchangeRateBubble = () => {
Expand Down
6 changes: 3 additions & 3 deletions src/__swaps__/screens/Swap/components/FlipButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Bleed, Box, IconContainer, Text, globalColors, useColorMode } from '@/d
import { SEPARATOR_COLOR } from '@/__swaps__/screens/Swap/constants';
import { getColorValueForThemeWorklet, opacity } from '@/__swaps__/utils/swaps';
import { IS_ANDROID, IS_IOS } from '@/env';
import { AnimatedBlurView } from '@/__swaps__/screens/Swap/components/AnimatedBlurView';
import { AnimatedBlurView } from '@/components/AnimatedComponents/AnimatedBlurView';
import { useSwapContext } from '@/__swaps__/screens/Swap/providers/swap-provider';
import { TIMING_CONFIGS } from '@/components/animations/animationConfigs';
import { SwapAssetType } from '@/__swaps__/types/swap';
Expand Down Expand Up @@ -90,7 +90,7 @@ export const FlipButton = () => {
return {
shadowColor: isDarkMode
? globalColors.grey100
: getColorValueForThemeWorklet(internalSelectedOutputAsset.value?.mixedShadowColor, false, true),
: getColorValueForThemeWorklet(internalSelectedOutputAsset.value?.mixedShadowColor, false),
};
});

Expand Down Expand Up @@ -162,7 +162,7 @@ const SpinnerComponent = () => {

const animatedColor = useDerivedValue(() => {
return withTiming(
getColorValueForThemeWorklet(internalSelectedOutputAsset.value?.highContrastColor, isDarkMode, true),
getColorValueForThemeWorklet(internalSelectedOutputAsset.value?.highContrastColor, isDarkMode),
TIMING_CONFIGS.slowFadeConfig
);
});
Expand Down
6 changes: 3 additions & 3 deletions src/__swaps__/screens/Swap/components/GasButton.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { GasSpeed } from '@/__swaps__/types/gas';
import { weiToGwei } from '@/__swaps__/utils/ethereum';
import { weiToGwei } from '@/parsers';
import { getCachedCurrentBaseFee, useMeteorologySuggestions } from '@/__swaps__/utils/meteorology';
import { add, formatNumber } from '@/__swaps__/utils/numbers';
import { add, formatNumber } from '@/helpers/utilities';
import { getColorValueForThemeWorklet } from '@/__swaps__/utils/swaps';
import { ButtonPressAnimation } from '@/components/animations';
import { ContextMenu } from '@/components/context-menu';
Expand Down Expand Up @@ -211,7 +211,7 @@ export function ReviewGasButton() {

const animatedBorderColor = useAnimatedStyle(() => {
return {
borderColor: getColorValueForThemeWorklet(internalSelectedOutputAsset.value?.highContrastColor, isDarkMode, true),
borderColor: getColorValueForThemeWorklet(internalSelectedOutputAsset.value?.highContrastColor, isDarkMode),
};
});

Expand Down
5 changes: 2 additions & 3 deletions src/__swaps__/screens/Swap/components/GasPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { MIN_FLASHBOTS_PRIORITY_FEE, THICK_BORDER_WIDTH } from '@/__swaps__/scre
import { NavigationSteps, useSwapContext } from '@/__swaps__/screens/Swap/providers/swap-provider';
import { ChainId } from '@/chains/types';
import { GasSpeed } from '@/__swaps__/types/gas';
import { gweiToWei, weiToGwei } from '@/__swaps__/utils/ethereum';
import { gweiToWei, weiToGwei } from '@/parsers';
import {
getCachedCurrentBaseFee,
getSelectedSpeedSuggestion,
Expand All @@ -16,13 +16,12 @@ import {
useMeteorologySuggestion,
useMeteorologySuggestions,
} from '@/__swaps__/utils/meteorology';
import { add, formatNumber, greaterThan, multiply, subtract } from '@/__swaps__/utils/numbers';
import { add, greaterThan, multiply, subtract, lessThan, formatNumber } from '@/helpers/utilities';
import { opacity } from '@/__swaps__/utils/swaps';
import { ButtonPressAnimation } from '@/components/animations';
import { SPRING_CONFIGS } from '@/components/animations/animationConfigs';
import { Bleed, Box, Inline, Separator, Stack, Text, globalColors, useColorMode, useForegroundColor } from '@/design-system';
import { IS_ANDROID } from '@/env';
import { lessThan } from '@/helpers/utilities';
import { useNavigation } from '@/navigation';
import Routes from '@/navigation/routesNames';
import { createRainbowStore } from '@/state/internal/createRainbowStore';
Expand Down
13 changes: 3 additions & 10 deletions src/__swaps__/screens/Swap/components/ReviewPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@ import { AnimatedChainImage } from '@/__swaps__/screens/Swap/components/Animated
import { ReviewGasButton } from '@/__swaps__/screens/Swap/components/GasButton';
import { GestureHandlerButton } from '@/__swaps__/screens/Swap/components/GestureHandlerButton';
import { useEstimatedTime } from '@/__swaps__/utils/meteorology';
import {
convertRawAmountToBalance,
convertRawAmountToBalanceWorklet,
handleSignificantDecimals,
multiply,
} from '@/__swaps__/utils/numbers';
import { convertRawAmountToBalance, convertRawAmountToBalanceWorklet, handleSignificantDecimals, multiply } from '@/helpers/utilities';
import { opacity } from '@/__swaps__/utils/swaps';
import { ButtonPressAnimation } from '@/components/animations';
import { SPRING_CONFIGS } from '@/components/animations/animationConfigs';
Expand All @@ -29,7 +24,6 @@ import * as i18n from '@/languages';
import { useNavigation } from '@/navigation';
import Routes from '@/navigation/routesNames';
import { swapsStore, useSwapsStore } from '@/state/swaps/swapsStore';
import { getNativeAssetForNetwork } from '@/utils/ethereumUtils';
import { CrosschainQuote, Quote, QuoteError } from '@rainbow-me/swaps';
import React, { useCallback } from 'react';
import { StyleSheet, View } from 'react-native';
Expand All @@ -48,7 +42,7 @@ import { NavigationSteps, useSwapContext } from '../providers/swap-provider';
import { AnimatedSwitch } from './AnimatedSwitch';
import { EstimatedSwapGasFee, EstimatedSwapGasFeeSlot } from './EstimatedSwapGasFee';
import { UnmountOnAnimatedReaction } from './UnmountOnAnimatedReaction';
import { chainsLabel } from '@/chains';
import { chainsLabel, chainsNativeAsset } from '@/chains';
import { ChainId } from '@/chains/types';

const UNKNOWN_LABEL = i18n.t(i18n.l.swap.unknown);
Expand Down Expand Up @@ -354,8 +348,7 @@ export function ReviewPanel() {
});

const openGasExplainer = useCallback(async () => {
const nativeAsset = await getNativeAssetForNetwork({ chainId: swapsStore.getState().inputAsset?.chainId ?? ChainId.mainnet });

const nativeAsset = chainsNativeAsset[swapsStore.getState().inputAsset?.chainId ?? ChainId.mainnet];
navigate(Routes.EXPLAIN_SHEET, {
chainId: swapsStore.getState().inputAsset?.chainId ?? ChainId.mainnet,
type: 'gas',
Expand Down
10 changes: 4 additions & 6 deletions src/__swaps__/screens/Swap/components/SwapActionButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function SwapButton({
});

const secondaryTextStyles = useAnimatedStyle(() => {
const secondaryColor = getColorValueForThemeWorklet(asset.value?.textColor, isDarkMode, true);
const secondaryColor = getColorValueForThemeWorklet(asset.value?.textColor, isDarkMode);

let opacity = isDarkMode ? 0.76 : 0.8;
if (secondaryColor === globalColors.grey100) {
Expand All @@ -75,9 +75,7 @@ function SwapButton({

const buttonWrapperStyles = useAnimatedStyle(() => {
return {
backgroundColor: outline
? 'transparent'
: getColorValueForThemeWorklet(asset.value?.highContrastColor, isDarkMode, true) || fallbackColor,
backgroundColor: outline ? 'transparent' : getColorValueForThemeWorklet(asset.value?.highContrastColor, isDarkMode) || fallbackColor,
borderColor: outline ? separatorSecondary : undefined,
borderRadius: borderRadius ?? 24,
height: small ? 36 : 48,
Expand Down Expand Up @@ -169,7 +167,7 @@ const HoldProgress = ({ holdProgress }: { holdProgress: SharedValue<number> }) =
const { internalSelectedOutputAsset } = useSwapContext();

const [brightenedColor, setBrightenedColor] = useState<string>(
transformColor(getColorValueForThemeWorklet(internalSelectedOutputAsset.value?.highContrastColor, isDarkMode, true), false)
transformColor(getColorValueForThemeWorklet(internalSelectedOutputAsset.value?.highContrastColor, isDarkMode), false)
);

const holdProgressStyle = useAnimatedStyle(() => {
Expand All @@ -192,7 +190,7 @@ const HoldProgress = ({ holdProgress }: { holdProgress: SharedValue<number> }) =
() => internalSelectedOutputAsset.value?.highContrastColor,
(current, previous) => {
if (current && current !== previous) {
runOnJS(transformColor)(getColorValueForThemeWorklet(current, isDarkMode, true));
runOnJS(transformColor)(getColorValueForThemeWorklet(current, isDarkMode));
}
},
[]
Expand Down
8 changes: 4 additions & 4 deletions src/__swaps__/screens/Swap/components/SwapBackground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ export const SwapBackground = () => {
const { internalSelectedInputAsset, internalSelectedOutputAsset } = useSwapContext();

const animatedTopColor = useDerivedValue(() => {
if (IS_TEST) return getColorValueForThemeWorklet(DEFAULT_BACKGROUND_COLOR, isDarkMode, true);
if (IS_TEST) return getColorValueForThemeWorklet(DEFAULT_BACKGROUND_COLOR, isDarkMode);
return withTiming(
getColorValueForThemeWorklet(internalSelectedInputAsset.value?.tintedBackgroundColor || DEFAULT_BACKGROUND_COLOR, isDarkMode, true),
getColorValueForThemeWorklet(internalSelectedInputAsset.value?.tintedBackgroundColor || DEFAULT_BACKGROUND_COLOR, isDarkMode),
TIMING_CONFIGS.slowFadeConfig
);
});

const animatedBottomColor = useDerivedValue(() => {
if (IS_TEST) return getColorValueForThemeWorklet(DEFAULT_BACKGROUND_COLOR, isDarkMode, true);
if (IS_TEST) return getColorValueForThemeWorklet(DEFAULT_BACKGROUND_COLOR, isDarkMode);
return withTiming(
getColorValueForThemeWorklet(internalSelectedOutputAsset.value?.tintedBackgroundColor || DEFAULT_BACKGROUND_COLOR, isDarkMode, true),
getColorValueForThemeWorklet(internalSelectedOutputAsset.value?.tintedBackgroundColor || DEFAULT_BACKGROUND_COLOR, isDarkMode),
TIMING_CONFIGS.slowFadeConfig
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const SwapCoinIconTextFallback = ({ asset, height, width, style }: SwapCo

const backgroundColor = useAnimatedStyle(() => {
return {
backgroundColor: getColorValueForThemeWorklet(asset.value?.color, isDarkMode, true),
backgroundColor: getColorValueForThemeWorklet(asset.value?.color, isDarkMode),
};
});

Expand All @@ -61,7 +61,7 @@ export const SwapCoinIconTextFallback = ({ asset, height, width, style }: SwapCo
const animatedFontSize = useAnimatedStyle(() => {
return {
fontSize: buildFallbackFontSize(formattedSymbol.value, width),
color: getColorValueForThemeWorklet(asset.value?.textColor, isDarkMode, true),
color: getColorValueForThemeWorklet(asset.value?.textColor, isDarkMode),
};
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import { StyleSheet } from 'react-native';
import Animated, { Easing, SharedValue, useAnimatedStyle, withRepeat, withSequence, withTiming } from 'react-native-reanimated';
import { SLIDER_COLLAPSED_HEIGHT, SLIDER_HEIGHT, caretConfig } from '@/__swaps__/screens/Swap/constants';
import { equalWorklet } from '@/__swaps__/safe-math/SafeMath';
import { equalWorklet } from '@/safe-math/SafeMath';
import { NavigationSteps } from '@/__swaps__/screens/Swap/hooks/useSwapNavigation';
import { useSwapContext } from '@/__swaps__/screens/Swap/providers/swap-provider';
import { inputKeys } from '@/__swaps__/types/swap';
Expand Down Expand Up @@ -65,7 +65,7 @@ export function SwapInputValuesCaret({ inputCaretType, disabled }: { inputCaretT
const selectedAsset =
inputCaretType === 'inputAmount' || inputCaretType === 'inputNativeValue' ? internalSelectedInputAsset : internalSelectedOutputAsset;
return {
backgroundColor: getColorValueForThemeWorklet(selectedAsset.value?.highContrastColor, isDarkMode, true),
backgroundColor: getColorValueForThemeWorklet(selectedAsset.value?.highContrastColor, isDarkMode),
};
});

Expand Down
2 changes: 1 addition & 1 deletion src/__swaps__/screens/Swap/components/SwapNativeInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Animated, { runOnJS, useAnimatedStyle, useDerivedValue } from 'react-nati
import { SwapInputValuesCaret } from '@/__swaps__/screens/Swap/components/SwapInputValuesCaret';
import { GestureHandlerButton } from '@/__swaps__/screens/Swap/components/GestureHandlerButton';
import { useSwapContext } from '@/__swaps__/screens/Swap/providers/swap-provider';
import { equalWorklet } from '@/__swaps__/safe-math/SafeMath';
import { equalWorklet } from '@/safe-math/SafeMath';

export function SwapNativeInput({
nativeInputType,
Expand Down
2 changes: 1 addition & 1 deletion src/__swaps__/screens/Swap/components/SwapNumberPad.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Animated, {
} from 'react-native-reanimated';
import { supportedNativeCurrencies } from '@/references';
import { Bleed, Box, Columns, HitSlop, Separator, Text, useColorMode, useForegroundColor } from '@/design-system';
import { equalWorklet } from '@/__swaps__/safe-math/SafeMath';
import { equalWorklet } from '@/safe-math/SafeMath';
import { stripNonDecimalNumbers } from '@/__swaps__/utils/swaps';
import {
CUSTOM_KEYBOARD_HEIGHT,
Expand Down
14 changes: 7 additions & 7 deletions src/__swaps__/screens/Swap/components/SwapSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { SPRING_CONFIGS, TIMING_CONFIGS } from '@/components/animations/animatio
import { AnimatedText, Bleed, Box, Column, Columns, Inline, globalColors, useColorMode, useForegroundColor } from '@/design-system';
import { IS_IOS } from '@/env';
import { triggerHapticFeedback } from '@/screens/points/constants';
import { greaterThanWorklet } from '@/__swaps__/safe-math/SafeMath';
import { greaterThanWorklet } from '@/safe-math/SafeMath';
import {
SCRUBBER_WIDTH,
SLIDER_COLLAPSED_HEIGHT,
Expand Down Expand Up @@ -90,18 +90,18 @@ export const SwapSlider = ({
const colors = useDerivedValue(() => ({
inactiveColorLeft: opacityWorklet(
dualColor
? getColorValueForThemeWorklet(internalSelectedOutputAsset.value?.highContrastColor, isDarkMode, true)
: getColorValueForThemeWorklet(internalSelectedInputAsset.value?.highContrastColor, isDarkMode, true),
? getColorValueForThemeWorklet(internalSelectedOutputAsset.value?.highContrastColor, isDarkMode)
: getColorValueForThemeWorklet(internalSelectedInputAsset.value?.highContrastColor, isDarkMode),
0.9
),
activeColorLeft: dualColor
? getColorValueForThemeWorklet(internalSelectedOutputAsset.value?.highContrastColor, isDarkMode, true)
: getColorValueForThemeWorklet(internalSelectedInputAsset.value?.highContrastColor, isDarkMode, true),
? getColorValueForThemeWorklet(internalSelectedOutputAsset.value?.highContrastColor, isDarkMode)
: getColorValueForThemeWorklet(internalSelectedInputAsset.value?.highContrastColor, isDarkMode),
inactiveColorRight: dualColor
? opacityWorklet(getColorValueForThemeWorklet(internalSelectedInputAsset.value?.highContrastColor, isDarkMode, true), 0.9)
? opacityWorklet(getColorValueForThemeWorklet(internalSelectedInputAsset.value?.highContrastColor, isDarkMode), 0.9)
: separatorSecondary,
activeColorRight: dualColor
? getColorValueForThemeWorklet(internalSelectedInputAsset.value?.highContrastColor, isDarkMode, true)
? getColorValueForThemeWorklet(internalSelectedInputAsset.value?.highContrastColor, isDarkMode)
: fillSecondary,
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { ChainId } from '@/chains/types';
import { SearchAsset } from '@/__swaps__/types/search';
import { SwapAssetType } from '@/__swaps__/types/swap';
import { parseSearchAsset } from '@/__swaps__/utils/assets';
import { getChainColorWorklet, getStandardizedUniqueIdWorklet } from '@/__swaps__/utils/swaps';
import { getChainColorWorklet } from '@/__swaps__/utils/swaps';
import { getUniqueId } from '@/utils/ethereumUtils';
import { analyticsV2 } from '@/analytics';
import { AnimatedTextIcon } from '@/components/AnimatedComponents/AnimatedTextIcon';
import { TIMING_CONFIGS } from '@/components/animations/animationConfigs';
Expand Down Expand Up @@ -99,10 +100,7 @@ export const TokenToBuyList = () => {
const handleSelectToken = useCallback(
(token: SearchAsset) => {
runOnUI(() => {
if (
internalSelectedInputAsset.value &&
getStandardizedUniqueIdWorklet({ address: token.address, chainId: token.chainId }) !== internalSelectedOutputAsset.value?.uniqueId
) {
if (internalSelectedInputAsset.value && getUniqueId(token.address, token.chainId) !== internalSelectedOutputAsset.value?.uniqueId) {
isQuoteStale.value = 1;
isFetching.value = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ListEmpty } from '@/__swaps__/screens/Swap/components/TokenList/ListEmp
import { useSwapContext } from '@/__swaps__/screens/Swap/providers/swap-provider';
import { ParsedSearchAsset } from '@/__swaps__/types/assets';
import { SwapAssetType } from '@/__swaps__/types/swap';
import { getStandardizedUniqueIdWorklet } from '@/__swaps__/utils/swaps';
import { getUniqueId } from '@/utils/ethereumUtils';
import { analyticsV2 } from '@/analytics';
import { useDelayedMount } from '@/hooks/useDelayedMount';
import * as i18n from '@/languages';
Expand Down Expand Up @@ -45,10 +45,7 @@ const TokenToSellListComponent = () => {
if (!token) return;

runOnUI(() => {
if (
internalSelectedOutputAsset.value &&
getStandardizedUniqueIdWorklet({ address: token.address, chainId: token.chainId }) !== internalSelectedInputAsset.value?.uniqueId
) {
if (internalSelectedOutputAsset.value && getUniqueId(token.address, token.chainId) !== internalSelectedInputAsset.value?.uniqueId) {
isQuoteStale.value = 1;
isFetching.value = true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/__swaps__/screens/Swap/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { gweiToWei } from '@/__swaps__/utils/ethereum';
import { gweiToWei } from '@/parsers';
import { getDefaultKeyboardHeight } from '@/redux/keyboardHeight';
import { deviceUtils, safeAreaInsetValues } from '@/utils';
import { Easing, WithSpringConfig, WithTimingConfig } from 'react-native-reanimated';
Expand Down
Loading
Loading