@funkit/connect 5.5.2 → 5.5.3

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 (48) hide show
  1. package/CHANGELOG.md +15 -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/usePaymentSources.d.ts +0 -1
  6. package/dist/index.js +161 -96
  7. package/dist/modals/CheckoutModal/InputAmount/InputAmount.d.ts +2 -1
  8. package/dist/modals/CheckoutModal/MeldQuotes/MeldQuotes.d.ts +2 -1
  9. package/dist/modals/CheckoutModal/stepTransition.d.ts +5 -1
  10. package/dist/utils/flags/config.d.ts +10 -3
  11. package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
  12. package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
  13. package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
  14. package/dist/wallets/walletConnectors/chunk-25VW5TZP.js +92 -0
  15. package/dist/wallets/walletConnectors/chunk-3NC26XLM.js +92 -0
  16. package/dist/wallets/walletConnectors/chunk-3U3BMEH5.js +94 -0
  17. package/dist/wallets/walletConnectors/chunk-4UM4GTKZ.js +103 -0
  18. package/dist/wallets/walletConnectors/chunk-545L7Y4M.js +69 -0
  19. package/dist/wallets/walletConnectors/chunk-6LPM6LUQ.js +110 -0
  20. package/dist/wallets/walletConnectors/chunk-7GSNBOD3.js +99 -0
  21. package/dist/wallets/walletConnectors/chunk-ETTNDQQG.js +100 -0
  22. package/dist/wallets/walletConnectors/chunk-FRGSRLTS.js +93 -0
  23. package/dist/wallets/walletConnectors/chunk-HKV7EMYZ.js +96 -0
  24. package/dist/wallets/walletConnectors/chunk-IPOC2VJX.js +106 -0
  25. package/dist/wallets/walletConnectors/chunk-JXP2QPW7.js +95 -0
  26. package/dist/wallets/walletConnectors/chunk-KFFJPS5R.js +96 -0
  27. package/dist/wallets/walletConnectors/chunk-LEXSM5KI.js +87 -0
  28. package/dist/wallets/walletConnectors/chunk-MOOBCMMB.js +70 -0
  29. package/dist/wallets/walletConnectors/chunk-N2NIIUW6.js +146 -0
  30. package/dist/wallets/walletConnectors/chunk-W5O4YSZN.js +98 -0
  31. package/dist/wallets/walletConnectors/chunk-XYBEMO3C.js +66 -0
  32. package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
  33. package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
  34. package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
  35. package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
  36. package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
  37. package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
  38. package/dist/wallets/walletConnectors/index.js +58 -58
  39. package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
  40. package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
  41. package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
  42. package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
  43. package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
  44. package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
  45. package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
  46. package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
  47. package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
  48. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 5.5.3
4
+
5
+ ### Patch Changes
6
+
7
+ - b0a2c6c: remove same asset tag in polymarket
8
+ - a0d19fc: preload meld currencies
9
+ - e252efc: feat(connect): keep Card payment method beneath Transfer Crypto
10
+ - 20f5175: tweak meld design
11
+ - 0ead49a: hide back button in card input step
12
+ - Updated dependencies [20f5175]
13
+ - @funkit/api-base@1.9.2
14
+ - @funkit/utils@1.1.2
15
+ - @funkit/core@2.3.24
16
+ - @funkit/wagmi-tools@3.0.46
17
+
3
18
  ## 5.5.2
4
19
 
5
20
  ### Patch Changes
@@ -2,11 +2,11 @@ import type { MeldQuote, MeldServiceProvider } from '@funkit/api-base';
2
2
  import React from 'react';
3
3
  export declare const providerLabelMap: Record<MeldServiceProvider, string>;
4
4
  export interface MeldQuoteItemProps {
5
- badge?: string;
5
+ isBestQuote?: boolean;
6
6
  quote: MeldQuote | undefined;
7
7
  onClick?: () => void;
8
8
  isError?: boolean;
9
9
  isDisabled?: boolean;
10
10
  isActive?: boolean;
11
11
  }
12
- export declare const MeldQuoteItem: ({ quote, badge, onClick, isDisabled, isActive, }: MeldQuoteItemProps) => React.JSX.Element;
12
+ export declare const MeldQuoteItem: ({ quote, isBestQuote, onClick, isDisabled, isActive, }: MeldQuoteItemProps) => React.JSX.Element;
@@ -1,4 +1,4 @@
1
- import type { MeldQuote } from '@funkit/api-base';
1
+ import type { MeldQuote, MeldServiceProvider } from '@funkit/api-base';
2
2
  import React from 'react';
