@funkit/connect 5.5.2 → 5.5.4

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 (32) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/components/MeldQuoteItem/MeldQuoteItem.d.ts +2 -2
  3. package/dist/components/SourceMeldQuoteItem/SourceMeldQuoteItem.d.ts +6 -1
  4. package/dist/hooks/queries/useMeldCurrencies.d.ts +1 -1
  5. package/dist/hooks/useIsUsUser.d.ts +3 -0
  6. package/dist/hooks/usePaymentSources.d.ts +0 -1
  7. package/dist/index.js +232 -116
  8. package/dist/modals/CheckoutModal/InputAmount/InputAmount.d.ts +2 -1
  9. package/dist/modals/CheckoutModal/MeldQuotes/MeldQuotes.d.ts +2 -1
  10. package/dist/modals/CheckoutModal/stepTransition.d.ts +5 -1
  11. package/dist/utils/flags/config.d.ts +26 -3
  12. package/dist/wallets/walletConnectors/chunk-25VW5TZP.js +92 -0
  13. package/dist/wallets/walletConnectors/chunk-3NC26XLM.js +92 -0
  14. package/dist/wallets/walletConnectors/chunk-3U3BMEH5.js +94 -0
  15. package/dist/wallets/walletConnectors/chunk-4UM4GTKZ.js +103 -0
  16. package/dist/wallets/walletConnectors/chunk-545L7Y4M.js +69 -0
  17. package/dist/wallets/walletConnectors/chunk-6LPM6LUQ.js +110 -0
  18. package/dist/wallets/walletConnectors/chunk-7GSNBOD3.js +99 -0
  19. package/dist/wallets/walletConnectors/chunk-ETTNDQQG.js +100 -0
  20. package/dist/wallets/walletConnectors/chunk-FRGSRLTS.js +93 -0
  21. package/dist/wallets/walletConnectors/chunk-HKV7EMYZ.js +96 -0
  22. package/dist/wallets/walletConnectors/chunk-IPOC2VJX.js +106 -0
  23. package/dist/wallets/walletConnectors/chunk-JXP2QPW7.js +95 -0
  24. package/dist/wallets/walletConnectors/chunk-KFFJPS5R.js +96 -0
  25. package/dist/wallets/walletConnectors/chunk-LEXSM5KI.js +87 -0
  26. package/dist/wallets/walletConnectors/chunk-MOOBCMMB.js +70 -0
  27. package/dist/wallets/walletConnectors/chunk-N2NIIUW6.js +146 -0
  28. package/dist/wallets/walletConnectors/chunk-W5O4YSZN.js +98 -0
  29. package/dist/wallets/walletConnectors/chunk-XYBEMO3C.js +66 -0
  30. package/dist/wallets/walletConnectors/index.js +54 -54
  31. package/package.json +6 -6
  32. package/dist/hooks/useIsUsBankrUser.d.ts +0 -1
package/dist/index.js CHANGED
@@ -3410,7 +3410,7 @@ var flagConfig = {
3410
3410
  {
3411
3411
  key: "apiKey",
3412
3412
  type: "isAnyOf",
3413
- values: [KATANA_API_KEY2]
3413
+ values: [KATANA_API_KEY2, POLYMARKET_API_KEY2]
3414
3414
  }
3415
3415
  ],
