@funkit/connect 1.0.14 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/components/FunButton/FunButton.d.ts +3 -2
- package/dist/components/FunCheckoutHistoryModal/FunCheckoutHistoryDetail.d.ts +5 -2
- package/dist/components/FunCheckoutHistoryModal/FunCheckoutHistoryHelp.d.ts +6 -0
- package/dist/components/FunCheckoutHistoryModal/FunCheckoutHistoryModal.d.ts +4 -0
- package/dist/components/FunInput/FunTextAreaInput.d.ts +8 -0
- package/dist/consts/quote.d.ts +9 -0
- package/dist/index.js +581 -241
- package/dist/utils/checkout.d.ts +8 -1
- package/dist/utils/formatTimestamp.d.ts +2 -1
- package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
- package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
- package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
- package/dist/wallets/walletConnectors/chunk-2B3SPBRY.js +100 -0
- package/dist/wallets/walletConnectors/chunk-2GAW2UBU.js +102 -0
- package/dist/wallets/walletConnectors/chunk-7KDOXASH.js +95 -0
- package/dist/wallets/walletConnectors/chunk-CRSPGVPF.js +105 -0
- package/dist/wallets/walletConnectors/chunk-CUKVUCIP.js +98 -0
- package/dist/wallets/walletConnectors/chunk-DV3SI63E.js +96 -0
- package/dist/wallets/walletConnectors/chunk-GW6EF4G2.js +92 -0
- package/dist/wallets/walletConnectors/chunk-HD5VYJNC.js +98 -0
- package/dist/wallets/walletConnectors/chunk-IBWFKX7P.js +94 -0
- package/dist/wallets/walletConnectors/chunk-KGTZ6E7L.js +71 -0
- package/dist/wallets/walletConnectors/chunk-OKWOB3DN.js +66 -0
- package/dist/wallets/walletConnectors/chunk-RCWZ4KBR.js +73 -0
- package/dist/wallets/walletConnectors/chunk-RTW6PVQI.js +107 -0
- package/dist/wallets/walletConnectors/chunk-T6JVHES7.js +87 -0
- package/dist/wallets/walletConnectors/chunk-VSZ7PAHS.js +94 -0
- package/dist/wallets/walletConnectors/chunk-XNNLZXHE.js +102 -0
- package/dist/wallets/walletConnectors/chunk-XRMAVTK7.js +178 -0
- package/dist/wallets/walletConnectors/chunk-Z2HIQYVN.js +96 -0
- package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
- package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
- package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
- package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
- package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
- package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
- package/dist/wallets/walletConnectors/index.js +74 -74
- package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
- package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
- package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
- package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
- package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
- package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
- package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
- package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
- package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
- package/package.json +14 -14
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import "./chunk-UK5FXGK3.js";
|
|
12
12
|
|
|
13
13
|
// src/components/ConnectButton/ConnectButton.tsx
|
|
14
|
-
import
|
|
14
|
+
import React148, { useContext as useContext27, useEffect as useEffect32, useState as useState46 } from "react";
|
|
15
15
|
|
|
16
16
|
// src/css/sprinkles.css.ts
|
|
17
17
|
import { createMapValueFn as _51c72 } from "@vanilla-extract/sprinkles/createUtils";
|
|
@@ -131,13 +131,13 @@ import PrivyJS, {
|
|
|
131
131
|
getUserEmbeddedWallet,
|
|
132
132
|
LocalStorage
|
|
133
133
|
} from "@privy-io/js-sdk-core";
|
|
134
|
-
import
|
|
134
|
+
import React143, {
|
|
135
135
|
createContext as createContext17,
|
|
136
136
|
useCallback as useCallback27,
|
|
137
137
|
useContext as useContext23,
|
|
138
138
|
useEffect as useEffect28,
|
|
139
|
-
useMemo as
|
|
140
|
-
useState as
|
|
139
|
+
useMemo as useMemo34,
|
|
140
|
+
useState as useState41
|
|
141
141
|
} from "react";
|
|
142
142
|
import { useConnect as useConnect2, useDisconnect as useDisconnect3 } from "wagmi";
|
|
143
143
|
|
|
@@ -482,13 +482,13 @@ var useFunkitConnectChainsById = () => {
|
|
|
482
482
|
};
|
|
483
483
|
|
|
484
484
|
// src/components/FunkitProvider/ModalContext.tsx
|
|
485
|
-
import
|
|
485
|
+
import React142, {
|
|
486
486
|
createContext as createContext16,
|
|
487
487
|
useCallback as useCallback26,
|
|
488
488
|
useContext as useContext22,
|
|
489
489
|
useEffect as useEffect27,
|
|
490
|
-
useMemo as
|
|
491
|
-
useState as
|
|
490
|
+
useMemo as useMemo33,
|
|
491
|
+
useState as useState40
|
|
492
492
|
} from "react";
|
|
493
493
|
import { useAccount as useAccount11, useAccountEffect as useAccountEffect2, useConfig as useConfig4 } from "wagmi";
|
|
494
494
|
|
|
@@ -1725,10 +1725,18 @@ var QUOTE_API_ERROR_STRING_INFO = {
|
|
|
1725
1725
|
display: "Checkout amount is too low. Please try again with a higher amount."
|
|
1726
1726
|
}
|
|
1727
1727
|
};
|
|
1728
|
+
var QUOTE_CUSTOM_ERROR_STRING_INFO = {
|
|
1729
|
+
[0 /* INSUFFICIENT_BALANCE */]: {
|
|
1730
|
+
check: "custom error - insufficient balance",
|
|
1731
|
+
display: "Insufficient wallet balance to perform checkout with fees. Please try again with a lower amount or another asset."
|
|
1732
|
+
}
|
|
1733
|
+
};
|
|
1728
1734
|
function generateQuoteApiErrorForDisplay(errorMessage = "") {
|
|
1729
1735
|
const errorMessageNormalized = errorMessage.toLowerCase();
|
|
1730
|
-
|
|
1731
|
-
|
|
1736
|
+
const foundItem = [
|
|
1737
|
+
...Object.values(QUOTE_API_ERROR_STRING_INFO),
|
|
1738
|
+
...Object.values(QUOTE_CUSTOM_ERROR_STRING_INFO)
|
|
1739
|
+
].find(
|
|
1732
1740
|
(infoItem) => errorMessageNormalized.includes(infoItem.check.toLowerCase())
|
|
1733
1741
|
);
|
|
1734
1742
|
return (foundItem == null ? void 0 : foundItem.display) || "";
|
|
@@ -1997,25 +2005,35 @@ function validateCheckoutConfig(config, isUserLoggedIn) {
|
|
|
1997
2005
|
message: "Valid checkout configuration, proceeding..."
|
|
1998
2006
|
};
|
|
1999
2007
|
}
|
|
2008
|
+
var hasSufficientBalance = async (wagmiConfig, walletAddress, tokenAddress, tokenChainId, tokenAddressAmount) => {
|
|
2009
|
+
const finalTokenAddress = tokenAddress.toLowerCase() === FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS2.toLowerCase() ? void 0 : tokenAddress;
|
|
2010
|
+
const data = await getBalance(wagmiConfig, {
|
|
2011
|
+
address: walletAddress,
|
|
2012
|
+
token: finalTokenAddress,
|
|
2013
|
+
chainId: Number(tokenChainId)
|
|
2014
|
+
});
|
|
2015
|
+
logger.log("hasSufficientBalance_info", {
|
|
2016
|
+
finalTokenAddress,
|
|
2017
|
+
data,
|
|
2018
|
+
tokenAddressAmount,
|
|
2019
|
+
walletAddress
|
|
2020
|
+
});
|
|
2021
|
+
if (parseFloat(data.formatted) >= tokenAddressAmount) {
|
|
2022
|
+
return { result: true, tokenTicker: data.symbol };
|
|
2023
|
+
} else {
|
|
2024
|
+
return { result: false, tokenTicker: null };
|
|
2025
|
+
}
|
|
2026
|
+
};
|
|
2000
2027
|
var testAutoExecutionDuringCheckout = async (config, walletAddress, wagmiConfig) => {
|
|
2001
2028
|
const { targetAsset, targetAssetAmount, targetChain } = config;
|
|
2002
2029
|
try {
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
tokenAddress,
|
|
2011
|
-
data,
|
|
2012
|
-
targetAssetAmount,
|
|
2013
|
-
walletAddress
|
|
2014
|
-
});
|
|
2015
|
-
if (parseFloat(data.formatted) >= targetAssetAmount) {
|
|
2016
|
-
return { result: true, tokenTicker: data.symbol };
|
|
2017
|
-
}
|
|
2018
|
-
return { result: false, tokenTicker: null };
|
|
2030
|
+
return hasSufficientBalance(
|
|
2031
|
+
wagmiConfig,
|
|
2032
|
+
walletAddress,
|
|
2033
|
+
targetAsset,
|
|
2034
|
+
targetChain,
|
|
2035
|
+
targetAssetAmount
|
|
2036
|
+
);
|
|
2019
2037
|
} catch (error) {
|
|
2020
2038
|
logger.error(`testAutoExecutionDuringCheckout:error`, error);
|
|
2021
2039
|
return { result: false, tokenTicker: null };
|
|
@@ -2114,7 +2132,14 @@ function categorizeCheckoutHistories(checkoutHistoryList) {
|
|
|
2114
2132
|
checkoutHistoryList.forEach((item) => {
|
|
2115
2133
|
depositAddrMap[item.depositAddr] = item;
|
|
2116
2134
|
currentDepositAddrMap[item.currentDepositAddr] = item;
|
|
2117
|
-
stateMap[item.state]
|
|
2135
|
+
if (stateMap[item.state]) {
|
|
2136
|
+
stateMap[item.state].push(item);
|
|
2137
|
+
} else {
|
|
2138
|
+
logger.error(
|
|
2139
|
+
"categorizeCheckoutHistories_unrecognizedCheckoutState",
|
|
2140
|
+
new Error("Unrecognized checkout state")
|
|
2141
|
+
);
|
|
2142
|
+
}
|
|
2118
2143
|
});
|
|
2119
2144
|
return { stateMap, depositAddrMap, currentDepositAddrMap };
|
|
2120
2145
|
}
|
|
@@ -2316,9 +2341,9 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
2316
2341
|
[]
|
|
2317
2342
|
);
|
|
2318
2343
|
const _initNewCheckout = useCallback6(
|
|
2319
|
-
(initSettings,
|
|
2344
|
+
(initSettings, hasSufficientBalance2, sourceSymbol) => {
|
|
2320
2345
|
const newCheckoutId = uuid();
|
|
2321
|
-
const isFastForwarded =
|
|
2346
|
+
const isFastForwarded = hasSufficientBalance2 && !!initSettings.config.actionsParams.length;
|
|
2322
2347
|
const selectedSourceAssetFormatted = {
|
|
2323
2348
|
address: isFastForwarded ? initSettings.config.targetAsset.toLowerCase() : null,
|
|
2324
2349
|
chainId: isFastForwarded ? initSettings.config.targetChain : null,
|
|
@@ -2683,6 +2708,20 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
2683
2708
|
const finalTotalUsdAlt = (baseQuote.estTotalUsd - baseQuote.estFeesUsd + finalFeesBreakdown.totalFeesUsd).toString();
|
|
2684
2709
|
logger.log("finalQuote", { finalEstimation, finalTotalUsdAlt });
|
|
2685
2710
|
(_g = (_f = checkoutItem == null ? void 0 : checkoutItem.initSettings) == null ? void 0 : _f.onEstimation) == null ? void 0 : _g.call(_f, finalEstimation);
|
|
2711
|
+
if (newPaymentMethodInfo.paymentMethod === "balance" /* ACCOUNT_BALANCE */) {
|
|
2712
|
+
const { result } = await hasSufficientBalance(
|
|
2713
|
+
wagmiConfig,
|
|
2714
|
+
walletAddress,
|
|
2715
|
+
checkoutItem.selectedSourceAssetInfo.address,
|
|
2716
|
+
checkoutItem.selectedSourceAssetInfo.chainId,
|
|
2717
|
+
Number(finalEstimation.finalPaymentTokenAmount)
|
|
2718
|
+
);
|
|
2719
|
+
if (!result) {
|
|
2720
|
+
throw new Error(
|
|
2721
|
+
QUOTE_CUSTOM_ERROR_STRING_INFO[0 /* INSUFFICIENT_BALANCE */].check
|
|
2722
|
+
);
|
|
2723
|
+
}
|
|
2724
|
+
}
|
|
2686
2725
|
checkoutItem = {
|
|
2687
2726
|
...checkoutItem,
|
|
2688
2727
|
isQuoting: false,
|
|
@@ -2807,6 +2846,7 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
2807
2846
|
);
|
|
2808
2847
|
const _generateClientMetadataForBackend = useCallback6(
|
|
2809
2848
|
(checkoutId) => {
|
|
2849
|
+
var _a, _b, _c, _d;
|
|
2810
2850
|
const checkoutItem = _getAndValidateCheckoutItemByCheckoutId(checkoutId);
|
|
2811
2851
|
return {
|
|
2812
2852
|
id: checkoutItem.id,
|
|
@@ -2816,14 +2856,20 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
2816
2856
|
depositAddress: checkoutItem.depositAddress,
|
|
2817
2857
|
initSettings: checkoutItem.initSettings,
|
|
2818
2858
|
isFastForwarded: checkoutItem.isFastForwarded,
|
|
2819
|
-
selectedSourceAssetInfo: checkoutItem.selectedSourceAssetInfo
|
|
2859
|
+
selectedSourceAssetInfo: checkoutItem.selectedSourceAssetInfo,
|
|
2860
|
+
selectedPaymentMethodInfo: {
|
|
2861
|
+
paymentMethod: (_a = checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _a.paymentMethod,
|
|
2862
|
+
title: (_b = checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _b.title,
|
|
2863
|
+
description: (_c = checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _c.description,
|
|
2864
|
+
meta: (_d = checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _d.meta
|
|
2865
|
+
}
|
|
2820
2866
|
};
|
|
2821
2867
|
},
|
|
2822
2868
|
[_getAndValidateCheckoutItemByCheckoutId]
|
|
2823
2869
|
);
|
|
2824
2870
|
const _confirmCheckout = useCallback6(
|
|
2825
2871
|
async (checkoutId, shouldbatchOpBypassInit, stepMessageSetter) => {
|
|
2826
|
-
var _a, _b, _c;
|
|
2872
|
+
var _a, _b, _c, _d;
|
|
2827
2873
|
if (!(funkitConfig == null ? void 0 : funkitConfig.apiKey)) {
|
|
2828
2874
|
throw new Error(
|
|
2829
2875
|
`Funkit Internal Error: Unable to detect funkit api key`
|
|
@@ -2859,9 +2905,10 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
2859
2905
|
userOp: batchUserOp,
|
|
2860
2906
|
quoteId: checkoutItem.latestQuote.baseQuote.quoteId,
|
|
2861
2907
|
apiKey: funkitConfig.apiKey || "",
|
|
2908
|
+
sourceOfFund: (_b = checkoutItem.selectedPaymentMethodInfo) == null ? void 0 : _b.paymentMethod,
|
|
2862
2909
|
clientMetadata: _generateClientMetadataForBackend(checkoutId)
|
|
2863
2910
|
});
|
|
2864
|
-
(
|
|
2911
|
+
(_d = (_c = checkoutItem == null ? void 0 : checkoutItem.initSettings) == null ? void 0 : _c.onConfirmation) == null ? void 0 : _d.call(_c);
|
|
2865
2912
|
logger.log("checkoutConfirmed", { depositAddress });
|
|
2866
2913
|
setActiveCheckouts({
|
|
2867
2914
|
...activeCheckouts,
|
|
@@ -3409,7 +3456,7 @@ function formatTimestamp(date, shortened = false) {
|
|
|
3409
3456
|
const formattedDate = `${month} ${day}${daySuffix}${shortened ? "" : `, ${year}`} \xB7 ${hours % 12 || 12}:${minutes < 10 ? "0" : ""}${minutes}${shortened ? "" : `:${seconds < 10 ? "0" : ""}${seconds}`} ${ampm}`;
|
|
3410
3457
|
return formattedDate;
|
|
3411
3458
|
}
|
|
3412
|
-
function formatSecondsToReadableForm(seconds, specifyUnderMinute = false) {
|
|
3459
|
+
function formatSecondsToReadableForm(seconds, specifyUnderMinute = false, omitSeconds = false) {
|
|
3413
3460
|
const normalizedSeconds = Math.ceil(seconds);
|
|
3414
3461
|
if (normalizedSeconds < 60) {
|
|
3415
3462
|
if (specifyUnderMinute) {
|
|
@@ -3420,6 +3467,9 @@ function formatSecondsToReadableForm(seconds, specifyUnderMinute = false) {
|
|
|
3420
3467
|
}
|
|
3421
3468
|
const mins = Math.floor(normalizedSeconds / 60);
|
|
3422
3469
|
const remainingSecs = normalizedSeconds % 60;
|
|
3470
|
+
if (omitSeconds) {
|
|
3471
|
+
return `${mins + 1}mins`;
|
|
3472
|
+
}
|
|
3423
3473
|
if (remainingSecs === 0) {
|
|
3424
3474
|
return mins === 1 ? `${mins}min` : `${mins}mins`;
|
|
3425
3475
|
}
|
|
@@ -3455,7 +3505,7 @@ function FunViewTxButton({ onClick }) {
|
|
|
3455
3505
|
weight: "semibold",
|
|
3456
3506
|
color: "buttonPrimary",
|
|
3457
3507
|
style: { lineHeight: "24px" }
|
|
3458
|
-
}, "View
|
|
3508
|
+
}, "View Order"));
|
|
3459
3509
|
}
|
|
3460
3510
|
|
|
3461
3511
|
// src/components/FunProgressBar/FunHorizontalStepper.tsx
|
|
@@ -4655,6 +4705,7 @@ function CopyAddress({
|
|
|
4655
4705
|
// src/components/FunButton/FunButton.tsx
|
|
4656
4706
|
import React48 from "react";
|
|
4657
4707
|
function FunButton({
|
|
4708
|
+
id,
|
|
4658
4709
|
title,
|
|
4659
4710
|
onClick,
|
|
4660
4711
|
titlePrefix,
|
|
@@ -4674,6 +4725,7 @@ function FunButton({
|
|
|
4674
4725
|
};
|
|
4675
4726
|
const hasBorder = !mobile && !isDisabled;
|
|
4676
4727
|
return /* @__PURE__ */ React48.createElement(Box, {
|
|
4728
|
+
id,
|
|
4677
4729
|
as: "button",
|
|
4678
4730
|
onClick: !isDisabled ? onClick : void 0,
|
|
4679
4731
|
...hasBorder ? {
|
|
@@ -4786,7 +4838,8 @@ function FunInputDefault({
|
|
|
4786
4838
|
color: "modalText",
|
|
4787
4839
|
display: "flex",
|
|
4788
4840
|
flexDirection: "column",
|
|
4789
|
-
gap: "8"
|
|
4841
|
+
gap: "8",
|
|
4842
|
+
width: "full"
|
|
4790
4843
|
}, label && /* @__PURE__ */ React50.createElement(Text, {
|
|
4791
4844
|
color: textColor,
|
|
4792
4845
|
size: "14",
|
|
@@ -5326,7 +5379,7 @@ function FunTermsAndConditionsTextButton() {
|
|
|
5326
5379
|
}, "By clicking Confirm Order you agree to our", /* @__PURE__ */ React54.createElement(FunLinkButton, {
|
|
5327
5380
|
onClick: () => {
|
|
5328
5381
|
window.open(
|
|
5329
|
-
"https://the-fun-group.notion.site/
|
|
5382
|
+
"https://the-fun-group.notion.site/Funkit-Terms-Conditions-8340448037474928b2d01b41ede947b2",
|
|
5330
5383
|
"_blank"
|
|
5331
5384
|
);
|
|
5332
5385
|
},
|
|
@@ -5830,7 +5883,7 @@ function FunPaymentMethods({
|
|
|
5830
5883
|
setSelectedOption(paymentsConfig.defaultPaymentMethod || null);
|
|
5831
5884
|
}
|
|
5832
5885
|
}, [reDraftSymbol]);
|
|
5833
|
-
const
|
|
5886
|
+
const hasSufficientBalance2 = useMemo14(() => {
|
|
5834
5887
|
if (!checkoutItem)
|
|
5835
5888
|
return false;
|
|
5836
5889
|
if (!(depositInfo == null ? void 0 : depositInfo.amount))
|
|
@@ -5863,7 +5916,7 @@ function FunPaymentMethods({
|
|
|
5863
5916
|
};
|
|
5864
5917
|
}
|
|
5865
5918
|
const shouldDisableMoonpay = "card" /* CARD */ === paymentMethod && isAmountValidForMoonpay({ amountUsd: depositInfo == null ? void 0 : depositInfo.amount });
|
|
5866
|
-
const shouldDisableAccBalance = "balance" /* ACCOUNT_BALANCE */ === paymentMethod && !
|
|
5919
|
+
const shouldDisableAccBalance = "balance" /* ACCOUNT_BALANCE */ === paymentMethod && !hasSufficientBalance2;
|
|
5867
5920
|
const isClickable = !isDisabled && !shouldDisableMoonpay && !shouldDisableAccBalance;
|
|
5868
5921
|
return {
|
|
5869
5922
|
paymentMethod,
|
|
@@ -5884,7 +5937,7 @@ function FunPaymentMethods({
|
|
|
5884
5937
|
}, [
|
|
5885
5938
|
(_b = (_a = checkoutItem == null ? void 0 : checkoutItem.initSettings) == null ? void 0 : _a.config) == null ? void 0 : _b.customRecipient,
|
|
5886
5939
|
depositInfo == null ? void 0 : depositInfo.amount,
|
|
5887
|
-
|
|
5940
|
+
hasSufficientBalance2,
|
|
5888
5941
|
isContinuing,
|
|
5889
5942
|
isDisabled,
|
|
5890
5943
|
paymentFlow,
|
|
@@ -6335,7 +6388,8 @@ function FunTransactionSummary({
|
|
|
6335
6388
|
size: "14"
|
|
6336
6389
|
}, formatSecondsToReadableForm(
|
|
6337
6390
|
parseFloat(estTime == null ? void 0 : estTime.toString()),
|
|
6338
|
-
true
|
|
6391
|
+
true,
|
|
6392
|
+
false
|
|
6339
6393
|
)) : null), hasTotal ? /* @__PURE__ */ React65.createElement(Fragment2, null, /* @__PURE__ */ React65.createElement(FunTxSummaryDivider, null), /* @__PURE__ */ React65.createElement(LineItem, null, /* @__PURE__ */ React65.createElement(Text, {
|
|
6340
6394
|
weight: "medium",
|
|
6341
6395
|
color: "modalTextDim",
|
|
@@ -6993,9 +7047,9 @@ function FunPaymentMoonpayType({
|
|
|
6993
7047
|
return signature || "";
|
|
6994
7048
|
};
|
|
6995
7049
|
const description = useMemo18(() => {
|
|
6996
|
-
|
|
7050
|
+
let normalizedConvertedAssetName = finalConvertedAssetName.toLowerCase();
|
|
6997
7051
|
if (normalizedConvertedAssetName.startsWith("$")) {
|
|
6998
|
-
|
|
7052
|
+
normalizedConvertedAssetName = normalizedConvertedAssetName.slice(1);
|
|
6999
7053
|
}
|
|
7000
7054
|
const isSame = normalizedConvertedAssetName === depositToken.toLowerCase();
|
|
7001
7055
|
const conversionText = finalConvertedAssetName && !isSame ? ` that is then automatically converted to ${finalConvertedAssetName}.` : ".";
|
|
@@ -7038,6 +7092,7 @@ function FunPaymentMoonpayType({
|
|
|
7038
7092
|
baseCurrencyCode: "usd",
|
|
7039
7093
|
baseCurrencyAmount: paymentFlow === 0 /* DEPOSIT */ ? depositTokenAmountStringFormatted : void 0,
|
|
7040
7094
|
quoteCurrencyAmount: paymentFlow === 0 /* DEPOSIT */ ? void 0 : depositTokenAmountStringFormatted,
|
|
7095
|
+
lockAmount: true,
|
|
7041
7096
|
currencyCode,
|
|
7042
7097
|
walletAddress: paymentAddress,
|
|
7043
7098
|
onUrlSignatureRequested: handleGetSignature,
|
|
@@ -8169,7 +8224,7 @@ var ProfileTitleSection = ({
|
|
|
8169
8224
|
icon: /* @__PURE__ */ React91.createElement(SettingsIcon, null),
|
|
8170
8225
|
onClick: () => {
|
|
8171
8226
|
setAnimateOut(true);
|
|
8172
|
-
setTimeout(() => onChangeView(1 /* SETTINGS */),
|
|
8227
|
+
setTimeout(() => onChangeView(1 /* SETTINGS */), 200);
|
|
8173
8228
|
},
|
|
8174
8229
|
size: "24"
|
|
8175
8230
|
}), /* @__PURE__ */ React91.createElement(FunIconButton, {
|
|
@@ -11834,7 +11889,7 @@ function ConnectModal({ onClose, open }) {
|
|
|
11834
11889
|
}
|
|
11835
11890
|
|
|
11836
11891
|
// src/components/FunCheckoutHistoryModal/FunCheckoutHistoryModal.tsx
|
|
11837
|
-
import
|
|
11892
|
+
import React140, { useMemo as useMemo32, useState as useState39 } from "react";
|
|
11838
11893
|
|
|
11839
11894
|
// src/components/FunCheckoutHistoryModal/FunCheckoutHistoryDetail.tsx
|
|
11840
11895
|
import {
|
|
@@ -11862,7 +11917,10 @@ var EditIcon = ({ size = "24" }) => /* @__PURE__ */ React129.createElement("svg"
|
|
|
11862
11917
|
})));
|
|
11863
11918
|
|
|
11864
11919
|
// src/components/FunCheckoutModal/FunCheckoutModal.tsx
|
|
11865
|
-
import {
|
|
11920
|
+
import {
|
|
11921
|
+
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO8,
|
|
11922
|
+
getTokenInfo as getTokenInfo2
|
|
11923
|
+
} from "@funkit/core";
|
|
11866
11924
|
import React135, { useCallback as useCallback24, useEffect as useEffect25, useMemo as useMemo29, useState as useState36 } from "react";
|
|
11867
11925
|
|
|
11868
11926
|
// src/hooks/useCheckoutAccountBalanceTransfer.ts
|
|
@@ -13045,7 +13103,10 @@ function FunCheckoutModal({
|
|
|
13045
13103
|
const targetChainId = checkoutItem == null ? void 0 : checkoutItem.initSettings.config.targetChain.toString();
|
|
13046
13104
|
let sourceTokenAddress;
|
|
13047
13105
|
let sourceTokenTicker;
|
|
13048
|
-
|
|
13106
|
+
const wethAddrOnTargetChain = (await getTokenInfo2("weth", targetChainId)).toLowerCase();
|
|
13107
|
+
if ([NATIVE_TOKEN, wethAddrOnTargetChain].includes(
|
|
13108
|
+
(_a2 = checkoutItem == null ? void 0 : checkoutItem.initSettings) == null ? void 0 : _a2.config.targetAsset
|
|
13109
|
+
) && FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO8[targetChainId].nativeCurrency.symbol === "ETH" /* ETH */) {
|
|
13049
13110
|
sourceTokenAddress = NATIVE_TOKEN;
|
|
13050
13111
|
sourceTokenTicker = "ETH" /* ETH */;
|
|
13051
13112
|
} else {
|
|
@@ -13336,7 +13397,9 @@ function CheckoutPrimaryInfo({
|
|
|
13336
13397
|
// src/components/FunCheckoutHistoryModal/FunCheckoutHistoryDetail.tsx
|
|
13337
13398
|
var FAKE_DELAY_MS = 4107;
|
|
13338
13399
|
function FunCheckoutHistoryDetail({
|
|
13339
|
-
checkoutHistoryInfo
|
|
13400
|
+
checkoutHistoryInfo,
|
|
13401
|
+
setCurrentPage,
|
|
13402
|
+
animateOut
|
|
13340
13403
|
}) {
|
|
13341
13404
|
const checkoutItem = checkoutHistoryInfo.clientMetadata;
|
|
13342
13405
|
const { isCheckoutDirectCrFlow } = useCheckoutType(checkoutItem);
|
|
@@ -13354,6 +13417,17 @@ function FunCheckoutHistoryDetail({
|
|
|
13354
13417
|
checkoutHistoryInfo.depositAddr
|
|
13355
13418
|
);
|
|
13356
13419
|
useWalletAssetsListener(isProcessing || isCompleted);
|
|
13420
|
+
const estimatedEndTimeInfo = useMemo31(() => {
|
|
13421
|
+
var _a;
|
|
13422
|
+
const estimatedEndTimeMs = (((_a = checkoutItem == null ? void 0 : checkoutItem.latestQuote) == null ? void 0 : _a.finalTimeEstimationMs) || 0) + checkoutHistoryInfo.createdTimeMs;
|
|
13423
|
+
const estimatedEndTimeFromNowMs = estimatedEndTimeMs - Date.now();
|
|
13424
|
+
const isExceededEstimation = estimatedEndTimeFromNowMs <= 0;
|
|
13425
|
+
return {
|
|
13426
|
+
estimatedEndTimeMs,
|
|
13427
|
+
estimatedEndTimeFromNowMs,
|
|
13428
|
+
isExceededEstimation
|
|
13429
|
+
};
|
|
13430
|
+
}, [checkoutHistoryInfo.createdTimeMs, checkoutItem]);
|
|
13357
13431
|
const timelineLabels = useMemo31(() => {
|
|
13358
13432
|
const fromExplorerInfo = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO9[checkoutHistoryInfo.fromChainId].explorerInfo;
|
|
13359
13433
|
const toExplorerInfo = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO9[checkoutHistoryInfo.toChainId].explorerInfo;
|
|
@@ -13381,7 +13455,13 @@ function FunCheckoutHistoryDetail({
|
|
|
13381
13455
|
)
|
|
13382
13456
|
) : isTerminal ? formatTimestamp(
|
|
13383
13457
|
new Date(checkoutHistoryInfo.lastUpdatedTimeMs)
|
|
13384
|
-
) : ""
|
|
13458
|
+
) : estimatedEndTimeInfo.isExceededEstimation ? "Order is experiencing delays. We appreciate your patience." : `Estimated completion in ${formatSecondsToReadableForm(
|
|
13459
|
+
Math.floor(
|
|
13460
|
+
estimatedEndTimeInfo.estimatedEndTimeFromNowMs / 1e3
|
|
13461
|
+
),
|
|
13462
|
+
true,
|
|
13463
|
+
true
|
|
13464
|
+
)}`,
|
|
13385
13465
|
...isCompleted ? {
|
|
13386
13466
|
linkText: `View on ${toExplorerInfo.name}`,
|
|
13387
13467
|
linkUrl: `${toExplorerInfo.url}/address/${checkoutHistoryInfo.recipientAddr}`
|
|
@@ -13401,13 +13481,26 @@ function FunCheckoutHistoryDetail({
|
|
|
13401
13481
|
isError,
|
|
13402
13482
|
isExpired,
|
|
13403
13483
|
isTerminal,
|
|
13484
|
+
estimatedEndTimeInfo.isExceededEstimation,
|
|
13485
|
+
estimatedEndTimeInfo.estimatedEndTimeFromNowMs,
|
|
13404
13486
|
isCompleted
|
|
13405
13487
|
]);
|
|
13488
|
+
const GetHelpButton = /* @__PURE__ */ React137.createElement(FunLinkButton, {
|
|
13489
|
+
hasPadding: false,
|
|
13490
|
+
text: "Get Help \u{1F449}",
|
|
13491
|
+
textProps: {
|
|
13492
|
+
size: "12",
|
|
13493
|
+
weight: "medium",
|
|
13494
|
+
color: "modalTextSecondary"
|
|
13495
|
+
},
|
|
13496
|
+
onClick: () => setCurrentPage(1 /* HELP */)
|
|
13497
|
+
});
|
|
13406
13498
|
return /* @__PURE__ */ React137.createElement(Box, {
|
|
13407
13499
|
display: "flex",
|
|
13408
13500
|
flexDirection: "column",
|
|
13409
13501
|
gap: "24",
|
|
13410
|
-
paddingY: "24"
|
|
13502
|
+
paddingY: "24",
|
|
13503
|
+
className: animateOut ? animateContentOutClass : animateContentInClass
|
|
13411
13504
|
}, /* @__PURE__ */ React137.createElement(Box, {
|
|
13412
13505
|
display: "flex",
|
|
13413
13506
|
flexDirection: "column",
|
|
@@ -13417,21 +13510,13 @@ function FunCheckoutHistoryDetail({
|
|
|
13417
13510
|
checkoutItem,
|
|
13418
13511
|
isLoading: false,
|
|
13419
13512
|
isEditable: false
|
|
13420
|
-
}),
|
|
13421
|
-
description: "We are currently processing your order."
|
|
13513
|
+
}), isTerminal ? null : /* @__PURE__ */ React137.createElement(FunNotification, {
|
|
13514
|
+
description: isCheckoutDirectCrFlow ? "Funds may take up to 10 minutes to arrive." : "We are currently processing your order."
|
|
13422
13515
|
}), /* @__PURE__ */ React137.createElement(FunVerticalProgressBar, {
|
|
13423
13516
|
step: isCheckoutDirectCrFlow ? 2 : isTerminal ? 3 : 2,
|
|
13424
13517
|
totalSteps: timelineLabels.length,
|
|
13425
13518
|
labels: timelineLabels
|
|
13426
|
-
}),
|
|
13427
|
-
display: "flex",
|
|
13428
|
-
flexDirection: "column",
|
|
13429
|
-
alignItems: "center",
|
|
13430
|
-
justifyContent: "center"
|
|
13431
|
-
}, /* @__PURE__ */ React137.createElement(Text, {
|
|
13432
|
-
size: "12",
|
|
13433
|
-
color: "modalTextDim"
|
|
13434
|
-
}, isCheckoutDirectCrFlow ? "Funds may take up to 10 minutes to arrive." : "You will receive a notification when your order has finished."))), isFailedFinal ? /* @__PURE__ */ React137.createElement(FunToast, {
|
|
13519
|
+
})), isFailedFinal ? /* @__PURE__ */ React137.createElement(FunToast, {
|
|
13435
13520
|
type: 1 /* ERROR */,
|
|
13436
13521
|
title: "Order Failed",
|
|
13437
13522
|
isDescriptionText: false,
|
|
@@ -13439,20 +13524,243 @@ function FunCheckoutHistoryDetail({
|
|
|
13439
13524
|
size: "12",
|
|
13440
13525
|
weight: "medium",
|
|
13441
13526
|
color: "modalTextDim"
|
|
13442
|
-
}, "A problem occurred processing your order.
|
|
13443
|
-
hasPadding: false,
|
|
13444
|
-
text: "contact support",
|
|
13445
|
-
textProps: {
|
|
13446
|
-
size: "12",
|
|
13447
|
-
weight: "medium",
|
|
13448
|
-
color: "modalTextSecondary"
|
|
13449
|
-
},
|
|
13450
|
-
onClick: () => {
|
|
13451
|
-
window.location = "mailto:support@fun.xyz";
|
|
13452
|
-
}
|
|
13453
|
-
}), " ", "for more information."),
|
|
13527
|
+
}, "A problem occurred processing your order. ", GetHelpButton),
|
|
13454
13528
|
hideTitleSuffix: true
|
|
13455
|
-
}) :
|
|
13529
|
+
}) : /* @__PURE__ */ React137.createElement(Box, {
|
|
13530
|
+
display: "flex",
|
|
13531
|
+
flexDirection: "column",
|
|
13532
|
+
alignItems: "center",
|
|
13533
|
+
justifyContent: "center"
|
|
13534
|
+
}, /* @__PURE__ */ React137.createElement(Text, {
|
|
13535
|
+
size: "12",
|
|
13536
|
+
color: "modalTextDim"
|
|
13537
|
+
}, "Experiencing problems? ", GetHelpButton)));
|
|
13538
|
+
}
|
|
13539
|
+
|
|
13540
|
+
// src/components/FunCheckoutHistoryModal/FunCheckoutHistoryHelp.tsx
|
|
13541
|
+
import React139, { useState as useState38 } from "react";
|
|
13542
|
+
|
|
13543
|
+
// src/components/FunInput/FunTextAreaInput.tsx
|
|
13544
|
+
import React138 from "react";
|
|
13545
|
+
function FunTextAreaInput({
|
|
13546
|
+
placeholder,
|
|
13547
|
+
value,
|
|
13548
|
+
label,
|
|
13549
|
+
onChange,
|
|
13550
|
+
onKeyDown,
|
|
13551
|
+
onKeySubmit,
|
|
13552
|
+
hasBackground = true,
|
|
13553
|
+
textColor = "modalTextSecondary",
|
|
13554
|
+
inputStyle = {},
|
|
13555
|
+
inputProps = {
|
|
13556
|
+
type: "text"
|
|
13557
|
+
},
|
|
13558
|
+
error,
|
|
13559
|
+
focused: _focused,
|
|
13560
|
+
overrideBorderWidth
|
|
13561
|
+
}) {
|
|
13562
|
+
const [focused, setFocused] = React138.useState(false);
|
|
13563
|
+
const onFocus = () => setFocused(true);
|
|
13564
|
+
const onBlur = () => setFocused(false);
|
|
13565
|
+
return /* @__PURE__ */ React138.createElement(Box, {
|
|
13566
|
+
color: "modalText",
|
|
13567
|
+
display: "flex",
|
|
13568
|
+
flexDirection: "column",
|
|
13569
|
+
gap: "8"
|
|
13570
|
+
}, label && /* @__PURE__ */ React138.createElement(Text, {
|
|
13571
|
+
color: textColor,
|
|
13572
|
+
size: "14",
|
|
13573
|
+
weight: "medium"
|
|
13574
|
+
}, label), /* @__PURE__ */ React138.createElement(Box, {
|
|
13575
|
+
background: hasBackground ? "actionButtonSecondaryBackground" : void 0,
|
|
13576
|
+
borderRadius: "menuButton",
|
|
13577
|
+
fontFamily: "body",
|
|
13578
|
+
minWidth: "full",
|
|
13579
|
+
display: "flex",
|
|
13580
|
+
color: textColor,
|
|
13581
|
+
alignItems: "center",
|
|
13582
|
+
borderColor: error ? "error" : focused && _focused ? "accentColor" : void 0,
|
|
13583
|
+
borderWidth: overrideBorderWidth ? overrideBorderWidth : error && focused ? "2" : error ? "1" : focused && _focused ? "1" : "0",
|
|
13584
|
+
borderStyle: "solid"
|
|
13585
|
+
}, /* @__PURE__ */ React138.createElement("textarea", {
|
|
13586
|
+
type: (inputProps == null ? void 0 : inputProps.type) || "text",
|
|
13587
|
+
value,
|
|
13588
|
+
placeholder,
|
|
13589
|
+
onChange: (e) => onChange(e),
|
|
13590
|
+
onKeyDown: (e) => {
|
|
13591
|
+
e.stopPropagation();
|
|
13592
|
+
if (onKeyDown) {
|
|
13593
|
+
onKeyDown(e);
|
|
13594
|
+
}
|
|
13595
|
+
if (e.key === "Enter" && onKeySubmit) {
|
|
13596
|
+
onKeySubmit();
|
|
13597
|
+
e.stopPropagation();
|
|
13598
|
+
}
|
|
13599
|
+
},
|
|
13600
|
+
onFocus,
|
|
13601
|
+
onBlur,
|
|
13602
|
+
onWheel: (e) => e.currentTarget.blur(),
|
|
13603
|
+
className: inputProps.disabled ? inputClassDisabled : inputClass,
|
|
13604
|
+
...inputProps,
|
|
13605
|
+
style: {
|
|
13606
|
+
fontWeight: value ? "590" : "500",
|
|
13607
|
+
...inputStyle
|
|
13608
|
+
}
|
|
13609
|
+
})), error && typeof error === "string" && /* @__PURE__ */ React138.createElement(Text, {
|
|
13610
|
+
color: "error",
|
|
13611
|
+
size: "14",
|
|
13612
|
+
weight: "medium"
|
|
13613
|
+
}, error));
|
|
13614
|
+
}
|
|
13615
|
+
|
|
13616
|
+
// src/components/FunCheckoutHistoryModal/FunCheckoutHistoryHelp.tsx
|
|
13617
|
+
function FunCheckoutHistoryHelp({
|
|
13618
|
+
checkoutHistoryInfo,
|
|
13619
|
+
animateOut
|
|
13620
|
+
}) {
|
|
13621
|
+
const { appName, apiKey } = useFunkitConfig();
|
|
13622
|
+
const { userInfo } = useGeneralWallet();
|
|
13623
|
+
const [isSubmitting, setIsSubmitting] = useState38(false);
|
|
13624
|
+
const [nameInput, setNameInput] = useState38("");
|
|
13625
|
+
const [telegramInput, setTelegramInput] = useState38("");
|
|
13626
|
+
const [subjectInput, setSubjectInput] = useState38("");
|
|
13627
|
+
const [refundAddressInput, setRefundAddressInput] = useState38("");
|
|
13628
|
+
const [refundChainInput, setRefundChainInput] = useState38("");
|
|
13629
|
+
const [descriptionInput, setDescriptionInput] = useState38("");
|
|
13630
|
+
const onSubmitIssue = (e) => {
|
|
13631
|
+
setIsSubmitting(true);
|
|
13632
|
+
const emailSubject = `[Checkout Help Report] ${subjectInput}`;
|
|
13633
|
+
const emailBody = `
|
|
13634
|
+
Checkout ID (Do not remove): ${checkoutHistoryInfo.depositAddr}
|
|
13635
|
+
|
|
13636
|
+
App Name: ${appName}
|
|
13637
|
+
|
|
13638
|
+
App ID: ${apiKey}
|
|
13639
|
+
|
|
13640
|
+
User ID: ${userInfo.userId || "NA"}
|
|
13641
|
+
|
|
13642
|
+
=========================
|
|
13643
|
+
|
|
13644
|
+
User Name: ${nameInput}
|
|
13645
|
+
|
|
13646
|
+
User Telegram ID: ${telegramInput || "NA"}
|
|
13647
|
+
|
|
13648
|
+
User Refund Address: ${refundAddressInput || "NA"}
|
|
13649
|
+
|
|
13650
|
+
User Refund Chain: ${refundChainInput || "NA"}
|
|
13651
|
+
|
|
13652
|
+
=========================
|
|
13653
|
+
|
|
13654
|
+
${descriptionInput}
|
|
13655
|
+
|
|
13656
|
+
`;
|
|
13657
|
+
window.location.href = `mailto:support@fun.xyz?subject=${encodeURIComponent(
|
|
13658
|
+
emailSubject
|
|
13659
|
+
)}&body=${encodeURIComponent(emailBody)}`;
|
|
13660
|
+
e.preventDefault();
|
|
13661
|
+
logger.log("checkoutReportStarted", { emailSubject, emailBody });
|
|
13662
|
+
setIsSubmitting(false);
|
|
13663
|
+
};
|
|
13664
|
+
return /* @__PURE__ */ React139.createElement(Box, {
|
|
13665
|
+
display: "flex",
|
|
13666
|
+
flexDirection: "column",
|
|
13667
|
+
gap: "24",
|
|
13668
|
+
paddingY: "24",
|
|
13669
|
+
className: animateOut ? animateContentOutClass : animateContentInClass
|
|
13670
|
+
}, /* @__PURE__ */ React139.createElement(Box, {
|
|
13671
|
+
display: "flex",
|
|
13672
|
+
flexDirection: "column",
|
|
13673
|
+
gap: "10"
|
|
13674
|
+
}, /* @__PURE__ */ React139.createElement(Text, {
|
|
13675
|
+
color: "modalText",
|
|
13676
|
+
size: "18",
|
|
13677
|
+
weight: "heavy"
|
|
13678
|
+
}, "Tell us what's wrong"), /* @__PURE__ */ React139.createElement(Text, {
|
|
13679
|
+
color: "modalTextSecondary",
|
|
13680
|
+
size: "14",
|
|
13681
|
+
weight: "medium"
|
|
13682
|
+
}, "If you're experiencing an issue or have a question, please fill out the form below with as much detail as possible. Our support team is committed to assisting you promptly and effectively.")), /* @__PURE__ */ React139.createElement(FunInput, {
|
|
13683
|
+
inputProps: { disabled: true },
|
|
13684
|
+
inputStyle: { fontSize: 14 },
|
|
13685
|
+
label: "Checkout ID",
|
|
13686
|
+
placeholder: checkoutHistoryInfo.depositAddr,
|
|
13687
|
+
value: "",
|
|
13688
|
+
onChange: () => void 0
|
|
13689
|
+
}), /* @__PURE__ */ React139.createElement(Box, {
|
|
13690
|
+
display: "flex",
|
|
13691
|
+
gap: "10",
|
|
13692
|
+
width: "full"
|
|
13693
|
+
}, /* @__PURE__ */ React139.createElement(FunInput, {
|
|
13694
|
+
label: "Name*",
|
|
13695
|
+
inputStyle: { fontSize: 14 },
|
|
13696
|
+
placeholder: "",
|
|
13697
|
+
value: nameInput,
|
|
13698
|
+
onChange: (e) => {
|
|
13699
|
+
var _a;
|
|
13700
|
+
return setNameInput((_a = e == null ? void 0 : e.target) == null ? void 0 : _a.value);
|
|
13701
|
+
}
|
|
13702
|
+
}), /* @__PURE__ */ React139.createElement(FunInput, {
|
|
13703
|
+
label: "Telegram (@xyz)",
|
|
13704
|
+
inputStyle: { fontSize: 14 },
|
|
13705
|
+
placeholder: "",
|
|
13706
|
+
value: telegramInput,
|
|
13707
|
+
onChange: (e) => {
|
|
13708
|
+
var _a;
|
|
13709
|
+
return setTelegramInput((_a = e == null ? void 0 : e.target) == null ? void 0 : _a.value);
|
|
13710
|
+
}
|
|
13711
|
+
})), /* @__PURE__ */ React139.createElement(FunInput, {
|
|
13712
|
+
label: "Subject*",
|
|
13713
|
+
inputStyle: { fontSize: 14 },
|
|
13714
|
+
placeholder: "",
|
|
13715
|
+
value: subjectInput,
|
|
13716
|
+
onChange: (e) => {
|
|
13717
|
+
var _a;
|
|
13718
|
+
return setSubjectInput((_a = e == null ? void 0 : e.target) == null ? void 0 : _a.value);
|
|
13719
|
+
}
|
|
13720
|
+
}), /* @__PURE__ */ React139.createElement(FunTextAreaInput, {
|
|
13721
|
+
label: "Description*",
|
|
13722
|
+
inputStyle: { fontSize: 14, fontFamily: "inherit" },
|
|
13723
|
+
placeholder: "",
|
|
13724
|
+
value: descriptionInput,
|
|
13725
|
+
onChange: (e) => {
|
|
13726
|
+
var _a;
|
|
13727
|
+
return setDescriptionInput((_a = e == null ? void 0 : e.target) == null ? void 0 : _a.value);
|
|
13728
|
+
}
|
|
13729
|
+
}), /* @__PURE__ */ React139.createElement(Box, {
|
|
13730
|
+
display: "flex",
|
|
13731
|
+
gap: "10",
|
|
13732
|
+
width: "full"
|
|
13733
|
+
}, /* @__PURE__ */ React139.createElement(FunInput, {
|
|
13734
|
+
label: "Refund Address (if any)",
|
|
13735
|
+
inputStyle: { fontSize: 14, fontFamily: "inherit" },
|
|
13736
|
+
placeholder: "",
|
|
13737
|
+
value: refundAddressInput,
|
|
13738
|
+
onChange: (e) => {
|
|
13739
|
+
var _a;
|
|
13740
|
+
return setRefundAddressInput((_a = e == null ? void 0 : e.target) == null ? void 0 : _a.value);
|
|
13741
|
+
}
|
|
13742
|
+
}), /* @__PURE__ */ React139.createElement(FunInput, {
|
|
13743
|
+
label: "Refund Chain (if any)",
|
|
13744
|
+
inputStyle: { fontSize: 14, fontFamily: "inherit" },
|
|
13745
|
+
placeholder: "",
|
|
13746
|
+
value: refundChainInput,
|
|
13747
|
+
onChange: (e) => {
|
|
13748
|
+
var _a;
|
|
13749
|
+
return setRefundChainInput((_a = e == null ? void 0 : e.target) == null ? void 0 : _a.value);
|
|
13750
|
+
}
|
|
13751
|
+
})), /* @__PURE__ */ React139.createElement(FunButton, {
|
|
13752
|
+
title: "Submit",
|
|
13753
|
+
onClick: (e) => onSubmitIssue(e),
|
|
13754
|
+
isDisabled: !nameInput || !subjectInput || !descriptionInput,
|
|
13755
|
+
titleSuffix: isSubmitting ? /* @__PURE__ */ React139.createElement(Box, {
|
|
13756
|
+
display: "flex",
|
|
13757
|
+
alignItems: "center",
|
|
13758
|
+
color: "modalText"
|
|
13759
|
+
}, /* @__PURE__ */ React139.createElement(SpinnerIcon, {
|
|
13760
|
+
height: 16,
|
|
13761
|
+
width: 16
|
|
13762
|
+
})) : null
|
|
13763
|
+
}));
|
|
13456
13764
|
}
|
|
13457
13765
|
|
|
13458
13766
|
// src/components/FunCheckoutHistoryModal/FunCheckoutHistoryModal.tsx
|
|
@@ -13467,22 +13775,49 @@ function FunCheckoutHistoryModal({
|
|
|
13467
13775
|
);
|
|
13468
13776
|
}
|
|
13469
13777
|
const { checkoutHistoryInfo, isLoading } = useFunkitPostCheckoutInternal(depositAddress);
|
|
13470
|
-
|
|
13778
|
+
const [currentPage, setCurrentPage] = useState39(
|
|
13779
|
+
0 /* DETAIL */
|
|
13780
|
+
);
|
|
13781
|
+
const ANIMATION_DELAY2 = 150;
|
|
13782
|
+
const [animateOut, setAnimateOut] = useState39(false);
|
|
13783
|
+
const titleConfig = useMemo32(() => {
|
|
13784
|
+
if (currentPage === 1 /* HELP */) {
|
|
13785
|
+
return {
|
|
13786
|
+
hasBackButton: true,
|
|
13787
|
+
onBack: () => {
|
|
13788
|
+
setAnimateOut(true);
|
|
13789
|
+
setTimeout(() => {
|
|
13790
|
+
setCurrentPage(0 /* DETAIL */);
|
|
13791
|
+
setAnimateOut(false);
|
|
13792
|
+
}, ANIMATION_DELAY2);
|
|
13793
|
+
},
|
|
13794
|
+
title: "Get Help"
|
|
13795
|
+
};
|
|
13796
|
+
} else {
|
|
13797
|
+
return {
|
|
13798
|
+
hasBackButton: false,
|
|
13799
|
+
onBack: () => void 0,
|
|
13800
|
+
title: "Order"
|
|
13801
|
+
};
|
|
13802
|
+
}
|
|
13803
|
+
}, [currentPage]);
|
|
13804
|
+
return /* @__PURE__ */ React140.createElement(Dialog, {
|
|
13471
13805
|
open,
|
|
13472
13806
|
onClose,
|
|
13473
13807
|
titleId: "fun-checkout-history-modal"
|
|
13474
|
-
}, /* @__PURE__ */
|
|
13808
|
+
}, /* @__PURE__ */ React140.createElement(DialogContent, {
|
|
13475
13809
|
bottomSheetOnMobile: true,
|
|
13476
13810
|
padding: "0"
|
|
13477
|
-
}, /* @__PURE__ */
|
|
13811
|
+
}, /* @__PURE__ */ React140.createElement(Box, {
|
|
13478
13812
|
paddingTop: "20",
|
|
13479
13813
|
paddingX: "20"
|
|
13480
|
-
}, /* @__PURE__ */
|
|
13481
|
-
hasBackButton:
|
|
13482
|
-
|
|
13814
|
+
}, /* @__PURE__ */ React140.createElement(FunModalTitleSection, {
|
|
13815
|
+
hasBackButton: titleConfig.hasBackButton,
|
|
13816
|
+
onBack: titleConfig.onBack,
|
|
13817
|
+
title: titleConfig.title,
|
|
13483
13818
|
hasCloseButton: true,
|
|
13484
13819
|
onClose
|
|
13485
|
-
}), isLoading ? /* @__PURE__ */
|
|
13820
|
+
}), isLoading ? /* @__PURE__ */ React140.createElement(Box, {
|
|
13486
13821
|
width: "full",
|
|
13487
13822
|
height: "200",
|
|
13488
13823
|
display: "flex",
|
|
@@ -13490,26 +13825,31 @@ function FunCheckoutHistoryModal({
|
|
|
13490
13825
|
alignItems: "center",
|
|
13491
13826
|
justifyContent: "center",
|
|
13492
13827
|
color: "modalText"
|
|
13493
|
-
}, /* @__PURE__ */
|
|
13494
|
-
checkoutHistoryInfo
|
|
13495
|
-
|
|
13828
|
+
}, /* @__PURE__ */ React140.createElement(SpinnerIcon, null)) : checkoutHistoryInfo ? currentPage === 0 /* DETAIL */ ? /* @__PURE__ */ React140.createElement(FunCheckoutHistoryDetail, {
|
|
13829
|
+
checkoutHistoryInfo,
|
|
13830
|
+
setCurrentPage,
|
|
13831
|
+
animateOut
|
|
13832
|
+
}) : currentPage === 1 /* HELP */ ? /* @__PURE__ */ React140.createElement(FunCheckoutHistoryHelp, {
|
|
13833
|
+
checkoutHistoryInfo,
|
|
13834
|
+
animateOut
|
|
13835
|
+
}) : null : null)));
|
|
13496
13836
|
}
|
|
13497
13837
|
|
|
13498
13838
|
// src/components/FunDevTestModal/FunDevTestModal.tsx
|
|
13499
|
-
import
|
|
13839
|
+
import React141 from "react";
|
|
13500
13840
|
function FunDevTestModal({ onClose, open }) {
|
|
13501
|
-
return /* @__PURE__ */
|
|
13841
|
+
return /* @__PURE__ */ React141.createElement(Dialog, {
|
|
13502
13842
|
onClose,
|
|
13503
13843
|
open,
|
|
13504
13844
|
titleId: "dev/test modal"
|
|
13505
|
-
}, /* @__PURE__ */
|
|
13845
|
+
}, /* @__PURE__ */ React141.createElement(DialogContent, {
|
|
13506
13846
|
bottomSheetOnMobile: true
|
|
13507
|
-
}, /* @__PURE__ */
|
|
13847
|
+
}, /* @__PURE__ */ React141.createElement(Box, null)));
|
|
13508
13848
|
}
|
|
13509
13849
|
|
|
13510
13850
|
// src/components/FunkitProvider/ModalContext.tsx
|
|
13511
13851
|
function useModalStateValue() {
|
|
13512
|
-
const [isModalOpen, setModalOpen] =
|
|
13852
|
+
const [isModalOpen, setModalOpen] = useState40(false);
|
|
13513
13853
|
return {
|
|
13514
13854
|
closeModal: useCallback26(() => setModalOpen(false), []),
|
|
13515
13855
|
isModalOpen,
|
|
@@ -13517,8 +13857,8 @@ function useModalStateValue() {
|
|
|
13517
13857
|
};
|
|
13518
13858
|
}
|
|
13519
13859
|
function useModalStateValueWithId() {
|
|
13520
|
-
const [isModalOpen, setModalOpen] =
|
|
13521
|
-
const [modalId, setModalId] =
|
|
13860
|
+
const [isModalOpen, setModalOpen] = useState40(false);
|
|
13861
|
+
const [modalId, setModalId] = useState40(null);
|
|
13522
13862
|
return {
|
|
13523
13863
|
closeModal: useCallback26(() => {
|
|
13524
13864
|
setModalId(null);
|
|
@@ -13559,7 +13899,7 @@ function ModalProvider({ children }) {
|
|
|
13559
13899
|
isModalOpen: chainModalOpen,
|
|
13560
13900
|
openModal: openChainModal
|
|
13561
13901
|
} = useModalStateValue();
|
|
13562
|
-
const [isWalletConnectModalOpen, setIsWalletConnectModalOpen] =
|
|
13902
|
+
const [isWalletConnectModalOpen, setIsWalletConnectModalOpen] = useState40(false);
|
|
13563
13903
|
const {
|
|
13564
13904
|
closeModal: closeFunCheckoutModal,
|
|
13565
13905
|
isModalOpen: funCheckoutModalOpen,
|
|
@@ -13601,8 +13941,8 @@ function ModalProvider({ children }) {
|
|
|
13601
13941
|
if (isUnauthenticated)
|
|
13602
13942
|
closeModals();
|
|
13603
13943
|
}, [isUnauthenticated]);
|
|
13604
|
-
return /* @__PURE__ */
|
|
13605
|
-
value:
|
|
13944
|
+
return /* @__PURE__ */ React142.createElement(ModalContext.Provider, {
|
|
13945
|
+
value: useMemo33(
|
|
13606
13946
|
() => ({
|
|
13607
13947
|
accountModalOpen,
|
|
13608
13948
|
chainModalOpen,
|
|
@@ -13641,25 +13981,25 @@ function ModalProvider({ children }) {
|
|
|
13641
13981
|
openFunDevTestModal
|
|
13642
13982
|
]
|
|
13643
13983
|
)
|
|
13644
|
-
}, children, /* @__PURE__ */
|
|
13984
|
+
}, children, /* @__PURE__ */ React142.createElement(ConnectModal, {
|
|
13645
13985
|
onClose: closeConnectModal,
|
|
13646
13986
|
open: connectModalOpen
|
|
13647
|
-
}), /* @__PURE__ */
|
|
13987
|
+
}), /* @__PURE__ */ React142.createElement(AccountModal, {
|
|
13648
13988
|
onClose: closeAccountModal,
|
|
13649
13989
|
open: accountModalOpen
|
|
13650
|
-
}), /* @__PURE__ */
|
|
13990
|
+
}), /* @__PURE__ */ React142.createElement(ChainModal, {
|
|
13651
13991
|
onClose: closeChainModal,
|
|
13652
13992
|
open: chainModalOpen
|
|
13653
|
-
}), /* @__PURE__ */
|
|
13993
|
+
}), /* @__PURE__ */ React142.createElement(FunCheckoutModal, {
|
|
13654
13994
|
onClose: closeFunCheckoutModal,
|
|
13655
13995
|
open: funCheckoutModalOpen,
|
|
13656
13996
|
checkoutId: funCheckoutModalId,
|
|
13657
13997
|
key: funCheckoutModalId
|
|
13658
|
-
}), depositAddress ? /* @__PURE__ */
|
|
13998
|
+
}), depositAddress ? /* @__PURE__ */ React142.createElement(FunCheckoutHistoryModal, {
|
|
13659
13999
|
onClose: closeFunCheckoutHistoryModal,
|
|
13660
14000
|
open: funCheckoutHistoryModalOpen,
|
|
13661
14001
|
depositAddress
|
|
13662
|
-
}) : null, /* @__PURE__ */
|
|
14002
|
+
}) : null, /* @__PURE__ */ React142.createElement(FunDevTestModal, {
|
|
13663
14003
|
onClose: closeFunDevTestModal,
|
|
13664
14004
|
open: funDevTestModalOpen
|
|
13665
14005
|
}));
|
|
@@ -13943,15 +14283,15 @@ var FunkitWeb2Provider = ({
|
|
|
13943
14283
|
const funkitConfig = useFunkitConfig();
|
|
13944
14284
|
const { connectAsync } = useConnect2();
|
|
13945
14285
|
const { connectors, disconnectAsync } = useDisconnect3();
|
|
13946
|
-
const [privy, setPrivy] =
|
|
13947
|
-
const [privyIframeUrl, setPrivyIframeUrl] =
|
|
13948
|
-
const [loginMethod, setLoginMethod] =
|
|
14286
|
+
const [privy, setPrivy] = useState41(null);
|
|
14287
|
+
const [privyIframeUrl, setPrivyIframeUrl] = useState41();
|
|
14288
|
+
const [loginMethod, setLoginMethod] = useState41(
|
|
13949
14289
|
getLoginMethodFromCache() || null
|
|
13950
14290
|
);
|
|
13951
14291
|
const wallets = useWalletConnectors();
|
|
13952
|
-
const [isLoggingIn, setIsLoggingIn] =
|
|
13953
|
-
const [loginErrorMessage, setLoginErrorMessage] =
|
|
13954
|
-
const [loggedInUser, setLoggedInUser] =
|
|
14292
|
+
const [isLoggingIn, setIsLoggingIn] = useState41(false);
|
|
14293
|
+
const [loginErrorMessage, setLoginErrorMessage] = useState41("");
|
|
14294
|
+
const [loggedInUser, setLoggedInUser] = useState41(null);
|
|
13955
14295
|
const setLoginMethodAndCache = useCallback27(
|
|
13956
14296
|
(method) => {
|
|
13957
14297
|
try {
|
|
@@ -14188,7 +14528,7 @@ var FunkitWeb2Provider = ({
|
|
|
14188
14528
|
},
|
|
14189
14529
|
[privy, setLoginMethodAndCache]
|
|
14190
14530
|
);
|
|
14191
|
-
const [isSendingOtpEmail, setIsSendingOtpEmail] =
|
|
14531
|
+
const [isSendingOtpEmail, setIsSendingOtpEmail] = useState41(false);
|
|
14192
14532
|
const handleSendOtpEmail = useCallback27(
|
|
14193
14533
|
async (emailAddress) => {
|
|
14194
14534
|
try {
|
|
@@ -14216,7 +14556,7 @@ var FunkitWeb2Provider = ({
|
|
|
14216
14556
|
},
|
|
14217
14557
|
[privy, setLoginMethodAndCache]
|
|
14218
14558
|
);
|
|
14219
|
-
const userAccountInfo =
|
|
14559
|
+
const userAccountInfo = useMemo34(() => {
|
|
14220
14560
|
if (loggedInUser && loggedInUser.linked_accounts && loggedInUser.linked_accounts.length > 0) {
|
|
14221
14561
|
const loggedInAccount = loggedInUser.linked_accounts.find(
|
|
14222
14562
|
(account) => (account == null ? void 0 : account.type) === loginMethod
|
|
@@ -14266,9 +14606,9 @@ var FunkitWeb2Provider = ({
|
|
|
14266
14606
|
handleFunkitWeb2Logout,
|
|
14267
14607
|
web2AccountInfo: userAccountInfo
|
|
14268
14608
|
};
|
|
14269
|
-
return /* @__PURE__ */
|
|
14609
|
+
return /* @__PURE__ */ React143.createElement(FunkitWeb2Context.Provider, {
|
|
14270
14610
|
value: contextValue
|
|
14271
|
-
}, privyIframeUrl ? /* @__PURE__ */
|
|
14611
|
+
}, privyIframeUrl ? /* @__PURE__ */ React143.createElement("iframe", {
|
|
14272
14612
|
id: PRIVY_IFRAME_ID,
|
|
14273
14613
|
src: privyIframeUrl,
|
|
14274
14614
|
style: { display: "none" }
|
|
@@ -14297,27 +14637,27 @@ function useConnectionStatus() {
|
|
|
14297
14637
|
}
|
|
14298
14638
|
|
|
14299
14639
|
// src/components/FunkitProvider/ShowBalanceContext.tsx
|
|
14300
|
-
import
|
|
14640
|
+
import React144, { createContext as createContext18, useContext as useContext24, useState as useState42 } from "react";
|
|
14301
14641
|
var ShowBalanceContext = createContext18({
|
|
14302
14642
|
showBalance: void 0,
|
|
14303
14643
|
setShowBalance: () => void 0
|
|
14304
14644
|
});
|
|
14305
14645
|
function ShowBalanceProvider({ children }) {
|
|
14306
|
-
const [showBalance, setShowBalance] =
|
|
14307
|
-
return /* @__PURE__ */
|
|
14646
|
+
const [showBalance, setShowBalance] = useState42();
|
|
14647
|
+
return /* @__PURE__ */ React144.createElement(ShowBalanceContext.Provider, {
|
|
14308
14648
|
value: { showBalance, setShowBalance }
|
|
14309
14649
|
}, children);
|
|
14310
14650
|
}
|
|
14311
14651
|
var useShowBalance = () => useContext24(ShowBalanceContext);
|
|
14312
14652
|
|
|
14313
14653
|
// src/components/Icons/Dropdown.tsx
|
|
14314
|
-
import
|
|
14315
|
-
var DropdownIcon = () => /* @__PURE__ */
|
|
14654
|
+
import React145 from "react";
|
|
14655
|
+
var DropdownIcon = () => /* @__PURE__ */ React145.createElement("svg", {
|
|
14316
14656
|
fill: "none",
|
|
14317
14657
|
height: "7",
|
|
14318
14658
|
width: "14",
|
|
14319
14659
|
xmlns: "http://www.w3.org/2000/svg"
|
|
14320
|
-
}, /* @__PURE__ */
|
|
14660
|
+
}, /* @__PURE__ */ React145.createElement("path", {
|
|
14321
14661
|
d: "M12.75 1.54001L8.51647 5.0038C7.77974 5.60658 6.72026 5.60658 5.98352 5.0038L1.75 1.54001",
|
|
14322
14662
|
stroke: "currentColor",
|
|
14323
14663
|
strokeLinecap: "round",
|
|
@@ -14327,13 +14667,13 @@ var DropdownIcon = () => /* @__PURE__ */ React143.createElement("svg", {
|
|
|
14327
14667
|
}));
|
|
14328
14668
|
|
|
14329
14669
|
// src/components/ConnectButton/ConnectButtonRenderer.tsx
|
|
14330
|
-
import
|
|
14670
|
+
import React147, { useContext as useContext26 } from "react";
|
|
14331
14671
|
import { useAccount as useAccount16, useBalance, useConfig as useConfig5 } from "wagmi";
|
|
14332
14672
|
|
|
14333
14673
|
// src/hooks/useIsMounted.ts
|
|
14334
|
-
import { useCallback as useCallback28, useEffect as useEffect29, useState as
|
|
14674
|
+
import { useCallback as useCallback28, useEffect as useEffect29, useState as useState43 } from "react";
|
|
14335
14675
|
function useIsMounted() {
|
|
14336
|
-
const [isMounted, setIsMounted] =
|
|
14676
|
+
const [isMounted, setIsMounted] = useState43(false);
|
|
14337
14677
|
useEffect29(() => {
|
|
14338
14678
|
setIsMounted(true);
|
|
14339
14679
|
return () => {
|
|
@@ -14360,7 +14700,7 @@ function useMainnetEnsAvatar(name) {
|
|
|
14360
14700
|
}
|
|
14361
14701
|
|
|
14362
14702
|
// src/transactions/useRecentTransactions.ts
|
|
14363
|
-
import { useEffect as useEffect31, useState as
|
|
14703
|
+
import { useEffect as useEffect31, useState as useState45 } from "react";
|
|
14364
14704
|
import { useAccount as useAccount15 } from "wagmi";
|
|
14365
14705
|
|
|
14366
14706
|
// src/hooks/useChainId.ts
|
|
@@ -14372,7 +14712,7 @@ function useChainId() {
|
|
|
14372
14712
|
}
|
|
14373
14713
|
|
|
14374
14714
|
// src/transactions/TransactionStoreContext.tsx
|
|
14375
|
-
import
|
|
14715
|
+
import React146, { createContext as createContext19, useContext as useContext25, useEffect as useEffect30, useState as useState44 } from "react";
|
|
14376
14716
|
import { useAccount as useAccount14, usePublicClient } from "wagmi";
|
|
14377
14717
|
|
|
14378
14718
|
// src/transactions/transactionStore.ts
|
|
@@ -14522,7 +14862,7 @@ function TransactionStoreProvider({
|
|
|
14522
14862
|
const provider = usePublicClient();
|
|
14523
14863
|
const { address } = useAccount14();
|
|
14524
14864
|
const chainId = useChainId();
|
|
14525
|
-
const [store] =
|
|
14865
|
+
const [store] = useState44(
|
|
14526
14866
|
() => storeSingleton != null ? storeSingleton : storeSingleton = createTransactionStore({ provider })
|
|
14527
14867
|
);
|
|
14528
14868
|
useEffect30(() => {
|
|
@@ -14533,7 +14873,7 @@ function TransactionStoreProvider({
|
|
|
14533
14873
|
store.waitForPendingTransactions(address, chainId);
|
|
14534
14874
|
}
|
|
14535
14875
|
}, [store, address, chainId]);
|
|
14536
|
-
return /* @__PURE__ */
|
|
14876
|
+
return /* @__PURE__ */ React146.createElement(TransactionStoreContext.Provider, {
|
|
14537
14877
|
value: store
|
|
14538
14878
|
}, children);
|
|
14539
14879
|
}
|
|
@@ -14550,7 +14890,7 @@ function useRecentTransactions() {
|
|
|
14550
14890
|
const store = useTransactionStore();
|
|
14551
14891
|
const { address } = useAccount15();
|
|
14552
14892
|
const chainId = useChainId();
|
|
14553
|
-
const [transactions, setTransactions] =
|
|
14893
|
+
const [transactions, setTransactions] = useState45(
|
|
14554
14894
|
() => store && address && chainId ? store.getTransactions(address, chainId) : []
|
|
14555
14895
|
);
|
|
14556
14896
|
useEffect31(() => {
|
|
@@ -14637,7 +14977,7 @@ function ConnectButtonRenderer({
|
|
|
14637
14977
|
const { openChainModal } = useChainModal();
|
|
14638
14978
|
const { openAccountModal } = useAccountModal();
|
|
14639
14979
|
const { accountModalOpen, chainModalOpen, connectModalOpen } = useModalState();
|
|
14640
|
-
return /* @__PURE__ */
|
|
14980
|
+
return /* @__PURE__ */ React147.createElement(React147.Fragment, null, children({
|
|
14641
14981
|
account: address ? {
|
|
14642
14982
|
address,
|
|
14643
14983
|
balanceDecimals: balanceData == null ? void 0 : balanceData.decimals,
|
|
@@ -14685,7 +15025,7 @@ function ChainSelectorButton({
|
|
|
14685
15025
|
}) {
|
|
14686
15026
|
var _a, _b;
|
|
14687
15027
|
const { i18n: i18n2 } = useContext27(I18nContext);
|
|
14688
|
-
return /* @__PURE__ */
|
|
15028
|
+
return /* @__PURE__ */ React148.createElement(Box, {
|
|
14689
15029
|
alignItems: "center",
|
|
14690
15030
|
"aria-label": "Chain Selector",
|
|
14691
15031
|
as: "button",
|
|
@@ -14711,37 +15051,37 @@ function ChainSelectorButton({
|
|
|
14711
15051
|
testId: unsupportedChain ? "wrong-network-button" : "chain-button",
|
|
14712
15052
|
transition: "default",
|
|
14713
15053
|
type: "button"
|
|
14714
|
-
}, unsupportedChain ? /* @__PURE__ */
|
|
15054
|
+
}, unsupportedChain ? /* @__PURE__ */ React148.createElement(Box, {
|
|
14715
15055
|
alignItems: "center",
|
|
14716
15056
|
display: "flex",
|
|
14717
15057
|
height: "24",
|
|
14718
15058
|
paddingX: "4"
|
|
14719
|
-
}, i18n2.t("connect_wallet.wrong_network.label")) : /* @__PURE__ */
|
|
15059
|
+
}, i18n2.t("connect_wallet.wrong_network.label")) : /* @__PURE__ */ React148.createElement(Box, {
|
|
14720
15060
|
alignItems: "center",
|
|
14721
15061
|
display: "flex",
|
|
14722
15062
|
gap: "6"
|
|
14723
|
-
}, chain.hasIcon ? /* @__PURE__ */
|
|
15063
|
+
}, chain.hasIcon ? /* @__PURE__ */ React148.createElement(Box, {
|
|
14724
15064
|
display: mapResponsiveValue(
|
|
14725
15065
|
chainStatus,
|
|
14726
15066
|
(value) => value === "full" || value === "icon" ? "block" : "none"
|
|
14727
15067
|
),
|
|
14728
15068
|
height: "24",
|
|
14729
15069
|
width: "24"
|
|
14730
|
-
}, /* @__PURE__ */
|
|
15070
|
+
}, /* @__PURE__ */ React148.createElement(AsyncImage, {
|
|
14731
15071
|
alt: (_a = chain.name) != null ? _a : "Chain icon",
|
|
14732
15072
|
background: chain.iconBackground,
|
|
14733
15073
|
borderRadius: "full",
|
|
14734
15074
|
height: "24",
|
|
14735
15075
|
src: chain.iconUrl,
|
|
14736
15076
|
width: "24"
|
|
14737
|
-
})) : null, /* @__PURE__ */
|
|
15077
|
+
})) : null, /* @__PURE__ */ React148.createElement(Box, {
|
|
14738
15078
|
display: mapResponsiveValue(chainStatus, (value) => {
|
|
14739
15079
|
if (value === "icon" && !chain.iconUrl) {
|
|
14740
15080
|
return "block";
|
|
14741
15081
|
}
|
|
14742
15082
|
return value === "full" || value === "name" ? "block" : "none";
|
|
14743
15083
|
})
|
|
14744
|
-
}, (_b = chain.name) != null ? _b : chain.id)), /* @__PURE__ */
|
|
15084
|
+
}, (_b = chain.name) != null ? _b : chain.id)), /* @__PURE__ */ React148.createElement(DropdownIcon, null));
|
|
14745
15085
|
}
|
|
14746
15086
|
function AccountButton({
|
|
14747
15087
|
openAccountModal,
|
|
@@ -14750,7 +15090,7 @@ function AccountButton({
|
|
|
14750
15090
|
accountStatus
|
|
14751
15091
|
}) {
|
|
14752
15092
|
const { userInfo } = useGeneralWallet();
|
|
14753
|
-
return /* @__PURE__ */
|
|
15093
|
+
return /* @__PURE__ */ React148.createElement(Box, {
|
|
14754
15094
|
alignItems: "center",
|
|
14755
15095
|
as: "button",
|
|
14756
15096
|
background: "accentColor",
|
|
@@ -14768,14 +15108,14 @@ function AccountButton({
|
|
|
14768
15108
|
testId: "account-button",
|
|
14769
15109
|
transition: "default",
|
|
14770
15110
|
type: "button"
|
|
14771
|
-
}, account.displayBalance && /* @__PURE__ */
|
|
15111
|
+
}, account.displayBalance && /* @__PURE__ */ React148.createElement(Box, {
|
|
14772
15112
|
display: mapResponsiveValue(
|
|
14773
15113
|
showBalance,
|
|
14774
15114
|
(value) => value ? "block" : "none"
|
|
14775
15115
|
),
|
|
14776
15116
|
padding: "8",
|
|
14777
15117
|
paddingLeft: "12"
|
|
14778
|
-
}, account.displayBalance), /* @__PURE__ */
|
|
15118
|
+
}, account.displayBalance), /* @__PURE__ */ React148.createElement(Box, {
|
|
14779
15119
|
background: "connectButtonInnerBackground",
|
|
14780
15120
|
borderColor: "accentColor",
|
|
14781
15121
|
borderRadius: "connectButton",
|
|
@@ -14787,32 +15127,32 @@ function AccountButton({
|
|
|
14787
15127
|
paddingX: "8",
|
|
14788
15128
|
paddingY: "6",
|
|
14789
15129
|
transition: "default"
|
|
14790
|
-
}, /* @__PURE__ */
|
|
15130
|
+
}, /* @__PURE__ */ React148.createElement(Box, {
|
|
14791
15131
|
alignItems: "center",
|
|
14792
15132
|
display: "flex",
|
|
14793
15133
|
gap: "6",
|
|
14794
15134
|
height: "24"
|
|
14795
|
-
}, /* @__PURE__ */
|
|
15135
|
+
}, /* @__PURE__ */ React148.createElement(Box, {
|
|
14796
15136
|
display: mapResponsiveValue(
|
|
14797
15137
|
accountStatus,
|
|
14798
15138
|
(value) => value === "full" || value === "avatar" ? "block" : "none"
|
|
14799
15139
|
)
|
|
14800
|
-
}, /* @__PURE__ */
|
|
15140
|
+
}, /* @__PURE__ */ React148.createElement(Avatar, {
|
|
14801
15141
|
address: account.address,
|
|
14802
15142
|
imageUrl: account.ensAvatar,
|
|
14803
15143
|
loading: account.hasPendingTransactions,
|
|
14804
15144
|
size: 24
|
|
14805
|
-
})), /* @__PURE__ */
|
|
15145
|
+
})), /* @__PURE__ */ React148.createElement(Box, {
|
|
14806
15146
|
alignItems: "center",
|
|
14807
15147
|
display: "flex",
|
|
14808
15148
|
gap: "6"
|
|
14809
|
-
}, /* @__PURE__ */
|
|
15149
|
+
}, /* @__PURE__ */ React148.createElement(Box, {
|
|
14810
15150
|
display: mapResponsiveValue(
|
|
14811
15151
|
accountStatus,
|
|
14812
15152
|
(value) => value === "full" || value === "address" ? "block" : "none"
|
|
14813
15153
|
),
|
|
14814
15154
|
style: { textWrap: "nowrap" }
|
|
14815
|
-
}, userInfo.accountName), /* @__PURE__ */
|
|
15155
|
+
}, userInfo.accountName), /* @__PURE__ */ React148.createElement(DropdownIcon, null)))));
|
|
14816
15156
|
}
|
|
14817
15157
|
function ConnectButton({
|
|
14818
15158
|
accountStatus = defaultProps.accountStatus,
|
|
@@ -14824,14 +15164,14 @@ function ConnectButton({
|
|
|
14824
15164
|
const chains = useFunkitConnectChains();
|
|
14825
15165
|
const connectionStatus = useConnectionStatus();
|
|
14826
15166
|
const { setShowBalance } = useShowBalance();
|
|
14827
|
-
const [ready, setReady] =
|
|
15167
|
+
const [ready, setReady] = useState46(false);
|
|
14828
15168
|
const { i18n: i18n2 } = useContext27(I18nContext);
|
|
14829
15169
|
useEffect32(() => {
|
|
14830
15170
|
setShowBalance(showBalance);
|
|
14831
15171
|
if (!ready)
|
|
14832
15172
|
setReady(true);
|
|
14833
15173
|
}, [showBalance, setShowBalance, ready]);
|
|
14834
|
-
return ready ? /* @__PURE__ */
|
|
15174
|
+
return ready ? /* @__PURE__ */ React148.createElement(ConnectButtonRenderer, null, ({
|
|
14835
15175
|
account,
|
|
14836
15176
|
chain,
|
|
14837
15177
|
mounted,
|
|
@@ -14842,7 +15182,7 @@ function ConnectButton({
|
|
|
14842
15182
|
var _a;
|
|
14843
15183
|
const ready2 = mounted && connectionStatus !== "loading";
|
|
14844
15184
|
const unsupportedChain = (_a = chain == null ? void 0 : chain.unsupported) != null ? _a : false;
|
|
14845
|
-
return /* @__PURE__ */
|
|
15185
|
+
return /* @__PURE__ */ React148.createElement(Box, {
|
|
14846
15186
|
display: "flex",
|
|
14847
15187
|
gap: "12",
|
|
14848
15188
|
...!ready2 && {
|
|
@@ -14853,17 +15193,17 @@ function ConnectButton({
|
|
|
14853
15193
|
userSelect: "none"
|
|
14854
15194
|
}
|
|
14855
15195
|
}
|
|
14856
|
-
}, ready2 && account && connectionStatus === "connected" ? /* @__PURE__ */
|
|
15196
|
+
}, ready2 && account && connectionStatus === "connected" ? /* @__PURE__ */ React148.createElement(React148.Fragment, null, showChainSelector && chain && (chains.length > 1 || unsupportedChain) && /* @__PURE__ */ React148.createElement(ChainSelectorButton, {
|
|
14857
15197
|
unsupportedChain,
|
|
14858
15198
|
chainStatus,
|
|
14859
15199
|
openChainModal,
|
|
14860
15200
|
chain
|
|
14861
|
-
}), !unsupportedChain && /* @__PURE__ */
|
|
15201
|
+
}), !unsupportedChain && /* @__PURE__ */ React148.createElement(AccountButton, {
|
|
14862
15202
|
openAccountModal,
|
|
14863
15203
|
account,
|
|
14864
15204
|
showBalance,
|
|
14865
15205
|
accountStatus
|
|
14866
|
-
})) : /* @__PURE__ */
|
|
15206
|
+
})) : /* @__PURE__ */ React148.createElement(Box, {
|
|
14867
15207
|
as: "button",
|
|
14868
15208
|
background: "accentColor",
|
|
14869
15209
|
borderRadius: "connectButton",
|
|
@@ -14883,14 +15223,14 @@ function ConnectButton({
|
|
|
14883
15223
|
transition: "default",
|
|
14884
15224
|
type: "button"
|
|
14885
15225
|
}, mounted && label === "Connect Wallet" ? i18n2.t("connect_wallet.label") : label));
|
|
14886
|
-
}) : /* @__PURE__ */
|
|
15226
|
+
}) : /* @__PURE__ */ React148.createElement(React148.Fragment, null);
|
|
14887
15227
|
}
|
|
14888
15228
|
ConnectButton.__defaultProps = defaultProps;
|
|
14889
15229
|
ConnectButton.Custom = ConnectButtonRenderer;
|
|
14890
15230
|
|
|
14891
15231
|
// src/components/FunkitProvider/FunkitProvider.tsx
|
|
14892
15232
|
import { QueryClientProvider } from "@tanstack/react-query";
|
|
14893
|
-
import
|
|
15233
|
+
import React149, { createContext as createContext21, useContext as useContext28, useEffect as useEffect35 } from "react";
|
|
14894
15234
|
import { useAccountEffect as useAccountEffect3, WagmiProvider } from "wagmi";
|
|
14895
15235
|
|
|
14896
15236
|
// src/css/cssObjectFromTheme.ts
|
|
@@ -15702,7 +16042,7 @@ function setFunkitConnectVersion({ version }) {
|
|
|
15702
16042
|
localStorage.setItem(storageKey4, version);
|
|
15703
16043
|
}
|
|
15704
16044
|
function getCurrentSdkVersion() {
|
|
15705
|
-
return "1.0.
|
|
16045
|
+
return "1.0.16";
|
|
15706
16046
|
}
|
|
15707
16047
|
function useFingerprint() {
|
|
15708
16048
|
const fingerprint = useCallback29(() => {
|
|
@@ -15757,7 +16097,7 @@ function clearWalletConnectDeepLink() {
|
|
|
15757
16097
|
|
|
15758
16098
|
// src/components/FunkitProvider/FunkitProvider.tsx
|
|
15759
16099
|
var MoonPayProvider = (props) => {
|
|
15760
|
-
const [MoonPayProviderInner, setMoonPayProviderInner] =
|
|
16100
|
+
const [MoonPayProviderInner, setMoonPayProviderInner] = React149.useState(null);
|
|
15761
16101
|
useEffect35(() => {
|
|
15762
16102
|
const loadMoonPayProviderInner = async () => {
|
|
15763
16103
|
try {
|
|
@@ -15770,8 +16110,8 @@ var MoonPayProvider = (props) => {
|
|
|
15770
16110
|
loadMoonPayProviderInner();
|
|
15771
16111
|
}, []);
|
|
15772
16112
|
if (!MoonPayProviderInner)
|
|
15773
|
-
return /* @__PURE__ */
|
|
15774
|
-
return /* @__PURE__ */
|
|
16113
|
+
return /* @__PURE__ */ React149.createElement(React149.Fragment, null, props.children);
|
|
16114
|
+
return /* @__PURE__ */ React149.createElement(MoonPayProviderInner, {
|
|
15775
16115
|
...props
|
|
15776
16116
|
}, props.children);
|
|
15777
16117
|
};
|
|
@@ -15793,13 +16133,13 @@ function FunkitProvider(props) {
|
|
|
15793
16133
|
getCurrentSdkVersion()
|
|
15794
16134
|
);
|
|
15795
16135
|
const initialChainId = getInitialChainIdFromFunkitProviderProps(props);
|
|
15796
|
-
return /* @__PURE__ */
|
|
16136
|
+
return /* @__PURE__ */ React149.createElement(WagmiProvider, {
|
|
15797
16137
|
config: finalWagmiConfig
|
|
15798
|
-
}, /* @__PURE__ */
|
|
16138
|
+
}, /* @__PURE__ */ React149.createElement(QueryClientProvider, {
|
|
15799
16139
|
client: props.queryClient
|
|
15800
|
-
}, /* @__PURE__ */
|
|
16140
|
+
}, /* @__PURE__ */ React149.createElement(FunkitThemeProvider, {
|
|
15801
16141
|
theme: props.theme
|
|
15802
|
-
}, /* @__PURE__ */
|
|
16142
|
+
}, /* @__PURE__ */ React149.createElement(FunkitProviderInner, {
|
|
15803
16143
|
appInfo: props.appInfo,
|
|
15804
16144
|
avatar: props.avatar,
|
|
15805
16145
|
id: props.id,
|
|
@@ -15835,36 +16175,36 @@ function FunkitProviderInner({
|
|
|
15835
16175
|
const modalSize = ModalSizeOptions.WIDE;
|
|
15836
16176
|
const coolMode = false;
|
|
15837
16177
|
const showRecentTransactions = false;
|
|
15838
|
-
return /* @__PURE__ */
|
|
16178
|
+
return /* @__PURE__ */ React149.createElement(FunkitConnectChainProvider, {
|
|
15839
16179
|
initialChain
|
|
15840
|
-
}, /* @__PURE__ */
|
|
16180
|
+
}, /* @__PURE__ */ React149.createElement(FunkitConfigContext.Provider, {
|
|
15841
16181
|
value: funkitConfig
|
|
15842
|
-
}, /* @__PURE__ */
|
|
16182
|
+
}, /* @__PURE__ */ React149.createElement(WalletButtonProvider, null, /* @__PURE__ */ React149.createElement(I18nProvider, {
|
|
15843
16183
|
locale
|
|
15844
|
-
}, /* @__PURE__ */
|
|
16184
|
+
}, /* @__PURE__ */ React149.createElement(CoolModeContext.Provider, {
|
|
15845
16185
|
value: coolMode
|
|
15846
|
-
}, /* @__PURE__ */
|
|
16186
|
+
}, /* @__PURE__ */ React149.createElement(ModalSizeProvider, {
|
|
15847
16187
|
modalSize
|
|
15848
|
-
}, /* @__PURE__ */
|
|
16188
|
+
}, /* @__PURE__ */ React149.createElement(FunkitWeb2Provider, null, /* @__PURE__ */ React149.createElement(GeneralWalletProvider, null, /* @__PURE__ */ React149.createElement(FunkitCheckoutProvider, null, /* @__PURE__ */ React149.createElement(ShowRecentTransactionsContext.Provider, {
|
|
15849
16189
|
value: showRecentTransactions
|
|
15850
|
-
}, /* @__PURE__ */
|
|
16190
|
+
}, /* @__PURE__ */ React149.createElement(FunkitSandboxContext.Provider, {
|
|
15851
16191
|
value: isSandboxMode
|
|
15852
|
-
}, /* @__PURE__ */
|
|
16192
|
+
}, /* @__PURE__ */ React149.createElement(FunkitMeshProvider, null, /* @__PURE__ */ React149.createElement(TransactionStoreProvider, null, /* @__PURE__ */ React149.createElement(AvatarContext.Provider, {
|
|
15853
16193
|
value: avatarContext
|
|
15854
|
-
}, /* @__PURE__ */
|
|
16194
|
+
}, /* @__PURE__ */ React149.createElement(AppContext.Provider, {
|
|
15855
16195
|
value: appContext
|
|
15856
|
-
}, /* @__PURE__ */
|
|
16196
|
+
}, /* @__PURE__ */ React149.createElement(ThemeIdContext2.Provider, {
|
|
15857
16197
|
value: id
|
|
15858
|
-
}, /* @__PURE__ */
|
|
16198
|
+
}, /* @__PURE__ */ React149.createElement(ShowBalanceProvider, null, /* @__PURE__ */ React149.createElement(FunToastProvider, null, /* @__PURE__ */ React149.createElement(MoonPayProvider, {
|
|
15859
16199
|
apiKey: isSandboxMode ? "pk_test_dWfAhBbvVexIId9S5hPd78mKM7ivIsqu" : "pk_live_IxayBRQuBC3RzpPZkbGPrwUsRWAaeO",
|
|
15860
16200
|
debug: !!debug
|
|
15861
|
-
}, /* @__PURE__ */
|
|
16201
|
+
}, /* @__PURE__ */ React149.createElement(ModalProvider, null, activeTheme ? /* @__PURE__ */ React149.createElement("div", {
|
|
15862
16202
|
...createThemeRootProps2(id),
|
|
15863
16203
|
style: {
|
|
15864
16204
|
width: "100%",
|
|
15865
16205
|
height: "100%"
|
|
15866
16206
|
}
|
|
15867
|
-
}, /* @__PURE__ */
|
|
16207
|
+
}, /* @__PURE__ */ React149.createElement("style", {
|
|
15868
16208
|
dangerouslySetInnerHTML: {
|
|
15869
16209
|
__html: [
|
|
15870
16210
|
`${selector}{${cssStringFromTheme(
|
|
@@ -15876,18 +16216,18 @@ function FunkitProviderInner({
|
|
|
15876
16216
|
}
|
|
15877
16217
|
|
|
15878
16218
|
// src/components/WalletButton/WalletButton.tsx
|
|
15879
|
-
import
|
|
16219
|
+
import React151, { useContext as useContext30 } from "react";
|
|
15880
16220
|
|
|
15881
16221
|
// src/components/WalletButton/WalletButton.css.ts
|
|
15882
16222
|
var border = "_85s11r0";
|
|
15883
16223
|
var maxWidth = "_85s11r1";
|
|
15884
16224
|
|
|
15885
16225
|
// src/components/WalletButton/WalletButtonRenderer.tsx
|
|
15886
|
-
import
|
|
16226
|
+
import React150, {
|
|
15887
16227
|
useContext as useContext29,
|
|
15888
16228
|
useEffect as useEffect36,
|
|
15889
|
-
useMemo as
|
|
15890
|
-
useState as
|
|
16229
|
+
useMemo as useMemo35,
|
|
16230
|
+
useState as useState47
|
|
15891
16231
|
} from "react";
|
|
15892
16232
|
import { useAccount as useAccount17, useAccountEffect as useAccountEffect4 } from "wagmi";
|
|
15893
16233
|
function WalletButtonRenderer({
|
|
@@ -15903,8 +16243,8 @@ function WalletButtonRenderer({
|
|
|
15903
16243
|
throw new Error("Connector not found");
|
|
15904
16244
|
}
|
|
15905
16245
|
const connectionStatus = useConnectionStatus();
|
|
15906
|
-
const [loading, setLoading] =
|
|
15907
|
-
const [isError, setIsError] =
|
|
16246
|
+
const [loading, setLoading] = useState47(false);
|
|
16247
|
+
const [isError, setIsError] = useState47(false);
|
|
15908
16248
|
const mobile = isMobile();
|
|
15909
16249
|
useEffect36(() => {
|
|
15910
16250
|
if (!connectModalOpen && connector)
|
|
@@ -15918,7 +16258,7 @@ function WalletButtonRenderer({
|
|
|
15918
16258
|
},
|
|
15919
16259
|
onDisconnect: clearLatestWalletId
|
|
15920
16260
|
});
|
|
15921
|
-
const isLastWalletIdConnected =
|
|
16261
|
+
const isLastWalletIdConnected = useMemo35(() => {
|
|
15922
16262
|
const lastWalletId = getLatestWalletId();
|
|
15923
16263
|
if (!lastWalletId || !(firstConnector == null ? void 0 : firstConnector.id)) {
|
|
15924
16264
|
return false;
|
|
@@ -15943,7 +16283,7 @@ function WalletButtonRenderer({
|
|
|
15943
16283
|
const isStatusLoading = connectionStatus === "loading";
|
|
15944
16284
|
const ready = !isConnecting && !!openConnectModal && firstConnector && !isStatusLoading;
|
|
15945
16285
|
const isNotSupported = !(firstConnector == null ? void 0 : firstConnector.installed) || !(firstConnector == null ? void 0 : firstConnector.ready);
|
|
15946
|
-
return /* @__PURE__ */
|
|
16286
|
+
return /* @__PURE__ */ React150.createElement(React150.Fragment, null, children({
|
|
15947
16287
|
error: isError,
|
|
15948
16288
|
loading,
|
|
15949
16289
|
connected: isLastWalletIdConnected,
|
|
@@ -15965,14 +16305,14 @@ function WalletButtonRenderer({
|
|
|
15965
16305
|
// src/components/WalletButton/WalletButton.tsx
|
|
15966
16306
|
var WalletButton = ({ wallet }) => {
|
|
15967
16307
|
const { i18n: i18n2 } = useContext30(I18nContext);
|
|
15968
|
-
return /* @__PURE__ */
|
|
16308
|
+
return /* @__PURE__ */ React151.createElement(WalletButtonRenderer, {
|
|
15969
16309
|
wallet
|
|
15970
16310
|
}, ({ ready, connect, connected, mounted, connector, loading }) => {
|
|
15971
16311
|
const isDisabled = !ready || loading;
|
|
15972
16312
|
const connectorName = (connector == null ? void 0 : connector.name) || "";
|
|
15973
16313
|
if (!mounted)
|
|
15974
16314
|
return;
|
|
15975
|
-
return /* @__PURE__ */
|
|
16315
|
+
return /* @__PURE__ */ React151.createElement(Box, {
|
|
15976
16316
|
display: "flex",
|
|
15977
16317
|
flexDirection: "column",
|
|
15978
16318
|
alignItems: "center",
|
|
@@ -15980,7 +16320,7 @@ var WalletButton = ({ wallet }) => {
|
|
|
15980
16320
|
style: {
|
|
15981
16321
|
pointerEvents: isDisabled ? "none" : "all"
|
|
15982
16322
|
}
|
|
15983
|
-
}, /* @__PURE__ */
|
|
16323
|
+
}, /* @__PURE__ */ React151.createElement(Box, {
|
|
15984
16324
|
as: "button",
|
|
15985
16325
|
borderRadius: "menuButton",
|
|
15986
16326
|
borderStyle: "solid",
|
|
@@ -16002,7 +16342,7 @@ var WalletButton = ({ wallet }) => {
|
|
|
16002
16342
|
transition: "default",
|
|
16003
16343
|
width: "full",
|
|
16004
16344
|
background: "connectButtonBackground"
|
|
16005
|
-
}, /* @__PURE__ */
|
|
16345
|
+
}, /* @__PURE__ */ React151.createElement(Box, {
|
|
16006
16346
|
color: "modalText",
|
|
16007
16347
|
fontFamily: "body",
|
|
16008
16348
|
fontSize: "16",
|
|
@@ -16010,28 +16350,28 @@ var WalletButton = ({ wallet }) => {
|
|
|
16010
16350
|
transition: "default",
|
|
16011
16351
|
display: "flex",
|
|
16012
16352
|
alignItems: "center"
|
|
16013
|
-
}, /* @__PURE__ */
|
|
16353
|
+
}, /* @__PURE__ */ React151.createElement(Box, {
|
|
16014
16354
|
alignItems: "center",
|
|
16015
16355
|
display: "flex",
|
|
16016
16356
|
flexDirection: "row",
|
|
16017
16357
|
gap: "12",
|
|
16018
16358
|
paddingRight: "6"
|
|
16019
|
-
}, /* @__PURE__ */
|
|
16359
|
+
}, /* @__PURE__ */ React151.createElement(Box, null, loading ? /* @__PURE__ */ React151.createElement(SpinnerIcon, null) : /* @__PURE__ */ React151.createElement(AsyncImage, {
|
|
16020
16360
|
background: connector == null ? void 0 : connector.iconBackground,
|
|
16021
16361
|
borderRadius: "6",
|
|
16022
16362
|
height: "28",
|
|
16023
16363
|
src: connector == null ? void 0 : connector.iconUrl,
|
|
16024
16364
|
width: "28"
|
|
16025
|
-
})), /* @__PURE__ */
|
|
16365
|
+
})), /* @__PURE__ */ React151.createElement(Box, {
|
|
16026
16366
|
alignItems: "center",
|
|
16027
16367
|
display: "flex",
|
|
16028
16368
|
flexDirection: "column",
|
|
16029
16369
|
color: "modalText"
|
|
16030
|
-
}, /* @__PURE__ */
|
|
16370
|
+
}, /* @__PURE__ */ React151.createElement(Box, {
|
|
16031
16371
|
testId: `wallet-button-label-${(connector == null ? void 0 : connector.id) || ""}`
|
|
16032
16372
|
}, loading ? i18n2.t("connect.status.connecting", {
|
|
16033
16373
|
wallet: connectorName
|
|
16034
|
-
}) : connectorName)), connected ? /* @__PURE__ */
|
|
16374
|
+
}) : connectorName)), connected ? /* @__PURE__ */ React151.createElement(Box, {
|
|
16035
16375
|
background: "connectionIndicator",
|
|
16036
16376
|
borderColor: "selectedOptionBorder",
|
|
16037
16377
|
borderRadius: "full",
|
|
@@ -16069,12 +16409,12 @@ function getDefaultWallets(parameters) {
|
|
|
16069
16409
|
}
|
|
16070
16410
|
|
|
16071
16411
|
// src/components/ConnectOptions/MobileOptions.tsx
|
|
16072
|
-
import
|
|
16412
|
+
import React152, {
|
|
16073
16413
|
useCallback as useCallback31,
|
|
16074
16414
|
useContext as useContext31,
|
|
16075
16415
|
useEffect as useEffect37,
|
|
16076
16416
|
useRef as useRef11,
|
|
16077
|
-
useState as
|
|
16417
|
+
useState as useState48
|
|
16078
16418
|
} from "react";
|
|
16079
16419
|
|
|
16080
16420
|
// src/components/ConnectOptions/MobileOptions.css.ts
|
|
@@ -16088,12 +16428,12 @@ var LoadingSpinner = ({ wallet }) => {
|
|
|
16088
16428
|
const height = 80;
|
|
16089
16429
|
const radiusFactor = 20;
|
|
16090
16430
|
const perimeter = 2 * (width + height - 4 * radiusFactor);
|
|
16091
|
-
return /* @__PURE__ */
|
|
16431
|
+
return /* @__PURE__ */ React152.createElement("svg", {
|
|
16092
16432
|
className: spinner,
|
|
16093
16433
|
viewBox: "0 0 86 86",
|
|
16094
16434
|
width: "86",
|
|
16095
16435
|
height: "86"
|
|
16096
|
-
}, /* @__PURE__ */
|
|
16436
|
+
}, /* @__PURE__ */ React152.createElement("title", null, "Loading"), /* @__PURE__ */ React152.createElement("rect", {
|
|
16097
16437
|
x: "3",
|
|
16098
16438
|
y: "3",
|
|
16099
16439
|
width,
|
|
@@ -16160,7 +16500,7 @@ function WalletButton2({
|
|
|
16160
16500
|
initialized.current = true;
|
|
16161
16501
|
}
|
|
16162
16502
|
}, [connecting, onConnect]);
|
|
16163
|
-
return /* @__PURE__ */
|
|
16503
|
+
return /* @__PURE__ */ React152.createElement(Box, {
|
|
16164
16504
|
as: "button",
|
|
16165
16505
|
color: ready ? "modalText" : "modalTextSecondary",
|
|
16166
16506
|
disabled: !ready,
|
|
@@ -16172,40 +16512,40 @@ function WalletButton2({
|
|
|
16172
16512
|
testId: `wallet-option-${id}`,
|
|
16173
16513
|
type: "button",
|
|
16174
16514
|
width: "full"
|
|
16175
|
-
}, /* @__PURE__ */
|
|
16515
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16176
16516
|
alignItems: "center",
|
|
16177
16517
|
display: "flex",
|
|
16178
16518
|
flexDirection: "column",
|
|
16179
16519
|
justifyContent: "center"
|
|
16180
|
-
}, /* @__PURE__ */
|
|
16520
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16181
16521
|
display: "flex",
|
|
16182
16522
|
alignItems: "center",
|
|
16183
16523
|
justifyContent: "center",
|
|
16184
16524
|
paddingBottom: "8",
|
|
16185
16525
|
paddingTop: "10",
|
|
16186
16526
|
position: "relative"
|
|
16187
|
-
}, connecting ? /* @__PURE__ */
|
|
16527
|
+
}, connecting ? /* @__PURE__ */ React152.createElement(LoadingSpinner, {
|
|
16188
16528
|
wallet
|
|
16189
|
-
}) : null, /* @__PURE__ */
|
|
16529
|
+
}) : null, /* @__PURE__ */ React152.createElement(AsyncImage, {
|
|
16190
16530
|
background: iconBackground,
|
|
16191
16531
|
borderRadius: "13",
|
|
16192
16532
|
boxShadow: "walletLogo",
|
|
16193
16533
|
height: "60",
|
|
16194
16534
|
src: iconUrl,
|
|
16195
16535
|
width: "60"
|
|
16196
|
-
})), !connecting ? /* @__PURE__ */
|
|
16536
|
+
})), !connecting ? /* @__PURE__ */ React152.createElement(Box, {
|
|
16197
16537
|
display: "flex",
|
|
16198
16538
|
flexDirection: "column",
|
|
16199
16539
|
textAlign: "center"
|
|
16200
|
-
}, /* @__PURE__ */
|
|
16540
|
+
}, /* @__PURE__ */ React152.createElement(Text, {
|
|
16201
16541
|
as: "h2",
|
|
16202
16542
|
color: wallet.ready ? "modalText" : "modalTextSecondary",
|
|
16203
16543
|
size: "13",
|
|
16204
16544
|
weight: "medium"
|
|
16205
|
-
}, /* @__PURE__ */
|
|
16545
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16206
16546
|
as: "span",
|
|
16207
16547
|
position: "relative"
|
|
16208
|
-
}, shortName != null ? shortName : name, !wallet.ready && " (unsupported)")), wallet.recent && /* @__PURE__ */
|
|
16548
|
+
}, shortName != null ? shortName : name, !wallet.ready && " (unsupported)")), wallet.recent && /* @__PURE__ */ React152.createElement(Text, {
|
|
16209
16549
|
color: "accentColor",
|
|
16210
16550
|
size: "12",
|
|
16211
16551
|
weight: "medium"
|
|
@@ -16222,7 +16562,7 @@ function MobileOptions({ onClose }) {
|
|
|
16222
16562
|
let walletContent = null;
|
|
16223
16563
|
let headerBackgroundContrast = false;
|
|
16224
16564
|
let headerBackButtonLink = null;
|
|
16225
|
-
const [walletStep, setWalletStep] =
|
|
16565
|
+
const [walletStep, setWalletStep] = useState48(
|
|
16226
16566
|
"CONNECT" /* Connect */
|
|
16227
16567
|
);
|
|
16228
16568
|
const { i18n: i18n2 } = useContext31(I18nContext);
|
|
@@ -16231,71 +16571,71 @@ function MobileOptions({ onClose }) {
|
|
|
16231
16571
|
case "CONNECT" /* Connect */: {
|
|
16232
16572
|
headerLabel = i18n2.t("connect.title");
|
|
16233
16573
|
headerBackgroundContrast = true;
|
|
16234
|
-
walletContent = /* @__PURE__ */
|
|
16574
|
+
walletContent = /* @__PURE__ */ React152.createElement(Box, null, /* @__PURE__ */ React152.createElement(Box, {
|
|
16235
16575
|
background: "profileForeground",
|
|
16236
16576
|
className: scroll2,
|
|
16237
16577
|
display: "flex",
|
|
16238
16578
|
paddingBottom: "20",
|
|
16239
16579
|
paddingTop: "6"
|
|
16240
|
-
}, /* @__PURE__ */
|
|
16580
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16241
16581
|
display: "flex",
|
|
16242
16582
|
style: { margin: "0 auto" }
|
|
16243
16583
|
}, wallets.filter((wallet) => wallet.ready).map((wallet) => {
|
|
16244
|
-
return /* @__PURE__ */
|
|
16584
|
+
return /* @__PURE__ */ React152.createElement(Box, {
|
|
16245
16585
|
key: wallet.id,
|
|
16246
16586
|
paddingX: "20"
|
|
16247
|
-
}, /* @__PURE__ */
|
|
16587
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16248
16588
|
width: "60"
|
|
16249
|
-
}, /* @__PURE__ */
|
|
16589
|
+
}, /* @__PURE__ */ React152.createElement(WalletButton2, {
|
|
16250
16590
|
onClose,
|
|
16251
16591
|
wallet
|
|
16252
16592
|
})));
|
|
16253
|
-
}))), /* @__PURE__ */
|
|
16593
|
+
}))), /* @__PURE__ */ React152.createElement(Box, {
|
|
16254
16594
|
background: "generalBorder",
|
|
16255
16595
|
height: "1",
|
|
16256
16596
|
marginBottom: "32",
|
|
16257
16597
|
marginTop: "-1"
|
|
16258
|
-
}), /* @__PURE__ */
|
|
16598
|
+
}), /* @__PURE__ */ React152.createElement(Box, {
|
|
16259
16599
|
alignItems: "center",
|
|
16260
16600
|
display: "flex",
|
|
16261
16601
|
flexDirection: "column",
|
|
16262
16602
|
gap: "32",
|
|
16263
16603
|
paddingX: "32",
|
|
16264
16604
|
style: { textAlign: "center" }
|
|
16265
|
-
}, /* @__PURE__ */
|
|
16605
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16266
16606
|
display: "flex",
|
|
16267
16607
|
flexDirection: "column",
|
|
16268
16608
|
gap: "8",
|
|
16269
16609
|
textAlign: "center"
|
|
16270
|
-
}, /* @__PURE__ */
|
|
16610
|
+
}, /* @__PURE__ */ React152.createElement(Text, {
|
|
16271
16611
|
color: "modalText",
|
|
16272
16612
|
size: "16",
|
|
16273
16613
|
weight: "bold"
|
|
16274
|
-
}, i18n2.t("intro.title")), /* @__PURE__ */
|
|
16614
|
+
}, i18n2.t("intro.title")), /* @__PURE__ */ React152.createElement(Text, {
|
|
16275
16615
|
color: "modalTextSecondary",
|
|
16276
16616
|
size: "16"
|
|
16277
|
-
}, i18n2.t("intro.description")))), /* @__PURE__ */
|
|
16617
|
+
}, i18n2.t("intro.description")))), /* @__PURE__ */ React152.createElement(Box, {
|
|
16278
16618
|
paddingTop: "32",
|
|
16279
16619
|
paddingX: "20"
|
|
16280
|
-
}, /* @__PURE__ */
|
|
16620
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16281
16621
|
display: "flex",
|
|
16282
16622
|
gap: "14",
|
|
16283
16623
|
justifyContent: "center"
|
|
16284
|
-
}, /* @__PURE__ */
|
|
16624
|
+
}, /* @__PURE__ */ React152.createElement(ActionButton, {
|
|
16285
16625
|
label: i18n2.t("intro.get.label"),
|
|
16286
16626
|
onClick: () => setWalletStep("GET" /* Get */),
|
|
16287
16627
|
size: "large",
|
|
16288
16628
|
type: "secondary"
|
|
16289
|
-
}), /* @__PURE__ */
|
|
16629
|
+
}), /* @__PURE__ */ React152.createElement(ActionButton, {
|
|
16290
16630
|
href: learnMoreUrl,
|
|
16291
16631
|
label: i18n2.t("intro.learn_more.label"),
|
|
16292
16632
|
size: "large",
|
|
16293
16633
|
type: "secondary"
|
|
16294
|
-
}))), Disclaimer && /* @__PURE__ */
|
|
16634
|
+
}))), Disclaimer && /* @__PURE__ */ React152.createElement(Box, {
|
|
16295
16635
|
marginTop: "28",
|
|
16296
16636
|
marginX: "32",
|
|
16297
16637
|
textAlign: "center"
|
|
16298
|
-
}, /* @__PURE__ */
|
|
16638
|
+
}, /* @__PURE__ */ React152.createElement(Disclaimer, {
|
|
16299
16639
|
Link: DisclaimerLink,
|
|
16300
16640
|
Text: DisclaimerText
|
|
16301
16641
|
})));
|
|
@@ -16310,7 +16650,7 @@ function MobileOptions({ onClose }) {
|
|
|
16310
16650
|
return ((_a2 = wallet.downloadUrls) == null ? void 0 : _a2.ios) || ((_b = wallet.downloadUrls) == null ? void 0 : _b.android) || ((_c = wallet.downloadUrls) == null ? void 0 : _c.mobile);
|
|
16311
16651
|
}
|
|
16312
16652
|
)) == null ? void 0 : _a.splice(0, 3);
|
|
16313
|
-
walletContent = /* @__PURE__ */
|
|
16653
|
+
walletContent = /* @__PURE__ */ React152.createElement(Box, null, /* @__PURE__ */ React152.createElement(Box, {
|
|
16314
16654
|
alignItems: "center",
|
|
16315
16655
|
display: "flex",
|
|
16316
16656
|
flexDirection: "column",
|
|
@@ -16324,88 +16664,88 @@ function MobileOptions({ onClose }) {
|
|
|
16324
16664
|
if (!(downloadUrls == null ? void 0 : downloadUrls.ios) && !(downloadUrls == null ? void 0 : downloadUrls.android) && !(downloadUrls == null ? void 0 : downloadUrls.mobile)) {
|
|
16325
16665
|
return null;
|
|
16326
16666
|
}
|
|
16327
|
-
return /* @__PURE__ */
|
|
16667
|
+
return /* @__PURE__ */ React152.createElement(Box, {
|
|
16328
16668
|
display: "flex",
|
|
16329
16669
|
gap: "16",
|
|
16330
16670
|
key: wallet.id,
|
|
16331
16671
|
paddingX: "20",
|
|
16332
16672
|
width: "full"
|
|
16333
|
-
}, /* @__PURE__ */
|
|
16673
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16334
16674
|
style: { minHeight: 48, minWidth: 48 }
|
|
16335
|
-
}, /* @__PURE__ */
|
|
16675
|
+
}, /* @__PURE__ */ React152.createElement(AsyncImage, {
|
|
16336
16676
|
background: iconBackground,
|
|
16337
16677
|
borderColor: "generalBorder",
|
|
16338
16678
|
borderRadius: "10",
|
|
16339
16679
|
height: "48",
|
|
16340
16680
|
src: iconUrl,
|
|
16341
16681
|
width: "48"
|
|
16342
|
-
})), /* @__PURE__ */
|
|
16682
|
+
})), /* @__PURE__ */ React152.createElement(Box, {
|
|
16343
16683
|
display: "flex",
|
|
16344
16684
|
flexDirection: "column",
|
|
16345
16685
|
width: "full"
|
|
16346
|
-
}, /* @__PURE__ */
|
|
16686
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16347
16687
|
alignItems: "center",
|
|
16348
16688
|
display: "flex",
|
|
16349
16689
|
height: "48"
|
|
16350
|
-
}, /* @__PURE__ */
|
|
16690
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16351
16691
|
width: "full"
|
|
16352
|
-
}, /* @__PURE__ */
|
|
16692
|
+
}, /* @__PURE__ */ React152.createElement(Text, {
|
|
16353
16693
|
color: "modalText",
|
|
16354
16694
|
size: "18",
|
|
16355
16695
|
weight: "bold"
|
|
16356
|
-
}, name)), /* @__PURE__ */
|
|
16696
|
+
}, name)), /* @__PURE__ */ React152.createElement(ActionButton, {
|
|
16357
16697
|
href: (ios ? downloadUrls == null ? void 0 : downloadUrls.ios : downloadUrls == null ? void 0 : downloadUrls.android) || (downloadUrls == null ? void 0 : downloadUrls.mobile),
|
|
16358
16698
|
label: i18n2.t("get.action.label"),
|
|
16359
16699
|
size: "small",
|
|
16360
16700
|
type: "secondary"
|
|
16361
|
-
})), index < mobileWallets.length - 1 && /* @__PURE__ */
|
|
16701
|
+
})), index < mobileWallets.length - 1 && /* @__PURE__ */ React152.createElement(Box, {
|
|
16362
16702
|
background: "generalBorderDim",
|
|
16363
16703
|
height: "1",
|
|
16364
16704
|
marginY: "10",
|
|
16365
16705
|
width: "full"
|
|
16366
16706
|
})));
|
|
16367
|
-
})), /* @__PURE__ */
|
|
16707
|
+
})), /* @__PURE__ */ React152.createElement(Box, {
|
|
16368
16708
|
style: { marginBottom: "42px" }
|
|
16369
|
-
}), /* @__PURE__ */
|
|
16709
|
+
}), /* @__PURE__ */ React152.createElement(Box, {
|
|
16370
16710
|
alignItems: "center",
|
|
16371
16711
|
display: "flex",
|
|
16372
16712
|
flexDirection: "column",
|
|
16373
16713
|
gap: "36",
|
|
16374
16714
|
paddingX: "36",
|
|
16375
16715
|
style: { textAlign: "center" }
|
|
16376
|
-
}, /* @__PURE__ */
|
|
16716
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16377
16717
|
display: "flex",
|
|
16378
16718
|
flexDirection: "column",
|
|
16379
16719
|
gap: "12",
|
|
16380
16720
|
textAlign: "center"
|
|
16381
|
-
}, /* @__PURE__ */
|
|
16721
|
+
}, /* @__PURE__ */ React152.createElement(Text, {
|
|
16382
16722
|
color: "modalText",
|
|
16383
16723
|
size: "16",
|
|
16384
16724
|
weight: "bold"
|
|
16385
|
-
}, i18n2.t("get.looking_for.title")), /* @__PURE__ */
|
|
16725
|
+
}, i18n2.t("get.looking_for.title")), /* @__PURE__ */ React152.createElement(Text, {
|
|
16386
16726
|
color: "modalTextSecondary",
|
|
16387
16727
|
size: "16"
|
|
16388
16728
|
}, i18n2.t("get.looking_for.mobile.description")))));
|
|
16389
16729
|
break;
|
|
16390
16730
|
}
|
|
16391
16731
|
}
|
|
16392
|
-
return /* @__PURE__ */
|
|
16732
|
+
return /* @__PURE__ */ React152.createElement(Box, {
|
|
16393
16733
|
display: "flex",
|
|
16394
16734
|
flexDirection: "column",
|
|
16395
16735
|
paddingBottom: "36"
|
|
16396
|
-
}, /* @__PURE__ */
|
|
16736
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16397
16737
|
background: headerBackgroundContrast ? "profileForeground" : "modalBackground",
|
|
16398
16738
|
display: "flex",
|
|
16399
16739
|
flexDirection: "column",
|
|
16400
16740
|
paddingBottom: "4",
|
|
16401
16741
|
paddingTop: "14"
|
|
16402
|
-
}, /* @__PURE__ */
|
|
16742
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16403
16743
|
display: "flex",
|
|
16404
16744
|
justifyContent: "center",
|
|
16405
16745
|
paddingBottom: "6",
|
|
16406
16746
|
paddingX: "20",
|
|
16407
16747
|
position: "relative"
|
|
16408
|
-
}, headerBackButtonLink && /* @__PURE__ */
|
|
16748
|
+
}, headerBackButtonLink && /* @__PURE__ */ React152.createElement(Box, {
|
|
16409
16749
|
display: "flex",
|
|
16410
16750
|
position: "absolute",
|
|
16411
16751
|
style: {
|
|
@@ -16413,7 +16753,7 @@ function MobileOptions({ onClose }) {
|
|
|
16413
16753
|
marginBottom: -20,
|
|
16414
16754
|
marginTop: -20
|
|
16415
16755
|
}
|
|
16416
|
-
}, /* @__PURE__ */
|
|
16756
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16417
16757
|
alignItems: "center",
|
|
16418
16758
|
as: "button",
|
|
16419
16759
|
className: touchableStyles({
|
|
@@ -16429,28 +16769,28 @@ function MobileOptions({ onClose }) {
|
|
|
16429
16769
|
style: { height: 17, willChange: "transform" },
|
|
16430
16770
|
transition: "default",
|
|
16431
16771
|
type: "button"
|
|
16432
|
-
}, /* @__PURE__ */
|
|
16772
|
+
}, /* @__PURE__ */ React152.createElement(BackIcon, null))), /* @__PURE__ */ React152.createElement(Box, {
|
|
16433
16773
|
marginTop: "4",
|
|
16434
16774
|
textAlign: "center",
|
|
16435
16775
|
width: "full"
|
|
16436
|
-
}, /* @__PURE__ */
|
|
16776
|
+
}, /* @__PURE__ */ React152.createElement(Text, {
|
|
16437
16777
|
as: "h1",
|
|
16438
16778
|
color: "modalText",
|
|
16439
16779
|
id: titleId,
|
|
16440
16780
|
size: "20",
|
|
16441
16781
|
weight: "bold"
|
|
16442
|
-
}, headerLabel)), /* @__PURE__ */
|
|
16782
|
+
}, headerLabel)), /* @__PURE__ */ React152.createElement(Box, {
|
|
16443
16783
|
alignItems: "center",
|
|
16444
16784
|
display: "flex",
|
|
16445
16785
|
height: "32",
|
|
16446
16786
|
paddingRight: "14",
|
|
16447
16787
|
position: "absolute",
|
|
16448
16788
|
right: "0"
|
|
16449
|
-
}, /* @__PURE__ */
|
|
16789
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16450
16790
|
style: { marginBottom: -20, marginTop: -20 }
|
|
16451
|
-
}, /* @__PURE__ */
|
|
16791
|
+
}, /* @__PURE__ */ React152.createElement(CloseButton, {
|
|
16452
16792
|
onClose
|
|
16453
|
-
}))))), /* @__PURE__ */
|
|
16793
|
+
}))))), /* @__PURE__ */ React152.createElement(Box, {
|
|
16454
16794
|
display: "flex",
|
|
16455
16795
|
flexDirection: "column"
|
|
16456
16796
|
}, walletContent));
|