@funkit/connect 9.25.0 → 9.26.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 (30) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/clients/{chunk-7G3QEQFB.js → chunk-2NBYHUIW.js} +1 -1
  3. package/dist/clients/{chunk-SQ2RX7WY.js → chunk-4IWQ2UT5.js} +11 -8
  4. package/dist/clients/{chunk-VJZW3MA3.js → chunk-F4SCUKY6.js} +1 -1
  5. package/dist/clients/{chunk-7UIDHSYG.js → chunk-LUHEVXPD.js} +1 -8
  6. package/dist/clients/chunk-STLOQEN7.js +11 -0
  7. package/dist/clients/chunk-UPZNKPYU.js +27 -0
  8. package/dist/clients/{chunk-MXPZTW2H.js → chunk-VT3ERWXE.js} +4 -2
  9. package/dist/clients/fanatics.js +5 -3
  10. package/dist/clients/lighter.js +7 -4
  11. package/dist/clients/mallard.d.ts +43 -1
  12. package/dist/clients/mallard.js +112 -3
  13. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +7 -5
  14. package/dist/clients/polymarket/createPolymarketDepositConfig.js +2 -2
  15. package/dist/clients/polymarket/index.js +7 -5
  16. package/dist/clients/polymarket/polymarket.js +1 -1
  17. package/dist/domains/clientMetadata.d.ts +21 -0
  18. package/dist/index.js +567 -242
  19. package/dist/modals/CheckoutModal/SourceChange/FormOfPaymentsList.d.ts +1 -1
  20. package/dist/modals/CheckoutModal/SourceChange/buildSourceGroups.d.ts +2 -2
  21. package/dist/modals/WithdrawalModal/RecipientAddress.d.ts +12 -0
  22. package/dist/modals/WithdrawalModal/WithdrawalSwappedIframeController.d.ts +3 -1
  23. package/dist/modals/WithdrawalModal/useFiatWithdrawal.d.ts +40 -0
  24. package/dist/modals/WithdrawalModal/useWithdrawal.d.ts +2 -2
  25. package/dist/providers/FunkitCheckoutContext/types.d.ts +18 -0
  26. package/dist/utils/swappedRouteOverride.d.ts +27 -0
  27. package/dist/wagmi/actions.d.ts +1 -1
  28. package/dist/wallets/walletConnectors/index.js +26 -26
  29. package/package.json +3 -3
  30. /package/dist/clients/{chunk-ME4OAQIY.js → chunk-O5CTDT3L.js} +0 -0
package/dist/index.js CHANGED
@@ -448,7 +448,7 @@ function Avatar({ address, imageUrl, loading, size }) {
448
448
  }
449
449
 
450
450
  // src/components/ConnectButton/ConnectButton.tsx
451
- import React302, { useEffect as useEffect83, useState as useState88 } from "react";
451
+ import React302, { useEffect as useEffect84, useState as useState88 } from "react";
452
452
 
453
453
  // src/css/touchableStyles.css.ts
454
454
  var active = { shrink: "_7rkubb8", shrinkSm: "_7rkubb9" };
@@ -973,12 +973,12 @@ import { arbitrum as arbitrum7, polygon as polygon8 } from "viem/chains";
973
973
 
974
974
  // src/domains/asset.ts
975
975
  import {
976
- FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO12,
976
+ FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO13,
977
977
  hyperEvmChain as hyperEvmChain4,
978
978
  monadChain as monadChain2,
979
979
  solanaChain as solanaChain6
980
980
  } from "@funkit/chains";
981
- import { isTokenAddressEquivalent as isTokenAddressEquivalent6, isTokenEquivalent as isTokenEquivalent14 } from "@funkit/utils";
981
+ import { isTokenAddressEquivalent as isTokenAddressEquivalent6, isTokenEquivalent as isTokenEquivalent15 } from "@funkit/utils";
982
982
  import { arbitrum as arbitrum6, base as base6, bsc as bsc2, mainnet as mainnet13, optimism as optimism2, polygon as polygon7 } from "viem/chains";
983
983
 
984
984
  // src/utils/checkout.ts
@@ -989,7 +989,7 @@ import {
989
989
  } from "@funkit/connect-core";
