@funkit/connect 1.3.0 → 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.
Files changed (47) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/components/FunCheckoutModal/FunCheckoutSelectAssetStep.d.ts +2 -1
  3. package/dist/components/FunInput/FunInput.d.ts +1 -3
  4. package/dist/components/FunkitProvider/FunkitConfigContext.d.ts +0 -2
  5. package/dist/index.js +126 -181
  6. package/dist/utils/flags/config.d.ts +4 -1
  7. package/dist/utils/flags/index.d.ts +1 -0
  8. package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
  9. package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
  10. package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
  11. package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
  12. package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
  13. package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
  14. package/dist/wallets/walletConnectors/dawnWallet/dawnWallet.js +2 -2
  15. package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
  16. package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
  17. package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
  18. package/dist/wallets/walletConnectors/index.js +78 -78
  19. package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
  20. package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
  21. package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
  22. package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
  23. package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
  24. package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
  25. package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
  26. package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
  27. package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
  28. package/package.json +3 -3
  29. package/dist/wallets/walletConnectors/chunk-2DWBVWFI.js +0 -87
  30. package/dist/wallets/walletConnectors/chunk-32KBKKGT.js +0 -182
  31. package/dist/wallets/walletConnectors/chunk-3CLNL7LR.js +0 -73
  32. package/dist/wallets/walletConnectors/chunk-5L2OLU3J.js +0 -102
  33. package/dist/wallets/walletConnectors/chunk-7GGRZNT3.js +0 -96
  34. package/dist/wallets/walletConnectors/chunk-7YDZTPO4.js +0 -100
  35. package/dist/wallets/walletConnectors/chunk-BCXBFAL4.js +0 -98
  36. package/dist/wallets/walletConnectors/chunk-CMXZK5RR.js +0 -94
  37. package/dist/wallets/walletConnectors/chunk-F4EJ42XO.js +0 -105
  38. package/dist/wallets/walletConnectors/chunk-FL2VIO76.js +0 -71
  39. package/dist/wallets/walletConnectors/chunk-IIJOJ6AD.js +0 -102
  40. package/dist/wallets/walletConnectors/chunk-KZFAL4RZ.js +0 -27
  41. package/dist/wallets/walletConnectors/chunk-LJRV5JY7.js +0 -95
  42. package/dist/wallets/walletConnectors/chunk-M4SPCKW4.js +0 -66
  43. package/dist/wallets/walletConnectors/chunk-MSRKKVDE.js +0 -98
  44. package/dist/wallets/walletConnectors/chunk-NK3DYIAB.js +0 -92
  45. package/dist/wallets/walletConnectors/chunk-OMKARG6Y.js +0 -94
  46. package/dist/wallets/walletConnectors/chunk-R5GNFRXW.js +0 -96
  47. package/dist/wallets/walletConnectors/chunk-XB2GFXBL.js +0 -107
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
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
+
3
18
  ## 1.3.0
4
19
 
5
20
  ### Minor 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
@@ -371,6 +371,16 @@ 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
  ]
376
386
  },
@@ -399,12 +409,16 @@ var flagConfig = {
399
409
  {
400
410
  key: "userId",
401
411
  type: "pctRollout",
402
- pct: 100
412
+ pct: 50
403
413
  }
404
414
  ],
405
415
  value: true
406
416
  }
407
417
  ]
418
+ },
419
+ ["disable_mantle_source_assets" /* DisableMantleSourceAssets */]: {
420
+ type: "boolean",
421
+ default_value: true
408
422
  }
409
423
  };
410
424
 
@@ -501,10 +515,6 @@ var FeatureFlag = class {
501
515
  ])
502
516
  );
503
517
  this.userContext = userContext;
504
- logger.log("flag_deriveAllFlags", {
505
- flags: this.derivedFlags,
506
- userContext
507
- });
508
518
  datadogLogs2.setGlobalContextProperty("flags", this.derivedFlags);
509
519
  }
