@funkit/connect 1.0.17 → 1.0.18

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 (38) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/components/FunInput/FunTwoFaInput.d.ts +2 -1
  3. package/dist/index.js +145 -95
  4. package/dist/utils/payment.d.ts +10 -0
  5. package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
  6. package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
  7. package/dist/wallets/walletConnectors/chunk-VWZEDVW6.js +27 -0
  8. package/dist/wallets/walletConnectors/chunk-YC7XNS7C.js +98 -0
  9. package/dist/wallets/walletConnectors/coinbaseWallet/coinbaseWallet.js +2 -2
  10. package/dist/wallets/walletConnectors/dawnWallet/dawnWallet.js +2 -2
  11. package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
  12. package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
  13. package/dist/wallets/walletConnectors/index.js +72 -72
  14. package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
  15. package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
  16. package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
  17. package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
  18. package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
  19. package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
  20. package/package.json +1 -1
  21. package/dist/wallets/walletConnectors/chunk-4FQLUQNA.js +0 -96
  22. package/dist/wallets/walletConnectors/chunk-JLQ5HJYV.js +0 -94
  23. package/dist/wallets/walletConnectors/chunk-LVRXH33E.js +0 -92
  24. package/dist/wallets/walletConnectors/chunk-MIWCKFYE.js +0 -87
  25. package/dist/wallets/walletConnectors/chunk-Q4RLUJJD.js +0 -66
  26. package/dist/wallets/walletConnectors/chunk-SYELB4QO.js +0 -107
  27. package/dist/wallets/walletConnectors/chunk-ZBAQFL6G.js +0 -102
  28. package/dist/wallets/walletConnectors/chunk-ZUAHWUEL.js +0 -98
  29. package/dist/wallets/walletConnectors/{chunk-V45EXW7A.js → chunk-2PC2XXUH.js} +4 -4
  30. package/dist/wallets/walletConnectors/{chunk-ZNXQ4V6G.js → chunk-75A2U7T7.js} +4 -4
  31. package/dist/wallets/walletConnectors/{chunk-O5NKWWEG.js → chunk-FDIIMYTB.js} +4 -4
  32. package/dist/wallets/walletConnectors/{chunk-AM4SSLAP.js → chunk-N3VZE65M.js} +4 -4
  33. package/dist/wallets/walletConnectors/{chunk-Z2DGDHHZ.js → chunk-OAEJQOAV.js} +4 -4
  34. package/dist/wallets/walletConnectors/{chunk-2UXZAUWT.js → chunk-OR3PU2W4.js} +4 -4
  35. package/dist/wallets/walletConnectors/{chunk-6LTLPR2Q.js → chunk-SL4VH23R.js} +4 -4
  36. package/dist/wallets/walletConnectors/{chunk-7CQPABJG.js → chunk-SQGFKNNZ.js} +4 -4
  37. package/dist/wallets/walletConnectors/{chunk-3WZRNEZH.js → chunk-X255T3C4.js} +4 -4
  38. package/dist/wallets/walletConnectors/{chunk-NGXIHASN.js → chunk-XSSD5ZVD.js} +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 1.0.18
4
+
5
+ ### Patch Changes
6
+
7
+ - bccf0b0: feat: mesh 2fa input length toggle
8
+ - bccf0b0: refactor: verbose sourceOfFund
9
+ - bccf0b0: chore: better logging
10
+ - 268d91c: format: tx summary alignments
11
+
3
12
  ## 1.0.17
4
13
 
5
14
  ### Patch Changes
@@ -5,5 +5,6 @@ export interface FunTwoFaInputProps {
5
5
  onCompleted?: (input?: any) => void;
6
6
  hasError: boolean;
7
7
  errorMessage?: string;
8
+ inputLength: number;
8
9
  }
