@funkit/connect 9.23.0 → 9.23.1

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 (42) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/clients/{chunk-KSSSSWR6.js → chunk-2LMREKV6.js} +1 -1
  3. package/dist/clients/{chunk-NCCAYPLO.js → chunk-4M57JDJK.js} +1 -1
  4. package/dist/clients/{chunk-ZMVXBMON.js → chunk-GCIUIPM7.js} +1 -1
  5. package/dist/clients/{chunk-OWXKWC7I.js → chunk-H3CKQIYI.js} +10 -10
  6. package/dist/clients/{chunk-4752IYY6.js → chunk-KWIR3HO4.js} +1 -1
  7. package/dist/clients/fanatics.css +2 -2
  8. package/dist/clients/fanatics.js +3 -3
  9. package/dist/clients/lighter.css +2 -2
  10. package/dist/clients/lighter.js +5 -3
  11. package/dist/clients/mallard.d.ts +49 -0
  12. package/dist/clients/mallard.js +86 -0
  13. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +91 -91
  14. package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +6 -6
  15. package/dist/clients/polymarket/createPolymarketDepositConfig.js +2 -2
  16. package/dist/clients/polymarket/index.css +91 -91
  17. package/dist/clients/polymarket/index.js +6 -6
  18. package/dist/clients/polymarket/polymarket.js +1 -1
  19. package/dist/clients/rolly.js +1 -14
  20. package/dist/components/Box/Box.d.ts +21 -21
  21. package/dist/consts/customers.d.ts +2 -0
  22. package/dist/css/sprinkles.css.d.ts +21 -21
  23. package/dist/domains/asset.d.ts +2 -2
  24. package/dist/domains/clientMetadata.d.ts +6 -1
  25. package/dist/hooks/useTokenTransferConfig.d.ts +7 -0
  26. package/dist/index.css +32 -32
  27. package/dist/index.js +216 -295
  28. package/dist/modals/CheckoutModal/FunCheckoutStep.d.ts +3 -1
  29. package/dist/modals/CheckoutModal/SelectAsset/SelectAsset.d.ts +1 -1
  30. package/dist/modals/CheckoutModal/Withdrawal/WithdrawalComplete.d.ts +14 -0
  31. package/dist/modals/CheckoutModal/Withdrawal/WithdrawalEnterAmount.d.ts +15 -0
  32. package/dist/modals/CheckoutModal/stepTransition.d.ts +6 -0
  33. package/dist/modals/CheckoutModal/stepTransition.track.d.ts +1 -1
  34. package/dist/providers/FunkitCheckoutContext/types.d.ts +2 -28
  35. package/dist/utils/tokenTransfer/disabledList.d.ts +1 -14
  36. package/dist/utils/tokenTransfer/types.d.ts +5 -30
  37. package/dist/wallets/walletConnectors/index.js +32 -32
  38. package/package.json +4 -4
  39. package/dist/clients/nado.d.ts +0 -78
  40. package/dist/clients/nado.js +0 -107
  41. /package/dist/clients/{chunk-52NKHZS2.js → chunk-OG254LB3.js} +0 -0
  42. /package/dist/clients/{chunk-MOUTRRN3.js → chunk-S7FRYR55.js} +0 -0
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use client";
2
- import {
3
- lightTheme
4
- } from "./chunk-67BKQQNG.js";
5
2
  import {
6
3
  darkTheme
7
4
  } from "./chunk-36KVHK22.js";
5
+ import {
6
+ lightTheme
7
+ } from "./chunk-67BKQQNG.js";
8
8
  import {
9
9
  systemFontStack
10
10
  } from "./chunk-4YEAUICE.js";
@@ -968,15 +968,17 @@ import {
968
968
  getAllWalletTokens
969
969
  } from "@funkit/api-base";
970
970
  import { keepPreviousData as keepPreviousData4, useQuery as useQuery28 } from "@tanstack/react-query";
971
- import { arbitrum as arbitrum7, polygon as polygon9 } from "viem/chains";
971
+ import { arbitrum as arbitrum7, polygon as polygon8 } from "viem/chains";
972
972
 
973
973
  // src/domains/asset.ts
974
974
  import {
975
975
  FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO12,
976
- solanaChain as solanaChain7
976
+ hyperEvmChain as hyperEvmChain4,
977
+ monadChain as monadChain2,
978
+ solanaChain as solanaChain6
977
979
  } from "@funkit/chains";
978
- import { isTokenAddressEquivalent as isTokenAddressEquivalent7, isTokenEquivalent as isTokenEquivalent11 } from "@funkit/utils";
979
- import { arbitrum as arbitrum6, base as base6, mainnet as mainnet13, optimism as optimism2, polygon as polygon8 } from "viem/chains";
980
+ import { isTokenAddressEquivalent as isTokenAddressEquivalent6, isTokenEquivalent as isTokenEquivalent11 } from "@funkit/utils";
981
+ import { arbitrum as arbitrum6, base as base6, bsc as bsc2, mainnet as mainnet13, optimism as optimism2, polygon as polygon7 } from "viem/chains";
980
982
 
981
983
  // src/utils/checkout.ts