990
990
  import {
991
991
  FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS as FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS5,
992
- FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO11,
992
+ FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO12,
993
993
  lightningChain as lightningChain4,
994
994
  solanaChain as solanaChain5,
995
995
  tronChain as tronChain4
@@ -999,11 +999,11 @@ import {
999
999
  formatCryptoAndStringify as formatCryptoAndStringify11,
1000
1000
  isNumericString,
1001
1001
  isTokenAddressEquivalent as isTokenAddressEquivalent5,
1002
- isTokenEquivalent as isTokenEquivalent13,
1002
+ isTokenEquivalent as isTokenEquivalent14,
1003
1003
  round as round3
1004
1004
  } from "@funkit/utils";
1005
1005
  import * as dnum12 from "dnum";
1006
- import { erc20Abi as erc20Abi8, formatUnits as formatUnits5 } from "viem";
1006
+ import { erc20Abi as erc20Abi9, formatUnits as formatUnits5 } from "viem";
1007
1007
 
1008
1008
  // src/consts/customers.ts
1009
1009
  import {
@@ -1073,11 +1073,14 @@ import {
1073
1073
  } from "wagmi/actions";
1074
1074
  import {
1075
1075
  estimateGas,
1076
+ getAccount,
1076
1077
  getGasPrice,
1077
1078
  getTransaction,
1078
1079
  getWalletClient,
1079
1080
  multicall,
1080
1081
  readContract,
1082
+ sendTransaction,
1083
+ switchChain,
1081
1084
  waitForTransactionReceipt
1082
1085
  } from "wagmi/actions";
1083
1086
  async function getBalance(config, params) {
@@ -1121,7 +1124,7 @@ import {
1121
1124
  initializeCheckout as postApiInitializeCheckout
1122
1125
  } from "@funkit/api-base";
1123
1126
  import {
1124
- FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO10,
1127
+ FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO11,
1125
1128
  SOLANA_MAINNET_CHAIN_ID as SOLANA_MAINNET_CHAIN_ID2
1126
1129
  } from "@funkit/chains";
1127
1130
  import { isNotNullish as isNotNullish8, isTokenAddressEquivalent as isTokenAddressEquivalent4 } from "@funkit/utils";
@@ -1129,7 +1132,7 @@ import React300, {
1129
1132
  createContext as createContext21,
1130
1133
  useCallback as useCallback58,
1131
1134
  useContext as useContext21,
1132
- useEffect as useEffect82,
1135
+ useEffect as useEffect83,
1133
1136
  useState as useState87
1134
1137
  } from "react";
1135
1138
  import { flushSync as flushSync2 } from "react-dom";
@@ -1544,6 +1547,25 @@ function stripFunctionsForBackend(config) {
1544
1547
  )
1545
1548
  };
1546
1549
  }
1550
+ function createNewCheckoutConfig({
1551
+ serializedConfig,
1552
+ liveConfig,
1553
+ isActiveCheckout
1554
+ }) {
1555
+ return {
1556
+ // Serialized history rehydrated into a live config; every function-valued
1557
+ // field is re-bound below.
1558
+ ...serializedConfig,
1559
+ dynamicTargetAssetCandidates: isActiveCheckout && liveConfig ? liveConfig.dynamicTargetAssetCandidates : serializedConfig.dynamicTargetAssetCandidates,
1560
+ finalizedToken: isActiveCheckout && liveConfig ? liveConfig.finalizedToken : serializedConfig.finalizedToken,
1561
+ modalTitle: liveConfig?.modalTitle ?? serializedConfig.modalTitle,
1562
+ withdrawalSourceTokenBalance: liveConfig?.withdrawalSourceTokenBalance,
1563
+ getMinDepositUSD: isActiveCheckout ? liveConfig?.getMinDepositUSD : void 0,
1564
+ generateActionsParams: isActiveCheckout ? liveConfig?.generateActionsParams : void 0,
1565
+ polymarketPerpsTransfer: isActiveCheckout ? liveConfig?.polymarketPerpsTransfer : void 0,
1566
+ resolveHealthFactor: isActiveCheckout ? liveConfig?.resolveHealthFactor : void 0
1567
+ };
1568
+ }
1547
1569
  function generateClientMetadataForBackend({
1548
1570
  checkoutItem,
1549
1571
  latestQuote,
@@ -1661,7 +1683,7 @@ function setFunkitConnectVersion({ version }) {
1661
1683
  localStorage.setItem(storageKey, version);
1662
1684
  }
1663
1685
  function getCurrentSdkVersion() {
1664
- return "9.25.0";
1686
+ return "9.26.0";
1665
1687
  }
1666
1688
  function useFingerprint() {
1667
1689
  const fingerprint = useCallback3(() => {
@@ -5013,7 +5035,7 @@ var useFunkitSwitchChains = ({
5013
5035
  onSettled
5014
5036
  }) => {
5015
5037
  const [pendingChainId, setPendingChainId] = useState11(null);
5016
- const { switchChain, switchChainAsync } = useSwitchChain({
5038
+ const { switchChain: switchChain2, switchChainAsync } = useSwitchChain({
5017
5039
  mutation: {
5018
5040
  onMutate: ({ chainId: _chainId }) => {
5019
5041
  setPendingChainId(_chainId);
@@ -5034,7 +5056,7 @@ var useFunkitSwitchChains = ({
5034
5056
  }
5035
5057
  });
5036
5058
  return {
5037
- switchChain,
5059
+ switchChain: switchChain2,
5038
5060
  switchChainAsync,
5039
5061
  pendingChainId
5040
5062
  };
@@ -6150,7 +6172,7 @@ import React299, {
6150
6172
  createContext as createContext20,
6151
6173
  useCallback as useCallback57,
6152
6174
  useContext as useContext20,
6153
- useEffect as useEffect81,
6175
+ useEffect as useEffect82,
6154
6176
  useMemo as useMemo66,
6155
6177
  useState as useState86
6156
6178
  } from "react";
@@ -6169,7 +6191,7 @@ var topbarFadeWrapper = "_1r8f577";
6169
6191
  var topbarOverflowContent = "_1r8f576 _1rsrm2fq3 _1rsrm2fs4";
6170
6192
 
6171
6193
  // src/modals/WithdrawalModal/WithdrawalModal.tsx
6172
- import React146, { useCallback as useCallback29, useEffect as useEffect48, useState as useState44 } from "react";
6194
+ import React146, { useCallback as useCallback29, useEffect as useEffect49, useState as useState44 } from "react";
6173
6195
  import { mainnet as mainnet9 } from "viem/chains";
6174
6196
 
6175
6197
  // src/components/FreeUsdcBanner/FreeUsdcBanner.tsx
@@ -8540,6 +8562,7 @@ import { RemoveScroll } from "react-remove-scroll";
8540
8562
  import { AnimatePresence as AnimatePresence3, motion as motion7 } from "motion/react";
8541
8563
 
8542
8564
  // src/providers/FunkitProvider.tsx
8565
+ import { LogLevel as LogLevel2, initializeRelayClient } from "@funkit/fun-relay";
8543
8566
  import { QueryClientProvider } from "@tanstack/react-query";
8544
8567
  import React55, {
8545
8568
  createContext as createContext18,
@@ -10909,7 +10932,7 @@ var en_default = {
10909
10932
  native: "Native",
10910
10933
  supplyNativeAsset: "Supply {{ticker}}",
10911
10934
  useOtherAssets: "Use other assets",
10912
- useOtherAssetsTooltip: "Pay with any of the assets below; we'll convert and supply automatically.",
10935
+ useOtherAssetsTooltip: "You can supply any asset to this market. Choose what you'd like to supply and it will automatically convert as needed.",
10913
10936
  useAnyAsset: "Use any asset",
10914
10937
  exploreMarketsFirst: "Explore markets first",
10915
10938
  selectTokenLabel: "Select token",
@@ -11508,7 +11531,7 @@ var es_default = {
11508
11531
  native: "Nativo",
11509
11532
  supplyNativeAsset: "Suministrar {{ticker}}",
11510
11533
  useOtherAssets: "Usar otros activos",
11511
- useOtherAssetsTooltip: "Paga con cualquiera de los activos a continuaci\xF3n; los convertiremos y suministraremos autom\xE1ticamente.",
11534
+ useOtherAssetsTooltip: "Puedes suministrar cualquier activo a este mercado. Elige lo que quieras suministrar y se convertir\xE1 autom\xE1ticamente seg\xFAn sea necesario.",
11512
11535
  useAnyAsset: "Usar cualquier activo",
11513
11536
  exploreMarketsFirst: "Explorar mercados primero",
11514
11537
  selectTokenLabel: "Seleccionar token",
@@ -12107,7 +12130,7 @@ var fr_default = {
12107
12130
  native: "Natif",
12108
12131
  supplyNativeAsset: "Fournir {{ticker}}",
12109
12132
  useOtherAssets: "Utiliser d'autres actifs",
12110
- useOtherAssetsTooltip: "Payez avec n'importe quel actif ci-dessous ; nous convertirons et fournirons automatiquement.",
12133
+ useOtherAssetsTooltip: "Vous pouvez fournir n'importe quel actif \xE0 ce march\xE9. Choisissez ce que vous souhaitez fournir et il sera automatiquement converti selon les besoins.",
12111
12134
  useAnyAsset: "Utiliser n'importe quel actif",
12112
12135
  exploreMarketsFirst: "Explorer les march\xE9s d'abord",
12113
12136
  selectTokenLabel: "S\xE9lectionner le token",
@@ -12706,7 +12729,7 @@ var ja_default = {
12706
12729
  native: "\u30CD\u30A4\u30C6\u30A3\u30D6",
12707
12730
  supplyNativeAsset: "{{ticker}}\u3092\u4F9B\u7D66",
12708
12731
  useOtherAssets: "\u4ED6\u306E\u8CC7\u7523\u3092\u4F7F\u7528",
12709
- useOtherAssetsTooltip: "\u4EE5\u4E0B\u306E\u3044\u305A\u308C\u304B\u306E\u8CC7\u7523\u3067\u652F\u6255\u3046\u3068\u3001\u81EA\u52D5\u7684\u306B\u5909\u63DB\u3057\u3066\u4F9B\u7D66\u3057\u307E\u3059\u3002",
12732
+ useOtherAssetsTooltip: "\u3053\u306E\u30DE\u30FC\u30B1\u30C3\u30C8\u306B\u306F\u4EFB\u610F\u306E\u8CC7\u7523\u3092\u4F9B\u7D66\u3067\u304D\u307E\u3059\u3002\u4F9B\u7D66\u3057\u305F\u3044\u8CC7\u7523\u3092\u9078\u629E\u3059\u308B\u3068\u3001\u5FC5\u8981\u306B\u5FDC\u3058\u3066\u81EA\u52D5\u7684\u306B\u5909\u63DB\u3055\u308C\u307E\u3059\u3002",
12710
12733
  useAnyAsset: "\u4EFB\u610F\u306E\u8CC7\u7523\u3092\u4F7F\u7528",
12711
12734
  exploreMarketsFirst: "\u6700\u521D\u306B\u30DE\u30FC\u30B1\u30C3\u30C8\u3092\u63A2\u7D22",
12712
12735
  selectTokenLabel: "\u30C8\u30FC\u30AF\u30F3\u3092\u9078\u629E",
@@ -13305,7 +13328,7 @@ var ko_default = {
13305
13328
  native: "\uB124\uC774\uD2F0\uBE0C",
13306
13329
  supplyNativeAsset: "{{ticker}} \uACF5\uAE09",
13307
13330
  useOtherAssets: "\uB2E4\uB978 \uC790\uC0B0 \uC0AC\uC6A9",
13308
- useOtherAssetsTooltip: "\uC544\uB798 \uC790\uC0B0 \uC911 \uD558\uB098\uB85C \uACB0\uC81C\uD558\uBA74 \uC790\uB3D9\uC73C\uB85C \uBCC0\uD658\uD558\uC5EC \uACF5\uAE09\uD569\uB2C8\uB2E4.",
13331
+ useOtherAssetsTooltip: "\uC774 \uB9C8\uCF13\uC5D0\uB294 \uC5B4\uB5A4 \uC790\uC0B0\uC774\uB4E0 \uACF5\uAE09\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uACF5\uAE09\uD560 \uC790\uC0B0\uC744 \uC120\uD0DD\uD558\uBA74 \uD544\uC694\uC5D0 \uB530\uB77C \uC790\uB3D9\uC73C\uB85C \uBCC0\uD658\uB429\uB2C8\uB2E4.",
13309
13332
  useAnyAsset: "\uBAA8\uB4E0 \uC790\uC0B0 \uC0AC\uC6A9",
13310
13333
  exploreMarketsFirst: "\uBA3C\uC800 \uB9C8\uCF13 \uD0D0\uC0C9",
13311
13334
  selectTokenLabel: "\uD1A0\uD070 \uC120\uD0DD",
@@ -13904,7 +13927,7 @@ var ru_default = {
13904
13927
  native: "\u041D\u0430\u0442\u0438\u0432\u043D\u044B\u0439",
13905
13928
  supplyNativeAsset: "\u041F\u043E\u0441\u0442\u0430\u0432\u0438\u0442\u044C {{ticker}}",
13906
13929
  useOtherAssets: "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0434\u0440\u0443\u0433\u0438\u0435 \u0430\u043A\u0442\u0438\u0432\u044B",
13907
- useOtherAssetsTooltip: "\u041F\u043B\u0430\u0442\u0438\u0442\u0435 \u043B\u044E\u0431\u044B\u043C \u0430\u043A\u0442\u0438\u0432\u043E\u043C \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430 \u043D\u0438\u0436\u0435 \u2014 \u043C\u044B \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438 \u043A\u043E\u043D\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u043C \u0438 \u043F\u043E\u0441\u0442\u0430\u0432\u0438\u043C.",
13930
+ useOtherAssetsTooltip: "\u0412\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u043F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u044D\u0442\u043E\u043C\u0443 \u0440\u044B\u043D\u043A\u0443 \u043B\u044E\u0431\u043E\u0439 \u0430\u043A\u0442\u0438\u0432. \u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435, \u0447\u0442\u043E \u0445\u043E\u0442\u0438\u0442\u0435 \u043F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u0438\u0442\u044C, \u0438 \u043E\u043D \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438 \u043A\u043E\u043D\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044F \u043F\u043E \u043C\u0435\u0440\u0435 \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E\u0441\u0442\u0438.",
13908
13931
  useAnyAsset: "\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u043B\u044E\u0431\u043E\u0439 \u0430\u043A\u0442\u0438\u0432",
13909
13932
  exploreMarketsFirst: "\u0421\u043D\u0430\u0447\u0430\u043B\u0430 \u0438\u0437\u0443\u0447\u0438\u0442\u0435 \u0440\u044B\u043D\u043A\u0438",
13910
13933
  selectTokenLabel: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0442\u043E\u043A\u0435\u043D",
@@ -14503,7 +14526,7 @@ var tr_default = {
14503
14526
  native: "Yerel",
14504
14527
  supplyNativeAsset: "{{ticker}} Sa\u011Fla",
14505
14528
  useOtherAssets: "Di\u011Fer varl\u0131klar\u0131 kullan",
14506
- useOtherAssetsTooltip: "A\u015Fa\u011F\u0131daki varl\u0131klardan biriyle \xF6deyin; otomatik olarak d\xF6n\xFC\u015Ft\xFCr\xFCp sa\u011Flayaca\u011F\u0131z.",
14529
+ useOtherAssetsTooltip: "Bu piyasaya herhangi bir varl\u0131k sa\u011Flayabilirsiniz. Sa\u011Flamak istedi\u011Finiz varl\u0131\u011F\u0131 se\xE7in; gerekti\u011Finde otomatik olarak d\xF6n\xFC\u015Ft\xFCr\xFCl\xFCr.",
14507
14530
  useAnyAsset: "Herhangi bir varl\u0131\u011F\u0131 kullan",
14508
14531
  exploreMarketsFirst: "\xD6nce piyasalar\u0131 ke\u015Ffedin",
14509
14532
  selectTokenLabel: "Token se\xE7in",
@@ -15102,7 +15125,7 @@ var zh_default = {
15102
15125
  native: "\u539F\u751F",
15103
15126
  supplyNativeAsset: "\u4F9B\u5E94 {{ticker}}",
15104
15127
  useOtherAssets: "\u4F7F\u7528\u5176\u4ED6\u8D44\u4EA7",
15105
- useOtherAssetsTooltip: "\u4F7F\u7528\u4EE5\u4E0B\u4EFB\u4E00\u8D44\u4EA7\u652F\u4ED8\uFF1B\u6211\u4EEC\u5C06\u81EA\u52A8\u8F6C\u6362\u5E76\u4F9B\u5E94\u3002",
15128
+ useOtherAssetsTooltip: "\u60A8\u53EF\u4EE5\u5411\u8BE5\u5E02\u573A\u4F9B\u5E94\u4EFB\u4F55\u8D44\u4EA7\u3002\u9009\u62E9\u60A8\u60F3\u4F9B\u5E94\u7684\u8D44\u4EA7\uFF0C\u5B83\u5C06\u6839\u636E\u9700\u8981\u81EA\u52A8\u8F6C\u6362\u3002",
15106
15129
  useAnyAsset: "\u4F7F\u7528\u4EFB\u4F55\u8D44\u4EA7",
15107
15130
  exploreMarketsFirst: "\u5148\u63A2\u7D22\u5E02\u573A",
15108
15131
  selectTokenLabel: "\u9009\u62E9\u4EE3\u5E01",
@@ -17139,6 +17162,34 @@ function FunkitProvider(props) {
17139
17162
  ));
17140
17163
  return finalWagmiConfig && finalQueryClient ? /* @__PURE__ */ React55.createElement(WagmiProvider, { config: finalWagmiConfig }, /* @__PURE__ */ React55.createElement(QueryClientProvider, { client: finalQueryClient }, MainChild)) : MainChild;
17141
17164
  }
17165
+ function getConfiguredHttpRpcUrl(config, chainId2) {
17166
+ const transport = config.getClient({ chainId: chainId2 }).transport;
17167
+ if (typeof transport.url === "string") {
17168
+ return transport.url;
17169
+ }
17170
+ return transport.transports?.[0]?.value?.url;
17171
+ }
17172
+ function useInitializeRelayClient() {
17173
+ const config = useConfig();
17174
+ const initializedRef = useRef9(false);
17175
+ useEffect26(() => {
17176
+ if (initializedRef.current) {
17177
+ return;
17178
+ }
17179
+ initializedRef.current = true;
17180
+ const chains = config.chains.map((chain) => {
17181
+ const httpUrl = getConfiguredHttpRpcUrl(config, chain.id);
17182
+ return httpUrl ? {
17183
+ ...chain,
17184
+ rpcUrls: {
17185
+ ...chain.rpcUrls,
17186
+ default: { ...chain.rpcUrls.default, http: [httpUrl] }
17187
+ }
17188
+ } : chain;
17189
+ });
17190
+ initializeRelayClient({ chains, logLevel: LogLevel2.Verbose, logger });
17191
+ }, [config]);
17192
+ }
17142
17193
  function FunkitProviderInner({
17143
17194
  avatar,
17144
17195
  children,
@@ -17154,6 +17205,7 @@ function FunkitProviderInner({
17154
17205
  usePreloadImages();
17155
17206
  useFingerprint();
17156
17207
  useAccountEffect({ onDisconnect: clearWalletConnectDeepLink });
17208
+ useInitializeRelayClient();
17157
17209
  const { activeTheme } = useActiveTheme();
17158
17210
  const selector = useMemo24(() => createThemeRootSelector(id), [id]);
17159
17211
  const themeRootProps = useMemo24(() => createThemeRootProps(id), [id]);
@@ -23106,19 +23158,11 @@ function FunDirectExecutionHistoryDetail({
23106
23158
  (fromCheckout) => {
23107
23159
  onClose({ isNewDeposit: true });
23108
23160
  const historicalCheckout = fromCheckout.clientMetadata;
23109
- const checkoutConfig = {
23110
- ...historicalCheckout.initSettings.config,
23111
- modalTitle: oldCheckoutConfig?.modalTitle ?? historicalCheckout.initSettings.config.modalTitle,
23112
- getMinDepositUSD: oldCheckoutConfig?.getMinDepositUSD,
23113
- withdrawalSourceTokenBalance: oldCheckoutConfig?.withdrawalSourceTokenBalance,
23114
- // can't preserve this if initially part of checkout, get from current config (?)
23115
- generateActionsParams: isActiveCheckout ? oldCheckoutConfig?.generateActionsParams : void 0,
23116
- // Live transfer handles aren't restorable from serialized history;
23117
- // only carry them forward when re-depositing off the active checkout.
23118
- polymarketPerpsTransfer: isActiveCheckout ? oldCheckoutConfig?.polymarketPerpsTransfer : void 0,
23119
- // HF resolver is a closure over live position data — not serializable.
23120
- resolveHealthFactor: isActiveCheckout ? oldCheckoutConfig?.resolveHealthFactor : void 0
23121
- };
23161
+ const checkoutConfig = createNewCheckoutConfig({
23162
+ serializedConfig: historicalCheckout.initSettings.config,
23163
+ liveConfig: oldCheckoutConfig,
23164
+ isActiveCheckout
23165
+ });
23122
23166
  onAnimationComplete?.(() => beginCheckout(checkoutConfig));
23123
23167
  },
23124
23168
  [
@@ -25757,17 +25801,29 @@ function getAlertMessage(selectedChainId, selectedToken, t) {
25757
25801
  token: selectedToken
25758
25802
  });
25759
25803
  }
25804
+ function shouldShowUseConnectedWallet({
25805
+ disableConnectedWallet,
25806
+ isConnected,
25807
+ connectedWalletAddress
25808
+ }) {
25809
+ return Boolean(
25810
+ !disableConnectedWallet && isConnected && connectedWalletAddress
25811
+ );
25812
+ }
25760
25813
  function useShowConnectWallet({ config }) {
25761
- const withdrawalWalletAddress = "wallet" in config ? config.wallet.address() : "0x";
25762
25814
  const { isConnected, address: connectedWalletAddress } = useAccount();
25763
- const showUseConnected = !config.disableConnectedWallet && isConnected && connectedWalletAddress && withdrawalWalletAddress.toLowerCase() !== connectedWalletAddress.toLowerCase();
25815
+ const showUseConnected = shouldShowUseConnectedWallet({
25816
+ disableConnectedWallet: config.disableConnectedWallet,
25817
+ isConnected,
25818
+ connectedWalletAddress
25819
+ });
25764
25820
  useEffect41(() => {
25765
25821
  logger.debug("withdrawalContent:showUseConnected", {
25766
25822
  isConnected,
25767
25823
  connectedWalletAddress,
25768
- withdrawalWalletAddress
25824
+ showUseConnected
25769
25825
  });
25770
- }, [isConnected, connectedWalletAddress, withdrawalWalletAddress]);
25826
+ }, [isConnected, connectedWalletAddress, showUseConnected]);
25771
25827
  return showUseConnected;
25772
25828
  }
25773
25829
  function getRecipientAddressPlaceholder(selectedChainId, t) {
@@ -26554,7 +26610,8 @@ function useWithdrawal({
26554
26610
  stepMessage: step,
26555
26611
  withdrawalAmountUSD: formData.withdrawalUSD
26556
26612
  });
26557
- onSuccess(formData, txHash);
26613
+ onSuccess?.(formData, txHash);
26614
+ return txHash;
26558
26615
  } catch (err) {
26559
26616
  const caughtError = err instanceof Error ? err : new Error("Unknown withdrawal error");
26560
26617
  const isNestedError = caughtError.message === "Invalid txHash - unable to proceed with withdrawal" || caughtError.message === "Invalid withdrawal config";
@@ -26577,6 +26634,7 @@ function useWithdrawal({
26577
26634
  message: err.message,
26578
26635
  metadata: err
26579
26636
  });
26637
+ return null;
26580
26638
  } finally {
26581
26639
  setIsWithdrawing(false);
26582
26640
  setStep(null);
@@ -27321,6 +27379,28 @@ import React139 from "react";
27321
27379
  import { RailConfigType as RailConfigType2, getFops as getFops3 } from "@funkit/api-base";
27322
27380
  import { useQuery as useQuery21 } from "@tanstack/react-query";
27323
27381
  import { useMemo as useMemo41 } from "react";
27382
+
27383
+ // src/utils/swappedRouteOverride.ts
27384
+ import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO9 } from "@funkit/chains";
27385
+ import { isTokenEquivalent as isTokenEquivalent6 } from "@funkit/utils";
27386
+ var isNonEmptyString = (value) => typeof value === "string" && value.length > 0;
27387
+ var isSupportedChainId = (value) => typeof value === "string" && /^\d+$/.test(value) && Boolean(FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO9[Number(value)]);
27388
+ var isEvmAddress = (value) => typeof value === "string" && /^0x[a-fA-F0-9]{40}$/.test(value);
27389
+ function isWellFormedOverride(override) {
27390
+ return isSupportedChainId(override.when?.chainId) && isEvmAddress(override.when?.tokenAddress) && isSupportedChainId(override.use?.chainId) && isEvmAddress(override.use?.tokenAddress) && isNonEmptyString(override.use?.symbol);
27391
+ }
27392
+ function findSwappedSourceOverride(overrides, source) {
27393
+ return overrides?.find(
27394
+ (override) => isWellFormedOverride(override) && isTokenEquivalent6({
27395
+ firstTokenChainId: override.when.chainId,
27396
+ firstTokenAddress: override.when.tokenAddress,
27397
+ secondTokenChainId: source.chainId,
27398
+ secondTokenAddress: source.tokenAddress
27399
+ })
27400
+ );
27401
+ }
27402
+
27403
+ // src/hooks/queries/useWithdrawFops.ts
27324
27404
  var useWithdrawFops = (params) => {
27325
27405
  const { apiKey } = useFunkitConfig();
27326
27406
  const { userInfo } = useGeneralWallet();
@@ -27332,6 +27412,18 @@ var useWithdrawFops = (params) => {
27332
27412
  isLoading: isSwappedCurrencyCodeLoading
27333
27413
  } = useSwappedDefaultCurrency();
27334
27414
  const fopPriority = useDynamicConfig("foppriority");
27415
+ const sourceOverrides = useDynamicConfig("swappedwithdrawalsourceoverrides");
27416
+ const sourceOverride = useMemo41(
27417
+ () => findSwappedSourceOverride(sourceOverrides, {
27418
+ chainId: params.sourceChainId,
27419
+ tokenAddress: params.sourceTokenAddress
27420
+ }),
27421
+ [sourceOverrides, params.sourceChainId, params.sourceTokenAddress]
27422
+ );
27423
+ const acceptedToken = sourceOverride ? {
27424
+ chainId: sourceOverride.use.chainId,
27425
+ address: sourceOverride.use.tokenAddress
27426
+ } : { chainId: params.sourceChainId, address: params.sourceTokenAddress };
27335
27427
  const themeConfig = useMemo41(
27336
27428
  () => buildSwappedThemeQueryParams(resolveObjectCssVars(activeTheme)),
27337
27429
  [activeTheme]
@@ -27351,12 +27443,22 @@ var useWithdrawFops = (params) => {
27351
27443
  themeConfig,
27352
27444
  fopPriority,
27353
27445
  params.sourceChainId,
27354
- params.sourceTokenAddress
27446
+ params.sourceTokenAddress,
27447
+ acceptedToken.chainId,
27448
+ acceptedToken.address
27355
27449
  ],
27356
27450
  queryFn: async () => {
27357
27451
  if (!isEnabled) {
27358
27452
  return { genericFormsOfPayments: [], savedFormsOfPayments: [] };
27359
27453
  }
27454
+ if (sourceOverride) {
27455
+ logger.info("withdraw-fops:source_override", {
27456
+ sourceChainId: params.sourceChainId,
27457
+ sourceTokenAddress: params.sourceTokenAddress,
27458
+ acceptedChainId: acceptedToken.chainId,
27459
+ acceptedTokenAddress: acceptedToken.address
27460
+ });
27461
+ }
27360
27462
  const thirdPartyPaymentConfigs = buildSwappedThirdPartyPaymentConfigs(
27361
27463
  prefillFiatEmail,
27362
27464
  themeConfig,
@@ -27371,10 +27473,7 @@ var useWithdrawFops = (params) => {
27371
27473
  // only reads railConfigs[].sourceToken.
27372
27474
  recipientAddress: userInfo.address,
27373
27475
  userId,
27374
- destinationToken: {
27375
- chainId: params.sourceChainId,
27376
- address: params.sourceTokenAddress
27377
- },
27476
+ destinationToken: acceptedToken,
27378
27477
  fiatCurrencyCode: swappedCurrencyCode,
27379
27478
  countryCode,
27380
27479
  railConfigs: [
@@ -27383,10 +27482,7 @@ var useWithdrawFops = (params) => {
27383
27482
  userId,
27384
27483
  countryCode,
27385
27484
  fiatCurrencyCode: swappedCurrencyCode,
27386
- sourceToken: {
27387
- chainId: params.sourceChainId,
27388
- address: params.sourceTokenAddress
27389
- },
27485
+ sourceToken: acceptedToken,
27390
27486
  thirdPartyPaymentConfigs,
27391
27487
  checkoutLimitsCriteria: { defaultMinAmount: 7 }
27392
27488
  // EUR — Swapped's hard minimum sell amount
@@ -27601,7 +27697,7 @@ function getFormOfPaymentSections(fopsData, fopPriority) {
27601
27697
  items: genericFormsOfPayments.filter(
27602
27698
  (fop) => fop.fopType !== popularFopType
27603
27699
  ),
27604
- labelKey: "sourceChange.otherOptions"
27700
+ labelKey: "sourceChange.moreOptions"
27605
27701
  }
27606
27702
  };
27607
27703
  }
@@ -27826,7 +27922,7 @@ function WithdrawalMethodSelect({
27826
27922
 
27827
27923
  // src/modals/WithdrawalModal/WithdrawalSwappedIframeController.tsx
27828
27924
  import { useQueryClient as useQueryClient4 } from "@tanstack/react-query";
27829
- import React141, { useEffect as useEffect46 } from "react";
27925
+ import React141, { useEffect as useEffect47 } from "react";
27830
27926
  import { Trans as Trans9 } from "react-i18next";
27831
27927
 
27832
27928
  // src/components/SwappedIframeSkeleton.tsx
@@ -27974,9 +28070,239 @@ function useSwappedIframeLifecycle({
27974
28070
  }, [isSwappedReady, stableOnTimeout]);
27975
28071
  }
27976
28072
 
28073
+ // src/modals/WithdrawalModal/useFiatWithdrawal.ts
28074
+ import { getCheckoutQuoteV2 as getCheckoutQuoteV22 } from "@funkit/api-base";
28075
+ import { useEffect as useEffect46, useRef as useRef22 } from "react";
28076
+ import { erc20Abi as erc20Abi5 } from "viem";
28077
+ function resolveSwappedWithdrawalLegs(config, override) {
28078
+ const sourceChainId = Number(config.sourceChainId);
28079
+ return {
28080
+ sourceChainId,
28081
+ sourceTokenAddress: config.sourceTokenAddress,
28082
+ targetTokenAddress: override?.use.tokenAddress ?? config.swappedTargetTokenAddress ?? config.sourceTokenAddress,
28083
+ targetChainId: override?.use.chainId ?? config.swappedTargetChainId ?? String(sourceChainId),
28084
+ targetTokenSymbol: override?.use.symbol ?? config.swappedTargetTokenSymbol ?? config.sourceTokenSymbol,
28085
+ iconSrc: config.iconSrc ?? void 0,
28086
+ overrideApplied: Boolean(override)
28087
+ };
28088
+ }
28089
+ async function ensureOnSourceChain(wallet, sourceChainId) {
28090
+ const currentChainId = await wallet.getChainId();
28091
+ if (currentChainId === sourceChainId) return;
28092
+ logger.info("fiat-withdrawal:switching_chain", {
28093
+ from: currentChainId,
28094
+ to: sourceChainId
28095
+ });
28096
+ await wallet.switchChain(sourceChainId);
28097
+ }
28098
+ async function quoteOrderExactOut(params) {
28099
+ const {
28100
+ wagmiConfig,
28101
+ apiKey,
28102
+ loginType,
28103
+ checkoutItem,
28104
+ userAddress,
28105
+ legs,
28106
+ order
28107
+ } = params;
28108
+ const targetDecimals = await readContract(wagmiConfig, {
28109
+ address: legs.targetTokenAddress,
28110
+ abi: erc20Abi5,
28111
+ functionName: "decimals",
28112
+ chainId: Number(legs.targetChainId)
28113
+ });
28114
+ const toAmountBaseUnit = toWithdrawalAmountBaseUnit(
28115
+ order.amount,
28116
+ targetDecimals
28117
+ );
28118
+ logger.info("fiat-withdrawal:fetching_quote", {
28119
+ order_id: order.orderId,
28120
+ fromToken: legs.sourceTokenAddress,
28121
+ toToken: legs.targetTokenAddress,
28122
+ toAmountBaseUnit: toAmountBaseUnit.toString()
28123
+ });
28124
+ const quote = await getCheckoutQuoteV22({
28125
+ apiKey,
28126
+ logger,
28127
+ fromChainId: String(legs.sourceChainId),
28128
+ fromTokenAddress: legs.sourceTokenAddress,
28129
+ toChainId: legs.targetChainId,
28130
+ toTokenAddress: legs.targetTokenAddress,
28131
+ recipientAddress: order.destinationAddress,
28132
+ userAddress,
28133
+ toAmountBaseUnit
28134
+ });
28135
+ const { finalEstimation } = await getQuoteFinalEstimation(
28136
+ quote,
28137
+ checkoutItem,
28138
+ createPaymentMethodInfo({
28139
+ paymentMethod: PaymentMethod.ACCOUNT_BALANCE,
28140
+ walletAddress: userAddress
28141
+ }),
28142
+ wagmiConfig,
28143
+ apiKey,
28144
+ loginType,
28145
+ true
28146
+ );
28147
+ return { quote, estimation: finalEstimation };
28148
+ }
28149
+ function useFiatWithdrawal({
28150
+ config,
28151
+ withdrawalItem,
28152
+ onError
28153
+ }) {
28154
+ const wagmiConfig = useConfig();
28155
+ const { apiKey } = useFunkitConfig();
28156
+ const { loginType } = useGeneralWallet();
28157
+ const { checkoutItem, updateTargetAsset } = useCheckoutContext();
28158
+ const sourceOverrides = useDynamicConfig("swappedwithdrawalsourceoverrides");
28159
+ const legs = isWalletWithdrawalConfig(config) ? resolveSwappedWithdrawalLegs(
28160
+ config,
28161
+ findSwappedSourceOverride(sourceOverrides, {
28162
+ chainId: config.sourceChainId,
28163
+ tokenAddress: config.sourceTokenAddress
28164
+ })
28165
+ ) : null;
28166
+ useEffect46(() => {
28167
+ if (!legs || !checkoutItem) return;
28168
+ updateTargetAsset({
28169
+ targetAsset: legs.targetTokenAddress,
28170
+ targetChain: legs.targetChainId,
28171
+ targetAssetTicker: legs.targetTokenSymbol,
28172
+ targetAssetMinAmount: 0,
28173
+ iconSrc: legs.iconSrc
28174
+ });
28175
+ }, [
28176
+ updateTargetAsset,
28177
+ checkoutItem?.id,
28178
+ legs?.targetTokenAddress,
28179
+ legs?.targetChainId,
28180
+ legs?.targetTokenSymbol,
28181
+ legs?.iconSrc
28182
+ ]);
28183
+ const isProcessingOrderRef = useRef22(false);
28184
+ const submittedOrderIdsRef = useRef22(/* @__PURE__ */ new Set());
28185
+ const { handleWithdrawal, withdrawalError } = useWithdrawal({
28186
+ config,
28187
+ withdrawalItem
28188
+ });
28189
+ const handleWithdrawalFailure = useEffectEvent(() => {
28190
+ if (withdrawalError && withdrawalError.code !== "SIGNATURE_DENIED" /* SIGNATURE_DENIED */) {
28191
+ logger.warn("fiat-withdrawal:failed", { code: withdrawalError.code });
28192
+ onError();
28193
+ }
28194
+ });
28195
+ useEffect46(() => {
28196
+ if (withdrawalError) {
28197
+ handleWithdrawalFailure();
28198
+ }
28199
+ }, [withdrawalError, handleWithdrawalFailure]);
28200
+ const rejectOrderBeforeStart = useEffectEvent(
28201
+ (order) => {
28202
+ if (isProcessingOrderRef.current) {
28203
+ logger.warn("fiat-withdrawal:already_processing", {
28204
+ order_id: order.orderId
28205
+ });
28206
+ return true;
28207
+ }
28208
+ if (submittedOrderIdsRef.current.has(order.orderId)) {
28209
+ logger.warn("fiat-withdrawal:duplicate", { order_id: order.orderId });
28210
+ return true;
28211
+ }
28212
+ if (!legs || !isWalletWithdrawalConfig(config)) {
28213
+ logger.error(
28214
+ "fiat-withdrawal:no_wallet",
28215
+ "config is not WalletWithdrawalConfig \u2014 cannot execute withdrawal"
28216
+ );
28217
+ onError();
28218
+ return true;
28219
+ }
28220
+ if (!checkoutItem) {
28221
+ logger.error(
28222
+ "fiat-withdrawal:no_checkout_item",
28223
+ "Missing checkout item for fiat withdrawal quote"
28224
+ );
28225
+ onError();
28226
+ return true;
28227
+ }
28228
+ return false;
28229
+ }
28230
+ );
28231
+ const processOrder = useEffectEvent(async (order) => {
28232
+ if (rejectOrderBeforeStart(order)) return;
28233
+ if (!isWalletWithdrawalConfig(config) || !legs || !checkoutItem) return;
28234
+ const { wallet } = config;
28235
+ const userAddress = wallet.address();
28236
+ isProcessingOrderRef.current = true;
28237
+ logger.info("fiat-withdrawal:route_decision", {
28238
+ order_id: order.orderId,
28239
+ overrideApplied: legs.overrideApplied,
28240
+ requestedTargetChainId: config.swappedTargetChainId,
28241
+ requestedTargetTokenAddress: config.swappedTargetTokenAddress,
28242
+ enforcedTargetChainId: legs.targetChainId,
28243
+ enforcedTargetTokenAddress: legs.targetTokenAddress,
28244
+ enforcedTargetTokenSymbol: legs.targetTokenSymbol,
28245
+ providerCrypto: order.providerCrypto,
28246
+ providerNetwork: order.providerNetwork
28247
+ });
28248
+ try {
28249
+ await ensureOnSourceChain(wallet, legs.sourceChainId);
28250
+ const { quote, estimation } = await quoteOrderExactOut({
28251
+ wagmiConfig,
28252
+ apiKey,
28253
+ loginType,
28254
+ checkoutItem,
28255
+ userAddress,
28256
+ legs,
28257
+ order
28258
+ });
28259
+ const txHash = await handleWithdrawal({
28260
+ destinationAddress: order.destinationAddress,
28261
+ // Fee-exclusive value of the withdrawal, matching the standard form
28262
+ // (WithdrawalParam.withdrawalUSD is the amount withdrawn, not cost).
28263
+ withdrawalUSD: quote.estSubtotalUsd.toString(),
28264
+ // Symbol must match the target `tokenAddress` (the on-chain movement),
28265
+ // not the source asset, for cross-token swaps (e.g. USDG → USDC).
28266
+ tokenSymbol: legs.targetTokenSymbol,
28267
+ tokenAddress: legs.targetTokenAddress,
28268
+ chainId: Number(legs.targetChainId),
28269
+ quote: estimation,
28270
+ // Source amount actually withdrawn (not the requested order amount):
28271
+ // the EXACT_OUT source requirement to deliver the order.
28272
+ userInputAmount: quote.estTotalFromAmount
28273
+ });
28274
+ if (txHash) {
28275
+ submittedOrderIdsRef.current.add(order.orderId);
28276
+ logger.info("fiat-withdrawal:submitted", {
28277
+ order_id: order.orderId,
28278
+ txHash
28279
+ });
28280
+ }
28281
+ } catch (error) {
28282
+ if (isUserRejectedError(error)) {
28283
+ logger.warn("fiat-withdrawal:user_rejected", {
28284
+ order_id: order.orderId
28285
+ });
28286
+ } else {
28287
+ logger.error("fiat-withdrawal:quote_failed", error);
28288
+ onError();
28289
+ }
28290
+ } finally {
28291
+ isProcessingOrderRef.current = false;
28292
+ }
28293
+ });
28294
+ return { processOrder };
28295
+ }
28296
+
27977
28297
  // src/modals/WithdrawalModal/WithdrawalSwappedIframeController.tsx
28298
+ function isValidOrderData(data) {
28299
+ if (!data || !data.order_id || !data.address) return false;
28300
+ const amount = Number(data.amount);
28301
+ return Number.isFinite(amount) && amount > 0;
28302
+ }
27978
28303
  function WithdrawalSwappedIframeController({
27979
28304
  selectedFop,
28305
+ activeConfig,
27980
28306
  isError,
27981
28307
  onError,
27982
28308
  onBack,
@@ -27987,6 +28313,11 @@ function WithdrawalSwappedIframeController({
27987
28313
  const queryClient = useQueryClient4();
27988
28314
  const { withdrawalItem } = useCheckoutContext();
27989
28315
  const { focusAmountInput, isSwappedReady, resetIframe, swappedTransport } = useSwappedContext();
28316
+ const { processOrder } = useFiatWithdrawal({
28317
+ config: activeConfig,
28318
+ withdrawalItem,
28319
+ onError
28320
+ });
27990
28321
  const getTrackMetadata = useEffectEvent(
27991
28322
  (extras) => ({
27992
28323
  ...extras,
@@ -27997,7 +28328,7 @@ function WithdrawalSwappedIframeController({
27997
28328
  checkoutId: withdrawalItem?.id
27998
28329
  })
27999
28330
  );
28000
- useEffect46(() => {
28331
+ useEffect47(() => {
28001
28332
  if (isSwappedReady) {
28002
28333
  const metadata = getTrackMetadata();
28003
28334
  logger.info("swapped-withdrawal-iframe:ready", metadata);
@@ -28066,6 +28397,18 @@ function WithdrawalSwappedIframeController({
28066
28397
  eventName: "fw::swapped::order_data" /* SWAPPED_IFRAME_ORDER_DATA */,
28067
28398
  metadata
28068
28399
  });
28400
+ if (!isValidOrderData(msg.data)) {
28401
+ logger.error("swapped-withdrawal-iframe:order_data:invalid", metadata);
28402
+ onError();
28403
+ return;
28404
+ }
28405
+ processOrder({
28406
+ orderId: msg.data.order_id,
28407
+ destinationAddress: msg.data.address,
28408
+ amount: msg.data.amount,
28409
+ providerCrypto: msg.data.crypto,
28410
+ providerNetwork: msg.data.network
28411
+ });
28069
28412
  break;
28070
28413
  }
28071
28414
  case "SWAPPED_NEW_WITHDRAWAL": {
@@ -28098,7 +28441,7 @@ function WithdrawalSwappedIframeController({
28098
28441
  }
28099
28442
  }
28100
28443
  });
28101
- useEffect46(() => {
28444
+ useEffect47(() => {
28102
28445
  return swappedTransport.onMessage(handleSwappedMessage);
28103
28446
  }, [swappedTransport, handleSwappedMessage]);
28104
28447
  useSwappedIframeLifecycle({
@@ -28146,11 +28489,11 @@ import React142, { useCallback as useCallback28, useMemo as useMemo42, useState
28146
28489
  import { createPortal as createPortal5 } from "react-dom";
28147
28490
 
28148
28491
  // src/hooks/useFunListeners.ts
28149
- import { useEffect as useEffect47, useRef as useRef22 } from "react";
28492
+ import { useEffect as useEffect48, useRef as useRef23 } from "react";
28150
28493
  function useCheckoutHistoryListener(activate = true, singleDepositAddr) {
28151
- const activeIntervalRef = useRef22(void 0);
28494
+ const activeIntervalRef = useRef23(void 0);
28152
28495
  const { startCheckoutHistoryListener, stopCheckoutHistoryListener } = useCheckoutHistoryContext();
28153
- useEffect47(() => {
28496
+ useEffect48(() => {
28154
28497
  if (activate) {
28155
28498
  const createdIntervalId = startCheckoutHistoryListener(
28156
28499
  /* singleDepositAddr */
@@ -28191,29 +28534,18 @@ function FunCheckoutHistoryDetail({
28191
28534
  (fromCheckout) => {
28192
28535
  onClose({ isNewDeposit: true });
28193
28536
  const historicalCheckout = fromCheckout.clientMetadata;
28194
- const checkoutConfig = {
28195
- ...historicalCheckout.initSettings.config,
28196
- withdrawalSourceTokenBalance: checkoutItem?.initSettings.config.withdrawalSourceTokenBalance,
28197
- getMinDepositUSD: isActiveCheckout ? checkoutItem?.initSettings.config.getMinDepositUSD : void 0,
28198
- // can't preserve this if initially part of checkout, get from current config (?)
28199
- generateActionsParams: isActiveCheckout ? checkoutItem?.initSettings.config.generateActionsParams : void 0,
28200
- // Live handles (walletClient + withdrawal fn) aren't restorable from
28201
- // serialized history.
28202
- polymarketPerpsTransfer: isActiveCheckout ? checkoutItem?.initSettings.config.polymarketPerpsTransfer : void 0,
28203
- // A closure (HF math over live position data) — not restorable from
28204
- // serialized history; pull from the active config or drop it.
28205
- resolveHealthFactor: isActiveCheckout ? checkoutItem?.initSettings.config.resolveHealthFactor : void 0
28206
- };
28537
+ const checkoutConfig = createNewCheckoutConfig({
28538
+ serializedConfig: historicalCheckout.initSettings.config,
28539
+ liveConfig: checkoutItem?.initSettings.config,
28540
+ isActiveCheckout
28541
+ });
28207
28542
  onAnimationComplete?.(() => beginCheckout(checkoutConfig));
28208
28543
  },
28209
28544
  [
28210
28545
  beginCheckout,
28211
28546
  onClose,
28212
28547
  onAnimationComplete,
28213
- checkoutItem?.initSettings.config.generateActionsParams,
28214
- checkoutItem?.initSettings.config.getMinDepositUSD,
28215
- checkoutItem?.initSettings.config.withdrawalSourceTokenBalance,
28216
- checkoutItem?.initSettings.config.resolveHealthFactor,
28548
+ checkoutItem?.initSettings.config,
28217
28549
  isActiveCheckout
28218
28550
  ]
28219
28551
  );
@@ -28434,7 +28766,7 @@ function WithdrawalModal({
28434
28766
  "SELECT_METHOD" /* SELECT_METHOD */,
28435
28767
  "ENTER_AMOUNT" /* ENTER_AMOUNT */
28436
28768
  ].includes(step);
28437
- useEffect48(() => {
28769
+ useEffect49(() => {
28438
28770
  setStep(
28439
28771
  isInitialStepSelectMethod ? "SELECT_METHOD" /* SELECT_METHOD */ : "ENTER_AMOUNT" /* ENTER_AMOUNT */
28440
28772
  );
@@ -28596,10 +28928,11 @@ function WithdrawalModal({
28596
28928
  onSwitchToSecure: handleSwitchToSecure
28597
28929
  }
28598
28930
  )),
28599
- step === "SWAPPED_IFRAME" /* SWAPPED_IFRAME */ && selectedFop && /* @__PURE__ */ React146.createElement(
28931
+ step === "SWAPPED_IFRAME" /* SWAPPED_IFRAME */ && selectedFop && activeConfig && /* @__PURE__ */ React146.createElement(
28600
28932
  WithdrawalSwappedIframeController,
28601
28933
  {
28602
28934
  selectedFop,
28935
+ activeConfig,
28603
28936
  isError: isIframeError,
28604
28937
  onError: () => {
28605
28938
  deactivateIframe();
@@ -28740,8 +29073,8 @@ import React264 from "react";
28740
29073
  // src/modals/CheckoutModal/stepTransition.ts
28741
29074
  import {
28742
29075
  useCallback as useCallback51,
28743
- useEffect as useEffect70,
28744
- useRef as useRef35,
29076
+ useEffect as useEffect71,
29077
+ useRef as useRef36,
28745
29078
  useState as useState77
28746
29079
  } from "react";
28747
29080
 
@@ -30200,7 +30533,7 @@ function VirtualFiatAccount({
30200
30533
 
30201
30534
  // src/modals/PolymarketPerpsTransfer/PerpsTransferStep.tsx
30202
30535
  import { useQueryClient as useQueryClient6 } from "@tanstack/react-query";
30203
- import React176, { useEffect as useEffect50, useRef as useRef23, useState as useState49 } from "react";
30536
+ import React176, { useEffect as useEffect51, useRef as useRef24, useState as useState49 } from "react";
30204
30537
  import { createPortal as createPortal9 } from "react-dom";
30205
30538
 
30206
30539
  // src/clients/polymarket/usePolymarketAccountBalances.ts
@@ -30747,7 +31080,7 @@ function PerpsTransferRows({ form }) {
30747
31080
  }
30748
31081
 
30749
31082
  // src/modals/PolymarketPerpsTransfer/usePerpsTransferForm.ts
30750
- import { useEffect as useEffect49, useState as useState48 } from "react";
31083
+ import { useEffect as useEffect50, useState as useState48 } from "react";
30751
31084
  function parseAmount(amount) {
30752
31085
  return Number(amount.replace(/,/g, ""));
30753
31086
  }
@@ -30777,7 +31110,7 @@ function usePerpsTransferForm({
30777
31110
  const { t } = useFunkitTranslation();
30778
31111
  const [amount, setAmount] = useState48(initialAmountUsd);
30779
31112
  const [direction, setDirection] = useState48(initialDirection);
30780
- useEffect49(() => {
31113
+ useEffect50(() => {
30781
31114
  if (status === "success") {
30782
31115
  setAmount("");
30783
31116
  }
@@ -30837,14 +31170,14 @@ function PerpsTransferStepComponent() {
30837
31170
  const queryClient = useQueryClient6();
30838
31171
  const { checkoutItem } = useCheckoutContext();
30839
31172
  const [status, setStatus] = useState49("idle");
30840
- const successResetTimerRef = useRef23(null);
31173
+ const successResetTimerRef = useRef24(null);
30841
31174
  const clearSuccessResetTimer = () => {
30842
31175
  if (successResetTimerRef.current !== null) {
30843
31176
  window.clearTimeout(successResetTimerRef.current);
30844
31177
  successResetTimerRef.current = null;
30845
31178
  }
30846
31179
  };
30847
- useEffect50(() => clearSuccessResetTimer, []);
31180
+ useEffect51(() => clearSuccessResetTimer, []);
30848
31181
  const perpsTransfer = checkoutItem?.initSettings.config.polymarketPerpsTransfer;
30849
31182
  const balances = usePolymarketAccountBalances({
30850
31183
  predictions: perpsTransfer?.predictions,
@@ -30993,8 +31326,8 @@ import { bluvoExecuteWithdrawal as bluvoExecuteWithdrawal2 } from "@funkit/api-b
30993
31326
  // src/components/FunInput/FunTwoFaInput.tsx
30994
31327
  import React179, {
30995
31328
  useCallback as useCallback32,
30996
- useEffect as useEffect51,
30997
- useRef as useRef24,
31329
+ useEffect as useEffect52,
31330
+ useRef as useRef25,
30998
31331
  useState as useState50
30999
31332
  } from "react";
31000
31333
  var FunTwoFaInput = ({
@@ -31008,13 +31341,13 @@ var FunTwoFaInput = ({
31008
31341
  hasResent = false,
31009
31342
  onCompleted
31010
31343
  }) => {
31011
- const inputRefs = useRef24(
31344
+ const inputRefs = useRef25(
31012
31345
  Array.from({ length: initialInputLength }, () => null)
31013
31346
  );
31014
31347
  const [currentLength, setCurrentLength] = useState50(initialInputLength);
31015
31348
  const [focusIndex, setFocusIndex] = useState50(0);
31016
31349
  const [isFocused, setIsFocused] = useState50(false);
31017
- useEffect51(() => {
31350
+ useEffect52(() => {
31018
31351
  if (!value) {
31019
31352
  setFocusIndex(0);
31020
31353
  }
@@ -31593,7 +31926,7 @@ var TwoFactorIcon = () => /* @__PURE__ */ React180.createElement(
31593
31926
  );
31594
31927
 
31595
31928
  // src/modals/CheckoutModal/Brokerage/ConnectExchange.tsx
31596
- import React184, { useCallback as useCallback33, useEffect as useEffect52, useState as useState52 } from "react";
31929
+ import React184, { useCallback as useCallback33, useEffect as useEffect53, useState as useState52 } from "react";
31597
31930
  import { createPortal as createPortal11 } from "react-dom";
31598
31931
 
31599
31932
  // src/components/FunMessage/FunMessage.tsx
@@ -31724,7 +32057,7 @@ function ConnectExchange({
31724
32057
  setAuthError(errorMessage);
31725
32058
  setIsLoadingBluvoModal(false);
31726
32059
  });
31727
- useEffect52(() => {
32060
+ useEffect53(() => {
31728
32061
  if (isConnected) {
31729
32062
  navigateToBrokerage();
31730
32063
  }
@@ -32142,7 +32475,7 @@ function CheckoutComplete({
32142
32475
 
32143
32476
  // src/modals/CheckoutModal/ConfirmationStep/ConfirmationStep.tsx
32144
32477
  import * as dnum9 from "dnum";
32145
- import React202, { useEffect as useEffect56, useMemo as useMemo50, useState as useState63 } from "react";
32478
+ import React202, { useEffect as useEffect57, useMemo as useMemo50, useState as useState63 } from "react";
32146
32479
  import { createPortal as createPortal14 } from "react-dom";
32147
32480
  import { DirectExecutionType as DirectExecutionType6 } from "@funkit/api-base";
32148
32481
 
@@ -32174,7 +32507,7 @@ var ChainInfoBanners = ({ chainId: chainId2 }) => {
32174
32507
  import {
32175
32508
  formatCurrencyAndStringify as formatCurrencyAndStringify7,
32176
32509
  isTokenAddressEquivalent as isTokenAddressEquivalent2,
32177
- isTokenEquivalent as isTokenEquivalent6
32510
+ isTokenEquivalent as isTokenEquivalent7
32178
32511
  } from "@funkit/utils";
32179
32512
  import NumberFlow from "@number-flow/react";
32180
32513
  import { motion as motion11 } from "motion/react";
@@ -32215,7 +32548,7 @@ function PaymentAmountSummary({
32215
32548
  const isBrokeragePayment = paymentMethod === PaymentMethod.BROKERAGE;
32216
32549
  const receiveAmountLabel = useReceiveAmountLabel({
32217
32550
  directExecutionType,
32218
- isSameToken: isTokenEquivalent6({
32551
+ isSameToken: isTokenEquivalent7({
32219
32552
  firstTokenAddress: sourceTokenAddress,
32220
32553
  firstTokenChainId: sourceTokenChainId,
32221
32554
  secondTokenAddress: targetTokenAddress,
@@ -32608,14 +32941,14 @@ import { DirectExecutionType as DirectExecutionType4, createDirectExecution } fr
32608
32941
  import { useQuery as useQuery23 } from "@tanstack/react-query";
32609
32942
  import * as dnum8 from "dnum";
32610
32943
  import { useCallback as useCallback36, useState as useState54 } from "react";
32611
- import { erc20Abi as erc20Abi5 } from "viem";
32944
+ import { erc20Abi as erc20Abi6 } from "viem";
32612
32945
 
32613
32946
  // src/utils/isMainnetUsdt.ts
32614
- import { isTokenEquivalent as isTokenEquivalent7 } from "@funkit/utils";
32947
+ import { isTokenEquivalent as isTokenEquivalent8 } from "@funkit/utils";
32615
32948
  import { mainnet as mainnet10 } from "viem/chains";
32616
32949
  var USDT_MAINNET_ADDRESS = "0xdAC17F958D2ee523a2206206994597C13D831ec7";
32617
32950
  function isMainnetUsdt(chainId2, address) {
32618
- return isTokenEquivalent7({
32951
+ return isTokenEquivalent8({
32619
32952
  firstTokenAddress: address,
32620
32953
  firstTokenChainId: chainId2.toString(),
32621
32954
  secondTokenAddress: USDT_MAINNET_ADDRESS,
@@ -32720,7 +33053,7 @@ async function resetUsdtAllowanceIfNeeded(wagmiConfig, walletClient, {
32720
33053
  }
32721
33054
  const allowance = await readContract(wagmiConfig, {
32722
33055
  address: currency,
32723
- abi: erc20Abi5,
33056
+ abi: erc20Abi6,
32724
33057
  functionName: "allowance",
32725
33058
  args: [owner, market],
32726
33059
  chainId: targetChainNum
@@ -32731,7 +33064,7 @@ async function resetUsdtAllowanceIfNeeded(wagmiConfig, walletClient, {
32731
33064
  });
32732
33065
  const resetTxHash = await walletClient.writeContract({
32733
33066
  address: currency,
32734
- abi: erc20Abi5,
33067
+ abi: erc20Abi6,
32735
33068
  functionName: "approve",
32736
33069
  args: [market, 0n],
32737
33070
  account: owner,
@@ -32862,7 +33195,7 @@ function useAaveTargetPoolAllowance(checkoutItem, owner) {
32862
33195
  }
32863
33196
  return readContract(wagmiConfig, {
32864
33197
  address: targetAsset,
32865
- abi: erc20Abi5,
33198
+ abi: erc20Abi6,
32866
33199
  functionName: "allowance",
32867
33200
  args: [owner, market],
32868
33201
  chainId: Number.parseInt(targetChainStr, 10)
@@ -33065,10 +33398,10 @@ function useAaveNativeSupply() {
33065
33398
  // src/modals/CheckoutModal/InputAmount/useNadoDirectTransfer.ts
33066
33399
  import { DirectExecutionType as DirectExecutionType5, createDirectExecution as createDirectExecution2 } from "@funkit/api-base";
33067
33400
  import {
33068
- isTokenEquivalent as isTokenEquivalent8
33401
+ isTokenEquivalent as isTokenEquivalent9
33069
33402
  } from "@funkit/utils";
33070
- import { useCallback as useCallback37, useRef as useRef25, useState as useState55 } from "react";
33071
- import { erc20Abi as erc20Abi6 } from "viem";
33403
+ import { useCallback as useCallback37, useRef as useRef26, useState as useState55 } from "react";
33404
+ import { erc20Abi as erc20Abi7 } from "viem";
33072
33405
  function getTransferAmountBaseUnit(tokenAmountBaseUnit, fallbackAssetAmount, decimals) {
33073
33406
  if (tokenAmountBaseUnit) {
33074
33407
  return tokenAmountBaseUnit[0];
@@ -33161,7 +33494,7 @@ function isNadoDirectTransferContext({
33161
33494
  if (!checkoutConfig.customRecipient) {
33162
33495
  return false;
33163
33496
  }
33164
- const matchesTarget = isTokenEquivalent8({
33497
+ const matchesTarget = isTokenEquivalent9({
33165
33498
  firstTokenChainId: String(sourceAsset.chainId),
33166
33499
  firstTokenAddress: sourceAsset.address,
33167
33500
  secondTokenChainId: checkoutConfig.targetChain,
@@ -33173,7 +33506,7 @@ function isNadoDirectTransferContext({
33173
33506
  if (!wrappedTokenAddress) {
33174
33507
  return false;
33175
33508
  }
33176
- return isTokenEquivalent8({
33509
+ return isTokenEquivalent9({
33177
33510
  firstTokenChainId: String(sourceAsset.chainId),
33178
33511
  firstTokenAddress: sourceAsset.address,
33179
33512
  secondTokenChainId: checkoutConfig.targetChain,
@@ -33206,7 +33539,7 @@ function useNadoDirectTransfer() {
33206
33539
  const { refreshCheckoutHistory } = useCheckoutHistoryContext();
33207
33540
  const [isPending, setIsPending] = useState55(false);
33208
33541
  const [error, setError] = useState55(null);
33209
- const isSubmittingRef = useRef25(false);
33542
+ const isSubmittingRef = useRef26(false);
33210
33543
  const config = checkoutItem?.initSettings.config;
33211
33544
  const targetChainStr = config?.targetChain;
33212
33545
  const targetAsset = config?.targetAsset;
@@ -33298,7 +33631,7 @@ function useNadoDirectTransfer() {
33298
33631
  });
33299
33632
  const txHash = await walletClient.writeContract({
33300
33633
  address: transferToken,
33301
- abi: erc20Abi6,
33634
+ abi: erc20Abi7,
33302
33635
  functionName: "transfer",
33303
33636
  args: [recipientAddr, amountBaseUnit],
33304
33637
  account: walletAddress,
@@ -33725,7 +34058,7 @@ function mapRetryAction(quoteBuilder, params) {
33725
34058
  }
33726
34059
 
33727
34060
  // src/modals/CheckoutModal/ConfirmationStep/useSourceAssetConfirm.tsx
33728
- import { useEffect as useEffect53, useState as useState57 } from "react";
34061
+ import { useEffect as useEffect54, useState as useState57 } from "react";
33729
34062
  function useSourceAssetConfirm(setPreloadedQuoteData) {
33730
34063
  const { setCheckoutQuote, getCheckoutQuote, setQuoteProgress } = useQuoteContext();
33731
34064
  const { checkoutItem, setCheckout } = useCheckoutContext();
@@ -33774,7 +34107,7 @@ function useHackyTriggerWorkaroundReactDevBrainExplode() {
33774
34107
  function useTriggerQuoteAndOtherStuffsWithExtremeCaution(onResult, setPreloadedQuoteData) {
33775
34108
  const [assetRefresh, triggerAssetConfirm] = useHackyTriggerWorkaroundReactDevBrainExplode();
33776
34109
  const { isSourceAssetConfirming, onSourceAssetConfirmed } = useSourceAssetConfirm(setPreloadedQuoteData);
33777
- useEffect53(() => {
34110
+ useEffect54(() => {
33778
34111
  if (assetRefresh === 0) {
33779
34112
  return;
33780
34113
  }
@@ -33868,7 +34201,7 @@ import { Trans as Trans15 } from "react-i18next";
33868
34201
  // src/modals/CheckoutModal/ConfirmationStep/useAccountBalanceTransfer.ts
33869
34202
  import { USDT_ABI } from "@funkit/utils";
33870
34203
  import { useCallback as useCallback38 } from "react";
33871
- import { erc20Abi as erc20Abi7 } from "viem";
34204
+ import { erc20Abi as erc20Abi8 } from "viem";
33872
34205
  function useWeb3AccountBalancePostCheckout(setPostCheckoutStepMessage) {
33873
34206
  const { t } = useFunkitTranslation();
33874
34207
  const { connector } = useAccount();
@@ -33934,7 +34267,7 @@ function useWeb3AccountBalancePostCheckout(setPostCheckoutStepMessage) {
33934
34267
  chainId: Number.parseInt(sourceAssetChainId),
33935
34268
  address: sourceAssetAddress,
33936
34269
  // USDT on mainnet has a different ABI
33937
- abi: isTokenMainnetUsdt ? USDT_ABI : erc20Abi7,
34270
+ abi: isTokenMainnetUsdt ? USDT_ABI : erc20Abi8,
33938
34271
  functionName: "transfer",
33939
34272
  args: [depositAddress, sourceAssetAmountBaseUnit]
33940
34273
  };
@@ -34135,7 +34468,7 @@ function usePostCheckout({
34135
34468
  }
34136
34469
 
34137
34470
  // src/modals/CheckoutModal/ConfirmationStep/useQuoteRefresh.ts
34138
- import { useCallback as useCallback41, useEffect as useEffect55, useMemo as useMemo49, useRef as useRef26, useState as useState62 } from "react";
34471
+ import { useCallback as useCallback41, useEffect as useEffect56, useMemo as useMemo49, useRef as useRef27, useState as useState62 } from "react";
34139
34472
 
34140
34473
  // src/hooks/useCountdown.tsx
34141
34474
  import React201 from "react";
@@ -34143,7 +34476,7 @@ import { useCallback as useCallback40, useState as useState61 } from "react";
34143
34476
 
34144
34477
  // src/components/FunCountdown/FunCountdown.tsx
34145
34478
  import { noop as noop5 } from "@funkit/utils";
34146
- import React200, { useCallback as useCallback39, useEffect as useEffect54, useState as useState60 } from "react";
34479
+ import React200, { useCallback as useCallback39, useEffect as useEffect55, useState as useState60 } from "react";
34147
34480
 
34148
34481
  // src/components/FunCountdown/FunCountdown.css.ts
34149
34482
  var backgroundRing = "_1t0bc111 _1rsrm2f2mm";
@@ -34186,7 +34519,7 @@ var FunCountdown = ({
34186
34519
  setRemainingSeconds((prev) => prev > 0 ? prev - 1 : prev);
34187
34520
  }, [isPaused]);
34188
34521
  useInterval(handleInterval, 1e3);
34189
- useEffect54(() => {
34522
+ useEffect55(() => {
34190
34523
  if (remainingSeconds === onBeforeCountdownEndsSeconds) {
34191
34524
  onBeforeCountdownEndsOnce();
34192
34525
  }
@@ -34333,10 +34666,10 @@ function useQuoteRefresh({
34333
34666
  refreshIntervalSeconds
34334
34667
  }) {
34335
34668
  const { setCheckoutQuote, isQuoting, quoteErrorMessage, quoteStepMessage } = useQuoteContext();
34336
- const preloadedQuoteRef = useRef26(
34669
+ const preloadedQuoteRef = useRef27(
34337
34670
  void 0
34338
34671
  );
34339
- const quoteCallbackRef = useRef26(void 0);
34672
+ const quoteCallbackRef = useRef27(void 0);
34340
34673
  const [isPendingRefresh, setIsPendingRefresh] = useState62(false);
34341
34674
  const {
34342
34675
  isSourceAssetConfirming,
@@ -34417,7 +34750,7 @@ function useQuoteRefresh({
34417
34750
  }
34418
34751
  return null;
34419
34752
  }, [isQuoting, quoteErrorMessage]);
34420
- useEffect55(() => {
34753
+ useEffect56(() => {
34421
34754
  if (isPendingRefresh && !isOnHold) {
34422
34755
  setIsPendingRefresh(false);
34423
34756
  refreshQuote();
@@ -34548,7 +34881,7 @@ function ConfirmationStep({
34548
34881
  }
34549
34882
  }
34550
34883
  });
34551
- useEffect56(() => {
34884
+ useEffect57(() => {
34552
34885
  if (!isDirectWalletTransfer) {
34553
34886
  triggerNewQuote({ maxRetries: 1 });
34554
34887
  }
@@ -34695,7 +35028,7 @@ function ConfirmationStep({
34695
35028
  const hasStaticPrimaryInfoValue = isExactIn && checkoutItem?.inputFiatAmount != null || !isExactIn && !!checkoutConfig?.targetAssetAmount && (hasFinalizedToken || isStablecoin(checkoutConfig.targetAssetTicker));
34696
35029
  const checkoutId = checkoutItem?.id;
34697
35030
  const isReady = !!checkoutItem?.finalDollarValue && !isQuoteLoading;
34698
- useEffect56(() => {
35031
+ useEffect57(() => {
34699
35032
  if (checkoutId && isReady) {
34700
35033
  logMeasuredEvent({
34701
35034
  eventName: "fc::ready::confirmation" /* READY_CONFIRMATION */,
@@ -34828,7 +35161,7 @@ function ConfirmationStep({
34828
35161
 
34829
35162
  // src/modals/CheckoutModal/InputAmount/InputAmount.tsx
34830
35163
  import { isMobile as isMobile7 } from "@funkit/utils";
34831
- import React217, { useEffect as useEffect59 } from "react";
35164
+ import React217, { useEffect as useEffect60 } from "react";
34832
35165
 
34833
35166
  // src/hooks/queries/useMeldCurrencies.ts
34834
35167
  import { getMeldSupportedFiat } from "@funkit/api-base";
@@ -35040,23 +35373,23 @@ var useMeldLimitError = (amount, fiatCurrency) => {
35040
35373
  import { defaultDynamicConfigs as fallbackDynamicConfigs } from "@funkit/connect-core";
35041
35374
  import {
35042
35375
  formatCryptoAndStringify as formatCryptoAndStringify7,
35043
- isTokenEquivalent as isTokenEquivalent10,
35376
+ isTokenEquivalent as isTokenEquivalent11,
35044
35377
  round as round2
35045
35378
  } from "@funkit/utils";
35046
35379
  import * as dnum11 from "dnum";
35047
35380
  import { motion as motion13 } from "motion/react";
35048
- import React215, { useEffect as useEffect58, useMemo as useMemo53 } from "react";
35381
+ import React215, { useEffect as useEffect59, useMemo as useMemo53 } from "react";
35049
35382
 
35050
35383
  // src/components/AnimatedWidthWrapper/AnimatedWidthWrapper.tsx
35051
35384
  import { motion as motion12 } from "motion/react";
35052
35385
  import React203 from "react";
35053
- import { useEffect as useEffect57, useRef as useRef27, useState as useState64 } from "react";
35386
+ import { useEffect as useEffect58, useRef as useRef28, useState as useState64 } from "react";
35054
35387
  function AnimatedWidthWrapper({ children }) {
35055
- const containerRef = useRef27(null);
35056
- const animationFrameRef = useRef27(null);
35057
- const resizeObserverRef = useRef27(null);
35388
+ const containerRef = useRef28(null);
35389
+ const animationFrameRef = useRef28(null);
35390
+ const resizeObserverRef = useRef28(null);
35058
35391
  const [width, setWidth] = useState64("auto");
35059
- useEffect57(() => {
35392
+ useEffect58(() => {
35060
35393
  if (containerRef.current) {
35061
35394
  resizeObserverRef.current = new ResizeObserver((entries) => {
35062
35395
  animationFrameRef.current = requestAnimationFrame(() => {
@@ -35088,7 +35421,7 @@ function AnimatedWidthWrapper({ children }) {
35088
35421
  }
35089
35422
 
35090
35423
  // src/components/ApprovalMethodToggle/ApprovalMethodToggle.tsx
35091
- import React204, { useCallback as useCallback42, useMemo as useMemo51, useRef as useRef28 } from "react";
35424
+ import React204, { useCallback as useCallback42, useMemo as useMemo51, useRef as useRef29 } from "react";
35092
35425
  import { Trans as Trans16 } from "react-i18next";
35093
35426
  function ApprovalMethodToggle({
35094
35427
  value,
@@ -35097,7 +35430,7 @@ function ApprovalMethodToggle({
35097
35430
  testId
35098
35431
  }) {
35099
35432
  const { t } = useFunkitTranslation();
35100
- const tooltipAnchorRef = useRef28(null);
35433
+ const tooltipAnchorRef = useRef29(null);
35101
35434
  const options = useMemo51(
35102
35435
  () => [
35103
35436
  { label: t("approvalMethodToggle.signedMessage"), value: "sign" },
@@ -36351,7 +36684,7 @@ import {
36351
36684
  useCallback as useCallback44,
36352
36685
  useMemo as useMemo52,
36353
36686
  useReducer as useReducer3,
36354
- useRef as useRef29,
36687
+ useRef as useRef30,
36355
36688
  useState as useState66
36356
36689
  } from "react";
36357
36690
 
@@ -36394,7 +36727,7 @@ function useTextMeasurer(inputRef) {
36394
36727
  // src/modals/CheckoutModal/InputAmount/state.ts
36395
36728
  import {
36396
36729
  isTokenAddressEquivalent as isTokenAddressEquivalent3,
36397
- isTokenEquivalent as isTokenEquivalent9,
36730
+ isTokenEquivalent as isTokenEquivalent10,
36398
36731
  round
36399
36732
  } from "@funkit/utils";
36400
36733
  import * as dnum10 from "dnum";
@@ -36569,7 +36902,7 @@ function isEffectivelySameAsset(checkoutConfig, sourceToken, apiKey) {
36569
36902
  if (!sourceToken) {
36570
36903
  return false;
36571
36904
  }
36572
- if (isTokenEquivalent9({
36905
+ if (isTokenEquivalent10({
36573
36906
  firstTokenChainId: sourceToken.chainId,
36574
36907
  firstTokenAddress: sourceToken.address,
36575
36908
  secondTokenChainId: checkoutConfig.targetChain,
@@ -37154,7 +37487,7 @@ function useAmountInput(options) {
37154
37487
  () => getDerivedState(state, checkoutConfig.targetAssetTicker),
37155
37488
  [state, checkoutConfig]
37156
37489
  );
37157
- const inputRef = useRef29(null);
37490
+ const inputRef = useRef30(null);
37158
37491
  const { inputValue, locale } = state;
37159
37492
  const { inputDecimals, inputAffix, placeholder } = derivedState;
37160
37493
  const { measureText } = useTextMeasurer(inputRef);
@@ -37839,7 +38172,7 @@ function InputAmountLoaded({
37839
38172
  }
37840
38173
  return setFiatAmount(selectedFiat);
37841
38174
  }
37842
- useEffect58(() => {
38175
+ useEffect59(() => {
37843
38176
  if (isInputInFiat !== modalState.isInputInFiat || fiatAmount !== modalState.fiatAmount || assetAmount !== modalState.assetAmount || sourceTokenKey !== modalState.sourceTokenKey) {
37844
38177
  setModalState((state) => ({
37845
38178
  ...state,
@@ -38318,7 +38651,7 @@ function YouPayYouReceiveWrapper({
38318
38651
  const showYouPayYouReceive = Boolean(
38319
38652
  sourceAssetSymbol && sourceAssetIconSrc && targetAssetTicker && targetIconSrc
38320
38653
  );
38321
- const youPayYouReceiveShowYouPaySection = forceShowYouPaySection || !isTokenEquivalent10({
38654
+ const youPayYouReceiveShowYouPaySection = forceShowYouPaySection || !isTokenEquivalent11({
38322
38655
  firstTokenChainId: sourceAssetChainId?.toString() || "",
38323
38656
  firstTokenAddress: sourceAssetAddress?.toString() || "",
38324
38657
  secondTokenChainId: targetChainId,
@@ -38619,10 +38952,10 @@ function InputAmount(props) {
38619
38952
  query: { enabled: gasFetchingEnabled }
38620
38953
  });
38621
38954
  const isLoaded = !!(checkoutItem && unitPrice && !sourceHoldingError && !isLoadingSourceHolding && !isMeldDefaultCurrencyLoading && (!gasFetchingEnabled || gasPriceWei !== void 0));
38622
- useEffect59(() => setCheckoutQuote(null), []);
38955
+ useEffect60(() => setCheckoutQuote(null), []);
38623
38956
  const checkoutId = checkoutItem?.id;
38624
38957
  const paymentMethod = paymentMethodInfo.paymentMethod;
38625
- useEffect59(() => {
38958
+ useEffect60(() => {
38626
38959
  if (checkoutId && isLoaded) {
38627
38960
  logMeasuredEvent({
38628
38961
  eventName: "fc::ready::input_amount" /* READY_INPUT_AMOUNT */,
@@ -38655,7 +38988,7 @@ function InputAmount(props) {
38655
38988
  }
38656
38989
 
38657
38990
  // src/modals/CheckoutModal/LightningInvoice/LightningInvoice.tsx
38658
- import React222, { useEffect as useEffect62 } from "react";
38991
+ import React222, { useEffect as useEffect63 } from "react";
38659
38992
  import { createPortal as createPortal16 } from "react-dom";
38660
38993
 
38661
38994
  // src/components/CopyAddress/CopyInputDisplayedAddress.tsx
@@ -38663,7 +38996,7 @@ import { truncateMiddleOfAddress } from "@funkit/utils";
38663
38996
  import React218, { useCallback as useCallback47, useState as useState68 } from "react";
38664
38997
 
38665
38998
  // src/hooks/useCopyToClipboard.ts
38666
- import { useCallback as useCallback46, useEffect as useEffect60, useState as useState67 } from "react";
38999
+ import { useCallback as useCallback46, useEffect as useEffect61, useState as useState67 } from "react";
38667
39000
  var useCopyToClipboard = (text, delay = 1500) => {
38668
39001
  const [isCopied, setCopied] = useState67(false);
38669
39002
  const handleCopy = useCallback46(() => {
@@ -38673,7 +39006,7 @@ var useCopyToClipboard = (text, delay = 1500) => {
38673
39006
  navigator.clipboard.writeText(text);
38674
39007
  setCopied(true);
38675
39008
  }, [text]);
38676
- useEffect60(() => {
39009
+ useEffect61(() => {
38677
39010
  if (!isCopied) {
38678
39011
  return;
38679
39012
  }
@@ -38785,7 +39118,7 @@ import {
38785
39118
  } from "@funkit/api-base";
38786
39119
  import { LIGHTNING_MAINNET_CHAIN_ID, bitcoinChain as bitcoinChain5 } from "@funkit/chains";
38787
39120
  import { keepPreviousData as keepPreviousData3, useQuery as useQuery28 } from "@tanstack/react-query";
38788
- import { useEffect as useEffect61, useRef as useRef30, useState as useState69 } from "react";
39121
+ import { useEffect as useEffect62, useRef as useRef31, useState as useState69 } from "react";
38789
39122
  import { parseUnits as parseUnits3 } from "viem";
38790
39123
  var QUOTE_REFRESH_LEAD_MS = 3e3;
38791
39124
  var QUOTE_REFRESH_MIN_MS = 250;
@@ -38801,9 +39134,9 @@ function usdToSats(usd, btcPrice) {
38801
39134
  }
38802
39135
  function useDeferredQuote(latestQuote) {
38803
39136
  const [displayedQuote, setDisplayedQuote] = useState69(latestQuote);
38804
- const latestQuoteRef = useRef30(latestQuote);
39137
+ const latestQuoteRef = useRef31(latestQuote);
38805
39138
  latestQuoteRef.current = latestQuote;
38806
- useEffect61(() => {
39139
+ useEffect62(() => {
38807
39140
  if (!displayedQuote) {
38808
39141
  if (latestQuote) {
38809
39142
  setDisplayedQuote(latestQuote);
@@ -39184,7 +39517,7 @@ function LightningInvoice(_props) {
39184
39517
  isHidden: isLoading || !!error,
39185
39518
  isPaused: isLoading || !!error
39186
39519
  });
39187
- useEffect62(() => {
39520
+ useEffect63(() => {
39188
39521
  if (expiresAtMs !== void 0) {
39189
39522
  restartCountdown();
39190
39523
  }
@@ -39238,7 +39571,7 @@ function LightningInvoice(_props) {
39238
39571
  }
39239
39572
 
39240
39573
  // src/modals/CheckoutModal/LoadingAccount.tsx
39241
- import React232, { useEffect as useEffect63 } from "react";
39574
+ import React232, { useEffect as useEffect64 } from "react";
39242
39575
 
39243
39576
  // src/components/FunAsset/FunAssetLoading.tsx
39244
39577
  import React224 from "react";
@@ -40005,7 +40338,7 @@ function LoadingAccount({
40005
40338
  const hasCustomStartingStep = !!checkoutConfig?.startingStep;
40006
40339
  const startsOnConfirmationStep = checkoutConfig?.startingStep === "confirmation" /* CONFIRMATION */;
40007
40340
  const startsOnSelectAssetStep = checkoutConfig?.startingStep === "select_asset" /* SELECT_ASSET */;
40008
- useEffect63(() => {
40341
+ useEffect64(() => {
40009
40342
  if (isLoadingFlags || isLoadingFiat || !checkoutConfig) {
40010
40343
  return;
40011
40344
  }
@@ -40245,7 +40578,7 @@ function MeldQuotes({
40245
40578
  }
40246
40579
 
40247
40580
  // src/modals/CheckoutModal/MeldRedirect/MeldRedirect.tsx
40248
- import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO9 } from "@funkit/chains";
40581
+ import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO10 } from "@funkit/chains";
40249
40582
  import React235 from "react";
40250
40583
  var MeldRedirectInfo = {
40251
40584
  Component: MeldRedirect,
@@ -40275,7 +40608,7 @@ function MeldRedirect({
40275
40608
  const [destinationCurrencyCode, destinationChainName = ""] = quote.destinationCurrencyCode.split("_");
40276
40609
  const providerLabel = providerLabelMap[quote.serviceProvider] ?? quote.serviceProvider;
40277
40610
  const getChainIdByName = (chainName) => {
40278
- const entry = Object.entries(FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO9).find(
40611
+ const entry = Object.entries(FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO10).find(
40279
40612
  ([, chainInfo]) => chainInfo?.name.toLowerCase() === chainName.toLowerCase()
40280
40613
  );
40281
40614
  return entry?.[0];
@@ -40332,9 +40665,9 @@ function MeldRedirect({
40332
40665
 
40333
40666
  // src/modals/CheckoutModal/SelectAsset/SelectAsset.tsx
40334
40667
  import { etherealChain, hyperEvmChain as hyperEvmChain3 } from "@funkit/chains";
40335
- import { isTokenEquivalent as isTokenEquivalent11 } from "@funkit/utils";
40668
+ import { isTokenEquivalent as isTokenEquivalent12 } from "@funkit/utils";
40336
40669
  import React239, {
40337
- useEffect as useEffect64,
40670
+ useEffect as useEffect65,
40338
40671
  useLayoutEffect as useLayoutEffect2,
40339
40672
  useMemo as useMemo60,
40340
40673
  useState as useState71
@@ -40666,7 +40999,7 @@ function useAssetOptions({
40666
40999
  const { isUsable, reason } = usableForCheckout;
40667
41000
  const isKnown = isKnownAsset(asset);
40668
41001
  const isDisabled = !isUsable || !isKnown;
40669
- const isUserSelected = isTokenEquivalent11({
41002
+ const isUserSelected = isTokenEquivalent12({
40670
41003
  firstTokenChainId: asset.pickedChainId,
40671
41004
  firstTokenAddress: asset.tokenAddress,
40672
41005
  secondTokenChainId: userSelectedTargetAsset?.tokenChainId || "",
@@ -40727,7 +41060,7 @@ function useAssetOptions({
40727
41060
  return assetOptions;
40728
41061
  }
40729
41062
  function useScrollToSelectedAsset(selectedChainTokenSymbol) {
40730
- useEffect64(() => {
41063
+ useEffect65(() => {
40731
41064
  const optionEl = document.getElementById(
40732
41065
  `option-${selectedChainTokenSymbol}`
40733
41066
  );
@@ -40827,7 +41160,7 @@ function AccountSelectAsset({
40827
41160
  return;
40828
41161
  }
40829
41162
  const currentSourceAsset = checkoutItem?.selectedSourceAssetInfo;
40830
- const sourceAssetChanged = !isTokenEquivalent11({
41163
+ const sourceAssetChanged = !isTokenEquivalent12({
40831
41164
  firstTokenChainId: currentSourceAsset?.chainId || "",
40832
41165
  firstTokenAddress: currentSourceAsset?.address || "",
40833
41166
  secondTokenChainId: tokenItem.pickedChainId,
@@ -40893,7 +41226,7 @@ function AccountSelectAsset({
40893
41226
  const isDisabled = isAssetsEmpty || !selectedChainTokenSymbol || isLoading;
40894
41227
  const onBalanceTopUpSwitch = checkoutItem?.initSettings.onBalanceTopUpSwitch;
40895
41228
  const checkoutId = checkoutItem?.id;
40896
- useEffect64(() => {
41229
+ useEffect65(() => {
40897
41230
  if (checkoutId && !isLoading) {
40898
41231
  logMeasuredEvent({
40899
41232
  eventName: "fc::ready::select_asset" /* READY_SELECT_ASSET */,
@@ -41004,7 +41337,7 @@ function isTreatedAsNativeToken(apiKey, asset, dynamicTargetAssetCandidates, fin
41004
41337
  return dynamicPath.badge === "NATIVE";
41005
41338
  }
41006
41339
  if (isEtherealCustomer(apiKey)) {
41007
- if (isTokenEquivalent11({
41340
+ if (isTokenEquivalent12({
41008
41341
  firstTokenChainId: mainnet12.id.toString(),
41009
41342
  firstTokenAddress: "0x90d2af7d622ca3141efa4d8f1f24d86e5974cc8f",
41010
41343
  // eUSDe (Ethereum)
@@ -41013,7 +41346,7 @@ function isTreatedAsNativeToken(apiKey, asset, dynamicTargetAssetCandidates, fin
41013
41346
  })) {
41014
41347
  return true;
41015
41348
  }
41016
- if (isTokenEquivalent11({
41349
+ if (isTokenEquivalent12({
41017
41350
  firstTokenChainId: etherealChain.id.toString(),
41018
41351
  firstTokenAddress: NATIVE_TOKEN,
41019
41352
  // USDe (Ethereal) uses 0xeeee... address
@@ -41024,7 +41357,7 @@ function isTreatedAsNativeToken(apiKey, asset, dynamicTargetAssetCandidates, fin
41024
41357
  }
41025
41358
  }
41026
41359
  if (isHyenaCustomer(apiKey)) {
41027
- if (isTokenEquivalent11({
41360
+ if (isTokenEquivalent12({
41028
41361
  firstTokenChainId: hyperEvmChain3.id.toString(),
41029
41362
  firstTokenAddress: "0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34",
41030
41363
  secondTokenChainId: asset.pickedChainId,
@@ -41034,7 +41367,7 @@ function isTreatedAsNativeToken(apiKey, asset, dynamicTargetAssetCandidates, fin
41034
41367
  }
41035
41368
  }
41036
41369
  return dynamicTargetAssetCandidates.some(
41037
- (token) => isTokenEquivalent11({
41370
+ (token) => isTokenEquivalent12({
41038
41371
  firstTokenChainId: token.tokenChainId,
41039
41372
  firstTokenAddress: token.tokenAddress,
41040
41373
  secondTokenChainId: asset.pickedChainId,
@@ -41051,8 +41384,8 @@ import {
41051
41384
  BridgeCustomerStatus as BridgeCustomerStatus6
41052
41385
  } from "@funkit/api-base";
41053
41386
  import { LIGHTER_CHAIN_ID as LIGHTER_CHAIN_ID3, lightningChain as lightningChain3 } from "@funkit/chains";
41054
- import { isTokenEquivalent as isTokenEquivalent12, noop as noop6 } from "@funkit/utils";
41055
- import React248, { useEffect as useEffect66, useMemo as useMemo61, useRef as useRef31, useState as useState72 } from "react";
41387
+ import { isTokenEquivalent as isTokenEquivalent13, noop as noop6 } from "@funkit/utils";
41388
+ import React248, { useEffect as useEffect67, useMemo as useMemo61, useRef as useRef32, useState as useState72 } from "react";
41056
41389
  import { createPortal as createPortal20 } from "react-dom";
41057
41390
 
41058
41391
  // src/components/Dropdown/ReceiveTokenDropdown.tsx
@@ -41160,14 +41493,14 @@ function useIsUserUnderComplianceReview() {
41160
41493
  }
41161
41494
 
41162
41495
  // src/modals/CheckoutModal/SourceChange/ComplianceReviewBanner.tsx
41163
- import React241, { useEffect as useEffect65 } from "react";
41496
+ import React241, { useEffect as useEffect66 } from "react";
41164
41497
  import { Trans as Trans18 } from "react-i18next";
41165
41498
  function ComplianceReviewBanner({
41166
41499
  checkoutId
41167
41500
  }) {
41168
41501
  const { t } = useFunkitTranslation();
41169
41502
  const { logEvent } = useTrack();
41170
- useEffect65(() => {
41503
+ useEffect66(() => {
41171
41504
  logEvent({
41172
41505
  eventName: "fc::compliance_review::banner_shown" /* COMPLIANCE_REVIEW_BANNER_SHOWN */,
41173
41506
  metadata: { checkoutId }
@@ -41395,10 +41728,10 @@ function buildDefaultSourceGroups({
41395
41728
  const moreChildren = [...moreSources, ...unavailable];
41396
41729
  if (moreChildren.length > 0) {
41397
41730
  groups.push({
41398
- // Mirror prior behavior: "Other options" header is suppressed
41731
+ // Mirror prior behavior: "More options" header is suppressed
41399
41732
  // when there's no preceding preferred group. Labeled mode skips
41400
41733
  // groups with no label.
41401
- label: preferred.length > 0 ? t("sourceChange.otherOptions") : void 0,
41734
+ label: preferred.length > 0 ? t("sourceChange.moreOptions") : void 0,
41402
41735
  children: /* @__PURE__ */ React246.createElement(React246.Fragment, null, moreChildren)
41403
41736
  });
41404
41737
  }
@@ -41649,7 +41982,7 @@ function SourceChange({
41649
41982
  return void 0;
41650
41983
  }
41651
41984
  const holding = Object.values(walletHoldings).find(
41652
- (h) => isTokenEquivalent12({
41985
+ (h) => isTokenEquivalent13({
41653
41986
  firstTokenChainId: h.pickedChainId,
41654
41987
  firstTokenAddress: h.tokenAddress,
41655
41988
  secondTokenChainId: checkoutConfig.targetChain,
@@ -41669,7 +42002,7 @@ function SourceChange({
41669
42002
  const showTagline = useDynamicConfig("showpoweredtagline");
41670
42003
  const hasBottomBar = showTagline || !isAutoContinue || bottomBarCloseButtonConfig.enabled;
41671
42004
  useSwappedPreload(fopsData?.data);
41672
- useEffect66(() => {
42005
+ useEffect67(() => {
41673
42006
  if (!paymentMethodInfo) {
41674
42007
  return;
41675
42008
  }
@@ -41723,7 +42056,7 @@ function SourceChange({
41723
42056
  setModalState((state) => ({ ...state, showWalletOptions: true }));
41724
42057
  }
41725
42058
  };
41726
- const lastObservedTabRef = useRef31(void 0);
42059
+ const lastObservedTabRef = useRef32(void 0);
41727
42060
  const sendPaymentMethodTabEvent = useEffectEvent((tab) => {
41728
42061
  if (lastObservedTabRef.current === tab) {
41729
42062
  return;
@@ -41736,7 +42069,7 @@ function SourceChange({
41736
42069
  )
41737
42070
  );
41738
42071
  });
41739
- useEffect66(() => {
42072
+ useEffect67(() => {
41740
42073
  sendPaymentMethodTabEvent(paymentMethodTab);
41741
42074
  }, [paymentMethodTab, sendPaymentMethodTabEvent]);
41742
42075
  const handleNewSourceContinue = async (newSource2, isConfirmed = false) => {
@@ -42070,7 +42403,7 @@ function trackEventForTabChange(checkoutItem, tab) {
42070
42403
 
42071
42404
  // src/modals/CheckoutModal/SwappedIframe/SwappedIframeController.tsx
42072
42405
  import { useQueryClient as useQueryClient7 } from "@tanstack/react-query";
42073
- import React249, { useEffect as useEffect67, useRef as useRef32 } from "react";
42406
+ import React249, { useEffect as useEffect68, useRef as useRef33 } from "react";
42074
42407
  import { createPortal as createPortal21 } from "react-dom";
42075
42408
  import { Trans as Trans19 } from "react-i18next";
42076
42409
  var SwappedIframeInfo = {
@@ -42105,7 +42438,7 @@ function SwappedIframeController({
42105
42438
  const { logEvent, logMeasuredEvent, startMeasuredEvent } = useTrack();
42106
42439
  const { t } = useFunkitTranslation();
42107
42440
  const queryClient = useQueryClient7();
42108
- const successCallbackScheduledRef = useRef32(false);
42441
+ const successCallbackScheduledRef = useRef33(false);
42109
42442
  const { checkoutItem, resetForNewDeposit } = useCheckoutContext();
42110
42443
  const bottomSectionRef = useBottomSectionRef();
42111
42444
  const { focusAmountInput, isSwappedReady, resetIframe, swappedTransport } = useSwappedContext();
@@ -42125,10 +42458,10 @@ function SwappedIframeController({
42125
42458
  metadata: {}
42126
42459
  });
42127
42460
  });
42128
- useEffect67(() => {
42461
+ useEffect68(() => {
42129
42462
  startMeasuredEvent("fc::ready::swapped_iframe" /* READY_SWAPPED_IFRAME */);
42130
42463
  }, [startMeasuredEvent]);
42131
- useEffect67(() => {
42464
+ useEffect68(() => {
42132
42465
  if (isSwappedReady) {
42133
42466
  const event = getTrackEvent("fc::ready::swapped_iframe" /* READY_SWAPPED_IFRAME */);
42134
42467
  logger.info("swapped-iframe:ready", event.metadata);
@@ -42293,7 +42626,7 @@ function SwappedIframeController({
42293
42626
  }
42294
42627
  }
42295
42628
  }
42296
- useEffect67(() => {
42629
+ useEffect68(() => {
42297
42630
  return swappedTransport.onMessage(handleSwappedMessage);
42298
42631
  }, [swappedTransport, handleSwappedMessage]);
42299
42632
  useSwappedIframeLifecycle({
@@ -42350,7 +42683,7 @@ function trackEventForFormOfPayment(fop, checkoutItem, eventName, extras) {
42350
42683
 
42351
42684
  // src/modals/CheckoutModal/TransferToken/TransferToken.tsx
42352
42685
  import { motion as motion17, useAnimationControls as useAnimationControls4 } from "motion/react";
42353
- import React257, { useRef as useRef34, useState as useState74 } from "react";
42686
+ import React257, { useRef as useRef35, useState as useState74 } from "react";
42354
42687
  import { createPortal as createPortal22 } from "react-dom";
42355
42688
 
42356
42689
  // src/components/BottomLinks/BottomLinks.tsx
@@ -42785,7 +43118,7 @@ var TransferTokenDetails = ({
42785
43118
  };
42786
43119
 
42787
43120
  // src/modals/CheckoutModal/TransferToken/useTransferTokenTracking.ts
42788
- import { useCallback as useCallback49, useEffect as useEffect68, useRef as useRef33 } from "react";
43121
+ import { useCallback as useCallback49, useEffect as useEffect69, useRef as useRef34 } from "react";
42789
43122
 
42790
43123
  // src/modals/CheckoutModal/TransferToken/CheckoutNotifications.track.ts
42791
43124
  function getNotificationId(item) {
@@ -42882,7 +43215,7 @@ function useTransferTokenTracking({
42882
43215
  toTokenAddress
42883
43216
  }) {
42884
43217
  const { logEvent } = useTrack();
42885
- useEffect68(() => {
43218
+ useEffect69(() => {
42886
43219
  if (depositAddress && fromChainId && toChainId && toTokenAddress) {
42887
43220
  setTokenTransferAddressShownAtMs({
42888
43221
  fromChainId,
@@ -42957,14 +43290,14 @@ function useNotificationTracking({
42957
43290
  status
42958
43291
  }) {
42959
43292
  const { logEvent } = useTrack();
42960
- const notificationDisplayedAtRef = useRef33(null);
42961
- const reasonRef = useRef33(null);
42962
- const itemRef = useRef33(item);
42963
- const statusRef = useRef33(status);
43293
+ const notificationDisplayedAtRef = useRef34(null);
43294
+ const reasonRef = useRef34(null);
43295
+ const itemRef = useRef34(item);
43296
+ const statusRef = useRef34(status);
42964
43297
  itemRef.current = item;
42965
43298
  statusRef.current = status;
42966
43299
  const id = item ? getNotificationId(item) : null;
42967
- useEffect68(() => {
43300
+ useEffect69(() => {
42968
43301
  if (!id || !itemRef.current) {
42969
43302
  return;
42970
43303
  }
@@ -43002,7 +43335,7 @@ function useNotificationTracking({
43002
43335
  notificationDisplayedAtRef.current = null;
43003
43336
  };
43004
43337
  }, [id, logEvent]);
43005
- useEffect68(() => {
43338
+ useEffect69(() => {
43006
43339
  if (!itemRef.current || !notificationDisplayedAtRef.current) {
43007
43340
  return;
43008
43341
  }
@@ -43140,7 +43473,7 @@ function TransferToken({
43140
43473
  const { checkoutItem } = useCheckoutContext();
43141
43474
  const checkoutConfig = checkoutItem?.initSettings.config;
43142
43475
  const { transferToken } = modalState;
43143
- const disclaimerTextWrapperRef = useRef34(null);
43476
+ const disclaimerTextWrapperRef = useRef35(null);
43144
43477
  const { transferInit } = useCheckoutTransferInit();
43145
43478
  const {
43146
43479
  assets,
@@ -43780,7 +44113,7 @@ var FiatAccountDetail = {
43780
44113
 
43781
44114
  // src/modals/CheckoutModal/VirtualFiatAccount/KycIframe.tsx
43782
44115
  import { BridgeCustomerStatus as BridgeCustomerStatus7 } from "@funkit/api-base";
43783
- import React263, { useCallback as useCallback50, useEffect as useEffect69, useMemo as useMemo62, useState as useState76 } from "react";
44116
+ import React263, { useCallback as useCallback50, useEffect as useEffect70, useMemo as useMemo62, useState as useState76 } from "react";
43784
44117
  function useIframeListener(listeners, expectedOrigin) {
43785
44118
  const handleMessage = useCallback50(
43786
44119
  (event) => {
@@ -43807,7 +44140,7 @@ function useIframeListener(listeners, expectedOrigin) {
43807
44140
  },
43808
44141
  [listeners, expectedOrigin]
43809
44142
  );
43810
- useEffect69(() => {
44143
+ useEffect70(() => {
43811
44144
  window.addEventListener("message", handleMessage);
43812
44145
  return () => {
43813
44146
  window.removeEventListener("message", handleMessage);
@@ -44046,7 +44379,7 @@ function useCheckoutModalTransition(checkoutItem, onClose) {
44046
44379
  ensureStepQueries(modalState.step);
44047
44380
  }
44048
44381
  });
44049
- useEffect70(() => {
44382
+ useEffect71(() => {
44050
44383
  ensureLoadingAccountScreen();
44051
44384
  }, [ensureLoadingAccountScreen]);
44052
44385
  const trackNextState = useCallback51(
@@ -44107,7 +44440,7 @@ function useCheckoutModalTransition(checkoutItem, onClose) {
44107
44440
  );
44108
44441
  const { animation, animate } = useAnimatedNavigation(void 0);
44109
44442
  const [stateHistory, setHistory] = useState77([]);
44110
- const prevStep = useRef35(null);
44443
+ const prevStep = useRef36(null);
44111
44444
  const hasHistoryEntry = stateHistory.length > 1;
44112
44445
  const onNext = useCallback51(
44113
44446
  (payload) => {
@@ -44281,7 +44614,7 @@ function useCheckoutModalTitle(depositAddress, defaultTitle) {
44281
44614
  import { IN_PROGRESS_CHECKOUT_STATES as IN_PROGRESS_CHECKOUT_STATES2 } from "@funkit/api-base";
44282
44615
  import { formatTimestampToDate, fullMonthNames } from "@funkit/utils";
44283
44616
  import clsx23 from "clsx";
44284
- import React273, { useEffect as useEffect72, useMemo as useMemo63, useRef as useRef37, useState as useState79 } from "react";
44617
+ import React273, { useEffect as useEffect73, useMemo as useMemo63, useRef as useRef38, useState as useState79 } from "react";
44285
44618
  import { Virtuoso } from "react-virtuoso";
44286
44619
 
44287
44620
  // src/consts/layout.ts
@@ -44644,13 +44977,13 @@ import { useCallback as useCallback52, useState as useState78 } from "react";
44644
44977
 
44645
44978
  // src/components/FunSelect/FunClickOutside.tsx
44646
44979
  import React269 from "react";
44647
- import { useEffect as useEffect71, useRef as useRef36 } from "react";
44980
+ import { useEffect as useEffect72, useRef as useRef37 } from "react";
44648
44981
  function FunClickOutside({
44649
44982
  children,
44650
44983
  onClick
44651
44984
  }) {
44652
- const wrapperRef = useRef36(null);
44653
- useEffect71(() => {
44985
+ const wrapperRef = useRef37(null);
44986
+ useEffect72(() => {
44654
44987
  const handleClickListener = (event) => {
44655
44988
  const clickedInside = wrapperRef.current?.contains(
44656
44989
  event.target
@@ -44824,8 +45157,8 @@ function Home({
44824
45157
  }) {
44825
45158
  const { t } = useFunkitTranslation();
44826
45159
  const [selectedView, setSelectedView] = useState79(defaultHomeTab);
44827
- const checkoutsListRef = useRef37(null);
44828
- const virtuosoParentRef = useRef37(null);
45160
+ const checkoutsListRef = useRef38(null);
45161
+ const virtuosoParentRef = useRef38(null);
44829
45162
  const account = useAccount();
44830
45163
  useCheckoutHistoryListener();
44831
45164
  const { userInfo, handleLogout } = useGeneralWallet();
@@ -44833,7 +45166,7 @@ function Home({
44833
45166
  const { checkoutHistoryList, isCheckoutHistoryInited } = useCheckoutHistoryContext();
44834
45167
  const { returnViewPresets } = useActivityTraversal();
44835
45168
  const { animation: tabAnimation, navigateTo } = useAnimatedNavigation(setSelectedView);
44836
- useEffect72(() => {
45169
+ useEffect73(() => {
44837
45170
  const virtuosoDiv = virtuosoParentRef.current?.firstChild;
44838
45171
  virtuosoDiv?.classList.add(animateVirtuosoInClass);
44839
45172
  }, []);
@@ -45381,7 +45714,7 @@ function ChainLineItem({
45381
45714
  var Chain = ({
45382
45715
  chainId: chainId2,
45383
45716
  currentChainId,
45384
- switchChain,
45717
+ switchChain: switchChain2,
45385
45718
  chainIconSize,
45386
45719
  isLoading,
45387
45720
  idx
@@ -45394,7 +45727,7 @@ var Chain = ({
45394
45727
  MenuButton,
45395
45728
  {
45396
45729
  currentlySelected: isCurrentChain,
45397
- onClick: isCurrentChain ? void 0 : () => switchChain({ chainId: chainId2 }),
45730
+ onClick: isCurrentChain ? void 0 : () => switchChain2({ chainId: chainId2 }),
45398
45731
  testId: `chain-option-${chainId2}`
45399
45732
  },
45400
45733
  /* @__PURE__ */ React282.createElement(Box, { fontFamily: "body", fontSize: "16", fontWeight: "bold" }, /* @__PURE__ */ React282.createElement(
@@ -45451,7 +45784,7 @@ function ChainModal({ onClose, open }) {
45451
45784
  const { t } = useFunkitTranslation();
45452
45785
  const { chainId: chainId2 } = useAccount();
45453
45786
  const { chains } = useConfig();
45454
- const { switchChain, pendingChainId } = useFunkitSwitchChains({
45787
+ const { switchChain: switchChain2, pendingChainId } = useFunkitSwitchChains({
45455
45788
  onSettled: () => onClose()
45456
45789
  });
45457
45790
  const { handleLogout } = useGeneralWallet();
@@ -45508,7 +45841,7 @@ function ChainModal({ onClose, open }) {
45508
45841
  key: id,
45509
45842
  chainId: id,
45510
45843
  currentChainId: chainId2,
45511
- switchChain,
45844
+ switchChain: switchChain2,
45512
45845
  chainIconSize,
45513
45846
  isLoading: pendingChainId === id,
45514
45847
  idx
@@ -45567,15 +45900,13 @@ function ChainModal({ onClose, open }) {
45567
45900
  }
45568
45901
 
45569
45902
  // src/modals/CheckoutModal/FunCheckoutModal.tsx
45570
- import { FUNKIT_CONNECT_SUPPORTED_CHECKOUT_CHAINS_INFO_LIST as FUNKIT_CONNECT_SUPPORTED_CHECKOUT_CHAINS_INFO_LIST2 } from "@funkit/chains";
45571
- import { LogLevel as LogLevel2, initializeRelayClient } from "@funkit/fun-relay";
45572
- import React297, { useEffect as useEffect80, useRef as useRef40 } from "react";
45903
+ import React297, { useEffect as useEffect81, useRef as useRef41 } from "react";
45573
45904
 
45574
45905
  // src/components/FunConnectOptions/FunConnectOptions.tsx
45575
45906
  import React289, { useCallback as useCallback54, useMemo as useMemo64, useState as useState83 } from "react";
45576
45907
 
45577
45908
  // src/components/FunConnectOptions/FunConnectResultStep.tsx
45578
- import React284, { useEffect as useEffect73 } from "react";
45909
+ import React284, { useEffect as useEffect74 } from "react";
45579
45910
  var AUTO_CLOSE = 2e3;
45580
45911
  var messageMap = (hasQrCode) => ({
45581
45912
  error: {
@@ -45594,7 +45925,7 @@ var FunConnectResultStep = ({
45594
45925
  qrCodeUri
45595
45926
  }) => {
45596
45927
  const hasAutoclose = type === "success";
45597
- useEffect73(() => {
45928
+ useEffect74(() => {
45598
45929
  if (!hasAutoclose) {
45599
45930
  return;
45600
45931
  }
@@ -46130,20 +46461,20 @@ var FunCheckoutBlocked = ({ reason }) => {
46130
46461
  };
46131
46462
 
46132
46463
  // src/modals/CheckoutModal/CheckoutModalPrefetchedHooks.tsx
46133
- import { useEffect as useEffect74 } from "react";
46464
+ import { useEffect as useEffect75 } from "react";
46134
46465
  function CheckoutModalPrefetchedHooks() {
46135
46466
  const { checkoutItem } = useCheckoutContext();
46136
46467
  const { address: walletAddress } = useAccount();
46137
46468
  const { setTargetAssetSupportsPermit, setTargetAssetPoolAllowance } = useQuoteContext();
46138
46469
  const aavePermitSupported = useAaveTargetReservePermit(checkoutItem);
46139
- useEffect74(() => {
46470
+ useEffect75(() => {
46140
46471
  setTargetAssetSupportsPermit(aavePermitSupported);
46141
46472
  }, [aavePermitSupported, setTargetAssetSupportsPermit]);
46142
46473
  const aavePoolAllowance = useAaveTargetPoolAllowance(
46143
46474
  checkoutItem,
46144
46475
  walletAddress
46145
46476
  );
46146
- useEffect74(() => {
46477
+ useEffect75(() => {
46147
46478
  setTargetAssetPoolAllowance(aavePoolAllowance);
46148
46479
  }, [aavePoolAllowance, setTargetAssetPoolAllowance]);
46149
46480
  return null;
@@ -46151,7 +46482,7 @@ function CheckoutModalPrefetchedHooks() {
46151
46482
 
46152
46483
  // src/modals/CheckoutModal/TransferToken/CheckoutNotifications.tsx
46153
46484
  import clsx26 from "clsx";
46154
- import React296, { useCallback as useCallback56, useEffect as useEffect78, useMemo as useMemo65, useState as useState85 } from "react";
46485
+ import React296, { useCallback as useCallback56, useEffect as useEffect79, useMemo as useMemo65, useState as useState85 } from "react";
46155
46486
 
46156
46487
  // src/components/FunNotificationBanner/FunNotificationShowMoreButton.tsx
46157
46488
  import React291 from "react";
@@ -46219,10 +46550,10 @@ var useRecentCheckouts = ({
46219
46550
 
46220
46551
  // src/hooks/useOnNewNotification.ts
46221
46552
  import { safeParseJson as safeParseJson2 } from "@funkit/utils";
46222
- import { useEffect as useEffect75 } from "react";
46553
+ import { useEffect as useEffect76 } from "react";
46223
46554
  var storageKey5 = "fkc-processed-notifications";
46224
46555
  var useOnNewNotification = (combinedNotifications, cb) => {
46225
- useEffect75(() => {
46556
+ useEffect76(() => {
46226
46557
  const alreadyProcessed = safeParseJsonObject(
46227
46558
  sessionStorage.getItem(storageKey5)
46228
46559
  );
@@ -46270,7 +46601,7 @@ import { Trans as Trans22 } from "react-i18next";
46270
46601
 
46271
46602
  // src/components/FunNotificationBanner/FunNotificationBanner.tsx
46272
46603
  import { AnimatePresence as AnimatePresence6, motion as motion19 } from "motion/react";
46273
- import React293, { useEffect as useEffect77, useRef as useRef39, useState as useState84 } from "react";
46604
+ import React293, { useEffect as useEffect78, useRef as useRef40, useState as useState84 } from "react";
46274
46605
  import clsx25 from "clsx";
46275
46606
 
46276
46607
  // src/components/FunNotificationBanner/FunNotificationBanner.css.ts
@@ -46280,7 +46611,7 @@ var showMoreButtonStyle = "_4yitd93 _1rsrm2f1r4 _1rsrm2f1i _1rsrm2f1f _1rsrm2f11
46280
46611
  // src/components/FunNotificationBanner/FunNotificationBannerIcon.tsx
46281
46612
  import clsx24 from "clsx";
46282
46613
  import { motion as motion18, useAnimate as useAnimate3 } from "motion/react";
46283
- import React292, { useCallback as useCallback55, useEffect as useEffect76, useRef as useRef38 } from "react";
46614
+ import React292, { useCallback as useCallback55, useEffect as useEffect77, useRef as useRef39 } from "react";
46284
46615
 
46285
46616
  // src/components/FunNotificationBanner/FunNotificationBannerIcon.css.ts
46286
46617
  var STATUS_SPINNER_BOTTOM_POSITION = -5;
@@ -46729,8 +47060,8 @@ var FunNotificationBannerIcon = ({
46729
47060
  )
46730
47061
  ]);
46731
47062
  }, [animate]);
46732
- const statusRef = useRef38(status);
46733
- useEffect76(() => {
47063
+ const statusRef = useRef39(status);
47064
+ useEffect77(() => {
46734
47065
  if (statusRef.current !== status) {
46735
47066
  if (statusRef.current === "processing" && status === "completed") {
46736
47067
  triggerAnimationProcessingToCompleted();
@@ -46828,9 +47159,9 @@ var FunNotificationBanner = ({
46828
47159
  }) => {
46829
47160
  const [showMore, setShowMore] = useState84(false);
46830
47161
  const [isOpen, setIsOpen] = useState84(true);
46831
- const prevStatusRef = useRef39(status);
47162
+ const prevStatusRef = useRef40(status);
46832
47163
  const prevStatus = prevStatusRef.current;
46833
- useEffect77(() => {
47164
+ useEffect78(() => {
46834
47165
  prevStatusRef.current = status;
46835
47166
  }, [status]);
46836
47167
  const direction = status && prevStatus && prevStatus !== status && (STATUS_RANK[status] ?? 0) < (STATUS_RANK[prevStatus] ?? 0) ? -1 : 1;
@@ -47399,13 +47730,13 @@ var CheckoutNotifications = ({
47399
47730
  }),
47400
47731
  [directExecutions, variant]
47401
47732
  );
47402
- useEffect78(() => {
47733
+ useEffect79(() => {
47403
47734
  if (initialCheckouts || !checkouts) {
47404
47735
  return;
47405
47736
  }
47406
47737
  setInitialCheckouts(checkouts);
47407
47738
  }, [initialCheckouts, checkouts]);
47408
- useEffect78(() => {
47739
+ useEffect79(() => {
47409
47740
  if (initialDirectExecutions || !directExecutions) {
47410
47741
  return;
47411
47742
  }
@@ -47515,7 +47846,7 @@ function selectSuccessScreenBackground({
47515
47846
  }
47516
47847
 
47517
47848
  // src/modals/CheckoutModal/useCheckoutBlocked.ts
47518
- import { useEffect as useEffect79 } from "react";
47849
+ import { useEffect as useEffect80 } from "react";
47519
47850
  var geoblockedViewableSteps = /* @__PURE__ */ new Set([
47520
47851
  "loading_account" /* LOADING_ACCOUNT */,
47521
47852
  "source_change" /* SOURCE_CHANGE */
@@ -47553,7 +47884,7 @@ function useCheckoutBlocked(params) {
47553
47884
  params.onCheckoutBlocked?.({ blockedReason: reason });
47554
47885
  }
47555
47886
  );
47556
- useEffect79(() => {
47887
+ useEffect80(() => {
47557
47888
  if (blockedReason) {
47558
47889
  onCheckoutBlockedEvent(blockedReason);
47559
47890
  }
@@ -47565,12 +47896,6 @@ function useCheckoutBlocked(params) {
47565
47896
  }
47566
47897
 
47567
47898
  // src/modals/CheckoutModal/FunCheckoutModal.tsx
47568
- initializeRelayClient({
47569
- // For now, enable only the checkout target chains funkit supports. In future, source chains may be added.
47570
- chains: FUNKIT_CONNECT_SUPPORTED_CHECKOUT_CHAINS_INFO_LIST2,
47571
- logLevel: LogLevel2.Verbose,
47572
- logger
47573
- });
47574
47899
  var CHECKOUT_DIALOG_CONTENT_ID = "checkout-dialog-content";
47575
47900
  var NOTIFICATION_STEP_VARIANTS = {
47576
47901
  ["transfer_token" /* TRANSFER_TOKEN */]: "token_transfer",
@@ -47628,8 +47953,8 @@ function FunCheckoutModalInner({
47628
47953
  } = useTitleConfig(checkoutItem, modalState);
47629
47954
  const notificationVariant = NOTIFICATION_STEP_VARIANTS[modalState.step];
47630
47955
  const handleCheckoutHelp = () => window.open(CONTACT_US_LINK, "_blank", "noopener");
47631
- const animationCallbackRef = useRef40(null);
47632
- const tooltipAnchorRef = useRef40(null);
47956
+ const animationCallbackRef = useRef41(null);
47957
+ const tooltipAnchorRef = useRef41(null);
47633
47958
  const handleAnimationCompleteRegister = (cb) => {
47634
47959
  animationCallbackRef.current = cb;
47635
47960
  };
@@ -47649,7 +47974,7 @@ function FunCheckoutModalInner({
47649
47974
  setModalState
47650
47975
  };
47651
47976
  const connectionStatus = useConnectionStatus();
47652
- useEffect80(() => {
47977
+ useEffect81(() => {
47653
47978
  if (!modalState.showWalletOptions) {
47654
47979
  return;
47655
47980
  }
@@ -47940,7 +48265,7 @@ function ModalProvider({ children }) {
47940
48265
  onConnect: () => closeModals(isUnauthenticated),
47941
48266
  onDisconnect: closeModals
47942
48267
  });
47943
- useEffect81(() => {
48268
+ useEffect82(() => {
47944
48269
  if (isUnauthenticated) {
47945
48270
  closeModals();
47946
48271
  }
@@ -48045,7 +48370,7 @@ function useConnectModal(onClose) {
48045
48370
  const { connectModalOpen, openConnectModal } = useContext20(ModalContext);
48046
48371
  const { isWalletConnectModalOpen } = useWalletConnectOpenState();
48047
48372
  const effectiveConnectModalOpen = connectModalOpen || isWalletConnectModalOpen;
48048
- useEffect81(() => {
48373
+ useEffect82(() => {
48049
48374
  if (!effectiveConnectModalOpen && onClose) {
48050
48375
  onClose();
48051
48376
  }
@@ -48145,7 +48470,7 @@ function FunkitCheckoutProvider({ children }) {
48145
48470
  },
48146
48471
  []
48147
48472
  );
48148
- useEffect82(() => {
48473
+ useEffect83(() => {
48149
48474
  if (isNotNullish8(logoutSymbol)) {
48150
48475
  setActiveCheckout(null);
48151
48476
  }
@@ -48780,7 +49105,7 @@ function useFunkitCheckout(props) {
48780
49105
  }
48781
49106
  };
48782
49107
  const isTestnetCheckoutBlocked = (config) => {
48783
- return isUserLoggedIn && !FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO10?.[config.targetChain]?.isMainnet;
49108
+ return isUserLoggedIn && !FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO11?.[config.targetChain]?.isMainnet;
48784
49109
  };
48785
49110
  const handleLoggedInCheckout = (config, checkoutId) => {
48786
49111
  setPendingCheckoutConfig(void 0);
@@ -48883,13 +49208,13 @@ function useFunkitCheckout(props) {
48883
49208
  });
48884
49209
  openWithdrawalModal?.({ withdrawalId, ...config });
48885
49210
  });
48886
- useEffect82(() => {
49211
+ useEffect83(() => {
48887
49212
  if (isUserLoggedIn && pendingCheckoutConfig) {
48888
49213
  setPendingCheckoutConfig(void 0);
48889
49214
  beginCheckout(pendingCheckoutConfig);
48890
49215
  }
48891
49216
  }, [beginCheckout, isUserLoggedIn, pendingCheckoutConfig]);
48892
- useEffect82(() => {
49217
+ useEffect83(() => {
48893
49218
  if (pendingCheckoutConfig && !isUserLoggedIn && !connectModalOpen) {
48894
49219
  setPendingCheckoutConfig(void 0);
48895
49220
  }
@@ -48949,7 +49274,7 @@ async function validateCheckoutConfig(config, apiKey) {
48949
49274
  message: "Invalid targetAssetTicker configuration: Missing value"
48950
49275
  };
48951
49276
  }
48952
- if (!FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO11[config.targetChain]) {
49277
+ if (!FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO12[config.targetChain]) {
48953
49278
  return {
48954
49279
  isValid: false,
48955
49280
  message: `Invalid targetChain configuration: Unsupported chain id ${config.targetChain} for checkout.`
@@ -49101,7 +49426,7 @@ function getMaxTargetAssetAmountEstimate(sourceAssetBalance, config, quoteResult
49101
49426
  async function getTokenDecimals(wagmiConfig, chainId2, tokenAddress) {
49102
49427
  try {
49103
49428
  if (isNativeTokenAddress(tokenAddress)) {
49104
- return FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO11[chainId2]?.nativeCurrency?.decimals || 18;
49429
+ return FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO12[chainId2]?.nativeCurrency?.decimals || 18;
49105
49430
  }
49106
49431
  if (chainId2 === solanaChain5.id.toString()) {
49107
49432
  return solanaChain5.nativeCurrency.decimals;
@@ -49114,7 +49439,7 @@ async function getTokenDecimals(wagmiConfig, chainId2, tokenAddress) {
49114
49439
  }
49115
49440
  const decimals = await readContract(wagmiConfig, {
49116
49441
  address: tokenAddress,
49117
- abi: erc20Abi8,
49442
+ abi: erc20Abi9,
49118
49443
  chainId: Number.parseInt(chainId2),
49119
49444
  functionName: "decimals"
49120
49445
  });
@@ -49157,7 +49482,7 @@ function isCheckoutPostActionRequired(config) {
49157
49482
  }
49158
49483
  function isVaultDepositCheckout(checkoutConfig, sourceHolding) {
49159
49484
  return Boolean(
49160
- checkoutConfig.finalizedToken && sourceHolding && checkoutConfig.generateActionsParams && isTokenEquivalent13({
49485
+ checkoutConfig.finalizedToken && sourceHolding && checkoutConfig.generateActionsParams && isTokenEquivalent14({
49161
49486
  firstTokenChainId: checkoutConfig.targetChain,
49162
49487
  firstTokenAddress: checkoutConfig.targetAsset,
49163
49488
  secondTokenChainId: sourceHolding.chainId,
@@ -49175,7 +49500,7 @@ function computeDisplayDestinationToken(checkoutConfig, displayAssetAmount) {
49175
49500
  }
49176
49501
  const { finalizedToken, targetAssetTicker } = checkoutConfig;
49177
49502
  const targetToken = checkoutConfig.dynamicTargetAssetCandidates?.find(
49178
- (cand) => isTokenEquivalent13({
49503
+ (cand) => isTokenEquivalent14({
49179
49504
  firstTokenChainId: cand.tokenChainId,
49180
49505
  firstTokenAddress: cand.tokenAddress,
49181
49506
  secondTokenChainId: checkoutConfig.targetChain,
@@ -49263,14 +49588,14 @@ var isAssetUsableToPayForCheckout = ({
49263
49588
  }
49264
49589
  if (isCheckoutPostActionRequired(config)) {
49265
49590
  const finalizedToken = config.finalizedToken;
49266
- return finalizedToken && isTokenEquivalent14({
49591
+ return finalizedToken && isTokenEquivalent15({
49267
49592
  firstTokenChainId: targetChainId,
49268
49593
  firstTokenAddress: targetTokenAddress,
49269
49594
  secondTokenChainId: finalizedToken.tokenChainId,
49270
49595
  secondTokenAddress: finalizedToken.tokenAddress
49271
49596
  });
49272
49597
  }
49273
- return paymentMethod === PaymentMethod.ACCOUNT_BALANCE && finalCheckoutRecipient.toLowerCase() === payerAddress.toLowerCase() && isTokenEquivalent14({
49598
+ return paymentMethod === PaymentMethod.ACCOUNT_BALANCE && finalCheckoutRecipient.toLowerCase() === payerAddress.toLowerCase() && isTokenEquivalent15({
49274
49599
  firstTokenChainId: targetChainId,
49275
49600
  firstTokenAddress: targetTokenAddress,
49276
49601
  secondTokenChainId: assetChainId,
@@ -49296,7 +49621,7 @@ var isAssetUsableToPayForCheckout = ({
49296
49621
  minUsdWithFees: minValueThreshold + feeEstimate
49297
49622
  };
49298
49623
  }
49299
- const isSupported = isAllowedForCheckout && FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO12[assetChainId]?.isCheckoutSupported;
49624
+ const isSupported = isAllowedForCheckout && FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO13[assetChainId]?.isCheckoutSupported;
49300
49625
  return {
49301
49626
  isUsable: !!isSupported,
49302
49627
  reason: !isSupported ? t("payment.unsupported") : ""
@@ -49304,7 +49629,7 @@ var isAssetUsableToPayForCheckout = ({
49304
49629
  };
49305
49630
 
49306
49631
  // src/hooks/useWalletAssets.ts
49307
- import { isTokenEquivalent as isTokenEquivalent15 } from "@funkit/utils";
49632
+ import { isTokenEquivalent as isTokenEquivalent16 } from "@funkit/utils";
49308
49633
  var ASSETS_LOW_VALUE_THRESHOLD3 = 0.1;
49309
49634
  var FETCH_ASSETS_INTERVAL_MS2 = 6e4;
49310
49635
  function isKnownAsset2(asset) {
@@ -49313,7 +49638,7 @@ function isKnownAsset2(asset) {
49313
49638
  var POLYGON_USDCE_TOKEN = "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174";
49314
49639
  var ARBITRUM_USDCE_TOKEN = "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8";
49315
49640
  function normalizeAssetSymbol(asset) {
49316
- if (isTokenEquivalent15({
49641
+ if (isTokenEquivalent16({
49317
49642
  firstTokenChainId: asset.chainId,
49318
49643
  firstTokenAddress: asset.contractAddress,
49319
49644
  secondTokenChainId: polygon8.id.toString(),
@@ -49321,7 +49646,7 @@ function normalizeAssetSymbol(asset) {
49321
49646
  })) {
49322
49647
  return { ...asset, symbol: "USDC.e" };
49323
49648
  }
49324
- if (isTokenEquivalent15({
49649
+ if (isTokenEquivalent16({
49325
49650
  firstTokenChainId: asset.chainId,
49326
49651
  firstTokenAddress: asset.contractAddress,
49327
49652
  secondTokenChainId: arbitrum7.id.toString(),
@@ -49694,7 +50019,7 @@ function ConnectButton({
49694
50019
  const connectionStatus = useConnectionStatus();
49695
50020
  const { setShowBalance } = useShowBalance();
49696
50021
  const [ready, setReady] = useState88(false);
49697
- useEffect83(() => {
50022
+ useEffect84(() => {
49698
50023
  setShowBalance(showBalance);
49699
50024
  if (!ready) {
49700
50025
  setReady(true);