9
- export declare const FunTwoFaInput: ({ value, onChange, onCompleted, hasError, errorMessage, }: FunTwoFaInputProps) => React.JSX.Element;
10
+ export declare const FunTwoFaInput: ({ value, onChange, onCompleted, hasError, errorMessage, inputLength, }: FunTwoFaInputProps) => React.JSX.Element;
package/dist/index.js CHANGED
@@ -1541,7 +1541,6 @@ function GeneralWalletProvider({ children }) {
1541
1541
  let newFunWalletAuth;
1542
1542
  let newFunWallet;
1543
1543
  if (isWeb2Login) {
1544
- logger.log("setupFunWallet_isWeb2Login");
1545
1544
  newFunWalletAuth = await ((_a = connector == null ? void 0 : connector.getAuth) == null ? void 0 : _a.call(connector));
1546
1545
  newFunWallet = await ((_b = connector == null ? void 0 : connector.getFunWallet) == null ? void 0 : _b.call(connector));
1547
1546
  } else if (isWeb3Login) {
@@ -1549,7 +1548,6 @@ function GeneralWalletProvider({ children }) {
1549
1548
  const provider = await ((_c = connector == null ? void 0 : connector.getProvider) == null ? void 0 : _c.call(connector));
1550
1549
  if (!provider)
1551
1550
  return;
1552
- logger.log("setupFunWallet_web3Provider", { provider });
1553
1551
  newFunWalletAuth = new Auth({ provider });
1554
1552
  newFunWallet = new FunWallet({
1555
1553
  users: [{ userId: await newFunWalletAuth.getAddress() }],
@@ -1558,7 +1556,12 @@ function GeneralWalletProvider({ children }) {
1558
1556
  )
1559
1557
  });
1560
1558
  }
1561
- logger.log("setupFunWallet_result", { newFunWallet, newFunWalletAuth });
1559
+ logger.log("setupFunWallet_result", {
1560
+ newFunWallet,
1561
+ newFunWalletAuth,
1562
+ isWeb2Login,
1563
+ isWeb3Login
1564
+ });
1562
1565
  setFunWallet(newFunWallet);
1563
1566
  setFunWalletAuth(newFunWalletAuth);
1564
1567
  }
@@ -2204,6 +2207,24 @@ function colorToHex(color) {
2204
2207
  return hexColor;
2205
2208
  }
2206
2209
 
2210
+ // src/utils/payment.ts
2211
+ function generateSourceOfFundString({
2212
+ paymentMethodInfo,
2213
+ isWeb2Login,
2214
+ isWeb3Login,
2215
+ walletAddress
2216
+ }) {
2217
+ const paymentMethod = paymentMethodInfo.paymentMethod;
2218
+ if (paymentMethod === "balance" /* ACCOUNT_BALANCE */) {
2219
+ return `${paymentMethod}|${isWeb2Login ? "funwallet" : isWeb3Login ? "eoa" : "unrecognized"}|${walletAddress}`;
2220
+ } else if (paymentMethod === "brokerage" /* BROKERAGE */) {
2221
+ return `${paymentMethod}|${paymentMethodInfo.title.toLowerCase()}`;
2222
+ } else if (paymentMethod === "card" /* CARD */) {
2223
+ return `${paymentMethod}|moonpay`;
2224
+ }
2225
+ return "";
2226
+ }
2227
+
2207
2228
  // src/components/FunkitProvider/FunkitCheckoutContext.tsx
2208
2229
  var FunkitCheckoutContext = createContext9({
2209
2230
  activeCheckouts: {},
@@ -2869,7 +2890,7 @@ function FunkitCheckoutProvider({ children }) {
2869
2890
  );
2870
2891
  const _confirmCheckout = useCallback6(
2871
2892
  async (checkoutId, shouldbatchOpBypassInit, stepMessageSetter) => {
2872
- var _a, _b, _c, _d;
2893
+ var _a, _b, _c;
2873
2894
  if (!(funkitConfig == null ? void 0 : funkitConfig.apiKey)) {
2874
2895
  throw new Error(
2875
2896
  `Funkit Internal Error: Unable to detect funkit api key`
@@ -2905,10 +2926,15 @@ function FunkitCheckoutProvider({ children }) {
2905
2926
  userOp: batchUserOp,
2906
2927
  quoteId: checkoutItem.latestQuote.baseQuote.quoteId,
2907
2928
  apiKey: funkitConfig.apiKey || "",
2908
- sourceOfFund: (_b = checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _b.paymentMethod,
2929
+ sourceOfFund: generateSourceOfFundString({
2930
+ paymentMethodInfo: checkoutItem.selectedPaymentMethodInfo,
2931
+ isWeb2Login,
2932
+ isWeb3Login,
2933
+ walletAddress
2934
+ }),
2909
2935
  clientMetadata: _generateClientMetadataForBackend(checkoutId)
2910
2936
  });
2911
- (_d = (_c = checkoutItem == null ? void 0 : checkoutItem.initSettings) == null ? void 0 : _c.onConfirmation) == null ? void 0 : _d.call(_c);
2937
+ (_c = (_b = checkoutItem == null ? void 0 : checkoutItem.initSettings) == null ? void 0 : _b.onConfirmation) == null ? void 0 : _c.call(_b);
2912
2938
  logger.log("checkoutConfirmed", { depositAddress });
2913
2939
  setActiveCheckouts({
2914
2940
  ...activeCheckouts,
@@ -4534,7 +4560,7 @@ var useMeshActiveNetworkInfo = (exchange) => {
4534
4560
  };
4535
4561
 
4536
4562
  // src/components/FunMeshVerificationStep/FunMeshVerificationStep.tsx
4537
- import React52, { useCallback as useCallback11, useEffect as useEffect11, useMemo as useMemo12, useState as useState14 } from "react";
4563
+ import React53, { useCallback as useCallback11, useEffect as useEffect11, useMemo as useMemo12, useState as useState14 } from "react";
4538
4564
 
4539
4565
  // src/components/CopyAddress/CopyAddress.tsx
4540
4566
  import React47, { useCallback as useCallback9, useEffect as useEffect9, useState as useState13 } from "react";
@@ -4771,8 +4797,30 @@ function FunButton({
4771
4797
  }, title) : null, titleSuffix && /* @__PURE__ */ React48.createElement(Box, null, titleSuffix)));
4772
4798
  }
4773
4799
 
4800
+ // src/components/FunButton/FunLinkButton.tsx
4801
+ import React49 from "react";
4802
+ function FunLinkButton({
4803
+ onClick,
4804
+ text,
4805
+ textProps,
4806
+ hasPadding = true,
4807
+ color = "modalText"
4808
+ }) {
4809
+ return /* @__PURE__ */ React49.createElement(Box, {
4810
+ as: "button",
4811
+ onClick,
4812
+ className: funLinkButtonStyle,
4813
+ paddingLeft: hasPadding ? "4" : "0"
4814
+ }, /* @__PURE__ */ React49.createElement(Text, {
4815
+ color,
4816
+ size: "12",
4817
+ weight: "bold",
4818
+ ...textProps
4819
+ }, text));
4820
+ }
4821
+
4774
4822
  // src/components/FunInput/FunTwoFaInput.tsx
4775
- import React51, {
4823
+ import React52, {
4776
4824
  Fragment,
4777
4825
  useCallback as useCallback10,
4778
4826
  useEffect as useEffect10,
@@ -4780,25 +4828,25 @@ import React51, {
4780
4828
  } from "react";
4781
4829
 
4782
4830
  // src/components/FunInput/FunInput.tsx
4783
- import React50, { forwardRef as forwardRef2 } from "react";
4831
+ import React51, { forwardRef as forwardRef2 } from "react";
4784
4832
 
4785
4833
  // src/components/Icons/SearchIcon.tsx
4786
- import React49 from "react";
4834
+ import React50 from "react";
4787
4835
  var SearchIcon = ({ selected }) => {
4788
4836
  const { active: active2 } = useActiveTheme();
4789
4837
  const colorStringSelected = active2.colors.modalText;
4790
4838
  const colorStringDefault = active2.colors.modalTextDim;
4791
4839
  const colorString = selected ? colorStringSelected : colorStringDefault;
4792
- return /* @__PURE__ */ React49.createElement("svg", {
4840
+ return /* @__PURE__ */ React50.createElement("svg", {
4793
4841
  width: "24",
4794
4842
  height: "24",
4795
4843
  viewBox: "0 0 24 24",
4796
4844
  fill: "none",
4797
4845
  xmlns: "http://www.w3.org/2000/svg"
4798
- }, /* @__PURE__ */ React49.createElement("path", {
4846
+ }, /* @__PURE__ */ React50.createElement("path", {
4799
4847
  d: "M10.7702 18.3002C9.28095 18.3002 7.8251 17.8586 6.5868 17.0312C5.3485 16.2038 4.38336 15.0277 3.81343 13.6518C3.2435 12.2759 3.09438 10.7618 3.38493 9.30121C3.67548 7.84054 4.39264 6.49882 5.44573 5.44573C6.49882 4.39264 7.84054 3.67548 9.30121 3.38493C10.7618 3.09438 12.2759 3.2435 13.6518 3.81343C15.0277 4.38336 16.2038 5.3485 17.0312 6.5868C17.8586 7.8251 18.3002 9.28095 18.3002 10.7702C18.3002 11.759 18.1054 12.7382 17.727 13.6518C17.3486 14.5654 16.7939 15.3955 16.0947 16.0947C15.3955 16.7939 14.5654 17.3486 13.6518 17.727C12.7382 18.1054 11.759 18.3002 10.7702 18.3002ZM10.7702 4.75024C9.58356 4.75024 8.42352 5.10214 7.43682 5.76143C6.45013 6.42071 5.68109 7.35779 5.22697 8.45414C4.77284 9.5505 4.65402 10.7568 4.88553 11.9207C5.11704 13.0846 5.68849 14.1537 6.5276 14.9928C7.36672 15.8319 8.43581 16.4034 9.5997 16.6349C10.7635 16.8664 11.9699 16.7476 13.0663 16.2935C14.1626 15.8393 15.0997 15.0703 15.759 14.0836C16.4183 13.0969 16.7702 11.9369 16.7702 10.7502C16.7702 9.15894 16.1381 7.63282 15.0128 6.5076C13.8876 5.38238 12.3615 4.75024 10.7702 4.75024Z",
4800
4848
  fill: colorString
4801
- }), /* @__PURE__ */ React49.createElement("path", {
4849
+ }), /* @__PURE__ */ React50.createElement("path", {
4802
4850
  d: "M20 20.75C19.9015 20.7504 19.8038 20.7312 19.7128 20.6934C19.6218 20.6557 19.5392 20.6001 19.47 20.53L15.34 16.4C15.2075 16.2578 15.1354 16.0697 15.1388 15.8754C15.1422 15.6811 15.221 15.4958 15.3584 15.3583C15.4958 15.2209 15.6812 15.1422 15.8755 15.1388C16.0698 15.1354 16.2578 15.2075 16.4 15.34L20.53 19.47C20.6704 19.6106 20.7493 19.8012 20.7493 20C20.7493 20.1987 20.6704 20.3893 20.53 20.53C20.4608 20.6001 20.3782 20.6557 20.2872 20.6934C20.1962 20.7312 20.0985 20.7504 20 20.75Z",
4803
4851
  fill: colorString
4804
4852
  }));
@@ -4831,20 +4879,20 @@ function FunInputDefault({
4831
4879
  focused: _focused,
4832
4880
  overrideBorderWidth
4833
4881
  }) {
4834
- const [focused, setFocused] = React50.useState(false);
4882
+ const [focused, setFocused] = React51.useState(false);
4835
4883
  const onFocus = () => setFocused(true);
4836
4884
  const onBlur = () => setFocused(false);
4837
- return /* @__PURE__ */ React50.createElement(Box, {
4885
+ return /* @__PURE__ */ React51.createElement(Box, {
4838
4886
  color: "modalText",
4839
4887
  display: "flex",
4840
4888
  flexDirection: "column",
4841
4889
  gap: "8",
4842
4890
  width: "full"
4843
- }, label && /* @__PURE__ */ React50.createElement(Text, {
4891
+ }, label && /* @__PURE__ */ React51.createElement(Text, {
4844
4892
  color: textColor,
4845
4893
  size: "14",
4846
4894
  weight: "medium"
4847
- }, label), /* @__PURE__ */ React50.createElement(Box, {
4895
+ }, label), /* @__PURE__ */ React51.createElement(Box, {
4848
4896
  background: hasBackground ? "actionButtonSecondaryBackground" : void 0,
4849
4897
  borderRadius: "menuButton",
4850
4898
  fontFamily: "body",
@@ -4855,27 +4903,27 @@ function FunInputDefault({
4855
4903
  borderColor: error ? "error" : focused && _focused ? "accentColor" : void 0,
4856
4904
  borderWidth: overrideBorderWidth ? overrideBorderWidth : error && focused ? "2" : error ? "1" : focused && _focused ? "1" : "0",
4857
4905
  borderStyle: "solid"
4858
- }, prefix ? /* @__PURE__ */ React50.createElement(Box, {
4906
+ }, prefix ? /* @__PURE__ */ React51.createElement(Box, {
4859
4907
  paddingLeft: "10",
4860
4908
  height: "max"
4861
- }, prefix) : null, prefixIcon && (prefixIcon === "SearchIcon" ? /* @__PURE__ */ React50.createElement(Box, {
4909
+ }, prefix) : null, prefixIcon && (prefixIcon === "SearchIcon" ? /* @__PURE__ */ React51.createElement(Box, {
4862
4910
  paddingLeft: "10",
4863
4911
  height: "max",
4864
4912
  alignItems: "center"
4865
- }, /* @__PURE__ */ React50.createElement(SearchIcon, {
4913
+ }, /* @__PURE__ */ React51.createElement(SearchIcon, {
4866
4914
  selected: focused
4867
- })) : prefixIcon === "$" ? /* @__PURE__ */ React50.createElement(Box, {
4915
+ })) : prefixIcon === "$" ? /* @__PURE__ */ React51.createElement(Box, {
4868
4916
  display: "flex",
4869
4917
  alignItems: "center",
4870
4918
  paddingLeft: "32"
4871
- }, /* @__PURE__ */ React50.createElement(Text, {
4919
+ }, /* @__PURE__ */ React51.createElement(Text, {
4872
4920
  color: "modalText",
4873
4921
  style: {
4874
4922
  paddingBottom: 2,
4875
4923
  fontSize: inputStyle.fontSize || InputTextSize,
4876
4924
  fontWeight: 800
4877
4925
  }
4878
- }, "$")) : void 0), /* @__PURE__ */ React50.createElement("input", {
4926
+ }, "$")) : void 0), /* @__PURE__ */ React51.createElement("input", {
4879
4927
  type: (inputProps == null ? void 0 : inputProps.type) || "text",
4880
4928
  value,
4881
4929
  placeholder,
@@ -4905,7 +4953,7 @@ function FunInputDefault({
4905
4953
  fontWeight: value ? "590" : "500",
4906
4954
  ...inputStyle
4907
4955
  }
4908
- })), error && typeof error === "string" && /* @__PURE__ */ React50.createElement(Text, {
4956
+ })), error && typeof error === "string" && /* @__PURE__ */ React51.createElement(Text, {
4909
4957
  color: "error",
4910
4958
  size: "14",
4911
4959
  weight: "medium"
@@ -4933,19 +4981,19 @@ var FunInputWithRef = forwardRef2(
4933
4981
  focused: _focused,
4934
4982
  overrideBorderWidth
4935
4983
  }, ref) {
4936
- const [focused, setFocused] = React50.useState(false);
4984
+ const [focused, setFocused] = React51.useState(false);
4937
4985
  const onFocus = () => setFocused(true);
4938
4986
  const onBlur = () => setFocused(false);
4939
- return /* @__PURE__ */ React50.createElement(Box, {
4987
+ return /* @__PURE__ */ React51.createElement(Box, {
4940
4988
  color: "modalText",
4941
4989
  display: "flex",
4942
4990
  flexDirection: "column",
4943
4991
  gap: "8"
4944
- }, label && /* @__PURE__ */ React50.createElement(Text, {
4992
+ }, label && /* @__PURE__ */ React51.createElement(Text, {
4945
4993
  color: textColor,
4946
4994
  size: "14",
4947
4995
  weight: "medium"
4948
- }, label), /* @__PURE__ */ React50.createElement(Box, {
4996
+ }, label), /* @__PURE__ */ React51.createElement(Box, {
4949
4997
  background: hasBackground ? "actionButtonSecondaryBackground" : void 0,
4950
4998
  borderRadius: "menuButton",
4951
4999
  fontFamily: "body",
@@ -4955,27 +5003,27 @@ var FunInputWithRef = forwardRef2(
4955
5003
  borderColor: error ? "error" : focused && _focused ? "accentColor" : void 0,
4956
5004
  borderWidth: overrideBorderWidth ? overrideBorderWidth : error && focused ? "2" : error ? "1" : focused && _focused ? "1" : "0",
4957
5005
  borderStyle: "solid"
4958
- }, prefix ? /* @__PURE__ */ React50.createElement(Box, {
5006
+ }, prefix ? /* @__PURE__ */ React51.createElement(Box, {
4959
5007
  paddingLeft: "10",
4960
5008
  height: "max"
4961
- }, prefix) : null, prefixIcon && (prefixIcon === "SearchIcon" ? /* @__PURE__ */ React50.createElement(Box, {
5009
+ }, prefix) : null, prefixIcon && (prefixIcon === "SearchIcon" ? /* @__PURE__ */ React51.createElement(Box, {
4962
5010
  paddingLeft: "10",
4963
5011
  height: "max",
4964
5012
  alignItems: "center"
4965
- }, /* @__PURE__ */ React50.createElement(SearchIcon, {
5013
+ }, /* @__PURE__ */ React51.createElement(SearchIcon, {
4966
5014
  selected: focused
4967
- })) : prefixIcon === "$" ? /* @__PURE__ */ React50.createElement(Box, {
5015
+ })) : prefixIcon === "$" ? /* @__PURE__ */ React51.createElement(Box, {
4968
5016
  display: "flex",
4969
5017
  alignItems: "center",
4970
5018
  paddingLeft: "32"
4971
- }, /* @__PURE__ */ React50.createElement(Text, {
5019
+ }, /* @__PURE__ */ React51.createElement(Text, {
4972
5020
  color: "modalText",
4973
5021
  style: {
4974
5022
  paddingBottom: 2,
4975
5023
  fontSize: inputStyle.fontSize || InputTextSize,
4976
5024
  fontWeight: 800
4977
5025
  }
4978
- }, "$")) : void 0), /* @__PURE__ */ React50.createElement("input", {
5026
+ }, "$")) : void 0), /* @__PURE__ */ React51.createElement("input", {
4979
5027
  ref,
4980
5028
  type: (inputProps == null ? void 0 : inputProps.type) || "text",
4981
5029
  value,
@@ -5005,7 +5053,7 @@ var FunInputWithRef = forwardRef2(
5005
5053
  fontWeight: value ? "590" : "510",
5006
5054
  ...inputStyle
5007
5055
  }
5008
- })), error && typeof error === "string" && /* @__PURE__ */ React50.createElement(Text, {
5056
+ })), error && typeof error === "string" && /* @__PURE__ */ React51.createElement(Text, {
5009
5057
  color: "error",
5010
5058
  size: "14",
5011
5059
  weight: "medium"
@@ -5013,9 +5061,9 @@ var FunInputWithRef = forwardRef2(
5013
5061
  }
5014
5062
  );
5015
5063
  function FunInput(props) {
5016
- return props.ref ? /* @__PURE__ */ React50.createElement(FunInputWithRef, {
5064
+ return props.ref ? /* @__PURE__ */ React51.createElement(FunInputWithRef, {
5017
5065
  ...props
5018
- }) : /* @__PURE__ */ React50.createElement(FunInputDefault, {
5066
+ }) : /* @__PURE__ */ React51.createElement(FunInputDefault, {
5019
5067
  ...props
5020
5068
  });
5021
5069
  }
@@ -5026,12 +5074,12 @@ var FunTwoFaInput = ({
5026
5074
  onChange,
5027
5075
  onCompleted,
5028
5076
  hasError,
5029
- errorMessage
5077
+ errorMessage,
5078
+ inputLength = 6
5030
5079
  }) => {
5031
- const inputLength = 6;
5032
5080
  const inputRefs = useRef6([]);
5033
5081
  inputRefs.current = Array(inputLength).fill(null);
5034
- const [focusIndex, setFocusIndex] = React51.useState(0);
5082
+ const [focusIndex, setFocusIndex] = React52.useState(0);
5035
5083
  const handleBackspace = useCallback10(
5036
5084
  (index) => {
5037
5085
  const newValue = value.slice(0, index) + value.slice(index + 1);
@@ -5069,7 +5117,7 @@ var FunTwoFaInput = ({
5069
5117
  onCompleted(newValue);
5070
5118
  }
5071
5119
  },
5072
- [hasError, onChange, onCompleted, value]
5120
+ [hasError, inputLength, onChange, onCompleted, value]
5073
5121
  );
5074
5122
  const handleKeyDown = (e) => {
5075
5123
  if (e.key === "Backspace" || e.key === "Delete") {
@@ -5090,21 +5138,21 @@ var FunTwoFaInput = ({
5090
5138
  var _a;
5091
5139
  (_a = inputRefs.current[0]) == null ? void 0 : _a.focus();
5092
5140
  }, []);
5093
- return /* @__PURE__ */ React51.createElement(Fragment, null, /* @__PURE__ */ React51.createElement(Box, null, /* @__PURE__ */ React51.createElement(Box, {
5141
+ return /* @__PURE__ */ React52.createElement(Fragment, null, /* @__PURE__ */ React52.createElement(Box, null, /* @__PURE__ */ React52.createElement(Box, {
5094
5142
  marginBottom: "10"
5095
- }, /* @__PURE__ */ React51.createElement(Text, {
5143
+ }, /* @__PURE__ */ React52.createElement(Text, {
5096
5144
  size: "14",
5097
5145
  color: "modalText"
5098
- }, "Code")), /* @__PURE__ */ React51.createElement(Box, {
5146
+ }, "Code")), /* @__PURE__ */ React52.createElement(Box, {
5099
5147
  display: "flex",
5100
5148
  wrap: "nowrap",
5101
5149
  width: "full",
5102
5150
  gap: "8"
5103
5151
  }, Array.from({ length: inputLength }).map((_, i) => {
5104
- return /* @__PURE__ */ React51.createElement(Box, {
5152
+ return /* @__PURE__ */ React52.createElement(Box, {
5105
5153
  key: i,
5106
5154
  style: { display: "flex", flex: 1 }
5107
- }, /* @__PURE__ */ React51.createElement(FunInputWithRef, {
5155
+ }, /* @__PURE__ */ React52.createElement(FunInputWithRef, {
5108
5156
  ref: (el) => inputRefs.current[i] = el,
5109
5157
  inputStyle: {
5110
5158
  textAlign: "center"
@@ -5128,10 +5176,10 @@ var FunTwoFaInput = ({
5128
5176
  error: hasError,
5129
5177
  focused: i === focusIndex
5130
5178
  }));
5131
- })), /* @__PURE__ */ React51.createElement(Box, {
5179
+ })), /* @__PURE__ */ React52.createElement(Box, {
5132
5180
  marginTop: "6",
5133
5181
  height: "20"
5134
- }, hasError && /* @__PURE__ */ React51.createElement(Text, {
5182
+ }, hasError && /* @__PURE__ */ React52.createElement(Text, {
5135
5183
  size: "14",
5136
5184
  color: "error",
5137
5185
  weight: "medium"
@@ -5148,6 +5196,7 @@ function FunMeshVerificationStep({
5148
5196
  accessToken
5149
5197
  }) {
5150
5198
  const [twoFactorCode, setTwoFactorCode] = useState14("");
5199
+ const [isSixDigits, setIsSixDigits] = useState14(true);
5151
5200
  const funkitConfig = useFunkitConfig();
5152
5201
  const [screen, setScreen] = useState14(
5153
5202
  0 /* INITIAL */
@@ -5273,7 +5322,7 @@ function FunMeshVerificationStep({
5273
5322
  return "An error occurred during checkout but your brokerage funds are unaffected. To retry, please go back and re-confirm a new checkout. If the error still persists, please reach out to support for help.";
5274
5323
  }
5275
5324
  }, [exchange, executionStatus]);
5276
- return /* @__PURE__ */ React52.createElement(Box, null, screen === 0 /* INITIAL */ ? /* @__PURE__ */ React52.createElement(Box, {
5325
+ return /* @__PURE__ */ React53.createElement(Box, null, screen === 0 /* INITIAL */ ? /* @__PURE__ */ React53.createElement(Box, {
5277
5326
  width: "full",
5278
5327
  height: "200",
5279
5328
  display: "flex",
@@ -5282,22 +5331,22 @@ function FunMeshVerificationStep({
5282
5331
  justifyContent: "center",
5283
5332
  color: "modalText",
5284
5333
  gap: "10"
5285
- }, /* @__PURE__ */ React52.createElement(Text, {
5334
+ }, /* @__PURE__ */ React53.createElement(Text, {
5286
5335
  size: "14",
5287
5336
  color: "modalTextSecondary"
5288
- }, "Executing brokerage transfer"), /* @__PURE__ */ React52.createElement(SpinnerIcon, null)) : /* @__PURE__ */ React52.createElement(Box, null, /* @__PURE__ */ React52.createElement(Box, {
5337
+ }, "Executing brokerage transfer"), /* @__PURE__ */ React53.createElement(SpinnerIcon, null)) : /* @__PURE__ */ React53.createElement(Box, null, /* @__PURE__ */ React53.createElement(Box, {
5289
5338
  marginBottom: "10"
5290
- }, /* @__PURE__ */ React52.createElement(Text, {
5339
+ }, /* @__PURE__ */ React53.createElement(Text, {
5291
5340
  size: "16",
5292
5341
  color: "modalText",
5293
5342
  weight: "heavy"
5294
- }, verificationTitle)), /* @__PURE__ */ React52.createElement(Text, {
5343
+ }, verificationTitle)), /* @__PURE__ */ React53.createElement(Text, {
5295
5344
  size: "14",
5296
5345
  color: "modalText",
5297
5346
  font: "body"
5298
- }, verificationDescription)), screen === 1 /* TWO_FACTOR */ ? /* @__PURE__ */ React52.createElement(Box, {
5347
+ }, verificationDescription)), screen === 1 /* TWO_FACTOR */ ? /* @__PURE__ */ React53.createElement(Box, {
5299
5348
  paddingTop: "10"
5300
- }, /* @__PURE__ */ React52.createElement(FunTwoFaInput, {
5349
+ }, /* @__PURE__ */ React53.createElement(FunTwoFaInput, {
5301
5350
  value: twoFactorCode,
5302
5351
  onChange: (value) => {
5303
5352
  setExecutionError("");
@@ -5305,28 +5354,43 @@ function FunMeshVerificationStep({
5305
5354
  },
5306
5355
  onCompleted: handleCompletion,
5307
5356
  hasError: !!executionError,
5308
- errorMessage: executionError
5309
- })) : screen === 2 /* CONFIRMATION */ ? /* @__PURE__ */ React52.createElement(React52.Fragment, null) : screen === 3 /* WHITELIST */ ? /* @__PURE__ */ React52.createElement(Box, {
5357
+ errorMessage: executionError,
5358
+ inputLength: isSixDigits ? 6 : 7
5359
+ }), /* @__PURE__ */ React53.createElement(Box, {
5360
+ display: "flex",
5361
+ justifyContent: "center",
5362
+ alignItems: "center",
5363
+ paddingTop: "4"
5364
+ }, /* @__PURE__ */ React53.createElement(FunLinkButton, {
5365
+ onClick: () => {
5366
+ setExecutionError("");
5367
+ setTwoFactorCode("");
5368
+ setIsSixDigits(!isSixDigits);
5369
+ },
5370
+ text: `Switch to ${isSixDigits ? 7 : 6} digits`,
5371
+ color: "modalTextSecondary",
5372
+ textProps: { weight: "semibold" }
5373
+ }))) : screen === 2 /* CONFIRMATION */ ? /* @__PURE__ */ React53.createElement(React53.Fragment, null) : screen === 3 /* WHITELIST */ ? /* @__PURE__ */ React53.createElement(Box, {
5310
5374
  paddingTop: "10"
5311
- }, /* @__PURE__ */ React52.createElement(CopyAddress, {
5375
+ }, /* @__PURE__ */ React53.createElement(CopyAddress, {
5312
5376
  type: "kv",
5313
5377
  address: transferToAddress,
5314
5378
  showAddress: true
5315
- })) : screen === 4 /* FAILED */ ? /* @__PURE__ */ React52.createElement(Box, {
5379
+ })) : screen === 4 /* FAILED */ ? /* @__PURE__ */ React53.createElement(Box, {
5316
5380
  paddingTop: "10"
5317
- }, /* @__PURE__ */ React52.createElement(FunNotification, {
5381
+ }, /* @__PURE__ */ React53.createElement(FunNotification, {
5318
5382
  type: "error",
5319
5383
  description: executionError
5320
- })) : null, isButtonVisible ? /* @__PURE__ */ React52.createElement(Box, {
5384
+ })) : null, isButtonVisible ? /* @__PURE__ */ React53.createElement(Box, {
5321
5385
  width: "full",
5322
5386
  paddingTop: "24"
5323
- }, /* @__PURE__ */ React52.createElement(FunButton, {
5387
+ }, /* @__PURE__ */ React53.createElement(FunButton, {
5324
5388
  isDisabled: isButtonDisabled,
5325
- titleSuffix: isExecuting ? /* @__PURE__ */ React52.createElement(Box, {
5389
+ titleSuffix: isExecuting ? /* @__PURE__ */ React53.createElement(Box, {
5326
5390
  display: "flex",
5327
5391
  alignItems: "center",
5328
5392
  color: "modalText"
5329
- }, /* @__PURE__ */ React52.createElement(SpinnerIcon, {
5393
+ }, /* @__PURE__ */ React53.createElement(SpinnerIcon, {
5330
5394
  height: 16,
5331
5395
  width: 16
5332
5396
  })) : null,
@@ -5340,30 +5404,6 @@ import React67, { useEffect as useEffect13, useMemo as useMemo15 } from "react";
5340
5404
 
5341
5405
  // src/components/FunButton/FunTermsAndConditionsTextButton.tsx
5342
5406
  import React54 from "react";
5343
-
5344
- // src/components/FunButton/FunLinkButton.tsx
5345
- import React53 from "react";
5346
- function FunLinkButton({
5347
- onClick,
5348
- text,
5349
- textProps,
5350
- hasPadding = true,
5351
- color = "modalText"
5352
- }) {
5353
- return /* @__PURE__ */ React53.createElement(Box, {
5354
- as: "button",
5355
- onClick,
5356
- className: funLinkButtonStyle,
5357
- paddingLeft: hasPadding ? "4" : "0"
5358
- }, /* @__PURE__ */ React53.createElement(Text, {
5359
- color,
5360
- size: "12",
5361
- weight: "bold",
5362
- ...textProps
5363
- }, text));
5364
- }
5365
-
5366
- // src/components/FunButton/FunTermsAndConditionsTextButton.tsx
5367
5407
  function FunTermsAndConditionsTextButton() {
5368
5408
  const { termsFontSize } = useFunkitConfig();
5369
5409
  return /* @__PURE__ */ React54.createElement(Box, {
@@ -6211,6 +6251,7 @@ function LineItem({ children, ...otherProps }) {
6211
6251
  width: "full",
6212
6252
  justifyContent: "space-between",
6213
6253
  paddingY: "8",
6254
+ gap: "16",
6214
6255
  ...otherProps
6215
6256
  }, children);
6216
6257
  }
@@ -6347,7 +6388,8 @@ function FunTransactionSummary({
6347
6388
  }, hasPaymentToken ? /* @__PURE__ */ React65.createElement(Fragment2, null, /* @__PURE__ */ React65.createElement(LineItem, null, /* @__PURE__ */ React65.createElement(Text, {
6348
6389
  weight: "medium",
6349
6390
  color: "modalTextDim",
6350
- size: "14"
6391
+ size: "14",
6392
+ style: { whiteSpace: "nowrap" }
6351
6393
  }, "Payment token"), isLoading ? /* @__PURE__ */ React65.createElement(Box, {
6352
6394
  color: "modalTextSecondary"
6353
6395
  }, /* @__PURE__ */ React65.createElement(SpinnerIcon, {
@@ -6369,7 +6411,8 @@ function FunTransactionSummary({
6369
6411
  }), /* @__PURE__ */ React65.createElement(Text, {
6370
6412
  weight: "medium",
6371
6413
  color: "modalText",
6372
- size: "14"
6414
+ size: "14",
6415
+ style: { textAlign: "end" }
6373
6416
  }, paymentTokenString))), /* @__PURE__ */ React65.createElement(FunTxSummaryDivider, null)) : null, /* @__PURE__ */ React65.createElement(FeesLineItem, {
6374
6417
  feesItem: estFees,
6375
6418
  isLoading
@@ -9912,7 +9955,8 @@ var FunWeb2ConnectingStep = (props) => {
9912
9955
  onChange: props.setOtpInput,
9913
9956
  onCompleted: (input) => handleOtpComplete(input),
9914
9957
  hasError: !!loginErrorMessage,
9915
- errorMessage: loginErrorMessage
9958
+ errorMessage: loginErrorMessage,
9959
+ inputLength: 6
9916
9960
  }), /* @__PURE__ */ React108.createElement(Box, {
9917
9961
  display: "flex",
9918
9962
  flexDirection: "column",
@@ -12997,9 +13041,15 @@ function FunCheckoutModal({
12997
13041
  const { isCheckoutCrFlow } = useCheckoutType(checkoutItem);
12998
13042
  const redirectToCheckoutHistory = useCallback24(
12999
13043
  (depositAddress) => {
13000
- var _a2, _b2;
13044
+ var _a2, _b2, _c2, _d2;
13001
13045
  if (depositAddress) {
13002
- (_b2 = (_a2 = checkoutItem == null ? void 0 : checkoutItem.initSettings) == null ? void 0 : _a2.onSuccess) == null ? void 0 : _b2.call(_a2, {
13046
+ logger.log("checkoutFundingCompleted", {
13047
+ depositAddress,
13048
+ paymentMethod: (_a2 = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _a2.paymentMethod,
13049
+ totalCheckoutUsd: (_b2 = checkoutItem == null ? void 0 : checkoutItem.latestQuote) == null ? void 0 : _b2.finalTotalUsd,
13050
+ checkoutItem
13051
+ });
13052
+ (_d2 = (_c2 = checkoutItem == null ? void 0 : checkoutItem.initSettings) == null ? void 0 : _c2.onSuccess) == null ? void 0 : _d2.call(_c2, {
13003
13053
  type: "success",
13004
13054
  message: "Checkout funding step completed successfully.",
13005
13055
  metadata: {}
@@ -13010,7 +13060,7 @@ function FunCheckoutModal({
13010
13060
  logger.warn("No depositAddress generated");
13011
13061
  }
13012
13062
  },
13013
- [checkoutItem == null ? void 0 : checkoutItem.initSettings, onCloseWrapper, openFunCheckoutHistoryModal]
13063
+ [checkoutItem, onCloseWrapper, openFunCheckoutHistoryModal]
13014
13064
  );
13015
13065
  const [isSourceAssetConfirming, setIsSourceAssetConfirming] = useState36(false);
13016
13066
  const onSourceAssetConfirmed = useCallback24(async () => {
@@ -16042,7 +16092,7 @@ function setFunkitConnectVersion({ version }) {
16042
16092
  localStorage.setItem(storageKey4, version);
16043
16093
  }
16044
16094
  function getCurrentSdkVersion() {
16045
- return "1.0.17";
16095
+ return "1.0.18";
16046
16096
  }
16047
16097
  function useFingerprint() {
16048
16098
  const fingerprint = useCallback29(() => {
@@ -0,0 +1,10 @@
1
+ import { PaymentMethodInfo } from '../consts/payment';
2
+ /**
3
+ * Generate a string for backend to indicate the source of a checkout funds
4
+ */
5
+ export declare function generateSourceOfFundString({ paymentMethodInfo, isWeb2Login, isWeb3Login, walletAddress, }: {
6
+ paymentMethodInfo: PaymentMethodInfo;
7
+ isWeb2Login: boolean;
8
+ isWeb3Login: boolean;
9
+ walletAddress: string | undefined;
10
+ }): string;
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  bifrostWallet
4
- } from "../chunk-KGTZ6E7L.js";
5
- import "../chunk-ZOLACFTK.js";
4
+ } from "../chunk-SL4VH23R.js";
6
5
  import "../chunk-QII6PY2D.js";
6
+ import "../chunk-ZOLACFTK.js";
7
7
  import "../chunk-ZDU3JFGR.js";
8
8
  export {
9
9
  bifrostWallet
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  bitgetWallet
4
- } from "../chunk-2B3SPBRY.js";
5
- import "../chunk-ZOLACFTK.js";
4
+ } from "../chunk-75A2U7T7.js";
6
5
  import "../chunk-QII6PY2D.js";
6
+ import "../chunk-ZOLACFTK.js";
7
7
  import "../chunk-ZDU3JFGR.js";
8
8
  export {
9
9
  bitgetWallet
@@ -0,0 +1,27 @@
1
+ "use client";
2
+ import {
3
+ getInjectedConnector,
4
+ hasInjectedProvider
5
+ } from "./chunk-QII6PY2D.js";
6
+ import {
7
+ isIOS
8
+ } from "./chunk-ZOLACFTK.js";
9
+
10
+ // src/wallets/walletConnectors/dawnWallet/dawnWallet.ts
11
+ var dawnWallet = () => ({
12
+ id: "dawn",
13
+ name: "Dawn",
14
+ iconUrl: async () => (await import("./dawnWallet-MN7QMTX3.js")).default,
15
+ iconBackground: "#000000",
16
+ installed: hasInjectedProvider({ flag: "isDawn" }),
17
+ hidden: () => !isIOS(),
18
+ downloadUrls: {
19
+ ios: "https://apps.apple.com/us/app/dawn-ethereum-wallet/id1673143782",
20
+ mobile: "https://dawnwallet.xyz"
21
+ },
22
+ createConnector: getInjectedConnector({ flag: "isDawn" })
23
+ });
24
+
25
+ export {
26
+ dawnWallet
27
+ };