@funkit/connect 1.2.7 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 1.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 5417c66: fix: better handling & fallback for mesh get holdings error
8
+ - d3b6b3f: fix: 2FA input for email uses numeric keyboard
9
+ - cd5b2dd: refactor: disable mantle assets for payment
10
+ - cd5b2dd: feat: add new flag disable_mantle_source_assets
11
+ - 5417c66: refactor: deprecate allowBrokerageUnlinking config
12
+ - cf610d8: refactor: Clean up implementation of the FunInput component
13
+ - e2b9215: fix: cleanup logging
14
+ - Updated dependencies [e2b9215]
15
+ - @funkit/core@1.0.19
16
+ - @funkit/wagmi-tools@2.0.4
17
+
18
+ ## 1.3.0
19
+
20
+ ### Minor Changes
21
+
22
+ - 6c315a2: feat: enable checkout transfers
23
+
24
+ ### Patch Changes
25
+
26
+ - 5f70055: refactor: switch over to userId-based checkout apis
27
+ - 70d3eb8: fix: quote gas estimation error fallback
28
+ - 8e6f93f: feat: add flags select_payment_method_text, payment_method_copy_v1
29
+ - Updated dependencies [5f70055]
30
+ - Updated dependencies [5f70055]
31
+ - @funkit/api-base@0.0.5
32
+ - @funkit/core@1.0.18
33
+ - @funkit/wagmi-tools@2.0.3
34
+
3
35
  ## 1.2.7
4
36
 
5
37
  ### Patch Changes
@@ -3,10 +3,11 @@ import { FunCheckoutStep } from './FunCheckoutModal';
3
3
  /**
4
4
  * Based on which payment method was selected, allow users to select which asset they want to fund
5
5
  */
6
- export declare function FunCheckoutSelectAssetStep({ checkoutId, checkoutStep, onFinish, isOnFinishLoading, animateOut, }: {
6
+ export declare function FunCheckoutSelectAssetStep({ checkoutId, checkoutStep, onFinish, onBack, isOnFinishLoading, animateOut, }: {
7
7
  checkoutId: string | null;
8
8
  checkoutStep: FunCheckoutStep;
9
9
  isOnFinishLoading: boolean;
10
10
  onFinish: () => void;
11
+ onBack: () => void;
11
12
  animateOut?: boolean;
12
13
  }): React.JSX.Element;
@@ -24,6 +24,4 @@ export interface FunInputProps {
24
24
  textColor?: BoxProps['color'];
25
25
  overrideBorderWidth?: undefined | BoxProps['borderWidth'];
26
26
  }
27
- export declare function FunInputDefault({ prefix, prefixIcon, placeholder, value, label, onChange, onKeyDown, onKeySubmit, onPaste, onMouseDown, hasBackground, textColor, inputStyle, inputProps, error, focused: _focused, overrideBorderWidth, }: FunInputProps): React.JSX.Element;
28
- export declare const FunInputWithRef: React.ForwardRefExoticComponent<Omit<FunInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
29
- export declare function FunInput(props: FunInputProps): React.JSX.Element;
27
+ export declare const FunInput: React.ForwardRefExoticComponent<Omit<FunInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -36,8 +36,6 @@ interface FunkitAccountOptionsConfig {
36
36
  interface FunkitPaymentsConfig {
37
37
  /** If available, the specified payment method will be selected by default during checkout or deposits **/
38
38
  defaultPaymentMethod?: PaymentMethod | undefined;
39
- /** Whether end users are given the option to unlink a previously connected brokerage **/
40
- allowBrokerageUnlinking?: boolean;
41
39
  /** Max width of the title of each payment method **/
42
40
  paymentTitleMaxWidth?: BoxProps['maxWidth'];
43
41
  /** Payment method options styling **/
package/dist/index.js CHANGED
@@ -2,12 +2,12 @@
2
2
  import {
3
3
  en_US_default
4
4
  } from "./chunk-SW6GAS7K.js";
5
- import {
6
- lightTheme
7
- } from "./chunk-FRT63PFR.js";
8
5
  import {
9
6
  darkTheme
10
7
  } from "./chunk-ICLRFHOV.js";
8
+ import {
9
+ lightTheme
10
+ } from "./chunk-FRT63PFR.js";
11
11
  import "./chunk-I24HX4XM.js";
12
12
 
13
13
  // src/components/ConnectButton/ConnectButton.tsx
@@ -371,8 +371,54 @@ var flagConfig = {
371
371
  }
372
372
  ],
373
373
  value: true
374
+ },
375
+ {
376
+ if_any: [
377
+ {
378
+ key: "userId",
379
+ type: "pctRollout",
380
+ pct: 50
381
+ }
382
+ ],
383
+ value: true
374
384
  }
375
385
  ]
386
+ },
387
+ ["select_payment_method_text" /* SelectPaymentMethodText */]: {
388
+ type: "string",
389
+ default_value: "Select Payment Method",
390
+ overrides: [
391
+ {
392
+ if_any: [
393
+ {
394
+ key: "userId",
395
+ type: "pctRollout",
396
+ pct: 50
397
+ }
398
+ ],
399
+ value: "Pay With"
400
+ }
401
+ ]
402
+ },
403
+ ["payment_method_copy_v1" /* PaymentMethodCopyV1 */]: {
404
+ type: "boolean",
405
+ default_value: false,
406
+ overrides: [
407
+ {
408
+ if_any: [
409
+ {
410
+ key: "userId",
411
+ type: "pctRollout",
412
+ pct: 50
413
+ }
414
+ ],
415
+ value: true
416
+ }
417
+ ]
418
+ },
419
+ ["disable_mantle_source_assets" /* DisableMantleSourceAssets */]: {
420
+ type: "boolean",
421
+ default_value: true
376
422
  }
377
423
  };
378
424
 
@@ -469,10 +515,6 @@ var FeatureFlag = class {
469
515
  ])
470
516
  );
471
517
  this.userContext = userContext;
472
- logger.log("flag_deriveAllFlags", {
473
- flags: this.derivedFlags,
474
- userContext
475
- });
476
518
  datadogLogs2.setGlobalContextProperty("flags", this.derivedFlags);
477
519
  }
