@funkit/connect 1.0.15 → 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 +13 -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 +554 -238
- package/dist/utils/checkout.d.ts +8 -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 +43 -43
- 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,
|
|
@@ -3458,7 +3505,7 @@ function FunViewTxButton({ onClick }) {
|
|
|
3458
3505
|
weight: "semibold",
|
|
3459
3506
|
color: "buttonPrimary",
|
|
3460
3507
|
style: { lineHeight: "24px" }
|
|
3461
|
-
}, "View
|
|
3508
|
+
}, "View Order"));
|
|
3462
3509
|
}
|
|
3463
3510
|
|
|
3464
3511
|
// src/components/FunProgressBar/FunHorizontalStepper.tsx
|
|
@@ -4658,6 +4705,7 @@ function CopyAddress({
|
|
|
4658
4705
|
// src/components/FunButton/FunButton.tsx
|
|
4659
4706
|
import React48 from "react";
|
|
4660
4707
|
function FunButton({
|
|
4708
|
+
id,
|
|
4661
4709
|
title,
|
|
4662
4710
|
onClick,
|
|
4663
4711
|
titlePrefix,
|
|
@@ -4677,6 +4725,7 @@ function FunButton({
|
|
|
4677
4725
|
};
|
|
4678
4726
|
const hasBorder = !mobile && !isDisabled;
|
|
4679
4727
|
return /* @__PURE__ */ React48.createElement(Box, {
|
|
4728
|
+
id,
|
|
4680
4729
|
as: "button",
|
|
4681
4730
|
onClick: !isDisabled ? onClick : void 0,
|
|
4682
4731
|
...hasBorder ? {
|
|
@@ -4789,7 +4838,8 @@ function FunInputDefault({
|
|
|
4789
4838
|
color: "modalText",
|
|
4790
4839
|
display: "flex",
|
|
4791
4840
|
flexDirection: "column",
|
|
4792
|
-
gap: "8"
|
|
4841
|
+
gap: "8",
|
|
4842
|
+
width: "full"
|
|
4793
4843
|
}, label && /* @__PURE__ */ React50.createElement(Text, {
|
|
4794
4844
|
color: textColor,
|
|
4795
4845
|
size: "14",
|
|
@@ -5329,7 +5379,7 @@ function FunTermsAndConditionsTextButton() {
|
|
|
5329
5379
|
}, "By clicking Confirm Order you agree to our", /* @__PURE__ */ React54.createElement(FunLinkButton, {
|
|
5330
5380
|
onClick: () => {
|
|
5331
5381
|
window.open(
|
|
5332
|
-
"https://the-fun-group.notion.site/
|
|
5382
|
+
"https://the-fun-group.notion.site/Funkit-Terms-Conditions-8340448037474928b2d01b41ede947b2",
|
|
5333
5383
|
"_blank"
|
|
5334
5384
|
);
|
|
5335
5385
|
},
|
|
@@ -5833,7 +5883,7 @@ function FunPaymentMethods({
|
|
|
5833
5883
|
setSelectedOption(paymentsConfig.defaultPaymentMethod || null);
|
|
5834
5884
|
}
|
|
5835
5885
|
}, [reDraftSymbol]);
|
|
5836
|
-
const
|
|
5886
|
+
const hasSufficientBalance2 = useMemo14(() => {
|
|
5837
5887
|
if (!checkoutItem)
|
|
5838
5888
|
return false;
|
|
5839
5889
|
if (!(depositInfo == null ? void 0 : depositInfo.amount))
|
|
@@ -5866,7 +5916,7 @@ function FunPaymentMethods({
|
|
|
5866
5916
|
};
|
|
5867
5917
|
}
|
|
5868
5918
|
const shouldDisableMoonpay = "card" /* CARD */ === paymentMethod && isAmountValidForMoonpay({ amountUsd: depositInfo == null ? void 0 : depositInfo.amount });
|
|
5869
|
-
const shouldDisableAccBalance = "balance" /* ACCOUNT_BALANCE */ === paymentMethod && !
|
|
5919
|
+
const shouldDisableAccBalance = "balance" /* ACCOUNT_BALANCE */ === paymentMethod && !hasSufficientBalance2;
|
|
5870
5920
|
const isClickable = !isDisabled && !shouldDisableMoonpay && !shouldDisableAccBalance;
|
|
5871
5921
|
return {
|
|
5872
5922
|
paymentMethod,
|
|
@@ -5887,7 +5937,7 @@ function FunPaymentMethods({
|
|
|
5887
5937
|
}, [
|
|
5888
5938
|
(_b = (_a = checkoutItem == null ? void 0 : checkoutItem.initSettings) == null ? void 0 : _a.config) == null ? void 0 : _b.customRecipient,
|
|
5889
5939
|
depositInfo == null ? void 0 : depositInfo.amount,
|
|
5890
|
-
|
|
5940
|
+
hasSufficientBalance2,
|
|
5891
5941
|
isContinuing,
|
|
5892
5942
|
isDisabled,
|
|
5893
5943
|
paymentFlow,
|
|
@@ -7042,6 +7092,7 @@ function FunPaymentMoonpayType({
|
|
|
7042
7092
|
baseCurrencyCode: "usd",
|
|
7043
7093
|
baseCurrencyAmount: paymentFlow === 0 /* DEPOSIT */ ? depositTokenAmountStringFormatted : void 0,
|
|
7044
7094
|
quoteCurrencyAmount: paymentFlow === 0 /* DEPOSIT */ ? void 0 : depositTokenAmountStringFormatted,
|
|
7095
|
+
lockAmount: true,
|
|
7045
7096
|
currencyCode,
|
|
7046
7097
|
walletAddress: paymentAddress,
|
|
7047
7098
|
onUrlSignatureRequested: handleGetSignature,
|
|
@@ -8173,7 +8224,7 @@ var ProfileTitleSection = ({
|
|
|
8173
8224
|
icon: /* @__PURE__ */ React91.createElement(SettingsIcon, null),
|
|
8174
8225
|
onClick: () => {
|
|
8175
8226
|
setAnimateOut(true);
|
|
8176
|
-
setTimeout(() => onChangeView(1 /* SETTINGS */),
|
|
8227
|
+
setTimeout(() => onChangeView(1 /* SETTINGS */), 200);
|
|
8177
8228
|
},
|
|
8178
8229
|
size: "24"
|
|
8179
8230
|
}), /* @__PURE__ */ React91.createElement(FunIconButton, {
|
|
@@ -11838,7 +11889,7 @@ function ConnectModal({ onClose, open }) {
|
|
|
11838
11889
|
}
|
|
11839
11890
|
|
|
11840
11891
|
// src/components/FunCheckoutHistoryModal/FunCheckoutHistoryModal.tsx
|
|
11841
|
-
import
|
|
11892
|
+
import React140, { useMemo as useMemo32, useState as useState39 } from "react";
|
|
11842
11893
|
|
|
11843
11894
|
// src/components/FunCheckoutHistoryModal/FunCheckoutHistoryDetail.tsx
|
|
11844
11895
|
import {
|
|
@@ -11866,7 +11917,10 @@ var EditIcon = ({ size = "24" }) => /* @__PURE__ */ React129.createElement("svg"
|
|
|
11866
11917
|
})));
|
|
11867
11918
|
|
|
11868
11919
|
// src/components/FunCheckoutModal/FunCheckoutModal.tsx
|
|
11869
|
-
import {
|
|
11920
|
+
import {
|
|
11921
|
+
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO8,
|
|
11922
|
+
getTokenInfo as getTokenInfo2
|
|
11923
|
+
} from "@funkit/core";
|
|
11870
11924
|
import React135, { useCallback as useCallback24, useEffect as useEffect25, useMemo as useMemo29, useState as useState36 } from "react";
|
|
11871
11925
|
|
|
11872
11926
|
// src/hooks/useCheckoutAccountBalanceTransfer.ts
|
|
@@ -13049,7 +13103,10 @@ function FunCheckoutModal({
|
|
|
13049
13103
|
const targetChainId = checkoutItem == null ? void 0 : checkoutItem.initSettings.config.targetChain.toString();
|
|
13050
13104
|
let sourceTokenAddress;
|
|
13051
13105
|
let sourceTokenTicker;
|
|
13052
|
-
|
|
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 */) {
|
|
13053
13110
|
sourceTokenAddress = NATIVE_TOKEN;
|
|
13054
13111
|
sourceTokenTicker = "ETH" /* ETH */;
|
|
13055
13112
|
} else {
|
|
@@ -13340,10 +13397,11 @@ function CheckoutPrimaryInfo({
|
|
|
13340
13397
|
// src/components/FunCheckoutHistoryModal/FunCheckoutHistoryDetail.tsx
|
|
13341
13398
|
var FAKE_DELAY_MS = 4107;
|
|
13342
13399
|
function FunCheckoutHistoryDetail({
|
|
13343
|
-
checkoutHistoryInfo
|
|
13400
|
+
checkoutHistoryInfo,
|
|
13401
|
+
setCurrentPage,
|
|
13402
|
+
animateOut
|
|
13344
13403
|
}) {
|
|
13345
13404
|
const checkoutItem = checkoutHistoryInfo.clientMetadata;
|
|
13346
|
-
console.log("checkoutItem", checkoutItem);
|
|
13347
13405
|
const { isCheckoutDirectCrFlow } = useCheckoutType(checkoutItem);
|
|
13348
13406
|
const {
|
|
13349
13407
|
isProcessing,
|
|
@@ -13397,7 +13455,7 @@ function FunCheckoutHistoryDetail({
|
|
|
13397
13455
|
)
|
|
13398
13456
|
) : isTerminal ? formatTimestamp(
|
|
13399
13457
|
new Date(checkoutHistoryInfo.lastUpdatedTimeMs)
|
|
13400
|
-
) : estimatedEndTimeInfo.isExceededEstimation ? "" : `Estimated
|
|
13458
|
+
) : estimatedEndTimeInfo.isExceededEstimation ? "Order is experiencing delays. We appreciate your patience." : `Estimated completion in ${formatSecondsToReadableForm(
|
|
13401
13459
|
Math.floor(
|
|
13402
13460
|
estimatedEndTimeInfo.estimatedEndTimeFromNowMs / 1e3
|
|
13403
13461
|
),
|
|
@@ -13427,11 +13485,22 @@ function FunCheckoutHistoryDetail({
|
|
|
13427
13485
|
estimatedEndTimeInfo.estimatedEndTimeFromNowMs,
|
|
13428
13486
|
isCompleted
|
|
13429
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
|
+
});
|
|
13430
13498
|
return /* @__PURE__ */ React137.createElement(Box, {
|
|
13431
13499
|
display: "flex",
|
|
13432
13500
|
flexDirection: "column",
|
|
13433
13501
|
gap: "24",
|
|
13434
|
-
paddingY: "24"
|
|
13502
|
+
paddingY: "24",
|
|
13503
|
+
className: animateOut ? animateContentOutClass : animateContentInClass
|
|
13435
13504
|
}, /* @__PURE__ */ React137.createElement(Box, {
|
|
13436
13505
|
display: "flex",
|
|
13437
13506
|
flexDirection: "column",
|
|
@@ -13441,21 +13510,13 @@ function FunCheckoutHistoryDetail({
|
|
|
13441
13510
|
checkoutItem,
|
|
13442
13511
|
isLoading: false,
|
|
13443
13512
|
isEditable: false
|
|
13444
|
-
}),
|
|
13445
|
-
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."
|
|
13446
13515
|
}), /* @__PURE__ */ React137.createElement(FunVerticalProgressBar, {
|
|
13447
13516
|
step: isCheckoutDirectCrFlow ? 2 : isTerminal ? 3 : 2,
|
|
13448
13517
|
totalSteps: timelineLabels.length,
|
|
13449
13518
|
labels: timelineLabels
|
|
13450
|
-
}),
|
|
13451
|
-
display: "flex",
|
|
13452
|
-
flexDirection: "column",
|
|
13453
|
-
alignItems: "center",
|
|
13454
|
-
justifyContent: "center"
|
|
13455
|
-
}, /* @__PURE__ */ React137.createElement(Text, {
|
|
13456
|
-
size: "12",
|
|
13457
|
-
color: "modalTextDim"
|
|
13458
|
-
}, "Funds may take up to 10 minutes to arrive."))), isFailedFinal ? /* @__PURE__ */ React137.createElement(FunToast, {
|
|
13519
|
+
})), isFailedFinal ? /* @__PURE__ */ React137.createElement(FunToast, {
|
|
13459
13520
|
type: 1 /* ERROR */,
|
|
13460
13521
|
title: "Order Failed",
|
|
13461
13522
|
isDescriptionText: false,
|
|
@@ -13463,20 +13524,243 @@ function FunCheckoutHistoryDetail({
|
|
|
13463
13524
|
size: "12",
|
|
13464
13525
|
weight: "medium",
|
|
13465
13526
|
color: "modalTextDim"
|
|
13466
|
-
}, "A problem occurred processing your order.
|
|
13467
|
-
hasPadding: false,
|
|
13468
|
-
text: "contact support",
|
|
13469
|
-
textProps: {
|
|
13470
|
-
size: "12",
|
|
13471
|
-
weight: "medium",
|
|
13472
|
-
color: "modalTextSecondary"
|
|
13473
|
-
},
|
|
13474
|
-
onClick: () => {
|
|
13475
|
-
window.location = "mailto:support@fun.xyz";
|
|
13476
|
-
}
|
|
13477
|
-
}), " ", "for more information."),
|
|
13527
|
+
}, "A problem occurred processing your order. ", GetHelpButton),
|
|
13478
13528
|
hideTitleSuffix: true
|
|
13479
|
-
}) :
|
|
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
|
+
}));
|
|
13480
13764
|
}
|
|
13481
13765
|
|
|
13482
13766
|
// src/components/FunCheckoutHistoryModal/FunCheckoutHistoryModal.tsx
|
|
@@ -13491,22 +13775,49 @@ function FunCheckoutHistoryModal({
|
|
|
13491
13775
|
);
|
|
13492
13776
|
}
|
|
13493
13777
|
const { checkoutHistoryInfo, isLoading } = useFunkitPostCheckoutInternal(depositAddress);
|
|
13494
|
-
|
|
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, {
|
|
13495
13805
|
open,
|
|
13496
13806
|
onClose,
|
|
13497
13807
|
titleId: "fun-checkout-history-modal"
|
|
13498
|
-
}, /* @__PURE__ */
|
|
13808
|
+
}, /* @__PURE__ */ React140.createElement(DialogContent, {
|
|
13499
13809
|
bottomSheetOnMobile: true,
|
|
13500
13810
|
padding: "0"
|
|
13501
|
-
}, /* @__PURE__ */
|
|
13811
|
+
}, /* @__PURE__ */ React140.createElement(Box, {
|
|
13502
13812
|
paddingTop: "20",
|
|
13503
13813
|
paddingX: "20"
|
|
13504
|
-
}, /* @__PURE__ */
|
|
13505
|
-
hasBackButton:
|
|
13506
|
-
|
|
13814
|
+
}, /* @__PURE__ */ React140.createElement(FunModalTitleSection, {
|
|
13815
|
+
hasBackButton: titleConfig.hasBackButton,
|
|
13816
|
+
onBack: titleConfig.onBack,
|
|
13817
|
+
title: titleConfig.title,
|
|
13507
13818
|
hasCloseButton: true,
|
|
13508
13819
|
onClose
|
|
13509
|
-
}), isLoading ? /* @__PURE__ */
|
|
13820
|
+
}), isLoading ? /* @__PURE__ */ React140.createElement(Box, {
|
|
13510
13821
|
width: "full",
|
|
13511
13822
|
height: "200",
|
|
13512
13823
|
display: "flex",
|
|
@@ -13514,26 +13825,31 @@ function FunCheckoutHistoryModal({
|
|
|
13514
13825
|
alignItems: "center",
|
|
13515
13826
|
justifyContent: "center",
|
|
13516
13827
|
color: "modalText"
|
|
13517
|
-
}, /* @__PURE__ */
|
|
13518
|
-
checkoutHistoryInfo
|
|
13519
|
-
|
|
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)));
|
|
13520
13836
|
}
|
|
13521
13837
|
|
|
13522
13838
|
// src/components/FunDevTestModal/FunDevTestModal.tsx
|
|
13523
|
-
import
|
|
13839
|
+
import React141 from "react";
|
|
13524
13840
|
function FunDevTestModal({ onClose, open }) {
|
|
13525
|
-
return /* @__PURE__ */
|
|
13841
|
+
return /* @__PURE__ */ React141.createElement(Dialog, {
|
|
13526
13842
|
onClose,
|
|
13527
13843
|
open,
|
|
13528
13844
|
titleId: "dev/test modal"
|
|
13529
|
-
}, /* @__PURE__ */
|
|
13845
|
+
}, /* @__PURE__ */ React141.createElement(DialogContent, {
|
|
13530
13846
|
bottomSheetOnMobile: true
|
|
13531
|
-
}, /* @__PURE__ */
|
|
13847
|
+
}, /* @__PURE__ */ React141.createElement(Box, null)));
|
|
13532
13848
|
}
|
|
13533
13849
|
|
|
13534
13850
|
// src/components/FunkitProvider/ModalContext.tsx
|
|
13535
13851
|
function useModalStateValue() {
|
|
13536
|
-
const [isModalOpen, setModalOpen] =
|
|
13852
|
+
const [isModalOpen, setModalOpen] = useState40(false);
|
|
13537
13853
|
return {
|
|
13538
13854
|
closeModal: useCallback26(() => setModalOpen(false), []),
|
|
13539
13855
|
isModalOpen,
|
|
@@ -13541,8 +13857,8 @@ function useModalStateValue() {
|
|
|
13541
13857
|
};
|
|
13542
13858
|
}
|
|
13543
13859
|
function useModalStateValueWithId() {
|
|
13544
|
-
const [isModalOpen, setModalOpen] =
|
|
13545
|
-
const [modalId, setModalId] =
|
|
13860
|
+
const [isModalOpen, setModalOpen] = useState40(false);
|
|
13861
|
+
const [modalId, setModalId] = useState40(null);
|
|
13546
13862
|
return {
|
|
13547
13863
|
closeModal: useCallback26(() => {
|
|
13548
13864
|
setModalId(null);
|
|
@@ -13583,7 +13899,7 @@ function ModalProvider({ children }) {
|
|
|
13583
13899
|
isModalOpen: chainModalOpen,
|
|
13584
13900
|
openModal: openChainModal
|
|
13585
13901
|
} = useModalStateValue();
|
|
13586
|
-
const [isWalletConnectModalOpen, setIsWalletConnectModalOpen] =
|
|
13902
|
+
const [isWalletConnectModalOpen, setIsWalletConnectModalOpen] = useState40(false);
|
|
13587
13903
|
const {
|
|
13588
13904
|
closeModal: closeFunCheckoutModal,
|
|
13589
13905
|
isModalOpen: funCheckoutModalOpen,
|
|
@@ -13625,8 +13941,8 @@ function ModalProvider({ children }) {
|
|
|
13625
13941
|
if (isUnauthenticated)
|
|
13626
13942
|
closeModals();
|
|
13627
13943
|
}, [isUnauthenticated]);
|
|
13628
|
-
return /* @__PURE__ */
|
|
13629
|
-
value:
|
|
13944
|
+
return /* @__PURE__ */ React142.createElement(ModalContext.Provider, {
|
|
13945
|
+
value: useMemo33(
|
|
13630
13946
|
() => ({
|
|
13631
13947
|
accountModalOpen,
|
|
13632
13948
|
chainModalOpen,
|
|
@@ -13665,25 +13981,25 @@ function ModalProvider({ children }) {
|
|
|
13665
13981
|
openFunDevTestModal
|
|
13666
13982
|
]
|
|
13667
13983
|
)
|
|
13668
|
-
}, children, /* @__PURE__ */
|
|
13984
|
+
}, children, /* @__PURE__ */ React142.createElement(ConnectModal, {
|
|
13669
13985
|
onClose: closeConnectModal,
|
|
13670
13986
|
open: connectModalOpen
|
|
13671
|
-
}), /* @__PURE__ */
|
|
13987
|
+
}), /* @__PURE__ */ React142.createElement(AccountModal, {
|
|
13672
13988
|
onClose: closeAccountModal,
|
|
13673
13989
|
open: accountModalOpen
|
|
13674
|
-
}), /* @__PURE__ */
|
|
13990
|
+
}), /* @__PURE__ */ React142.createElement(ChainModal, {
|
|
13675
13991
|
onClose: closeChainModal,
|
|
13676
13992
|
open: chainModalOpen
|
|
13677
|
-
}), /* @__PURE__ */
|
|
13993
|
+
}), /* @__PURE__ */ React142.createElement(FunCheckoutModal, {
|
|
13678
13994
|
onClose: closeFunCheckoutModal,
|
|
13679
13995
|
open: funCheckoutModalOpen,
|
|
13680
13996
|
checkoutId: funCheckoutModalId,
|
|
13681
13997
|
key: funCheckoutModalId
|
|
13682
|
-
}), depositAddress ? /* @__PURE__ */
|
|
13998
|
+
}), depositAddress ? /* @__PURE__ */ React142.createElement(FunCheckoutHistoryModal, {
|
|
13683
13999
|
onClose: closeFunCheckoutHistoryModal,
|
|
13684
14000
|
open: funCheckoutHistoryModalOpen,
|
|
13685
14001
|
depositAddress
|
|
13686
|
-
}) : null, /* @__PURE__ */
|
|
14002
|
+
}) : null, /* @__PURE__ */ React142.createElement(FunDevTestModal, {
|
|
13687
14003
|
onClose: closeFunDevTestModal,
|
|
13688
14004
|
open: funDevTestModalOpen
|
|
13689
14005
|
}));
|
|
@@ -13967,15 +14283,15 @@ var FunkitWeb2Provider = ({
|
|
|
13967
14283
|
const funkitConfig = useFunkitConfig();
|
|
13968
14284
|
const { connectAsync } = useConnect2();
|
|
13969
14285
|
const { connectors, disconnectAsync } = useDisconnect3();
|
|
13970
|
-
const [privy, setPrivy] =
|
|
13971
|
-
const [privyIframeUrl, setPrivyIframeUrl] =
|
|
13972
|
-
const [loginMethod, setLoginMethod] =
|
|
14286
|
+
const [privy, setPrivy] = useState41(null);
|
|
14287
|
+
const [privyIframeUrl, setPrivyIframeUrl] = useState41();
|
|
14288
|
+
const [loginMethod, setLoginMethod] = useState41(
|
|
13973
14289
|
getLoginMethodFromCache() || null
|
|
13974
14290
|
);
|
|
13975
14291
|
const wallets = useWalletConnectors();
|
|
13976
|
-
const [isLoggingIn, setIsLoggingIn] =
|
|
13977
|
-
const [loginErrorMessage, setLoginErrorMessage] =
|
|
13978
|
-
const [loggedInUser, setLoggedInUser] =
|
|
14292
|
+
const [isLoggingIn, setIsLoggingIn] = useState41(false);
|
|
14293
|
+
const [loginErrorMessage, setLoginErrorMessage] = useState41("");
|
|
14294
|
+
const [loggedInUser, setLoggedInUser] = useState41(null);
|
|
13979
14295
|
const setLoginMethodAndCache = useCallback27(
|
|
13980
14296
|
(method) => {
|
|
13981
14297
|
try {
|
|
@@ -14212,7 +14528,7 @@ var FunkitWeb2Provider = ({
|
|
|
14212
14528
|
},
|
|
14213
14529
|
[privy, setLoginMethodAndCache]
|
|
14214
14530
|
);
|
|
14215
|
-
const [isSendingOtpEmail, setIsSendingOtpEmail] =
|
|
14531
|
+
const [isSendingOtpEmail, setIsSendingOtpEmail] = useState41(false);
|
|
14216
14532
|
const handleSendOtpEmail = useCallback27(
|
|
14217
14533
|
async (emailAddress) => {
|
|
14218
14534
|
try {
|
|
@@ -14240,7 +14556,7 @@ var FunkitWeb2Provider = ({
|
|
|
14240
14556
|
},
|
|
14241
14557
|
[privy, setLoginMethodAndCache]
|
|
14242
14558
|
);
|
|
14243
|
-
const userAccountInfo =
|
|
14559
|
+
const userAccountInfo = useMemo34(() => {
|
|
14244
14560
|
if (loggedInUser && loggedInUser.linked_accounts && loggedInUser.linked_accounts.length > 0) {
|
|
14245
14561
|
const loggedInAccount = loggedInUser.linked_accounts.find(
|
|
14246
14562
|
(account) => (account == null ? void 0 : account.type) === loginMethod
|
|
@@ -14290,9 +14606,9 @@ var FunkitWeb2Provider = ({
|
|
|
14290
14606
|
handleFunkitWeb2Logout,
|
|
14291
14607
|
web2AccountInfo: userAccountInfo
|
|
14292
14608
|
};
|
|
14293
|
-
return /* @__PURE__ */
|
|
14609
|
+
return /* @__PURE__ */ React143.createElement(FunkitWeb2Context.Provider, {
|
|
14294
14610
|
value: contextValue
|
|
14295
|
-
}, privyIframeUrl ? /* @__PURE__ */
|
|
14611
|
+
}, privyIframeUrl ? /* @__PURE__ */ React143.createElement("iframe", {
|
|
14296
14612
|
id: PRIVY_IFRAME_ID,
|
|
14297
14613
|
src: privyIframeUrl,
|
|
14298
14614
|
style: { display: "none" }
|
|
@@ -14321,27 +14637,27 @@ function useConnectionStatus() {
|
|
|
14321
14637
|
}
|
|
14322
14638
|
|
|
14323
14639
|
// src/components/FunkitProvider/ShowBalanceContext.tsx
|
|
14324
|
-
import
|
|
14640
|
+
import React144, { createContext as createContext18, useContext as useContext24, useState as useState42 } from "react";
|
|
14325
14641
|
var ShowBalanceContext = createContext18({
|
|
14326
14642
|
showBalance: void 0,
|
|
14327
14643
|
setShowBalance: () => void 0
|
|
14328
14644
|
});
|
|
14329
14645
|
function ShowBalanceProvider({ children }) {
|
|
14330
|
-
const [showBalance, setShowBalance] =
|
|
14331
|
-
return /* @__PURE__ */
|
|
14646
|
+
const [showBalance, setShowBalance] = useState42();
|
|
14647
|
+
return /* @__PURE__ */ React144.createElement(ShowBalanceContext.Provider, {
|
|
14332
14648
|
value: { showBalance, setShowBalance }
|
|
14333
14649
|
}, children);
|
|
14334
14650
|
}
|
|
14335
14651
|
var useShowBalance = () => useContext24(ShowBalanceContext);
|
|
14336
14652
|
|
|
14337
14653
|
// src/components/Icons/Dropdown.tsx
|
|
14338
|
-
import
|
|
14339
|
-
var DropdownIcon = () => /* @__PURE__ */
|
|
14654
|
+
import React145 from "react";
|
|
14655
|
+
var DropdownIcon = () => /* @__PURE__ */ React145.createElement("svg", {
|
|
14340
14656
|
fill: "none",
|
|
14341
14657
|
height: "7",
|
|
14342
14658
|
width: "14",
|
|
14343
14659
|
xmlns: "http://www.w3.org/2000/svg"
|
|
14344
|
-
}, /* @__PURE__ */
|
|
14660
|
+
}, /* @__PURE__ */ React145.createElement("path", {
|
|
14345
14661
|
d: "M12.75 1.54001L8.51647 5.0038C7.77974 5.60658 6.72026 5.60658 5.98352 5.0038L1.75 1.54001",
|
|
14346
14662
|
stroke: "currentColor",
|
|
14347
14663
|
strokeLinecap: "round",
|
|
@@ -14351,13 +14667,13 @@ var DropdownIcon = () => /* @__PURE__ */ React143.createElement("svg", {
|
|
|
14351
14667
|
}));
|
|
14352
14668
|
|
|
14353
14669
|
// src/components/ConnectButton/ConnectButtonRenderer.tsx
|
|
14354
|
-
import
|
|
14670
|
+
import React147, { useContext as useContext26 } from "react";
|
|
14355
14671
|
import { useAccount as useAccount16, useBalance, useConfig as useConfig5 } from "wagmi";
|
|
14356
14672
|
|
|
14357
14673
|
// src/hooks/useIsMounted.ts
|
|
14358
|
-
import { useCallback as useCallback28, useEffect as useEffect29, useState as
|
|
14674
|
+
import { useCallback as useCallback28, useEffect as useEffect29, useState as useState43 } from "react";
|
|
14359
14675
|
function useIsMounted() {
|
|
14360
|
-
const [isMounted, setIsMounted] =
|
|
14676
|
+
const [isMounted, setIsMounted] = useState43(false);
|
|
14361
14677
|
useEffect29(() => {
|
|
14362
14678
|
setIsMounted(true);
|
|
14363
14679
|
return () => {
|
|
@@ -14384,7 +14700,7 @@ function useMainnetEnsAvatar(name) {
|
|
|
14384
14700
|
}
|
|
14385
14701
|
|
|
14386
14702
|
// src/transactions/useRecentTransactions.ts
|
|
14387
|
-
import { useEffect as useEffect31, useState as
|
|
14703
|
+
import { useEffect as useEffect31, useState as useState45 } from "react";
|
|
14388
14704
|
import { useAccount as useAccount15 } from "wagmi";
|
|
14389
14705
|
|
|
14390
14706
|
// src/hooks/useChainId.ts
|
|
@@ -14396,7 +14712,7 @@ function useChainId() {
|
|
|
14396
14712
|
}
|
|
14397
14713
|
|
|
14398
14714
|
// src/transactions/TransactionStoreContext.tsx
|
|
14399
|
-
import
|
|
14715
|
+
import React146, { createContext as createContext19, useContext as useContext25, useEffect as useEffect30, useState as useState44 } from "react";
|
|
14400
14716
|
import { useAccount as useAccount14, usePublicClient } from "wagmi";
|
|
14401
14717
|
|
|
14402
14718
|
// src/transactions/transactionStore.ts
|
|
@@ -14546,7 +14862,7 @@ function TransactionStoreProvider({
|
|
|
14546
14862
|
const provider = usePublicClient();
|
|
14547
14863
|
const { address } = useAccount14();
|
|
14548
14864
|
const chainId = useChainId();
|
|
14549
|
-
const [store] =
|
|
14865
|
+
const [store] = useState44(
|
|
14550
14866
|
() => storeSingleton != null ? storeSingleton : storeSingleton = createTransactionStore({ provider })
|
|
14551
14867
|
);
|
|
14552
14868
|
useEffect30(() => {
|
|
@@ -14557,7 +14873,7 @@ function TransactionStoreProvider({
|
|
|
14557
14873
|
store.waitForPendingTransactions(address, chainId);
|
|
14558
14874
|
}
|
|
14559
14875
|
}, [store, address, chainId]);
|
|
14560
|
-
return /* @__PURE__ */
|
|
14876
|
+
return /* @__PURE__ */ React146.createElement(TransactionStoreContext.Provider, {
|
|
14561
14877
|
value: store
|
|
14562
14878
|
}, children);
|
|
14563
14879
|
}
|
|
@@ -14574,7 +14890,7 @@ function useRecentTransactions() {
|
|
|
14574
14890
|
const store = useTransactionStore();
|
|
14575
14891
|
const { address } = useAccount15();
|
|
14576
14892
|
const chainId = useChainId();
|
|
14577
|
-
const [transactions, setTransactions] =
|
|
14893
|
+
const [transactions, setTransactions] = useState45(
|
|
14578
14894
|
() => store && address && chainId ? store.getTransactions(address, chainId) : []
|
|
14579
14895
|
);
|
|
14580
14896
|
useEffect31(() => {
|
|
@@ -14661,7 +14977,7 @@ function ConnectButtonRenderer({
|
|
|
14661
14977
|
const { openChainModal } = useChainModal();
|
|
14662
14978
|
const { openAccountModal } = useAccountModal();
|
|
14663
14979
|
const { accountModalOpen, chainModalOpen, connectModalOpen } = useModalState();
|
|
14664
|
-
return /* @__PURE__ */
|
|
14980
|
+
return /* @__PURE__ */ React147.createElement(React147.Fragment, null, children({
|
|
14665
14981
|
account: address ? {
|
|
14666
14982
|
address,
|
|
14667
14983
|
balanceDecimals: balanceData == null ? void 0 : balanceData.decimals,
|
|
@@ -14709,7 +15025,7 @@ function ChainSelectorButton({
|
|
|
14709
15025
|
}) {
|
|
14710
15026
|
var _a, _b;
|
|
14711
15027
|
const { i18n: i18n2 } = useContext27(I18nContext);
|
|
14712
|
-
return /* @__PURE__ */
|
|
15028
|
+
return /* @__PURE__ */ React148.createElement(Box, {
|
|
14713
15029
|
alignItems: "center",
|
|
14714
15030
|
"aria-label": "Chain Selector",
|
|
14715
15031
|
as: "button",
|
|
@@ -14735,37 +15051,37 @@ function ChainSelectorButton({
|
|
|
14735
15051
|
testId: unsupportedChain ? "wrong-network-button" : "chain-button",
|
|
14736
15052
|
transition: "default",
|
|
14737
15053
|
type: "button"
|
|
14738
|
-
}, unsupportedChain ? /* @__PURE__ */
|
|
15054
|
+
}, unsupportedChain ? /* @__PURE__ */ React148.createElement(Box, {
|
|
14739
15055
|
alignItems: "center",
|
|
14740
15056
|
display: "flex",
|
|
14741
15057
|
height: "24",
|
|
14742
15058
|
paddingX: "4"
|
|
14743
|
-
}, i18n2.t("connect_wallet.wrong_network.label")) : /* @__PURE__ */
|
|
15059
|
+
}, i18n2.t("connect_wallet.wrong_network.label")) : /* @__PURE__ */ React148.createElement(Box, {
|
|
14744
15060
|
alignItems: "center",
|
|
14745
15061
|
display: "flex",
|
|
14746
15062
|
gap: "6"
|
|
14747
|
-
}, chain.hasIcon ? /* @__PURE__ */
|
|
15063
|
+
}, chain.hasIcon ? /* @__PURE__ */ React148.createElement(Box, {
|
|
14748
15064
|
display: mapResponsiveValue(
|
|
14749
15065
|
chainStatus,
|
|
14750
15066
|
(value) => value === "full" || value === "icon" ? "block" : "none"
|
|
14751
15067
|
),
|
|
14752
15068
|
height: "24",
|
|
14753
15069
|
width: "24"
|
|
14754
|
-
}, /* @__PURE__ */
|
|
15070
|
+
}, /* @__PURE__ */ React148.createElement(AsyncImage, {
|
|
14755
15071
|
alt: (_a = chain.name) != null ? _a : "Chain icon",
|
|
14756
15072
|
background: chain.iconBackground,
|
|
14757
15073
|
borderRadius: "full",
|
|
14758
15074
|
height: "24",
|
|
14759
15075
|
src: chain.iconUrl,
|
|
14760
15076
|
width: "24"
|
|
14761
|
-
})) : null, /* @__PURE__ */
|
|
15077
|
+
})) : null, /* @__PURE__ */ React148.createElement(Box, {
|
|
14762
15078
|
display: mapResponsiveValue(chainStatus, (value) => {
|
|
14763
15079
|
if (value === "icon" && !chain.iconUrl) {
|
|
14764
15080
|
return "block";
|
|
14765
15081
|
}
|
|
14766
15082
|
return value === "full" || value === "name" ? "block" : "none";
|
|
14767
15083
|
})
|
|
14768
|
-
}, (_b = chain.name) != null ? _b : chain.id)), /* @__PURE__ */
|
|
15084
|
+
}, (_b = chain.name) != null ? _b : chain.id)), /* @__PURE__ */ React148.createElement(DropdownIcon, null));
|
|
14769
15085
|
}
|
|
14770
15086
|
function AccountButton({
|
|
14771
15087
|
openAccountModal,
|
|
@@ -14774,7 +15090,7 @@ function AccountButton({
|
|
|
14774
15090
|
accountStatus
|
|
14775
15091
|
}) {
|
|
14776
15092
|
const { userInfo } = useGeneralWallet();
|
|
14777
|
-
return /* @__PURE__ */
|
|
15093
|
+
return /* @__PURE__ */ React148.createElement(Box, {
|
|
14778
15094
|
alignItems: "center",
|
|
14779
15095
|
as: "button",
|
|
14780
15096
|
background: "accentColor",
|
|
@@ -14792,14 +15108,14 @@ function AccountButton({
|
|
|
14792
15108
|
testId: "account-button",
|
|
14793
15109
|
transition: "default",
|
|
14794
15110
|
type: "button"
|
|
14795
|
-
}, account.displayBalance && /* @__PURE__ */
|
|
15111
|
+
}, account.displayBalance && /* @__PURE__ */ React148.createElement(Box, {
|
|
14796
15112
|
display: mapResponsiveValue(
|
|
14797
15113
|
showBalance,
|
|
14798
15114
|
(value) => value ? "block" : "none"
|
|
14799
15115
|
),
|
|
14800
15116
|
padding: "8",
|
|
14801
15117
|
paddingLeft: "12"
|
|
14802
|
-
}, account.displayBalance), /* @__PURE__ */
|
|
15118
|
+
}, account.displayBalance), /* @__PURE__ */ React148.createElement(Box, {
|
|
14803
15119
|
background: "connectButtonInnerBackground",
|
|
14804
15120
|
borderColor: "accentColor",
|
|
14805
15121
|
borderRadius: "connectButton",
|
|
@@ -14811,32 +15127,32 @@ function AccountButton({
|
|
|
14811
15127
|
paddingX: "8",
|
|
14812
15128
|
paddingY: "6",
|
|
14813
15129
|
transition: "default"
|
|
14814
|
-
}, /* @__PURE__ */
|
|
15130
|
+
}, /* @__PURE__ */ React148.createElement(Box, {
|
|
14815
15131
|
alignItems: "center",
|
|
14816
15132
|
display: "flex",
|
|
14817
15133
|
gap: "6",
|
|
14818
15134
|
height: "24"
|
|
14819
|
-
}, /* @__PURE__ */
|
|
15135
|
+
}, /* @__PURE__ */ React148.createElement(Box, {
|
|
14820
15136
|
display: mapResponsiveValue(
|
|
14821
15137
|
accountStatus,
|
|
14822
15138
|
(value) => value === "full" || value === "avatar" ? "block" : "none"
|
|
14823
15139
|
)
|
|
14824
|
-
}, /* @__PURE__ */
|
|
15140
|
+
}, /* @__PURE__ */ React148.createElement(Avatar, {
|
|
14825
15141
|
address: account.address,
|
|
14826
15142
|
imageUrl: account.ensAvatar,
|
|
14827
15143
|
loading: account.hasPendingTransactions,
|
|
14828
15144
|
size: 24
|
|
14829
|
-
})), /* @__PURE__ */
|
|
15145
|
+
})), /* @__PURE__ */ React148.createElement(Box, {
|
|
14830
15146
|
alignItems: "center",
|
|
14831
15147
|
display: "flex",
|
|
14832
15148
|
gap: "6"
|
|
14833
|
-
}, /* @__PURE__ */
|
|
15149
|
+
}, /* @__PURE__ */ React148.createElement(Box, {
|
|
14834
15150
|
display: mapResponsiveValue(
|
|
14835
15151
|
accountStatus,
|
|
14836
15152
|
(value) => value === "full" || value === "address" ? "block" : "none"
|
|
14837
15153
|
),
|
|
14838
15154
|
style: { textWrap: "nowrap" }
|
|
14839
|
-
}, userInfo.accountName), /* @__PURE__ */
|
|
15155
|
+
}, userInfo.accountName), /* @__PURE__ */ React148.createElement(DropdownIcon, null)))));
|
|
14840
15156
|
}
|
|
14841
15157
|
function ConnectButton({
|
|
14842
15158
|
accountStatus = defaultProps.accountStatus,
|
|
@@ -14848,14 +15164,14 @@ function ConnectButton({
|
|
|
14848
15164
|
const chains = useFunkitConnectChains();
|
|
14849
15165
|
const connectionStatus = useConnectionStatus();
|
|
14850
15166
|
const { setShowBalance } = useShowBalance();
|
|
14851
|
-
const [ready, setReady] =
|
|
15167
|
+
const [ready, setReady] = useState46(false);
|
|
14852
15168
|
const { i18n: i18n2 } = useContext27(I18nContext);
|
|
14853
15169
|
useEffect32(() => {
|
|
14854
15170
|
setShowBalance(showBalance);
|
|
14855
15171
|
if (!ready)
|
|
14856
15172
|
setReady(true);
|
|
14857
15173
|
}, [showBalance, setShowBalance, ready]);
|
|
14858
|
-
return ready ? /* @__PURE__ */
|
|
15174
|
+
return ready ? /* @__PURE__ */ React148.createElement(ConnectButtonRenderer, null, ({
|
|
14859
15175
|
account,
|
|
14860
15176
|
chain,
|
|
14861
15177
|
mounted,
|
|
@@ -14866,7 +15182,7 @@ function ConnectButton({
|
|
|
14866
15182
|
var _a;
|
|
14867
15183
|
const ready2 = mounted && connectionStatus !== "loading";
|
|
14868
15184
|
const unsupportedChain = (_a = chain == null ? void 0 : chain.unsupported) != null ? _a : false;
|
|
14869
|
-
return /* @__PURE__ */
|
|
15185
|
+
return /* @__PURE__ */ React148.createElement(Box, {
|
|
14870
15186
|
display: "flex",
|
|
14871
15187
|
gap: "12",
|
|
14872
15188
|
...!ready2 && {
|
|
@@ -14877,17 +15193,17 @@ function ConnectButton({
|
|
|
14877
15193
|
userSelect: "none"
|
|
14878
15194
|
}
|
|
14879
15195
|
}
|
|
14880
|
-
}, 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, {
|
|
14881
15197
|
unsupportedChain,
|
|
14882
15198
|
chainStatus,
|
|
14883
15199
|
openChainModal,
|
|
14884
15200
|
chain
|
|
14885
|
-
}), !unsupportedChain && /* @__PURE__ */
|
|
15201
|
+
}), !unsupportedChain && /* @__PURE__ */ React148.createElement(AccountButton, {
|
|
14886
15202
|
openAccountModal,
|
|
14887
15203
|
account,
|
|
14888
15204
|
showBalance,
|
|
14889
15205
|
accountStatus
|
|
14890
|
-
})) : /* @__PURE__ */
|
|
15206
|
+
})) : /* @__PURE__ */ React148.createElement(Box, {
|
|
14891
15207
|
as: "button",
|
|
14892
15208
|
background: "accentColor",
|
|
14893
15209
|
borderRadius: "connectButton",
|
|
@@ -14907,14 +15223,14 @@ function ConnectButton({
|
|
|
14907
15223
|
transition: "default",
|
|
14908
15224
|
type: "button"
|
|
14909
15225
|
}, mounted && label === "Connect Wallet" ? i18n2.t("connect_wallet.label") : label));
|
|
14910
|
-
}) : /* @__PURE__ */
|
|
15226
|
+
}) : /* @__PURE__ */ React148.createElement(React148.Fragment, null);
|
|
14911
15227
|
}
|
|
14912
15228
|
ConnectButton.__defaultProps = defaultProps;
|
|
14913
15229
|
ConnectButton.Custom = ConnectButtonRenderer;
|
|
14914
15230
|
|
|
14915
15231
|
// src/components/FunkitProvider/FunkitProvider.tsx
|
|
14916
15232
|
import { QueryClientProvider } from "@tanstack/react-query";
|
|
14917
|
-
import
|
|
15233
|
+
import React149, { createContext as createContext21, useContext as useContext28, useEffect as useEffect35 } from "react";
|
|
14918
15234
|
import { useAccountEffect as useAccountEffect3, WagmiProvider } from "wagmi";
|
|
14919
15235
|
|
|
14920
15236
|
// src/css/cssObjectFromTheme.ts
|
|
@@ -15726,7 +16042,7 @@ function setFunkitConnectVersion({ version }) {
|
|
|
15726
16042
|
localStorage.setItem(storageKey4, version);
|
|
15727
16043
|
}
|
|
15728
16044
|
function getCurrentSdkVersion() {
|
|
15729
|
-
return "1.0.
|
|
16045
|
+
return "1.0.16";
|
|
15730
16046
|
}
|
|
15731
16047
|
function useFingerprint() {
|
|
15732
16048
|
const fingerprint = useCallback29(() => {
|
|
@@ -15781,7 +16097,7 @@ function clearWalletConnectDeepLink() {
|
|
|
15781
16097
|
|
|
15782
16098
|
// src/components/FunkitProvider/FunkitProvider.tsx
|
|
15783
16099
|
var MoonPayProvider = (props) => {
|
|
15784
|
-
const [MoonPayProviderInner, setMoonPayProviderInner] =
|
|
16100
|
+
const [MoonPayProviderInner, setMoonPayProviderInner] = React149.useState(null);
|
|
15785
16101
|
useEffect35(() => {
|
|
15786
16102
|
const loadMoonPayProviderInner = async () => {
|
|
15787
16103
|
try {
|
|
@@ -15794,8 +16110,8 @@ var MoonPayProvider = (props) => {
|
|
|
15794
16110
|
loadMoonPayProviderInner();
|
|
15795
16111
|
}, []);
|
|
15796
16112
|
if (!MoonPayProviderInner)
|
|
15797
|
-
return /* @__PURE__ */
|
|
15798
|
-
return /* @__PURE__ */
|
|
16113
|
+
return /* @__PURE__ */ React149.createElement(React149.Fragment, null, props.children);
|
|
16114
|
+
return /* @__PURE__ */ React149.createElement(MoonPayProviderInner, {
|
|
15799
16115
|
...props
|
|
15800
16116
|
}, props.children);
|
|
15801
16117
|
};
|
|
@@ -15817,13 +16133,13 @@ function FunkitProvider(props) {
|
|
|
15817
16133
|
getCurrentSdkVersion()
|
|
15818
16134
|
);
|
|
15819
16135
|
const initialChainId = getInitialChainIdFromFunkitProviderProps(props);
|
|
15820
|
-
return /* @__PURE__ */
|
|
16136
|
+
return /* @__PURE__ */ React149.createElement(WagmiProvider, {
|
|
15821
16137
|
config: finalWagmiConfig
|
|
15822
|
-
}, /* @__PURE__ */
|
|
16138
|
+
}, /* @__PURE__ */ React149.createElement(QueryClientProvider, {
|
|
15823
16139
|
client: props.queryClient
|
|
15824
|
-
}, /* @__PURE__ */
|
|
16140
|
+
}, /* @__PURE__ */ React149.createElement(FunkitThemeProvider, {
|
|
15825
16141
|
theme: props.theme
|
|
15826
|
-
}, /* @__PURE__ */
|
|
16142
|
+
}, /* @__PURE__ */ React149.createElement(FunkitProviderInner, {
|
|
15827
16143
|
appInfo: props.appInfo,
|
|
15828
16144
|
avatar: props.avatar,
|
|
15829
16145
|
id: props.id,
|
|
@@ -15859,36 +16175,36 @@ function FunkitProviderInner({
|
|
|
15859
16175
|
const modalSize = ModalSizeOptions.WIDE;
|
|
15860
16176
|
const coolMode = false;
|
|
15861
16177
|
const showRecentTransactions = false;
|
|
15862
|
-
return /* @__PURE__ */
|
|
16178
|
+
return /* @__PURE__ */ React149.createElement(FunkitConnectChainProvider, {
|
|
15863
16179
|
initialChain
|
|
15864
|
-
}, /* @__PURE__ */
|
|
16180
|
+
}, /* @__PURE__ */ React149.createElement(FunkitConfigContext.Provider, {
|
|
15865
16181
|
value: funkitConfig
|
|
15866
|
-
}, /* @__PURE__ */
|
|
16182
|
+
}, /* @__PURE__ */ React149.createElement(WalletButtonProvider, null, /* @__PURE__ */ React149.createElement(I18nProvider, {
|
|
15867
16183
|
locale
|
|
15868
|
-
}, /* @__PURE__ */
|
|
16184
|
+
}, /* @__PURE__ */ React149.createElement(CoolModeContext.Provider, {
|
|
15869
16185
|
value: coolMode
|
|
15870
|
-
}, /* @__PURE__ */
|
|
16186
|
+
}, /* @__PURE__ */ React149.createElement(ModalSizeProvider, {
|
|
15871
16187
|
modalSize
|
|
15872
|
-
}, /* @__PURE__ */
|
|
16188
|
+
}, /* @__PURE__ */ React149.createElement(FunkitWeb2Provider, null, /* @__PURE__ */ React149.createElement(GeneralWalletProvider, null, /* @__PURE__ */ React149.createElement(FunkitCheckoutProvider, null, /* @__PURE__ */ React149.createElement(ShowRecentTransactionsContext.Provider, {
|
|
15873
16189
|
value: showRecentTransactions
|
|
15874
|
-
}, /* @__PURE__ */
|
|
16190
|
+
}, /* @__PURE__ */ React149.createElement(FunkitSandboxContext.Provider, {
|
|
15875
16191
|
value: isSandboxMode
|
|
15876
|
-
}, /* @__PURE__ */
|
|
16192
|
+
}, /* @__PURE__ */ React149.createElement(FunkitMeshProvider, null, /* @__PURE__ */ React149.createElement(TransactionStoreProvider, null, /* @__PURE__ */ React149.createElement(AvatarContext.Provider, {
|
|
15877
16193
|
value: avatarContext
|
|
15878
|
-
}, /* @__PURE__ */
|
|
16194
|
+
}, /* @__PURE__ */ React149.createElement(AppContext.Provider, {
|
|
15879
16195
|
value: appContext
|
|
15880
|
-
}, /* @__PURE__ */
|
|
16196
|
+
}, /* @__PURE__ */ React149.createElement(ThemeIdContext2.Provider, {
|
|
15881
16197
|
value: id
|
|
15882
|
-
}, /* @__PURE__ */
|
|
16198
|
+
}, /* @__PURE__ */ React149.createElement(ShowBalanceProvider, null, /* @__PURE__ */ React149.createElement(FunToastProvider, null, /* @__PURE__ */ React149.createElement(MoonPayProvider, {
|
|
15883
16199
|
apiKey: isSandboxMode ? "pk_test_dWfAhBbvVexIId9S5hPd78mKM7ivIsqu" : "pk_live_IxayBRQuBC3RzpPZkbGPrwUsRWAaeO",
|
|
15884
16200
|
debug: !!debug
|
|
15885
|
-
}, /* @__PURE__ */
|
|
16201
|
+
}, /* @__PURE__ */ React149.createElement(ModalProvider, null, activeTheme ? /* @__PURE__ */ React149.createElement("div", {
|
|
15886
16202
|
...createThemeRootProps2(id),
|
|
15887
16203
|
style: {
|
|
15888
16204
|
width: "100%",
|
|
15889
16205
|
height: "100%"
|
|
15890
16206
|
}
|
|
15891
|
-
}, /* @__PURE__ */
|
|
16207
|
+
}, /* @__PURE__ */ React149.createElement("style", {
|
|
15892
16208
|
dangerouslySetInnerHTML: {
|
|
15893
16209
|
__html: [
|
|
15894
16210
|
`${selector}{${cssStringFromTheme(
|
|
@@ -15900,18 +16216,18 @@ function FunkitProviderInner({
|
|
|
15900
16216
|
}
|
|
15901
16217
|
|
|
15902
16218
|
// src/components/WalletButton/WalletButton.tsx
|
|
15903
|
-
import
|
|
16219
|
+
import React151, { useContext as useContext30 } from "react";
|
|
15904
16220
|
|
|
15905
16221
|
// src/components/WalletButton/WalletButton.css.ts
|
|
15906
16222
|
var border = "_85s11r0";
|
|
15907
16223
|
var maxWidth = "_85s11r1";
|
|
15908
16224
|
|
|
15909
16225
|
// src/components/WalletButton/WalletButtonRenderer.tsx
|
|
15910
|
-
import
|
|
16226
|
+
import React150, {
|
|
15911
16227
|
useContext as useContext29,
|
|
15912
16228
|
useEffect as useEffect36,
|
|
15913
|
-
useMemo as
|
|
15914
|
-
useState as
|
|
16229
|
+
useMemo as useMemo35,
|
|
16230
|
+
useState as useState47
|
|
15915
16231
|
} from "react";
|
|
15916
16232
|
import { useAccount as useAccount17, useAccountEffect as useAccountEffect4 } from "wagmi";
|
|
15917
16233
|
function WalletButtonRenderer({
|
|
@@ -15927,8 +16243,8 @@ function WalletButtonRenderer({
|
|
|
15927
16243
|
throw new Error("Connector not found");
|
|
15928
16244
|
}
|
|
15929
16245
|
const connectionStatus = useConnectionStatus();
|
|
15930
|
-
const [loading, setLoading] =
|
|
15931
|
-
const [isError, setIsError] =
|
|
16246
|
+
const [loading, setLoading] = useState47(false);
|
|
16247
|
+
const [isError, setIsError] = useState47(false);
|
|
15932
16248
|
const mobile = isMobile();
|
|
15933
16249
|
useEffect36(() => {
|
|
15934
16250
|
if (!connectModalOpen && connector)
|
|
@@ -15942,7 +16258,7 @@ function WalletButtonRenderer({
|
|
|
15942
16258
|
},
|
|
15943
16259
|
onDisconnect: clearLatestWalletId
|
|
15944
16260
|
});
|
|
15945
|
-
const isLastWalletIdConnected =
|
|
16261
|
+
const isLastWalletIdConnected = useMemo35(() => {
|
|
15946
16262
|
const lastWalletId = getLatestWalletId();
|
|
15947
16263
|
if (!lastWalletId || !(firstConnector == null ? void 0 : firstConnector.id)) {
|
|
15948
16264
|
return false;
|
|
@@ -15967,7 +16283,7 @@ function WalletButtonRenderer({
|
|
|
15967
16283
|
const isStatusLoading = connectionStatus === "loading";
|
|
15968
16284
|
const ready = !isConnecting && !!openConnectModal && firstConnector && !isStatusLoading;
|
|
15969
16285
|
const isNotSupported = !(firstConnector == null ? void 0 : firstConnector.installed) || !(firstConnector == null ? void 0 : firstConnector.ready);
|
|
15970
|
-
return /* @__PURE__ */
|
|
16286
|
+
return /* @__PURE__ */ React150.createElement(React150.Fragment, null, children({
|
|
15971
16287
|
error: isError,
|
|
15972
16288
|
loading,
|
|
15973
16289
|
connected: isLastWalletIdConnected,
|
|
@@ -15989,14 +16305,14 @@ function WalletButtonRenderer({
|
|
|
15989
16305
|
// src/components/WalletButton/WalletButton.tsx
|
|
15990
16306
|
var WalletButton = ({ wallet }) => {
|
|
15991
16307
|
const { i18n: i18n2 } = useContext30(I18nContext);
|
|
15992
|
-
return /* @__PURE__ */
|
|
16308
|
+
return /* @__PURE__ */ React151.createElement(WalletButtonRenderer, {
|
|
15993
16309
|
wallet
|
|
15994
16310
|
}, ({ ready, connect, connected, mounted, connector, loading }) => {
|
|
15995
16311
|
const isDisabled = !ready || loading;
|
|
15996
16312
|
const connectorName = (connector == null ? void 0 : connector.name) || "";
|
|
15997
16313
|
if (!mounted)
|
|
15998
16314
|
return;
|
|
15999
|
-
return /* @__PURE__ */
|
|
16315
|
+
return /* @__PURE__ */ React151.createElement(Box, {
|
|
16000
16316
|
display: "flex",
|
|
16001
16317
|
flexDirection: "column",
|
|
16002
16318
|
alignItems: "center",
|
|
@@ -16004,7 +16320,7 @@ var WalletButton = ({ wallet }) => {
|
|
|
16004
16320
|
style: {
|
|
16005
16321
|
pointerEvents: isDisabled ? "none" : "all"
|
|
16006
16322
|
}
|
|
16007
|
-
}, /* @__PURE__ */
|
|
16323
|
+
}, /* @__PURE__ */ React151.createElement(Box, {
|
|
16008
16324
|
as: "button",
|
|
16009
16325
|
borderRadius: "menuButton",
|
|
16010
16326
|
borderStyle: "solid",
|
|
@@ -16026,7 +16342,7 @@ var WalletButton = ({ wallet }) => {
|
|
|
16026
16342
|
transition: "default",
|
|
16027
16343
|
width: "full",
|
|
16028
16344
|
background: "connectButtonBackground"
|
|
16029
|
-
}, /* @__PURE__ */
|
|
16345
|
+
}, /* @__PURE__ */ React151.createElement(Box, {
|
|
16030
16346
|
color: "modalText",
|
|
16031
16347
|
fontFamily: "body",
|
|
16032
16348
|
fontSize: "16",
|
|
@@ -16034,28 +16350,28 @@ var WalletButton = ({ wallet }) => {
|
|
|
16034
16350
|
transition: "default",
|
|
16035
16351
|
display: "flex",
|
|
16036
16352
|
alignItems: "center"
|
|
16037
|
-
}, /* @__PURE__ */
|
|
16353
|
+
}, /* @__PURE__ */ React151.createElement(Box, {
|
|
16038
16354
|
alignItems: "center",
|
|
16039
16355
|
display: "flex",
|
|
16040
16356
|
flexDirection: "row",
|
|
16041
16357
|
gap: "12",
|
|
16042
16358
|
paddingRight: "6"
|
|
16043
|
-
}, /* @__PURE__ */
|
|
16359
|
+
}, /* @__PURE__ */ React151.createElement(Box, null, loading ? /* @__PURE__ */ React151.createElement(SpinnerIcon, null) : /* @__PURE__ */ React151.createElement(AsyncImage, {
|
|
16044
16360
|
background: connector == null ? void 0 : connector.iconBackground,
|
|
16045
16361
|
borderRadius: "6",
|
|
16046
16362
|
height: "28",
|
|
16047
16363
|
src: connector == null ? void 0 : connector.iconUrl,
|
|
16048
16364
|
width: "28"
|
|
16049
|
-
})), /* @__PURE__ */
|
|
16365
|
+
})), /* @__PURE__ */ React151.createElement(Box, {
|
|
16050
16366
|
alignItems: "center",
|
|
16051
16367
|
display: "flex",
|
|
16052
16368
|
flexDirection: "column",
|
|
16053
16369
|
color: "modalText"
|
|
16054
|
-
}, /* @__PURE__ */
|
|
16370
|
+
}, /* @__PURE__ */ React151.createElement(Box, {
|
|
16055
16371
|
testId: `wallet-button-label-${(connector == null ? void 0 : connector.id) || ""}`
|
|
16056
16372
|
}, loading ? i18n2.t("connect.status.connecting", {
|
|
16057
16373
|
wallet: connectorName
|
|
16058
|
-
}) : connectorName)), connected ? /* @__PURE__ */
|
|
16374
|
+
}) : connectorName)), connected ? /* @__PURE__ */ React151.createElement(Box, {
|
|
16059
16375
|
background: "connectionIndicator",
|
|
16060
16376
|
borderColor: "selectedOptionBorder",
|
|
16061
16377
|
borderRadius: "full",
|
|
@@ -16093,12 +16409,12 @@ function getDefaultWallets(parameters) {
|
|
|
16093
16409
|
}
|
|
16094
16410
|
|
|
16095
16411
|
// src/components/ConnectOptions/MobileOptions.tsx
|
|
16096
|
-
import
|
|
16412
|
+
import React152, {
|
|
16097
16413
|
useCallback as useCallback31,
|
|
16098
16414
|
useContext as useContext31,
|
|
16099
16415
|
useEffect as useEffect37,
|
|
16100
16416
|
useRef as useRef11,
|
|
16101
|
-
useState as
|
|
16417
|
+
useState as useState48
|
|
16102
16418
|
} from "react";
|
|
16103
16419
|
|
|
16104
16420
|
// src/components/ConnectOptions/MobileOptions.css.ts
|
|
@@ -16112,12 +16428,12 @@ var LoadingSpinner = ({ wallet }) => {
|
|
|
16112
16428
|
const height = 80;
|
|
16113
16429
|
const radiusFactor = 20;
|
|
16114
16430
|
const perimeter = 2 * (width + height - 4 * radiusFactor);
|
|
16115
|
-
return /* @__PURE__ */
|
|
16431
|
+
return /* @__PURE__ */ React152.createElement("svg", {
|
|
16116
16432
|
className: spinner,
|
|
16117
16433
|
viewBox: "0 0 86 86",
|
|
16118
16434
|
width: "86",
|
|
16119
16435
|
height: "86"
|
|
16120
|
-
}, /* @__PURE__ */
|
|
16436
|
+
}, /* @__PURE__ */ React152.createElement("title", null, "Loading"), /* @__PURE__ */ React152.createElement("rect", {
|
|
16121
16437
|
x: "3",
|
|
16122
16438
|
y: "3",
|
|
16123
16439
|
width,
|
|
@@ -16184,7 +16500,7 @@ function WalletButton2({
|
|
|
16184
16500
|
initialized.current = true;
|
|
16185
16501
|
}
|
|
16186
16502
|
}, [connecting, onConnect]);
|
|
16187
|
-
return /* @__PURE__ */
|
|
16503
|
+
return /* @__PURE__ */ React152.createElement(Box, {
|
|
16188
16504
|
as: "button",
|
|
16189
16505
|
color: ready ? "modalText" : "modalTextSecondary",
|
|
16190
16506
|
disabled: !ready,
|
|
@@ -16196,40 +16512,40 @@ function WalletButton2({
|
|
|
16196
16512
|
testId: `wallet-option-${id}`,
|
|
16197
16513
|
type: "button",
|
|
16198
16514
|
width: "full"
|
|
16199
|
-
}, /* @__PURE__ */
|
|
16515
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16200
16516
|
alignItems: "center",
|
|
16201
16517
|
display: "flex",
|
|
16202
16518
|
flexDirection: "column",
|
|
16203
16519
|
justifyContent: "center"
|
|
16204
|
-
}, /* @__PURE__ */
|
|
16520
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16205
16521
|
display: "flex",
|
|
16206
16522
|
alignItems: "center",
|
|
16207
16523
|
justifyContent: "center",
|
|
16208
16524
|
paddingBottom: "8",
|
|
16209
16525
|
paddingTop: "10",
|
|
16210
16526
|
position: "relative"
|
|
16211
|
-
}, connecting ? /* @__PURE__ */
|
|
16527
|
+
}, connecting ? /* @__PURE__ */ React152.createElement(LoadingSpinner, {
|
|
16212
16528
|
wallet
|
|
16213
|
-
}) : null, /* @__PURE__ */
|
|
16529
|
+
}) : null, /* @__PURE__ */ React152.createElement(AsyncImage, {
|
|
16214
16530
|
background: iconBackground,
|
|
16215
16531
|
borderRadius: "13",
|
|
16216
16532
|
boxShadow: "walletLogo",
|
|
16217
16533
|
height: "60",
|
|
16218
16534
|
src: iconUrl,
|
|
16219
16535
|
width: "60"
|
|
16220
|
-
})), !connecting ? /* @__PURE__ */
|
|
16536
|
+
})), !connecting ? /* @__PURE__ */ React152.createElement(Box, {
|
|
16221
16537
|
display: "flex",
|
|
16222
16538
|
flexDirection: "column",
|
|
16223
16539
|
textAlign: "center"
|
|
16224
|
-
}, /* @__PURE__ */
|
|
16540
|
+
}, /* @__PURE__ */ React152.createElement(Text, {
|
|
16225
16541
|
as: "h2",
|
|
16226
16542
|
color: wallet.ready ? "modalText" : "modalTextSecondary",
|
|
16227
16543
|
size: "13",
|
|
16228
16544
|
weight: "medium"
|
|
16229
|
-
}, /* @__PURE__ */
|
|
16545
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16230
16546
|
as: "span",
|
|
16231
16547
|
position: "relative"
|
|
16232
|
-
}, shortName != null ? shortName : name, !wallet.ready && " (unsupported)")), wallet.recent && /* @__PURE__ */
|
|
16548
|
+
}, shortName != null ? shortName : name, !wallet.ready && " (unsupported)")), wallet.recent && /* @__PURE__ */ React152.createElement(Text, {
|
|
16233
16549
|
color: "accentColor",
|
|
16234
16550
|
size: "12",
|
|
16235
16551
|
weight: "medium"
|
|
@@ -16246,7 +16562,7 @@ function MobileOptions({ onClose }) {
|
|
|
16246
16562
|
let walletContent = null;
|
|
16247
16563
|
let headerBackgroundContrast = false;
|
|
16248
16564
|
let headerBackButtonLink = null;
|
|
16249
|
-
const [walletStep, setWalletStep] =
|
|
16565
|
+
const [walletStep, setWalletStep] = useState48(
|
|
16250
16566
|
"CONNECT" /* Connect */
|
|
16251
16567
|
);
|
|
16252
16568
|
const { i18n: i18n2 } = useContext31(I18nContext);
|
|
@@ -16255,71 +16571,71 @@ function MobileOptions({ onClose }) {
|
|
|
16255
16571
|
case "CONNECT" /* Connect */: {
|
|
16256
16572
|
headerLabel = i18n2.t("connect.title");
|
|
16257
16573
|
headerBackgroundContrast = true;
|
|
16258
|
-
walletContent = /* @__PURE__ */
|
|
16574
|
+
walletContent = /* @__PURE__ */ React152.createElement(Box, null, /* @__PURE__ */ React152.createElement(Box, {
|
|
16259
16575
|
background: "profileForeground",
|
|
16260
16576
|
className: scroll2,
|
|
16261
16577
|
display: "flex",
|
|
16262
16578
|
paddingBottom: "20",
|
|
16263
16579
|
paddingTop: "6"
|
|
16264
|
-
}, /* @__PURE__ */
|
|
16580
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16265
16581
|
display: "flex",
|
|
16266
16582
|
style: { margin: "0 auto" }
|
|
16267
16583
|
}, wallets.filter((wallet) => wallet.ready).map((wallet) => {
|
|
16268
|
-
return /* @__PURE__ */
|
|
16584
|
+
return /* @__PURE__ */ React152.createElement(Box, {
|
|
16269
16585
|
key: wallet.id,
|
|
16270
16586
|
paddingX: "20"
|
|
16271
|
-
}, /* @__PURE__ */
|
|
16587
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16272
16588
|
width: "60"
|
|
16273
|
-
}, /* @__PURE__ */
|
|
16589
|
+
}, /* @__PURE__ */ React152.createElement(WalletButton2, {
|
|
16274
16590
|
onClose,
|
|
16275
16591
|
wallet
|
|
16276
16592
|
})));
|
|
16277
|
-
}))), /* @__PURE__ */
|
|
16593
|
+
}))), /* @__PURE__ */ React152.createElement(Box, {
|
|
16278
16594
|
background: "generalBorder",
|
|
16279
16595
|
height: "1",
|
|
16280
16596
|
marginBottom: "32",
|
|
16281
16597
|
marginTop: "-1"
|
|
16282
|
-
}), /* @__PURE__ */
|
|
16598
|
+
}), /* @__PURE__ */ React152.createElement(Box, {
|
|
16283
16599
|
alignItems: "center",
|
|
16284
16600
|
display: "flex",
|
|
16285
16601
|
flexDirection: "column",
|
|
16286
16602
|
gap: "32",
|
|
16287
16603
|
paddingX: "32",
|
|
16288
16604
|
style: { textAlign: "center" }
|
|
16289
|
-
}, /* @__PURE__ */
|
|
16605
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16290
16606
|
display: "flex",
|
|
16291
16607
|
flexDirection: "column",
|
|
16292
16608
|
gap: "8",
|
|
16293
16609
|
textAlign: "center"
|
|
16294
|
-
}, /* @__PURE__ */
|
|
16610
|
+
}, /* @__PURE__ */ React152.createElement(Text, {
|
|
16295
16611
|
color: "modalText",
|
|
16296
16612
|
size: "16",
|
|
16297
16613
|
weight: "bold"
|
|
16298
|
-
}, i18n2.t("intro.title")), /* @__PURE__ */
|
|
16614
|
+
}, i18n2.t("intro.title")), /* @__PURE__ */ React152.createElement(Text, {
|
|
16299
16615
|
color: "modalTextSecondary",
|
|
16300
16616
|
size: "16"
|
|
16301
|
-
}, i18n2.t("intro.description")))), /* @__PURE__ */
|
|
16617
|
+
}, i18n2.t("intro.description")))), /* @__PURE__ */ React152.createElement(Box, {
|
|
16302
16618
|
paddingTop: "32",
|
|
16303
16619
|
paddingX: "20"
|
|
16304
|
-
}, /* @__PURE__ */
|
|
16620
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16305
16621
|
display: "flex",
|
|
16306
16622
|
gap: "14",
|
|
16307
16623
|
justifyContent: "center"
|
|
16308
|
-
}, /* @__PURE__ */
|
|
16624
|
+
}, /* @__PURE__ */ React152.createElement(ActionButton, {
|
|
16309
16625
|
label: i18n2.t("intro.get.label"),
|
|
16310
16626
|
onClick: () => setWalletStep("GET" /* Get */),
|
|
16311
16627
|
size: "large",
|
|
16312
16628
|
type: "secondary"
|
|
16313
|
-
}), /* @__PURE__ */
|
|
16629
|
+
}), /* @__PURE__ */ React152.createElement(ActionButton, {
|
|
16314
16630
|
href: learnMoreUrl,
|
|
16315
16631
|
label: i18n2.t("intro.learn_more.label"),
|
|
16316
16632
|
size: "large",
|
|
16317
16633
|
type: "secondary"
|
|
16318
|
-
}))), Disclaimer && /* @__PURE__ */
|
|
16634
|
+
}))), Disclaimer && /* @__PURE__ */ React152.createElement(Box, {
|
|
16319
16635
|
marginTop: "28",
|
|
16320
16636
|
marginX: "32",
|
|
16321
16637
|
textAlign: "center"
|
|
16322
|
-
}, /* @__PURE__ */
|
|
16638
|
+
}, /* @__PURE__ */ React152.createElement(Disclaimer, {
|
|
16323
16639
|
Link: DisclaimerLink,
|
|
16324
16640
|
Text: DisclaimerText
|
|
16325
16641
|
})));
|
|
@@ -16334,7 +16650,7 @@ function MobileOptions({ onClose }) {
|
|
|
16334
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);
|
|
16335
16651
|
}
|
|
16336
16652
|
)) == null ? void 0 : _a.splice(0, 3);
|
|
16337
|
-
walletContent = /* @__PURE__ */
|
|
16653
|
+
walletContent = /* @__PURE__ */ React152.createElement(Box, null, /* @__PURE__ */ React152.createElement(Box, {
|
|
16338
16654
|
alignItems: "center",
|
|
16339
16655
|
display: "flex",
|
|
16340
16656
|
flexDirection: "column",
|
|
@@ -16348,88 +16664,88 @@ function MobileOptions({ onClose }) {
|
|
|
16348
16664
|
if (!(downloadUrls == null ? void 0 : downloadUrls.ios) && !(downloadUrls == null ? void 0 : downloadUrls.android) && !(downloadUrls == null ? void 0 : downloadUrls.mobile)) {
|
|
16349
16665
|
return null;
|
|
16350
16666
|
}
|
|
16351
|
-
return /* @__PURE__ */
|
|
16667
|
+
return /* @__PURE__ */ React152.createElement(Box, {
|
|
16352
16668
|
display: "flex",
|
|
16353
16669
|
gap: "16",
|
|
16354
16670
|
key: wallet.id,
|
|
16355
16671
|
paddingX: "20",
|
|
16356
16672
|
width: "full"
|
|
16357
|
-
}, /* @__PURE__ */
|
|
16673
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16358
16674
|
style: { minHeight: 48, minWidth: 48 }
|
|
16359
|
-
}, /* @__PURE__ */
|
|
16675
|
+
}, /* @__PURE__ */ React152.createElement(AsyncImage, {
|
|
16360
16676
|
background: iconBackground,
|
|
16361
16677
|
borderColor: "generalBorder",
|
|
16362
16678
|
borderRadius: "10",
|
|
16363
16679
|
height: "48",
|
|
16364
16680
|
src: iconUrl,
|
|
16365
16681
|
width: "48"
|
|
16366
|
-
})), /* @__PURE__ */
|
|
16682
|
+
})), /* @__PURE__ */ React152.createElement(Box, {
|
|
16367
16683
|
display: "flex",
|
|
16368
16684
|
flexDirection: "column",
|
|
16369
16685
|
width: "full"
|
|
16370
|
-
}, /* @__PURE__ */
|
|
16686
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16371
16687
|
alignItems: "center",
|
|
16372
16688
|
display: "flex",
|
|
16373
16689
|
height: "48"
|
|
16374
|
-
}, /* @__PURE__ */
|
|
16690
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16375
16691
|
width: "full"
|
|
16376
|
-
}, /* @__PURE__ */
|
|
16692
|
+
}, /* @__PURE__ */ React152.createElement(Text, {
|
|
16377
16693
|
color: "modalText",
|
|
16378
16694
|
size: "18",
|
|
16379
16695
|
weight: "bold"
|
|
16380
|
-
}, name)), /* @__PURE__ */
|
|
16696
|
+
}, name)), /* @__PURE__ */ React152.createElement(ActionButton, {
|
|
16381
16697
|
href: (ios ? downloadUrls == null ? void 0 : downloadUrls.ios : downloadUrls == null ? void 0 : downloadUrls.android) || (downloadUrls == null ? void 0 : downloadUrls.mobile),
|
|
16382
16698
|
label: i18n2.t("get.action.label"),
|
|
16383
16699
|
size: "small",
|
|
16384
16700
|
type: "secondary"
|
|
16385
|
-
})), index < mobileWallets.length - 1 && /* @__PURE__ */
|
|
16701
|
+
})), index < mobileWallets.length - 1 && /* @__PURE__ */ React152.createElement(Box, {
|
|
16386
16702
|
background: "generalBorderDim",
|
|
16387
16703
|
height: "1",
|
|
16388
16704
|
marginY: "10",
|
|
16389
16705
|
width: "full"
|
|
16390
16706
|
})));
|
|
16391
|
-
})), /* @__PURE__ */
|
|
16707
|
+
})), /* @__PURE__ */ React152.createElement(Box, {
|
|
16392
16708
|
style: { marginBottom: "42px" }
|
|
16393
|
-
}), /* @__PURE__ */
|
|
16709
|
+
}), /* @__PURE__ */ React152.createElement(Box, {
|
|
16394
16710
|
alignItems: "center",
|
|
16395
16711
|
display: "flex",
|
|
16396
16712
|
flexDirection: "column",
|
|
16397
16713
|
gap: "36",
|
|
16398
16714
|
paddingX: "36",
|
|
16399
16715
|
style: { textAlign: "center" }
|
|
16400
|
-
}, /* @__PURE__ */
|
|
16716
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16401
16717
|
display: "flex",
|
|
16402
16718
|
flexDirection: "column",
|
|
16403
16719
|
gap: "12",
|
|
16404
16720
|
textAlign: "center"
|
|
16405
|
-
}, /* @__PURE__ */
|
|
16721
|
+
}, /* @__PURE__ */ React152.createElement(Text, {
|
|
16406
16722
|
color: "modalText",
|
|
16407
16723
|
size: "16",
|
|
16408
16724
|
weight: "bold"
|
|
16409
|
-
}, i18n2.t("get.looking_for.title")), /* @__PURE__ */
|
|
16725
|
+
}, i18n2.t("get.looking_for.title")), /* @__PURE__ */ React152.createElement(Text, {
|
|
16410
16726
|
color: "modalTextSecondary",
|
|
16411
16727
|
size: "16"
|
|
16412
16728
|
}, i18n2.t("get.looking_for.mobile.description")))));
|
|
16413
16729
|
break;
|
|
16414
16730
|
}
|
|
16415
16731
|
}
|
|
16416
|
-
return /* @__PURE__ */
|
|
16732
|
+
return /* @__PURE__ */ React152.createElement(Box, {
|
|
16417
16733
|
display: "flex",
|
|
16418
16734
|
flexDirection: "column",
|
|
16419
16735
|
paddingBottom: "36"
|
|
16420
|
-
}, /* @__PURE__ */
|
|
16736
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16421
16737
|
background: headerBackgroundContrast ? "profileForeground" : "modalBackground",
|
|
16422
16738
|
display: "flex",
|
|
16423
16739
|
flexDirection: "column",
|
|
16424
16740
|
paddingBottom: "4",
|
|
16425
16741
|
paddingTop: "14"
|
|
16426
|
-
}, /* @__PURE__ */
|
|
16742
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16427
16743
|
display: "flex",
|
|
16428
16744
|
justifyContent: "center",
|
|
16429
16745
|
paddingBottom: "6",
|
|
16430
16746
|
paddingX: "20",
|
|
16431
16747
|
position: "relative"
|
|
16432
|
-
}, headerBackButtonLink && /* @__PURE__ */
|
|
16748
|
+
}, headerBackButtonLink && /* @__PURE__ */ React152.createElement(Box, {
|
|
16433
16749
|
display: "flex",
|
|
16434
16750
|
position: "absolute",
|
|
16435
16751
|
style: {
|
|
@@ -16437,7 +16753,7 @@ function MobileOptions({ onClose }) {
|
|
|
16437
16753
|
marginBottom: -20,
|
|
16438
16754
|
marginTop: -20
|
|
16439
16755
|
}
|
|
16440
|
-
}, /* @__PURE__ */
|
|
16756
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16441
16757
|
alignItems: "center",
|
|
16442
16758
|
as: "button",
|
|
16443
16759
|
className: touchableStyles({
|
|
@@ -16453,28 +16769,28 @@ function MobileOptions({ onClose }) {
|
|
|
16453
16769
|
style: { height: 17, willChange: "transform" },
|
|
16454
16770
|
transition: "default",
|
|
16455
16771
|
type: "button"
|
|
16456
|
-
}, /* @__PURE__ */
|
|
16772
|
+
}, /* @__PURE__ */ React152.createElement(BackIcon, null))), /* @__PURE__ */ React152.createElement(Box, {
|
|
16457
16773
|
marginTop: "4",
|
|
16458
16774
|
textAlign: "center",
|
|
16459
16775
|
width: "full"
|
|
16460
|
-
}, /* @__PURE__ */
|
|
16776
|
+
}, /* @__PURE__ */ React152.createElement(Text, {
|
|
16461
16777
|
as: "h1",
|
|
16462
16778
|
color: "modalText",
|
|
16463
16779
|
id: titleId,
|
|
16464
16780
|
size: "20",
|
|
16465
16781
|
weight: "bold"
|
|
16466
|
-
}, headerLabel)), /* @__PURE__ */
|
|
16782
|
+
}, headerLabel)), /* @__PURE__ */ React152.createElement(Box, {
|
|
16467
16783
|
alignItems: "center",
|
|
16468
16784
|
display: "flex",
|
|
16469
16785
|
height: "32",
|
|
16470
16786
|
paddingRight: "14",
|
|
16471
16787
|
position: "absolute",
|
|
16472
16788
|
right: "0"
|
|
16473
|
-
}, /* @__PURE__ */
|
|
16789
|
+
}, /* @__PURE__ */ React152.createElement(Box, {
|
|
16474
16790
|
style: { marginBottom: -20, marginTop: -20 }
|
|
16475
|
-
}, /* @__PURE__ */
|
|
16791
|
+
}, /* @__PURE__ */ React152.createElement(CloseButton, {
|
|
16476
16792
|
onClose
|
|
16477
|
-
}))))), /* @__PURE__ */
|
|
16793
|
+
}))))), /* @__PURE__ */ React152.createElement(Box, {
|
|
16478
16794
|
display: "flex",
|
|
16479
16795
|
flexDirection: "column"
|
|
16480
16796
|
}, walletContent));
|