3
3
  interface SourceMeldQuoteItemProps {
4
4
  quote?: MeldQuote;
@@ -10,4 +10,9 @@ interface SourceMeldQuoteItemProps {
10
10
  error?: string;
11
11
  }
12
12
  export declare const SourceMeldQuoteItem: ({ quote, onClick, isLoading, isBestQuote, isPreselected, disabled, error, }: SourceMeldQuoteItemProps) => React.JSX.Element;
13
+ interface MeldProviderLabelProps {
14
+ serviceProvider: MeldServiceProvider;
15
+ isBest?: boolean;
16
+ }
17
+ export declare const MeldProviderLabel: ({ serviceProvider, isBest, }: MeldProviderLabelProps) => React.JSX.Element;
13
18
  export {};
@@ -1 +1 @@
1
- export declare const useMeldCurrencies: () => import("@tanstack/react-query").UseQueryResult<import("@funkit/api-base").MeldFiatCurrency[], Error>;
1
+ export declare const useMeldCurrencies: (isEnabled?: boolean) => import("@tanstack/react-query").UseQueryResult<import("@funkit/api-base").MeldFiatCurrency[], Error>;
@@ -1,7 +1,6 @@
1
1
  import { type ConnectablePaymentMethodInfo, PaymentMethod } from '~/domains/paymentMethods';
2
2
  import type { FunkitCheckoutConfig } from '~/providers/FunkitCheckoutContext';
3
3
  export declare const usePaymentSources: (paymentMethodInfo: ConnectablePaymentMethodInfo | null, targetChainId: string, checkoutConfig?: FunkitCheckoutConfig) => {
4
- promoted: PaymentMethod | undefined;
5
4
  preferred: (import("~/domains/paymentMethods").PaymentMethodBrokerageInfo | import("~/domains/paymentMethods").PaymentMethodAccountInfo | import("~/domains/paymentMethods").PaymentMethodVirtualBankInfo)[] | PaymentMethod[];
6
5
  moreSources: PaymentMethod[];
7
6
  };
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,32 @@ 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_any: [
3615
+ {
3616
+ key: "userId",
3617
+ type: "pctRollout",
3618
+ pct: 100
3601
3619
  }
3602
3620
  ],
3603
3621
  value: false
@@ -5511,7 +5529,7 @@ var getStyleProps = (type, isDisabled) => {
5511
5529
  focusedVisible: isDisabled ? void 0 : "buttonFocusedShadow"
5512
5530
  },
5513
5531
  paddingX: "24",
5514
- paddingY: isDisabled ? "11" : "10"
5532
+ paddingY: "10"
5515
5533
  };
5516
5534
  };
5517
5535
  function FunButton({
@@ -13507,7 +13525,7 @@ var CheckoutCompleteInfo = {
13507
13525
  depositAddress: state.depositAddress
13508
13526
  };
13509
13527
  },
13510
- disableBack: true,
13528
+ disableBack: () => true,
13511
13529
  fallbackTitle: DEFAULT_CHECKOUT_HISTORY_DETAIL_TITLE
13512
13530
  };