982
984
  import {
@@ -985,17 +987,17 @@ import {
985
987
  toMergedCheckoutHistoryItem
986
988
  } from "@funkit/connect-core";
987
989
  import {
988
- FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS as FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS4,
990
+ FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS as FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS5,
989
991
  FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO11,
990
992
  lightningChain as lightningChain4,
991
- solanaChain as solanaChain6,
992
- tronChain as tronChain5
993
+ solanaChain as solanaChain5,
994
+ tronChain as tronChain4
993
995
  } from "@funkit/chains";
994
996
  import { getRelayAssetInfo } from "@funkit/fun-relay";
995
997
  import {
996
998
  formatCryptoAndStringify as formatCryptoAndStringify11,
997
999
  isNumericString,
998
- isTokenAddressEquivalent as isTokenAddressEquivalent6,
1000
+ isTokenAddressEquivalent as isTokenAddressEquivalent5,
999
1001
  isTokenEquivalent as isTokenEquivalent10,
1000
1002
  round as round3
1001
1003
  } from "@funkit/utils";
@@ -1013,8 +1015,10 @@ import {
1013
1015
  HYENA_API_KEY,
1014
1016
  HYPERDASH_API_KEY,
1015
1017
  LIGHTERXYZ_API_KEY,
1018
+ MALLARD_API_KEY,
1016
1019
  MONAD_API_KEY,
1017
1020
  MONKEY_TILT_API_KEY,
1021
+ NADO_API_KEY,
1018
1022
  OSTIUM_API_KEY,
1019
1023
  PERPL_API_KEY,
1020
1024
  POLYMARKET_API_KEY
@@ -1032,9 +1036,6 @@ function isEtherealCustomer(apiKey) {
1032
1036
  function isMonadCustomer(apiKey) {
1033
1037
  return apiKey === MONAD_API_KEY;
1034
1038
  }
1035
- function isBasedCustomer(apiKey) {
1036
- return apiKey === BASED_API_KEY;
1037
- }
1038
1039
  function isHyenaCustomer(apiKey) {
1039
1040
  return apiKey === HYENA_API_KEY;
1040
1041
  }
@@ -1047,6 +1048,12 @@ function isFanaticsCustomer(apiKey) {
1047
1048
  function isAaveCustomer(apiKey) {
1048
1049
  return apiKey === AAVE_API_KEY;
1049
1050
  }
1051
+ function isNadoCustomer(apiKey) {
1052
+ return apiKey === NADO_API_KEY;
1053
+ }
1054
+ function isMallardCustomer(apiKey) {
1055
+ return apiKey === MALLARD_API_KEY;
1056
+ }
1050
1057
  function isCustomerNativeFastPathEnabled(apiKey) {
1051
1058
  return isAaveCustomer(apiKey);
1052
1059
  }
@@ -1116,7 +1123,7 @@ import {
1116
1123
  FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO10,
1117
1124
  SOLANA_MAINNET_CHAIN_ID as SOLANA_MAINNET_CHAIN_ID2
1118
1125
  } from "@funkit/chains";
1119
- import { isNotNullish as isNotNullish8, isTokenAddressEquivalent as isTokenAddressEquivalent5 } from "@funkit/utils";
1126
+ import { isNotNullish as isNotNullish8, isTokenAddressEquivalent as isTokenAddressEquivalent4 } from "@funkit/utils";
1120
1127
  import React301, {
1121
1128
  createContext as createContext21,
1122
1129
  useCallback as useCallback56,
@@ -1526,6 +1533,15 @@ function createPaymentMethodInfo(params) {
1526
1533
  }
1527
1534
 
1528
1535
  // src/domains/clientMetadata.ts
1536
+ function stripFunctionsForBackend(config) {
1537
+ return {
1538
+ ...config,
1539
+ generateActionsParams: void 0,
1540
+ dynamicTargetAssetCandidates: config.dynamicTargetAssetCandidates?.map(
1541
+ ({ generateActionsParams: _stripped, ...candidate }) => candidate
1542
+ )
1543
+ };
1544
+ }
1529
1545
  function generateClientMetadataForBackend({
1530
1546
  checkoutItem,
1531
1547
  latestQuote,
@@ -1541,11 +1557,9 @@ function generateClientMetadataForBackend({
1541
1557
  initSettings: {
1542
1558
  ...checkoutItem.initSettings,
1543
1559
  //TODO: on callbacks are not serializable, should be removed
1544
- config: {
1545
- ...checkoutItem.initSettings.config,
1546
- // Functions cannot be serialized over REST API (because JSON is a data format, and functions are not valid data types in JSON)
1547
- generateActionsParams: void 0
1548
- }
1560
+ // Functions cannot be serialized over REST API; strip the top-level
1561
+ // callback and every candidate's per-route override too.
1562
+ config: stripFunctionsForBackend(checkoutItem.initSettings.config)
1549
1563
  },
1550
1564
  selectedSourceAssetInfo: checkoutItem.selectedSourceAssetInfo,
1551
1565
  selectedPaymentMethodInfo: checkoutItem.selectedPaymentMethodInfo ? checkoutItem.selectedPaymentMethodInfo : null,
@@ -1603,7 +1617,8 @@ function mergeDynamicTargetAssetCandidateIntoConfig(config, candidate) {
1603
1617
  targetAssetTicker: candidate.tokenSymbol,
1604
1618
  iconSrc: candidate.iconSrc,
1605
1619
  dynamicRoutingId: candidate.dynamicRoutingId ?? config.dynamicRoutingId,
1606
- customRecipient: candidate.customRecipient ?? config.customRecipient
1620
+ customRecipient: candidate.customRecipient ?? config.customRecipient,
1621
+ generateActionsParams: "generateActionsParams" in candidate ? candidate.generateActionsParams : config.generateActionsParams
1607
1622
  };
1608
1623
  }
1609
1624
 
@@ -1644,7 +1659,7 @@ function setFunkitConnectVersion({ version }) {
1644
1659
  localStorage.setItem(storageKey, version);
1645
1660
  }
1646
1661
  function getCurrentSdkVersion() {
1647
- return "9.23.0";
1662
+ return "9.23.1";
1648
1663
  }
1649
1664
  function useFingerprint() {
1650
1665
  const fingerprint = useCallback3(() => {
@@ -2132,8 +2147,8 @@ function validateFops(res, logTag) {
2132
2147
  // src/hooks/useTokenTransfer.ts
2133
2148
  import {
2134
2149
  bitcoinChain,
2135
- hyperEvmChain,
2136
- monadChain,
2150
+ FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS as FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS2,
2151
+ hyperCoreChain,
2137
2152
  solanaChain,
2138
2153
  tronChain
2139
2154
  } from "@funkit/chains";
@@ -2202,7 +2217,9 @@ var CHECKOUT_STEP_TO_NAVIGATION_EVENT = {
2202
2217
  ["brokerage_two_fa" /* BROKERAGE_TWO_FA */]: "fc::navigate::brokerage_two_fa" /* NAVIGATE_BROKERAGE_TWO_FA */,
2203
2218
  ["brokerage_success" /* BROKERAGE_SUCCESS */]: "fc::navigate::brokerage_success" /* NAVIGATE_BROKERAGE_SUCCESS */,
2204
2219
  ["swapped_iframe" /* SWAPPED_IFRAME */]: "fc::navigate::swapped_iframe" /* NAVIGATE_SWAPPED_IFRAME */,
2205
- ["perps_transfer" /* PERPS_TRANSFER */]: "fc::navigate::perps_transfer" /* NAVIGATE_PERPS_TRANSFER */
2220
+ ["perps_transfer" /* PERPS_TRANSFER */]: "fc::navigate::perps_transfer" /* NAVIGATE_PERPS_TRANSFER */,
2221
+ ["withdrawal_enter_amount" /* WITHDRAWAL_ENTER_AMOUNT */]: null,
2222
+ ["withdrawal_complete" /* WITHDRAWAL_COMPLETE */]: null
2206
2223
  };
2207
2224
  var CHECKOUT_STEP_TO_READY_EVENT = {
2208
2225
  ["confirmation" /* CONFIRMATION */]: "fc::ready::confirmation" /* READY_CONFIRMATION */,
@@ -2214,6 +2231,9 @@ var CHECKOUT_STEP_TO_READY_EVENT = {
2214
2231
  };
2215
2232
  var trackEventFromNextState = (nextState) => {
2216
2233
  const eventName = CHECKOUT_STEP_TO_NAVIGATION_EVENT[nextState.step];
2234
+ if (!eventName) {
2235
+ return null;
2236
+ }
2217
2237
  return {
2218
2238
  eventName,
2219
2239
  metadata: nextState
@@ -2451,16 +2471,15 @@ var useTokenTransfer = (selectedChainId, selectedToken, chainIds) => {
2451
2471
  const enableUniversal = useDynamicConfig(
2452
2472
  "enabletokentransferuniversaldepositaddress"
2453
2473
  );
2454
- const estPriceImpact = usePriceImpactEstimation(
2455
- selectedToken,
2456
- selectedChainId
2457
- );
2474
+ const estPriceImpact = usePriceImpactEstimation(selectedToken);
2458
2475
  const checkoutConfig = checkoutItem?.initSettings.config;
2459
2476
  const maxSlippage = useMaxSlippage({
2460
2477
  apiKey,
2461
2478
  sourceToken: selectedToken,
2462
2479
  selectedChainId,
2463
- targetAssetTicker: checkoutConfig?.targetAssetTicker ?? ""
2480
+ targetChainId: checkoutConfig?.targetChain,
2481
+ targetAssetTicker: checkoutConfig?.targetAssetTicker ?? "",
2482
+ targetAssetAddress: checkoutConfig?.targetAsset
2464
2483
  });
2465
2484
  const { transferInit, recipientAddr } = useCheckoutTransferInit();
2466
2485
  const minTransferUsd = useMinTransferValueUsd(selectedChainId);
@@ -2535,60 +2554,84 @@ var useMinTransferValues = (chainIds) => {
2535
2554
  );
2536
2555
  }, [chainIds, limits]);
2537
2556
  };
2538
- var usePriceImpactEstimation = (selectedToken, selectedChainId) => {
2557
+ var USDC_FAMILY_TICKERS = /* @__PURE__ */ new Set([
2558
+ "USDC",
2559
+ "USDC.e",
2560
+ "pUSD",
2561
+ "USDC (Perps)",
2562
+ "USDC (Spot)"
2563
+ ]);
2564
+ var USDT_FAMILY_TICKERS = /* @__PURE__ */ new Set(["USDT", "USDT0", "USD\u20AE0"]);
2565
+ var USDC_USDT_FAMILY_TICKERS = /* @__PURE__ */ new Set([
2566
+ ...USDC_FAMILY_TICKERS,
2567
+ ...USDT_FAMILY_TICKERS
2568
+ ]);
2569
+ var isSameUsdcOrUsdtFamily = (sourceToken, targetTicker) => {
2570
+ if (!sourceToken) return false;
2571
+ if (sourceToken === targetTicker) return true;
2572
+ if (USDC_FAMILY_TICKERS.has(sourceToken) && USDC_FAMILY_TICKERS.has(targetTicker)) {
2573
+ return true;
2574
+ }
2575
+ return USDT_FAMILY_TICKERS.has(sourceToken) && USDT_FAMILY_TICKERS.has(targetTicker);
2576
+ };
2577
+ var usePriceImpactEstimation = (selectedToken) => {
2539
2578
  const { t } = useFunkitTranslation();
2540
2579
  const { checkoutItem } = useCheckoutContext();
2541
2580
  const isStablecoin = useIsStablecoin();
2542
2581
  const label = t("fees.priceImpact");
2543
- const isUSDC = selectedToken === "USDC" || selectedToken === "USDC.e";
2544
- const isUSDT = selectedToken === "USDT";
2545
- const isPreferredChainId = selectedChainId !== void 0 && isPreferredChain(selectedChainId);
2546
2582
  const targetAssetTicker = checkoutItem?.initSettings.config.targetAssetTicker ?? "";
2547
- if (!isPreferredChainId || !isStablecoin(targetAssetTicker)) {
2548
- return { label, value: 0.25 };
2583
+ if (!selectedToken) {
2584
+ return { label, value: 0 };
2549
2585
  }
2550
- if (isUSDC) {
2586
+ if (isSameUsdcOrUsdtFamily(selectedToken, targetAssetTicker)) {
2551
2587
  return { label, value: 0 };
2552
2588
  }
2553
- if (isUSDT) {
2589
+ if (USDC_USDT_FAMILY_TICKERS.has(selectedToken) && USDC_USDT_FAMILY_TICKERS.has(targetAssetTicker)) {
2554
2590
  return { label, value: 0.05 };
2555
2591
  }
2556
- return { label, value: 0.1 };
2592
+ if (isStablecoin(selectedToken) && isStablecoin(targetAssetTicker)) {
2593
+ return { label, value: 0.1 };
2594
+ }
2595
+ return { label, value: 0.25 };
2557
2596
  };
2558
2597
  var useMaxSlippage = ({
2559
2598
  apiKey,
2560
2599
  sourceToken,
2561
2600
  selectedChainId,
2562
- targetAssetTicker
2601
+ targetChainId,
2602
+ targetAssetTicker,
2603
+ targetAssetAddress
2563
2604
  }) => {
2564
2605
  const { t } = useFunkitTranslation();
2565
2606
  const isStablecoin = useIsStablecoin();
2566
2607
  const label = t("fees.maxSlippage");
2567
- const isArbitrum = selectedChainId === arbitrum2.id;
2568
- const isPreferredChainId = selectedChainId !== void 0 && isPreferredChain(selectedChainId);
2569
- const defaultValue = 0.25;
2570
- if (isBasedCustomer(apiKey) && isArbitrum && sourceToken === "USDC") {
2571
- return { label, value: 0.1 };
2608
+ if (!sourceToken || !selectedChainId) {
2609
+ return { label, value: 0 };
2572
2610
  }
2573
- if (isLighterxyzCustomer(apiKey) && selectedChainId !== void 0 && // if preferred chains + chains that have CCTP support
2574
- isPreferredChain(selectedChainId, [hyperEvmChain.id, monadChain.id]) && sourceToken === "USDC") {
2611
+ const isSourceArbitrumUsdc = selectedChainId === arbitrum2.id && sourceToken === "USDC";
2612
+ const isTargetHypercoreUsdcPerps = Number(targetChainId) === hyperCoreChain.id && targetAssetAddress === FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS2;
2613
+ if (isTargetHypercoreUsdcPerps && isSourceArbitrumUsdc) {
2614
+ return { label, value: 0 };
2615
+ }
2616
+ if (isLighterxyzCustomer(apiKey) && sourceToken === "USDC") {
2575
2617
  return { label, value: 0.01 };
2576
2618
  }
2577
- if (isPolymarketCustomer(apiKey) && isPreferredChainId) {
2578
- if (sourceToken === "USDC.e") {
2579
- return { label, value: 0 };
2580
- }
2581
- if (sourceToken === "USDC") {
2582
- return { label, value: 0.05 };
2583
- }
2584
- if (sourceToken === "USDT") {
2585
- return { label, value: 0.2 };
2586
- }
2619
+ if (isPolymarketCustomer(apiKey) && sourceToken === "USDC.e") {
2620
+ return { label, value: 0 };
2587
2621
  }
2588
- if (!isPreferredChainId || !isStablecoin(targetAssetTicker) || sourceToken === "DAI") {
2589
- return { label, value: 1 };
2622
+ if (selectedChainId === Number(targetChainId) && sourceToken === targetAssetTicker) {
2623
+ return { label, value: 0 };
2624
+ }
2625
+ if (isSameUsdcOrUsdtFamily(sourceToken, targetAssetTicker)) {
2626
+ return { label, value: 0.05 };
2590
2627
  }
2591
- return { label, value: defaultValue };
2628
+ if (USDC_USDT_FAMILY_TICKERS.has(sourceToken) && USDC_USDT_FAMILY_TICKERS.has(targetAssetTicker)) {
2629
+ return { label, value: 0.2 };
2630
+ }
2631
+ if (isPreferredChain(selectedChainId) && isPreferredChain(Number(targetChainId)) || isStablecoin(sourceToken) && isStablecoin(targetAssetTicker)) {
2632
+ return { label, value: 0.25 };
2633
+ }
2634
+ return { label, value: 1 };
2592
2635
  };
2593
2636
 
2594
2637
  // src/providers/FunkitMoonpayProvider.tsx
@@ -2932,9 +2975,9 @@ import {
2932
2975
  BluvoWithdrawalError
2933
2976
  } from "@funkit/api-base";
2934
2977
  import {
2935
- FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS as FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS2,
2978
+ FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS as FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS3,
2936
2979
  FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO,
2937
- hyperCoreChain,
2980
+ hyperCoreChain as hyperCoreChain2,
2938
2981
  hyperEvmChain as hyperEvmChain2
2939
2982
  } from "@funkit/chains";
2940
2983
  import { v4 as uuid } from "uuid";
@@ -2980,7 +3023,7 @@ function getPreferredNetwork(networks, targetChainId) {
2980
3023
  const networkMap = Object.fromEntries(
2981
3024
  validNetworks.map((n) => [n.chainId?.toString(), n])
2982
3025
  );
2983
- const isArbritrumOverride = [hyperCoreChain, hyperEvmChain2].some(
3026
+ const isArbritrumOverride = [hyperCoreChain2, hyperEvmChain2].some(
2984
3027
  ({ id }) => id.toString() === targetChainId
2985
3028
  );
2986
3029
  if (validNetworks.length === 0) {
@@ -3068,7 +3111,7 @@ function transformBluvoBalancesToAssetHoldings(balances, preferredChainId) {
3068
3111
  continue;
3069
3112
  }
3070
3113
  const isNativeCurrency = chainInfo.nativeCurrency.symbol.toUpperCase() === asset.toUpperCase();
3071
- const normalizedTokenAddress = isNativeCurrency ? FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS2 : tokenAddress;
3114
+ const normalizedTokenAddress = isNativeCurrency ? FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS3 : tokenAddress;
3072
3115
  const chainSymbolKey = combineChainSymbolOrAddress({
3073
3116
  chainId: chainId2.toString(),
3074
3117
  symbolOrAddress: asset
@@ -3331,11 +3374,11 @@ import {
3331
3374
  } from "@funkit/api-base";
3332
3375
  import {
3333
3376
  FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO2,
3334
- hyperCoreChain as hyperCoreChain2
3377
+ hyperCoreChain as hyperCoreChain3
3335
3378
  } from "@funkit/chains";
3336
3379
  import { ResourceNotFoundError } from "@funkit/utils";
3337
3380
  var findBridgeSupportedChain = (chainId2) => {
3338
- if (chainId2 === hyperCoreChain2.id.toString()) {
3381
+ if (chainId2 === hyperCoreChain3.id.toString()) {
3339
3382
  return "arbitrum";
3340
3383
  }
3341
3384
  const chainName = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO2[chainId2]?.name.toLowerCase();
@@ -3641,7 +3684,7 @@ function useCreateVirtualBankAccount() {
3641
3684
 
3642
3685
  // src/hooks/useWalletAssetHoldings.ts
3643
3686
  import {
3644
- FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS as FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS3,
3687
+ FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS as FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS4,
3645
3688
  FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO3
3646
3689
  } from "@funkit/chains";
3647
3690
  import * as dnum2 from "dnum";
@@ -3776,7 +3819,7 @@ var processWalletAssets = (walletAssets, targetChain, isStablecoin) => {
3776
3819
  chainId: asset.chainId,
3777
3820
  symbolOrAddress: asset.symbol
3778
3821
  });
3779
- const normalizedTokenAddress = assetChainInfo?.nativeCurrency.symbol.toUpperCase() === asset.symbol.toUpperCase() ? FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS3 : asset.contractAddress;
3822
+ const normalizedTokenAddress = assetChainInfo?.nativeCurrency.symbol.toUpperCase() === asset.symbol.toUpperCase() ? FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS4 : asset.contractAddress;
3780
3823
  const normalizeAmount = getNormalizedTokenBalance(
3781
3824
  BigInt(asset.tokenBalance),
3782
3825
  asset.decimals
@@ -3808,6 +3851,7 @@ var processWalletAssets = (walletAssets, targetChain, isStablecoin) => {
3808
3851
  };
3809
3852
  function useWalletAssetHoldings(targetChain) {
3810
3853
  const { walletAssets, isLoading, totalWalletAssetsUsd } = useWalletAssets();
3854
+ const { apiKey } = useFunkitConfig();
3811
3855
  const { checkoutItem } = useCheckoutContext();
3812
3856
  const config = checkoutItem?.initSettings.config;
3813
3857
  const { walletAddress, isUserLoggedIn } = useGeneralWallet();
@@ -3844,7 +3888,7 @@ function useWalletAssetHoldings(targetChain) {
3844
3888
  asset.tokenAddress
3845
3889
  ),
3846
3890
  minValueThreshold,
3847
- isDynamicRoutingEnabled,
3891
+ isLighterDynamicRoutingEnabled: isDynamicRoutingEnabled && isLighterxyzCustomer(apiKey),
3848
3892
  t
3849
3893
  });
3850
3894
  return isUsable;
@@ -20035,8 +20079,10 @@ function isLive(option) {
20035
20079
  }
20036
20080
 
20037
20081
  // src/hooks/useTokenTransferConfig.ts
20082
+ import {
20083
+ resolveTokenTransferConfig
20084
+ } from "@funkit/connect-core";
20038
20085
  import { useMemo as useMemo27 } from "react";
20039
- import { polygon as polygon6 } from "viem/chains";
20040
20086
 
20041
20087
  // src/hooks/useSupportedAssets.ts
20042
20088
  import {
@@ -20057,150 +20103,8 @@ function useSupportedAssets(options) {
20057
20103
  });
20058
20104
  }
20059
20105
 
20060
- // src/utils/tokenTransfer/disabledList.ts
20061
- import { isTokenAddressEquivalent } from "@funkit/utils";
20062
- function isChainDisabled(disabledConfig, chainId2) {
20063
- if (!disabledConfig) {
20064
- return false;
20065
- }
20066
- const disabledTokens = disabledConfig[String(chainId2)];
20067
- if (!disabledTokens) {
20068
- return false;
20069
- }
20070
- return disabledTokens.includes("*");
20071
- }
20072
- function isAssetDisabled(disabledConfig, chainId2, tokenAddress) {
20073
- if (!disabledConfig) {
20074
- return false;
20075
- }
20076
- const disabledTokens = disabledConfig[String(chainId2)];
20077
- if (!disabledTokens) {
20078
- return false;
20079
- }
20080
- if (disabledTokens.includes("*")) {
20081
- return true;
20082
- }
20083
- return disabledTokens.some(
20084
- (disabledTokenAddress) => isTokenAddressEquivalent({
20085
- firstTokenAddress: disabledTokenAddress,
20086
- secondTokenAddress: tokenAddress
20087
- })
20088
- );
20089
- }
20090
-
20091
20106
  // src/hooks/useTokenTransferConfig.ts
20092
- var SYMBOL_OVERRIDES = {
20093
- "USD\u20AE0": "USDT",
20094
- USDT0: "USDT"
20095
- };
20096
- var POLYGON_NATIVE_TOKEN_ALIAS = "MATIC";
20097
- function lowercaseAddressKeys(response) {
20098
- return Object.fromEntries(
20099
- Object.entries(response).map(([chainId2, chainAssets]) => [
20100
- chainId2,
20101
- Object.fromEntries(
20102
- Object.entries(chainAssets).map(([address, metadata]) => [
20103
- address.toLowerCase(),
20104
- metadata
20105
- ])
20106
- )
20107
- ])
20108
- );
20109
- }
20110
- function resolveSymbols(backendSymbol, chainId2, address) {
20111
- const displaySymbol = SYMBOL_OVERRIDES[backendSymbol] ?? backendSymbol;
20112
- const alias = chainId2 === polygon6.id && isNativeTokenAddress(address) ? POLYGON_NATIVE_TOKEN_ALIAS : void 0;
20113
- return { displaySymbol, alias };
20114
- }
20115
- function resolveChainAssets(chainConfig, chainAssets, disabledChainAssets) {
20116
- const { chainId: chainId2 } = chainConfig;
20117
- const resolvedChainAssets = chainConfig.assets.filter(
20118
- (configAsset) => !isAssetDisabled(
20119
- disabledChainAssets,
20120
- chainId2,
20121
- configAsset.address.toLowerCase()
20122
- )
20123
- ).map((configAsset) => {
20124
- const address = configAsset.address.toLowerCase();
20125
- const metadata = chainAssets?.[address];
20126
- if (!metadata) {
20127
- logger.warn("useTokenTransferConfig:tokenMetadataMissing", {
20128
- chainId: chainId2,
20129
- address: configAsset.address
20130
- });
20131
- return null;
20132
- }
20133
- const { displaySymbol, alias } = resolveSymbols(
20134
- metadata.symbol,
20135
- chainId2,
20136
- address
20137
- );
20138
- return {
20139
- address,
20140
- metadata: { ...configAsset, ...metadata, symbol: displaySymbol },
20141
- alias
20142
- };
20143
- }).filter((item) => item !== null);
20144
- const assets = Object.fromEntries(
20145
- resolvedChainAssets.map(({ address, metadata }) => [address, metadata])
20146
- );
20147
- const symbols = [
20148
- ...new Set(
20149
- resolvedChainAssets.flatMap(
20150
- ({ metadata, alias }) => alias ? [metadata.symbol, alias] : [metadata.symbol]
20151
- )
20152
- )
20153
- ];
20154
- return { assets, symbols };
20155
- }
20156
- function resolveNewBadgeSymbols(resolvedChains) {
20157
- const allBadgeAssets = resolvedChains.flatMap(
20158
- ({ resolvedChainAssets }) => Object.values(resolvedChainAssets.assets).filter((a) => !!a.showNewBadge)
20159
- );
20160
- return /* @__PURE__ */ new Set([
20161
- ...allBadgeAssets.filter((a) => a.showNewBadge === "primary").map((a) => a.symbol),
20162
- ...allBadgeAssets.filter((a) => a.showNewBadge !== "primary").map((a) => a.symbol)
20163
- ]);
20164
- }
20165
- function resolveTokenTransferConfig(chainConfigs, rawPriorityTokens, disabledChainAssets, allSupportedAssets) {
20166
- const lowercasedAssets = lowercaseAddressKeys(allSupportedAssets);
20167
- const resolvedChains = chainConfigs.filter((c) => !isChainDisabled(disabledChainAssets, c.chainId)).map((chainConfig) => ({
20168
- chainConfig,
20169
- resolvedChainAssets: resolveChainAssets(
20170
- chainConfig,
20171
- lowercasedAssets[String(chainConfig.chainId)],
20172
- disabledChainAssets
20173
- )
20174
- })).filter(({ resolvedChainAssets }) => resolvedChainAssets.symbols.length > 0);
20175
- const supportedAssets = Object.fromEntries(
20176
- resolvedChains.map(({ chainConfig, resolvedChainAssets }) => [
20177
- chainConfig.chainId,
20178
- resolvedChainAssets.assets
20179
- ])
20180
- );
20181
- const symbolsByChainId = Object.fromEntries(
20182
- resolvedChains.map(({ chainConfig, resolvedChainAssets }) => [
20183
- chainConfig.chainId,
20184
- resolvedChainAssets.symbols
20185
- ])
20186
- );
20187
- const chainIdSortOrder = resolvedChains.map(
20188
- ({ chainConfig }) => chainConfig.chainId
20189
- );
20190
- const defaultChainId = resolvedChains.find(
20191
- ({ chainConfig }) => chainConfig.isDefault
20192
- )?.chainConfig.chainId;
20193
- const newBadgeSymbols = resolveNewBadgeSymbols(resolvedChains);
20194
- return {
20195
- supportedAssets,
20196
- symbolsByChainId,
20197
- chainIdSortOrder,
20198
- defaultChainId,
20199
- priorityTokenSymbols: [...rawPriorityTokens],
20200
- newBadgeSymbols
20201
- };
20202
- }
20203
- var EMPTY_CONFIG = {
20107
+ var EMPTY_RESULT = {
20204
20108
  supportedAssets: {},
20205
20109
  symbolsByChainId: {},
20206
20110
  chainIdSortOrder: [],
@@ -20222,15 +20126,15 @@ function useTokenTransferConfig(isWithdrawal = false) {
20222
20126
  const { data: allSupportedAssets, isLoading } = useSupportedAssets();
20223
20127
  const config = useMemo27(() => {
20224
20128
  if (!allSupportedAssets) {
20225
- return EMPTY_CONFIG;
20129
+ return EMPTY_RESULT;
20226
20130
  }
20227
- const { chains: rawChains, priorityTokens: rawPriorityTokens } = rawConfig;
20228
- return resolveTokenTransferConfig(
20229
- rawChains ?? [],
20230
- rawPriorityTokens ?? [],
20131
+ return resolveTokenTransferConfig({
20132
+ chainConfigs: rawConfig.chains ?? [],
20133
+ priorityTokens: rawConfig.priorityTokens ?? [],
20231
20134
  disabledChainAssets,
20232
- allSupportedAssets
20233
- );
20135
+ supportedAssets: allSupportedAssets,
20136
+ logger
20137
+ });
20234
20138
  }, [rawConfig, disabledChainAssets, allSupportedAssets]);
20235
20139
  return { ...config, isLoading };
20236
20140
  }
@@ -24692,7 +24596,7 @@ import { isTokenEquivalent as isTokenEquivalent3 } from "@funkit/utils";
24692
24596
  import { useQuery as useQuery15 } from "@tanstack/react-query";
24693
24597
 
24694
24598
  // src/hooks/useIsBlacklistedWithdrawalAddress.ts
24695
- import { isTokenAddressEquivalent as isTokenAddressEquivalent2 } from "@funkit/utils";
24599
+ import { isTokenAddressEquivalent } from "@funkit/utils";
24696
24600
  import { useMemo as useMemo36 } from "react";
24697
24601
  function useIsBlacklistedWithdrawalAddress(address) {
24698
24602
  const addressBlacklist = useDynamicConfig("blacklistedwithdrawaladdress");
@@ -24709,7 +24613,7 @@ function useIsBlacklistedWithdrawalAddress(address) {
24709
24613
  return addresses;
24710
24614
  }, [withdrawalConfig.chains]);
24711
24615
  return Object.keys(addressBlacklist).concat(withdrawalTokenAddresses).some(
24712
- (blockedAddress) => isTokenAddressEquivalent2({
24616
+ (blockedAddress) => isTokenAddressEquivalent({
24713
24617
  firstTokenAddress: blockedAddress,
24714
24618
  secondTokenAddress: address
24715
24619
  })
@@ -24993,30 +24897,22 @@ var useAssetSymbolPrice = ({
24993
24897
 
24994
24898
  // src/hooks/useTokenAndChainDropdown.ts
24995
24899
  import { useEffect as useEffect39, useState as useState34 } from "react";
24996
- import { polygon as polygon7 } from "viem/chains";
24900
+ import { polygon as polygon6 } from "viem/chains";
24997
24901
 
24998
24902
  // src/hooks/useEnabledTokenTransferChainTokens.ts
24999
- import { bitcoinChain as bitcoinChain5, solanaChain as solanaChain4, tronChain as tronChain3 } from "@funkit/chains";
24903
+ import { isTransferChainEnabled } from "@funkit/connect-core";
25000
24904
  function useEnabledTokenTransferChainTokens(transferInit, isWithdrawal) {
25001
24905
  const { symbolsByChainId } = useTokenTransferConfig(isWithdrawal);
25002
- const hasSolanaAddress = !!transferInit?.solanaAddr;
25003
- const hasBitcoinAddress = !!transferInit?.btcAddrSegwit;
25004
- const hasTronAddress = !!transferInit?.tronAddr;
25005
24906
  return Object.keys(
25006
24907
  symbolsByChainId
25007
24908
  ).reduce(
25008
24909
  (acc, curChainIdString) => {
25009
24910
  const chainId2 = Number(curChainIdString);
25010
- const isSolana = chainId2 === solanaChain4.id;
25011
- if (isSolana && !hasSolanaAddress && !isWithdrawal) {
25012
- return acc;
25013
- }
25014
- const isBitcoin = chainId2 === bitcoinChain5.id;
25015
- if (isBitcoin && !hasBitcoinAddress && !isWithdrawal) {
25016
- return acc;
25017
- }
25018
- const isTron = chainId2 === tronChain3.id;
25019
- if (isTron && !hasTronAddress && !isWithdrawal) {
24911
+ if (!isTransferChainEnabled(
24912
+ chainId2,
24913
+ transferInit ?? void 0,
24914
+ isWithdrawal
24915
+ )) {
25020
24916
  return acc;
25021
24917
  }
25022
24918
  if (symbolsByChainId[chainId2]?.length) {
@@ -25034,7 +24930,7 @@ function resolveDefaultChainId(enabledChainSymbols, preferredChainId) {
25034
24930
  return preferredChainId;
25035
24931
  }
25036
24932
  const firstAvailable = Number(Object.keys(enabledChainSymbols)[0]);
25037
- return firstAvailable || polygon7.id;
24933
+ return firstAvailable || polygon6.id;
25038
24934
  }
25039
24935
  function resolveDefaultToken(currentChainSymbols, preferredToken) {
25040
24936
  if (preferredToken && currentChainSymbols?.includes(preferredToken)) {
@@ -25061,7 +24957,7 @@ var useTokenAndChainDropdown = ({
25061
24957
  const tokenTransferConfig = useTokenTransferConfig(isWithdrawal);
25062
24958
  const isLoadingAssets = tokenTransferConfig.isLoading || Object.keys(tokenTransferConfig.symbolsByChainId).length === 0;
25063
24959
  const popularTokenSymbols = tokenTransferConfig.popularTokenSymbols ?? [];
25064
- const preferredChainId = defaultValues?.chainId ?? tokenTransferConfig.defaultChainId ?? polygon7.id;
24960
+ const preferredChainId = defaultValues?.chainId ?? tokenTransferConfig.defaultChainId ?? polygon6.id;
25065
24961
  const validDefaultChainId = resolveDefaultChainId(
25066
24962
  enabledChainSymbols,
25067
24963
  preferredChainId
@@ -25304,8 +25200,8 @@ function getErrorNotification({
25304
25200
  import React128, { useEffect as useEffect40, useState as useState35 } from "react";
25305
25201
  import {
25306
25202
  FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO8,
25307
- solanaChain as solanaChain5,
25308
- tronChain as tronChain4
25203
+ solanaChain as solanaChain4,
25204
+ tronChain as tronChain3
25309
25205
  } from "@funkit/chains";
25310
25206
  function getAlertMessage(selectedChainId, selectedToken, t) {
25311
25207
  const chainName = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO8[selectedChainId]?.name;
@@ -25333,7 +25229,7 @@ function useShowConnectWallet({ config }) {
25333
25229
  return showUseConnected;
25334
25230
  }
25335
25231
  function getRecipientAddressPlaceholder(selectedChainId, t) {
25336
- if (selectedChainId === solanaChain5.id || selectedChainId === tronChain4.id) {
25232
+ if (selectedChainId === solanaChain4.id || selectedChainId === tronChain3.id) {
25337
25233
  return t("withdrawal.enterRecipientAddress")[0] + t("withdrawal.enterRecipientAddress").slice(1).toLowerCase();
25338
25234
  }
25339
25235
  return "0x...";
@@ -31712,7 +31608,7 @@ var ChainInfoBanners = ({ chainId: chainId2 }) => {
31712
31608
  // src/components/FunTransactionSummary/PaymentAmountSummary.tsx
31713
31609
  import {
31714
31610
  formatCurrencyAndStringify as formatCurrencyAndStringify7,
31715
- isTokenAddressEquivalent as isTokenAddressEquivalent3,
31611
+ isTokenAddressEquivalent as isTokenAddressEquivalent2,
31716
31612
  isTokenEquivalent as isTokenEquivalent4
31717
31613
  } from "@funkit/utils";
31718
31614
  import NumberFlow from "@number-flow/react";
@@ -31768,7 +31664,7 @@ function PaymentAmountSummary({
31768
31664
  const sourceChainId = sourceAssetInfo?.chainId;
31769
31665
  const areSameChains = sourceChainId === targetChainId;
31770
31666
  const sourceIcon = sourceAssetInfo?.iconSrc ?? void 0;
31771
- const isSameTokenAddress = isTokenAddressEquivalent3({
31667
+ const isSameTokenAddress = isTokenAddressEquivalent2({
31772
31668
  firstTokenAddress: sourceTokenAddress,
31773
31669
  secondTokenAddress: targetTokenAddress
31774
31670
  });
@@ -35501,7 +35397,7 @@ function useTextMeasurer(inputRef) {
35501
35397
 
35502
35398
  // src/modals/CheckoutModal/InputAmount/state.ts
35503
35399
  import {
35504
- isTokenAddressEquivalent as isTokenAddressEquivalent4,
35400
+ isTokenAddressEquivalent as isTokenAddressEquivalent3,
35505
35401
  isTokenEquivalent as isTokenEquivalent6,
35506
35402
  round
35507
35403
  } from "@funkit/utils";
@@ -35686,7 +35582,7 @@ function isEffectivelySameAsset(checkoutConfig, sourceToken, apiKey) {
35686
35582
  return true;
35687
35583
  }
35688
35584
  const mainnetChainId = mainnet11.id.toString();
35689
- return isLighterxyzCustomer(apiKey) && sourceToken.chainId === mainnetChainId && isNativeTokenAddress(sourceToken.address) && checkoutConfig.targetChain === mainnetChainId && isTokenAddressEquivalent4({
35585
+ return isLighterxyzCustomer(apiKey) && sourceToken.chainId === mainnetChainId && isNativeTokenAddress(sourceToken.address) && checkoutConfig.targetChain === mainnetChainId && isTokenAddressEquivalent3({
35690
35586
  firstTokenAddress: checkoutConfig.targetAsset,
35691
35587
  secondTokenAddress: WETH_MAINNET_ADDRESS
35692
35588
  });
@@ -37929,14 +37825,14 @@ function CopyInputDisplayedAddress(props) {
37929
37825
  import {
37930
37826
  getLightningQuote
37931
37827
  } from "@funkit/api-base";
37932
- import { LIGHTNING_MAINNET_CHAIN_ID, bitcoinChain as bitcoinChain6 } from "@funkit/chains";
37828
+ import { LIGHTNING_MAINNET_CHAIN_ID, bitcoinChain as bitcoinChain5 } from "@funkit/chains";
37933
37829
  import { keepPreviousData as keepPreviousData3, useQuery as useQuery26 } from "@tanstack/react-query";
37934
37830
  import { useEffect as useEffect58, useRef as useRef28, useState as useState67 } from "react";
37935
37831
  import { parseUnits as parseUnits3 } from "viem";
37936
37832
  var QUOTE_REFRESH_LEAD_MS = 3e3;
37937
37833
  var QUOTE_REFRESH_MIN_MS = 250;
37938
37834
  var QUOTE_GC_MS = 1e4;
37939
- var BTC_DECIMALS = bitcoinChain6.nativeCurrency.decimals;
37835
+ var BTC_DECIMALS = bitcoinChain5.nativeCurrency.decimals;
37940
37836
  var SATS_PER_BTC = 10n ** BigInt(BTC_DECIMALS);
37941
37837
  function usdToSats(usd, btcPrice) {
37942
37838
  if (usd && btcPrice) {
@@ -37989,7 +37885,7 @@ var useLightningQuote = ({
37989
37885
  }
37990
37886
  const btcPrice = await getAssetPriceInfoWithFallback({
37991
37887
  apiKey,
37992
- chainId: bitcoinChain6.id.toString(),
37888
+ chainId: bitcoinChain5.id.toString(),
37993
37889
  assetTokenAddress: NATIVE_TOKEN
37994
37890
  });
37995
37891
  const fromAmountSats = usdToSats(fiatAmount, btcPrice.unitPrice);
@@ -39741,6 +39637,7 @@ function useEnrichedAccountHoldings({
39741
39637
  const { t } = useFunkitTranslation();
39742
39638
  const { isAllowed, isLoading } = useAllowedAssets();
39743
39639
  const { walletAddress } = useGeneralWallet();
39640
+ const { apiKey } = useFunkitConfig();
39744
39641
  const minTransferLimits = useDynamicConfig("mintokentransfervalue");
39745
39642
  const isDynamicRoutingEnabled = useIsDynamicRoutingEnabled();
39746
39643
  const enrichedAccountHoldings = useMemo58(() => {
@@ -39772,7 +39669,7 @@ function useEnrichedAccountHoldings({
39772
39669
  asset.pickedChainId,
39773
39670
  asset.tokenAddress
39774
39671
  ),
39775
- isDynamicRoutingEnabled,
39672
+ isLighterDynamicRoutingEnabled: isDynamicRoutingEnabled && isLighterxyzCustomer(apiKey),
39776
39673
  t
39777
39674
  });
39778
39675
  return { asset, usableForCheckout };
@@ -39822,7 +39719,8 @@ function useAssetOptions({
39822
39719
  apiKey,
39823
39720
  asset,
39824
39721
  dynamicTargetAssetCandidates,
39825
- findPath
39722
+ findPath,
39723
+ isUserSelected
39826
39724
  )) {
39827
39725
  badgeText = "Native";
39828
39726
  if (showsNativeTokensOnTop(apiKey)) {
@@ -40122,7 +40020,10 @@ function SelectAsset({
40122
40020
  }
40123
40021
  ));
40124
40022
  }
40125
- function isTreatedAsNativeToken(apiKey, asset, dynamicTargetAssetCandidates, findDynamicPath) {
40023
+ function isTreatedAsNativeToken(apiKey, asset, dynamicTargetAssetCandidates, findDynamicPath, isUserSelected) {
40024
+ if (isNadoCustomer(apiKey)) {
40025
+ return isUserSelected;
40026
+ }
40126
40027
  const dynamicPath = findDynamicPath({
40127
40028
  chainId: asset.pickedChainId,
40128
40029
  tokenAddress: asset.tokenAddress
@@ -40170,7 +40071,7 @@ function isTreatedAsNativeToken(apiKey, asset, dynamicTargetAssetCandidates, fin
40170
40071
  );
40171
40072
  }
40172
40073
  function showsNativeTokensOnTop(apiKey) {
40173
- return isEtherealCustomer(apiKey) || isHyenaCustomer(apiKey);
40074
+ return isEtherealCustomer(apiKey) || isHyenaCustomer(apiKey) || isNadoCustomer(apiKey) || isMallardCustomer(apiKey);
40174
40075
  }
40175
40076
 
40176
40077
  // src/modals/CheckoutModal/SourceChange/SourceChange.tsx
@@ -42627,32 +42528,6 @@ function TransferToken({
42627
42528
  onClick: () => onNext({})
42628
42529
  }
42629
42530
  )),
42630
- defaultCandidate && !checkoutConfig?.generateActionsParams && /* @__PURE__ */ React257.createElement(
42631
- Box,
42632
- {
42633
- display: "flex",
42634
- alignItems: "center",
42635
- justifyContent: "space-between",
42636
- width: "full",
42637
- borderColor: "mediumStroke",
42638
- borderWidth: "1",
42639
- borderRadius: BORDER_RADIUS,
42640
- borderStyle: "solid",
42641
- paddingX: "dropdownPaddingX",
42642
- paddingY: "8"
42643
- },
42644
- /* @__PURE__ */ React257.createElement(Text, { size: "12", color: "secondaryText" }, t("transferToken.receiveToken")),
42645
- /* @__PURE__ */ React257.createElement(Box, { display: "flex", alignItems: "center", gap: "8" }, /* @__PURE__ */ React257.createElement(
42646
- FunAssetAvatar,
42647
- {
42648
- assetIconSize: "16",
42649
- assetName: "receive-token-asset",
42650
- assetSrc: defaultCandidate.iconSrc || getTokenIconUrl(defaultCandidate.tokenSymbol),
42651
- chainId: defaultCandidate.tokenChainId,
42652
- largeChainIcon: true
42653
- }
42654
- ), /* @__PURE__ */ React257.createElement(Text, { size: "12", weight: "medium" }, defaultCandidate.tokenSymbol))
42655
- ),
42656
42531
  /* @__PURE__ */ React257.createElement(
42657
42532
  TokenAndChainDropdown,
42658
42533
  {
@@ -43330,6 +43205,45 @@ function KycIframe({
43330
43205
  );
43331
43206
  }
43332
43207
 
43208
+ // src/modals/CheckoutModal/Withdrawal/WithdrawalComplete.tsx
43209
+ var WithdrawalCompleteInfo = {
43210
+ Component: WithdrawalComplete,
43211
+ disableBack: () => true,
43212
+ onNext(state, _payload) {
43213
+ return {
43214
+ ...extractCommonState(state),
43215
+ step: "source_change" /* SOURCE_CHANGE */,
43216
+ paymentMethodInfo: null,
43217
+ paymentMethodTypeFilter: "withdraw"
43218
+ };
43219
+ }
43220
+ };
43221
+ function WithdrawalComplete(_props) {
43222
+ return null;
43223
+ }
43224
+
43225
+ // src/modals/CheckoutModal/Withdrawal/WithdrawalEnterAmount.tsx
43226
+ var WithdrawalEnterAmountInfo = {
43227
+ Component: WithdrawalEnterAmount,
43228
+ onBack(state, prevState) {
43229
+ return prevState;
43230
+ },
43231
+ onNext(state, payload) {
43232
+ return {
43233
+ ...extractCommonState(state),
43234
+ step: "withdrawal_complete" /* WITHDRAWAL_COMPLETE */,
43235
+ withdrawalConfig: state.withdrawalConfig,
43236
+ hash: payload.hash,
43237
+ withdrawnAmount: payload.withdrawnAmount,
43238
+ tokenSymbol: payload.tokenSymbol,
43239
+ quote: payload.quote
43240
+ };
43241
+ }
43242
+ };
43243
+ function WithdrawalEnterAmount(_props) {
43244
+ return null;
43245
+ }
43246
+
43333
43247
  // src/modals/CheckoutModal/stepTransition.ts
43334
43248
  function extractCommonState(state) {
43335
43249
  return {
@@ -43364,7 +43278,9 @@ var CheckoutModalSteps = {
43364
43278
  ["brokerage_two_fa" /* BROKERAGE_TWO_FA */]: BrokerageTwoFAInfo,
43365
43279
  ["brokerage_success" /* BROKERAGE_SUCCESS */]: BrokerageSuccessInfo,
43366
43280
  ["swapped_iframe" /* SWAPPED_IFRAME */]: SwappedIframeInfo,
43367
- ["perps_transfer" /* PERPS_TRANSFER */]: PerpsTransferStepInfo
43281
+ ["perps_transfer" /* PERPS_TRANSFER */]: PerpsTransferStepInfo,
43282
+ ["withdrawal_enter_amount" /* WITHDRAWAL_ENTER_AMOUNT */]: WithdrawalEnterAmountInfo,
43283
+ ["withdrawal_complete" /* WITHDRAWAL_COMPLETE */]: WithdrawalCompleteInfo
43368
43284
  };
43369
43285
  var checkoutBackMap = {
43370
43286
  ["bridge_kyc" /* BRIDGE_KYC */]: "source_change" /* SOURCE_CHANGE */
@@ -43403,7 +43319,9 @@ function useCheckoutModalTransition(checkoutItem, onClose) {
43403
43319
  const trackNextState = useCallback49(
43404
43320
  (nextState) => {
43405
43321
  const trackEvent = trackEventFromNextState(nextState);
43406
- logEvent(trackEvent);
43322
+ if (trackEvent) {
43323
+ logEvent(trackEvent);
43324
+ }
43407
43325
  const readyEventName = CHECKOUT_STEP_TO_READY_EVENT[nextState.step];
43408
43326
  if (readyEventName) {
43409
43327
  startMeasuredEvent(readyEventName);
@@ -47663,7 +47581,7 @@ function FunkitCheckoutProvider({ children }) {
47663
47581
  config: {
47664
47582
  ...config,
47665
47583
  // Solana is case-sensitive for SPL token addresses, so we should not lowercase the target asset address here
47666
- targetAsset: config.targetChain.toString() === SOLANA_MAINNET_CHAIN_ID2.toString() && !isTokenAddressEquivalent5({
47584
+ targetAsset: config.targetChain.toString() === SOLANA_MAINNET_CHAIN_ID2.toString() && !isTokenAddressEquivalent4({
47667
47585
  firstTokenAddress: NATIVE_TOKEN,
47668
47586
  secondTokenAddress: config.targetAsset
47669
47587
  }) ? config.targetAsset : config.targetAsset.toLowerCase(),
@@ -48418,9 +48336,9 @@ async function validateCheckoutConfig(config, apiKey) {
48418
48336
  };
48419
48337
  }
48420
48338
  var hasSufficientBalance = async (wagmiConfig, walletAddress, tokenAddress, tokenChainId, requiredAssetAmount) => {
48421
- const finalTokenAddress = isTokenAddressEquivalent6({
48339
+ const finalTokenAddress = isTokenAddressEquivalent5({
48422
48340
  firstTokenAddress: tokenAddress,
48423
- secondTokenAddress: FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS4
48341
+ secondTokenAddress: FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS5
48424
48342
  }) ? void 0 : tokenAddress;
48425
48343
  const data = await getBalance(wagmiConfig, {
48426
48344
  address: walletAddress,
@@ -48532,11 +48450,11 @@ async function getTokenDecimals(wagmiConfig, chainId2, tokenAddress) {
48532
48450
  if (isNativeTokenAddress(tokenAddress)) {
48533
48451
  return FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO11[chainId2]?.nativeCurrency?.decimals || 18;
48534
48452
  }
48535
- if (chainId2 === solanaChain6.id.toString()) {
48536
- return solanaChain6.nativeCurrency.decimals;
48453
+ if (chainId2 === solanaChain5.id.toString()) {
48454
+ return solanaChain5.nativeCurrency.decimals;
48537
48455
  }
48538
- if (chainId2 === tronChain5.id.toString()) {
48539
- return tronChain5.nativeCurrency.decimals;
48456
+ if (chainId2 === tronChain4.id.toString()) {
48457
+ return tronChain4.nativeCurrency.decimals;
48540
48458
  }
48541
48459
  if (chainId2 === lightningChain4.id.toString()) {
48542
48460
  return lightningChain4.nativeCurrency.decimals;
@@ -48649,22 +48567,25 @@ function getMinValueThreshold(config, minUsdRequired) {
48649
48567
  function isPreferredChain(chainId2, additionalChains = []) {
48650
48568
  const chains = /* @__PURE__ */ new Set([
48651
48569
  mainnet13.id,
48652
- polygon8.id,
48570
+ polygon7.id,
48653
48571
  base6.id,
48654
48572
  arbitrum6.id,
48655
48573
  optimism2.id,
48656
- solanaChain7.id,
48574
+ bsc2.id,
48575
+ solanaChain6.id,
48576
+ hyperEvmChain4.id,
48577
+ monadChain2.id,
48657
48578
  ...additionalChains
48658
48579
  ]);
48659
48580
  return chains.has(chainId2);
48660
48581
  }
48661
48582
  function isNativeTokenAddress(address) {
48662
- return isTokenAddressEquivalent7({
48583
+ return isTokenAddressEquivalent6({
48663
48584
  firstTokenAddress: address,
48664
48585
  secondTokenAddress: NATIVE_TOKEN
48665
48586
  });
48666
48587
  }
48667
- var isPolygonEcosystemToken = (chainId2, tokenAddress) => chainId2 === polygon8.id.toString() && tokenAddress === "0x0000000000000000000000000000000000001010";
48588
+ var isPolygonEcosystemToken = (chainId2, tokenAddress) => chainId2 === polygon7.id.toString() && tokenAddress === "0x0000000000000000000000000000000000001010";
48668
48589
  var isAssetUsableToPayForCheckout = ({
48669
48590
  config,
48670
48591
  payerAddress,
@@ -48676,7 +48597,7 @@ var isAssetUsableToPayForCheckout = ({
48676
48597
  assetUsdAmount,
48677
48598
  isAllowedForCheckout,
48678
48599
  minValueThreshold,
48679
- isDynamicRoutingEnabled,
48600
+ isLighterDynamicRoutingEnabled,
48680
48601
  t
48681
48602
  }) => {
48682
48603
  const finalCheckoutRecipient = getCheckoutRecipient({
@@ -48684,7 +48605,7 @@ var isAssetUsableToPayForCheckout = ({
48684
48605
  walletAddress: payerAddress
48685
48606
  });
48686
48607
  const isSameAsPurchasingToken = (() => {
48687
- if (isDynamicRoutingEnabled) {
48608
+ if (isLighterDynamicRoutingEnabled) {
48688
48609
  return false;
48689
48610
  }
48690
48611
  if (isCheckoutPostActionRequired(config)) {
@@ -48742,7 +48663,7 @@ function normalizeAssetSymbol(asset) {
48742
48663
  if (isTokenEquivalent12({
48743
48664
  firstTokenChainId: asset.chainId,
48744
48665
  firstTokenAddress: asset.contractAddress,
48745
- secondTokenChainId: polygon9.id.toString(),
48666
+ secondTokenChainId: polygon8.id.toString(),
48746
48667
  secondTokenAddress: POLYGON_USDCE_TOKEN
48747
48668
  })) {
48748
48669
  return { ...asset, symbol: "USDC.e" };