@funkit/connect 6.0.2 → 6.0.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 6.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 131c4e8: Increase modal overlay blur for tiny theme from 2px to 4px for improved visual consistency
8
+ - e7fbbf7: Apply uppercase customization consistently to both buttons in FunBottomBar component
9
+ - 0ed7731: Increase tooltip max width in PaymentFeesSummary from 205px to 250px for better content visibility
10
+ - 3d27ffe: fix(connect): fix height calculation for checkout modal
11
+ - 9811dfe: feat(connect,api-base,frog): add Revolut as Meld service provider
12
+ - b144caf: add new config for starting step
13
+ - 3d27ffe: feat(connect): adjust above and below spacing for main CTA for all themes
14
+ - Updated dependencies [31bf384]
15
+ - Updated dependencies [90e1f57]
16
+ - Updated dependencies [9811dfe]
17
+ - Updated dependencies [b144caf]
18
+ - Updated dependencies [1ccc1a3]
19
+ - Updated dependencies [a167261]
20
+ - @funkit/api-base@1.9.12
21
+ - @funkit/fun-relay@1.0.0
22
+ - @funkit/core@2.3.36
23
+ - @funkit/wagmi-tools@3.0.58
24
+
3
25
  ## 6.0.2
4
26
 
5
27
  ### Patch Changes
@@ -88,7 +88,7 @@ var blurs = {
88
88
  modalOverlay: "blur(8px)"
89
89
  },
90
90
  tiny: {
91
- modalOverlay: "blur(2px)"
91
+ modalOverlay: "blur(4px)"
92
92
  }
93
93
  };
94
94
  var DEFAULT_FONT_WEIGHTS = {
@@ -187,7 +187,7 @@ var baseTheme = ({
187
187
  spacing: {
188
188
  modalBaseHorizontalPadding: "6px",
189
189
  modalBottomHorizontalPadding: "12px",
190
- modalPaddingBottomUpper: "18px",
190
+ modalPaddingBottomUpper: "16px",
191
191
  modalPaddingBottomLower: "16px",
192
192
  modalTopBarVerticalTextSpacing: "0px",
193
193
  ...customSpacings
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  baseTheme
4
- } from "./chunk-IVQ57535.js";
4
+ } from "./chunk-7HKC2KCK.js";
5
5
 
6
6
  // src/themes/darkTheme.ts
7
7
  var accentColors = {
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  baseTheme
4
- } from "./chunk-IVQ57535.js";
4
+ } from "./chunk-7HKC2KCK.js";
5
5
 
6
6
  // src/themes/lightTheme.ts
7
7
  var accentColors = {
@@ -1,5 +1,9 @@
1
1
  export declare const SCROLL_BAR_WIDTH = 6;
2
2
  export declare const DIALOG_BOTTOM_PADDING = "15";
3
+ /**
4
+ * note the border defined here is taken into account in the FunCheckoutModalHeightAnimationWrapper component in the `getPermittedHeight` function
5
+ * adjusting the border width will require adjusting the `getPermittedHeight` function
6
+ */
3
7
  export declare const dialog: string;
4
8
  export declare const dialogCompact: string;
5
9
  export declare const dialogMedium: string;
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  import {
3
3
  darkTheme
4
- } from "./chunk-IOMUPAAW.js";
4
+ } from "./chunk-VQOGHHW2.js";
5
5
  import {
6
6
  lightTheme
7
- } from "./chunk-N6UWLAUQ.js";
7
+ } from "./chunk-ZAZGUX6Z.js";
8
8
  import {
9
9
  systemFontStack
10
- } from "./chunk-IVQ57535.js";
10
+ } from "./chunk-7HKC2KCK.js";
11
11
 
12
12
  // src/components/Dialog/DialogContent.css.ts
13
13
  var SCROLL_BAR_WIDTH = 6;
@@ -2490,8 +2490,26 @@ var flagConfig = {
2490
2490
  type: "isAnyOf",
2491
2491
  values: [
2492
2492
  "0x2A8Bd916E85d98d8175258De99fc0ddbcC102eF6",
2493
- "0x21b94a3E67c4a72d3D15f478A696c5175f036092"
2493
+ "0x21b94a3E67c4a72d3D15f478A696c5175f036092",
2494
2494
  // jianhe
2495
+ "0x9C64fD7d9826E6d552dD8bc53e5C96F7C3F38528",
2496
+ // panda
2497
+ "0x236c60C57a8B9ca563Fb0dA5199FDdCB686d91E8",
2498
+ // greg
2499
+ "0x2e0Fa1cE3F0F6a85542c1E4F941116c0E885292E",
2500
+ // adam
2501
+ "0x8a5505F1b274d8fC23986AF60Dd3Ca3857095BB8",
2502
+ // david
2503
+ "0x0B6E49e9D1528F59BaBF3C5337A4c96E987f81aa",
2504
+ // aaron (rainbow)
2505
+ "0x84Bc1AC5621d2B44C5D3e3E79b45C2885406026D",
2506
+ // hunter (evm)
2507
+ "0x0D0377aa9CCA769931821842aB0E1A75e7DD6dD6",
2508
+ // cheng-yu (evm)
2509
+ "0x7B0195921183f7E04f0D331c1DAF7C1bB208CC4E",
2510
+ // kurt (evm)
2511
+ "0xda6b07Eb94f699F511a943e9bFC12B64B7fe3486"
2512
+ // Alex
2495
2513
  ]
2496
2514
  },
