@funkit/connect 1.0.22 → 1.0.23

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 (42) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/components/FunCheckoutHistoryModal/FunCheckoutHistoryHelp.d.ts +2 -1
  3. package/dist/index.js +122 -71
  4. package/dist/utils/mesh.d.ts +7 -6
  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/bybitWallet/bybitWallet.js +2 -2
  8. package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
  9. package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
  10. package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
  11. package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
  12. package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
  13. package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
  14. package/dist/wallets/walletConnectors/index.js +64 -64
  15. package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
  16. package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
  17. package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
  18. package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
  19. package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
  20. package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
  21. package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
  22. package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
  23. package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
  24. package/package.json +3 -3
  25. package/dist/wallets/walletConnectors/chunk-2B3SPBRY.js +0 -100
  26. package/dist/wallets/walletConnectors/chunk-2GAW2UBU.js +0 -102
  27. package/dist/wallets/walletConnectors/chunk-7KDOXASH.js +0 -95
  28. package/dist/wallets/walletConnectors/chunk-CRSPGVPF.js +0 -105
  29. package/dist/wallets/walletConnectors/chunk-CUKVUCIP.js +0 -98
  30. package/dist/wallets/walletConnectors/chunk-DV3SI63E.js +0 -96
  31. package/dist/wallets/walletConnectors/chunk-GW6EF4G2.js +0 -92
  32. package/dist/wallets/walletConnectors/chunk-HD5VYJNC.js +0 -98
  33. package/dist/wallets/walletConnectors/chunk-IBWFKX7P.js +0 -94
  34. package/dist/wallets/walletConnectors/chunk-KGTZ6E7L.js +0 -71
  35. package/dist/wallets/walletConnectors/chunk-OKWOB3DN.js +0 -66
  36. package/dist/wallets/walletConnectors/chunk-RCWZ4KBR.js +0 -73
  37. package/dist/wallets/walletConnectors/chunk-RTW6PVQI.js +0 -107
  38. package/dist/wallets/walletConnectors/chunk-T6JVHES7.js +0 -87
  39. package/dist/wallets/walletConnectors/chunk-VSZ7PAHS.js +0 -94
  40. package/dist/wallets/walletConnectors/chunk-XNNLZXHE.js +0 -102
  41. package/dist/wallets/walletConnectors/chunk-XRMAVTK7.js +0 -178
  42. package/dist/wallets/walletConnectors/chunk-Z2HIQYVN.js +0 -96
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @funkit/connect
2
2
 
3
+ ## 1.0.23
4
+
5
+ ### Patch Changes
6
+
7
+ - cb71b0a: - fix: wallet balance load in payment method selection
8
+ - fix: icon sizes
9
+ - feat: auto back on successful report submission
10
+ - 774374b: fix: mesh preview and execute exchange type
11
+ - cebb243: fix: mesh holdings exchange type
12
+ - Updated dependencies [cebb243]
13
+ - @funkit/core@1.0.9
14
+ - @funkit/wagmi-tools@1.0.10
15
+
3
16
  ## 1.0.22
4
17
 
5
18
  ### Patch Changes
@@ -1,6 +1,7 @@
1
1
  import { CheckoutHistoryItem } from '@funkit/core';
2
2
  import React from 'react';