3416
3416
  value: JSON.stringify({
@@ -3435,7 +3435,7 @@ var flagConfig = {
3435
3435
  {
3436
3436
  value: true,
3437
3437
  if_any: [
3438
- // Full rollout to Katana and Ethereal users
3438
+ // Full rollout to Katana / Ethereal
3439
3439
  {
3440
3440
  key: "apiKey",
3441
3441
  type: "isAnyOf",
@@ -3463,7 +3463,7 @@ var flagConfig = {
3463
3463
  }
3464
3464
  ]
3465
3465
  },
3466
- // 1% rollout to Polymarket and Ostium users
3466
+ // 5% rollout to Ostium and Polymarket users
3467
3467
  {
3468
3468
  value: true,
3469
3469
  if_all: [
@@ -3475,7 +3475,7 @@ var flagConfig = {
3475
3475
  {
3476
3476
  key: "apiKey",
3477
3477
  type: "isAnyOf",
3478
- values: [POLYMARKET_API_KEY2, OSTIUM_API_KEY2]
3478
+ values: [OSTIUM_API_KEY2, POLYMARKET_API_KEY2]
3479
3479
  }
3480
3480
  ],
3481
3481
  if_any: [
@@ -3590,14 +3590,48 @@ var flagConfig = {
3590
3590
  },
3591
3591
  [FlagKey.EnableMeldPayment]: {
3592
3592
  type: "boolean",
3593
- default_value: true,
3593
+ default_value: false,
3594
3594
  overrides: [
3595
3595
  {
3596
3596
  if_any: [
3597
3597
  {
3598
3598
  key: "userId",
3599
3599
  type: "isAnyOf",
3600
- values: ["0x2A8Bd916E85d98d8175258De99fc0ddbcC102eF6"]
3600
+ values: [
3601
+ "0x6ec0c2f25d323e7779925Cc20c3740101f990d9F",
3602
+ "0xbeFE12aA8cBa36DD79F50eE5E23828adB62f2FD6",
3603
+ "0x2A8Bd916E85d98d8175258De99fc0ddbcC102eF6",
3604
+ "0xda6b07Eb94f699F511a943e9bFC12B64B7fe3486",
3605
+ "0x0D6e43CA32545B3dc2FE6f93AafBD7e640F548d4",
3606
+ "0x236c60C57a8B9ca563Fb0dA5199FDdCB686d91E8"
3607
+ // greg
3608
+ ]
3609
+ }
3610
+ ],
3611
+ value: true
3612
+ },
3613
+ {
3614
+ if_all: [
3615
+ {
3616
+ key: "userId",
3617
+ type: "pctRollout",
3618
+ pct: 5
3619
+ },
3620
+ {
3621
+ key: "apiKey",
3622
+ type: "isAnyOf",
3623
+ values: [POLYMARKET_API_KEY2]
3624
+ }
3625
+ ],
3626
+ if_any: [],
3627
+ value: true
3628
+ },
3629
+ {
3630
+ if_any: [
3631
+ {
3632
+ key: "userId",
3633
+ type: "pctRollout",
3634
+ pct: 100
3601
3635
  }
3602
3636
  ],
3603
3637
  value: false
@@ -5511,7 +5545,7 @@ var getStyleProps = (type, isDisabled) => {
5511
5545
  focusedVisible: isDisabled ? void 0 : "buttonFocusedShadow"
5512
5546
  },
5513
5547
  paddingX: "24",
5514
- paddingY: isDisabled ? "11" : "10"
5548
+ paddingY: "10"
5515
5549
  };
5516
5550
  };
5517
5551
  function FunButton({
@@ -7420,6 +7454,8 @@ function FunkitCheckoutProvider({ children }) {
7420
7454
  clientMetadata,
7421
7455
  apiKey: funkitConfig.apiKey
7422
7456
  });
7457
+ checkoutItem.initSettings.onConfirmation?.(txHash);
7458
+ logger.log("directExecutionCheckoutConfirmed", { txHash });
7423
7459
  updateActiveCheckout({ depositAddress: txHash });
7424
7460
  refreshCheckoutHistory();
7425
7461
  return txHash;
@@ -8515,11 +8551,20 @@ function useFunkitUserIp() {
8515
8551
  };
8516
8552
  }
8517
8553
 
8518
- // src/hooks/useIsUsBankrUser.ts
8519
- function useIsUsBankrUser() {
8554
+ // src/hooks/useIsUsUser.ts
8555
+ function useIsUsUser() {
8520
8556
  const { userIpInfo } = useFunkitUserIp();
8557
+ return userIpInfo?.alpha2 === "US";
8558
+ }
8559
+ function useIsUsBankrUser() {
8560
+ const { apiKey } = useFunkitConfig();
8561
+ const isUsUser = useIsUsUser();
8562
+ return isUsUser && isBankrCustomer(apiKey);
8563
+ }
8564
+ function useIsUsKatanaUser() {
8521
8565
  const { apiKey } = useFunkitConfig();
8522
- return userIpInfo?.alpha2 === "US" && isBankrCustomer(apiKey);
8566
+ const isUsUser = useIsUsUser();
8567
+ return isUsUser && isKatanaCustomer(apiKey);
8523
8568
  }
8524
8569
 
8525
8570
  // src/hooks/useEnabledTokenTransferChainTokens.ts
@@ -13507,7 +13552,7 @@ var CheckoutCompleteInfo = {
13507
13552
  depositAddress: state.depositAddress
13508
13553
  };
13509
13554
  },
13510
- disableBack: true,
13555
+ disableBack: () => true,
13511
13556
  fallbackTitle: DEFAULT_CHECKOUT_HISTORY_DETAIL_TITLE
13512
13557
  };
13513
13558
  function CheckoutComplete({
@@ -14526,6 +14571,16 @@ function CheckoutPrimaryInfo({
14526
14571
 
14527
14572
  // src/modals/CheckoutModal/ConfirmationStep/DisclaimerText.tsx
14528
14573
  import React128, { useMemo as useMemo19 } from "react";
14574
+
14575
+ // src/utils/customer.ts
14576
+ function isKatanaEarnFlow({
14577
+ apiKey,
14578
+ checkoutConfig
14579
+ }) {
14580
+ return isKatanaCustomer(apiKey) && !!checkoutConfig && isCheckoutPostActionRequired(checkoutConfig);
14581
+ }
14582
+
14583
+ // src/modals/CheckoutModal/ConfirmationStep/DisclaimerText.tsx
14529
14584
  var DisclaimerText = ({
14530
14585
  showDydxDisclaimer,
14531
14586
  continueText,
@@ -14535,6 +14590,11 @@ var DisclaimerText = ({
14535
14590
  }) => {
14536
14591
  const { apiKey } = useFunkitConfig();
14537
14592
  const isVertex = isVertexCustomer(apiKey);
14593
+ const isKatana = isKatanaCustomer(apiKey);
14594
+ const isKatanaEarn = isKatanaEarnFlow({
14595
+ apiKey,
14596
+ checkoutConfig: checkoutItem?.initSettings.config
14597
+ });
14538
14598
  const vertexText = useVertextDisclaimer(checkoutItem, isCardPayment);
14539
14599
  const cardDisclaimer = useCardDisclaimer(
14540
14600
  checkoutItem,
@@ -14548,7 +14608,21 @@ var DisclaimerText = ({
14548
14608
  inline: true,
14549
14609
  text: "privacy policy"
14550
14610
  }
14551
- ), ".") : /* @__PURE__ */ React128.createElement(React128.Fragment, null, isVertex && vertexText ? `${vertexText} ` : showCardDisclaimer && `${cardDisclaimer} `, "By clicking on ", continueText, ", you agree to our", " ", /* @__PURE__ */ React128.createElement(FunLinkButton, { href: FUN_TERMS_URL, inline: true, text: "terms" }), ".");
14611
+ ), ".") : isKatana && isKatanaEarn ? /* @__PURE__ */ React128.createElement(React128.Fragment, null, showCardDisclaimer && `${cardDisclaimer} `, "By clicking on ", continueText, ", you agree to ", FUN_ORG_NAME, "'s", " ", /* @__PURE__ */ React128.createElement(FunLinkButton, { href: FUN_TERMS_URL, inline: true, text: "terms" }), ", Katana's ", /* @__PURE__ */ React128.createElement(
14612
+ FunLinkButton,
14613
+ {
14614
+ href: "https://katana.network/legal/terms-and-conditions",
14615
+ inline: true,
14616
+ text: "terms"
14617
+ }
14618
+ ), ", and the ", /* @__PURE__ */ React128.createElement(FunLinkButton, { href: "https://yearn.fi/", inline: true, text: "terms" }), " applicable to third-party Yearn vaults", ".") : isKatana && !isKatanaEarn ? /* @__PURE__ */ React128.createElement(React128.Fragment, null, showCardDisclaimer && `${cardDisclaimer} `, "By clicking on ", continueText, ", you agree to ", FUN_ORG_NAME, "'s", " ", /* @__PURE__ */ React128.createElement(FunLinkButton, { href: FUN_TERMS_URL, inline: true, text: "terms" }), ", Katana's and Vaultbridge's ", /* @__PURE__ */ React128.createElement(
14619
+ FunLinkButton,
14620
+ {
14621
+ href: "https://katana.network/legal/terms-and-conditions",
14622
+ inline: true,
14623
+ text: "terms"
14624
+ }
14625
+ ), ", and the ", /* @__PURE__ */ React128.createElement(FunLinkButton, { href: "https://morpho.org/", inline: true, text: "terms" }), " applicable to third-party Morpho vaults", ".") : /* @__PURE__ */ React128.createElement(React128.Fragment, null, isVertex && vertexText ? `${vertexText} ` : showCardDisclaimer && `${cardDisclaimer} `, "By clicking on ", continueText, ", you agree to our", " ", /* @__PURE__ */ React128.createElement(FunLinkButton, { href: FUN_TERMS_URL, inline: true, text: "terms" }), ".");
14552
14626
  };
14553
14627
  function useCardDisclaimer(checkoutItem, finalConvertedAssetName) {
14554
14628
  const cardDisclaimer = useMemo19(() => {
@@ -16252,15 +16326,47 @@ function ConnectExchange({
16252
16326
  import { isMobile as isMobile5 } from "@funkit/utils";
16253
16327
  import React152, { useEffect as useEffect28 } from "react";
16254
16328
 
16329
+ // src/hooks/queries/useMeldCurrencies.ts
16330
+ import { getMeldSupportedFiat } from "@funkit/api-base";
16331
+ import { useQuery as useQuery11 } from "@tanstack/react-query";
16332
+ var getPriority = (currencyCode) => {
16333
+ if (currencyCode === "USD") return 0;
16334
+ if (currencyCode === "EUR") return 1;
16335
+ return 2;
16336
+ };
16337
+ var useMeldCurrencies = (isEnabled = true) => {
16338
+ const { apiKey } = useFunkitConfig();
16339
+ const query = useQuery11({
16340
+ queryKey: ["meld", "currencies"],
16341
+ queryFn: async () => {
16342
+ if (!apiKey) {
16343
+ return [];
16344
+ }
16345
+ const { currencies } = await getMeldSupportedFiat({ apiKey });
16346
+ return currencies.sort((a, b) => {
16347
+ const aPriority = getPriority(a.currencyCode);
16348
+ const bPriority = getPriority(b.currencyCode);
16349
+ if (aPriority !== bPriority) return aPriority - bPriority;
16350
+ return a.name.localeCompare(b.name);
16351
+ });
16352
+ },
16353
+ enabled: !!apiKey && isEnabled,
16354
+ refetchOnMount: false,
16355
+ refetchOnReconnect: false,
16356
+ refetchOnWindowFocus: false
16357
+ });
16358
+ return query;
16359
+ };
16360
+
16255
16361
  // src/hooks/queries/useMeldDefaultCurrency.ts
16256
16362
  import { getMeldDefaultFiat } from "@funkit/api-base";
16257
16363
  import { FlagKey as FlagKey18 } from "@funkit/utils";
16258
- import { useQuery as useQuery11 } from "@tanstack/react-query";
16364
+ import { useQuery as useQuery12 } from "@tanstack/react-query";
16259
16365
  var useMeldDefaultCurrency = (paymentMethod) => {
16260
16366
  const { apiKey } = useFunkitConfig();
16261
16367
  const { userIpInfo } = useFunkitUserIp();
16262
16368
  const enableMeld = useFlag(FlagKey18.EnableMeldPayment);
16263
- const query = useQuery11({
16369
+ const query = useQuery12({
16264
16370
  queryKey: ["meld", "defaultCurrency"],
16265
16371
  queryFn: async () => {
16266
16372
  if (!apiKey) return "";
@@ -16398,6 +16504,7 @@ var providerLabelMap = {
16398
16504
  KOYWE: "Koywe",
16399
16505
  MESH: "Mesh",
16400
16506
  MESO: "Meso",
16507
+ MERCURYO: "Mercuryo",
16401
16508
  ONMETA: "Onmeta",
16402
16509
  ONRAMPMONEY: "Onramp Money",
16403
16510
  PAYBIS: "Paybis",
@@ -16413,7 +16520,7 @@ var providerLabelMap = {
16413
16520
  };
16414
16521
  var MeldQuoteItem = ({
16415
16522
  quote,
16416
- badge,
16523
+ isBestQuote,
16417
16524
  onClick,
16418
16525
  isDisabled = false,
16419
16526
  isActive = false
@@ -16422,16 +16529,15 @@ var MeldQuoteItem = ({
16422
16529
  return /* @__PURE__ */ React141.createElement(FunSkeletonBlock, { height: "56", width: "full" });
16423
16530
  }
16424
16531
  const destinationCurrencyCode = quote.destinationCurrencyCode.split("_")[0];
16532
+ const cryptoDecimals = isStablecoin(destinationCurrencyCode) ? 2 : 5;
16425
16533
  const cryptoAmount = formatCryptoAndStringify2(
16426
16534
  quote.destinationAmount,
16427
16535
  destinationCurrencyCode,
16428
16536
  true,
16429
- // TODO: fix crypto formatting so that options are respected
16430
16537
  {
16431
- minimumSignificantDigits: 2,
16432
16538
  numberFormatOptions: {
16433
- minimumFractionDigits: 2,
16434
- maximumFractionDigits: 2
16539
+ minimumFractionDigits: cryptoDecimals,
16540
+ maximumFractionDigits: cryptoDecimals
16435
16541
  }
16436
16542
  }
16437
16543
  );
@@ -16461,14 +16567,12 @@ var MeldQuoteItem = ({
16461
16567
  alt: quote.serviceProvider,
16462
16568
  borderRadius: "full"
16463
16569
  }
16464
- )), /* @__PURE__ */ React141.createElement(Text, { weight: "medium", size: "12", style: { whiteSpace: "nowrap" } }, providerLabelMap[quote.serviceProvider] ?? quote.serviceProvider), badge && /* @__PURE__ */ React141.createElement(
16465
- FunBadge,
16570
+ )), /* @__PURE__ */ React141.createElement(
16571
+ MeldProviderLabel,
16466
16572
  {
16467
- background: "approvedBadgeBackground",
16468
- borderColor: "approvedBadgeBorder",
16469
- color: "approvedBadgeText"
16470
- },
16471
- badge
16573
+ serviceProvider: quote.serviceProvider,
16574
+ isBest: isBestQuote
16575
+ }
16472
16576
  )),
16473
16577
  /* @__PURE__ */ React141.createElement(Box, { display: "flex", alignItems: "center", gap: "8" }, /* @__PURE__ */ React141.createElement(
16474
16578
  Box,
@@ -16518,9 +16622,29 @@ var SourceMeldQuoteItem = ({
16518
16622
  alt: quote.serviceProvider,
16519
16623
  borderRadius: "full"
16520
16624
  }
16521
- ), /* @__PURE__ */ React142.createElement(Box, { display: "flex", flexDirection: "column" }, /* @__PURE__ */ React142.createElement(Text, { size: "12", weight: "medium" }, providerLabelMap[quote.serviceProvider]), isBestQuote && /* @__PURE__ */ React142.createElement(Text, { color: "approvedBadgeText", size: "10" }, "Best price"))) : /* @__PURE__ */ React142.createElement(Text, { size: "12", color: "secondaryText", weight: "medium" }, "No quotes found")), /* @__PURE__ */ React142.createElement(ArrowIcon, { direction: "right", size: 16 }))
16625
+ ), /* @__PURE__ */ React142.createElement(
16626
+ MeldProviderLabel,
16627
+ {
16628
+ serviceProvider: quote.serviceProvider,
16629
+ isBest: isBestQuote
16630
+ }
16631
+ )) : /* @__PURE__ */ React142.createElement(Text, { size: "12", color: "secondaryText", weight: "medium" }, "No quotes found")), /* @__PURE__ */ React142.createElement(ArrowIcon, { direction: "right", size: 16 }))
16522
16632
  );
16523
16633
  };
16634
+ var MeldProviderLabel = ({
16635
+ serviceProvider,
16636
+ isBest
16637
+ }) => {
16638
+ return /* @__PURE__ */ React142.createElement(Box, { display: "flex", flexDirection: "column", gap: "2" }, /* @__PURE__ */ React142.createElement(Text, { size: "12", weight: "medium", style: { whiteSpace: "nowrap" } }, providerLabelMap[serviceProvider] ?? serviceProvider), isBest && /* @__PURE__ */ React142.createElement(
16639
+ Text,
16640
+ {
16641
+ color: "approvedBadgeText",
16642
+ size: "10",
16643
+ style: { whiteSpace: "nowrap" }
16644
+ },
16645
+ "Best price"
16646
+ ));
16647
+ };
16524
16648
 
16525
16649
  // src/components/SourcePaymentMethodItem/SourcePaymentMethodItem.tsx
16526
16650
  import clsx14 from "clsx";
@@ -17286,7 +17410,7 @@ var YouPayYouReceiveBottomBarLayoutWrapper = ({
17286
17410
  // src/hooks/queries/useMeldLimits.ts
17287
17411
  import { getMeldFiatLimits } from "@funkit/api-base";
17288
17412
  import { formatCurrencyAndStringify as formatCurrencyAndStringify6 } from "@funkit/utils";
17289
- import { useQuery as useQuery12 } from "@tanstack/react-query";
17413
+ import { useQuery as useQuery13 } from "@tanstack/react-query";
17290
17414
  import { useMemo as useMemo23 } from "react";
17291
17415
 
17292
17416
  // src/hooks/queries/useMeldCryptoCurrencyCode.ts
@@ -17302,7 +17426,7 @@ var useMeldLimits = (fiatCurrency) => {
17302
17426
  const { apiKey } = useFunkitConfig();
17303
17427
  const { userIpInfo } = useFunkitUserIp();
17304
17428
  const cryptoCurrency = useMeldCryptoCurrencyCode();
17305
- const query = useQuery12({
17429
+ const query = useQuery13({
17306
17430
  queryKey: ["meld", "limits", userIpInfo?.alpha2, cryptoCurrency],
17307
17431
  queryFn: async () => {
17308
17432
  if (!apiKey || !userIpInfo) return void 0;
@@ -17458,7 +17582,7 @@ var useMeldLink = (sourceAmount, sourceCurrencyCode = "USD") => {
17458
17582
 
17459
17583
  // src/modals/CheckoutModal/MeldQuotes/useMeldQuotes.tsx
17460
17584
  import { getMeldQuotes } from "@funkit/api-base";
17461
- import { useQuery as useQuery13 } from "@tanstack/react-query";
17585
+ import { useQuery as useQuery14 } from "@tanstack/react-query";
17462
17586
  import { useDebounce } from "use-debounce";
17463
17587
  var DEBOUNCE_DELAY = 500;
17464
17588
  var COUNTDOWN_INTERVAL_SEC = 60;
@@ -17470,7 +17594,7 @@ var useMeldQuotes = (sourceAmount, fiatCurrency) => {
17470
17594
  const { isAway } = useUserPresence();
17471
17595
  const destinationCurrencyCode = useMeldCryptoCurrencyCode();
17472
17596
  const sourceCurrencyCode = fiatCurrency || "USD";
17473
- const query = useQuery13({
17597
+ const query = useQuery14({
17474
17598
  queryKey: [
17475
17599
  "meld",
17476
17600
  "quotes",
@@ -17500,7 +17624,8 @@ var useMeldQuotes = (sourceAmount, fiatCurrency) => {
17500
17624
  },
17501
17625
  enabled: !!userIpInfo && !!apiKey && !!destinationCurrencyCode && !isAway && !!fiatCurrency,
17502
17626
  refetchInterval: COUNTDOWN_INTERVAL_SEC * 1e3,
17503
- refetchOnWindowFocus: false
17627
+ refetchOnWindowFocus: false,
17628
+ retry: false
17504
17629
  });
17505
17630
  const { countdown } = useCountdown({
17506
17631
  countdownSeconds: COUNTDOWN_INTERVAL_SEC,
@@ -18017,8 +18142,8 @@ function InputAmountLoaded({
18017
18142
  }
18018
18143
  if (meldQuotesQuery.error) {
18019
18144
  return {
18020
- message: "An error occurred. Please try again or contact us for more information",
18021
- type: "error"
18145
+ message: "It seems something didn't work. Our team has been notified of the issue",
18146
+ type: "hint"
18022
18147
  };
18023
18148
  }
18024
18149
  }
@@ -18067,13 +18192,14 @@ function InputAmountLoaded({
18067
18192
  ASSET_DECIMALS
18068
18193
  );
18069
18194
  const isConvertedAmountShown = targetAssetTicker && (!isInputInUsd || isCardCheckout && fiatCurrency === "USD" || !isCardCheckout);
18195
+ const isMeldContinueDisabled = meldEnabled && (!!meldLimitError || isMeldLinkPending || !!meldQuotesQuery.error || meldQuotesQuery.isFetching || isSelectedQuoteUnavailable);
18070
18196
  return /* @__PURE__ */ React150.createElement(
18071
18197
  InputAmountLayout,
18072
18198
  {
18073
18199
  actionButtonProps: {
18074
18200
  title: suggestion?.buttonLabel ?? "Continue",
18075
18201
  onClick: handleSubmit,
18076
- isDisabled: !isValid && !suggestion || error?.type === "error" || !!meldLimitError || isMeldLinkPending || meldQuotesQuery.isFetching || isCardCheckout && isSelectedQuoteUnavailable,
18202
+ isDisabled: !isValid && !suggestion || isMeldContinueDisabled,
18077
18203
  isLoading: isMeldLinkPending
18078
18204
  },
18079
18205
  fiatCurrencySelector: meldEnabled && /* @__PURE__ */ React150.createElement(
@@ -18171,12 +18297,13 @@ function InputAmountLoaded({
18171
18297
  }
18172
18298
  }
18173
18299
  ),
18174
- footer: meldEnabled ? /* @__PURE__ */ React150.createElement(
18300
+ footer: meldEnabled ? /* @__PURE__ */ React150.createElement(Box, { paddingX: "6" }, /* @__PURE__ */ React150.createElement(
18175
18301
  SourceMeldQuoteItem,
18176
18302
  {
18177
18303
  onClick: () => onNext({
18178
18304
  fiatAmount: usdAmount,
18179
18305
  fiatCurrency,
18306
+ provider: selectedQuote?.serviceProvider,
18180
18307
  nextStep: "meld_quotes" /* MELD_QUOTES */
18181
18308
  }),
18182
18309
  quote: selectedQuote,
@@ -18186,7 +18313,7 @@ function InputAmountLoaded({
18186
18313
  isPreselected: !manuallySelectedQuote && !!bestRateQuote,
18187
18314
  error: meldLimitError?.issue
18188
18315
  }
18189
- ) : /* @__PURE__ */ React150.createElement(
18316
+ )) : /* @__PURE__ */ React150.createElement(
18190
18317
  YouPayYouReceiveWrapper,
18191
18318
  {
18192
18319
  targetChainId: modalState.targetChainId,
@@ -18336,7 +18463,7 @@ function InputAmountLoading({
18336
18463
  )
18337
18464
  ),
18338
18465
  amountOptions: /* @__PURE__ */ React151.createElement(QuickOptions, { disabled: true, percentMode: !isCardCheckout }),
18339
- footer: isMeldCheckout ? /* @__PURE__ */ React151.createElement(SourceMeldQuoteItem, { isLoading: true }) : /* @__PURE__ */ React151.createElement(YouPayYouReceiveBottomBarLayoutWrapper, null, /* @__PURE__ */ React151.createElement(
18466
+ footer: isMeldCheckout ? /* @__PURE__ */ React151.createElement(Box, { paddingX: "6" }, /* @__PURE__ */ React151.createElement(SourceMeldQuoteItem, { isLoading: true })) : /* @__PURE__ */ React151.createElement(YouPayYouReceiveBottomBarLayoutWrapper, null, /* @__PURE__ */ React151.createElement(
18340
18467
  FunSkeletonBlock,
18341
18468
  {
18342
18469
  borderRadius: "youPayYouReceive",
@@ -18358,7 +18485,7 @@ import {
18358
18485
  convertFunToRelayTokenAddress,
18359
18486
  getRelayAssetPriceInfo
18360
18487
  } from "@funkit/fun-relay";
18361
- import { skipToken, useQuery as useQuery14 } from "@tanstack/react-query";
18488
+ import { skipToken, useQuery as useQuery15 } from "@tanstack/react-query";
18362
18489
  async function getFormattedRelayAssetPriceInfo({
18363
18490
  chainId,
18364
18491
  assetTokenAddress
@@ -18384,7 +18511,7 @@ function useAssetPrice({
18384
18511
  assetTokenAddress
18385
18512
  }) {
18386
18513
  const { apiKey } = useFunkitConfig();
18387
- const { data, error, isLoading } = useQuery14({
18514
+ const { data, error, isLoading } = useQuery15({
18388
18515
  queryKey: ["getAssetPriceInfo", chainId, assetTokenAddress],
18389
18516
  queryFn: chainId && assetTokenAddress ? async () => {
18390
18517
  const isRelayPrimary = RELAY_SHORT_CIRCUIT_CHAIN_IDS.includes(chainId);
@@ -18486,7 +18613,8 @@ var InputAmountInfo = {
18486
18613
  step: "meld_quotes" /* MELD_QUOTES */,
18487
18614
  fiatAmount: payload.fiatAmount,
18488
18615
  paymentMethodInfo: state.paymentMethodInfo,
18489
- fiatCurrency: payload.fiatCurrency ?? state.fiatCurrency
18616
+ fiatCurrency: payload.fiatCurrency ?? state.fiatCurrency,
18617
+ provider: payload.provider
18490
18618
  };
18491
18619
  }
18492
18620
  return {
@@ -18495,9 +18623,14 @@ var InputAmountInfo = {
18495
18623
  paymentMethodInfo: state.paymentMethodInfo
18496
18624
  };
18497
18625
  },
18498
- showFullHeight: !isMobile5()
18626
+ showFullHeight: !isMobile5(),
18627
+ // back should be disabled in card flow in input_amount
18628
+ disableBack: ({ state }) => {
18629
+ return state.paymentMethodInfo?.paymentMethod === "card" /* CARD */;
18630
+ }
18499
18631
  };
18500
18632
  function InputAmount(props) {
18633
+ const { paymentMethodInfo } = props.modalState;
18501
18634
  const { textCustomizations } = useFunkitConfig();
18502
18635
  const { setCheckoutQuote } = useQuoteContext();
18503
18636
  const { checkoutItem } = useCheckoutContext();
@@ -18506,12 +18639,13 @@ function InputAmount(props) {
18506
18639
  error: sourceHoldingError,
18507
18640
  isLoading: isLoadingSourceHolding
18508
18641
  } = useAvailableBalanceForCheckout(
18509
- props.modalState.paymentMethodInfo,
18642
+ paymentMethodInfo,
18510
18643
  checkoutItem?.initSettings.config.targetChain ?? "",
18511
18644
  checkoutItem?.selectedSourceAssetInfo.chainId ?? "",
18512
18645
  checkoutItem?.selectedSourceAssetInfo.symbol ?? null
18513
18646
  );
18514
- const { data: defaultCurrency, isLoading: isMeldDefaultCurrencyLoading } = useMeldDefaultCurrency(props.modalState.paymentMethodInfo.paymentMethod);
18647
+ const { data: defaultCurrency, isLoading: isMeldDefaultCurrencyLoading } = useMeldDefaultCurrency(paymentMethodInfo.paymentMethod);
18648
+ useMeldCurrencies(paymentMethodInfo.paymentMethod === "card" /* CARD */);
18515
18649
  const { error: unitPriceError, unitPrice } = useAssetPrice({
18516
18650
  chainId: checkoutItem?.initSettings.config.targetChain,
18517
18651
  assetTokenAddress: checkoutItem?.initSettings.config.targetAsset
@@ -18918,38 +19052,6 @@ var FunNoResults = ({ text }) => {
18918
19052
  var hideScrollBar = "_163ehmk0";
18919
19053
  var selectWrapperStyle = "_163ehmk1";
18920
19054
 
18921
- // src/hooks/queries/useMeldCurrencies.ts
18922
- import { getMeldSupportedFiat } from "@funkit/api-base";
18923
- import { useQuery as useQuery15 } from "@tanstack/react-query";
18924
- var getPriority = (currencyCode) => {
18925
- if (currencyCode === "USD") return 0;
18926
- if (currencyCode === "EUR") return 1;
18927
- return 2;
18928
- };
18929
- var useMeldCurrencies = () => {
18930
- const { apiKey } = useFunkitConfig();
18931
- const query = useQuery15({
18932
- queryKey: ["meld", "currencies"],
18933
- queryFn: async () => {
18934
- if (!apiKey) {
18935
- return [];
18936
- }
18937
- const { currencies } = await getMeldSupportedFiat({ apiKey });
18938
- return currencies.sort((a, b) => {
18939
- const aPriority = getPriority(a.currencyCode);
18940
- const bPriority = getPriority(b.currencyCode);
18941
- if (aPriority !== bPriority) return aPriority - bPriority;
18942
- return a.name.localeCompare(b.name);
18943
- });
18944
- },
18945
- enabled: !!apiKey,
18946
- refetchOnMount: false,
18947
- refetchOnReconnect: false,
18948
- refetchOnWindowFocus: false
18949
- });
18950
- return query;
18951
- };
18952
-
18953
19055
  // src/modals/CheckoutModal/MeldCurrencySelect/MeldCurrencySelect.tsx
18954
19056
  var MeldCurrencySelectInfo = {
18955
19057
  Component: MeldCurrencySelect,
@@ -18964,7 +19066,17 @@ var MeldCurrencySelectInfo = {
18964
19066
  paymentMethodInfo: state.paymentMethodInfo
18965
19067
  };
18966
19068
  },
18967
- title: (_textCustomizations) => "Currency"
19069
+ title: (_textCustomizations) => "Currency",
19070
+ onBack: (state) => {
19071
+ const common = extractCommonState(state);
19072
+ return {
19073
+ ...common,
19074
+ step: "input_amount" /* INPUT_AMOUNT */,
19075
+ fiatAmount: state.fiatAmount,
19076
+ fiatCurrency: state.defaultCurrency,
19077
+ paymentMethodInfo: state.paymentMethodInfo
19078
+ };
19079
+ }
18968
19080
  };
18969
19081
  function MeldCurrencySelect({
18970
19082
  modalState,
@@ -19054,7 +19166,17 @@ var MeldQuotesInfo = {
19054
19166
  paymentMethodInfo: state.paymentMethodInfo
19055
19167
  };
19056
19168
  },
19057
- title: (_textCustomizations) => "Quotes"
19169
+ title: (_textCustomizations) => "Quotes",
19170
+ onBack: (state) => {
19171
+ const common = extractCommonState(state);
19172
+ return {
19173
+ ...common,
19174
+ step: "input_amount" /* INPUT_AMOUNT */,
19175
+ fiatAmount: state.fiatAmount,
19176
+ fiatCurrency: state.fiatCurrency,
19177
+ paymentMethodInfo: state.paymentMethodInfo
19178
+ };
19179
+ }
19058
19180
  };
19059
19181
  function MeldQuotes({
19060
19182
  modalState,
@@ -19073,7 +19195,8 @@ function MeldQuotes({
19073
19195
  MeldQuoteItem,
19074
19196
  {
19075
19197
  key: quote.serviceProvider,
19076
- badge: index === 0 ? "Best Price" : void 0,
19198
+ isBestQuote: index === 0,
19199
+ isActive: modalState.provider === quote.serviceProvider,
19077
19200
  quote,
19078
19201
  onClick: () => onNext({ quote, navigateToHistoryStep: true })
19079
19202
  }
@@ -20646,7 +20769,7 @@ var ASSET_ITEM_HEIGHT = 52;
20646
20769
  var VISIBLE_ITEMS_COUNT = 5;
20647
20770
  var SelectAssetInfo = {
20648
20771
  Component: SelectAsset,
20649
- disableBack: true,
20772
+ disableBack: ({ apiKey }) => !isOstiumCustomer(apiKey),
20650
20773
  onNext(state, payload) {
20651
20774
  const common = extractCommonState(state);
20652
20775
  if (payload.disconnectedBrokerage) {
@@ -20913,7 +21036,7 @@ function MeshOrAccountSelectAsset({
20913
21036
  asset,
20914
21037
  isActive: selectedChainTokenSymbol === asset.chainSymbolKey,
20915
21038
  isDisabled: isDisabled2,
20916
- badgeText,
21039
+ badgeText: isPolymarketCustomer(apiKey) && badgeText === "Same Asset" ? "" : badgeText,
20917
21040
  onClick: () => setSelectedChainTokenSymbol(asset.chainSymbolKey)
20918
21041
  }
20919
21042
  )));
@@ -21257,16 +21380,6 @@ import { createPortal as createPortal12 } from "react-dom";
21257
21380
 
21258
21381
  // src/hooks/usePaymentSources.ts
21259
21382
  import { FlagKey as FlagKey25, isNotNullish as isNotNullish9 } from "@funkit/utils";
21260
-
21261
- // src/utils/customer.ts
21262
- function isKatanaEarnFlow({
21263
- apiKey,
21264
- checkoutConfig
21265
- }) {
21266
- return isKatanaCustomer(apiKey) && !!checkoutConfig && isCheckoutPostActionRequired(checkoutConfig);
21267
- }
21268
-
21269
- // src/hooks/usePaymentSources.ts
21270
21383
  function useRemainingMeshExchangeConnections(selected) {
21271
21384
  const { getActiveConnection } = useFunkitMesh();
21272
21385
  const supportedExchanges = useSupportedExchanges();
@@ -21300,8 +21413,9 @@ function usePaymentMethodEnablement({
21300
21413
  const isCardFlagEnabled = useFlag(FlagKey25.EnableCard);
21301
21414
  const isBrokerageFlagEnabled = useFlag(FlagKey25.EnableBrokerage);
21302
21415
  const isKatanaEarnFlowAction = isKatanaEarnFlow({ apiKey, checkoutConfig });
21416
+ const isUsKatanaUser = useIsUsKatanaUser();
21303
21417
  const isFiatEnabled = isFiatFlagEnabled && !isKatanaEarnFlowAction;
21304
- const isTokenTransferEnabled = isTokenTransferFlagEnabled && !isKatanaEarnFlowAction;
21418
+ const isTokenTransferEnabled = isTokenTransferFlagEnabled && !isKatanaEarnFlowAction && !isUsKatanaUser;
21305
21419
  const isBrokerageEnabled = isBrokerageFlagEnabled && !isKatanaEarnFlowAction;
21306
21420
  const isCardEnabled = isCardFlagEnabled && !isKatanaEarnFlowAction && (uiCustomizations?.paymentMethods?.isCardEnabled ?? true);
21307
21421
  return {
@@ -21333,7 +21447,8 @@ var usePaymentSources = (paymentMethodInfo, targetChainId, checkoutConfig) => {
21333
21447
  matchingFiatAccount,
21334
21448
  bridgeCustomer: allFiatAccounts.bridgeCustomer
21335
21449
  }) : null;
21336
- const connectedAccountInfo = paymentMethodInfo?.paymentMethod !== "balance" /* ACCOUNT_BALANCE */ && isUserLoggedIn && hasUsableBalance ? accountPaymentMethodInfo : null;
21450
+ const showBalanceOption = isKatanaCustomer(apiKey) || hasUsableBalance;
21451
+ const connectedAccountInfo = paymentMethodInfo?.paymentMethod !== "balance" /* ACCOUNT_BALANCE */ && isUserLoggedIn && showBalanceOption ? accountPaymentMethodInfo : null;
21337
21452
  const connected = [
21338
21453
  paymentMethodInfo,
21339
21454
  connectedAccountInfo,
@@ -21349,11 +21464,10 @@ var usePaymentSources = (paymentMethodInfo, targetChainId, checkoutConfig) => {
21349
21464
  isTokenInNewSources && "token_transfer" /* TOKEN_TRANSFER */,
21350
21465
  isBrokerageEnabled && "brokerage" /* BROKERAGE */,
21351
21466
  isBankInNewSources && "virtual_bank" /* VIRTUAL_BANK */,
21352
- isWalletInNewSources && "balance" /* ACCOUNT_BALANCE */
21467
+ isWalletInNewSources && "balance" /* ACCOUNT_BALANCE */,
21468
+ !fallback2.includes("card" /* CARD */) && isCardEnabled && "card" /* CARD */
21353
21469
  ].filter((b) => !!b);
21354
- const promotedSource = !fallback2.includes("card" /* CARD */) && isCardEnabled ? "card" /* CARD */ : void 0;
21355
21470
  return {
21356
- promoted: promotedSource,
21357
21471
  preferred: connected.length > 0 ? connected : fallback2,
21358
21472
  moreSources: newSources
21359
21473
  };
@@ -21636,7 +21750,7 @@ function SourceChange({
21636
21750
  titleCustomization: textCustomizations.debitOrCredit
21637
21751
  });
21638
21752
  updateSelectedPaymentMethodInfo(paymentMethodInfo2);
21639
- await onSelectCard();
21753
+ if (!enableMeldPayment) await onSelectCard();
21640
21754
  onNext({
21641
21755
  connectNew: true,
21642
21756
  paymentMethod: newSource2,
@@ -21683,7 +21797,7 @@ function SourceChange({
21683
21797
  });
21684
21798
  }
21685
21799
  };
21686
- const { promoted, preferred, moreSources } = usePaymentSources(
21800
+ const { preferred, moreSources } = usePaymentSources(
21687
21801
  paymentMethodInfo,
21688
21802
  targetChainId,
21689
21803
  checkoutItem?.initSettings.config
@@ -21713,14 +21827,7 @@ function SourceChange({
21713
21827
  );
21714
21828
  }
21715
21829
  const bottomSectionRef = useBottomSectionRef();
21716
- return /* @__PURE__ */ React185.createElement(React185.Fragment, null, /* @__PURE__ */ React185.createElement(Box, { display: "flex", flexDirection: "column", gap: "4" }, promoted && renderSource(promoted), promoted && paymentMethodInfo && /* @__PURE__ */ React185.createElement(
21717
- FunDivider,
21718
- {
21719
- marginTop: "8",
21720
- marginBottom: "8",
21721
- borderColor: "selectedOptionBorder"
21722
- }
21723
- ), preferred.map(renderSource), preferred.length > 0 && moreSources.length > 0 && /* @__PURE__ */ React185.createElement(
21830
+ return /* @__PURE__ */ React185.createElement(React185.Fragment, null, /* @__PURE__ */ React185.createElement(Box, { display: "flex", flexDirection: "column", gap: "4" }, preferred.map(renderSource), preferred.length > 0 && moreSources.length > 0 && /* @__PURE__ */ React185.createElement(
21724
21831
  FunDivider,
21725
21832
  {
21726
21833
  label: "more",
@@ -22574,7 +22681,7 @@ var getMaxSlippage = (sourceToken, targetToken, isSameChain) => {
22574
22681
  // src/modals/CheckoutModal/TransferToken/TransferToken.tsx
22575
22682
  var TransferTokenInfo = {
22576
22683
  Component: TransferToken,
22577
- disableBack: true,
22684
+ disableBack: () => true,
22578
22685
  onNext: (state) => {
22579
22686
  const common = extractCommonState(state);
22580
22687
  return {
@@ -23119,7 +23226,7 @@ var AccountDetailsScreen = ({
23119
23226
  };
23120
23227
  var FiatAccountDetail = {
23121
23228
  Component: AccountDetailsScreen,
23122
- disableBack: true,
23229
+ disableBack: () => true,
23123
23230
  onNext(state, _payload) {
23124
23231
  const common = extractCommonState(state);
23125
23232
  return {
@@ -23175,7 +23282,7 @@ var KycIframeInfo = {
23175
23282
  };
23176
23283
  },
23177
23284
  title: (textCustomizations) => textCustomizations.virtualFiat,
23178
- disableBack: true
23285
+ disableBack: () => true
23179
23286
  };
23180
23287
  function KycIframe({
23181
23288
  modalState,
@@ -23421,10 +23528,16 @@ function useCheckoutModalTransition(checkoutItem, onClose) {
23421
23528
  }
23422
23529
  function useTitleConfig(checkoutItem, state) {
23423
23530
  const { apiKey, textCustomizations } = useFunkitConfig();
23424
- const { showFullHeight, disableBack, hideClose, title, fallbackTitle } = CheckoutModalSteps[state.step];
23531
+ const {
23532
+ showFullHeight,
23533
+ disableBack = () => false,
23534
+ hideClose,
23535
+ title,
23536
+ fallbackTitle
23537
+ } = CheckoutModalSteps[state.step];
23425
23538
  const baseTitle = checkoutItem.initSettings.config.modalTitle ?? fallbackTitle ?? "Checkout";
23426
23539
  return {
23427
- disableBack: isOstiumCustomer(apiKey) && state.step === "select_asset" /* SELECT_ASSET */ ? false : disableBack ?? false,
23540
+ disableBack: disableBack({ state, apiKey }),
23428
23541
  hideClose: hideClose ?? false,
23429
23542
  showFullHeight: showFullHeight ?? ((isVertexCustomer(apiKey) || isKatanaCustomer(apiKey)) && state.step === "select_asset" /* SELECT_ASSET */),
23430
23543
  title: title?.(textCustomizations) ?? baseTitle
@@ -27805,7 +27918,8 @@ var parseDisclaimer = (checkout, onHelp) => {
27805
27918
 
27806
27919
  // src/modals/CheckoutModal/TransferToken/DirectExecutionNotification.tsx
27807
27920
  import React250 from "react";
27808
- var mapDirectExecutionStateToNotificationStatus = (isDelayed2, isRefunded, isCompleted, isFailed) => {
27921
+ var mapDirectExecutionStateToNotificationStatus = (isProcessing, isDelayed2, isRefunded, isCompleted, isFailed) => {
27922
+ if (isProcessing) return "processing";
27809
27923
  if (isDelayed2) return "delayed";
27810
27924
  if (isCompleted) return "completed";
27811
27925
  if (isRefunded) return "expired";
@@ -27818,10 +27932,11 @@ var DirectExecutionNotification = ({
27818
27932
  onHelp
27819
27933
  }) => {
27820
27934
  const { initSettings } = directExecution.clientMetadata;
27821
- const { isDelayed: isDelayed2, isRefunded, isCompleted, isFailed } = useCheckoutDirectExecutionHistory({
27935
+ const { isProcessing, isDelayed: isDelayed2, isRefunded, isCompleted, isFailed } = useCheckoutDirectExecutionHistory({
27822
27936
  initDirectExecution: directExecution
27823
27937
  });
27824
27938
  const notificationStatus = mapDirectExecutionStateToNotificationStatus(
27939
+ isProcessing,
27825
27940
  isDelayed2,
27826
27941
  isRefunded,
27827
27942
  isCompleted,
@@ -27832,6 +27947,7 @@ var DirectExecutionNotification = ({
27832
27947
  FunNotificationBanner,
27833
27948
  {
27834
27949
  description: parseDescription2(
27950
+ isProcessing,
27835
27951
  isDelayed2,
27836
27952
  isRefunded,
27837
27953
  isCompleted,
@@ -27869,8 +27985,8 @@ var parseTitle = (isDelayed2, isRefunded, isCompleted, isFailed) => {
27869
27985
  if (isFailed || isRefunded) return "Didn't complete";
27870
27986
  return "Deposit received and processing...";
27871
27987
  };
27872
- var parseDescription2 = (isDelayed2, isRefunded, isCompleted, isFailed) => {
27873
- if (isDelayed2) {
27988
+ var parseDescription2 = (isProcessing, isDelayed2, isRefunded, isCompleted, isFailed) => {
27989
+ if (isProcessing || isDelayed2) {
27874
27990
  return "Your deposit will be credited to your account shortly.";
27875
27991
  }
27876
27992
  if (isCompleted) {
@@ -30010,7 +30126,7 @@ function setFunkitConnectVersion({ version }) {
30010
30126
  localStorage.setItem(storageKey5, version);
30011
30127
  }
30012
30128
  function getCurrentSdkVersion() {
30013
- return "5.5.2";
30129
+ return "5.5.4";
30014
30130
  }
30015
30131
  function useFingerprint() {
30016
30132
  const fingerprint = useCallback49(() => {