2497
2515
  {
@@ -2808,41 +2826,13 @@ var flagConfig = {
2808
2826
  [FlagKey.RelayBypassTargetChainsAndAssets]: {
2809
2827
  type: "string",
2810
2828
  default_value: JSON.stringify({
2811
- // USDC.e on Polygon (PM)
2812
- 137: ["0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"],
2813
- // USDC on Arbitrum (OSTIUM)
2814
- 42161: ["0xaf88d065e77c8cC2239327C5EDb3A432268e5831"],
2815
- // Katana
2816
- 747474: [
2817
- NATIVE_TOKEN,
2818
- // ETH
2819
- "0x7f1f4b4b29f5058fa32cc7a97141b8d7e5abdc2d",
2820
- // KAT
2821
- "0xEE7D8BCFb72bC1880D0Cf19822eB0A2e6577aB62",
2822
- // vbETH
2823
- "0x203A662b0BD271A6ed5a60EdFbd04bFce608FD36",
2824
- // vbUSDC
2825
- "0x2DCa96907fde857dd3D816880A0df407eeB2D2F2",
2826
- // vbUSDT
2827
- "0x0913DA6Da4b42f538B445599b46Bb4622342Cf52",
2828
- // vbWBTC
2829
- "0x62D6A123E8D19d06d68cf0d2294F9A3A0362c6b3",
2830
- // vbUSDS
2831
- "0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a",
2832
- // AUSD
2833
- "0x9B8Df6E244526ab5F6e6400d331DB28C8fdDdb55",
2834
- // uSOL
2835
- "0xb0505e5a99abd03d94a1169e638B78EDfEd26ea4",
2836
- // uSUI
2837
- "0x2615a94df961278DcbC41Fb0a54fEc5f10a693aE",
2838
- // uXRP
2839
- "0x1e5eFCA3D0dB2c6d5C67a4491845c43253eB9e4e",
2840
- // MORPHO
2841
- "0x17BFF452dae47e07CeA877Ff0E1aba17eB62b0aB",
2842
- // SUSHI
2843
- "0x476eaCd417cD65421bD34fca054377658BB5E02b"
2844
- // YFI
2845
- ],
2829
+ 1: ["*"],
2830
+ 137: ["*"],
2831
+ 8453: ["*"],
2832
+ 42161: ["*"],
2833
+ 10: ["*"],
2834
+ 56: ["*"],
2835
+ 747474: ["*"],
2846
2836
  999: ["*"],
2847
2837
  2741: ["*"],
2848
2838
  1151111081099710: [
@@ -4460,6 +4450,7 @@ function generateSourceOfFundString({
4460
4450
  var FunCheckoutStartingStep = /* @__PURE__ */ ((FunCheckoutStartingStep2) => {
4461
4451
  FunCheckoutStartingStep2["SOURCE_CHANGE"] = "source_change";
4462
4452
  FunCheckoutStartingStep2["CONFIRMATION"] = "confirmation";
4453
+ FunCheckoutStartingStep2["SELECT_ASSET"] = "select_asset";
4463
4454
  return FunCheckoutStartingStep2;
4464
4455
  })(FunCheckoutStartingStep || {});
4465
4456
  var FunkitCheckoutContext = createContext10({
@@ -7653,7 +7644,8 @@ var FunBottomBar = ({
7653
7644
  type: "tertiary",
7654
7645
  height: "modalBottomBarButtonHeight",
7655
7646
  textSize: "modalBottomBarButtonText",
7656
- textWeight: "modalBottomBarButtonText"
7647
+ textWeight: "modalBottomBarButtonText",
7648
+ uppercase: uiCustomizations?.callToActionsUppercase
7657
7649
  }
7658
7650
  ), actionButtonProps && /* @__PURE__ */ React60.createElement(
7659
7651
  FunButton,
@@ -7662,8 +7654,8 @@ var FunBottomBar = ({
7662
7654
  borderRadius: customButtonRadius,
7663
7655
  height: "modalBottomBarButtonHeight",
7664
7656
  textSize: "modalBottomBarButtonText",
7665
- uppercase: uiCustomizations?.callToActionsUppercase,
7666
- textWeight: "modalBottomBarButtonText"
7657
+ textWeight: "modalBottomBarButtonText",
7658
+ uppercase: uiCustomizations?.callToActionsUppercase
7667
7659
  }
7668
7660
  )), bottomSectionComponent && /* @__PURE__ */ React60.createElement(Box, { paddingTop: "10" }, bottomSectionComponent));
7669
7661
  };
@@ -10697,7 +10689,7 @@ function FeeLineItem({
10697
10689
  content: tooltipText,
10698
10690
  tooltipPosition,
10699
10691
  enableDynamicPositioning: true,
10700
- maxWidth: tooltipWidth === "wide" ? 205 : void 0
10692
+ maxWidth: tooltipWidth === "wide" ? 250 : void 0
10701
10693
  },
10702
10694
  /* @__PURE__ */ React90.createElement(
10703
10695
  Box,
@@ -15153,9 +15145,6 @@ function useCheckoutQuoteNotification() {
15153
15145
  };
15154
15146
  }
15155
15147
 
15156
- // src/modals/CheckoutModal/stepTransition.ts
15157
- import { FlagKey as FlagKey31 } from "@funkit/utils";
15158
-
15159
15148
  // src/modals/CheckoutModal/VirtualFiatAccount/BridgeCustomer.tsx
15160
15149
  import React112 from "react";
15161
15150
 
@@ -18828,6 +18817,7 @@ var providerLabelMap = {
18828
18817
  ONRAMPMONEY: "Onramp Money",
18829
18818
  PAYBIS: "Paybis",
18830
18819
  RAMP: "Ramp",
18820
+ REVOLUT: "Revolut",
18831
18821
  ROBINHOOD: "Robinhood",
18832
18822
  SARDINE: "Sardine",
18833
18823
  SHIFT4: "Shift4",
@@ -20452,7 +20442,7 @@ function InputAmountLoaded({
20452
20442
  textCustomizations
20453
20443
  }) {
20454
20444
  const maxCheckoutUsdString = useFlag(FlagKey23.MaxCheckoutUsd);
20455
- const isSourceNavWidgetEnabled = useFlag(FlagKey23.EnableSourceNavigationWidget);
20445
+ const isSourceNavWidgetEnabled = modalState.startingStep === "select_asset" /* SELECT_ASSET */;
20456
20446
  const { paymentMethod } = modalState.paymentMethodInfo;
20457
20447
  const { quote: manuallySelectedQuote } = modalState;
20458
20448
  const isCardCheckout = paymentMethod === "card" /* CARD */;
@@ -20762,7 +20752,7 @@ function YouPayYouReceiveWrapper({
20762
20752
  }
20763
20753
 
20764
20754
  // src/modals/CheckoutModal/InputAmount/InputAmountLoading.tsx
20765
- import { FlagKey as FlagKey24, formatCryptoAndStringify as formatCryptoAndStringify6 } from "@funkit/utils";
20755
+ import { formatCryptoAndStringify as formatCryptoAndStringify6 } from "@funkit/utils";
20766
20756
  import React163, { useMemo as useMemo21 } from "react";
20767
20757
  function InputAmountLoading({
20768
20758
  modalState,
@@ -20772,7 +20762,7 @@ function InputAmountLoading({
20772
20762
  const { paymentMethodInfo } = modalState;
20773
20763
  const { checkoutItem } = useCheckoutContext();
20774
20764
  const meldEnabled = useIsMeldEnabled();
20775
- const isSourceNavWidgetEnabled = useFlag(FlagKey24.EnableSourceNavigationWidget);
20765
+ const isSourceNavWidgetEnabled = modalState.startingStep === "select_asset" /* SELECT_ASSET */;
20776
20766
  const targetAssetAmount = checkoutItem?.initSettings.config.targetAssetAmount;
20777
20767
  const targetAssetTicker = checkoutItem?.initSettings.config.targetAssetTicker;
20778
20768
  const error = useMemo21(() => {
@@ -20981,14 +20971,14 @@ import { mainnet as mainnet6, polygon as polygon6 } from "viem/chains";
20981
20971
  var ASSETS_LOW_VALUE_THRESHOLD2 = 0.1;
20982
20972
 
20983
20973
  // src/hooks/usePaymentSources.ts
20984
- import { FlagKey as FlagKey25, isNotNullish as isNotNullish8 } from "@funkit/utils";
20974
+ import { FlagKey as FlagKey24, isNotNullish as isNotNullish8 } from "@funkit/utils";
20985
20975
  function usePaymentMethodEnablement({
20986
20976
  checkoutConfig
20987
20977
  }) {
20988
20978
  const { apiKey, uiCustomizations } = useFunkitConfig();
20989
- const isTokenTransferFlagEnabled = useFlag(FlagKey25.EnableTokenTransfer);
20979
+ const isTokenTransferFlagEnabled = useFlag(FlagKey24.EnableTokenTransfer);
20990
20980
  const isFiatFlagEnabled = useFiatEnabled();
20991
- const isCardFlagEnabled = useFlag(FlagKey25.EnableCard);
20981
+ const isCardFlagEnabled = useFlag(FlagKey24.EnableCard);
20992
20982
  const isKatanaEarnFlowAction = isKatanaEarnFlow({ apiKey, checkoutConfig });
20993
20983
  const isUsKatanaUser = useIsUsKatanaUser();
20994
20984
  const isFiatEnabled = isFiatFlagEnabled && !isKatanaEarnFlowAction;
@@ -21200,13 +21190,20 @@ function FunAssetLoading({ count = 3 }) {
21200
21190
  var LoadingAccountInfo = {
21201
21191
  Component: LoadingAccount,
21202
21192
  onNext(state, payload) {
21203
- if (payload.startingStep === "confirmation" /* CONFIRMATION */ && payload.paymentMethodInfo) {
21193
+ if (state.startingStep === "confirmation" /* CONFIRMATION */ && payload.paymentMethodInfo) {
21204
21194
  return {
21205
21195
  ...state,
21206
21196
  step: "confirmation" /* CONFIRMATION */,
21207
21197
  paymentMethodInfo: payload.paymentMethodInfo
21208
21198
  };
21209
21199
  }
21200
+ if (state.startingStep === "select_asset" /* SELECT_ASSET */ && payload.chosenPaymentMethod === "balance" /* ACCOUNT_BALANCE */ && payload.paymentMethodInfo) {
21201
+ return {
21202
+ ...state,
21203
+ step: "select_asset" /* SELECT_ASSET */,
21204
+ paymentMethodInfo: payload.paymentMethodInfo
21205
+ };
21206
+ }
21210
21207
  switch (payload.chosenPaymentMethod) {
21211
21208
  case "balance" /* ACCOUNT_BALANCE */:
21212
21209
  case "brokerage" /* BROKERAGE */:
@@ -21243,7 +21240,7 @@ var hasSufficientAsset = (walletAssets, targetChainId, threshold = ASSETS_LOW_VA
21243
21240
  return (availableAmount ?? 0) >= threshold;
21244
21241
  });
21245
21242
  };
21246
- function handleSufficientAssetRedirect(isDefiMode, hasCustomStartingStep, isOstiumCustomer2, walletAddress, updateSelectedPaymentMethodInfo, onNext, checkoutConfig) {
21243
+ function handleSufficientAssetRedirect(isDefiMode, hasCustomStartingStep, isOstiumCustomer2, walletAddress, updateSelectedPaymentMethodInfo, onNext) {
21247
21244
  const paymentMethodInfo = createPaymentMethodInfo({
21248
21245
  paymentMethod: "balance" /* ACCOUNT_BALANCE */,
21249
21246
  walletAddress
@@ -21252,8 +21249,7 @@ function handleSufficientAssetRedirect(isDefiMode, hasCustomStartingStep, isOsti
21252
21249
  if (isDefiMode || hasCustomStartingStep || isOstiumCustomer2) {
21253
21250
  return onNext({
21254
21251
  chosenPaymentMethod: null,
21255
- paymentMethodInfo,
21256
- startingStep: checkoutConfig?.startingStep
21252
+ paymentMethodInfo
21257
21253
  });
21258
21254
  }
21259
21255
  return onNext({
@@ -21294,10 +21290,22 @@ function LoadingAccount({
21294
21290
  });
21295
21291
  const hasCustomStartingStep = !!checkoutConfig?.startingStep;
21296
21292
  const startsOnConfirmationStep = checkoutConfig?.startingStep === "confirmation" /* CONFIRMATION */;
21293
+ const startsOnSelectAssetStep = checkoutConfig?.startingStep === "select_asset" /* SELECT_ASSET */;
21297
21294
  useEffect38(() => {
21298
21295
  if (isLoadingFlags || isLoadingFiat || !checkoutConfig) {
21299
21296
  return;
21300
21297
  }
21298
+ if (startsOnSelectAssetStep) {
21299
+ const paymentMethodInfo = createPaymentMethodInfo({
21300
+ paymentMethod: "balance" /* ACCOUNT_BALANCE */,
21301
+ walletAddress
21302
+ });
21303
+ updateSelectedPaymentMethodInfo(paymentMethodInfo);
21304
+ return onNext({
21305
+ chosenPaymentMethod: "balance" /* ACCOUNT_BALANCE */,
21306
+ paymentMethodInfo
21307
+ });
21308
+ }
21301
21309
  if (!startsOnConfirmationStep) {
21302
21310
  return onNext({ chosenPaymentMethod: null });
21303
21311
  }
@@ -21309,8 +21317,7 @@ function LoadingAccount({
21309
21317
  isOstiumCustomer(apiKey),
21310
21318
  walletAddress,
21311
21319
  updateSelectedPaymentMethodInfo,
21312
- onNext,
21313
- checkoutConfig
21320
+ onNext
21314
21321
  );
21315
21322
  }
21316
21323
  if (isFetchingAssets) {
@@ -21328,6 +21335,7 @@ function LoadingAccount({
21328
21335
  }, [
21329
21336
  hasCustomStartingStep,
21330
21337
  startsOnConfirmationStep,
21338
+ startsOnSelectAssetStep,
21331
21339
  isDefiMode,
21332
21340
  isLoadingFlags,
21333
21341
  isLoadingFiat,
@@ -21654,11 +21662,7 @@ function MoonpaySetup({
21654
21662
 
21655
21663
  // src/modals/CheckoutModal/SelectAsset.tsx
21656
21664
  import { FUNKIT_CONNECT_SUPPORTED_CHECKOUT_CHAINS_INFO_LIST as FUNKIT_CONNECT_SUPPORTED_CHECKOUT_CHAINS_INFO_LIST2 } from "@funkit/chains";
21657
- import {
21658
- FlagKey as FlagKey27,
21659
- formatCurrencyAndStringify as formatCurrencyAndStringify12,
21660
- isTokenEquivalent as isTokenEquivalent6
21661
- } from "@funkit/utils";
21665
+ import { formatCurrencyAndStringify as formatCurrencyAndStringify12, isTokenEquivalent as isTokenEquivalent6 } from "@funkit/utils";
21662
21666
  import React174, { useEffect as useEffect40, useMemo as useMemo27, useState as useState45 } from "react";
21663
21667
  import { createPortal as createPortal11 } from "react-dom";
21664
21668
 
@@ -21755,13 +21759,13 @@ var ReceiveTokenDropdown = ({
21755
21759
 
21756
21760
  // src/components/NewTokenDepositAlert/NewTokenDepositAlert.tsx
21757
21761
  import React173 from "react";
21758
- import { FlagKey as FlagKey26, safeParseJson as safeParseJson5 } from "@funkit/utils";
21762
+ import { FlagKey as FlagKey25, safeParseJson as safeParseJson5 } from "@funkit/utils";
21759
21763
  var NewTokenDepositAlert = ({
21760
21764
  onClick
21761
21765
  }) => {
21762
- const alertJson = useFlag(FlagKey26.NewTokenAssetSelectionBanner);
21766
+ const alertJson = useFlag(FlagKey25.NewTokenAssetSelectionBanner);
21763
21767
  const alertData = safeParseJson5(alertJson);
21764
- const isTokenTransferEnabled = useFlag(FlagKey26.EnableTokenTransfer);
21768
+ const isTokenTransferEnabled = useFlag(FlagKey25.EnableTokenTransfer);
21765
21769
  if (!alertData || !isTokenTransferEnabled) {
21766
21770
  return null;
21767
21771
  }
@@ -22250,9 +22254,9 @@ var SelectAssetInfoSection = ({
22250
22254
  totalBalance,
22251
22255
  paymentMethodInfo,
22252
22256
  onSelectSource,
22253
- onTokenTransfer
22257
+ onTokenTransfer,
22258
+ isSourceNavWidgetEnabled
22254
22259
  }) => {
22255
- const isSourceNavWidgetEnabled = useFlag(FlagKey27.EnableSourceNavigationWidget);
22256
22260
  const { checkoutItem } = useCheckoutContext();
22257
22261
  const label = usePaymentMethodInfoLabel(paymentMethodInfo, 16);
22258
22262
  const isDefiMode = checkoutItem?.initSettings.config.isDefiMode;
@@ -22276,7 +22280,8 @@ function SelectWalletAsset({
22276
22280
  onFinish,
22277
22281
  onSelectSource,
22278
22282
  onTokenTransfer,
22279
- onClose
22283
+ onClose,
22284
+ isSourceNavWidgetEnabled
22280
22285
  }) {
22281
22286
  const { data, isLoading, totalBalance } = useWalletAssetHoldings(targetChainId);
22282
22287
  return /* @__PURE__ */ React174.createElement(React174.Fragment, null, /* @__PURE__ */ React174.createElement(
@@ -22285,7 +22290,8 @@ function SelectWalletAsset({
22285
22290
  paymentMethodInfo,
22286
22291
  totalBalance,
22287
22292
  onTokenTransfer,
22288
- onSelectSource
22293
+ onSelectSource,
22294
+ isSourceNavWidgetEnabled
22289
22295
  }
22290
22296
  ), /* @__PURE__ */ React174.createElement(
22291
22297
  MeshOrAccountSelectAsset,
@@ -22319,7 +22325,8 @@ function SelectAsset({
22319
22325
  onFinish: handleFinish,
22320
22326
  onSelectSource: handleSelectSource,
22321
22327
  onTokenTransfer: handleTokenTransfer,
22322
- onClose
22328
+ onClose,
22329
+ isSourceNavWidgetEnabled: modalState.startingStep === "select_asset" /* SELECT_ASSET */
22323
22330
  }
22324
22331
  ) : /* @__PURE__ */ React174.createElement(React174.Fragment, null));
22325
22332
  }
@@ -22720,7 +22727,6 @@ function SourceChange({
22720
22727
  }
22721
22728
 
22722
22729
  // src/modals/CheckoutModal/TransferToken/TransferToken.tsx
22723
- import { FlagKey as FlagKey29 } from "@funkit/utils";
22724
22730
  import { motion as motion9, useAnimationControls as useAnimationControls3 } from "motion/react";
22725
22731
  import React188, { useRef as useRef17, useState as useState51 } from "react";
22726
22732
  import { createPortal as createPortal13 } from "react-dom";
@@ -23406,13 +23412,13 @@ var TransferTokenDetails = ({
23406
23412
 
23407
23413
  // src/hooks/useTokenTransfer.ts
23408
23414
  import { solanaChain as solanaChain4 } from "@funkit/chains";
23409
- import { FlagKey as FlagKey28 } from "@funkit/utils";
23415
+ import { FlagKey as FlagKey26 } from "@funkit/utils";
23410
23416
  import { useMemo as useMemo29 } from "react";
23411
23417
  import { mainnet as mainnet8, polygon as polygon7 } from "viem/chains";
23412
23418
  var useTokenTransfer = (selectedChainId, selectedToken, chainIds) => {
23413
23419
  const { checkoutItem } = useCheckoutContext();
23414
23420
  const enableUniversal = useFlag(
23415
- FlagKey28.EnableTokenTransferUniversalDepositAddress,
23421
+ FlagKey26.EnableTokenTransferUniversalDepositAddress,
23416
23422
  false
23417
23423
  );
23418
23424
  const estPriceImpact = usePriceImpactEstimation(selectedToken);
@@ -23446,7 +23452,7 @@ var useTokenTransfer = (selectedChainId, selectedToken, chainIds) => {
23446
23452
  };
23447
23453
  var useMinTransferLimits = () => {
23448
23454
  const { userIpInfo } = useFunkitUserIp();
23449
- const minTransferValueJsonString = useFlag(FlagKey28.MinTokenTransferValue);
23455
+ const minTransferValueJsonString = useFlag(FlagKey26.MinTokenTransferValue);
23450
23456
  const minTransferValue = safeJSONParse(
23451
23457
  minTransferValueJsonString
23452
23458
  );
@@ -23526,7 +23532,7 @@ function TransferToken({
23526
23532
  }) {
23527
23533
  const controls = useAnimationControls3();
23528
23534
  const [qrCodeHover, setQrCodeHover] = useState51(false);
23529
- const isSourceNavWidgetEnabled = useFlag(FlagKey29.EnableSourceNavigationWidget);
23535
+ const isSourceNavWidgetEnabled = modalState.startingStep === "select_asset" /* SELECT_ASSET */;
23530
23536
  const { textCustomizations } = useFunkitConfig();
23531
23537
  const { checkoutItem } = useCheckoutContext();
23532
23538
  const checkoutConfig = checkoutItem?.initSettings.config;
@@ -23768,7 +23774,6 @@ function TransferToken({
23768
23774
  }
23769
23775
 
23770
23776
  // src/modals/CheckoutModal/VirtualFiatAccount/FiatAccountDetail.tsx
23771
- import { FlagKey as FlagKey30 } from "@funkit/utils";
23772
23777
  import React194, { useState as useState52 } from "react";
23773
23778
 
23774
23779
  // src/components/Tabs/Tabs.tsx
@@ -24053,7 +24058,7 @@ var AccountDetailsScreen = ({
24053
24058
  const label = usePaymentMethodInfoLabel(paymentMethodInfo);
24054
24059
  const { appName } = useFunkitConfig();
24055
24060
  const { animation, animate } = useAnimatedNavigation(void 0);
24056
- const isSourceNavWidgetEnabled = useFlag(FlagKey30.EnableSourceNavigationWidget);
24061
+ const isSourceNavWidgetEnabled = modalState.startingStep === "select_asset" /* SELECT_ASSET */;
24057
24062
  const [activeTab, setActiveTab] = useState52(0);
24058
24063
  const [detailsExpanded, setDetailsExpanded] = useState52(false);
24059
24064
  const { source_deposit_instructions: sourceDeposit } = matchingFiatAccount;
@@ -24287,7 +24292,8 @@ function extractCommonState(state) {
24287
24292
  checkoutId: state.checkoutId,
24288
24293
  targetChainId: state.targetChainId,
24289
24294
  isSoftHidden: state.isSoftHidden,
24290
- isDefiMode: state.isDefiMode
24295
+ isDefiMode: state.isDefiMode,
24296
+ startingStep: state.startingStep
24291
24297
  };
24292
24298
  }
24293
24299
  var CheckoutModalSteps = {
@@ -24325,7 +24331,8 @@ function initialState(checkoutItem) {
24325
24331
  checkoutId: checkoutItem.id,
24326
24332
  targetChainId: checkoutItem.initSettings.config.targetChain,
24327
24333
  isSoftHidden: false,
24328
- isDefiMode: !!checkoutItem.initSettings.config.isDefiMode
24334
+ isDefiMode: !!checkoutItem.initSettings.config.isDefiMode,
24335
+ startingStep: checkoutItem.initSettings.config.startingStep || "source_change" /* SOURCE_CHANGE */
24329
24336
  };
24330
24337
  }
24331
24338
  function useCheckoutModalTransition(checkoutItem, onClose) {
@@ -24432,7 +24439,7 @@ function useCheckoutModalTransition(checkoutItem, onClose) {
24432
24439
  }
24433
24440
  function useTitleConfig(checkoutItem, state) {
24434
24441
  const { apiKey, textCustomizations } = useFunkitConfig();
24435
- const isSourceNavWidgetEnabled = useFlag(FlagKey31.EnableSourceNavigationWidget);
24442
+ const isSourceNavWidgetEnabled = state.startingStep === "select_asset" /* SELECT_ASSET */;
24436
24443
  const {
24437
24444
  showFullHeight,
24438
24445
  disableBack = () => false,
@@ -24462,6 +24469,10 @@ var mapHeightToCheckoutStep = {
24462
24469
  ["confirmation" /* CONFIRMATION */]: 825,
24463
24470
  ["checkout_complete" /* CHECKOUT_COMPLETE */]: 825
24464
24471
  };
24472
+ function getPermittedHeight(checkoutStep) {
24473
+ const heightOffset = 2;
24474
+ return (checkoutStep ? mapHeightToCheckoutStep[checkoutStep] ?? DEFAULT_HEIGHT : DEFAULT_HEIGHT) - heightOffset;
24475
+ }
24465
24476
  function FunCheckoutModalHeightAnimationWrapper({
24466
24477
  children,
24467
24478
  checkoutStep
@@ -24475,7 +24486,7 @@ function FunCheckoutModalHeightAnimationWrapper({
24475
24486
  resizeObserverRef.current = new ResizeObserver((entries) => {
24476
24487
  animationFrameRef.current = requestAnimationFrame(() => {
24477
24488
  const requestedHeight = entries[0].contentRect.height;
24478
- const permittedHeight2 = checkoutStep ? mapHeightToCheckoutStep[checkoutStep] ?? DEFAULT_HEIGHT : DEFAULT_HEIGHT;
24489
+ const permittedHeight2 = getPermittedHeight(checkoutStep);
24479
24490
  setHeight(
24480
24491
  requestedHeight > permittedHeight2 ? permittedHeight2 : requestedHeight
24481
24492
  );
@@ -24490,7 +24501,7 @@ function FunCheckoutModalHeightAnimationWrapper({
24490
24501
  };
24491
24502
  }
24492
24503
  }, [checkoutStep]);
24493
- const permittedHeight = checkoutStep ? mapHeightToCheckoutStep[checkoutStep] ?? DEFAULT_HEIGHT : DEFAULT_HEIGHT;
24504
+ const permittedHeight = getPermittedHeight(checkoutStep);
24494
24505
  return /* @__PURE__ */ React196.createElement(
24495
24506
  motion11.div,
24496
24507
  {
@@ -28013,7 +28024,7 @@ function ChainModal({ onClose, open }) {
28013
28024
  // src/modals/CheckoutModal/FunCheckoutModal.tsx
28014
28025
  import { FUNKIT_CONNECT_SUPPORTED_CHECKOUT_CHAINS_INFO_LIST as FUNKIT_CONNECT_SUPPORTED_CHECKOUT_CHAINS_INFO_LIST3 } from "@funkit/chains";
28015
28026
  import { LogLevel, initializeRelayClient } from "@funkit/fun-relay";
28016
- import { FlagKey as FlagKey33 } from "@funkit/utils";
28027
+ import { FlagKey as FlagKey28 } from "@funkit/utils";
28017
28028
  import React247, { useRef as useRef26 } from "react";
28018
28029
 
28019
28030
  // src/components/FunCheckoutBlocked/FunCheckoutBlocked.tsx
@@ -28082,13 +28093,13 @@ var FunNotificationShowMoreButton = ({
28082
28093
  import {
28083
28094
  getCheckoutsByUserId as getCheckoutsByUserId2
28084
28095
  } from "@funkit/api-base";
28085
- import { FlagKey as FlagKey32 } from "@funkit/utils";
28096
+ import { FlagKey as FlagKey27 } from "@funkit/utils";
28086
28097
  import { useQuery as useQuery18 } from "@tanstack/react-query";
28087
28098
  var hasCorrectPaymentMethod = (checkout, paymentMethod) => !paymentMethod || checkout.clientMetadata.selectedPaymentMethodInfo?.paymentMethod === paymentMethod;
28088
28099
  var isRecent = (checkout, timestampCutoff) => checkout.createdTimeMs > timestampCutoff;
28089
28100
  var DEFAULT_NOTIF_CUTOFF = 7 * 24 * 60 * 60 * 1e3;
28090
28101
  function useCheckoutRefreshInterval() {
28091
- const str = useFlag(FlagKey32.CheckoutNotificationsRefreshInterval);
28102
+ const str = useFlag(FlagKey27.CheckoutNotificationsRefreshInterval);
28092
28103
  return safeJSONParse(str) || { listRefresh: 50 * 1e3, itemRefresh: 5 * 1e3 };
28093
28104
  }
28094
28105
  var useRecentCheckouts = ({
@@ -29256,7 +29267,7 @@ function FunCheckoutModalInner({
29256
29267
  const isBlocked = isUserGeoblocked || modalState.isBlocked;
29257
29268
  const hasBack = hasHistoryEntry && !disableBack;
29258
29269
  const checkoutConfig = checkoutItem.initSettings.config;
29259
- const helpButtonUrl = useFlag(FlagKey33.HelpTutorialUrl);
29270
+ const helpButtonUrl = useFlag(FlagKey28.HelpTutorialUrl);
29260
29271
  const { onScroll, topbar, withTopDivider } = useCustomStatusAnimationAboveTopbar({
29261
29272
  depositAddress: checkoutItem.depositAddress ?? void 0,
29262
29273
  isCheckoutDetailView: modalState.step === "checkout_complete" /* CHECKOUT_COMPLETE */,
@@ -31148,18 +31159,18 @@ function cssStringFromTheme(theme, options = {}) {
31148
31159
  }
31149
31160
 
31150
31161
  // src/hooks/useIsFunkitCheckoutActivated.ts
31151
- import { FlagKey as FlagKey34 } from "@funkit/utils";
31162
+ import { FlagKey as FlagKey29 } from "@funkit/utils";
31152
31163
  var useIsFunkitCheckoutActivated = () => {
31153
- const isCheckoutActivated = useFlag(FlagKey34.IsCheckoutActivated);
31164
+ const isCheckoutActivated = useFlag(FlagKey29.IsCheckoutActivated);
31154
31165
  return {
31155
31166
  isActivated: isCheckoutActivated
31156
31167
  };
31157
31168
  };
31158
31169
 
31159
31170
  // src/hooks/useFunkitMaxCheckoutUsdInfo.ts
31160
- import { FlagKey as FlagKey35, formatCurrencyAndStringify as formatCurrencyAndStringify17 } from "@funkit/utils";
31171
+ import { FlagKey as FlagKey30, formatCurrencyAndStringify as formatCurrencyAndStringify17 } from "@funkit/utils";
31161
31172
  var useFunkitMaxCheckoutUsdInfo = () => {
31162
- const maxCheckoutUsd = Number(useFlag(FlagKey35.MaxCheckoutUsd));
31173
+ const maxCheckoutUsd = Number(useFlag(FlagKey30.MaxCheckoutUsd));
31163
31174
  const limitText = maxCheckoutUsd === Number.MAX_VALUE ? "no" : formatCurrencyAndStringify17(maxCheckoutUsd, {
31164
31175
  decimalPrecisionForSuffix: 0,
31165
31176
  minimumSignificantDigits: 0,
@@ -31276,7 +31287,7 @@ function setFunkitConnectVersion({ version }) {
31276
31287
  localStorage.setItem(storageKey5, version);
31277
31288
  }
31278
31289
  function getCurrentSdkVersion() {
31279
- return "6.0.2";
31290
+ return "6.0.3";
31280
31291
  }
31281
31292
  function useFingerprint() {
31282
31293
  const fingerprint = useCallback50(() => {
@@ -1,12 +1,8 @@
1
1
  import React from 'react';
2
- import { FunCheckoutStartingStep } from '~/providers/FunkitCheckoutContext';
3
2
  import { type ConnectablePaymentMethodInfo, PaymentMethod, type PaymentMethodAccountInfo, type PaymentMethodBrokerageInfo, type PaymentMethodVirtualBankInfo } from '../../domains/paymentMethods';
4
3
  import { type CheckoutModalCommonState, FunCheckoutStep, type ModalStepComponentProps, type ModalStepInfo } from './stepTransition';
5
4
  export type LoadingAccountState = CheckoutModalCommonState;
6
- type UserEntryContext<T> = T & {
7
- startingStep?: FunCheckoutStartingStep;
8
- };
9
- export type LoadingAccountNext = UserEntryContext<{
5
+ export type LoadingAccountNext = {
10
6
  chosenPaymentMethod: PaymentMethod.ACCOUNT_BALANCE;
11
7
  paymentMethodInfo: PaymentMethodAccountInfo;
12
8
  } | {
@@ -19,8 +15,7 @@ export type LoadingAccountNext = UserEntryContext<{
19
15
  /** Can be set to null to skip auto payment method selection */
20
16
  chosenPaymentMethod: null | PaymentMethod.TOKEN_TRANSFER;
21
17
  paymentMethodInfo?: ConnectablePaymentMethodInfo;
22
- }>;
18
+ };
23
19
  export declare const LoadingAccountInfo: ModalStepInfo<FunCheckoutStep.LOADING_ACCOUNT>;
24
20
  /** A placeholder component to handle redirecting to the checkout history page */
25
21
  export declare function LoadingAccount({ modalState, onNext, }: ModalStepComponentProps<FunCheckoutStep.LOADING_ACCOUNT>): React.JSX.Element;
26
- export {};
@@ -3,7 +3,7 @@ import { type BridgeCustomerNext, type BridgeCustomerState } from '~/modals/Chec
3
3
  import { type BridgeKycNext, type BridgeKycState } from '~/modals/CheckoutModal/VirtualFiatAccount/BridgeKyc';
4
4
  import { type ErrorScreenState } from '~/modals/CheckoutModal/VirtualFiatAccount/ErrorScreen';
5
5
  import { type VirtualFiatAccountNext, type VirtualFiatAccountState } from '~/modals/CheckoutModal/VirtualFiatAccount/VirtualFiatAccount';
6
- import type { FunCheckoutStartingStep, FunkitActiveCheckoutItem } from '../../providers/FunkitCheckoutContext';
6
+ import { FunCheckoutStartingStep, type FunkitActiveCheckoutItem } from '../../providers/FunkitCheckoutContext';
7
7
  import { type FunkitTextCustomizationsConfig } from '../../providers/FunkitConfigContext';
8
8
  import { type CheckoutCompleteNext, type CheckoutCompleteState } from './CheckoutComplete/CheckoutComplete';
9
9
  import { type CheckoutHelpState } from './CheckoutHelp/CheckoutHelp';
@@ -27,6 +27,7 @@ export interface CheckoutModalCommonState {
27
27
  isBlocked?: boolean;
28
28
  /** Whether checkout is started in a defi mode which has various flow implications (most importantly targetAssetAmount must be set and is not editable throughout the checkout)*/
29
29
  isDefiMode: boolean;
30
+ startingStep: FunCheckoutStartingStep;
30
31
  targetChainId: string;
31
32
  }
32
33
  export interface ModalStepComponentProps<S extends FunCheckoutStep = FunCheckoutStep> {
@@ -18,7 +18,8 @@ export interface DynamicTargetAssetCandidate {
18
18
  }
19
19
  export declare enum FunCheckoutStartingStep {
20
20
  SOURCE_CHANGE = "source_change",
21
- CONFIRMATION = "confirmation"
21
+ CONFIRMATION = "confirmation",
22
+ SELECT_ASSET = "select_asset"
22
23
  }
23
24
  export interface FunkitCheckoutConfig extends Omit<ApiFunkitCheckoutConfig, 'generateActionsParams' | 'customRecipient' | 'modalTitle' | 'iconSrc' | 'modalTitleMeta' | 'externalCheckoutUserId'> {
24
25
  /** List of contract action params **/
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  baseTheme,
4
4
  systemFontStack
5
- } from "../chunk-IVQ57535.js";
5
+ } from "../chunk-7HKC2KCK.js";
6
6
  export {
7
7
  baseTheme,
8
8
  systemFontStack
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import {
3
3
  darkTheme
4
- } from "../chunk-IOMUPAAW.js";
5
- import "../chunk-IVQ57535.js";
4
+ } from "../chunk-VQOGHHW2.js";
5
+ import "../chunk-7HKC2KCK.js";
6
6
  export {
7
7
  darkTheme
8
8
  };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import {
3
3
  lightTheme
4
- } from "../chunk-N6UWLAUQ.js";
5
- import "../chunk-IVQ57535.js";
4
+ } from "../chunk-ZAZGUX6Z.js";
5
+ import "../chunk-7HKC2KCK.js";
6
6
  export {
7
7
  lightTheme
8
8
  };
@@ -1,13 +1,13 @@
1
1
  "use client";
2
+ import {
3
+ zerionWallet
4
+ } from "./chunk-SULRQO27.js";
2
5
  import {
3
6
  xdefiWallet
4
7
  } from "./chunk-BOU4WKRZ.js";
5
8
  import {
6
9
  zealWallet
7
10
  } from "./chunk-RNBEDQHF.js";
8
- import {
9
- zerionWallet
10
- } from "./chunk-SULRQO27.js";
11
11
  import {
12
12
  tahoWallet
13
13
  } from "./chunk-ZZZRUXZE.js";
@@ -26,45 +26,45 @@ import {
26
26
  import {
27
27
  trustWallet
28
28
  } from "./chunk-VYBAYMP3.js";
29
- import {
30
- walletConnectWallet
31
- } from "./chunk-NP5QGWNL.js";
32
29
  import {
33
30
  uniswapWallet
34
31
  } from "./chunk-LH7BMNFZ.js";
35
32
  import {
36
- phantomWallet
37
- } from "./chunk-362NXNTM.js";
33
+ walletConnectWallet
34
+ } from "./chunk-NP5QGWNL.js";
38
35
  import {
39
- rabbyWallet
40
- } from "./chunk-BBOM42DL.js";
36
+ oneInchWallet
37
+ } from "./chunk-OESTDX6I.js";
41
38
  import {
42
39
  rainbowWallet
43
40
  } from "./chunk-2KUBG3S6.js";
44
41
  import {
45
- roninWallet
46
- } from "./chunk-NWIQNBJU.js";
42
+ rabbyWallet
43
+ } from "./chunk-BBOM42DL.js";
47
44
  import {
48
45
  ramperWallet
49
46
  } from "./chunk-BYXPFMI7.js";
50
47
  import {
51
- safeWallet
52
- } from "./chunk-BQQQL6UD.js";
48
+ roninWallet
49
+ } from "./chunk-NWIQNBJU.js";
53
50
  import {
54
51
  safeheronWallet
55
52
  } from "./chunk-RZIO5TFF.js";
53
+ import {
54
+ safeWallet
55
+ } from "./chunk-BQQQL6UD.js";
56
56
  import {
57
57
  safepalWallet
58
58
  } from "./chunk-NT2HYJKW.js";
59
59
  import {
60
- mewWallet
61
- } from "./chunk-OL5ZO7E4.js";
60
+ metaMaskWallet
61
+ } from "./chunk-2HYNUNAS.js";
62
62
  import {
63
63
  ledgerWallet
64
64
  } from "./chunk-BRBKM4PW.js";
65
65
  import {
66
- kresusWallet
67
- } from "./chunk-MJXPRJZT.js";
66
+ mewWallet
67
+ } from "./chunk-OL5ZO7E4.js";
68
68
  import {
69
69
  oktoWallet
70
70
  } from "./chunk-ADIXAKUL.js";
@@ -74,24 +74,27 @@ import {
74
74
  import {
75
75
  omniWallet
76
76
  } from "./chunk-7CUY5G6R.js";
77
- import {
78
- oneInchWallet
79
- } from "./chunk-OESTDX6I.js";
80
77
  import {
81
78
  oneKeyWallet
82
79
  } from "./chunk-SHBUZ7U7.js";
80
+ import {
81
+ phantomWallet
82
+ } from "./chunk-362NXNTM.js";
83
83
  import {
84
84
  foxWallet
85
85
  } from "./chunk-7QONTUXT.js";
86
86
  import {
87
87
  frameWallet
88
88
  } from "./chunk-IFON7E6U.js";
89
+ import {
90
+ gateWallet
91
+ } from "./chunk-FKJJQNKX.js";
89
92
  import {
90
93
  frontierWallet
91
94
  } from "./chunk-TCAGNB4B.js";
92
95
  import {
93
- gateWallet
94
- } from "./chunk-FKJJQNKX.js";
96
+ kresusWallet
97
+ } from "./chunk-MJXPRJZT.js";
95
98
  import {
96
99
  imTokenWallet
97
100
  } from "./chunk-COZ7MIQS.js";
@@ -99,8 +102,8 @@ import {
99
102
  injectedWallet
100
103
  } from "./chunk-XWUJE7MW.js";
101
104
  import {
102
- metaMaskWallet
103
- } from "./chunk-2HYNUNAS.js";
105
+ coin98Wallet
106
+ } from "./chunk-OBOVHCEI.js";
104
107
  import {
105
108
  bybitWallet
106
109
  } from "./chunk-2STUC6QL.js";
@@ -111,14 +114,11 @@ import {
111
114
  coinbaseWallet
112
115
  } from "./chunk-H4IRCEZN.js";
113
116
  import {
114
- coin98Wallet
115
- } from "./chunk-OBOVHCEI.js";
117
+ coreWallet
118
+ } from "./chunk-VR4TBQ6S.js";
116
119
  import {
117
120
  dawnWallet
118
121
  } from "./chunk-HWPKCIBE.js";
119
- import {
120
- coreWallet
121
- } from "./chunk-VR4TBQ6S.js";
122
122
  import {
123
123
  enkryptWallet
124
124
  } from "./chunk-OLOIXTYS.js";
@@ -128,15 +128,15 @@ import {
128
128
  import {
129
129
  argentWallet
130
130
  } from "./chunk-WSQ2YJO2.js";
131
+ import {
132
+ bitgetWallet
133
+ } from "./chunk-TDAVGY5F.js";
131
134
  import {
132
135
  bifrostWallet
133
136
  } from "./chunk-A5N6B5UW.js";
134
137
  import {
135
138
  bitskiWallet
136
139
  } from "./chunk-HS3C7OQV.js";
137
- import {
138
- bitgetWallet
139
- } from "./chunk-TDAVGY5F.js";
140
140
  import {
141
141
  bitverseWallet
142
142
  } from "./chunk-3HZRRP4Y.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funkit/connect",
3
- "version": "6.0.2",
3
+ "version": "6.0.3",
4
4
  "description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
5
5
  "files": [
6
6
  "dist",
@@ -89,12 +89,12 @@
89
89
  "ua-parser-js": "^1.0.37",
90
90
  "use-debounce": "^10.0.5",
91
91
  "uuid": "^9.0.1",
92
- "@funkit/api-base": "1.9.11",
93
- "@funkit/core": "2.3.35",
94
- "@funkit/wagmi-tools": "3.0.57",
95
- "@funkit/utils": "1.1.8",
92
+ "@funkit/api-base": "1.9.12",
93
+ "@funkit/fun-relay": "1.0.0",
96
94
  "@funkit/chains": "0.3.7",
97
- "@funkit/fun-relay": "0.1.12"
95
+ "@funkit/utils": "1.1.8",
96
+ "@funkit/core": "2.3.36",
97
+ "@funkit/wagmi-tools": "3.0.58"
98
98
  },
99
99
  "repository": {
100
100
  "type": "git",