510
520
  deriveFlag(flagKey, flagConfig2, context) {
@@ -827,7 +837,6 @@ var DEFAULT_FUNKIT_CONFIG = {
827
837
  },
828
838
  accountModalConfig: { showUnknownTokens: false, allowDepositing: false },
829
839
  paymentsConfig: {
830
- allowBrokerageUnlinking: false,
831
840
  defaultPaymentMethod: void 0,
832
841
  paymentTitleMaxWidth: "240",
833
842
  methodsConfig: {
@@ -1728,6 +1737,7 @@ var useSymbolRefresh_default = useSymbolRefresh;
1728
1737
  // src/utils/assets.ts
1729
1738
  import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO } from "@funkit/core";
1730
1739
  import { formatUnits } from "viem";
1740
+ import { mantle } from "viem/chains";
1731
1741
 
1732
1742
  // src/hooks/useCheckoutType.ts
1733
1743
  function getCheckoutType(checkoutItem) {
@@ -1768,7 +1778,12 @@ var isAssetUsableToPayForCheckout = (checkoutItem, paymentMethod, assetChainId,
1768
1778
  const { isCheckoutPostActionRequired } = getCheckoutType(checkoutItem);
1769
1779
  const isSameAsPurchasingToken = !isCheckoutPostActionRequired && paymentMethod === "balance" /* ACCOUNT_BALANCE */ && checkoutItem.initSettings.config.targetChain === assetChainId && checkoutItem.initSettings.config.targetAsset.toLowerCase() === assetTokenAddress.toLowerCase();
1770
1780
  const isConnectedAccountSupported = isWeb2Login && FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO[assetChainId].isFunWalletSupported || isWeb3Login || !isWeb2Login && !isWeb3Login;
1771
- 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;
1772
1787
  const isUsable = !isSameAsPurchasingToken && isPickedChainSupportedForCheckout;
1773
1788
  return {
1774
1789
  isUsable,
@@ -4414,112 +4429,8 @@ var inputClassDisabled = "zue0i63 _1rsrm2fxv";
4414
4429
 
4415
4430
  // src/components/FunInput/FunInput.tsx
4416
4431
  var InputTextSize = "57px";
4417
- function FunInputDefault({
4418
- prefix,
4419
- prefixIcon,
4420
- placeholder,
4421
- value,
4422
- label,
4423
- onChange,
4424
- onKeyDown,
4425
- onKeySubmit,
4426
- onPaste,
4427
- onMouseDown,
4428
- hasBackground = true,
4429
- textColor = "modalTextSecondary",
4430
- inputStyle = {},
4431
- inputProps = {
4432
- type: "text"
4433
- },
4434
- error,
4435
- focused: _focused,
4436
- overrideBorderWidth
4437
- }) {
4438
- const { paymentsConfig } = useFunkitConfig();
4439
- const [focused, setFocused] = React29.useState(false);
4440
- const onFocus = () => setFocused(true);
4441
- const onBlur = () => setFocused(false);
4442
- return /* @__PURE__ */ React29.createElement(Box, {
4443
- color: "modalText",
4444
- display: "flex",
4445
- flexDirection: "column",
4446
- gap: "8",
4447
- width: "full"
4448
- }, label && /* @__PURE__ */ React29.createElement(Text, {
4449
- color: textColor,
4450
- size: "14",
4451
- weight: "medium"
4452
- }, label), /* @__PURE__ */ React29.createElement(Box, {
4453
- background: hasBackground ? "actionButtonSecondaryBackground" : void 0,
4454
- borderRadius: "connectButton",
4455
- fontFamily: "body",
4456
- minWidth: "full",
4457
- display: "flex",
4458
- color: textColor,
4459
- alignItems: "center",
4460
- borderColor: error ? "error" : focused && _focused ? "accentColor" : void 0,
4461
- borderWidth: overrideBorderWidth ? overrideBorderWidth : error && focused ? "2" : error ? "1" : focused && _focused ? "1" : "0",
4462
- borderStyle: "solid",
4463
- fontWeight: value ? "semibold" : "medium"
4464
- }, prefix ? /* @__PURE__ */ React29.createElement(Box, {
4465
- paddingLeft: paymentsConfig.optionsConfig.optionsPadding,
4466
- height: "max"
4467
- }, prefix) : null, prefixIcon && (prefixIcon === "SearchIcon" ? /* @__PURE__ */ React29.createElement(Box, {
4468
- display: "flex",
4469
- paddingLeft: paymentsConfig.optionsConfig.optionsPadding,
4470
- height: "max",
4471
- alignItems: "center"
4472
- }, /* @__PURE__ */ React29.createElement(SearchIcon, {
4473
- selected: focused
4474
- })) : prefixIcon === "$" ? /* @__PURE__ */ React29.createElement(Box, {
4475
- display: "flex",
4476
- alignItems: "center",
4477
- paddingLeft: "32"
4478
- }, /* @__PURE__ */ React29.createElement(Text, {
4479
- color: "modalText",
4480
- style: {
4481
- paddingBottom: 2,
4482
- fontSize: inputStyle.fontSize || InputTextSize,
4483
- fontWeight: 800
4484
- }
4485
- }, "$")) : void 0), /* @__PURE__ */ React29.createElement("input", {
4486
- type: (inputProps == null ? void 0 : inputProps.type) || "text",
4487
- value,
4488
- placeholder,
4489
- onChange: (e) => onChange(e),
4490
- onKeyDown: (e) => {
4491
- e.stopPropagation();
4492
- if (onKeyDown) {
4493
- onKeyDown(e);
4494
- }
4495
- if (e.key === "Enter" && onKeySubmit) {
4496
- onKeySubmit();
4497
- e.stopPropagation();
4498
- }
4499
- },
4500
- onPaste,
4501
- onMouseDown: (e) => {
4502
- if (onMouseDown) {
4503
- onMouseDown(e);
4504
- }
4505
- },
4506
- onFocus,
4507
- onBlur,
4508
- onWheel: (e) => e.currentTarget.blur(),
4509
- className: inputProps.disabled ? inputClassDisabled : inputClass,
4510
- ...inputProps,
4511
- style: {
4512
- fontWeight: "inherit",
4513
- ...inputStyle
4514
- }
4515
- })), error && typeof error === "string" && /* @__PURE__ */ React29.createElement(Text, {
4516
- color: "error",
4517
- size: "14",
4518
- weight: "medium"
4519
- }, error));
4520
- }
4521
- var FunInputWithRef = forwardRef2(
4522
- function FunInputWithRef2({
4432
+ var FunInput = forwardRef2(
4433
+ function FunInputWithRef({
4523
4434
  prefix,
4524
4435
  prefixIcon,
4525
4436
  placeholder,
@@ -4548,7 +4459,8 @@ var FunInputWithRef = forwardRef2(
4548
4459
  color: "modalText",
4549
4460
  display: "flex",
4550
4461
  flexDirection: "column",
4551
- gap: "8"
4462
+ gap: "8",
4463
+ width: "full"
4552
4464
  }, label && /* @__PURE__ */ React29.createElement(Text, {
4553
4465
  color: textColor,
4554
4466
  size: "14",
@@ -4557,6 +4469,7 @@ var FunInputWithRef = forwardRef2(
4557
4469
  background: hasBackground ? "actionButtonSecondaryBackground" : void 0,
4558
4470
  borderRadius: "connectButton",
4559
4471
  fontFamily: "body",
4472
+ minWidth: "full",
4560
4473
  display: "flex",
4561
4474
  color: textColor,
4562
4475
  alignItems: "center",
@@ -4589,7 +4502,7 @@ var FunInputWithRef = forwardRef2(
4589
4502
  ref,
4590
4503
  type: (inputProps == null ? void 0 : inputProps.type) || "text",
4591
4504
  value,
4592
- placeholder: placeholder == null ? void 0 : placeholder.toString(),
4505
+ placeholder,
4593
4506
  onChange: (e) => onChange(e),
4594
4507
  onKeyDown: (e) => {
4595
4508
  e.stopPropagation();
@@ -4600,7 +4513,6 @@ var FunInputWithRef = forwardRef2(
4600
4513
  onKeySubmit();
4601
4514
  }
4602
4515
  },
4603
- onWheel: (e) => e.currentTarget.blur(),
4604
4516
  onPaste,
4605
4517
  onMouseDown: (e) => {
4606
4518
  if (onMouseDown) {
@@ -4609,6 +4521,7 @@ var FunInputWithRef = forwardRef2(
4609
4521
  },
4610
4522
  onFocus,
4611
4523
  onBlur,
4524
+ onWheel: (e) => e.currentTarget.blur(),
4612
4525
  className: inputProps.disabled ? inputClassDisabled : inputClass,
4613
4526
  ...inputProps,
4614
4527
  style: {
@@ -4622,13 +4535,6 @@ var FunInputWithRef = forwardRef2(
4622
4535
  }, error));
4623
4536
  }
4624
4537
  );
4625
- function FunInput(props) {
4626
- return props.ref ? /* @__PURE__ */ React29.createElement(FunInputWithRef, {
4627
- ...props
4628
- }) : /* @__PURE__ */ React29.createElement(FunInputDefault, {
4629
- ...props
4630
- });
4631
- }
4632
4538
 
4633
4539
  // src/components/FunKeyValue/FunKeyValue.tsx
4634
4540
  import React30 from "react";
@@ -4764,7 +4670,7 @@ import {
4764
4670
  getTokenInfo as getTokenInfo2
4765
4671
  } from "@funkit/core";
4766
4672
  import React83, { useCallback as useCallback20, useEffect as useEffect20, useMemo as useMemo22, useState as useState23 } from "react";
4767
- 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";
4768
4674
 
4769
4675
  // src/hooks/useCheckoutAccountBalanceTransfer.ts
4770
4676
  import { useCallback as useCallback9 } from "react";
@@ -4877,38 +4783,38 @@ import {
4877
4783
  } from "@funkit/api-base";
4878
4784
  import { FUNKIT_CONNECT_SUPPORTED_CHAINS_ID_LIST } from "@funkit/core";
4879
4785
  var FUNKIT_MESH_CLIENT_ID = "8132aff4-56c9-4b1d-85b4-08dbdcc6199d";
4880
- var MeshExchanges = /* @__PURE__ */ ((MeshExchanges4) => {
4881
- MeshExchanges4["Robinhood"] = "Robinhood";
4882
- MeshExchanges4["ETrade"] = "ETrade";
4883
- MeshExchanges4["Alpaca"] = "Alpaca";
4884
- MeshExchanges4["WeBull"] = "WeBull";
4885
- MeshExchanges4["Stash"] = "Stash";
4886
- MeshExchanges4["InteractiveBrokers"] = "InteractiveBrokers";
4887
- MeshExchanges4["Public"] = "Public";
4888
- MeshExchanges4["Coinbase"] = "Coinbase";
4889
- MeshExchanges4["Kraken"] = "Kraken";
4890
- MeshExchanges4["CoinbasePro"] = "CoinbasePro";
4891
- MeshExchanges4["CryptoCom"] = "CryptoCom";
4892
- MeshExchanges4["Binance"] = "Binance";
4893
- MeshExchanges4["BinanceUs"] = "BinanceUs";
4894
- MeshExchanges4["Gemini"] = "Gemini";
4895
- MeshExchanges4["OkCoin"] = "OkCoin";
4896
- MeshExchanges4["KuCoin"] = "KuCoin";
4897
- MeshExchanges4["Etoro"] = "Etoro";
4898
- MeshExchanges4["CexIo"] = "CexIo";
4899
- MeshExchanges4["Bitstamp"] = "Bitstamp";
4900
- MeshExchanges4["GateIo"] = "GateIo";
4901
- MeshExchanges4["Acorns"] = "Acorns";
4902
- MeshExchanges4["Okx"] = "Okx";
4903
- MeshExchanges4["BitFlyer"] = "BitFlyer";
4904
- MeshExchanges4["Coinlist"] = "Coinlist";
4905
- MeshExchanges4["Huobi"] = "Huobi";
4906
- MeshExchanges4["Bitfinex"] = "Bitfinex";
4907
- MeshExchanges4["KrakenDirect"] = "KrakenDirect";
4908
- MeshExchanges4["Vanguard"] = "Vanguard";
4909
- MeshExchanges4["BitfinexDirect"] = "BitfinexDirect";
4910
- MeshExchanges4["Bybit"] = "Bybit";
4911
- 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;
4912
4818
  })(MeshExchanges || {});
4913
4819
  var EXCHANGE_NAME_TO_TYPE = {
4914
4820
  ["Robinhood" /* Robinhood */]: "robinhood",
@@ -5900,11 +5806,14 @@ var FunTwoFaInput = ({
5900
5806
  return /* @__PURE__ */ React50.createElement(Box, {
5901
5807
  key: i,
5902
5808
  style: { display: "flex", flex: 1 }
5903
- }, /* @__PURE__ */ React50.createElement(FunInputWithRef, {
5809
+ }, /* @__PURE__ */ React50.createElement(FunInput, {
5904
5810
  ref: (el) => inputRefs.current[i] = el,
5905
5811
  inputStyle: {
5906
5812
  textAlign: "center"
5907
5813
  },
5814
+ inputProps: {
5815
+ inputMode: "numeric"
5816
+ },
5908
5817
  value: value[i] || "",
5909
5818
  onChange: (e) => {
5910
5819
  e.stopPropagation();
@@ -6618,12 +6527,7 @@ function FunPaymentMeshType({
6618
6527
  gap: "24"
6619
6528
  }, (filteredOptions == null ? void 0 : filteredOptions.length) > 0 ? /* @__PURE__ */ React58.createElement(FunNotification, {
6620
6529
  type: hasMeshPreError ? "error" : "default",
6621
- 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, {
6622
- text: "Unlink.",
6623
- color: "buttonPrimary",
6624
- textProps: { weight: "medium" },
6625
- onClick: () => unlinkBrokerage(exchange)
6626
- }) : 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."
6627
6531
  }) : null, /* @__PURE__ */ React58.createElement(FunButton, {
6628
6532
  title: "Continue",
6629
6533
  onClick: onClickContinue,
@@ -8824,6 +8728,8 @@ var SwitchIcon = () => {
8824
8728
  };
8825
8729
 
8826
8730
  // src/components/FunCheckoutModal/FunCheckoutInputAmountStep.tsx
8731
+ var USD_REGEX = /^\$?\d*(\.\d{0,2})?/;
8732
+ var ABSOLUTE_REGEX = /^\d*(\.\d{0,5})?/;
8827
8733
  function FunCheckoutInputAmountStep({
8828
8734
  checkoutId,
8829
8735
  onContinue,
@@ -8925,20 +8831,23 @@ function FunCheckoutInputAmountStep({
8925
8831
  value: amountInput === "" ? "" : isAmountInAbsolute ? amountInput : `$${amountInput}`,
8926
8832
  placeholder: isAmountInAbsolute ? "0.00000" : "$0.00",
8927
8833
  onChange: (newAmount) => {
8834
+ const regex = isAmountInAbsolute ? ABSOLUTE_REGEX : USD_REGEX;
8928
8835
  let newValue = newAmount.target.value;
8836
+ const match = newValue.match(regex);
8837
+ if (!match) {
8838
+ return;
8839
+ }
8840
+ newValue = match[0];
8929
8841
  if (!isAmountInAbsolute && newValue.startsWith("$")) {
8930
- if (newValue === "$") {
8931
- newValue = "";
8932
- } else if (newValue.length > 0) {
8933
- newValue = newValue.slice(1);
8934
- }
8842
+ newValue = newValue.slice(1);
8935
8843
  }
8936
8844
  setAmountInput(newValue);
8937
8845
  },
8938
8846
  inputProps: {
8939
8847
  type: isAmountInAbsolute ? "number" : "text",
8940
8848
  autoFocus: true,
8941
- disabled: isContinuing || unitPrice == null
8849
+ disabled: isContinuing || unitPrice == null,
8850
+ inputMode: "decimal"
8942
8851
  },
8943
8852
  inputStyle: {
8944
8853
  textAlign: "center",
@@ -9105,16 +9014,20 @@ function MeshOrAccountSelectAsset({
9105
9014
  checkoutId,
9106
9015
  checkoutStep,
9107
9016
  onFinish,
9017
+ onBack,
9108
9018
  isOnFinishLoading
9109
9019
  }) {
9110
9020
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
9111
9021
  const [accountHoldingsMap, setAccountHoldingsMap] = useState22({});
9112
9022
  const [isLoadingAssets, setIsLoadingAssets] = useState22(true);
9023
+ const [fetchAssetsError, setFetchAssetsError] = useState22("");
9024
+ const hasFetchAssetsError = !!fetchAssetsError;
9113
9025
  const [selectedChainTokenSymbol, setSelectedChainTokenSymbol] = useState22("");
9114
9026
  const { checkoutItem, updateSourceAsset } = useFunkitPreCheckoutInternal(checkoutId);
9115
9027
  const { isCheckoutCrFlow } = useCheckoutType(checkoutItem);
9116
9028
  const draftDollarValueNormalized = (checkoutItem == null ? void 0 : checkoutItem.draftDollarValue) || 0;
9117
9029
  const funkitConfig = useFunkitConfig();
9030
+ const { unlinkBrokerage } = useFunkitMesh({});
9118
9031
  const { fetchInfo: manualFetchNetworkInfo } = useMeshNetworkInfo(
9119
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
9120
9033
  );
@@ -9124,7 +9037,7 @@ function MeshOrAccountSelectAsset({
9124
9037
  const { walletAssets, isWeb2Login, isWeb3Login } = useGeneralWallet();
9125
9038
  const generateAccountHoldingsMapForMesh = useCallback19(async () => {
9126
9039
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
9127
- if (funkitConfig == null ? void 0 : funkitConfig.apiKey) {
9040
+ try {
9128
9041
  const [cryptoHoldings, meshNetworkInfo] = await Promise.all([
9129
9042
  fetchMeshAccountCryptoHoldings({
9130
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,
@@ -9191,8 +9104,13 @@ function MeshOrAccountSelectAsset({
9191
9104
  });
9192
9105
  logger.log("generateAccountHoldingsMapForMesh_itemMap", itemMap);
9193
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 {};
9194
9113
  }
9195
- return {};
9196
9114
  }, [
9197
9115
  checkoutItem == null ? void 0 : checkoutItem.initSettings.config.targetChain,
9198
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,
@@ -9200,7 +9118,7 @@ function MeshOrAccountSelectAsset({
9200
9118
  funkitConfig == null ? void 0 : funkitConfig.apiKey,
9201
9119
  manualFetchNetworkInfo
9202
9120
  ]);
9203
- const generateAccountHoldingsMapForBalance = useCallback19(async () => {
9121
+ const generateAccountHoldingsMapForBalance = useCallback19(() => {
9204
9122
  var _a2, _b2;
9205
9123
  const itemMap = {};
9206
9124
  const checkoutTargetChainId = checkoutItem == null ? void 0 : checkoutItem.initSettings.config.targetChain;
@@ -9248,14 +9166,19 @@ function MeshOrAccountSelectAsset({
9248
9166
  if (paymentMethod === "brokerage" /* BROKERAGE */) {
9249
9167
  itemMap = await generateAccountHoldingsMapForMesh();
9250
9168
  } else if (paymentMethod === "balance" /* ACCOUNT_BALANCE */) {
9251
- itemMap = await generateAccountHoldingsMapForBalance();
9169
+ itemMap = generateAccountHoldingsMapForBalance();
9252
9170
  }
9253
9171
  setAccountHoldingsMap(itemMap);
9254
9172
  setIsLoadingAssets(false);
9255
9173
  }
9256
- fetchAccountHoldings().catch(
9257
- (reason) => logger.error("fetchAccountHoldings:error", reason)
9258
- );
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
+ });
9259
9182
  }, [
9260
9183
  (_k = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _k.paymentMethod,
9261
9184
  manualFetchNetworkInfo,
@@ -9340,7 +9263,26 @@ function MeshOrAccountSelectAsset({
9340
9263
  } = useCheckoutQuoteNotification(checkoutId || "");
9341
9264
  const [insufficientAssetError, setInsufficientAssetError] = useState22("");
9342
9265
  const hasInsufficientAssetError = !!insufficientAssetError;
9343
- 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
+ ]);
9344
9286
  useEffect19(() => {
9345
9287
  if (checkoutItem == null ? void 0 : checkoutItem.isDrafting) {
9346
9288
  setSelectedChainTokenSymbol("");
@@ -9393,8 +9335,8 @@ function MeshOrAccountSelectAsset({
9393
9335
  paddingBottom: showNotification ? "24" : "0"
9394
9336
  }, /* @__PURE__ */ React81.createElement(FunNotification, {
9395
9337
  isVisible: showNotification,
9396
- type: hasQuoteError ? "error" : "default",
9397
- description: quoteNotificationMessage || insufficientAssetError
9338
+ type: hasQuoteError || hasFetchAssetsError ? "error" : "default",
9339
+ description: notificationDescription
9398
9340
  })), /* @__PURE__ */ React81.createElement(FunButton, {
9399
9341
  type: "primary",
9400
9342
  title: "Continue",
@@ -9414,6 +9356,7 @@ function FunCheckoutSelectAssetStep({
9414
9356
  checkoutId,
9415
9357
  checkoutStep,
9416
9358
  onFinish,
9359
+ onBack,
9417
9360
  isOnFinishLoading,
9418
9361
  animateOut = false
9419
9362
  }) {
@@ -9430,6 +9373,7 @@ function FunCheckoutSelectAssetStep({
9430
9373
  ) ? /* @__PURE__ */ React81.createElement(MeshOrAccountSelectAsset, {
9431
9374
  isOnFinishLoading,
9432
9375
  onFinish,
9376
+ onBack,
9433
9377
  checkoutId,
9434
9378
  checkoutStep
9435
9379
  }) : /* @__PURE__ */ React81.createElement(Text, {
@@ -9735,7 +9679,7 @@ function FunCheckoutModal({
9735
9679
  const originalTargetChainId = checkoutItem == null ? void 0 : checkoutItem.initSettings.config.targetChain.toString();
9736
9680
  const moonpayChainId = [
9737
9681
  zkSync2.id.toString(),
9738
- mantle.id.toString()
9682
+ mantle2.id.toString()
9739
9683
  ].includes(originalTargetChainId) ? arbitrum.id.toString() : originalTargetChainId;
9740
9684
  const wethAddrOnTargetChain = (await getTokenInfo2("weth", moonpayChainId)).toLowerCase();
9741
9685
  const isTargetAssetEthOrWeth = [NATIVE_TOKEN, wethAddrOnTargetChain].includes(
@@ -9860,6 +9804,7 @@ function FunCheckoutModal({
9860
9804
  checkoutStep,
9861
9805
  isOnFinishLoading: isSourceAssetConfirming,
9862
9806
  onFinish: triggerSourceAssetConfirmedFn,
9807
+ onBack: titleConfig.onBack,
9863
9808
  animateOut
9864
9809
  }) : checkoutStep === "confirmation" /* CONFIRMATION */ ? /* @__PURE__ */ React83.createElement(FunCheckoutConfirmationStep, {
9865
9810
  checkoutId,
@@ -17351,7 +17296,7 @@ function setFunkitConnectVersion({ version }) {
17351
17296
  localStorage.setItem(storageKey6, version);
17352
17297
  }
17353
17298
  function getCurrentSdkVersion() {
17354
- return "1.3.0";
17299
+ return "1.3.1";
17355
17300
  }
17356
17301
  function useFingerprint() {
17357
17302
  const fingerprint = useCallback33(() => {
@@ -15,10 +15,13 @@ export declare enum FlagKey {
15
15
  * - “Debit or Credit” → Card
16
16
  * - “Brokerage or Exchange” → Exchange
17
17
  */
18
- PaymentMethodCopyV1 = "payment_method_copy_v1"
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"
19
21
  }
20
22
  export declare const flagConfig: {
21
23
  [FlagKey.ConnectSignInShowSocialLabel]: BooleanFlagConfig;
22
24
  [FlagKey.SelectPaymentMethodText]: StringFlagConfig;
23
25
  [FlagKey.PaymentMethodCopyV1]: BooleanFlagConfig;
26
+ [FlagKey.DisableMantleSourceAssets]: BooleanFlagConfig;
24
27
  };
@@ -5,5 +5,6 @@ declare const singleton: FeatureFlag<{
5
5
  connect_sign_in_show_social_label: import("./types").BooleanFlagConfig;
6
6
  select_payment_method_text: import("./types").StringFlagConfig;
7
7
  payment_method_copy_v1: import("./types").BooleanFlagConfig;
8
+ disable_mantle_source_assets: import("./types").BooleanFlagConfig;
8
9
  }>;
9
10
  export declare const flags: Pick<typeof singleton, "init" | "getBool" | "getNumber" | "getString">;
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  bifrostWallet
4
- } from "../chunk-FL2VIO76.js";
5
- import "../chunk-F3VCNZXS.js";
4
+ } from "../chunk-AFONKDII.js";
6
5
  import "../chunk-ZOLACFTK.js";
7
6
  import "../chunk-ZDU3JFGR.js";
7
+ import "../chunk-F3VCNZXS.js";
8
8
  export {
9
9
  bifrostWallet
10
10
  };
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import {
3
3
  bitgetWallet
4
- } from "../chunk-7YDZTPO4.js";
5
- import "../chunk-F3VCNZXS.js";
4
+ } from "../chunk-OUQ3ZF2W.js";
6
5
  import "../chunk-ZOLACFTK.js";
7
6
  import "../chunk-ZDU3JFGR.js";
7
+ import "../chunk-F3VCNZXS.js";
8
8
  export {
9
9
  bitgetWallet
10
10
  };
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  bybitWallet
4
- } from "../chunk-BCXBFAL4.js";
5
- import "../chunk-F3VCNZXS.js";
4
+ } from "../chunk-ZBQT5PV6.js";
6
5
  import "../chunk-ZDU3JFGR.js";
6
+ import "../chunk-F3VCNZXS.js";
7
7
  export {
8
8
  bybitWallet
9
9
  };