3
- export declare function FunCheckoutHistoryHelp({ checkoutHistoryInfo, animateOut, }: {
3
+ export declare function FunCheckoutHistoryHelp({ checkoutHistoryInfo, animateOut, onBackFromHelpPage, }: {
4
4
  checkoutHistoryInfo: CheckoutHistoryItem;
5
5
  animateOut: boolean;
6
+ onBackFromHelpPage: () => void;
6
7
  }): React.JSX.Element;
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-RA4J3G3B.js";
8
5
  import {
9
6
  darkTheme
10
7
  } from "./chunk-2GFNZKMA.js";
8
+ import {
9
+ lightTheme
10
+ } from "./chunk-RA4J3G3B.js";
11
11
  import "./chunk-UK5FXGK3.js";
12
12
 
13
13
  // src/components/ConnectButton/ConnectButton.tsx
@@ -133,7 +133,7 @@ import PrivyJS, {
133
133
  } from "@privy-io/js-sdk-core";
134
134
  import React146, {
135
135
  createContext as createContext17,
136
- useCallback as useCallback29,
136
+ useCallback as useCallback30,
137
137
  useContext as useContext23,
138
138
  useEffect as useEffect30,
139
139
  useMemo as useMemo36,
@@ -485,7 +485,7 @@ var useFunkitConnectChainsById = () => {
485
485
  // src/components/FunkitProvider/ModalContext.tsx
486
486
  import React145, {
487
487
  createContext as createContext16,
488
- useCallback as useCallback28,
488
+ useCallback as useCallback29,
489
489
  useContext as useContext22,
490
490
  useEffect as useEffect29,
491
491
  useMemo as useMemo35,
@@ -2708,9 +2708,9 @@ function FunkitCheckoutProvider({ children }) {
2708
2708
  } else if (newPaymentMethodInfo.paymentMethod === "brokerage" /* BROKERAGE */) {
2709
2709
  const meshMeta = newPaymentMethodInfo.meta;
2710
2710
  const meshAccessToken = (_c = (_b = (_a = meshMeta == null ? void 0 : meshMeta.accessToken) == null ? void 0 : _a.accountTokens) == null ? void 0 : _b[0]) == null ? void 0 : _c.accessToken;
2711
- const meshBrokerName = (_d = meshMeta == null ? void 0 : meshMeta.accessToken) == null ? void 0 : _d.brokerName;
2711
+ const meshExchangeType = (_d = meshMeta == null ? void 0 : meshMeta.accessToken) == null ? void 0 : _d.brokerType;
2712
2712
  const meshNetworkId = meshMeta == null ? void 0 : meshMeta.checkoutMeshNetworkId;
2713
- if (!meshMeta || !meshAccessToken || !meshBrokerName || !meshNetworkId) {
2713
+ if (!meshMeta || !meshAccessToken || !meshNetworkId || !meshExchangeType) {
2714
2714
  throw new Error("Missing mesh meta information");
2715
2715
  }
2716
2716
  const amountInCrypto = roundUpToXDecimalPlaces(
@@ -2719,7 +2719,7 @@ function FunkitCheckoutProvider({ children }) {
2719
2719
  );
2720
2720
  const dummyPreviewTransfer = await meshPreviewTransfer(
2721
2721
  meshAccessToken,
2722
- meshBrokerName,
2722
+ meshExchangeType,
2723
2723
  null,
2724
2724
  null,
2725
2725
  meshNetworkId,
@@ -3990,7 +3990,7 @@ import {
3990
3990
  meshGetLinkToken,
3991
3991
  meshGetTransferIntegrations
3992
3992
  } from "@funkit/core";
3993
- var FUNKIT_MESH_CLIENT_ID = "e1880c6d-5af8-4634-3182-08dba58a99a5";
3993
+ var FUNKIT_MESH_CLIENT_ID = "8132aff4-56c9-4b1d-85b4-08dbdcc6199d";
3994
3994
  var MeshExchanges = /* @__PURE__ */ ((MeshExchanges4) => {
3995
3995
  MeshExchanges4["Robinhood"] = "Robinhood";
3996
3996
  MeshExchanges4["ETrade"] = "ETrade";
@@ -4004,13 +4004,12 @@ var MeshExchanges = /* @__PURE__ */ ((MeshExchanges4) => {
4004
4004
  MeshExchanges4["CoinbasePro"] = "CoinbasePro";
4005
4005
  MeshExchanges4["CryptoCom"] = "CryptoCom";
4006
4006
  MeshExchanges4["Binance"] = "Binance";
4007
+ MeshExchanges4["BinanceUs"] = "BinanceUs";
4007
4008
  MeshExchanges4["Gemini"] = "Gemini";
4008
4009
  MeshExchanges4["OkCoin"] = "OkCoin";
4009
- MeshExchanges4["Bittrex"] = "Bittrex";
4010
4010
  MeshExchanges4["KuCoin"] = "KuCoin";
4011
4011
  MeshExchanges4["Etoro"] = "Etoro";
4012
4012
  MeshExchanges4["CexIo"] = "CexIo";
4013
- MeshExchanges4["BinanceInternational"] = "BinanceInternational";
4014
4013
  MeshExchanges4["Bitstamp"] = "Bitstamp";
4015
4014
  MeshExchanges4["GateIo"] = "GateIo";
4016
4015
  MeshExchanges4["Acorns"] = "Acorns";
@@ -4021,11 +4020,42 @@ var MeshExchanges = /* @__PURE__ */ ((MeshExchanges4) => {
4021
4020
  MeshExchanges4["Bitfinex"] = "Bitfinex";
4022
4021
  MeshExchanges4["KrakenDirect"] = "KrakenDirect";
4023
4022
  MeshExchanges4["Vanguard"] = "Vanguard";
4024
- MeshExchanges4["BinanceInternationalDirect"] = "BinanceInternationalDirect";
4025
4023
  MeshExchanges4["BitfinexDirect"] = "BitfinexDirect";
4026
4024
  MeshExchanges4["Bybit"] = "Bybit";
4027
4025
  return MeshExchanges4;
4028
4026
  })(MeshExchanges || {});
4027
+ var EXCHANGE_NAME_TO_TYPE = {
4028
+ ["Robinhood" /* Robinhood */]: "robinhood",
4029
+ ["ETrade" /* ETrade */]: "eTrade",
4030
+ ["Alpaca" /* Alpaca */]: "alpaca",
4031
+ ["WeBull" /* WeBull */]: "weBull",
4032
+ ["Stash" /* Stash */]: "stash",
4033
+ ["InteractiveBrokers" /* InteractiveBrokers */]: "interactiveBrokers",
4034
+ ["Public" /* Public */]: "public",
4035
+ ["Coinbase" /* Coinbase */]: "coinbase",
4036
+ ["Kraken" /* Kraken */]: "kraken",
4037
+ ["CryptoCom" /* CryptoCom */]: "cryptoCom",
4038
+ ["CoinbasePro" /* CoinbasePro */]: "coinbasePro",
4039
+ ["Gemini" /* Gemini */]: "gemini",
4040
+ ["Binance" /* Binance */]: "binanceInternationalDirect",
4041
+ ["BinanceUs" /* BinanceUs */]: "binanceUs",
4042
+ ["OkCoin" /* OkCoin */]: "okCoin",
4043
+ ["Etoro" /* Etoro */]: "etoro",
4044
+ ["KuCoin" /* KuCoin */]: "kuCoin",
4045
+ ["CexIo" /* CexIo */]: "cexIo",
4046
+ ["GateIo" /* GateIo */]: "gateIo",
4047
+ ["Bitstamp" /* Bitstamp */]: "bitstamp",
4048
+ ["Okx" /* Okx */]: "okx",
4049
+ ["Acorns" /* Acorns */]: "acorns",
4050
+ ["Coinlist" /* Coinlist */]: "coinlist",
4051
+ ["BitFlyer" /* BitFlyer */]: "bitFlyer",
4052
+ ["Bitfinex" /* Bitfinex */]: "bitfinex",
4053
+ ["Huobi" /* Huobi */]: "huobi",
4054
+ ["KrakenDirect" /* KrakenDirect */]: "krakenDirect",
4055
+ ["Vanguard" /* Vanguard */]: "vanguard",
4056
+ ["Bybit" /* Bybit */]: "bybit",
4057
+ ["BitfinexDirect" /* BitfinexDirect */]: "bitfinexDirect"
4058
+ };
4029
4059
  async function fetchMeshLinkToken(selectedExchange, funApiKey) {
4030
4060
  return await meshGetLinkToken(
4031
4061
  "meshconnectkit",
@@ -4035,10 +4065,10 @@ async function fetchMeshLinkToken(selectedExchange, funApiKey) {
4035
4065
  funApiKey
4036
4066
  );
4037
4067
  }
4038
- async function executeBrokerageDeposit(fromAuthToken, brokerage, previewId, apiKey, mfaCode) {
4068
+ async function executeBrokerageDeposit(fromAuthToken, fromType, previewId, apiKey, mfaCode) {
4039
4069
  const executeTransfer = await meshExecuteTransfer(
4040
4070
  fromAuthToken,
4041
- brokerage,
4071
+ fromType,
4042
4072
  previewId,
4043
4073
  mfaCode,
4044
4074
  apiKey
@@ -4050,7 +4080,8 @@ async function fetchMeshAccountCryptoHoldings({
4050
4080
  apiKey,
4051
4081
  exchange
4052
4082
  }) {
4053
- const res = await meshGetCryptocurrencyHoldings(authToken, exchange, apiKey);
4083
+ const type = EXCHANGE_NAME_TO_TYPE[exchange];
4084
+ const res = await meshGetCryptocurrencyHoldings(authToken, type, apiKey);
4054
4085
  return res.cryptocurrencyPositions;
4055
4086
  }
4056
4087
  async function fetchMeshSupportedTokensByBrokerageAndSupportedFunkitChains({
@@ -4059,7 +4090,7 @@ async function fetchMeshSupportedTokensByBrokerageAndSupportedFunkitChains({
4059
4090
  }) {
4060
4091
  const res = await meshGetTransferIntegrations(apiKey);
4061
4092
  const item = res.integrations.find(
4062
- (item2) => item2.type === (exchange == null ? void 0 : exchange.toLowerCase())
4093
+ (item2) => item2.type === EXCHANGE_NAME_TO_TYPE[exchange]
4063
4094
  );
4064
4095
  const filteredNetworks = ((item == null ? void 0 : item.networks) || []).filter((networkItem) => {
4065
4096
  return (networkItem == null ? void 0 : networkItem.chainId) && FUNKIT_CONNECT_SUPPORTED_CHAINS_ID_LIST.includes(
@@ -5377,7 +5408,7 @@ function FunMeshVerificationStep({
5377
5408
  logger.log("inputs", { finalOtpInput });
5378
5409
  const res = await executeBrokerageDeposit(
5379
5410
  accessToken,
5380
- exchange,
5411
+ EXCHANGE_NAME_TO_TYPE[exchange],
5381
5412
  previewId,
5382
5413
  funkitConfig == null ? void 0 : funkitConfig.apiKey,
5383
5414
  finalOtpInput
@@ -5443,7 +5474,7 @@ function FunMeshVerificationStep({
5443
5474
  case "mfaRequired" /* mfaRequired */:
5444
5475
  case "mfaFailed" /* mfaFailed */:
5445
5476
  case "secondMfaRequired" /* secondMfaRequired */:
5446
- return `Please enter the two factor code associated with your ${exchange} account. Once done, click "Continue" below.`;
5477
+ return `Please enter the${(executionContent == null ? void 0 : executionContent.mfaType) && (executionContent == null ? void 0 : executionContent.mfaType) !== "unspecified" /* unspecified */ ? ` ${executionContent.mfaType} ` : " "}two factor code associated with your ${exchange} account. Once done, click "Continue" below.`;
5447
5478
  case "deviceConfirmationRequired" /* deviceConfirmationRequired */:
5448
5479
  return `Open the ${exchange} app on your mobile device and verify that you are trying to transfer crypto. Once done, click "Continue" below.`;
5449
5480
  case "emailConfirmationRequired" /* emailConfirmationRequired */:
@@ -5453,7 +5484,7 @@ function FunMeshVerificationStep({
5453
5484
  case "failed" /* failed */:
5454
5485
  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.";
5455
5486
  }
5456
- }, [exchange, executionStatus]);
5487
+ }, [exchange, executionContent == null ? void 0 : executionContent.mfaType, executionStatus]);
5457
5488
  return /* @__PURE__ */ React53.createElement(Box, null, screen === 0 /* INITIAL */ ? /* @__PURE__ */ React53.createElement(Box, {
5458
5489
  width: "full",
5459
5490
  height: "200",
@@ -5985,7 +6016,7 @@ function AddPaymentMethodItem({
5985
6016
  }) {
5986
6017
  const config = PAYMENT_METHOD_CONFIG[paymentMethod];
5987
6018
  const { textCustomizations, paymentsConfig } = useFunkitConfig();
5988
- const { walletAddress } = useGeneralWallet();
6019
+ const { walletAddress, walletAssets } = useGeneralWallet();
5989
6020
  const isEnabledForFlow = useMemo14(() => {
5990
6021
  if (paymentFlow === 1 /* CHECKOUT */) {
5991
6022
  return config.isEnabledForCheckout;
@@ -5999,7 +6030,12 @@ function AddPaymentMethodItem({
5999
6030
  textCustomizations,
6000
6031
  formatAddressLastFour(walletAddress || "")
6001
6032
  );
6002
- const isDisabled = !isClickable || !isEnabledForFlow;
6033
+ const isWalletBalanceAndAssetStillLoading = useMemo14(() => {
6034
+ return paymentMethod === "balance" /* ACCOUNT_BALANCE */ && walletAssets == null;
6035
+ }, [paymentMethod, walletAssets]);
6036
+ const isDisabled = useMemo14(() => {
6037
+ return !isClickable || !isEnabledForFlow || isWalletBalanceAndAssetStillLoading;
6038
+ }, [isClickable, isEnabledForFlow, isWalletBalanceAndAssetStillLoading]);
6003
6039
  const valueIcon = disclaimerText ? config.timeIcon : /* @__PURE__ */ React63.createElement(Box, {
6004
6040
  display: "flex",
6005
6041
  gap: "4",
@@ -6009,7 +6045,10 @@ function AddPaymentMethodItem({
6009
6045
  return /* @__PURE__ */ React63.createElement(React63.Fragment, null);
6010
6046
  }
6011
6047
  return /* @__PURE__ */ React63.createElement(FunKeyValue, {
6012
- keyIcon: config.icon,
6048
+ keyIcon: isWalletBalanceAndAssetStillLoading ? /* @__PURE__ */ React63.createElement(SpinnerIcon, {
6049
+ width: 24,
6050
+ height: 24
6051
+ }) : config.icon,
6013
6052
  keyText: labelText,
6014
6053
  valueIcon,
6015
6054
  valueText: config.timeRange,
@@ -6021,7 +6060,7 @@ function AddPaymentMethodItem({
6021
6060
  valueTextColor: isActive ? "buttonTextPrimary" : "modalText",
6022
6061
  onClick: isActive ? null : () => onClick == null ? void 0 : onClick(),
6023
6062
  isDisabled,
6024
- disclaimerText
6063
+ disclaimerText: isWalletBalanceAndAssetStillLoading ? "Fetching balance..." : disclaimerText
6025
6064
  });
6026
6065
  }
6027
6066
  function ExistingPaymentMethodItem({
@@ -7506,7 +7545,6 @@ function FunPaymentMoonpayType({
7506
7545
  }, [finalConvertedAssetName, funkitConfig == null ? void 0 : funkitConfig.appName, depositToken]);
7507
7546
  const moonpayButtonColor = useMemo19(() => {
7508
7547
  const primaryButtonHex = colorToHex(active2.colors.buttonPrimary);
7509
- console.log("primaryButonHex", primaryButtonHex);
7510
7548
  if (["#FFF", "#FFFF", "#FFFFFF", "#FFFFFFFF"].includes(primaryButtonHex)) {
7511
7549
  return void 0;
7512
7550
  } else {
@@ -7900,7 +7938,7 @@ function Deposit({
7900
7938
  }
7901
7939
  const previewTransfer = await meshPreviewTransfer2(
7902
7940
  (_f2 = (_e2 = (_d2 = selectedPaymentMethodInfo == null ? void 0 : selectedPaymentMethodInfo.meta) == null ? void 0 : _d2.accessToken) == null ? void 0 : _e2.accountTokens) == null ? void 0 : _f2[0].accessToken,
7903
- (_h2 = (_g2 = selectedPaymentMethodInfo == null ? void 0 : selectedPaymentMethodInfo.meta) == null ? void 0 : _g2.accessToken) == null ? void 0 : _h2.brokerName,
7941
+ (_h2 = (_g2 = selectedPaymentMethodInfo == null ? void 0 : selectedPaymentMethodInfo.meta) == null ? void 0 : _g2.accessToken) == null ? void 0 : _h2.brokerType,
7904
7942
  null,
7905
7943
  null,
7906
7944
  meshNetworkInfo.meshNetworkId,
@@ -8423,7 +8461,8 @@ var HomeTokenBalanceDisplayRow = ({ asset }) => {
8423
8461
  assetSrc: asset.logo,
8424
8462
  assetName: asset.name,
8425
8463
  assetTicker: asset.symbol,
8426
- chainId: asset.chainId
8464
+ chainId: asset.chainId,
8465
+ chainIconSize: "14"
8427
8466
  }), /* @__PURE__ */ React92.createElement(Box, {
8428
8467
  display: "flex",
8429
8468
  flexDirection: "column",
@@ -12367,7 +12406,7 @@ function ConnectModal({ onClose, open }) {
12367
12406
  }
12368
12407
 
12369
12408
  // src/components/FunCheckoutHistoryModal/FunCheckoutHistoryModal.tsx
12370
- import React143, { useMemo as useMemo34, useState as useState40 } from "react";
12409
+ import React143, { useCallback as useCallback28, useMemo as useMemo34, useState as useState40 } from "react";
12371
12410
 
12372
12411
  // src/components/FunCheckoutHistoryModal/FunCheckoutHistoryDetail.tsx
12373
12412
  import {
@@ -12517,7 +12556,7 @@ function FunCheckoutConfirmationStep({
12517
12556
  }
12518
12557
  return await meshPreviewTransfer3(
12519
12558
  (_h2 = (_g2 = (_f2 = (_e2 = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _e2.meta) == null ? void 0 : _f2.accessToken) == null ? void 0 : _g2.accountTokens) == null ? void 0 : _h2[0].accessToken,
12520
- (_k2 = (_j2 = (_i2 = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _i2.meta) == null ? void 0 : _j2.accessToken) == null ? void 0 : _k2.brokerName,
12559
+ (_k2 = (_j2 = (_i2 = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _i2.meta) == null ? void 0 : _j2.accessToken) == null ? void 0 : _k2.brokerType,
12521
12560
  null,
12522
12561
  null,
12523
12562
  (_m2 = (_l2 = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _l2.meta) == null ? void 0 : _m2.checkoutMeshNetworkId,
@@ -12535,7 +12574,7 @@ function FunCheckoutConfirmationStep({
12535
12574
  [
12536
12575
  (_b = checkoutItem == null ? void 0 : checkoutItem.latestQuote) == null ? void 0 : _b.baseQuote.estTotalFromAmount,
12537
12576
  (_e = (_d = (_c = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _c.meta) == null ? void 0 : _d.accessToken) == null ? void 0 : _e.accountTokens,
12538
- (_h = (_g = (_f = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _f.meta) == null ? void 0 : _g.accessToken) == null ? void 0 : _h.brokerName,
12577
+ (_h = (_g = (_f = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _f.meta) == null ? void 0 : _g.accessToken) == null ? void 0 : _h.brokerType,
12539
12578
  (_j = (_i = checkoutItem == null ? void 0 : checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _i.meta) == null ? void 0 : _j.checkoutMeshNetworkId,
12540
12579
  (_k = checkoutItem == null ? void 0 : checkoutItem.selectedSourceAssetInfo) == null ? void 0 : _k.symbol,
12541
12580
  funkitConfig.apiKey
@@ -12593,7 +12632,9 @@ function FunCheckoutConfirmationStep({
12593
12632
  return;
12594
12633
  const sourceAssetChainId = checkoutItem.selectedSourceAssetInfo.chainId;
12595
12634
  const sourceAssetAddress = (_b2 = checkoutItem == null ? void 0 : checkoutItem.selectedSourceAssetInfo) == null ? void 0 : _b2.address;
12596
- const sourceAssetAmountBaseUnit = checkoutItem.latestQuote.baseQuote.estTotalFromAmountBaseUnit;
12635
+ const sourceAssetAmountBaseUnit = BigInt(
12636
+ checkoutItem.latestQuote.baseQuote.estTotalFromAmountBaseUnit
12637
+ );
12597
12638
  if (parseInt(sourceAssetChainId) !== (chain == null ? void 0 : chain.id)) {
12598
12639
  logger.log("handleWeb3AccountBalancePostCheckout_needToSwitchChhain", {
12599
12640
  sourceAssetChainId,
@@ -12612,9 +12653,12 @@ function FunCheckoutConfirmationStep({
12612
12653
  const hash = await sendTransactionAsync({
12613
12654
  chainId: parseInt(sourceAssetChainId),
12614
12655
  to: depositAddress,
12615
- value: BigInt(sourceAssetAmountBaseUnit)
12656
+ value: sourceAssetAmountBaseUnit
12657
+ });
12658
+ logger.log("handleWeb3AccountBalancePostCheckout_hash", {
12659
+ hash,
12660
+ sourceAssetAmountBaseUnit
12616
12661
  });
12617
- logger.log("handleWeb3AccountBalancePostCheckout_hash", { hash });
12618
12662
  } else {
12619
12663
  const hash = await writeContractAsync({
12620
12664
  chainId: parseInt(sourceAssetChainId),
@@ -12623,7 +12667,10 @@ function FunCheckoutConfirmationStep({
12623
12667
  functionName: "transfer",
12624
12668
  args: [depositAddress, sourceAssetAmountBaseUnit]
12625
12669
  });
12626
- logger.log("handleWeb3AccountBalancePostCheckout_hash", { hash });
12670
+ logger.log("handleWeb3AccountBalancePostCheckout_hash", {
12671
+ hash,
12672
+ sourceAssetAmountBaseUnit
12673
+ });
12627
12674
  }
12628
12675
  setPostCheckoutStepMessage("");
12629
12676
  },
@@ -14138,7 +14185,8 @@ var FIVE_MINUTES_MS = 3e5;
14138
14185
  var FIVE_SECONDS_MS = 5e3;
14139
14186
  function FunCheckoutHistoryHelp({
14140
14187
  checkoutHistoryInfo,
14141
- animateOut
14188
+ animateOut,
14189
+ onBackFromHelpPage
14142
14190
  }) {
14143
14191
  const { appName, apiKey } = useFunkitConfig();
14144
14192
  const { userInfo } = useGeneralWallet();
@@ -14215,6 +14263,7 @@ function FunCheckoutHistoryHelp({
14215
14263
  },
14216
14264
  FIVE_SECONDS_MS
14217
14265
  );
14266
+ onBackFromHelpPage();
14218
14267
  } else {
14219
14268
  showToast(
14220
14269
  {
@@ -14334,17 +14383,18 @@ function FunCheckoutHistoryModal({
14334
14383
  );
14335
14384
  const ANIMATION_DELAY2 = 150;
14336
14385
  const [animateOut, setAnimateOut] = useState40(false);
14386
+ const onBackFromHelpPage = useCallback28(() => {
14387
+ setAnimateOut(true);
14388
+ setTimeout(() => {
14389
+ setCurrentPage("detail" /* DETAIL */);
14390
+ setAnimateOut(false);
14391
+ }, ANIMATION_DELAY2);
14392
+ }, []);
14337
14393
  const titleConfig = useMemo34(() => {
14338
14394
  if (currentPage === "help" /* HELP */) {
14339
14395
  return {
14340
14396
  hasBackButton: true,
14341
- onBack: () => {
14342
- setAnimateOut(true);
14343
- setTimeout(() => {
14344
- setCurrentPage("detail" /* DETAIL */);
14345
- setAnimateOut(false);
14346
- }, ANIMATION_DELAY2);
14347
- },
14397
+ onBack: onBackFromHelpPage,
14348
14398
  title: "Get Help"
14349
14399
  };
14350
14400
  } else {
@@ -14354,7 +14404,7 @@ function FunCheckoutHistoryModal({
14354
14404
  title: "Order"
14355
14405
  };
14356
14406
  }
14357
- }, [currentPage]);
14407
+ }, [currentPage, onBackFromHelpPage]);
14358
14408
  return /* @__PURE__ */ React143.createElement(Dialog, {
14359
14409
  open,
14360
14410
  onClose,
@@ -14385,7 +14435,8 @@ function FunCheckoutHistoryModal({
14385
14435
  animateOut
14386
14436
  }) : currentPage === "help" /* HELP */ ? /* @__PURE__ */ React143.createElement(FunCheckoutHistoryHelp, {
14387
14437
  checkoutHistoryInfo,
14388
- animateOut
14438
+ animateOut,
14439
+ onBackFromHelpPage
14389
14440
  }) : null : null)));
14390
14441
  }
14391
14442
 
@@ -14405,22 +14456,22 @@ function FunDevTestModal({ onClose, open }) {
14405
14456
  function useModalStateValue() {
14406
14457
  const [isModalOpen, setModalOpen] = useState41(false);
14407
14458
  return {
14408
- closeModal: useCallback28(() => setModalOpen(false), []),
14459
+ closeModal: useCallback29(() => setModalOpen(false), []),
14409
14460
  isModalOpen,
14410
- openModal: useCallback28(() => setModalOpen(true), [])
14461
+ openModal: useCallback29(() => setModalOpen(true), [])
14411
14462
  };
14412
14463
  }
14413
14464
  function useModalStateValueWithId() {
14414
14465
  const [isModalOpen, setModalOpen] = useState41(false);
14415
14466
  const [modalId, setModalId] = useState41(null);
14416
14467
  return {
14417
- closeModal: useCallback28(() => {
14468
+ closeModal: useCallback29(() => {
14418
14469
  setModalId(null);
14419
14470
  setModalOpen(false);
14420
14471
  }, []),
14421
14472
  isModalOpen,
14422
14473
  modalId,
14423
- openModal: useCallback28((id) => {
14474
+ openModal: useCallback29((id) => {
14424
14475
  setModalId(id);
14425
14476
  setModalOpen(true);
14426
14477
  }, [])
@@ -14861,7 +14912,7 @@ var FunkitWeb2Provider = ({
14861
14912
  const [isLoggingIn, setIsLoggingIn] = useState42(false);
14862
14913
  const [loginErrorMessage, setLoginErrorMessage] = useState42("");
14863
14914
  const [loggedInUser, setLoggedInUser] = useState42(null);
14864
- const setLoginMethodAndCache = useCallback29(
14915
+ const setLoginMethodAndCache = useCallback30(
14865
14916
  (method) => {
14866
14917
  try {
14867
14918
  setLoginMethod(method);
@@ -14884,7 +14935,7 @@ var FunkitWeb2Provider = ({
14884
14935
  setPrivyIframeUrl(newPrivy.embeddedWallet.getURL());
14885
14936
  setPrivy(newPrivy);
14886
14937
  }, [funkitConfig.privyAppId]);
14887
- const handleIframeMessage = useCallback29(
14938
+ const handleIframeMessage = useCallback30(
14888
14939
  (e) => {
14889
14940
  if (e.origin === PRIVY_AUTH_URL && privy) {
14890
14941
  const iframeHandler = privy.embeddedWallet.getMessageHandler();
@@ -14893,7 +14944,7 @@ var FunkitWeb2Provider = ({
14893
14944
  },
14894
14945
  [privy]
14895
14946
  );
14896
- const handleFunkitWeb2Logout = useCallback29(async () => {
14947
+ const handleFunkitWeb2Logout = useCallback30(async () => {
14897
14948
  if (privy) {
14898
14949
  logger.log("handleFunkitWeb2Logout_disconnecting_connectors", {
14899
14950
  numConnectors: connectors.length
@@ -14906,7 +14957,7 @@ var FunkitWeb2Provider = ({
14906
14957
  setLoginMethodAndCache(null);
14907
14958
  }
14908
14959
  }, [connectors, disconnectAsync, privy, setLoginMethodAndCache]);
14909
- const handleFreshPrivyLogin = useCallback29(
14960
+ const handleFreshPrivyLogin = useCallback30(
14910
14961
  async ({
14911
14962
  firstLoginCode,
14912
14963
  secondLoginCode,
@@ -14953,7 +15004,7 @@ var FunkitWeb2Provider = ({
14953
15004
  },
14954
15005
  [handleFunkitWeb2Logout, privy]
14955
15006
  );
14956
- const getPrivyUserEmbeddedWallet = useCallback29(
15007
+ const getPrivyUserEmbeddedWallet = useCallback30(
14957
15008
  async (inputPrivyUser) => {
14958
15009
  try {
14959
15010
  if (!privy || !inputPrivyUser)
@@ -14971,7 +15022,7 @@ var FunkitWeb2Provider = ({
14971
15022
  },
14972
15023
  [privy]
14973
15024
  );
14974
- const getExistingPrivySession = useCallback29(async () => {
15025
+ const getExistingPrivySession = useCallback30(async () => {
14975
15026
  try {
14976
15027
  if (!privy)
14977
15028
  throw new Error(ERROR_MESSAGES.PRIVY_NOT_INITIALIZED);
@@ -14981,7 +15032,7 @@ var FunkitWeb2Provider = ({
14981
15032
  return null;
14982
15033
  }
14983
15034
  }, [privy]);
14984
- const handleFunkitWeb2Login = useCallback29(
15035
+ const handleFunkitWeb2Login = useCallback30(
14985
15036
  async ({
14986
15037
  chainId,
14987
15038
  firstLoginCode,
@@ -15054,9 +15105,9 @@ var FunkitWeb2Provider = ({
15054
15105
  wallets
15055
15106
  ]
15056
15107
  );
15057
- const clearLoginError = useCallback29(() => setLoginErrorMessage(""), []);
15108
+ const clearLoginError = useCallback30(() => setLoginErrorMessage(""), []);
15058
15109
  const initChainId = useInitialChainId();
15059
- const handleAutoLoginFlows = useCallback29(async () => {
15110
+ const handleAutoLoginFlows = useCallback30(async () => {
15060
15111
  if (isNotNullish(loginMethod) && isNotNullish(initChainId)) {
15061
15112
  const queryParams = new URLSearchParams(window.location.search);
15062
15113
  const oauthCode = queryParams.get(PRIVY_OAUTH_CODE_URL_PARAM);
@@ -15092,7 +15143,7 @@ var FunkitWeb2Provider = ({
15092
15143
  handleIframeMessage,
15093
15144
  initChainId
15094
15145
  ]);
15095
- const handleOauthRedirect = useCallback29(
15146
+ const handleOauthRedirect = useCallback30(
15096
15147
  async (authProvider) => {
15097
15148
  if (!privy)
15098
15149
  throw new Error(ERROR_MESSAGES.PRIVY_NOT_INITIALIZED);
@@ -15117,7 +15168,7 @@ var FunkitWeb2Provider = ({
15117
15168
  [privy, setLoginMethodAndCache]
15118
15169
  );
15119
15170
  const [isSendingOtpEmail, setIsSendingOtpEmail] = useState42(false);
15120
- const handleSendOtpEmail = useCallback29(
15171
+ const handleSendOtpEmail = useCallback30(
15121
15172
  async (emailAddress) => {
15122
15173
  try {
15123
15174
  if (!privy)
@@ -15145,7 +15196,7 @@ var FunkitWeb2Provider = ({
15145
15196
  [privy, setLoginMethodAndCache]
15146
15197
  );
15147
15198
  const [isGeneratingFcUri, setIsGeneratingFcUri] = useState42(false);
15148
- const handleGenerateFcUri = useCallback29(async () => {
15199
+ const handleGenerateFcUri = useCallback30(async () => {
15149
15200
  try {
15150
15201
  if (!privy)
15151
15202
  throw new Error(ERROR_MESSAGES.PRIVY_NOT_INITIALIZED);
@@ -15171,7 +15222,7 @@ var FunkitWeb2Provider = ({
15171
15222
  setIsGeneratingFcUri(false);
15172
15223
  }
15173
15224
  }, [privy]);
15174
- const getFcConnectionStatus = useCallback29(
15225
+ const getFcConnectionStatus = useCallback30(
15175
15226
  async (channelToken) => {
15176
15227
  try {
15177
15228
  if (!privy)
@@ -15321,7 +15372,7 @@ import React150, { useContext as useContext26 } from "react";
15321
15372
  import { useAccount as useAccount16, useBalance, useConfig as useConfig5 } from "wagmi";
15322
15373
 
15323
15374
  // src/hooks/useIsMounted.ts
15324
- import { useCallback as useCallback30, useEffect as useEffect31, useState as useState44 } from "react";
15375
+ import { useCallback as useCallback31, useEffect as useEffect31, useState as useState44 } from "react";
15325
15376
  function useIsMounted() {
15326
15377
  const [isMounted, setIsMounted] = useState44(false);
15327
15378
  useEffect31(() => {
@@ -15330,7 +15381,7 @@ function useIsMounted() {
15330
15381
  setIsMounted(false);
15331
15382
  };
15332
15383
  }, []);
15333
- return useCallback30(() => isMounted, [isMounted]);
15384
+ return useCallback31(() => isMounted, [isMounted]);
15334
15385
  }
15335
15386
 
15336
15387
  // src/hooks/useMainnetEnsAvatar.ts
@@ -16686,16 +16737,16 @@ function generateInnerWagmiConfig(props) {
16686
16737
  }
16687
16738
 
16688
16739
  // src/components/FunkitProvider/useFingerprint.ts
16689
- import { useCallback as useCallback31, useEffect as useEffect35 } from "react";
16740
+ import { useCallback as useCallback32, useEffect as useEffect35 } from "react";
16690
16741
  var storageKey6 = "funkit-connect-version";
16691
16742
  function setFunkitConnectVersion({ version }) {
16692
16743
  localStorage.setItem(storageKey6, version);
16693
16744
  }
16694
16745
  function getCurrentSdkVersion() {
16695
- return "1.0.22";
16746
+ return "1.0.23";
16696
16747
  }
16697
16748
  function useFingerprint() {
16698
- const fingerprint = useCallback31(() => {
16749
+ const fingerprint = useCallback32(() => {
16699
16750
  setFunkitConnectVersion({ version: getCurrentSdkVersion() });
16700
16751
  }, []);
16701
16752
  useEffect35(() => {
@@ -16704,12 +16755,12 @@ function useFingerprint() {
16704
16755
  }
16705
16756
 
16706
16757
  // src/components/FunkitProvider/usePreloadImages.ts
16707
- import { useCallback as useCallback32, useEffect as useEffect36 } from "react";
16758
+ import { useCallback as useCallback33, useEffect as useEffect36 } from "react";
16708
16759
  function usePreloadImages() {
16709
16760
  const funkitConnectChains = useFunkitConnectChains();
16710
16761
  const walletConnectors = useWalletConnectors();
16711
16762
  const isUnauthenticated = useAuthenticationStatus() === "unauthenticated";
16712
- const preloadImages = useCallback32(() => {
16763
+ const preloadImages = useCallback33(() => {
16713
16764
  loadImages(
16714
16765
  ...walletConnectors.map((wallet) => wallet.iconUrl),
16715
16766
  ...funkitConnectChains.map((chain) => chain.iconUrl).filter(isNotNullish)
@@ -17042,7 +17093,7 @@ function getDefaultWallets(parameters) {
17042
17093
 
17043
17094
  // src/components/ConnectOptions/MobileOptions.tsx
17044
17095
  import React155, {
17045
- useCallback as useCallback33,
17096
+ useCallback as useCallback34,
17046
17097
  useContext as useContext31,
17047
17098
  useEffect as useEffect39,
17048
17099
  useRef as useRef12,
@@ -17099,7 +17150,7 @@ function WalletButton2({
17099
17150
  const coolModeRef = useCoolMode(iconUrl);
17100
17151
  const initialized = useRef12(false);
17101
17152
  const { i18n: i18n2 } = useContext31(I18nContext);
17102
- const onConnect = useCallback33(async () => {
17153
+ const onConnect = useCallback34(async () => {
17103
17154
  const onMobileUri = async () => {
17104
17155
  const mobileUri = await (getMobileUri == null ? void 0 : getMobileUri());
17105
17156
  if (!mobileUri)
@@ -17437,13 +17488,13 @@ var __private__ = {
17437
17488
  };
17438
17489
 
17439
17490
  // src/transactions/useAddRecentTransaction.ts
17440
- import { useCallback as useCallback34 } from "react";
17491
+ import { useCallback as useCallback35 } from "react";
17441
17492
  import { useAccount as useAccount18 } from "wagmi";
17442
17493
  function useAddRecentTransaction() {
17443
17494
  const store = useTransactionStore();
17444
17495
  const { address } = useAccount18();
17445
17496
  const chainId = useChainId();
17446
- return useCallback34(
17497
+ return useCallback35(
17447
17498
  (transaction) => {
17448
17499
  if (!address || !chainId) {
17449
17500
  throw new Error("No address or chain ID found");
@@ -1,4 +1,4 @@
1
- export declare const FUNKIT_MESH_CLIENT_ID = "e1880c6d-5af8-4634-3182-08dba58a99a5";
1
+ export declare const FUNKIT_MESH_CLIENT_ID = "8132aff4-56c9-4b1d-85b4-08dbdcc6199d";
2
2
  export declare enum MeshExchanges {
3
3
  Robinhood = "Robinhood",
4
4
  ETrade = "ETrade",
@@ -11,14 +11,13 @@ export declare enum MeshExchanges {
11
11
  Kraken = "Kraken",
12
12
  CoinbasePro = "CoinbasePro",
13
13
  CryptoCom = "CryptoCom",
14
- Binance = "Binance",
14
+ Binance = "Binance",// BinanceInternationalDirect
15
+ BinanceUs = "BinanceUs",
15
16
  Gemini = "Gemini",
16
17
  OkCoin = "OkCoin",
17
- Bittrex = "Bittrex",
18
18
  KuCoin = "KuCoin",
19
19
  Etoro = "Etoro",
20
20
  CexIo = "CexIo",
21
- BinanceInternational = "BinanceInternational",
22
21
  Bitstamp = "Bitstamp",
23
22
  GateIo = "GateIo",
24
23
  Acorns = "Acorns",
@@ -29,10 +28,12 @@ export declare enum MeshExchanges {
29
28
  Bitfinex = "Bitfinex",
30
29
  KrakenDirect = "KrakenDirect",
31
30
  Vanguard = "Vanguard",
32
- BinanceInternationalDirect = "BinanceInternationalDirect",
33
31
  BitfinexDirect = "BitfinexDirect",
34
32
  Bybit = "Bybit"
35
33
  }
34
+ export declare const EXCHANGE_NAME_TO_TYPE: {
35
+ [x: string]: string;
36
+ };
36
37
  export declare function fetchMeshLinkToken(selectedExchange: MeshExchanges, funApiKey: string): Promise<any>;
37
38
  export declare enum MeshExecuteTransferStatus {
38
39
  succeeded = "succeeded",
@@ -56,7 +57,7 @@ export interface MeshExecuteTransferContent {
56
57
  errorMessage: string | null;
57
58
  executeTransferResult: object | null;
58
59
  }
59
- export declare function executeBrokerageDeposit(fromAuthToken: string, brokerage: string, previewId: string, apiKey: string, mfaCode?: string): Promise<MeshExecuteTransferContent>;
60
+ export declare function executeBrokerageDeposit(fromAuthToken: string, fromType: string, previewId: string, apiKey: string, mfaCode?: string): Promise<MeshExecuteTransferContent>;
60
61
  export declare function fetchMeshAccountCryptoHoldings({ authToken, apiKey, exchange, }: {
61
62
  authToken: string;
62
63
  apiKey: string;