478
520
  deriveFlag(flagKey, flagConfig2, context) {
@@ -795,7 +837,6 @@ var DEFAULT_FUNKIT_CONFIG = {
795
837
  },
796
838
  accountModalConfig: { showUnknownTokens: false, allowDepositing: false },
797
839
  paymentsConfig: {
798
- allowBrokerageUnlinking: false,
799
840
  defaultPaymentMethod: void 0,
800
841
  paymentTitleMaxWidth: "240",
801
842
  methodsConfig: {
@@ -1070,7 +1111,7 @@ function FunkitConnectChainProvider({
1070
1111
  apiKey
1071
1112
  }).then(() => {
1072
1113
  logger.log("Core configured");
1073
- flags.init({
1114
+ void flags.init({
1074
1115
  apiKey
1075
1116
  });
1076
1117
  });
@@ -1696,6 +1737,7 @@ var useSymbolRefresh_default = useSymbolRefresh;
1696
1737
  // src/utils/assets.ts
1697
1738
  import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO } from "@funkit/core";
1698
1739
  import { formatUnits } from "viem";
1740
+ import { mantle } from "viem/chains";
1699
1741
 
1700
1742
  // src/hooks/useCheckoutType.ts
1701
1743
  function getCheckoutType(checkoutItem) {
@@ -1736,7 +1778,12 @@ var isAssetUsableToPayForCheckout = (checkoutItem, paymentMethod, assetChainId,
1736
1778
  const { isCheckoutPostActionRequired } = getCheckoutType(checkoutItem);
1737
1779
  const isSameAsPurchasingToken = !isCheckoutPostActionRequired && paymentMethod === "balance" /* ACCOUNT_BALANCE */ && checkoutItem.initSettings.config.targetChain === assetChainId && checkoutItem.initSettings.config.targetAsset.toLowerCase() === assetTokenAddress.toLowerCase();
1738
1780
  const isConnectedAccountSupported = isWeb2Login && FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO[assetChainId].isFunWalletSupported || isWeb3Login || !isWeb2Login && !isWeb3Login;
1739
- const isPickedChainSupportedForCheckout = isConnectedAccountSupported && FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO[assetChainId].isCheckoutSupported;
1781
+ const isMantleAssetsDisabled = flags.getBool(
1782
+ "disable_mantle_source_assets" /* DisableMantleSourceAssets */,
1783
+ true
1784
+ );
1785
+ const isAssetDisabled = isMantleAssetsDisabled && assetChainId === mantle.id.toString();
1786
+ const isPickedChainSupportedForCheckout = isConnectedAccountSupported && FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO[assetChainId].isCheckoutSupported && !isAssetDisabled;
1740
1787
  const isUsable = !isSameAsPurchasingToken && isPickedChainSupportedForCheckout;
1741
1788
  return {
1742
1789
  isUsable,
@@ -2154,7 +2201,7 @@ import {
2154
2201
  getAssetPriceInfo as getAssetPriceInfo2,
2155
2202
  getCheckoutByDepositAddress,
2156
2203
  getCheckoutQuote as getApiCheckoutQuote,
2157
- getCheckoutsByRecipientAddress,
2204
+ getCheckoutsByUserId,
2158
2205
  getMoonpayBuyQuoteForCreditCard,
2159
2206
  initializeCheckout as postApiInitializeCheckout,
2160
2207
  meshPreviewTransfer
@@ -2586,12 +2633,6 @@ function validateCheckoutConfig(config, isUserLoggedIn) {
2586
2633
  message: `Invalid customRecipient configuration: Has to be a valid address.`
2587
2634
  };
2588
2635
  }
2589
- if (config.customRecipient && isAddress(config.customRecipient) && isUserLoggedIn) {
2590
- return {
2591
- isValid: false,
2592
- message: `Invalid customRecipient configuration: Unsupported when a user is logged in.`
2593
- };
2594
- }
2595
2636
  if (config.customRecipient && !!config.actionsParams.length) {
2596
2637
  return {
2597
2638
  isValid: false,
@@ -2843,7 +2884,8 @@ function FunkitCheckoutProvider({ children }) {
2843
2884
  logoutSymbol,
2844
2885
  isWeb2Login,
2845
2886
  isWeb3Login,
2846
- isUserLoggedIn
2887
+ isUserLoggedIn,
2888
+ userInfo
2847
2889
  } = useGeneralWallet();
2848
2890
  const { switchChainAsync } = useFunkitSwitchChains({});
2849
2891
  const [activeCheckouts, setActiveCheckouts] = useState8({});
@@ -2870,9 +2912,9 @@ function FunkitCheckoutProvider({ children }) {
2870
2912
  let newCheckoutHistoryList = [];
2871
2913
  setIsRefreshingCheckoutHistory(true);
2872
2914
  if (isUserLoggedIn) {
2873
- logger.log("getCheckoutsByRecipientAddress");
2874
- newCheckoutHistoryList = await getCheckoutsByRecipientAddress({
2875
- recipientAddress: walletAddress,
2915
+ logger.log("getCheckoutsByUserId");
2916
+ newCheckoutHistoryList = await getCheckoutsByUserId({
2917
+ userId: userInfo.id,
2876
2918
  apiKey: funkitConfig.apiKey
2877
2919
  });
2878
2920
  } else if (isGuestUserOnCheckoutHistory) {
@@ -2897,7 +2939,8 @@ function FunkitCheckoutProvider({ children }) {
2897
2939
  historyDepositAddress,
2898
2940
  isGuestUserOnCheckoutHistory,
2899
2941
  isUserLoggedIn,
2900
- walletAddress
2942
+ walletAddress,
2943
+ userInfo
2901
2944
  ]);
2902
2945
  useEffect7(() => {
2903
2946
  if (isUserLoggedIn || isGuestUserOnCheckoutHistory) {
@@ -3156,6 +3199,7 @@ function FunkitCheckoutProvider({ children }) {
3156
3199
  ]);
3157
3200
  const inputCustomRecipient = checkoutItem.initSettings.config.customRecipient;
3158
3201
  const baseQuote = await getApiCheckoutQuote({
3202
+ userId: userInfo.id,
3159
3203
  fromChainId,
3160
3204
  fromTokenAddress,
3161
3205
  fromTokenDecimals,
@@ -3177,10 +3221,12 @@ function FunkitCheckoutProvider({ children }) {
3177
3221
  ...checkoutItem,
3178
3222
  quoteStepMessage: newPaymentMethodInfo.paymentMethod === "balance" /* ACCOUNT_BALANCE */ && isWeb2Login ? PENDING_QUOTE_MESSAGE_GENERATOR[3 /* FINALIZING */]() : newPaymentMethodInfo.paymentMethod === "balance" /* ACCOUNT_BALANCE */ && isWeb3Login ? PENDING_QUOTE_MESSAGE_GENERATOR[2 /* ESTIMATING_GAS */]() : PENDING_QUOTE_MESSAGE_GENERATOR[1 /* VERIFYING_PROVIDER */](newPaymentMethodInfo.title)
3179
3223
  };
3180
- setActiveCheckouts((prev) => ({
3181
- ...prev,
3182
- [checkoutId]: checkoutItem
3183
- }));
3224
+ setActiveCheckouts(
3225
+ (prev) => ({
3226
+ ...prev,
3227
+ [checkoutId]: checkoutItem
3228
+ })
3229
+ );
3184
3230
  }
3185
3231
  const newFinalDollarValue = baseQuote.estSubtotalUsd;
3186
3232
  const networkFeesUsdBreakdown = {
@@ -3199,26 +3245,32 @@ function FunkitCheckoutProvider({ children }) {
3199
3245
  if (newPaymentMethodInfo.paymentMethod === "balance" /* ACCOUNT_BALANCE */ && isWeb3Login && checkoutItem.selectedSourceAssetInfo.chainId !== zkSync.id.toString()) {
3200
3246
  let gasEstimateResult = BigInt(0);
3201
3247
  const isNativeTokenTransfer = checkoutItem.selectedSourceAssetInfo.address === NATIVE_TOKEN;
3202
- if (isNativeTokenTransfer) {
3203
- gasEstimateResult = await estimateGas(wagmiConfig, {
3204
- to: DUMMY_TRANSFER_PARAMS.toAddress,
3205
- chainId: parseInt(checkoutItem.selectedSourceAssetInfo.chainId),
3206
- value: BigInt(baseQuote.estTotalFromAmountBaseUnit)
3207
- });
3208
- } else {
3209
- gasEstimateResult = await estimateGas(wagmiConfig, {
3210
- to: checkoutItem.selectedSourceAssetInfo.address,
3211
- chainId: parseInt(checkoutItem.selectedSourceAssetInfo.chainId),
3212
- data: encodeFunctionData({
3213
- abi: erc20Abi,
3214
- functionName: "transfer",
3215
- args: [
3216
- DUMMY_TRANSFER_PARAMS.toAddress,
3217
- BigInt(baseQuote.estTotalFromAmountBaseUnit)
3218
- ]
3219
- })
3220
- });
3248
+ logger.log("gasEstimateResult:before", { gasEstimateResult });
3249
+ try {
3250
+ if (isNativeTokenTransfer) {
3251
+ gasEstimateResult = await estimateGas(wagmiConfig, {
3252
+ to: DUMMY_TRANSFER_PARAMS.toAddress,
3253
+ chainId: parseInt(checkoutItem.selectedSourceAssetInfo.chainId),
3254
+ value: BigInt(baseQuote.estTotalFromAmountBaseUnit)
3255
+ });
3256
+ } else {
3257
+ gasEstimateResult = await estimateGas(wagmiConfig, {
3258
+ to: checkoutItem.selectedSourceAssetInfo.address,
3259
+ chainId: parseInt(checkoutItem.selectedSourceAssetInfo.chainId),
3260
+ data: encodeFunctionData({
3261
+ abi: erc20Abi,
3262
+ functionName: "transfer",
3263
+ args: [
3264
+ DUMMY_TRANSFER_PARAMS.toAddress,
3265
+ BigInt(baseQuote.estTotalFromAmountBaseUnit)
3266
+ ]
3267
+ })
3268
+ });
3269
+ }
3270
+ } catch (err) {
3271
+ logger.error("_getCheckoutQuote:estimateGas:error", err);
3221
3272
  }
3273
+ logger.log("gasEstimateResult:after", { gasEstimateResult });
3222
3274
  const gasInEthAmount = GAS_ESTIMATE_MULTIPLER * parseFloat(formatEther(gasEstimateResult));
3223
3275
  networkFeesUsdBreakdown.networkFeesUsdFromEoaGas = await _calculateAssetUsdValue(
3224
3276
  checkoutItem.selectedSourceAssetInfo.chainId,
@@ -3346,10 +3398,12 @@ function FunkitCheckoutProvider({ children }) {
3346
3398
  quoteStepMessage: "",
3347
3399
  quoteErrorMessage: ""
3348
3400
  };
3349
- setActiveCheckouts((prev) => ({
3350
- ...prev,
3351
- [checkoutId]: checkoutItem
3352
- }));
3401
+ setActiveCheckouts(
3402
+ (prev) => ({
3403
+ ...prev,
3404
+ [checkoutId]: checkoutItem
3405
+ })
3406
+ );
3353
3407
  return true;
3354
3408
  } catch (err) {
3355
3409
  const generatedErrorIfAny = generateQuoteApiErrorForDisplay(err.message);
@@ -3357,16 +3411,18 @@ function FunkitCheckoutProvider({ children }) {
3357
3411
  generatedErrorIfAny,
3358
3412
  checkoutItem
3359
3413
  });
3360
- setActiveCheckouts((prev) => ({
3361
- ...prev,
3362
- [checkoutId]: {
3363
- ...checkoutItem,
3364
- isQuoting: false,
3365
- latestQuote: null,
3366
- quoteStepMessage: "",
3367
- quoteErrorMessage: generatedErrorIfAny ? generatedErrorIfAny : "An error occured while generating the quote. Please try again with a different payment method or payment asset."
3368
- }
3369
- }));
3414
+ setActiveCheckouts(
3415
+ (prev) => ({
3416
+ ...prev,
3417
+ [checkoutId]: {
3418
+ ...checkoutItem,
3419
+ isQuoting: false,
3420
+ latestQuote: null,
3421
+ quoteStepMessage: "",
3422
+ quoteErrorMessage: generatedErrorIfAny ? generatedErrorIfAny : "An error occured while generating the quote. Please try again with a different payment method or payment asset."
3423
+ }
3424
+ })
3425
+ );
3370
3426
  return false;
3371
3427
  }
3372
3428
  },
@@ -3377,7 +3433,8 @@ function FunkitCheckoutProvider({ children }) {
3377
3433
  isWeb2Login,
3378
3434
  isWeb3Login,
3379
3435
  wagmiConfig,
3380
- walletAddress
3436
+ walletAddress,
3437
+ userInfo
3381
3438
  ]
3382
3439
  );
3383
3440
  const _generateSignedBatchOperation = useCallback7(
@@ -4372,112 +4429,8 @@ var inputClassDisabled = "zue0i63 _1rsrm2fxv";
4372
4429
 
4373
4430
  // src/components/FunInput/FunInput.tsx
4374
4431
  var InputTextSize = "57px";
4375
- function FunInputDefault({
4376
- prefix,
4377
- prefixIcon,
4378
- placeholder,
4379
- value,
4380
- label,
4381
- onChange,
4382
- onKeyDown,
4383
- onKeySubmit,
4384
- onPaste,
4385
- onMouseDown,
4386
- hasBackground = true,
4387
- textColor = "modalTextSecondary",
4388
- inputStyle = {},
4389
- inputProps = {
4390
- type: "text"
4391
- },
4392
- error,
4393
- focused: _focused,
4394
- overrideBorderWidth
4395
- }) {
4396
- const { paymentsConfig } = useFunkitConfig();
4397
- const [focused, setFocused] = React29.useState(false);
4398
- const onFocus = () => setFocused(true);
4399
- const onBlur = () => setFocused(false);
4400
- return /* @__PURE__ */ React29.createElement(Box, {
4401
- color: "modalText",
4402
- display: "flex",
4403
- flexDirection: "column",
4404
- gap: "8",
4405
- width: "full"
4406
- }, label && /* @__PURE__ */ React29.createElement(Text, {
4407
- color: textColor,
4408
- size: "14",
4409
- weight: "medium"
4410
- }, label), /* @__PURE__ */ React29.createElement(Box, {
4411
- background: hasBackground ? "actionButtonSecondaryBackground" : void 0,
4412
- borderRadius: "connectButton",
4413
- fontFamily: "body",
4414
- minWidth: "full",
4415
- display: "flex",
4416
- color: textColor,
4417
- alignItems: "center",
4418
- borderColor: error ? "error" : focused && _focused ? "accentColor" : void 0,
4419
- borderWidth: overrideBorderWidth ? overrideBorderWidth : error && focused ? "2" : error ? "1" : focused && _focused ? "1" : "0",
4420
- borderStyle: "solid",
4421
- fontWeight: value ? "semibold" : "medium"
4422
- }, prefix ? /* @__PURE__ */ React29.createElement(Box, {
4423
- paddingLeft: paymentsConfig.optionsConfig.optionsPadding,
4424
- height: "max"
4425
- }, prefix) : null, prefixIcon && (prefixIcon === "SearchIcon" ? /* @__PURE__ */ React29.createElement(Box, {
4426
- display: "flex",
4427
- paddingLeft: paymentsConfig.optionsConfig.optionsPadding,
4428
- height: "max",
4429
- alignItems: "center"
4430
- }, /* @__PURE__ */ React29.createElement(SearchIcon, {
4431
- selected: focused
4432
- })) : prefixIcon === "$" ? /* @__PURE__ */ React29.createElement(Box, {
4433
- display: "flex",
4434
- alignItems: "center",
4435
- paddingLeft: "32"
4436
- }, /* @__PURE__ */ React29.createElement(Text, {
4437
- color: "modalText",
4438
- style: {
4439
- paddingBottom: 2,
4440
- fontSize: inputStyle.fontSize || InputTextSize,
4441
- fontWeight: 800
4442
- }
4443
- }, "$")) : void 0), /* @__PURE__ */ React29.createElement("input", {
4444
- type: (inputProps == null ? void 0 : inputProps.type) || "text",
4445
- value,
4446
- placeholder,
4447
- onChange: (e) => onChange(e),
4448
- onKeyDown: (e) => {
4449
- e.stopPropagation();
4450
- if (onKeyDown) {
4451
- onKeyDown(e);
4452
- }
4453
- if (e.key === "Enter" && onKeySubmit) {
4454
- onKeySubmit();
4455
- e.stopPropagation();
4456
- }
4457
- },
4458
- onPaste,
4459
- onMouseDown: (e) => {
4460
- if (onMouseDown) {
4461
- onMouseDown(e);
4462
- }
4463
- },
4464
- onFocus,
4465
- onBlur,
4466
- onWheel: (e) => e.currentTarget.blur(),
4467
- className: inputProps.disabled ? inputClassDisabled : inputClass,
4468
- ...inputProps,
4469
- style: {
4470
- fontWeight: "inherit",
4471
- ...inputStyle
4472
- }
4473
- })), error && typeof error === "string" && /* @__PURE__ */ React29.createElement(Text, {
4474
- color: "error",
4475
- size: "14",
4476
- weight: "medium"
4477
- }, error));
4478
- }
4479
- var FunInputWithRef = forwardRef2(
4480
- function FunInputWithRef2({
4432
+ var FunInput = forwardRef2(
4433
+ function FunInputWithRef({
4481
4434
  prefix,
4482
4435
  prefixIcon,
4483
4436
  placeholder,
@@ -4506,7 +4459,8 @@ var FunInputWithRef = forwardRef2(
4506
4459
  color: "modalText",
4507
4460
  display: "flex",
4508
4461
  flexDirection: "column",
4509
- gap: "8"
4462
+ gap: "8",
4463
+ width: "full"
4510
4464
  }, label && /* @__PURE__ */ React29.createElement(Text, {
4511
4465
  color: textColor,
4512
4466
  size: "14",
@@ -4515,6 +4469,7 @@ var FunInputWithRef = forwardRef2(
4515
4469
  background: hasBackground ? "actionButtonSecondaryBackground" : void 0,
4516
4470
  borderRadius: "connectButton",
4517
4471
  fontFamily: "body",
4472
+ minWidth: "full",
4518
4473
  display: "flex",
4519
4474
  color: textColor,
4520
4475
  alignItems: "center",
@@ -4547,7 +4502,7 @@ var FunInputWithRef = forwardRef2(
4547
4502
  ref,
4548
4503
  type: (inputProps == null ? void 0 : inputProps.type) || "text",
4549
4504
  value,
4550
- placeholder: placeholder == null ? void 0 : placeholder.toString(),
4505
+ placeholder,
4551
4506
  onChange: (e) => onChange(e),
4552
4507
  onKeyDown: (e) => {
4553
4508
  e.stopPropagation();
@@ -4558,7 +4513,6 @@ var FunInputWithRef = forwardRef2(
4558
4513
  onKeySubmit();
4559
4514
  }
4560
4515
  },
4561
- onWheel: (e) => e.currentTarget.blur(),
4562
4516
  onPaste,
4563
4517
  onMouseDown: (e) => {
4564
4518
  if (onMouseDown) {
@@ -4567,6 +4521,7 @@ var FunInputWithRef = forwardRef2(
4567
4521
  },
4568
4522
  onFocus,
4569
4523
  onBlur,
4524
+ onWheel: (e) => e.currentTarget.blur(),
4570
4525
  className: inputProps.disabled ? inputClassDisabled : inputClass,
4571
4526
  ...inputProps,
4572
4527
  style: {
@@ -4580,13 +4535,6 @@ var FunInputWithRef = forwardRef2(
4580
4535
  }, error));
4581
4536
  }
4582
4537
  );
4583
- function FunInput(props) {
4584
- return props.ref ? /* @__PURE__ */ React29.createElement(FunInputWithRef, {
4585
- ...props
4586
- }) : /* @__PURE__ */ React29.createElement(FunInputDefault, {
4587
- ...props
4588
- });
4589
- }
4590
4538
 
4591
4539
  // src/components/FunKeyValue/FunKeyValue.tsx
4592
4540
  import React30 from "react";
@@ -4722,7 +4670,7 @@ import {
4722
4670
  getTokenInfo as getTokenInfo2
4723
4671
  } from "@funkit/core";
4724
4672
  import React83, { useCallback as useCallback20, useEffect as useEffect20, useMemo as useMemo22, useState as useState23 } from "react";
4725
- import { arbitrum, mainnet as mainnet3, mantle, zkSync as zkSync2 } from "viem/chains";
4673
+ import { arbitrum, mainnet as mainnet3, mantle as mantle2, zkSync as zkSync2 } from "viem/chains";
4726
4674
 
4727
4675
  // src/hooks/useCheckoutAccountBalanceTransfer.ts
4728
4676
  import { useCallback as useCallback9 } from "react";
@@ -4835,38 +4783,38 @@ import {
4835
4783
  } from "@funkit/api-base";
4836
4784
  import { FUNKIT_CONNECT_SUPPORTED_CHAINS_ID_LIST } from "@funkit/core";
4837
4785
  var FUNKIT_MESH_CLIENT_ID = "8132aff4-56c9-4b1d-85b4-08dbdcc6199d";
4838
- var MeshExchanges = /* @__PURE__ */ ((MeshExchanges4) => {
4839
- MeshExchanges4["Robinhood"] = "Robinhood";
4840
- MeshExchanges4["ETrade"] = "ETrade";
4841
- MeshExchanges4["Alpaca"] = "Alpaca";
4842
- MeshExchanges4["WeBull"] = "WeBull";
4843
- MeshExchanges4["Stash"] = "Stash";
4844
- MeshExchanges4["InteractiveBrokers"] = "InteractiveBrokers";
4845
- MeshExchanges4["Public"] = "Public";
4846
- MeshExchanges4["Coinbase"] = "Coinbase";
4847
- MeshExchanges4["Kraken"] = "Kraken";
4848
- MeshExchanges4["CoinbasePro"] = "CoinbasePro";
4849
- MeshExchanges4["CryptoCom"] = "CryptoCom";
4850
- MeshExchanges4["Binance"] = "Binance";
4851
- MeshExchanges4["BinanceUs"] = "BinanceUs";
4852
- MeshExchanges4["Gemini"] = "Gemini";
4853
- MeshExchanges4["OkCoin"] = "OkCoin";
4854
- MeshExchanges4["KuCoin"] = "KuCoin";
4855
- MeshExchanges4["Etoro"] = "Etoro";
4856
- MeshExchanges4["CexIo"] = "CexIo";
4857
- MeshExchanges4["Bitstamp"] = "Bitstamp";
4858
- MeshExchanges4["GateIo"] = "GateIo";
4859
- MeshExchanges4["Acorns"] = "Acorns";
4860
- MeshExchanges4["Okx"] = "Okx";
4861
- MeshExchanges4["BitFlyer"] = "BitFlyer";
4862
- MeshExchanges4["Coinlist"] = "Coinlist";
4863
- MeshExchanges4["Huobi"] = "Huobi";
4864
- MeshExchanges4["Bitfinex"] = "Bitfinex";
4865
- MeshExchanges4["KrakenDirect"] = "KrakenDirect";
4866
- MeshExchanges4["Vanguard"] = "Vanguard";
4867
- MeshExchanges4["BitfinexDirect"] = "BitfinexDirect";
4868
- MeshExchanges4["Bybit"] = "Bybit";
4869
- return MeshExchanges4;
4786
+ var MeshExchanges = /* @__PURE__ */ ((MeshExchanges5) => {
4787
+ MeshExchanges5["Robinhood"] = "Robinhood";
4788
+ MeshExchanges5["ETrade"] = "ETrade";
4789
+ MeshExchanges5["Alpaca"] = "Alpaca";
4790
+ MeshExchanges5["WeBull"] = "WeBull";
4791
+ MeshExchanges5["Stash"] = "Stash";
4792
+ MeshExchanges5["InteractiveBrokers"] = "InteractiveBrokers";
4793
+ MeshExchanges5["Public"] = "Public";
4794
+ MeshExchanges5["Coinbase"] = "Coinbase";
4795
+ MeshExchanges5["Kraken"] = "Kraken";
4796
+ MeshExchanges5["CoinbasePro"] = "CoinbasePro";
4797
+ MeshExchanges5["CryptoCom"] = "CryptoCom";
4798
+ MeshExchanges5["Binance"] = "Binance";
4799
+ MeshExchanges5["BinanceUs"] = "BinanceUs";
4800
+ MeshExchanges5["Gemini"] = "Gemini";
4801
+ MeshExchanges5["OkCoin"] = "OkCoin";
4802
+ MeshExchanges5["KuCoin"] = "KuCoin";
4803
+ MeshExchanges5["Etoro"] = "Etoro";
4804
+ MeshExchanges5["CexIo"] = "CexIo";
4805
+ MeshExchanges5["Bitstamp"] = "Bitstamp";
4806
+ MeshExchanges5["GateIo"] = "GateIo";
4807
+ MeshExchanges5["Acorns"] = "Acorns";
4808
+ MeshExchanges5["Okx"] = "Okx";
4809
+ MeshExchanges5["BitFlyer"] = "BitFlyer";
4810
+ MeshExchanges5["Coinlist"] = "Coinlist";
4811
+ MeshExchanges5["Huobi"] = "Huobi";
4812
+ MeshExchanges5["Bitfinex"] = "Bitfinex";
4813
+ MeshExchanges5["KrakenDirect"] = "KrakenDirect";
4814
+ MeshExchanges5["Vanguard"] = "Vanguard";
4815
+ MeshExchanges5["BitfinexDirect"] = "BitfinexDirect";
4816
+ MeshExchanges5["Bybit"] = "Bybit";
4817
+ return MeshExchanges5;
4870
4818
  })(MeshExchanges || {});
4871
4819
  var EXCHANGE_NAME_TO_TYPE = {
4872
4820
  ["Robinhood" /* Robinhood */]: "robinhood",
@@ -5858,11 +5806,14 @@ var FunTwoFaInput = ({
5858
5806
  return /* @__PURE__ */ React50.createElement(Box, {
5859
5807
  key: i,
5860
5808
  style: { display: "flex", flex: 1 }
5861
- }, /* @__PURE__ */ React50.createElement(FunInputWithRef, {
5809
+ }, /* @__PURE__ */ React50.createElement(FunInput, {
5862
5810
  ref: (el) => inputRefs.current[i] = el,
5863
5811
  inputStyle: {
5864
5812
  textAlign: "center"
5865
5813
  },
5814
+ inputProps: {
5815
+ inputMode: "numeric"
5816
+ },
5866
5817
  value: value[i] || "",
5867
5818
  onChange: (e) => {
5868
5819
  e.stopPropagation();
@@ -6576,12 +6527,7 @@ function FunPaymentMeshType({
6576
6527
  gap: "24"
6577
6528
  }, (filteredOptions == null ? void 0 : filteredOptions.length) > 0 ? /* @__PURE__ */ React58.createElement(FunNotification, {
6578
6529
  type: hasMeshPreError ? "error" : "default",
6579
- description: hasMeshPreError ? meshPreError : hasActiveConnectionCheck(exchange) ? /* @__PURE__ */ React58.createElement("div", null, `You will be directed to your linked ${exchange} account.`, funkitConfig.paymentsConfig.allowBrokerageUnlinking ? /* @__PURE__ */ React58.createElement(FunLinkButton, {
6580
- text: "Unlink.",
6581
- color: "buttonPrimary",
6582
- textProps: { weight: "medium" },
6583
- onClick: () => unlinkBrokerage(exchange)
6584
- }) : null) : "You will be redirected to Mesh to securely link your account."
6530
+ description: hasMeshPreError ? meshPreError : hasActiveConnectionCheck(exchange) ? `You will be directed to your linked ${exchange} account.` : "You will be redirected to Mesh to securely link your account."
6585
6531
  }) : null, /* @__PURE__ */ React58.createElement(FunButton, {
6586
6532
  title: "Continue",
6587
6533
  onClick: onClickContinue,
@@ -7205,7 +7151,13 @@ var LightningIcon = ({ color }) => {
7205
7151
  var PAYMENT_METHOD_CONFIG = {
7206
7152
  ["balance" /* ACCOUNT_BALANCE */]: {
7207
7153
  label: DEFAULT_TEXT_CUSTOMIZATIONS.accountBalance,
7208
- labelDynamic: (textCustomizations, walletAddress) => `${textCustomizations.accountBalance}${walletAddress ? ` (${walletAddress})` : ""}`,
7154
+ labelDynamic: (textCustomizations, walletAddress) => {
7155
+ const walletSuffix = walletAddress ? ` (${walletAddress})` : "";
7156
+ if (textCustomizations.accountBalance !== DEFAULT_TEXT_CUSTOMIZATIONS.accountBalance) {
7157
+ return `${textCustomizations.accountBalance}${walletSuffix}`;
7158
+ }
7159
+ return flags.getBool("payment_method_copy_v1" /* PaymentMethodCopyV1 */, false) ? `Wallet${walletSuffix}` : `${textCustomizations.accountBalance}${walletSuffix}`;
7160
+ },
7209
7161
  timeIconDynamic: (color) => /* @__PURE__ */ React70.createElement(LightningIcon, {
7210
7162
  color
7211
7163
  }),
@@ -7216,7 +7168,12 @@ var PAYMENT_METHOD_CONFIG = {
7216
7168
  },
7217
7169
  ["card" /* CARD */]: {
7218
7170
  label: DEFAULT_TEXT_CUSTOMIZATIONS.debitOrCredit,
7219
- labelDynamic: (textCustomizations) => textCustomizations.debitOrCredit,
7171
+ labelDynamic: (textCustomizations) => {
7172
+ if (textCustomizations.debitOrCredit !== DEFAULT_TEXT_CUSTOMIZATIONS.debitOrCredit) {
7173
+ return textCustomizations.debitOrCredit;
7174
+ }
7175
+ return flags.getBool("payment_method_copy_v1" /* PaymentMethodCopyV1 */, false) ? "Card" : textCustomizations.debitOrCredit;
7176
+ },
7220
7177
  timeIconDynamic: (color) => /* @__PURE__ */ React70.createElement(ClockIcon, {
7221
7178
  color
7222
7179
  }),
@@ -7227,7 +7184,12 @@ var PAYMENT_METHOD_CONFIG = {
7227
7184
  },
7228
7185
  ["brokerage" /* BROKERAGE */]: {
7229
7186
  label: DEFAULT_TEXT_CUSTOMIZATIONS.brokerageOrExchange,
7230
- labelDynamic: (textCustomizations) => textCustomizations.brokerageOrExchange,
7187
+ labelDynamic: (textCustomizations) => {
7188
+ if (textCustomizations.brokerageOrExchange !== DEFAULT_TEXT_CUSTOMIZATIONS.brokerageOrExchange) {
7189
+ return textCustomizations.brokerageOrExchange;
7190
+ }
7191
+ return flags.getBool("payment_method_copy_v1" /* PaymentMethodCopyV1 */, false) ? "Exchange" : textCustomizations.brokerageOrExchange;
7192
+ },
7231
7193
  timeIconDynamic: (color) => /* @__PURE__ */ React70.createElement(ClockIcon, {
7232
7194
  color
7233
7195
  }),
@@ -7375,7 +7337,7 @@ function FunPaymentMethods({
7375
7337
  );
7376
7338
  const [isContinuing, setIsContinuing] = useState17(false);
7377
7339
  useWalletAssetsListener();
7378
- const { walletAssets, isWeb3Login, isWeb2Login } = useGeneralWallet();
7340
+ const { walletAssets, isWeb3Login, isWeb2Login, isUserLoggedIn } = useGeneralWallet();
7379
7341
  const {
7380
7342
  checkoutItem,
7381
7343
  reDraftSymbol,
@@ -7474,8 +7436,8 @@ function FunPaymentMethods({
7474
7436
  ]);
7475
7437
  const PaymentMethodListWithStatus = useMemo16(() => {
7476
7438
  return Object.keys(PAYMENT_METHOD_CONFIG).map((paymentMethod) => {
7477
- var _a2, _b2, _c2;
7478
- if (paymentFlow === 0 /* DEPOSIT */ && paymentMethod === "balance" /* ACCOUNT_BALANCE */ || paymentFlow === 1 /* CHECKOUT */ && paymentMethod === "transfer" /* TRANSFER */ || paymentFlow === 1 /* CHECKOUT */ && paymentMethod === "balance" /* ACCOUNT_BALANCE */ && !!((_b2 = (_a2 = checkoutItem == null ? void 0 : checkoutItem.initSettings) == null ? void 0 : _a2.config) == null ? void 0 : _b2.customRecipient) || paymentMethod === "otc" /* OTC */ && !((_c2 = paymentsConfig.otcConfig) == null ? void 0 : _c2.isEnabled)) {
7439
+ var _a2;
7440
+ if (paymentFlow === 0 /* DEPOSIT */ && paymentMethod === "balance" /* ACCOUNT_BALANCE */ || paymentFlow === 1 /* CHECKOUT */ && paymentMethod === "transfer" /* TRANSFER */ || paymentFlow === 1 /* CHECKOUT */ && paymentMethod === "balance" /* ACCOUNT_BALANCE */ && !isUserLoggedIn || paymentMethod === "otc" /* OTC */ && !((_a2 = paymentsConfig.otcConfig) == null ? void 0 : _a2.isEnabled)) {
7479
7441
  return {
7480
7442
  paymentMethod,
7481
7443
  status: false,
@@ -7531,6 +7493,15 @@ function FunPaymentMethods({
7531
7493
  });
7532
7494
  }
7533
7495
  }, [canContinue, onSelect, selectedOption]);
7496
+ const selectPaymentMethod = useMemo16(() => {
7497
+ if (textCustomizations.selectPaymentMethod !== DEFAULT_TEXT_CUSTOMIZATIONS.selectPaymentMethod) {
7498
+ return textCustomizations.selectPaymentMethod;
7499
+ }
7500
+ return flags.getString(
7501
+ "select_payment_method_text" /* SelectPaymentMethodText */,
7502
+ textCustomizations.selectPaymentMethod
7503
+ );
7504
+ }, [textCustomizations]);
7534
7505
  return /* @__PURE__ */ React70.createElement(Box, {
7535
7506
  display: "flex",
7536
7507
  flexDirection: "column",
@@ -7549,7 +7520,7 @@ function FunPaymentMethods({
7549
7520
  size: "18",
7550
7521
  weight: "semibold",
7551
7522
  color: "modalTextSecondary"
7552
- }, textCustomizations.selectPaymentMethod), /* @__PURE__ */ React70.createElement(Box, {
7523
+ }, selectPaymentMethod), /* @__PURE__ */ React70.createElement(Box, {
7553
7524
  id: "method-list",
7554
7525
  display: "flex",
7555
7526
  flexDirection: "column",
@@ -8757,6 +8728,8 @@ var SwitchIcon = () => {
8757
8728
  };
8758
8729
 
8759
8730
  // src/components/FunCheckoutModal/FunCheckoutInputAmountStep.tsx
8731
+ var USD_REGEX = /^\$?\d*(\.\d{0,2})?/;
8732
+ var ABSOLUTE_REGEX = /^\d*(\.\d{0,5})?/;
8760
8733
  function FunCheckoutInputAmountStep({
8761
8734
  checkoutId,
8762
8735
  onContinue,
@@ -8858,20 +8831,23 @@ function FunCheckoutInputAmountStep({
8858
8831
  value: amountInput === "" ? "" : isAmountInAbsolute ? amountInput : `$${amountInput}`,
8859
8832
  placeholder: isAmountInAbsolute ? "0.00000" : "$0.00",
8860
8833
  onChange: (newAmount) => {
8834
+ const regex = isAmountInAbsolute ? ABSOLUTE_REGEX : USD_REGEX;
8861
8835
  let newValue = newAmount.target.value;
8836
+ const match = newValue.match(regex);
8837
+ if (!match) {
8838
+ return;
8839
+ }
8840
+ newValue = match[0];
8862
8841
  if (!isAmountInAbsolute && newValue.startsWith("$")) {
8863
- if (newValue === "$") {
8864
- newValue = "";
8865
- } else if (newValue.length > 0) {
8866
- newValue = newValue.slice(1);
8867
- }
8842
+ newValue = newValue.slice(1);
8868
8843
  }
8869
8844
  setAmountInput(newValue);
8870
8845
  },
8871
8846
  inputProps: {
8872
8847
  type: isAmountInAbsolute ? "number" : "text",
8873
8848
  autoFocus: true,
8874
- disabled: isContinuing || unitPrice == null
8849
+ disabled: isContinuing || unitPrice == null,
8850
+ inputMode: "decimal"
8875
8851
  },
8876
8852
  inputStyle: {
8877
8853
  textAlign: "center",
@@ -9038,16 +9014,20 @@ function MeshOrAccountSelectAsset({
9038
9014
  checkoutId,
9039
9015
  checkoutStep,
9040
9016
  onFinish,
9017
+ onBack,
9041
9018
  isOnFinishLoading
9042
9019
  }) {
9043
9020
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
9044
9021
  const [accountHoldingsMap, setAccountHoldingsMap] = useState22({});
9045
9022
  const [isLoadingAssets, setIsLoadingAssets] = useState22(true);
9023
+ const [fetchAssetsError, setFetchAssetsError] = useState22("");
9024
+ const hasFetchAssetsError = !!fetchAssetsError;
9046
9025
  const [selectedChainTokenSymbol, setSelectedChainTokenSymbol] = useState22("");
9047
9026
  const { checkoutItem, updateSourceAsset } = useFunkitPreCheckoutInternal(checkoutId);
9048
9027
  const { isCheckoutCrFlow } = useCheckoutType(checkoutItem);
9049
9028
  const draftDollarValueNormalized = (checkoutItem == null ? void 0 : checkoutItem.draftDollarValue) || 0;
9050
9029
  const funkitConfig = useFunkitConfig();
9030
+ const { unlinkBrokerage } = useFunkitMesh({});
9051
9031
  const { fetchInfo: manualFetchNetworkInfo } = useMeshNetworkInfo(
9052
9032
  (_c = (_b = (_a = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _a.meta) == null ? void 0 : _b.accessToken) == null ? void 0 : _c.brokerName
9053
9033
  );
@@ -9057,7 +9037,7 @@ function MeshOrAccountSelectAsset({
9057
9037
  const { walletAssets, isWeb2Login, isWeb3Login } = useGeneralWallet();
9058
9038
  const generateAccountHoldingsMapForMesh = useCallback19(async () => {
9059
9039
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
9060
- if (funkitConfig == null ? void 0 : funkitConfig.apiKey) {
9040
+ try {
9061
9041
  const [cryptoHoldings, meshNetworkInfo] = await Promise.all([
9062
9042
  fetchMeshAccountCryptoHoldings({
9063
9043
  authToken: (_d2 = (_c2 = (_b2 = (_a2 = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _a2.meta) == null ? void 0 : _b2.accessToken) == null ? void 0 : _c2.accountTokens) == null ? void 0 : _d2[0].accessToken,
@@ -9124,8 +9104,13 @@ function MeshOrAccountSelectAsset({
9124
9104
  });
9125
9105
  logger.log("generateAccountHoldingsMapForMesh_itemMap", itemMap);
9126
9106
  return itemMap;
9107
+ } catch (err) {
9108
+ logger.error("generateAccountHoldingsMapForMesh:error", err);
9109
+ setFetchAssetsError(
9110
+ "Unable to retrieve your account balance. Please try re-linking your account."
9111
+ );
9112
+ return {};
9127
9113
  }
9128
- return {};
9129
9114
  }, [
9130
9115
  checkoutItem == null ? void 0 : checkoutItem.initSettings.config.targetChain,
9131
9116
  (_g = (_f = (_e = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _e.meta) == null ? void 0 : _f.accessToken) == null ? void 0 : _g.accountTokens,
@@ -9133,7 +9118,7 @@ function MeshOrAccountSelectAsset({
9133
9118
  funkitConfig == null ? void 0 : funkitConfig.apiKey,
9134
9119
  manualFetchNetworkInfo
9135
9120
  ]);
9136
- const generateAccountHoldingsMapForBalance = useCallback19(async () => {
9121
+ const generateAccountHoldingsMapForBalance = useCallback19(() => {
9137
9122
  var _a2, _b2;
9138
9123
  const itemMap = {};
9139
9124
  const checkoutTargetChainId = checkoutItem == null ? void 0 : checkoutItem.initSettings.config.targetChain;
@@ -9181,14 +9166,19 @@ function MeshOrAccountSelectAsset({
9181
9166
  if (paymentMethod === "brokerage" /* BROKERAGE */) {
9182
9167
  itemMap = await generateAccountHoldingsMapForMesh();
9183
9168
  } else if (paymentMethod === "balance" /* ACCOUNT_BALANCE */) {
9184
- itemMap = await generateAccountHoldingsMapForBalance();
9169
+ itemMap = generateAccountHoldingsMapForBalance();
9185
9170
  }
9186
9171
  setAccountHoldingsMap(itemMap);
9187
9172
  setIsLoadingAssets(false);
9188
9173
  }
9189
- fetchAccountHoldings().catch(
9190
- (reason) => logger.error("fetchAccountHoldings:error", reason)
9191
- );
9174
+ fetchAccountHoldings().catch((reason) => {
9175
+ logger.error("fetchAccountHoldings:error", reason);
9176
+ setFetchAssetsError(
9177
+ "Unable to retrieve your account balance. Please try again."
9178
+ );
9179
+ setAccountHoldingsMap({});
9180
+ setIsLoadingAssets(false);
9181
+ });
9192
9182
  }, [
9193
9183
  (_k = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _k.paymentMethod,
9194
9184
  manualFetchNetworkInfo,
@@ -9273,7 +9263,26 @@ function MeshOrAccountSelectAsset({
9273
9263
  } = useCheckoutQuoteNotification(checkoutId || "");
9274
9264
  const [insufficientAssetError, setInsufficientAssetError] = useState22("");
9275
9265
  const hasInsufficientAssetError = !!insufficientAssetError;
9276
- const showNotification = hasInsufficientAssetError || showQuoteNotification;
9266
+ const showNotification = hasFetchAssetsError || hasInsufficientAssetError || showQuoteNotification;
9267
+ const notificationDescription = useMemo21(() => {
9268
+ return hasFetchAssetsError ? /* @__PURE__ */ React81.createElement("div", null, fetchAssetsError, /* @__PURE__ */ React81.createElement(FunLinkButton, {
9269
+ text: "Unlink.",
9270
+ color: "buttonPrimary",
9271
+ textProps: { weight: "medium" },
9272
+ onClick: () => {
9273
+ var _a2, _b2, _c2;
9274
+ unlinkBrokerage(
9275
+ (_c2 = (_b2 = (_a2 = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _a2.meta) == null ? void 0 : _b2.accessToken) == null ? void 0 : _c2.brokerName
9276
+ );
9277
+ onBack();
9278
+ }
9279
+ })) : quoteNotificationMessage || insufficientAssetError;
9280
+ }, [
9281
+ hasFetchAssetsError,
9282
+ fetchAssetsError,
9283
+ quoteNotificationMessage,
9284
+ insufficientAssetError
9285
+ ]);
9277
9286
  useEffect19(() => {
9278
9287
  if (checkoutItem == null ? void 0 : checkoutItem.isDrafting) {
9279
9288
  setSelectedChainTokenSymbol("");
@@ -9326,8 +9335,8 @@ function MeshOrAccountSelectAsset({
9326
9335
  paddingBottom: showNotification ? "24" : "0"
9327
9336
  }, /* @__PURE__ */ React81.createElement(FunNotification, {
9328
9337
  isVisible: showNotification,
9329
- type: hasQuoteError ? "error" : "default",
9330
- description: quoteNotificationMessage || insufficientAssetError
9338
+ type: hasQuoteError || hasFetchAssetsError ? "error" : "default",
9339
+ description: notificationDescription
9331
9340
  })), /* @__PURE__ */ React81.createElement(FunButton, {
9332
9341
  type: "primary",
9333
9342
  title: "Continue",
@@ -9347,6 +9356,7 @@ function FunCheckoutSelectAssetStep({
9347
9356
  checkoutId,
9348
9357
  checkoutStep,
9349
9358
  onFinish,
9359
+ onBack,
9350
9360
  isOnFinishLoading,
9351
9361
  animateOut = false
9352
9362
  }) {
@@ -9363,6 +9373,7 @@ function FunCheckoutSelectAssetStep({
9363
9373
  ) ? /* @__PURE__ */ React81.createElement(MeshOrAccountSelectAsset, {
9364
9374
  isOnFinishLoading,
9365
9375
  onFinish,
9376
+ onBack,
9366
9377
  checkoutId,
9367
9378
  checkoutStep
9368
9379
  }) : /* @__PURE__ */ React81.createElement(Text, {
@@ -9668,7 +9679,7 @@ function FunCheckoutModal({
9668
9679
  const originalTargetChainId = checkoutItem == null ? void 0 : checkoutItem.initSettings.config.targetChain.toString();
9669
9680
  const moonpayChainId = [
9670
9681
  zkSync2.id.toString(),
9671
- mantle.id.toString()
9682
+ mantle2.id.toString()
9672
9683
  ].includes(originalTargetChainId) ? arbitrum.id.toString() : originalTargetChainId;
9673
9684
  const wethAddrOnTargetChain = (await getTokenInfo2("weth", moonpayChainId)).toLowerCase();
9674
9685
  const isTargetAssetEthOrWeth = [NATIVE_TOKEN, wethAddrOnTargetChain].includes(
@@ -9793,6 +9804,7 @@ function FunCheckoutModal({
9793
9804
  checkoutStep,
9794
9805
  isOnFinishLoading: isSourceAssetConfirming,
9795
9806
  onFinish: triggerSourceAssetConfirmedFn,
9807
+ onBack: titleConfig.onBack,
9796
9808
  animateOut
9797
9809
  }) : checkoutStep === "confirmation" /* CONFIRMATION */ ? /* @__PURE__ */ React83.createElement(FunCheckoutConfirmationStep, {
9798
9810
  checkoutId,
@@ -17284,7 +17296,7 @@ function setFunkitConnectVersion({ version }) {
17284
17296
  localStorage.setItem(storageKey6, version);
17285
17297
  }
17286
17298
  function getCurrentSdkVersion() {
17287
- return "1.2.7";
17299
+ return "1.3.1";
17288
17300
  }
17289
17301
  function useFingerprint() {
17290
17302
  const fingerprint = useCallback33(() => {
@@ -1,4 +1,4 @@
1
- import type { BooleanFlagConfig } from './types';
1
+ import type { BooleanFlagConfig, StringFlagConfig } from './types';
2
2
  /**
3
3
  * Remember that these values show up in our logs
4
4
  * Make sure the enum values are unique
@@ -6,9 +6,22 @@ import type { BooleanFlagConfig } from './types';
6
6
  */
7
7
  export declare enum FlagKey {
8
8
  /** Shows "or continue with" label on FunSignInStep */
9
- ConnectSignInShowSocialLabel = "connect_sign_in_show_social_label"
9
+ ConnectSignInShowSocialLabel = "connect_sign_in_show_social_label",
10
+ /** Custom text for the select payment method button */
11
+ SelectPaymentMethodText = "select_payment_method_text",
12
+ /**
13
+ * Changing the copy for each of three payment methods:
14
+ * - “Cross-Chain Swap” → Wallet
15
+ * - “Debit or Credit” → Card
16
+ * - “Brokerage or Exchange” → Exchange
17
+ */
18
+ PaymentMethodCopyV1 = "payment_method_copy_v1",
19
+ /** Whether mantle assets can be used as source asset for payment in `isAssetUsableToPayForCheckout` */
20
+ DisableMantleSourceAssets = "disable_mantle_source_assets"
10
21
  }
11
- /** @satisfies Record<FlagKey, FlagConfig> */
12
22
  export declare const flagConfig: {
13
23
  [FlagKey.ConnectSignInShowSocialLabel]: BooleanFlagConfig;
24
+ [FlagKey.SelectPaymentMethodText]: StringFlagConfig;
25
+ [FlagKey.PaymentMethodCopyV1]: BooleanFlagConfig;
26
+ [FlagKey.DisableMantleSourceAssets]: BooleanFlagConfig;
14
27
  };
@@ -3,5 +3,8 @@ import { FeatureFlag } from './impl';
3
3
  export { FlagKey };
4
4
  declare const singleton: FeatureFlag<{
5
5
  connect_sign_in_show_social_label: import("./types").BooleanFlagConfig;
6
+ select_payment_method_text: import("./types").StringFlagConfig;
7
+ payment_method_copy_v1: import("./types").BooleanFlagConfig;
8
+ disable_mantle_source_assets: import("./types").BooleanFlagConfig;
6
9
  }>;
7
10
  export declare const flags: Pick<typeof singleton, "init" | "getBool" | "getNumber" | "getString">;
@@ -1,61 +1,61 @@
1
1
  "use client";
2
+ import {
3
+ zealWallet
4
+ } from "./chunk-Z5QFIFDP.js";
2
5
  import {
3
6
  zerionWallet
4
7
  } from "./chunk-G4DNQN67.js";
5
- import {
6
- walletConnectWallet
7
- } from "./chunk-ASPRR7T3.js";
8
- import {
9
- subWallet
10
- } from "./chunk-WS4EM7AZ.js";
11
- import {
12
- tokenPocketWallet
13
- } from "./chunk-UWU574XS.js";
14
8
  import {
15
9
  talismanWallet
16
10
  } from "./chunk-R2GYJ376.js";
17
11
  import {
18
- tokenaryWallet
19
- } from "./chunk-MD5OPFAT.js";
12
+ tahoWallet
13
+ } from "./chunk-PILSRRPJ.js";
20
14
  import {
21
- imTokenWallet
22
- } from "./chunk-5MVV7OVS.js";
15
+ subWallet
16
+ } from "./chunk-WS4EM7AZ.js";
23
17
  import {
24
18
  trustWallet
25
19
  } from "./chunk-BMHNXJZK.js";
26
20
  import {
27
21
  uniswapWallet
28
22
  } from "./chunk-XRSY4JVH.js";
23
+ import {
24
+ walletConnectWallet
25
+ } from "./chunk-ASPRR7T3.js";
26
+ import {
27
+ tokenaryWallet
28
+ } from "./chunk-MD5OPFAT.js";
29
29
  import {
30
30
  xdefiWallet
31
31
  } from "./chunk-JNZ3EYC7.js";
32
32
  import {
33
- zealWallet
34
- } from "./chunk-Z5QFIFDP.js";
33
+ tokenPocketWallet
34
+ } from "./chunk-UWU574XS.js";
35
+ import {
36
+ rabbyWallet
37
+ } from "./chunk-5SIHQ5GA.js";
35
38
  import {
36
39
  ramperWallet
37
40
  } from "./chunk-XEZPRJPV.js";
38
41
  import {
39
- roninWallet
40
- } from "./chunk-CNTLU4ZV.js";
42
+ rainbowWallet
43
+ } from "./chunk-EXN2ODSI.js";
44
+ import {
45
+ safepalWallet
46
+ } from "./chunk-PQSJXOGA.js";
47
+ import {
48
+ oneKeyWallet
49
+ } from "./chunk-QS2J6MWB.js";
41
50
  import {
42
51
  safeWallet
43
52
  } from "./chunk-D3DCQ72J.js";
44
53
  import {
45
- phantomWallet
46
- } from "./chunk-4PTY6XNU.js";
54
+ roninWallet
55
+ } from "./chunk-CNTLU4ZV.js";
47
56
  import {
48
57
  safeheronWallet
49
58
  } from "./chunk-FQDX6QIP.js";
50
- import {
51
- safepalWallet
52
- } from "./chunk-PQSJXOGA.js";
53
- import {
54
- oneInchWallet
55
- } from "./chunk-LCPIZUR3.js";
56
- import {
57
- tahoWallet
58
- } from "./chunk-PILSRRPJ.js";
59
59
  import {
60
60
  metaMaskWallet
61
61
  } from "./chunk-TUK3HNKY.js";
@@ -63,65 +63,65 @@ import {
63
63
  okxWallet
64
64
  } from "./chunk-5ZGE5SN5.js";
65
65
  import {
66
- mewWallet
67
- } from "./chunk-ZCSUP7CX.js";
66
+ imTokenWallet
67
+ } from "./chunk-5MVV7OVS.js";
68
+ import {
69
+ oneInchWallet
70
+ } from "./chunk-LCPIZUR3.js";
68
71
  import {
69
72
  omniWallet
70
73
  } from "./chunk-SVN7OEQR.js";
71
- import {
72
- oneKeyWallet
73
- } from "./chunk-QS2J6MWB.js";
74
74
  import {
75
75
  oktoWallet
76
76
  } from "./chunk-WKHTUEF5.js";
77
77
  import {
78
- rabbyWallet
79
- } from "./chunk-5SIHQ5GA.js";
78
+ mewWallet
79
+ } from "./chunk-ZCSUP7CX.js";
80
80
  import {
81
- rainbowWallet
82
- } from "./chunk-EXN2ODSI.js";
81
+ phantomWallet
82
+ } from "./chunk-4PTY6XNU.js";
83
83
  import {
84
84
  foxWallet
85
85
  } from "./chunk-TKXMLZXG.js";
86
86
  import {
87
87
  frameWallet
88
88
  } from "./chunk-HXGBE5AH.js";
89
- import {
90
- frontierWallet
91
- } from "./chunk-LOEDYNWO.js";
92
89
  import {
93
90
  gateWallet
94
91
  } from "./chunk-QGQISKXF.js";
92
+ import {
93
+ injectedWallet
94
+ } from "./chunk-GUJHPWTU.js";
95
95
  import {
96
96
  kresusWallet
97
97
  } from "./chunk-X6T3CICZ.js";
98
+ import {
99
+ frontierWallet
100
+ } from "./chunk-LOEDYNWO.js";
98
101
  import {
99
102
  ledgerWallet
100
103
  } from "./chunk-Y6VY6E3L.js";
101
104
  import {
102
- injectedWallet
103
- } from "./chunk-GUJHPWTU.js";
104
- import {
105
- clvWallet
106
- } from "./chunk-ND5YG63V.js";
107
- import {
108
- bybitWallet
109
- } from "./chunk-ZBQT5PV6.js";
105
+ coin98Wallet
106
+ } from "./chunk-3QXMJHL4.js";
110
107
  import {
111
108
  coinbaseWallet
112
109
  } from "./chunk-O77H3VWW.js";
113
- import {
114
- coin98Wallet
115
- } from "./chunk-3QXMJHL4.js";
116
110
  import {
117
111
  coreWallet
118
112
  } from "./chunk-32O7HVBJ.js";
119
113
  import {
120
- desigWallet
121
- } from "./chunk-P4C7ZHIS.js";
114
+ bitverseWallet
115
+ } from "./chunk-NL4I7WOT.js";
116
+ import {
117
+ bybitWallet
118
+ } from "./chunk-ZBQT5PV6.js";
122
119
  import {
123
120
  dawnWallet
124
121
  } from "./chunk-QUFNIKMV.js";
122
+ import {
123
+ desigWallet
124
+ } from "./chunk-P4C7ZHIS.js";
125
125
  import {
126
126
  enkryptWallet
127
127
  } from "./chunk-SJWHYD45.js";
@@ -137,17 +137,17 @@ import {
137
137
  import {
138
138
  bitskiWallet
139
139
  } from "./chunk-IMZRCMZR.js";
140
- import {
141
- bitverseWallet
142
- } from "./chunk-NL4I7WOT.js";
143
140
  import {
144
141
  bloomWallet
145
142
  } from "./chunk-NTGZF5BY.js";
146
143
  import "./chunk-ZOLACFTK.js";
147
- import "./chunk-ZDU3JFGR.js";
148
144
  import {
149
145
  braveWallet
150
146
  } from "./chunk-KJWMF6GZ.js";
147
+ import {
148
+ clvWallet
149
+ } from "./chunk-ND5YG63V.js";
150
+ import "./chunk-ZDU3JFGR.js";
151
151
  import "./chunk-F3VCNZXS.js";
152
152
  export {
153
153
  argentWallet,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funkit/connect",
3
- "version": "1.2.7",
3
+ "version": "1.3.1",
4
4
  "description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
5
5
  "files": [
6
6
  "dist",
@@ -69,19 +69,19 @@
69
69
  "@tanstack/react-query": "^5.28.8",
70
70
  "@types/node-fetch": "^2.6.4",
71
71
  "@types/uuid": "^9.0.8",
72
- "@vanilla-extract/css": "1.14.0",
72
+ "@vanilla-extract/css": "1.15.3",
73
73
  "@vanilla-extract/dynamic": "2.1.0",
74
74
  "@vanilla-extract/sprinkles": "1.6.1",
75
75
  "@wagmi/core": "^2.10.2",
76
- "clsx": "2.1.0",
76
+ "clsx": "2.1.1",
77
77
  "node-fetch": "^2.7.0",
78
78
  "qrcode": "1.5.3",
79
79
  "react-remove-scroll": "2.5.7",
80
80
  "ua-parser-js": "^1.0.37",
81
81
  "uuid": "^9.0.1",
82
- "@funkit/api-base": "0.0.4",
83
- "@funkit/wagmi-tools": "2.0.2",
84
- "@funkit/core": "1.0.17"
82
+ "@funkit/api-base": "0.0.5",
83
+ "@funkit/wagmi-tools": "2.0.4",
84
+ "@funkit/core": "1.0.19"
85
85
  },
86
86
  "repository": {
87
87
  "type": "git",