@imtbl/sdk 1.66.1 → 1.68.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/{blockchain_data-B9T-qbph.js → blockchain_data-CCKsao-2.js} +2 -2
  2. package/dist/blockchain_data.js +3 -3
  3. package/dist/browser/checkout/{AddTokensWidget-DdZHY_JS.js → AddTokensWidget-DS4GOnbQ.js} +151 -107
  4. package/dist/browser/checkout/{BridgeWidget-CzoLGKzK.js → BridgeWidget-DNdm4P40.js} +23 -13
  5. package/dist/browser/checkout/{CommerceWidget-BGemG9RB.js → CommerceWidget-C4yziPs9.js} +17 -17
  6. package/dist/browser/checkout/{CryptoFiatProvider-BwfapqZO.js → CryptoFiatProvider-D6MFlvbF.js} +1 -1
  7. package/dist/browser/checkout/{EllipsizedText-ngVXQGn_.js → EllipsizedText-CJWQB2xz.js} +1 -1
  8. package/dist/browser/checkout/{FeesBreakdown-BpgS4Cf3.js → FeesBreakdown-CZuqljfy.js} +1 -1
  9. package/dist/browser/checkout/{HandoverContent-C0qfeRAh.js → HandoverContent-rAxG25Cv.js} +1 -1
  10. package/dist/browser/checkout/{OnRampWidget-Dx2XkuTt.js → OnRampWidget-DRayHgnD.js} +3 -3
  11. package/dist/browser/checkout/{SaleWidget-N4DUeD2I.js → SaleWidget-DztSk2UN.js} +71 -19
  12. package/dist/browser/checkout/{SpendingCapHero-BeqEPpR_.js → SpendingCapHero-BTLwIZz3.js} +1 -1
  13. package/dist/browser/checkout/{SwapWidget-DiA9c6Zu.js → SwapWidget-BUjL8E1t.js} +9 -9
  14. package/dist/browser/checkout/{retry-aLeSin3J.js → TokenImage-d3u0ZvQH.js} +15 -15
  15. package/dist/browser/checkout/{TopUpView-BBUB2cpE.js → TopUpView-XlT3otoq.js} +3 -3
  16. package/dist/browser/checkout/{WalletApproveHero-DiwEKXIx.js → WalletApproveHero-BU16nd9U.js} +3 -3
  17. package/dist/browser/checkout/{WalletWidget-BNCipG33.js → WalletWidget-BxBGnI3n.js} +4 -4
  18. package/dist/browser/checkout/{auto-track-CwlqwwA6.js → auto-track-VXPmwspo.js} +1 -1
  19. package/dist/browser/checkout/{index-DS1USgQr.js → index--CfNdaMn.js} +2 -2
  20. package/dist/browser/checkout/{index-PJGxH105.js → index-BdoW5GHq.js} +1 -1
  21. package/dist/browser/checkout/{index-bA3tzuB3.js → index-BlQEiUzF.js} +1 -1
  22. package/dist/browser/checkout/{index-R3d13MqX.js → index-BurH9x3O.js} +1 -1
  23. package/dist/browser/checkout/{index-DVVgTW38.js → index-CB9YWdxS.js} +128 -55
  24. package/dist/browser/checkout/{index-Ze29sipG.js → index-CLK98XCj.js} +1 -1
  25. package/dist/browser/checkout/{index-BdohR2SR.js → index-D4f54ZFm.js} +1 -1
  26. package/dist/browser/checkout/{index-HL3njUMr.js → index-DY-H1U96.js} +1 -1
  27. package/dist/browser/checkout/{index-lFfbeyAV.js → index-LSVL9_fH.js} +1 -1
  28. package/dist/browser/checkout/{index.umd-_yYKRbcT.js → index.umd-eURePKSp.js} +1 -1
  29. package/dist/browser/checkout/sdk.js +4 -4
  30. package/dist/browser/checkout/{useInterval-D0l_aPl9.js → useInterval-B8niXF8W.js} +1 -1
  31. package/dist/browser/checkout/widgets-esm.js +1 -1
  32. package/dist/browser/checkout/widgets.js +373 -194
  33. package/dist/{checkout-CZ8Ekr5g.js → checkout-C071Fxzs.js} +50 -19
  34. package/dist/checkout.d.ts +47 -29
  35. package/dist/checkout.js +5 -5
  36. package/dist/{config-B-S2GgWx.js → config-DHULaE6i.js} +1 -1
  37. package/dist/config.js +1 -1
  38. package/dist/{index-BqBIqxw_.js → index-BCUBql_R.js} +4 -4
  39. package/dist/{index-B8OpSizY.js → index-BcVQ_2aR.js} +1 -1
  40. package/dist/{index-Drj8RVbj.js → index-BdcecID3.js} +1 -1
  41. package/dist/{index-D9UCgdaj.js → index-C3og99BK.js} +3 -3
  42. package/dist/{index-DkQZpG9P.js → index-DCGG33Y4.js} +1 -1
  43. package/dist/{index-B0RD2JVo.js → index-Dr4o8k-B.js} +1 -1
  44. package/dist/index.browser.js +4 -4
  45. package/dist/index.browser.js.map +1 -1
  46. package/dist/index.cjs +51 -20
  47. package/dist/index.d.ts +28 -8
  48. package/dist/index.js +14 -14
  49. package/dist/{minting_backend-CbsoaB6S.js → minting_backend-D25wDjzr.js} +3 -3
  50. package/dist/minting_backend.js +5 -5
  51. package/dist/{orderbook-DctAuD-W.js → orderbook-CN5EL0vL.js} +1 -1
  52. package/dist/orderbook.js +2 -2
  53. package/dist/{passport-BOcQMNRG.js → passport-DD0zBIJH.js} +3 -3
  54. package/dist/passport.js +4 -4
  55. package/dist/{webhook-Cdi0qezX.js → webhook-a1yb-34L.js} +1 -1
  56. package/dist/webhook.js +2 -2
  57. package/dist/{x-AiomNseI.js → x-Ccm5bhWI.js} +3 -3
  58. package/dist/x.js +4 -4
  59. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import { A as APIError, B as BlockchainData } from './index-D9UCgdaj.js';
2
- import { i as index } from './index-B0RD2JVo.js';
1
+ import { A as APIError, B as BlockchainData } from './index-C3og99BK.js';
2
+ import { i as index } from './index-Dr4o8k-B.js';
3
3
 
