diff --git a/packages/checkout/widgets-lib/src/lib/squid/config.ts b/packages/checkout/widgets-lib/src/lib/squid/config.ts index 75339de528..601045be9d 100644 --- a/packages/checkout/widgets-lib/src/lib/squid/config.ts +++ b/packages/checkout/widgets-lib/src/lib/squid/config.ts @@ -1,3 +1,17 @@ export const SQUID_SDK_BASE_URL = 'https://apiplus.squidrouter.com'; export const SQUID_NATIVE_TOKEN = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'; + +export const APPROVE_TXN_ANIMATION = '/access_coins.riv'; + +export const EXECUTE_TXN_ANIMATION = '/swapping_coins.riv'; + +export const BLOCK_TXN_ANIMATION = '/blocked.riv'; + +export const ERROR_TXN_ANIMATION = '/error.riv'; + +export const TOOLKIT_SQUID_URL = 'https://toolkit.immutable.com/squid-bridge/'; + +export const FIXED_HANDOVER_DURATION = 2000; + +export const TOKEN_PRIORITY_ORDER = ['IMX', 'USDC', 'ETH']; diff --git a/packages/checkout/widgets-lib/src/lib/squid/hooks/useError.tsx b/packages/checkout/widgets-lib/src/lib/squid/hooks/useError.tsx index d99523dd4a..136ff8e267 100644 --- a/packages/checkout/widgets-lib/src/lib/squid/hooks/useError.tsx +++ b/packages/checkout/widgets-lib/src/lib/squid/hooks/useError.tsx @@ -5,7 +5,6 @@ import { AddTokensErrorTypes } from '../../../widgets/add-tokens/types'; import { useHandover } from '../../hooks/useHandover'; import { HandoverTarget } from '../../../context/handover-context/HandoverContext'; import { getRemoteRive } from '../../utils'; -import { APPROVE_TXN_ANIMATION } from '../../../widgets/add-tokens/utils/config'; import { HandoverContent } from '../../../components/Handover/HandoverContent'; import { sendAddTokensCloseEvent } from '../../../widgets/add-tokens/AddTokensWidgetEvents'; import { EventTargetContext } from '../../../context/event-target-context/EventTargetContext'; @@ -19,6 +18,7 @@ import { UserJourney, } from '../../../context/analytics-provider/SegmentAnalyticsProvider'; import { RiveStateMachineInput } from '../../../types/HandoverTypes'; +import { APPROVE_TXN_ANIMATION } from '../config'; interface ErrorConfig { headingText: string; diff --git a/packages/checkout/widgets-lib/src/widgets/add-tokens/components/TokenDrawerMenu.tsx b/packages/checkout/widgets-lib/src/widgets/add-tokens/components/TokenDrawerMenu.tsx index f3616c1ce6..d7590a30a5 100644 --- a/packages/checkout/widgets-lib/src/widgets/add-tokens/components/TokenDrawerMenu.tsx +++ b/packages/checkout/widgets-lib/src/widgets/add-tokens/components/TokenDrawerMenu.tsx @@ -39,8 +39,8 @@ import { import { getL2ChainId } from '../../../lib'; import { AddTokensErrorTypes } from '../types'; import { TokenImage } from '../../../components/TokenImage/TokenImage'; -import { TOKEN_PRIORITY_ORDER } from '../utils/config'; import { PULSE_SHADOW } from '../utils/animation'; +import { TOKEN_PRIORITY_ORDER } from '../../../lib/squid/config'; export interface TokenDrawerMenuProps { checkout: Checkout; diff --git a/packages/checkout/widgets-lib/src/widgets/add-tokens/utils/config.ts b/packages/checkout/widgets-lib/src/widgets/add-tokens/utils/config.ts deleted file mode 100644 index ed3c268bd4..0000000000 --- a/packages/checkout/widgets-lib/src/widgets/add-tokens/utils/config.ts +++ /dev/null @@ -1,13 +0,0 @@ -export const FIXED_HANDOVER_DURATION = 2000; - -export const APPROVE_TXN_ANIMATION = '/access_coins.riv'; - -export const EXECUTE_TXN_ANIMATION = '/swapping_coins.riv'; - -export const BLOCK_TXN_ANIMATION = '/blocked.riv'; - -export const ERROR_TXN_ANIMATION = '/error.riv'; - -export const TOKEN_PRIORITY_ORDER = ['IMX', 'USDC', 'ETH']; - -export const TOOLKIT_SQUID_URL = 'https://toolkit.immutable.com/squid-bridge/'; diff --git a/packages/checkout/widgets-lib/src/widgets/add-tokens/views/AddTokens.tsx b/packages/checkout/widgets-lib/src/widgets/add-tokens/views/AddTokens.tsx index fd6e3313a9..2e4f2876e1 100644 --- a/packages/checkout/widgets-lib/src/widgets/add-tokens/views/AddTokens.tsx +++ b/packages/checkout/widgets-lib/src/widgets/add-tokens/views/AddTokens.tsx @@ -65,10 +65,9 @@ import { SquidFooter } from '../../../lib/squid/components/SquidFooter'; import { TokenDrawerMenu } from '../components/TokenDrawerMenu'; import { PULSE_SHADOW } from '../utils/animation'; import { RouteData } from '../../../lib/squid/types'; -import { SQUID_NATIVE_TOKEN } from '../../../lib/squid/config'; +import { SQUID_NATIVE_TOKEN, TOOLKIT_SQUID_URL } from '../../../lib/squid/config'; import { identifyUser } from '../../../lib/analytics/identifyUser'; import { NotEnoughGasDrawer } from '../../../components/NotEnoughGasDrawer/NotEnoughGasDrawer'; -import { TOOLKIT_SQUID_URL } from '../utils/config'; import { SelectedWallet } from '../../../components/SelectedWallet/SelectedWallet'; import { RouteOptionsDrawer } from '../../../components/RouteOptionsDrawer/RouteOptionsDrawer'; import { SelectedRouteOption } from '../../../components/SelectedRouteOption/SelectedRouteOption'; diff --git a/packages/checkout/widgets-lib/src/widgets/add-tokens/views/Review.tsx b/packages/checkout/widgets-lib/src/widgets/add-tokens/views/Review.tsx index 0f9e4d610e..dc6b90ebc2 100644 --- a/packages/checkout/widgets-lib/src/widgets/add-tokens/views/Review.tsx +++ b/packages/checkout/widgets-lib/src/widgets/add-tokens/views/Review.tsx @@ -46,12 +46,7 @@ import { useHandover } from '../../../lib/hooks/useHandover'; import { HandoverTarget } from '../../../context/handover-context/HandoverContext'; import { HandoverContent } from '../../../components/Handover/HandoverContent'; import { getRemoteRive } from '../../../lib/utils'; -import { - APPROVE_TXN_ANIMATION, - EXECUTE_TXN_ANIMATION, - FIXED_HANDOVER_DURATION, - TOOLKIT_SQUID_URL, -} from '../utils/config'; + import { useAnalytics, UserJourney, @@ -70,7 +65,9 @@ import { import { EventTargetContext } from '../../../context/event-target-context/EventTargetContext'; import { convertToNetworkChangeableProvider } from '../../../functions/convertToNetworkChangeableProvider'; import { AmountData } from '../../../lib/squid/types'; -import { SQUID_NATIVE_TOKEN } from '../../../lib/squid/config'; +import { + APPROVE_TXN_ANIMATION, EXECUTE_TXN_ANIMATION, FIXED_HANDOVER_DURATION, SQUID_NATIVE_TOKEN, TOOLKIT_SQUID_URL, +} from '../../../lib/squid/config'; import { AddressMissmatchDrawer } from '../../../components/AddressMismatchDrawer/AddressMissmatchDrawer'; import { RouteFees } from '../../../components/RouteFees/RouteFees'; import { getDurationFormatted } from '../../../functions/getDurationFormatted';