13513
13531
  function CheckoutComplete({
@@ -16252,15 +16270,47 @@ function ConnectExchange({
16252
16270
  import { isMobile as isMobile5 } from "@funkit/utils";
16253
16271
  import React152, { useEffect as useEffect28 } from "react";
16254
16272
 
16273
+ // src/hooks/queries/useMeldCurrencies.ts
16274
+ import { getMeldSupportedFiat } from "@funkit/api-base";
16275
+ import { useQuery as useQuery11 } from "@tanstack/react-query";
16276
+ var getPriority = (currencyCode) => {
16277
+ if (currencyCode === "USD") return 0;
16278
+ if (currencyCode === "EUR") return 1;
16279
+ return 2;
16280
+ };
16281
+ var useMeldCurrencies = (isEnabled = true) => {
16282
+ const { apiKey } = useFunkitConfig();
16283
+ const query = useQuery11({
16284
+ queryKey: ["meld", "currencies"],
16285
+ queryFn: async () => {
16286
+ if (!apiKey) {
16287
+ return [];
16288
+ }
16289
+ const { currencies } = await getMeldSupportedFiat({ apiKey });
16290
+ return currencies.sort((a, b) => {
16291
+ const aPriority = getPriority(a.currencyCode);
16292
+ const bPriority = getPriority(b.currencyCode);
16293
+ if (aPriority !== bPriority) return aPriority - bPriority;
16294
+ return a.name.localeCompare(b.name);
16295
+ });
16296
+ },
16297
+ enabled: !!apiKey && isEnabled,
16298
+ refetchOnMount: false,
16299
+ refetchOnReconnect: false,
16300
+ refetchOnWindowFocus: false
16301
+ });
16302
+ return query;
16303
+ };
16304
+
16255
16305
  // src/hooks/queries/useMeldDefaultCurrency.ts
16256
16306
  import { getMeldDefaultFiat } from "@funkit/api-base";
16257
16307
  import { FlagKey as FlagKey18 } from "@funkit/utils";
16258
- import { useQuery as useQuery11 } from "@tanstack/react-query";
16308
+ import { useQuery as useQuery12 } from "@tanstack/react-query";
16259
16309
  var useMeldDefaultCurrency = (paymentMethod) => {
16260
16310
  const { apiKey } = useFunkitConfig();
16261
16311
  const { userIpInfo } = useFunkitUserIp();
16262
16312
  const enableMeld = useFlag(FlagKey18.EnableMeldPayment);
16263
- const query = useQuery11({
16313
+ const query = useQuery12({
16264
16314
  queryKey: ["meld", "defaultCurrency"],
16265
16315
  queryFn: async () => {
16266
16316
  if (!apiKey) return "";
@@ -16398,6 +16448,7 @@ var providerLabelMap = {
16398
16448
  KOYWE: "Koywe",
16399
16449
  MESH: "Mesh",
16400
16450
  MESO: "Meso",
16451
+ MERCURYO: "Mercuryo",
16401
16452
  ONMETA: "Onmeta",
16402
16453
  ONRAMPMONEY: "Onramp Money",
16403
16454
  PAYBIS: "Paybis",
@@ -16413,7 +16464,7 @@ var providerLabelMap = {
16413
16464
  };
16414
16465
  var MeldQuoteItem = ({
16415
16466
  quote,
16416
- badge,
16467
+ isBestQuote,
16417
16468
  onClick,
16418
16469
  isDisabled = false,
16419
16470
  isActive = false
@@ -16422,16 +16473,15 @@ var MeldQuoteItem = ({
16422
16473
  return /* @__PURE__ */ React141.createElement(FunSkeletonBlock, { height: "56", width: "full" });
16423
16474
  }
16424
16475
  const destinationCurrencyCode = quote.destinationCurrencyCode.split("_")[0];
16476
+ const cryptoDecimals = isStablecoin(destinationCurrencyCode) ? 2 : 5;
16425
16477
  const cryptoAmount = formatCryptoAndStringify2(
16426
16478
  quote.destinationAmount,
16427
16479
  destinationCurrencyCode,
16428
16480
  true,
16429
- // TODO: fix crypto formatting so that options are respected
16430
16481
  {
16431
- minimumSignificantDigits: 2,
16432
16482
  numberFormatOptions: {
16433
- minimumFractionDigits: 2,
16434
- maximumFractionDigits: 2
16483
+ minimumFractionDigits: cryptoDecimals,
16484
+ maximumFractionDigits: cryptoDecimals
16435
16485
  }
16436
16486
  }
16437
16487
  );
@@ -16461,14 +16511,12 @@ var MeldQuoteItem = ({
16461
16511
  alt: quote.serviceProvider,
16462
16512
  borderRadius: "full"
16463
16513
  }
16464
- )), /* @__PURE__ */ React141.createElement(Text, { weight: "medium", size: "12", style: { whiteSpace: "nowrap" } }, providerLabelMap[quote.serviceProvider] ?? quote.serviceProvider), badge && /* @__PURE__ */ React141.createElement(
16465
- FunBadge,
16514
+ )), /* @__PURE__ */ React141.createElement(
16515
+ MeldProviderLabel,
16466
16516
  {
16467
- background: "approvedBadgeBackground",
16468
- borderColor: "approvedBadgeBorder",
16469
- color: "approvedBadgeText"
16470
- },
16471
- badge
16517
+ serviceProvider: quote.serviceProvider,
16518
+ isBest: isBestQuote
16519
+ }
16472
16520
  )),
16473
16521
  /* @__PURE__ */ React141.createElement(Box, { display: "flex", alignItems: "center", gap: "8" }, /* @__PURE__ */ React141.createElement(
16474
16522
  Box,
@@ -16518,9 +16566,29 @@ var SourceMeldQuoteItem = ({
16518
16566
  alt: quote.serviceProvider,
16519
16567
  borderRadius: "full"
16520
16568
  }
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 }))
16569
+ ), /* @__PURE__ */ React142.createElement(
16570
+ MeldProviderLabel,
16571
+ {
16572
+ serviceProvider: quote.serviceProvider,
16573
+ isBest: isBestQuote
16574
+ }
16575
+ )) : /* @__PURE__ */ React142.createElement(Text, { size: "12", color: "secondaryText", weight: "medium" }, "No quotes found")), /* @__PURE__ */ React142.createElement(ArrowIcon, { direction: "right", size: 16 }))
16522
16576
  );
16523
16577
  };
16578
+ var MeldProviderLabel = ({
16579
+ serviceProvider,
16580
+ isBest
16581
+ }) => {
16582
+ 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(
16583
+ Text,
16584
+ {
16585
+ color: "approvedBadgeText",
16586
+ size: "10",
16587
+ style: { whiteSpace: "nowrap" }
16588
+ },
16589
+ "Best price"
16590
+ ));
16591
+ };
16524
16592
 
16525
16593
  // src/components/SourcePaymentMethodItem/SourcePaymentMethodItem.tsx
16526
16594
  import clsx14 from "clsx";
@@ -17286,7 +17354,7 @@ var YouPayYouReceiveBottomBarLayoutWrapper = ({
17286
17354
  // src/hooks/queries/useMeldLimits.ts
17287
17355
  import { getMeldFiatLimits } from "@funkit/api-base";
17288
17356
  import { formatCurrencyAndStringify as formatCurrencyAndStringify6 } from "@funkit/utils";
17289
- import { useQuery as useQuery12 } from "@tanstack/react-query";
17357
+ import { useQuery as useQuery13 } from "@tanstack/react-query";
17290
17358
  import { useMemo as useMemo23 } from "react";
17291
17359
 
17292
17360
  // src/hooks/queries/useMeldCryptoCurrencyCode.ts
@@ -17302,7 +17370,7 @@ var useMeldLimits = (fiatCurrency) => {
17302
17370
  const { apiKey } = useFunkitConfig();
17303
17371
  const { userIpInfo } = useFunkitUserIp();
17304
17372
  const cryptoCurrency = useMeldCryptoCurrencyCode();
17305
- const query = useQuery12({
17373
+ const query = useQuery13({
17306
17374
  queryKey: ["meld", "limits", userIpInfo?.alpha2, cryptoCurrency],
17307
17375
  queryFn: async () => {
17308
17376
  if (!apiKey || !userIpInfo) return void 0;
@@ -17458,7 +17526,7 @@ var useMeldLink = (sourceAmount, sourceCurrencyCode = "USD") => {
17458
17526
 
17459
17527
  // src/modals/CheckoutModal/MeldQuotes/useMeldQuotes.tsx
17460
17528
  import { getMeldQuotes } from "@funkit/api-base";
17461
- import { useQuery as useQuery13 } from "@tanstack/react-query";
17529
+ import { useQuery as useQuery14 } from "@tanstack/react-query";
17462
17530
  import { useDebounce } from "use-debounce";
17463
17531
  var DEBOUNCE_DELAY = 500;
17464
17532
  var COUNTDOWN_INTERVAL_SEC = 60;
@@ -17470,7 +17538,7 @@ var useMeldQuotes = (sourceAmount, fiatCurrency) => {
17470
17538
  const { isAway } = useUserPresence();
17471
17539
  const destinationCurrencyCode = useMeldCryptoCurrencyCode();
17472
17540
  const sourceCurrencyCode = fiatCurrency || "USD";
17473
- const query = useQuery13({
17541
+ const query = useQuery14({
17474
17542
  queryKey: [
17475
17543
  "meld",
17476
17544
  "quotes",
@@ -17500,7 +17568,8 @@ var useMeldQuotes = (sourceAmount, fiatCurrency) => {
17500
17568
  },
17501
17569
  enabled: !!userIpInfo && !!apiKey && !!destinationCurrencyCode && !isAway && !!fiatCurrency,
17502
17570
  refetchInterval: COUNTDOWN_INTERVAL_SEC * 1e3,
17503
- refetchOnWindowFocus: false
17571
+ refetchOnWindowFocus: false,
17572
+ retry: false
17504
17573
  });
17505
17574
  const { countdown } = useCountdown({
17506
17575
  countdownSeconds: COUNTDOWN_INTERVAL_SEC,
@@ -18017,8 +18086,8 @@ function InputAmountLoaded({
18017
18086
  }
18018
18087
  if (meldQuotesQuery.error) {
18019
18088
  return {
18020
- message: "An error occurred. Please try again or contact us for more information",
18021
- type: "error"
18089
+ message: "It seems something didn't work. Our team has been notified of the issue",
18090
+ type: "hint"
18022
18091
  };
18023
18092
  }
18024
18093
  }
@@ -18067,13 +18136,14 @@ function InputAmountLoaded({
18067
18136
  ASSET_DECIMALS
18068
18137
  );
18069
18138
  const isConvertedAmountShown = targetAssetTicker && (!isInputInUsd || isCardCheckout && fiatCurrency === "USD" || !isCardCheckout);
18139
+ const isMeldContinueDisabled = meldEnabled && (!!meldLimitError || isMeldLinkPending || !!meldQuotesQuery.error || meldQuotesQuery.isFetching || isSelectedQuoteUnavailable);
18070
18140
  return /* @__PURE__ */ React150.createElement(
18071
18141
  InputAmountLayout,
18072
18142
  {
18073
18143
  actionButtonProps: {
18074
18144
  title: suggestion?.buttonLabel ?? "Continue",
18075
18145
  onClick: handleSubmit,
18076
- isDisabled: !isValid && !suggestion || error?.type === "error" || !!meldLimitError || isMeldLinkPending || meldQuotesQuery.isFetching || isCardCheckout && isSelectedQuoteUnavailable,
18146
+ isDisabled: !isValid && !suggestion || isMeldContinueDisabled,
18077
18147
  isLoading: isMeldLinkPending
18078
18148
  },
18079
18149
  fiatCurrencySelector: meldEnabled && /* @__PURE__ */ React150.createElement(
@@ -18171,12 +18241,13 @@ function InputAmountLoaded({
18171
18241
  }
18172
18242
  }
18173
18243
  ),
18174
- footer: meldEnabled ? /* @__PURE__ */ React150.createElement(
18244
+ footer: meldEnabled ? /* @__PURE__ */ React150.createElement(Box, { paddingX: "6" }, /* @__PURE__ */ React150.createElement(
18175
18245
  SourceMeldQuoteItem,
18176
18246
  {
18177
18247
  onClick: () => onNext({
18178
18248
  fiatAmount: usdAmount,
18179
18249
  fiatCurrency,
18250
+ provider: selectedQuote?.serviceProvider,
18180
18251
  nextStep: "meld_quotes" /* MELD_QUOTES */
18181
18252
  }),
18182
18253
  quote: selectedQuote,
@@ -18186,7 +18257,7 @@ function InputAmountLoaded({
18186
18257
  isPreselected: !manuallySelectedQuote && !!bestRateQuote,
18187
18258
  error: meldLimitError?.issue
18188
18259
  }
18189
- ) : /* @__PURE__ */ React150.createElement(
18260
+ )) : /* @__PURE__ */ React150.createElement(
18190
18261
  YouPayYouReceiveWrapper,
18191
18262
  {
18192
18263
  targetChainId: modalState.targetChainId,
@@ -18336,7 +18407,7 @@ function InputAmountLoading({
18336
18407
  )
18337
18408
  ),
18338
18409
  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(
18410
+ footer: isMeldCheckout ? /* @__PURE__ */ React151.createElement(Box, { paddingX: "6" }, /* @__PURE__ */ React151.createElement(SourceMeldQuoteItem, { isLoading: true })) : /* @__PURE__ */ React151.createElement(YouPayYouReceiveBottomBarLayoutWrapper, null, /* @__PURE__ */ React151.createElement(
18340
18411
  FunSkeletonBlock,
18341
18412
  {
18342
18413
  borderRadius: "youPayYouReceive",
@@ -18358,7 +18429,7 @@ import {
18358
18429
  convertFunToRelayTokenAddress,
18359
18430
  getRelayAssetPriceInfo
18360
18431
  } from "@funkit/fun-relay";
18361
- import { skipToken, useQuery as useQuery14 } from "@tanstack/react-query";
18432
+ import { skipToken, useQuery as useQuery15 } from "@tanstack/react-query";
18362
18433
  async function getFormattedRelayAssetPriceInfo({
18363
18434
  chainId,
18364
18435
  assetTokenAddress
@@ -18384,7 +18455,7 @@ function useAssetPrice({
18384
18455
  assetTokenAddress
18385
18456
  }) {
18386
18457
  const { apiKey } = useFunkitConfig();
18387
- const { data, error, isLoading } = useQuery14({
18458
+ const { data, error, isLoading } = useQuery15({
18388
18459
  queryKey: ["getAssetPriceInfo", chainId, assetTokenAddress],
18389
18460
  queryFn: chainId && assetTokenAddress ? async () => {
18390
18461
  const isRelayPrimary = RELAY_SHORT_CIRCUIT_CHAIN_IDS.includes(chainId);
@@ -18486,7 +18557,8 @@ var InputAmountInfo = {
18486
18557
  step: "meld_quotes" /* MELD_QUOTES */,
18487
18558
  fiatAmount: payload.fiatAmount,
18488
18559
  paymentMethodInfo: state.paymentMethodInfo,
18489
- fiatCurrency: payload.fiatCurrency ?? state.fiatCurrency
18560
+ fiatCurrency: payload.fiatCurrency ?? state.fiatCurrency,
18561
+ provider: payload.provider
18490
18562
  };
18491
18563
  }
18492
18564
  return {
@@ -18495,9 +18567,14 @@ var InputAmountInfo = {
18495
18567
  paymentMethodInfo: state.paymentMethodInfo
18496
18568
  };
18497
18569
  },
18498
- showFullHeight: !isMobile5()
18570
+ showFullHeight: !isMobile5(),
18571
+ // back should be disabled in card flow in input_amount
18572
+ disableBack: ({ state }) => {
18573
+ return state.paymentMethodInfo?.paymentMethod === "card" /* CARD */;
18574
+ }
18499
18575
  };
18500
18576
  function InputAmount(props) {
18577
+ const { paymentMethodInfo } = props.modalState;
18501
18578
  const { textCustomizations } = useFunkitConfig();
18502
18579
  const { setCheckoutQuote } = useQuoteContext();
18503
18580
  const { checkoutItem } = useCheckoutContext();
@@ -18506,12 +18583,13 @@ function InputAmount(props) {
18506
18583
  error: sourceHoldingError,
18507
18584
  isLoading: isLoadingSourceHolding
18508
18585
  } = useAvailableBalanceForCheckout(
18509
- props.modalState.paymentMethodInfo,
18586
+ paymentMethodInfo,
18510
18587
  checkoutItem?.initSettings.config.targetChain ?? "",
18511
18588
  checkoutItem?.selectedSourceAssetInfo.chainId ?? "",
18512
18589
  checkoutItem?.selectedSourceAssetInfo.symbol ?? null
18513
18590
  );
18514
- const { data: defaultCurrency, isLoading: isMeldDefaultCurrencyLoading } = useMeldDefaultCurrency(props.modalState.paymentMethodInfo.paymentMethod);
18591
+ const { data: defaultCurrency, isLoading: isMeldDefaultCurrencyLoading } = useMeldDefaultCurrency(paymentMethodInfo.paymentMethod);
18592
+ useMeldCurrencies(paymentMethodInfo.paymentMethod === "card" /* CARD */);
18515
18593
  const { error: unitPriceError, unitPrice } = useAssetPrice({
18516
18594
  chainId: checkoutItem?.initSettings.config.targetChain,
18517
18595
  assetTokenAddress: checkoutItem?.initSettings.config.targetAsset
@@ -18918,38 +18996,6 @@ var FunNoResults = ({ text }) => {
18918
18996
  var hideScrollBar = "_163ehmk0";
18919
18997
  var selectWrapperStyle = "_163ehmk1";
18920
18998
 
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
18999
  // src/modals/CheckoutModal/MeldCurrencySelect/MeldCurrencySelect.tsx
18954
19000
  var MeldCurrencySelectInfo = {
18955
19001
  Component: MeldCurrencySelect,
@@ -18964,7 +19010,17 @@ var MeldCurrencySelectInfo = {
18964
19010
  paymentMethodInfo: state.paymentMethodInfo
18965
19011
  };
18966
19012
  },
18967
- title: (_textCustomizations) => "Currency"
19013
+ title: (_textCustomizations) => "Currency",
19014
+ onBack: (state) => {
19015
+ const common = extractCommonState(state);
19016
+ return {
19017
+ ...common,
19018
+ step: "input_amount" /* INPUT_AMOUNT */,
19019
+ fiatAmount: state.fiatAmount,
19020
+ fiatCurrency: state.defaultCurrency,
19021
+ paymentMethodInfo: state.paymentMethodInfo
19022
+ };
19023
+ }
18968
19024
  };
18969
19025
  function MeldCurrencySelect({
18970
19026
  modalState,
@@ -19054,7 +19110,17 @@ var MeldQuotesInfo = {
19054
19110
  paymentMethodInfo: state.paymentMethodInfo
19055
19111
  };
19056
19112
  },
19057
- title: (_textCustomizations) => "Quotes"
19113
+ title: (_textCustomizations) => "Quotes",
19114
+ onBack: (state) => {
19115
+ const common = extractCommonState(state);
19116
+ return {
19117
+ ...common,
19118
+ step: "input_amount" /* INPUT_AMOUNT */,
19119
+ fiatAmount: state.fiatAmount,
19120
+ fiatCurrency: state.fiatCurrency,
19121
+ paymentMethodInfo: state.paymentMethodInfo
19122
+ };
19123
+ }
19058
19124
  };
19059
19125
  function MeldQuotes({
19060
19126
  modalState,
@@ -19073,7 +19139,8 @@ function MeldQuotes({
19073
19139
  MeldQuoteItem,
19074
19140
  {
19075
19141
  key: quote.serviceProvider,
19076
- badge: index === 0 ? "Best Price" : void 0,
19142
+ isBestQuote: index === 0,
19143
+ isActive: modalState.provider === quote.serviceProvider,
19077
19144
  quote,
19078
19145
  onClick: () => onNext({ quote, navigateToHistoryStep: true })
19079
19146
  }
@@ -20646,7 +20713,7 @@ var ASSET_ITEM_HEIGHT = 52;
20646
20713
  var VISIBLE_ITEMS_COUNT = 5;
20647
20714
  var SelectAssetInfo = {
20648
20715
  Component: SelectAsset,
20649
- disableBack: true,
20716
+ disableBack: ({ apiKey }) => !isOstiumCustomer(apiKey),
20650
20717
  onNext(state, payload) {
20651
20718
  const common = extractCommonState(state);
20652
20719
  if (payload.disconnectedBrokerage) {
@@ -20913,7 +20980,7 @@ function MeshOrAccountSelectAsset({
20913
20980
  asset,
20914
20981
  isActive: selectedChainTokenSymbol === asset.chainSymbolKey,
20915
20982
  isDisabled: isDisabled2,
20916
- badgeText,
20983
+ badgeText: isPolymarketCustomer(apiKey) && badgeText === "Same Asset" ? "" : badgeText,
20917
20984
  onClick: () => setSelectedChainTokenSymbol(asset.chainSymbolKey)
20918
20985
  }
20919
20986
  )));
@@ -21349,11 +21416,10 @@ var usePaymentSources = (paymentMethodInfo, targetChainId, checkoutConfig) => {
21349
21416
  isTokenInNewSources && "token_transfer" /* TOKEN_TRANSFER */,
21350
21417
  isBrokerageEnabled && "brokerage" /* BROKERAGE */,
21351
21418
  isBankInNewSources && "virtual_bank" /* VIRTUAL_BANK */,
21352
- isWalletInNewSources && "balance" /* ACCOUNT_BALANCE */
21419
+ isWalletInNewSources && "balance" /* ACCOUNT_BALANCE */,
21420
+ !fallback2.includes("card" /* CARD */) && isCardEnabled && "card" /* CARD */
21353
21421
  ].filter((b) => !!b);
21354
- const promotedSource = !fallback2.includes("card" /* CARD */) && isCardEnabled ? "card" /* CARD */ : void 0;
21355
21422
  return {
21356
- promoted: promotedSource,
21357
21423
  preferred: connected.length > 0 ? connected : fallback2,
21358
21424
  moreSources: newSources
21359
21425
  };
@@ -21636,7 +21702,7 @@ function SourceChange({
21636
21702
  titleCustomization: textCustomizations.debitOrCredit
21637
21703
  });
21638
21704
  updateSelectedPaymentMethodInfo(paymentMethodInfo2);
21639
- await onSelectCard();
21705
+ if (!enableMeldPayment) await onSelectCard();
21640
21706
  onNext({
21641
21707
  connectNew: true,
21642
21708
  paymentMethod: newSource2,
@@ -21683,7 +21749,7 @@ function SourceChange({
21683
21749
  });
21684
21750
  }
21685
21751
  };
21686
- const { promoted, preferred, moreSources } = usePaymentSources(
21752
+ const { preferred, moreSources } = usePaymentSources(
21687
21753
  paymentMethodInfo,
21688
21754
  targetChainId,
21689
21755
  checkoutItem?.initSettings.config
@@ -21713,14 +21779,7 @@ function SourceChange({
21713
21779
  );
21714
21780
  }
21715
21781
  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(
21782
+ 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
21783
  FunDivider,
21725
21784
  {
21726
21785
  label: "more",
@@ -22574,7 +22633,7 @@ var getMaxSlippage = (sourceToken, targetToken, isSameChain) => {
22574
22633
  // src/modals/CheckoutModal/TransferToken/TransferToken.tsx
22575
22634
  var TransferTokenInfo = {
22576
22635
  Component: TransferToken,
22577
- disableBack: true,
22636
+ disableBack: () => true,
22578
22637
  onNext: (state) => {
22579
22638
  const common = extractCommonState(state);
22580
22639
  return {
@@ -23119,7 +23178,7 @@ var AccountDetailsScreen = ({
23119
23178
  };
23120
23179
  var FiatAccountDetail = {
23121
23180
  Component: AccountDetailsScreen,
23122
- disableBack: true,
23181
+ disableBack: () => true,
23123
23182
  onNext(state, _payload) {
23124
23183
  const common = extractCommonState(state);
23125
23184
  return {
@@ -23175,7 +23234,7 @@ var KycIframeInfo = {
23175
23234
  };
23176
23235
  },
23177
23236
  title: (textCustomizations) => textCustomizations.virtualFiat,
23178
- disableBack: true
23237
+ disableBack: () => true
23179
23238
  };
23180
23239
  function KycIframe({
23181
23240
  modalState,
@@ -23421,10 +23480,16 @@ function useCheckoutModalTransition(checkoutItem, onClose) {
23421
23480
  }
23422
23481
  function useTitleConfig(checkoutItem, state) {
23423
23482
  const { apiKey, textCustomizations } = useFunkitConfig();
23424
- const { showFullHeight, disableBack, hideClose, title, fallbackTitle } = CheckoutModalSteps[state.step];
23483
+ const {
23484
+ showFullHeight,
23485
+ disableBack = () => false,
23486
+ hideClose,
23487
+ title,
23488
+ fallbackTitle
23489
+ } = CheckoutModalSteps[state.step];
23425
23490
  const baseTitle = checkoutItem.initSettings.config.modalTitle ?? fallbackTitle ?? "Checkout";
23426
23491
  return {
23427
- disableBack: isOstiumCustomer(apiKey) && state.step === "select_asset" /* SELECT_ASSET */ ? false : disableBack ?? false,
23492
+ disableBack: disableBack({ state, apiKey }),
23428
23493
  hideClose: hideClose ?? false,
23429
23494
  showFullHeight: showFullHeight ?? ((isVertexCustomer(apiKey) || isKatanaCustomer(apiKey)) && state.step === "select_asset" /* SELECT_ASSET */),
23430
23495
  title: title?.(textCustomizations) ?? baseTitle
@@ -30010,7 +30075,7 @@ function setFunkitConnectVersion({ version }) {
30010
30075
  localStorage.setItem(storageKey5, version);
30011
30076
  }
30012
30077
  function getCurrentSdkVersion() {
30013
- return "5.5.2";
30078
+ return "5.5.3";
30014
30079
  }
30015
30080
  function useFingerprint() {
30016
30081
  const fingerprint = useCallback49(() => {
@@ -1,4 +1,4 @@
1
- import type { MeldQuote } from '@funkit/api-base';
1
+ import type { MeldQuote, MeldServiceProvider } from '@funkit/api-base';
2
2
  import React from 'react';
3
3
  import { type PaymentMethodInfo } from '~/domains/paymentMethods';
4
4
  import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from '../stepTransition';
@@ -11,6 +11,7 @@ export type InputAmountState = CheckoutModalCommonState & {
11
11
  export type InputAmountNext = Record<string, never> | {
12
12
  fiatAmount: number;
13
13
  fiatCurrency?: string;
14
+ provider?: MeldServiceProvider;
14
15
  nextStep?: FunCheckoutStep.SOURCE_CHANGE | FunCheckoutStep.MELD_CURRENCY_SELECT | FunCheckoutStep.MELD_QUOTES;
15
16
  };
16
17
  export declare const InputAmountInfo: ModalStepInfo<FunCheckoutStep.INPUT_AMOUNT>;