4
4
  var blockchain_data = /*#__PURE__*/Object.freeze({
5
5
  __proto__: null,
@@ -1,6 +1,6 @@
1
- export { A as APIError, B as BlockchainData } from './index-D9UCgdaj.js';
2
- export { i as Types } from './index-B0RD2JVo.js';
3
- import './index-Drj8RVbj.js';
1
+ export { A as APIError, B as BlockchainData } from './index-C3og99BK.js';
2
+ export { i as Types } from './index-Dr4o8k-B.js';
3
+ import './index-BdcecID3.js';
4
4
  import 'axios';
5
5
  import 'lru-memorise';
6
6
  import 'global-const';
@@ -1,9 +1,9 @@
1
- import { _ as _objectWithoutProperties, w as useTheme, x as useForwardLocalDomRef, y as useGetSubcomponentChild, z as useSplitApartChildrenAndSubComponents, r as reactExports, D as merge$2, F as useResizeObserver, p as jsxs, o as jsx, G as SmartClone, H as Box, J as isChildSubcomponent, K as flattenChildren, M as Body, N as useTheme$1, Q as Icon, R as ButtCon, T as Button, U as _defineProperty, X as isDualVariantIcon, Y as _slicedToArray, Z as isNumberWithinTotal, $ as getStartingSize, a0 as BaseClickable, a1 as ClassNames, a2 as _toConsumableArray, a3 as isError, a4 as Badge, a5 as FramedIcon, a6 as FramedImage, a7 as FramedLogo, a8 as Stack, a9 as hFlex, aa as usePrevious, ab as useBrowserEffect, ac as getHeadingTextStyles, ad as vFlex, ae as centerFlexChildren, af as FormControlLabel, ag as FormControlValidation, ah as FormControlCaption, I as IMTBLWidgetEvents, A as AddTokensEventType, ai as getDefaultExportFromCjs, aj as commonjsGlobal, u as useTranslation, ak as MenuItem, al as tokenValueFormat, am as DEFAULT_TOKEN_FORMATTING_DECIMALS, an as BigNumber, ao as getRemoteVideo, ap as FramedVideo, aq as motion, ar as listItemVariants, as as Divider, at as Fragment, au as listVariants, av as useProvidersContext, aw as Drawer, ax as useAnalytics, ay as UserJourney, az as isPassportProvider, aA as Heading, aB as WalletDrawer, aC as UnableToConnectDrawer, aD as ChangedYourMindDrawer, aE as WalletProviderRdns, aF as getProviderSlugFromRdns, aG as Web3Provider, aH as connectEIP6963Provider, aI as identifyUser, aJ as ConnectEIP6963ProviderError, aK as ProvidersContextActions, aL as ViewContext, V as ViewActions, m as SharedViews, j as ChainId, aM as commonjsRequire, aN as getRemoteImage, aO as useHandover, aP as HandoverTarget, aQ as EventTargetContext, aR as getRemoteRive, aS as Trans, aT as Link, aU as useInjectedProviders, aV as getDefaultTokenImage, aW as OverflowDrawerMenu, aX as SimpleLayout, aY as TokenFilterTypes, h as getL2ChainId, aZ as isNativeToken, a_ as getTokenImageByAddress, a$ as orchestrationEvents, b0 as requireSecp256k1$1, b1 as requireLib_commonjs, b2 as require$$0$2, b3 as bech32$2, b4 as bnExports$1, b5 as require$$0$3, b6 as getAugmentedNamespace, b7 as require$$0$4, b8 as minimalisticAssert, b9 as require$$2, ba as hash$6, bb as MaxUint256, bc as merge$3, bd as SvgIcon, be as WalletWarningHero, bf as Environment, bg as t, bh as PriceDisplay, L as LoadingView, bi as viewReducer, bj as initialViewState, bk as isValidAddress, bl as amountInputValidation, bm as CloudImage, E as ErrorView, bn as ServiceUnavailableErrorView, bo as ServiceType } from './index-DVVgTW38.js';
2
- import { f as formatUnits, p as parseUnits } from './index-lFfbeyAV.js';
3
- import { E as EllipsizedText, C as Contract } from './EllipsizedText-ngVXQGn_.js';
4
- import { r as retry, T as TokenImage } from './retry-aLeSin3J.js';
5
- import { H as HandoverContent } from './HandoverContent-C0qfeRAh.js';
6
- import { F as FeesBreakdown } from './FeesBreakdown-BpgS4Cf3.js';
1
+ import { _ as _objectWithoutProperties, w as useTheme, x as useForwardLocalDomRef, y as useGetSubcomponentChild, z as useSplitApartChildrenAndSubComponents, r as reactExports, D as merge$2, F as useResizeObserver, p as jsxs, o as jsx, G as SmartClone, H as Box, J as isChildSubcomponent, K as flattenChildren, M as Body, N as useTheme$1, Q as Icon, R as ButtCon, T as Button, U as _defineProperty, X as isDualVariantIcon, Y as _slicedToArray, Z as isNumberWithinTotal, $ as getStartingSize, a0 as BaseClickable, a1 as ClassNames, a2 as _toConsumableArray, a3 as isError, a4 as Badge, a5 as FramedIcon, a6 as FramedImage, a7 as FramedLogo, a8 as Stack, a9 as hFlex, aa as usePrevious, ab as useBrowserEffect, ac as getHeadingTextStyles, ad as vFlex, ae as centerFlexChildren, af as FormControlLabel, ag as FormControlValidation, ah as FormControlCaption, I as IMTBLWidgetEvents, A as AddTokensEventType, ai as getDefaultExportFromCjs, aj as commonjsGlobal, u as useTranslation, ak as MenuItem, al as tokenValueFormat, am as DEFAULT_TOKEN_FORMATTING_DECIMALS, an as BigNumber, ao as getRemoteVideo, ap as FramedVideo, aq as motion, ar as listItemVariants, as as Divider, at as Fragment, au as listVariants, av as useProvidersContext, aw as Drawer, ax as useAnalytics, ay as UserJourney, az as isPassportProvider, aA as Heading, aB as WalletDrawer, aC as UnableToConnectDrawer, aD as WalletProviderRdns, aE as getProviderSlugFromRdns, aF as Web3Provider, aG as connectEIP6963Provider, aH as identifyUser, aI as ConnectEIP6963ProviderError, aJ as ProvidersContextActions, aK as ViewContext, V as ViewActions, m as SharedViews, j as ChainId, aL as commonjsRequire, aM as getRemoteImage, aN as useHandover, aO as HandoverTarget, aP as EventTargetContext, aQ as getRemoteRive, aR as Trans, aS as Link, aT as keyframes, aU as getDefaultTokenImage, aV as TokenFilterTypes, h as getL2ChainId, aW as isNativeToken, aX as getTokenImageByAddress, aY as TextInput, aZ as VerticalMenu, a_ as useInjectedProviders, a$ as SimpleLayout, b0 as orchestrationEvents, b1 as requireSecp256k1$1, b2 as requireLib_commonjs, b3 as require$$0$2, b4 as bech32$2, b5 as bnExports$1, b6 as require$$0$3, b7 as getAugmentedNamespace, b8 as require$$0$4, b9 as minimalisticAssert, ba as require$$2, bb as hash$6, bc as MaxUint256, bd as merge$3, be as SvgIcon, bf as WalletWarningHero, bg as Environment, bh as t, bi as PriceDisplay, L as LoadingView, bj as viewReducer, bk as initialViewState, bl as isValidAddress, bm as amountInputValidation, bn as CloudImage, E as ErrorView, bo as ServiceUnavailableToRegionErrorView, bp as ServiceType } from './index-CB9YWdxS.js';
2
+ import { f as formatUnits, p as parseUnits } from './index-LSVL9_fH.js';
3
+ import { E as EllipsizedText, C as Contract } from './EllipsizedText-CJWQB2xz.js';
4
+ import { r as retry, T as TokenImage } from './TokenImage-d3u0ZvQH.js';
5
+ import { H as HandoverContent } from './HandoverContent-rAxG25Cv.js';
6
+ import { F as FeesBreakdown } from './FeesBreakdown-CZuqljfy.js';
7
7
 
8
8
  var bannerSx = {
9
9
  d: "flex",
@@ -2638,6 +2638,7 @@ const SQUID_NATIVE_TOKEN = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE';
2638
2638
  const FIXED_HANDOVER_DURATION = 2000;
2639
2639
  const APPROVE_TXN_ANIMATION = '/access_coins.riv';
2640
2640
  const EXECUTE_TXN_ANIMATION = '/swapping_coins.riv';
2641
+ const TOKEN_PRIORITY_ORDER = ['IMX', 'USDC', 'ETH'];
2641
2642
 
2642
2643
  function SelectedRouteOptionContainer({ children, onClick, selected, }) {
2643
2644
  return (jsx(Stack, { direction: "row", alignItems: "center", gap: "base.spacing.x4", sx: {
@@ -2649,7 +2650,7 @@ function SelectedRouteOptionContainer({ children, onClick, selected, }) {
2649
2650
  : `calc(100% + (${base.spacing.x16}))`),
2650
2651
  }, rc: jsx("span", { ...(onClick ? { onClick } : {}) }), children: children }));
2651
2652
  }
2652
- function SelectedRouteOption({ checkout, routeData, chains, loading = false, withSelectedWallet = false, withSelectedToken = false, withSelectedAmount = false, insufficientBalance = false, showOnrampOption = false, onClick, }) {
2653
+ function SelectedRouteOption({ checkout, routeData, chains, loading = false, withSelectedWallet = false, insufficientBalance = false, showOnrampOption = false, onClick, }) {
2653
2654
  const { t } = useTranslation();
2654
2655
  const { fromToken } = routeData?.amountData ?? {};
2655
2656
  const chain = chains?.find((c) => c.id === fromToken?.chainId);
@@ -2667,16 +2668,7 @@ function SelectedRouteOption({ checkout, routeData, chains, loading = false, wit
2667
2668
  }
2668
2669
  if ((!routeData && !loading) || insufficientBalance) {
2669
2670
  let icon = 'Sparkle';
2670
- let copy = "Add your token, we'll find the best payment";
2671
- if (!withSelectedToken && withSelectedAmount) {
2672
- copy = "Add your token, we'll find the best payment";
2673
- }
2674
- if (withSelectedToken && !withSelectedAmount) {
2675
- copy = "Add your amount, we'll find the best payment";
2676
- }
2677
- if (!withSelectedWallet && withSelectedToken && withSelectedAmount) {
2678
- copy = "Select a wallet, we'll find the best payment";
2679
- }
2671
+ let copy = '';
2680
2672
  if (insufficientBalance) {
2681
2673
  icon = 'InformationCircle';
2682
2674
  copy = 'No routes found, choose a different wallet, token or amount.';
@@ -2694,12 +2686,13 @@ const disabledStyles = {
2694
2686
  cursor: 'not-allowed',
2695
2687
  bg: 'base.color.translucent.inverse.800',
2696
2688
  };
2697
- function SelectedWallet({ label, children, onClick, providerInfo, disabled, }) {
2689
+ function SelectedWallet({ label, children, onClick, providerInfo, disabled, sx, }) {
2698
2690
  const selected = !!children && providerInfo?.rdns;
2699
2691
  const size = selected ? 'xSmall' : 'small';
2700
2692
  return (jsxs(MenuItem, { size: size, disabled: disabled, emphasized: !disabled, onClick: disabled ? undefined : onClick, sx: {
2701
2693
  py: selected ? 'base.spacing.x3' : undefined,
2702
2694
  ...(disabled ? disabledStyles : {}),
2695
+ ...sx,
2703
2696
  }, children: [!providerInfo?.icon && (jsx(MenuItem.FramedIcon, { icon: "Wallet", variant: "bold", emphasized: false })), providerInfo?.icon && (jsx(MenuItem.FramedImage, { padded: true, sx: { mx: selected ? 'base.spacing.x2' : undefined }, use: jsx("img", { src: providerInfo.icon, alt: providerInfo.name }) })), jsx(MenuItem.Label, { children: label }), providerInfo?.name && (jsxs(MenuItem.Caption, { children: [providerInfo?.name, ' • ', jsx(EllipsizedText, { text: providerInfo.address ?? '', sx: { c: 'inherit', fontSize: 'inherit' } })] })), jsx(MenuItem.BottomSlot, { children: children })] }));
2704
2697
  }
2705
2698
 
@@ -2727,7 +2720,6 @@ function ConnectWalletDrawer({ heading, visible, onClose, onConnect, onError, pr
2727
2720
  const { identify, track } = useAnalytics();
2728
2721
  const prevWalletChangeEvent = reactExports.useRef();
2729
2722
  const [showUnableToConnectDrawer, setShowUnableToConnectDrawer] = reactExports.useState(false);
2730
- const [showChangedMindDrawer, setShowChangedMindDrawer] = reactExports.useState(false);
2731
2723
  const [showEOAWarningDrawer, setShowEOAWarningDrawer] = reactExports.useState(false);
2732
2724
  const setProviderInContext = async (provider, providerInfo) => {
2733
2725
  const address = await provider.getSigner().getAddress();
@@ -2793,9 +2785,6 @@ function ConnectWalletDrawer({ heading, visible, onClose, onConnect, onError, pr
2793
2785
  catch (error) {
2794
2786
  let errorType = error.message;
2795
2787
  switch (error.message) {
2796
- case ConnectEIP6963ProviderError.USER_REJECTED_REQUEST_ERROR:
2797
- setShowChangedMindDrawer(true);
2798
- break;
2799
2788
  case ConnectEIP6963ProviderError.SANCTIONED_ADDRESS:
2800
2789
  case ConnectEIP6963ProviderError.CONNECT_ERROR:
2801
2790
  setShowUnableToConnectDrawer(true);
@@ -2824,10 +2813,6 @@ function ConnectWalletDrawer({ heading, visible, onClose, onConnect, onError, pr
2824
2813
  handleWalletConnection(prevWalletChangeEvent.current);
2825
2814
  }
2826
2815
  };
2827
- const handleCloseChangedMindDrawer = () => {
2828
- retrySelectedWallet();
2829
- setShowChangedMindDrawer(false);
2830
- };
2831
2816
  const handleProceedEOA = () => {
2832
2817
  retrySelectedWallet();
2833
2818
  setShowEOAWarningDrawer(false);
@@ -2838,7 +2823,7 @@ function ConnectWalletDrawer({ heading, visible, onClose, onConnect, onError, pr
2838
2823
  return (jsxs(Fragment, { children: [jsx(WalletDrawer, { testId: "select-from-wallet-drawer", showWalletConnect: true, showDrawer: visible, drawerText: { heading }, walletOptions: walletOptions, disabledOptions: disabledOptions, menuItemSize: menuItemSize, setShowDrawer: (show) => {
2839
2824
  if (show === false)
2840
2825
  onClose();
2841
- }, onWalletChange: handleOnWalletChangeEvent, bottomSlot: bottomSlot }), jsx(UnableToConnectDrawer, { visible: showUnableToConnectDrawer, checkout: checkout, onCloseDrawer: () => setShowUnableToConnectDrawer(false), onTryAgain: () => setShowUnableToConnectDrawer(false) }), jsx(ChangedYourMindDrawer, { visible: showChangedMindDrawer, checkout: checkout, onCloseDrawer: () => setShowChangedMindDrawer(false), onTryAgain: handleCloseChangedMindDrawer }), jsx(EOAWarningDrawer, { visible: showEOAWarningDrawer, onProceedClick: handleProceedEOA, onCloseDrawer: handleCloseEOAWarningDrawer })] }));
2826
+ }, onWalletChange: handleOnWalletChangeEvent, bottomSlot: bottomSlot }), jsx(UnableToConnectDrawer, { visible: showUnableToConnectDrawer, checkout: checkout, onCloseDrawer: () => setShowUnableToConnectDrawer(false), onTryAgain: () => setShowUnableToConnectDrawer(false) }), jsx(EOAWarningDrawer, { visible: showEOAWarningDrawer, onProceedClick: handleProceedEOA, onCloseDrawer: handleCloseEOAWarningDrawer })] }));
2842
2827
  }
2843
2828
 
2844
2829
  function DeliverToWalletDrawer({ visible, onClose, onConnect, walletOptions, }) {
@@ -5954,7 +5939,132 @@ function SquidFooter() {
5954
5939
  } }) }));
5955
5940
  }
5956
5941
 
5942
+ const PULSE_SHADOW = keyframes `
5943
+ 0% {
5944
+ box-shadow: 0 0 0 0 rgba(255, 255, 255, 1);
5945
+ }
5946
+ 50% {
5947
+ box-shadow: 0 0 10px 3px rgba(54, 210, 227, 0.1);
5948
+ }
5949
+ 100% {
5950
+ box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
5951
+ }
5952
+ `;
5953
+
5954
+ function TokenDrawerMenu({ checkout, config, toTokenAddress, }) {
5955
+ const { addTokensState: { tokens, selectedToken }, addTokensDispatch, } = reactExports.useContext(AddTokensContext);
5956
+ const { showErrorHandover } = useError(config.environment);
5957
+ const [visible, setVisible] = reactExports.useState(false);
5958
+ const [allowedTokens, setAllowedTokens] = reactExports.useState([]);
5959
+ const [searchValue, setSearchValue] = reactExports.useState('');
5960
+ const defaultTokenImage = getDefaultTokenImage(checkout?.config.environment, config.theme);
5961
+ const { track } = useAnalytics();
5962
+ const setSelectedToken = (token) => {
5963
+ track({
5964
+ userJourney: UserJourney.ADD_TOKENS,
5965
+ screen: 'InputScreen',
5966
+ control: 'TokensMenu',
5967
+ controlType: 'MenuItem',
5968
+ extras: {
5969
+ tokenAddress: token?.address,
5970
+ },
5971
+ });
5972
+ addTokensDispatch({
5973
+ payload: {
5974
+ type: AddTokensActions.SET_SELECTED_TOKEN,
5975
+ selectedToken: token,
5976
+ },
5977
+ });
5978
+ };
5979
+ const handleTokenChange = reactExports.useCallback((token) => {
5980
+ setSelectedToken(token);
5981
+ setVisible(false);
5982
+ setSearchValue('');
5983
+ }, []);
5984
+ const isSelected = reactExports.useCallback((token) => token.address === selectedToken?.address, [selectedToken]);
5985
+ const tokenChoiceOptions = reactExports.useMemo(() => allowedTokens.filter((token) => {
5986
+ if (!searchValue)
5987
+ return true;
5988
+ return token.symbol.toLowerCase().startsWith(searchValue.toLowerCase());
5989
+ }), [tokens, handleTokenChange, isSelected, defaultTokenImage, searchValue]);
5990
+ const handleTokenIconClick = reactExports.useCallback(() => {
5991
+ setVisible(!visible);
5992
+ }, [visible]);
5993
+ const handleDrawerClose = reactExports.useCallback(() => {
5994
+ setVisible(false);
5995
+ setSearchValue('');
5996
+ }, [setVisible, setSearchValue]);
5997
+ reactExports.useEffect(() => {
5998
+ if (!checkout)
5999
+ return;
6000
+ (async () => {
6001
+ try {
6002
+ const tokenResponse = await checkout.getTokenAllowList({
6003
+ type: TokenFilterTypes.SWAP,
6004
+ chainId: getL2ChainId(checkout.config),
6005
+ });
6006
+ if (tokenResponse?.tokens.length > 0) {
6007
+ const updatedTokens = tokenResponse.tokens.map((token) => {
6008
+ if (isNativeToken(token.address)) {
6009
+ return {
6010
+ ...token,
6011
+ icon: getTokenImageByAddress(checkout.config.environment, token.symbol),
6012
+ };
6013
+ }
6014
+ return token;
6015
+ });
6016
+ updatedTokens.sort((a, b) => {
6017
+ const aIndex = TOKEN_PRIORITY_ORDER.findIndex((token) => token === a.symbol);
6018
+ const bIndex = TOKEN_PRIORITY_ORDER.findIndex((token) => token === b.symbol);
6019
+ // If both tokens are not in the priority list, sort by symbol
6020
+ if (aIndex === -1 && bIndex === -1) {
6021
+ return a.symbol.localeCompare(b.symbol);
6022
+ }
6023
+ // If only one token is in the priority list, sort it first
6024
+ if (aIndex === -1) {
6025
+ return 1;
6026
+ }
6027
+ if (bIndex === -1) {
6028
+ return -1;
6029
+ }
6030
+ // If both tokens are in the priority list, sort by index
6031
+ return aIndex < bIndex ? -1 : 1;
6032
+ });
6033
+ setAllowedTokens(updatedTokens);
6034
+ if (toTokenAddress) {
6035
+ const preselectedToken = updatedTokens.find((token) => token.address?.toLowerCase() === toTokenAddress.toLowerCase());
6036
+ if (preselectedToken) {
6037
+ setSelectedToken(preselectedToken);
6038
+ }
6039
+ }
6040
+ addTokensDispatch({
6041
+ payload: {
6042
+ type: AddTokensActions.SET_ALLOWED_TOKENS,
6043
+ allowedTokens: tokenResponse.tokens,
6044
+ },
6045
+ });
6046
+ }
6047
+ }
6048
+ catch (error) {
6049
+ showErrorHandover(AddTokensErrorTypes.SERVICE_BREAKDOWN, { error });
6050
+ }
6051
+ })();
6052
+ }, [checkout, toTokenAddress]);
6053
+ return (jsxs(Drawer, { visible: visible, onCloseDrawer: handleDrawerClose, size: "full", headerBarTitle: "Add Tokens", drawerCloseIcon: "ChevronExpand", showHeaderBar: true, outsideClicksClose: true, escapeKeyClose: true, children: [jsx(Drawer.Target, { children: selectedToken ? (jsx(SmartClone, { onClick: handleTokenIconClick, children: jsx(FramedImage, { size: "xLarge", use: (jsx(TokenImage, { src: selectedToken?.icon, name: selectedToken?.name, defaultImage: defaultTokenImage })), padded: true, emphasized: true, circularFrame: true, sx: {
6054
+ cursor: 'pointer',
6055
+ mb: 'base.spacing.x1',
6056
+ // eslint-disable-next-line @typescript-eslint/naming-convention
6057
+ '&:hover': {
6058
+ boxShadow: ({ base }) => `0 0 0 ${base.border.size[200]} ${base.color.text.body.primary}`,
6059
+ },
6060
+ } }) })) : (jsx(Box, { sx: { animation: `${PULSE_SHADOW} 2s infinite ease-in-out`, borderRadius: '50%' }, children: jsx(ButtCon, { size: "large", variant: "tertiary", icon: "Add", onClick: handleTokenIconClick }) })) }), jsxs(Drawer.Content, { sx: { paddingX: 'base.spacing.x2' }, children: [jsx(TextInput, { sx: { marginBottom: 'base.spacing.x2' }, placeholder: "Search tokens", sizeVariant: "medium", onChange: (event) => {
6061
+ setSearchValue(event.target.value);
6062
+ }, children: jsx(TextInput.Icon, { icon: "Search" }) }), jsx(VerticalMenu, { sx: { maxHeight: '100%' }, children: tokenChoiceOptions.length > 0
6063
+ && tokenChoiceOptions.map((token) => (jsxs(MenuItem, { size: "medium", onClick: () => handleTokenChange(token), selected: isSelected(token), emphasized: true, children: [jsx(MenuItem.FramedImage, { circularFrame: true, use: (jsx(TokenImage, { src: token.icon, name: token.name, defaultImage: defaultTokenImage })), emphasized: false }), jsx(MenuItem.Label, { children: token.symbol }), token.symbol !== token.name && (jsx(MenuItem.Caption, { children: token.name }))] }, token.name))) })] })] }));
6064
+ }
6065
+
5957
6066
  function AddTokens({ checkout, toAmount, config, toTokenAddress, showOnrampOption = true, showSwapOption = true, showBridgeOption = true, onCloseButtonClick, showBackButton, onBackButtonClick, }) {
6067
+ const inputRef = reactExports.useRef(null);
5958
6068
  const { fetchRoutesWithRateLimit, resetRoutes } = useRoutes();
5959
6069
  const { showErrorHandover } = useError(config.environment);
5960
6070
  const { addTokensState: { squid, chains, balances, tokens, selectedAmount, routes, selectedRouteData, selectedToken, isSwapAvailable, }, addTokensDispatch, } = reactExports.useContext(AddTokensContext);
@@ -5967,7 +6077,6 @@ function AddTokens({ checkout, toAmount, config, toTokenAddress, showOnrampOptio
5967
6077
  const [showPayWithDrawer, setShowPayWithDrawer] = reactExports.useState(false);
5968
6078
  const [showDeliverToDrawer, setShowDeliverToDrawer] = reactExports.useState(false);
5969
6079
  const [onRampAllowedTokens, setOnRampAllowedTokens] = reactExports.useState([]);
5970
- const [allowedTokens, setAllowedTokens] = reactExports.useState([]);
5971
6080
  const [inputValue, setInputValue] = reactExports.useState(selectedAmount || toAmount || '');
5972
6081
  const [fetchingRoutes, setFetchingRoutes] = reactExports.useState(false);
5973
6082
  const [insufficientBalance, setInsufficientBalance] = reactExports.useState(false);
@@ -5989,23 +6098,6 @@ function AddTokens({ checkout, toAmount, config, toTokenAddress, showOnrampOptio
5989
6098
  },
5990
6099
  });
5991
6100
  }, 2500), []);
5992
- const setSelectedToken = (token) => {
5993
- track({
5994
- userJourney: UserJourney.ADD_TOKENS,
5995
- screen: 'InputScreen',
5996
- control: 'TokensMenu',
5997
- controlType: 'MenuItem',
5998
- extras: {
5999
- tokenAddress: token?.address,
6000
- },
6001
- });
6002
- addTokensDispatch({
6003
- payload: {
6004
- type: AddTokensActions.SET_SELECTED_TOKEN,
6005
- selectedToken: token,
6006
- },
6007
- });
6008
- };
6009
6101
  const setSelectedRouteData = (route) => {
6010
6102
  if (route) {
6011
6103
  track({
@@ -6101,46 +6193,6 @@ function AddTokens({ checkout, toAmount, config, toTokenAddress, showOnrampOptio
6101
6193
  setSelectedRouteData(routes[0]);
6102
6194
  }
6103
6195
  }, [routes]);
6104
- reactExports.useEffect(() => {
6105
- if (!checkout)
6106
- return;
6107
- const fetchTokens = async () => {
6108
- try {
6109
- const tokenResponse = await checkout.getTokenAllowList({
6110
- type: TokenFilterTypes.SWAP,
6111
- chainId: getL2ChainId(checkout.config),
6112
- });
6113
- if (tokenResponse?.tokens.length > 0) {
6114
- const updatedTokens = tokenResponse.tokens.map((token) => {
6115
- if (isNativeToken(token.address)) {
6116
- return {
6117
- ...token,
6118
- icon: getTokenImageByAddress(checkout.config.environment, token.symbol),
6119
- };
6120
- }
6121
- return token;
6122
- });
6123
- setAllowedTokens(updatedTokens);
6124
- if (toTokenAddress) {
6125
- const preselectedToken = updatedTokens.find((token) => token.address?.toLowerCase() === toTokenAddress.toLowerCase());
6126
- if (preselectedToken) {
6127
- setSelectedToken(preselectedToken);
6128
- }
6129
- }
6130
- addTokensDispatch({
6131
- payload: {
6132
- type: AddTokensActions.SET_ALLOWED_TOKENS,
6133
- allowedTokens: tokenResponse.tokens,
6134
- },
6135
- });
6136
- }
6137
- }
6138
- catch (error) {
6139
- showErrorHandover(AddTokensErrorTypes.SERVICE_BREAKDOWN, { error });
6140
- }
6141
- };
6142
- fetchTokens();
6143
- }, [checkout, toTokenAddress]);
6144
6196
  reactExports.useEffect(() => {
6145
6197
  if (!checkout)
6146
6198
  return;
@@ -6160,10 +6212,6 @@ function AddTokens({ checkout, toAmount, config, toTokenAddress, showOnrampOptio
6160
6212
  };
6161
6213
  fetchOnRampTokens();
6162
6214
  }, [checkout]);
6163
- const isSelected = reactExports.useCallback((token) => token.address === selectedToken, [selectedToken]);
6164
- const handleTokenChange = reactExports.useCallback((token) => {
6165
- setSelectedToken(token);
6166
- }, []);
6167
6215
  const sendRequestOnRampEvent = () => {
6168
6216
  track({
6169
6217
  userJourney: UserJourney.ADD_TOKENS,
@@ -6249,8 +6297,6 @@ function AddTokens({ checkout, toAmount, config, toTokenAddress, showOnrampOptio
6249
6297
  return false;
6250
6298
  }, [selectedToken, onRampAllowedTokens, showOnrampOption]);
6251
6299
  const showInitialEmptyState = !selectedToken;
6252
- const defaultTokenImage = getDefaultTokenImage(checkout?.config.environment, config.theme);
6253
- const tokenChoiceOptions = reactExports.useMemo(() => allowedTokens.map((token) => (jsxs(MenuItem, { size: "medium", onClick: () => handleTokenChange(token), selected: isSelected(token), emphasized: true, children: [jsx(MenuItem.FramedImage, { circularFrame: true, use: (jsx(TokenImage, { src: token.icon, name: token.name, defaultImage: defaultTokenImage })), emphasized: false }), jsx(MenuItem.Label, { children: token.symbol }), token.symbol !== token.name && (jsx(MenuItem.Caption, { children: token.name }))] }, token.name))), [allowedTokens, handleTokenChange, isSelected, defaultTokenImage]);
6254
6300
  const shouldShowBackButton = showBackButton && onBackButtonClick;
6255
6301
  const routeInputsReady = !!selectedToken
6256
6302
  && !!fromAddress
@@ -6285,18 +6331,7 @@ function AddTokens({ checkout, toAmount, config, toTokenAddress, showOnrampOptio
6285
6331
  px: 'base.spacing.x2',
6286
6332
  w: '100%',
6287
6333
  pt: 'base.spacing.x1',
6288
- }, justifyContent: "center", alignItems: "center", children: [jsx(OverflowDrawerMenu, { drawerSize: "full", headerBarTitle: "Add Token", drawerCloseIcon: "ChevronExpand", ...(showInitialEmptyState
6289
- ? { icon: 'Add', size: 'large', variant: 'tertiary' }
6290
- : {
6291
- customTarget: (jsx(FramedImage, { size: "xLarge", use: (jsx(TokenImage, { src: selectedToken?.icon, name: selectedToken?.name, defaultImage: defaultTokenImage })), padded: true, emphasized: true, circularFrame: true, sx: {
6292
- cursor: 'pointer',
6293
- mb: 'base.spacing.x1',
6294
- // eslint-disable-next-line @typescript-eslint/naming-convention
6295
- '&:hover': {
6296
- boxShadow: ({ base }) => `0 0 0 ${base.border.size[200]} ${base.color.text.body.primary}`,
6297
- },
6298
- } })),
6299
- }), children: tokenChoiceOptions }), showInitialEmptyState ? (jsx(Body, { children: "Add Token" })) : (jsxs(HeroFormControl, { validationStatus: inputValue === '0' ? 'error' : 'success', children: [jsxs(HeroFormControl.Label, { children: ["Add", ' ', selectedToken.symbol] }), jsx(HeroTextInput, { testId: "add-tokens-amount-input", type: "number", value: inputValue, onChange: (value) => handleOnAmountInputChange(value), placeholder: "0", maxTextSize: "xLarge" }), jsx(HeroFormControl.Caption, { children: `${t('views.ADD_TOKENS.fees.fiatPricePrefix')}
6334
+ }, justifyContent: "center", alignItems: "center", children: [jsx(TokenDrawerMenu, { checkout: checkout, config: config, toTokenAddress: toTokenAddress }), showInitialEmptyState ? (jsx(Body, { children: "Add Token" })) : (jsxs(HeroFormControl, { validationStatus: inputValue === '0' ? 'error' : 'success', children: [jsxs(HeroFormControl.Label, { children: ["Add", ' ', selectedToken.symbol] }), jsx(HeroTextInput, { inputRef: inputRef, testId: "add-tokens-amount-input", type: "number", value: inputValue, onChange: (value) => handleOnAmountInputChange(value), placeholder: "0", maxTextSize: "xLarge" }), jsx(HeroFormControl.Caption, { children: `${t('views.ADD_TOKENS.fees.fiatPricePrefix')}
6300
6335
  $${getFormattedNumberWithDecimalPlaces(selectedAmountUsd)}` })] }))] }), jsxs(Stack, { testId: "bottomSection", sx: {
6301
6336
  alignSelf: 'stretch',
6302
6337
  p: 'base.spacing.x3',
@@ -6304,18 +6339,27 @@ function AddTokens({ checkout, toAmount, config, toTokenAddress, showOnrampOptio
6304
6339
  bg: 'base.color.neutral.800',
6305
6340
  bradtl: 'base.borderRadius.x8',
6306
6341
  bradtr: 'base.borderRadius.x8',
6307
- }, gap: "base.spacing.x4", children: [jsxs(Stack, { gap: "0px", children: [jsxs(SelectedWallet, { label: "Send from", providerInfo: {
6342
+ }, gap: "base.spacing.x4", children: [jsxs(Stack, { gap: "0px", children: [jsx(SelectedWallet, { sx: selectedToken
6343
+ && !fromAddress
6344
+ && inputValue
6345
+ ? { animation: `${PULSE_SHADOW} 2s infinite ease-in-out` }
6346
+ : {}, label: "Send from", providerInfo: {
6308
6347
  ...fromProviderInfo,
6309
6348
  address: fromAddress,
6310
6349
  }, onClick: (event) => {
6311
6350
  event.stopPropagation();
6312
6351
  setShowPayWithDrawer(true);
6313
- }, children: [jsx(MenuItem.BottomSlot.Divider, { sx: fromAddress ? { ml: 'base.spacing.x4' } : undefined }), jsx(SelectedRouteOption, { checkout: checkout, loading: loading, chains: chains, routeData: selectedRouteData, onClick: () => setShowOptionsDrawer(true), withSelectedToken: !!selectedToken, withSelectedAmount: parseFloat(inputValue) > 0, withSelectedWallet: !!fromAddress, insufficientBalance: insufficientBalance, showOnrampOption: shouldShowOnRampOption })] }), jsx(Stack, { sx: { pos: 'relative', h: 'base.spacing.x3' }, alignItems: "center", children: jsx(FramedIcon, { icon: "ArrowDown", sx: {
6352
+ }, children: selectedToken && fromAddress && inputValue && (jsxs(Fragment, { children: [jsx(MenuItem.BottomSlot.Divider, { sx: fromAddress ? { ml: 'base.spacing.x4' } : undefined }), jsx(SelectedRouteOption, { checkout: checkout, loading: loading, chains: chains, routeData: selectedRouteData, onClick: () => setShowOptionsDrawer(true), withSelectedWallet: !!fromAddress, insufficientBalance: insufficientBalance, showOnrampOption: shouldShowOnRampOption })] })) }), jsx(Stack, { sx: { pos: 'relative', h: 'base.spacing.x3' }, alignItems: "center", children: jsx(FramedIcon, { icon: "ArrowDown", sx: {
6314
6353
  top: '0',
6315
6354
  pos: 'absolute',
6316
6355
  translate: '0 -30%',
6317
6356
  bg: 'base.color.neutral.800',
6318
- } }) }), jsx(SelectedWallet, { label: "Deliver to", providerInfo: {
6357
+ } }) }), jsx(SelectedWallet, { sx: selectedToken
6358
+ && fromAddress
6359
+ && !toAddress
6360
+ && inputValue
6361
+ ? { animation: `${PULSE_SHADOW} 2s infinite ease-in-out` }
6362
+ : {}, label: "Deliver to", providerInfo: {
6319
6363
  ...toProviderInfo,
6320
6364
  address: toAddress,
6321
6365
  }, onClick: () => setShowDeliverToDrawer(true), disabled: lockedToProvider })] }), jsx(Button, { testId: "add-tokens-button", size: "large", variant: readyToReview ? 'primary' : 'secondary', disabled: !readyToReview, onClick: handleReviewClick, sx: { opacity: readyToReview ? 1 : 0.5 }, children: "Review" }), jsx(SquidFooter, {}), jsx(PayWithWalletDrawer, { visible: showPayWithDrawer, walletOptions: walletOptions, onClose: () => setShowPayWithDrawer(false), onPayWithCard: handleCardClick, onConnect: handleWalletConnected, insufficientBalance: insufficientBalance, showOnRampOption: shouldShowOnRampOption }), jsx(OptionsDrawer, { checkout: checkout, routes: routes, showOnrampOption: shouldShowOnRampOption, showSwapOption: showSwapOption, showBridgeOption: showBridgeOption, visible: showOptionsDrawer, onClose: () => setShowOptionsDrawer(false), onCardClick: handleCardClick, onRouteClick: handleRouteClick, insufficientBalance: insufficientBalance }), jsx(DeliverToWalletDrawer, { visible: showDeliverToDrawer, walletOptions: walletOptions, onClose: handleDeliverToClose }), jsx(OnboardingDrawer, { environment: checkout?.config.environment })] })] }) }));
@@ -174043,7 +174087,7 @@ function AddTokensWidget({ showOnrampOption = true, showSwapOption = true, showB
174043
174087
  screen: 'Error',
174044
174088
  });
174045
174089
  } })), viewState.view.type
174046
- === SharedViews.SERVICE_UNAVAILABLE_ERROR_VIEW && (jsx(ServiceUnavailableErrorView, { service: ServiceType.GENERIC, onCloseClick: () => sendAddTokensCloseEvent(eventTarget) }))] }) }) }));
174090
+ === SharedViews.SERVICE_UNAVAILABLE_ERROR_VIEW && (jsx(ServiceUnavailableToRegionErrorView, { service: ServiceType.GENERIC, onCloseClick: () => sendAddTokensCloseEvent(eventTarget) }))] }) }) }));
174047
174091
  }
174048
174092
 
174049
174093
  export { AddTokensWidget as default };
@@ -1,12 +1,12 @@
1
- import { c0 as axios, c1 as CheckoutErrorType, c2 as IMMUTABLE_API_BASE_URL, r as reactExports, I as IMTBLWidgetEvents, B as BridgeEventType, p as jsxs, o as jsx, c3 as ShimmerBox, ak as MenuItem, a8 as Stack, u as useTranslation, M as Body, T as Button, H as Box, c4 as PASSPORT_URL, aT as Link, c5 as getChainIdBySlug, c6 as getChainImage, c7 as networkName, a6 as FramedImage, Q as Icon, ax as useAnalytics, ay as UserJourney, as as Divider, aL as ViewContext, at as Fragment, V as ViewActions, c8 as useWalletConnect, c9 as isWalletConnectProvider, ca as Logo, cb as RawImage, cc as AXELAR_SCAN_URL, aZ as isNativeToken, a_ as getTokenImageByAddress, cd as getNativeSymbolByChainSlug, by as calculateCryptoToFiat, aQ as EventTargetContext, az as isPassportProvider, i as getL1ChainId, aY as TokenFilterTypes, h as getL2ChainId, aE as WalletProviderRdns, aG as Web3Provider, aU as useInjectedProviders, bF as HeaderNavigation, bI as FooterLogo, aB as WalletDrawer, aX as SimpleLayout, ce as getChainSlugById, cf as JsonRpcProvider, cg as DEFAULT_TRANSACTIONS_RETRY_POLICY, L as LoadingView, j as ChainId, ch as getChainNameById, w as useTheme, aA as Heading, ci as getWalletProviderNameByProvider, cj as isAddressSanctioned, m as SharedViews, ck as isMetaMaskProvider, cl as WalletProviderName, aw as Drawer, R as ButtCon, cm as ButtonNavigationStyles, a$ as orchestrationEvents, al as tokenValueFormat, cn as formatZeroAmount, co as NATIVE, bl as amountInputValidation, aN as getRemoteImage, bm as CloudImage, cp as ETH_TOKEN_SYMBOL, an as BigNumber, bf as Environment, cq as GasEstimateType, cr as DEFAULT_TOKEN_DECIMALS, cs as DEFAULT_QUOTE_REFRESH_INTERVAL, ct as addChainChangedListener, cu as removeChainChangedListener, cv as IMX_TOKEN_SYMBOL, cw as dist, cx as CHECKOUT_CDN_BASE_URL, cy as heroBackGroundStyles, cz as heroImageStyles, a4 as Badge, cA as SimpleTextBody, cB as FooterButton, cC as getEthTokenImage, cD as WITHDRAWAL_CLAIM_GAS_LIMIT, aV as getDefaultTokenImage, bi as viewReducer, bj as initialViewState, cE as BridgeConfiguration, cF as ImmutableConfiguration, cG as TokenBridge, cH as StatusView, bJ as StatusType, E as ErrorView, bn as ServiceUnavailableErrorView, bo as ServiceType, cI as ETH_SEPOLIA_TO_ZKEVM_TESTNET, cJ as ETH_SEPOLIA_TO_ZKEVM_DEVNET, cK as ETH_MAINNET_TO_ZKEVM_MAINNET } from './index-DVVgTW38.js';
2
- import { C as CryptoFiatContext, a as CryptoFiatActions, b as CryptoFiatProvider } from './CryptoFiatProvider-BwfapqZO.js';
3
- import { T as TokenImage, r as retry } from './retry-aLeSin3J.js';
4
- import { E as EllipsizedText, C as Contract } from './EllipsizedText-ngVXQGn_.js';
5
- import { A as Accordion, S as SelectForm, T as TextInputForm, a as TransactionRejected, g as getAllowedBalances, F as Fees, N as NetworkSwitchDrawer, W as WalletApproveHero } from './WalletApproveHero-DiwEKXIx.js';
6
- import { B as BridgeWidgetViews, T as TopUpView } from './TopUpView-BBUB2cpE.js';
7
- import { f as formatUnits, p as parseUnits } from './index-lFfbeyAV.js';
8
- import { u as useInterval } from './useInterval-D0l_aPl9.js';
9
- import './FeesBreakdown-BpgS4Cf3.js';
1
+ import { c4 as axios, c5 as CheckoutErrorType, c6 as IMMUTABLE_API_BASE_URL, r as reactExports, I as IMTBLWidgetEvents, B as BridgeEventType, p as jsxs, o as jsx, c7 as ShimmerBox, ak as MenuItem, a8 as Stack, u as useTranslation, M as Body, T as Button, H as Box, c8 as PASSPORT_URL, aS as Link, c9 as getChainIdBySlug, ca as getChainImage, cb as networkName, a6 as FramedImage, Q as Icon, ax as useAnalytics, ay as UserJourney, as as Divider, aK as ViewContext, at as Fragment, V as ViewActions, cc as useWalletConnect, cd as isWalletConnectProvider, ce as Logo, cf as RawImage, cg as AXELAR_SCAN_URL, aW as isNativeToken, aX as getTokenImageByAddress, ch as getNativeSymbolByChainSlug, bA as calculateCryptoToFiat, aP as EventTargetContext, az as isPassportProvider, i as getL1ChainId, aV as TokenFilterTypes, h as getL2ChainId, aD as WalletProviderRdns, aF as Web3Provider, a_ as useInjectedProviders, bH as HeaderNavigation, bL as FooterLogo, aB as WalletDrawer, a$ as SimpleLayout, ci as getChainSlugById, cj as JsonRpcProvider, ck as DEFAULT_TRANSACTIONS_RETRY_POLICY, L as LoadingView, j as ChainId, cl as getChainNameById, w as useTheme, aA as Heading, cm as getWalletProviderNameByProvider, by as fetchRiskAssessment, bK as isAddressSanctioned, m as SharedViews, cn as isMetaMaskProvider, co as WalletProviderName, aw as Drawer, R as ButtCon, cp as ButtonNavigationStyles, b0 as orchestrationEvents, al as tokenValueFormat, cq as formatZeroAmount, cr as NATIVE, bm as amountInputValidation, aM as getRemoteImage, bn as CloudImage, cs as ETH_TOKEN_SYMBOL, an as BigNumber, bg as Environment, ct as GasEstimateType, cu as DEFAULT_TOKEN_DECIMALS, cv as DEFAULT_QUOTE_REFRESH_INTERVAL, cw as addChainChangedListener, cx as removeChainChangedListener, cy as IMX_TOKEN_SYMBOL, cz as dist, cA as CHECKOUT_CDN_BASE_URL, cB as heroBackGroundStyles, cC as heroImageStyles, a4 as Badge, cD as SimpleTextBody, cE as FooterButton, cF as getEthTokenImage, cG as WITHDRAWAL_CLAIM_GAS_LIMIT, aU as getDefaultTokenImage, bj as viewReducer, bk as initialViewState, cH as BridgeConfiguration, cI as ImmutableConfiguration, cJ as TokenBridge, cK as StatusView, bM as StatusType, E as ErrorView, c3 as ServiceUnavailableErrorView, cL as ETH_SEPOLIA_TO_ZKEVM_TESTNET, cM as ETH_SEPOLIA_TO_ZKEVM_DEVNET, cN as ETH_MAINNET_TO_ZKEVM_MAINNET } from './index-CB9YWdxS.js';
2
+ import { C as CryptoFiatContext, a as CryptoFiatActions, b as CryptoFiatProvider } from './CryptoFiatProvider-D6MFlvbF.js';
3
+ import { T as TokenImage, r as retry } from './TokenImage-d3u0ZvQH.js';
4
+ import { E as EllipsizedText, C as Contract } from './EllipsizedText-CJWQB2xz.js';
5
+ import { A as Accordion, S as SelectForm, T as TextInputForm, a as TransactionRejected, g as getAllowedBalances, F as Fees, N as NetworkSwitchDrawer, W as WalletApproveHero } from './WalletApproveHero-BU16nd9U.js';
6
+ import { B as BridgeWidgetViews, T as TopUpView } from './TopUpView-XlT3otoq.js';
7
+ import { f as formatUnits, p as parseUnits } from './index-LSVL9_fH.js';
8
+ import { u as useInterval } from './useInterval-B8niXF8W.js';
9
+ import './FeesBreakdown-CZuqljfy.js';
10
10
 
11
11
  // This module is intended to unwrap Axios default export as named.
12
12
  // Keep top-level export same with static properties
@@ -1234,7 +1234,9 @@ function WalletAndNetworkSelector() {
1234
1234
  const web3Provider = new Web3Provider(event.provider);
1235
1235
  const connectedProvider = await connectToProvider(checkout, web3Provider, changeAccount);
1236
1236
  // CM-793 Check for sanctioned address
1237
- if (await isAddressSanctioned(await connectedProvider.getSigner().getAddress(), checkout.config.environment)) {
1237
+ const address = await connectedProvider.getSigner().getAddress();
1238
+ const sanctions = await fetchRiskAssessment([address], checkout.config);
1239
+ if (isAddressSanctioned(sanctions, address)) {
1238
1240
  viewDispatch({
1239
1241
  payload: {
1240
1242
  type: ViewActions.UPDATE_VIEW,
@@ -1340,7 +1342,9 @@ function WalletAndNetworkSelector() {
1340
1342
  const web3Provider = new Web3Provider(event.provider);
1341
1343
  const connectedProvider = await connectToProvider(checkout, web3Provider, false);
1342
1344
  // CM-793 Check for sanctioned address
1343
- if (await isAddressSanctioned(await connectedProvider.getSigner().getAddress(), checkout.config.environment)) {
1345
+ const address = await connectedProvider.getSigner().getAddress();
1346
+ const sanctions = await fetchRiskAssessment([address], checkout.config);
1347
+ if (isAddressSanctioned(sanctions, address)) {
1344
1348
  viewDispatch({
1345
1349
  payload: {
1346
1350
  type: ViewActions.UPDATE_VIEW,
@@ -1357,7 +1361,6 @@ function WalletAndNetworkSelector() {
1357
1361
  }
1358
1362
  else {
1359
1363
  setToWalletWeb3Provider(connectedProvider);
1360
- const address = await connectedProvider.getSigner().getAddress();
1361
1364
  setToWalletAddress(address.toLowerCase());
1362
1365
  handleSettingToNetwork(address.toLowerCase());
1363
1366
  track({
@@ -3065,7 +3068,14 @@ function BridgeWidget({ checkout, web3Provider, config, amount, tokenAddress, sh
3065
3068
  },
3066
3069
  });
3067
3070
  sendBridgeClaimWithdrawalFailedEvent(eventTarget, viewState.view.transactionHash, 'Transaction failed');
3068
- }, onActionClick: updateToTransactionsPage, statusType: StatusType.FAILURE, onCloseClick: () => sendBridgeWidgetCloseEvent(eventTarget), testId: "claim-withdrawal-fail-view" })), viewState.view.type === SharedViews.SERVICE_UNAVAILABLE_ERROR_VIEW && (jsx(ServiceUnavailableErrorView, { service: ServiceType.GENERIC, onCloseClick: () => sendBridgeWidgetCloseEvent(eventTarget) }))] }) }) }));
3071
+ }, onActionClick: updateToTransactionsPage, statusType: StatusType.FAILURE, onCloseClick: () => sendBridgeWidgetCloseEvent(eventTarget), testId: "claim-withdrawal-fail-view" })), viewState.view.type === SharedViews.SERVICE_UNAVAILABLE_ERROR_VIEW && (jsx(ServiceUnavailableErrorView, { onCloseClick: () => sendBridgeWidgetCloseEvent(eventTarget), onBackButtonClick: () => {
3072
+ viewDispatch({
3073
+ payload: {
3074
+ type: ViewActions.UPDATE_VIEW,
3075
+ view: { type: BridgeWidgetViews.WALLET_NETWORK_SELECTION },
3076
+ },
3077
+ });
3078
+ } }))] }) }) }));
3069
3079
  }
3070
3080
 
3071
3081
  export { BridgeWidget as default };
@@ -1,20 +1,20 @@
1
- import { I as IMTBLWidgetEvents, C as CommerceFlowType, P as ProviderEventType, a as CommerceEventType, b as ConnectEventType, c as CommerceFailureEventType, d as CommerceSuccessEventType, W as WalletEventType, e as CommerceUserActionEventType, S as SwapEventType, A as AddTokensEventType, B as BridgeEventType, O as OnRampEventType, f as SaleEventType, g as OrchestrationEventType, r as reactExports, V as ViewActions, h as getL2ChainId, i as getL1ChainId, j as ChainId, u as useTranslation, k as useViewState, l as useEventTargetState, m as SharedViews, n as commerceFlows, o as jsx, p as jsxs, L as LoadingView, E as ErrorView, q as ConnectWidget, s as ProvidersContextProvider, t as ConnectLoader, v as ViewContextProvider } from './index-DVVgTW38.js';
2
- import SwapWidget from './SwapWidget-DiA9c6Zu.js';
3
- import BridgeWidget from './BridgeWidget-CzoLGKzK.js';
4
- import { O as OnRampWidget } from './OnRampWidget-Dx2XkuTt.js';
5
- import WalletWidget from './WalletWidget-BNCipG33.js';
6
- import SaleWidget from './SaleWidget-N4DUeD2I.js';
7
- import AddTokensWidget from './AddTokensWidget-DdZHY_JS.js';
8
- import './WalletApproveHero-DiwEKXIx.js';
9
- import './retry-aLeSin3J.js';
10
- import './FeesBreakdown-BpgS4Cf3.js';
11
- import './CryptoFiatProvider-BwfapqZO.js';
12
- import './useInterval-D0l_aPl9.js';
13
- import './index-lFfbeyAV.js';
14
- import './TopUpView-BBUB2cpE.js';
15
- import './SpendingCapHero-BeqEPpR_.js';
16
- import './EllipsizedText-ngVXQGn_.js';
17
- import './HandoverContent-C0qfeRAh.js';
1
+ import { I as IMTBLWidgetEvents, C as CommerceFlowType, P as ProviderEventType, a as CommerceEventType, b as ConnectEventType, c as CommerceFailureEventType, d as CommerceSuccessEventType, W as WalletEventType, e as CommerceUserActionEventType, S as SwapEventType, A as AddTokensEventType, B as BridgeEventType, O as OnRampEventType, f as SaleEventType, g as OrchestrationEventType, r as reactExports, V as ViewActions, h as getL2ChainId, i as getL1ChainId, j as ChainId, u as useTranslation, k as useViewState, l as useEventTargetState, m as SharedViews, n as commerceFlows, o as jsx, p as jsxs, L as LoadingView, E as ErrorView, q as ConnectWidget, s as ProvidersContextProvider, t as ConnectLoader, v as ViewContextProvider } from './index-CB9YWdxS.js';
2
+ import SwapWidget from './SwapWidget-BUjL8E1t.js';
3
+ import BridgeWidget from './BridgeWidget-DNdm4P40.js';
4
+ import { O as OnRampWidget } from './OnRampWidget-DRayHgnD.js';
5
+ import WalletWidget from './WalletWidget-BxBGnI3n.js';
6
+ import SaleWidget from './SaleWidget-DztSk2UN.js';
7
+ import AddTokensWidget from './AddTokensWidget-DS4GOnbQ.js';
8
+ import './WalletApproveHero-BU16nd9U.js';
9
+ import './TokenImage-d3u0ZvQH.js';
10
+ import './FeesBreakdown-CZuqljfy.js';
11
+ import './CryptoFiatProvider-D6MFlvbF.js';
12
+ import './useInterval-B8niXF8W.js';
13
+ import './index-LSVL9_fH.js';
14
+ import './TopUpView-XlT3otoq.js';
15
+ import './SpendingCapHero-BTLwIZz3.js';
16
+ import './EllipsizedText-CJWQB2xz.js';
17
+ import './HandoverContent-rAxG25Cv.js';
18
18
 
19
19
  const sendCheckoutEvent = (eventTarget, detail) => {
20
20
  const event = new CustomEvent(IMTBLWidgetEvents.IMTBL_COMMERCE_WIDGET_EVENT, { detail });
@@ -1,4 +1,4 @@
1
- import { bf as Environment, c0 as axios, r as reactExports, o as jsx } from './index-DVVgTW38.js';
1
+ import { bg as Environment, c4 as axios, r as reactExports, o as jsx } from './index-CB9YWdxS.js';
2
2
 
3
3
  /**
4
4
  * Class representing the configuration for the CryptoFiatModule.
@@ -1,4 +1,4 @@
1
- import { cL as defineReadOnly, cM as getStatic, cN as Signer, cO as Provider, cP as getAddress, cQ as Logger, cR as getContractAddress, cS as Interface, cT as shallowCopy, cU as VoidSigner, cV as Indexed, cW as deepCopy, cX as isHexString, cY as checkResultErrors, cZ as resolveProperties, an as BigNumber, c_ as accessListify, c$ as arrayify, o as jsx, _ as _objectWithoutProperties, bv as cloneElementWithCssProp, M as Body, U as _defineProperty } from './index-DVVgTW38.js';
1
+ import { cO as defineReadOnly, cP as getStatic, cQ as Signer, cR as Provider, cS as getAddress, cT as Logger, cU as getContractAddress, cV as Interface, cW as shallowCopy, cX as VoidSigner, cY as Indexed, cZ as deepCopy, c_ as isHexString, c$ as checkResultErrors, d0 as resolveProperties, an as BigNumber, d1 as accessListify, d2 as arrayify, o as jsx, _ as _objectWithoutProperties, bw as cloneElementWithCssProp, M as Body, U as _defineProperty } from './index-CB9YWdxS.js';
2
2
 
3
3
  const version = "contracts/5.7.0";
4
4
 
@@ -1,4 +1,4 @@
1
- import { p as jsxs, o as jsx, M as Body, bh as PriceDisplay, H as Box, u as useTranslation, aw as Drawer, ak as MenuItem, at as Fragment, as as Divider, al as tokenValueFormat, cn as formatZeroAmount, bI as FooterLogo } from './index-DVVgTW38.js';
1
+ import { p as jsxs, o as jsx, M as Body, bi as PriceDisplay, H as Box, u as useTranslation, aw as Drawer, ak as MenuItem, at as Fragment, as as Divider, al as tokenValueFormat, cq as formatZeroAmount, bL as FooterLogo } from './index-CB9YWdxS.js';
2
2
 
3
3
  const feesBreakdownContentStyles = {
4
4
  display: 'flex',
@@ -1,4 +1,4 @@
1
- import { p as jsxs, H as Box, o as jsx, aA as Heading, M as Body, T as Button } from './index-DVVgTW38.js';
1
+ import { p as jsxs, H as Box, o as jsx, aA as Heading, M as Body, T as Button } from './index-CB9YWdxS.js';
2
2
 
3
3
  function HandoverContent({ headingText, subheadingText, primaryButtonText, onPrimaryButtonClick, secondaryButtonText, onSecondaryButtonClick, }) {
4
4
  return (jsxs(Box, { sx: {
@@ -1,6 +1,6 @@
1
- import { d0 as global, ax as useAnalytics, r as reactExports, bU as ConnectLoaderContext, aQ as EventTargetContext, u as useTranslation, aL as ViewContext, m as SharedViews, d1 as ExchangeType, o as jsx, aX as SimpleLayout, bF as HeaderNavigation, d2 as sendOnRampWidgetCloseEvent, a$ as orchestrationEvents, I as IMTBLWidgetEvents, H as Box, ay as UserJourney, V as ViewActions, bI as FooterLogo, p as jsxs, cA as SimpleTextBody, bi as viewReducer, bj as initialViewState, co as NATIVE, L as LoadingView, d3 as sendOnRampSuccessEvent, bJ as StatusType, cH as StatusView, d4 as sendOnRampFailedEvent } from './index-DVVgTW38.js';
2
- import { O as OnRampWidgetViews, T as TopUpView } from './TopUpView-BBUB2cpE.js';
3
- import { S as SpendingCapHero } from './SpendingCapHero-BeqEPpR_.js';
1
+ import { d3 as global, ax as useAnalytics, r as reactExports, bX as ConnectLoaderContext, aP as EventTargetContext, u as useTranslation, aK as ViewContext, m as SharedViews, d4 as ExchangeType, o as jsx, a$ as SimpleLayout, bH as HeaderNavigation, d5 as sendOnRampWidgetCloseEvent, b0 as orchestrationEvents, I as IMTBLWidgetEvents, H as Box, ay as UserJourney, V as ViewActions, bL as FooterLogo, p as jsxs, cD as SimpleTextBody, bj as viewReducer, bk as initialViewState, cr as NATIVE, L as LoadingView, d6 as sendOnRampSuccessEvent, bM as StatusType, cK as StatusView, d7 as sendOnRampFailedEvent } from './index-CB9YWdxS.js';
2
+ import { O as OnRampWidgetViews, T as TopUpView } from './TopUpView-XlT3otoq.js';
3
+ import { S as SpendingCapHero } from './SpendingCapHero-BTLwIZz3.js';
4
4
 
5
5
  function isNull(arg) {
6
6
  return arg === null;