@funkit/connect 3.0.0-next.8 → 3.0.0
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 +29 -0
- package/dist/components/AccountModal/AccountModal.d.ts +3 -1
- package/dist/components/FunButton/FunButton.css.d.ts +1 -0
- package/dist/components/FunButton/FunIconButton.d.ts +1 -2
- package/dist/components/FunCheckoutHistoryModal/FunCheckoutHistoryContent.d.ts +1 -0
- package/dist/components/FunInput/FunTextAreaInput.d.ts +1 -1
- package/dist/components/FunkitProvider/FunkitConfigContext.d.ts +0 -6
- package/dist/components/FunkitProvider/ModalContext.d.ts +2 -1
- package/dist/components/Icons/Spinner.d.ts +2 -3
- package/dist/components/ProfileDetails/ProfileDetails.d.ts +3 -1
- package/dist/hooks/useAnimatedNavigation.d.ts +10 -0
- package/dist/hooks/useCheckoutModalTitle.d.ts +2 -0
- package/dist/hooks/useMesh.d.ts +1 -0
- package/dist/index.css +17 -14
- package/dist/index.js +731 -671
- package/dist/utils/mesh.d.ts +1 -1
- package/dist/wallets/walletConnectors/index.js +65 -65
- package/package.json +4 -4
- package/dist/wallets/walletConnectors/chunk-45BGLKK3.js +0 -149
- package/dist/wallets/walletConnectors/chunk-A6MZY5ZZ.js +0 -81
- package/dist/wallets/walletConnectors/chunk-ARIYPPEC.js +0 -92
- package/dist/wallets/walletConnectors/chunk-BEAW5Y5M.js +0 -60
- package/dist/wallets/walletConnectors/chunk-CW3DUKXK.js +0 -102
- package/dist/wallets/walletConnectors/chunk-E5XC6KBV.js +0 -95
- package/dist/wallets/walletConnectors/chunk-FCHEJLHR.js +0 -101
- package/dist/wallets/walletConnectors/chunk-FLTQRYFS.js +0 -27
- package/dist/wallets/walletConnectors/chunk-HKN7647Q.js +0 -73
- package/dist/wallets/walletConnectors/chunk-IOQWKPOO.js +0 -71
- package/dist/wallets/walletConnectors/chunk-LPQBQIZL.js +0 -108
- package/dist/wallets/walletConnectors/chunk-LTIIUGMZ.js +0 -96
- package/dist/wallets/walletConnectors/chunk-PIZ2XVGH.js +0 -60
- package/dist/wallets/walletConnectors/chunk-RXUGTOMT.js +0 -60
- package/dist/wallets/walletConnectors/chunk-VJ5C6RXN.js +0 -98
- package/dist/wallets/walletConnectors/chunk-WMLYUYMP.js +0 -94
package/dist/index.js
CHANGED
|
@@ -116,47 +116,35 @@ import React3 from "react";
|
|
|
116
116
|
var SpinnerIconClassName = "qe221a1";
|
|
117
117
|
|
|
118
118
|
// src/components/Icons/Spinner.tsx
|
|
119
|
-
var SpinnerIcon = ({
|
|
120
|
-
height = 21,
|
|
121
|
-
width = 21
|
|
122
|
-
}) => {
|
|
119
|
+
var SpinnerIcon = ({ size = 21 }) => {
|
|
123
120
|
return /* @__PURE__ */ React3.createElement(
|
|
124
|
-
"
|
|
121
|
+
"svg",
|
|
125
122
|
{
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
123
|
+
className: SpinnerIconClassName,
|
|
124
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
125
|
+
height: size,
|
|
126
|
+
width: size,
|
|
127
|
+
viewBox: "0 0 14 14",
|
|
128
|
+
fill: "none"
|
|
130
129
|
},
|
|
131
130
|
/* @__PURE__ */ React3.createElement(
|
|
132
|
-
"
|
|
131
|
+
"path",
|
|
133
132
|
{
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
),
|
|
151
|
-
/* @__PURE__ */ React3.createElement(
|
|
152
|
-
"path",
|
|
153
|
-
{
|
|
154
|
-
d: "M6.91235 13.2504C10.3968 13.2504 13.2214 10.4257 13.2214 6.94133C13.2214 5.63413 12.8239 4.41978 12.1431 3.4126",
|
|
155
|
-
stroke: "#333333",
|
|
156
|
-
strokeLinecap: "round",
|
|
157
|
-
strokeWidth: "1.3125"
|
|
158
|
-
}
|
|
159
|
-
)
|
|
133
|
+
opacity: "0.3",
|
|
134
|
+
d: "M13.3438 7C13.3438 8.66748 12.7013 10.1834 11.6491 11.3162C11.091 11.917 10.4183 12.4092 9.66627 12.7581C8.85649 13.1337 7.95367 13.3438 7 13.3438C3.49644 13.3438 0.65625 10.5036 0.65625 7C0.65625 3.49644 3.49644 0.65625 7 0.65625C10.5036 0.65625 13.3438 3.49644 13.3438 7Z",
|
|
135
|
+
stroke: "white",
|
|
136
|
+
strokeOpacity: "0.5",
|
|
137
|
+
strokeWidth: "1.3125"
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
/* @__PURE__ */ React3.createElement(
|
|
141
|
+
"path",
|
|
142
|
+
{
|
|
143
|
+
d: "M6.91235 13.2504C10.3968 13.2504 13.2214 10.4257 13.2214 6.94133C13.2214 5.63413 12.8239 4.41978 12.1431 3.4126",
|
|
144
|
+
stroke: "#333333",
|
|
145
|
+
strokeLinecap: "round",
|
|
146
|
+
strokeWidth: "1.3125"
|
|
147
|
+
}
|
|
160
148
|
)
|
|
161
149
|
);
|
|
162
150
|
};
|
|
@@ -408,13 +396,13 @@ function Avatar({ address, imageUrl, loading, size }) {
|
|
|
408
396
|
position: "absolute",
|
|
409
397
|
width: "full"
|
|
410
398
|
},
|
|
411
|
-
/* @__PURE__ */ React7.createElement(SpinnerIcon, {
|
|
399
|
+
/* @__PURE__ */ React7.createElement(SpinnerIcon, { size: "100%" })
|
|
412
400
|
)
|
|
413
401
|
);
|
|
414
402
|
}
|
|
415
403
|
|
|
416
404
|
// src/components/ConnectButton/ConnectButton.tsx
|
|
417
|
-
import React173, { useContext as useContext20, useEffect as useEffect36, useState as
|
|
405
|
+
import React173, { useContext as useContext20, useEffect as useEffect36, useState as useState48 } from "react";
|
|
418
406
|
|
|
419
407
|
// src/css/touchableStyles.css.ts
|
|
420
408
|
var active = { shrink: "_7rkubb8", shrinkSm: "_7rkubb9" };
|
|
@@ -523,7 +511,7 @@ import React170, {
|
|
|
523
511
|
useContext as useContext18,
|
|
524
512
|
useEffect as useEffect34,
|
|
525
513
|
useMemo as useMemo34,
|
|
526
|
-
useState as
|
|
514
|
+
useState as useState45
|
|
527
515
|
} from "react";
|
|
528
516
|
import { useConfig as useConfig5, useConnect as useConnect2, useDisconnect as useDisconnect2 } from "wagmi";
|
|
529
517
|
|
|
@@ -763,7 +751,7 @@ var MeshExchanges = /* @__PURE__ */ ((MeshExchanges5) => {
|
|
|
763
751
|
MeshExchanges5["Bitstamp"] = "Bitstamp";
|
|
764
752
|
MeshExchanges5["GateIo"] = "GateIo";
|
|
765
753
|
MeshExchanges5["Acorns"] = "Acorns";
|
|
766
|
-
MeshExchanges5["Okx"] = "
|
|
754
|
+
MeshExchanges5["Okx"] = "OKX";
|
|
767
755
|
MeshExchanges5["BitFlyer"] = "BitFlyer";
|
|
768
756
|
MeshExchanges5["Coinlist"] = "Coinlist";
|
|
769
757
|
MeshExchanges5["Huobi"] = "Huobi";
|
|
@@ -795,7 +783,7 @@ var EXCHANGE_NAME_TO_TYPE = {
|
|
|
795
783
|
["CexIo" /* CexIo */]: "cexIo",
|
|
796
784
|
["GateIo" /* GateIo */]: "gateIo",
|
|
797
785
|
["Bitstamp" /* Bitstamp */]: "bitstamp",
|
|
798
|
-
["
|
|
786
|
+
["OKX" /* Okx */]: "okx",
|
|
799
787
|
["Acorns" /* Acorns */]: "acorns",
|
|
800
788
|
["Coinlist" /* Coinlist */]: "coinlist",
|
|
801
789
|
["BitFlyer" /* BitFlyer */]: "bitFlyer",
|
|
@@ -863,6 +851,7 @@ async function fetchMeshSupportedTokensAndIdByChainIdAndBrokerage({
|
|
|
863
851
|
|
|
864
852
|
// src/utils/flags/config.ts
|
|
865
853
|
var flagConfig = {
|
|
854
|
+
// TODO: Delete this flag after v3-main is merged to main
|
|
866
855
|
["select_payment_method_text" /* SelectPaymentMethodText */]: {
|
|
867
856
|
type: "string",
|
|
868
857
|
default_value: "Select Payment Method",
|
|
@@ -879,6 +868,7 @@ var flagConfig = {
|
|
|
879
868
|
}
|
|
880
869
|
]
|
|
881
870
|
},
|
|
871
|
+
// TODO: Delete this flag after v3-main is merged to main
|
|
882
872
|
["payment_method_copy_v1" /* PaymentMethodCopyV1 */]: {
|
|
883
873
|
type: "boolean",
|
|
884
874
|
default_value: false,
|
|
@@ -912,7 +902,7 @@ var flagConfig = {
|
|
|
912
902
|
default_value: [
|
|
913
903
|
"Coinbase" /* Coinbase */,
|
|
914
904
|
"Binance" /* Binance */,
|
|
915
|
-
"
|
|
905
|
+
"OKX" /* Okx */,
|
|
916
906
|
"Bitfinex" /* Bitfinex */
|
|
917
907
|
].join(",")
|
|
918
908
|
},
|
|
@@ -1144,15 +1134,11 @@ var flags = {
|
|
|
1144
1134
|
// src/components/FunkitProvider/FunkitConfigContext.tsx
|
|
1145
1135
|
import { createContext as createContext3, useContext as useContext3, useMemo as useMemo2 } from "react";
|
|
1146
1136
|
var DEFAULT_TEXT_CUSTOMIZATIONS = {
|
|
1147
|
-
selectPaymentMethod: "Select Method",
|
|
1148
1137
|
brokerageOrExchange: "Exchange",
|
|
1149
1138
|
debitOrCredit: "Card",
|
|
1150
|
-
accountBalance: "
|
|
1139
|
+
accountBalance: "Wallet",
|
|
1151
1140
|
transferCrypto: "Transfer Crypto",
|
|
1152
|
-
selectAccount: "Select an exchange"
|
|
1153
|
-
payWith: "Pay With",
|
|
1154
|
-
enterPaymentInfo: "Enter Payment Information",
|
|
1155
|
-
otc: "Over the Counter"
|
|
1141
|
+
selectAccount: "Select an exchange"
|
|
1156
1142
|
};
|
|
1157
1143
|
var DEFAULT_FUNKIT_CONFIG = {
|
|
1158
1144
|
apiKey: "",
|
|
@@ -1415,7 +1401,7 @@ import React169, {
|
|
|
1415
1401
|
useContext as useContext17,
|
|
1416
1402
|
useEffect as useEffect33,
|
|
1417
1403
|
useMemo as useMemo33,
|
|
1418
|
-
useState as
|
|
1404
|
+
useState as useState44
|
|
1419
1405
|
} from "react";
|
|
1420
1406
|
import { useAccount as useAccount10, useAccountEffect as useAccountEffect2, useConfig as useConfig4 } from "wagmi";
|
|
1421
1407
|
|
|
@@ -1523,7 +1509,8 @@ var noop = () => void 0;
|
|
|
1523
1509
|
|
|
1524
1510
|
// src/components/FunButton/FunButton.css.ts
|
|
1525
1511
|
var funIconButtonClickableStyle = "_1tyx5nu4";
|
|
1526
|
-
var funIconButtonDisabledStyle = "
|
|
1512
|
+
var funIconButtonDisabledStyle = "_1tyx5nu6";
|
|
1513
|
+
var funIconButtonNonClickableStyle = "_1tyx5nu5";
|
|
1527
1514
|
var funLinkButtonStyle = "_1tyx5nu1 _1rsrm2f186";
|
|
1528
1515
|
var pressedStyles = "_1tyx5nu3";
|
|
1529
1516
|
var transitionStyles = "_1tyx5nu2";
|
|
@@ -1542,7 +1529,6 @@ var FunIconButton = ({
|
|
|
1542
1529
|
isDisabled = false,
|
|
1543
1530
|
borderRadius = "full",
|
|
1544
1531
|
style,
|
|
1545
|
-
disableHoverStyles = false,
|
|
1546
1532
|
variant = "quiet",
|
|
1547
1533
|
...props
|
|
1548
1534
|
}) => {
|
|
@@ -1557,21 +1543,21 @@ var FunIconButton = ({
|
|
|
1557
1543
|
"aria-label": ariaLabel,
|
|
1558
1544
|
background: {
|
|
1559
1545
|
base: isDisabled ? "buttonIconBackgroundHover" : "transparent",
|
|
1560
|
-
hover:
|
|
1561
|
-
active: "buttonIconBackgroundPressed"
|
|
1546
|
+
hover: onClick ? "buttonIconBackgroundHover" : void 0,
|
|
1547
|
+
active: onClick ? "buttonIconBackgroundPressed" : void 0
|
|
1562
1548
|
},
|
|
1563
1549
|
borderColor: {
|
|
1564
1550
|
base: showBorder ? "buttonIconBackgroundHover" : "transparent",
|
|
1565
|
-
active: showBorder ? "buttonIconStroke" :
|
|
1566
|
-
focusedVisible: "buttonIconStroke"
|
|
1551
|
+
active: onClick && showBorder ? "buttonIconStroke" : void 0,
|
|
1552
|
+
focusedVisible: onClick ? "buttonIconStroke" : void 0
|
|
1567
1553
|
},
|
|
1568
1554
|
borderRadius,
|
|
1569
1555
|
borderStyle: "solid",
|
|
1570
1556
|
borderWidth: showBorder ? "1" : "2",
|
|
1571
1557
|
className: clsx3(
|
|
1572
|
-
isDisabled ? funIconButtonDisabledStyle : funIconButtonClickableStyle,
|
|
1558
|
+
isDisabled ? funIconButtonDisabledStyle : onClick ? funIconButtonClickableStyle : funIconButtonNonClickableStyle,
|
|
1573
1559
|
transitionStyles,
|
|
1574
|
-
!isDisabled && pressedStyles
|
|
1560
|
+
onClick && !isDisabled && pressedStyles
|
|
1575
1561
|
),
|
|
1576
1562
|
color,
|
|
1577
1563
|
gap,
|
|
@@ -1798,7 +1784,7 @@ function FunButton({
|
|
|
1798
1784
|
...border,
|
|
1799
1785
|
onKeyDown: () => void 0
|
|
1800
1786
|
},
|
|
1801
|
-
/* @__PURE__ */ React14.createElement(Box, { display: "flex", alignItems: "center", justifyContent: "center", gap: "10" }, isLoading && /* @__PURE__ */ React14.createElement(SpinnerIcon, {
|
|
1787
|
+
/* @__PURE__ */ React14.createElement(Box, { display: "flex", alignItems: "center", justifyContent: "center", gap: "10" }, isLoading && /* @__PURE__ */ React14.createElement(SpinnerIcon, { size: loaderSize }), /* @__PURE__ */ React14.createElement(Text, { size: isSecondary ? "10" : "12", color, weight: "medium" }, title))
|
|
1802
1788
|
);
|
|
1803
1789
|
}
|
|
1804
1790
|
|
|
@@ -2037,7 +2023,7 @@ function useInterval(callback, delay) {
|
|
|
2037
2023
|
|
|
2038
2024
|
// src/components/FunCountdown/FunCountdown.css.ts
|
|
2039
2025
|
var backgroundRing = "_1rsrm2f13i";
|
|
2040
|
-
var counterRing = "
|
|
2026
|
+
var counterRing = "_1rsrm2f120";
|
|
2041
2027
|
|
|
2042
2028
|
// src/components/FunCountdown/FunCountdown.tsx
|
|
2043
2029
|
var FunCountdown = ({
|
|
@@ -2748,12 +2734,12 @@ import {
|
|
|
2748
2734
|
} from "@funkit/core";
|
|
2749
2735
|
import React61, {
|
|
2750
2736
|
createContext as createContext10,
|
|
2751
|
-
useCallback as
|
|
2737
|
+
useCallback as useCallback15,
|
|
2752
2738
|
useContext as useContext10,
|
|
2753
2739
|
useEffect as useEffect20,
|
|
2754
2740
|
useMemo as useMemo10,
|
|
2755
2741
|
useRef as useRef8,
|
|
2756
|
-
useState as
|
|
2742
|
+
useState as useState19
|
|
2757
2743
|
} from "react";
|
|
2758
2744
|
import { useAccount as useAccount4, useDisconnect, useSwitchChain } from "wagmi";
|
|
2759
2745
|
|
|
@@ -2856,7 +2842,7 @@ import React60 from "react";
|
|
|
2856
2842
|
import { useAccount as useAccount3 } from "wagmi";
|
|
2857
2843
|
|
|
2858
2844
|
// src/components/FunConnectOptions/FunSignInStep.tsx
|
|
2859
|
-
import React58, { Fragment, useCallback as
|
|
2845
|
+
import React58, { Fragment, useCallback as useCallback14, useMemo as useMemo9, useState as useState18 } from "react";
|
|
2860
2846
|
|
|
2861
2847
|
// src/utils/browsers.ts
|
|
2862
2848
|
function isSafari() {
|
|
@@ -3146,10 +3132,10 @@ function clearWalletConnectDeepLink() {
|
|
|
3146
3132
|
import React35 from "react";
|
|
3147
3133
|
|
|
3148
3134
|
// src/components/ModalSelection/ModalSelection.tsx
|
|
3149
|
-
import React34, { useContext as useContext8, useState as
|
|
3135
|
+
import React34, { useContext as useContext8, useState as useState12 } from "react";
|
|
3150
3136
|
|
|
3151
3137
|
// src/components/AsyncImage/AsyncImage.tsx
|
|
3152
|
-
import React31, { useMemo as useMemo4, useReducer as useReducer2 } from "react";
|
|
3138
|
+
import React31, { useMemo as useMemo4, useReducer as useReducer2, useState as useState10 } from "react";
|
|
3153
3139
|
|
|
3154
3140
|
// src/components/AsyncImage/useAsyncImage.ts
|
|
3155
3141
|
import { useEffect as useEffect11, useReducer } from "react";
|
|
@@ -3213,7 +3199,9 @@ function AsyncImage({
|
|
|
3213
3199
|
const src3 = useAsyncImage(srcProp || fallbackSrc);
|
|
3214
3200
|
const isRemoteImage = src3 !== void 0 && /^http/.test(src3);
|
|
3215
3201
|
const [isRemoteImageLoaded, setRemoteImageLoaded] = useTriggeredOnce();
|
|
3216
|
-
const [hasError, setHasError] =
|
|
3202
|
+
const [hasError, setHasError] = useState10(
|
|
3203
|
+
srcProp === void 0 && fallbackSrc === void 0
|
|
3204
|
+
);
|
|
3217
3205
|
const { asyncStyle, imgProps } = useMemo4(() => {
|
|
3218
3206
|
const asyncStyle2 = !useAsImage ? getRemoteImageStyles(isRemoteImage, isRemoteImageLoaded, src3) : {};
|
|
3219
3207
|
if (useAsImage || isRemoteImage) {
|
|
@@ -3228,7 +3216,7 @@ function AsyncImage({
|
|
|
3228
3216
|
if (fallbackSrc !== void 0) {
|
|
3229
3217
|
currentTarget.src = fallbackSrc;
|
|
3230
3218
|
} else {
|
|
3231
|
-
setHasError();
|
|
3219
|
+
setHasError(true);
|
|
3232
3220
|
}
|
|
3233
3221
|
},
|
|
3234
3222
|
onLoad: isRemoteImage ? setRemoteImageLoaded : void 0
|
|
@@ -3337,7 +3325,7 @@ import React33, {
|
|
|
3337
3325
|
createContext as createContext8,
|
|
3338
3326
|
useEffect as useEffect12,
|
|
3339
3327
|
useMemo as useMemo5,
|
|
3340
|
-
useState as
|
|
3328
|
+
useState as useState11
|
|
3341
3329
|
} from "react";
|
|
3342
3330
|
|
|
3343
3331
|
// src/locales/I18n.ts
|
|
@@ -3523,7 +3511,7 @@ var detectedBrowserLocale = () => {
|
|
|
3523
3511
|
// src/components/FunkitProvider/I18nContext.tsx
|
|
3524
3512
|
var I18nContext = createContext8({ i18n });
|
|
3525
3513
|
var I18nProvider = ({ children, locale }) => {
|
|
3526
|
-
const [updateCount, setUpdateCount] =
|
|
3514
|
+
const [updateCount, setUpdateCount] = useState11(0);
|
|
3527
3515
|
const browserLocale = useMemo5(
|
|
3528
3516
|
() => detectedBrowserLocale(),
|
|
3529
3517
|
[]
|
|
@@ -3563,7 +3551,7 @@ var ModalSelection = ({
|
|
|
3563
3551
|
isFunkitSdkConnector: isFunkitSdkConnector2,
|
|
3564
3552
|
...urlProps
|
|
3565
3553
|
}) => {
|
|
3566
|
-
const [isMouseOver, setIsMouseOver] =
|
|
3554
|
+
const [isMouseOver, setIsMouseOver] = useState12(false);
|
|
3567
3555
|
const { i18n: i18n2 } = useContext8(I18nContext);
|
|
3568
3556
|
return /* @__PURE__ */ React34.createElement(
|
|
3569
3557
|
Box,
|
|
@@ -3891,12 +3879,41 @@ var SocialsIcon = () => {
|
|
|
3891
3879
|
};
|
|
3892
3880
|
|
|
3893
3881
|
// src/components/FunConnectOptions/FunConnectOptions.tsx
|
|
3894
|
-
import React57, { useCallback as
|
|
3882
|
+
import React57, { useCallback as useCallback13, useState as useState17 } from "react";
|
|
3895
3883
|
|
|
3896
3884
|
// src/css/modalTransitionStyles.css.ts
|
|
3897
3885
|
var animateContentInClass = "stgjxl2";
|
|
3898
3886
|
var animateContentOutClass = "stgjxl3";
|
|
3899
3887
|
|
|
3888
|
+
// src/hooks/useAnimatedNavigation.ts
|
|
3889
|
+
import { useCallback as useCallback6, useState as useState13 } from "react";
|
|
3890
|
+
var ANIMATION_DELAY = 150;
|
|
3891
|
+
function useAnimatedNavigation(callback) {
|
|
3892
|
+
const [animateOut, setAnimateOut] = useState13(false);
|
|
3893
|
+
const navigateTo = useCallback6(
|
|
3894
|
+
(page) => {
|
|
3895
|
+
setAnimateOut(true);
|
|
3896
|
+
setTimeout(() => {
|
|
3897
|
+
callback?.(page);
|
|
3898
|
+
setAnimateOut(false);
|
|
3899
|
+
}, ANIMATION_DELAY);
|
|
3900
|
+
},
|
|
3901
|
+
[callback]
|
|
3902
|
+
);
|
|
3903
|
+
const animate = useCallback6((callback2) => {
|
|
3904
|
+
setAnimateOut(true);
|
|
3905
|
+
setTimeout(() => {
|
|
3906
|
+
callback2();
|
|
3907
|
+
setAnimateOut(false);
|
|
3908
|
+
}, ANIMATION_DELAY);
|
|
3909
|
+
}, []);
|
|
3910
|
+
return {
|
|
3911
|
+
animateOut,
|
|
3912
|
+
navigateTo,
|
|
3913
|
+
animate
|
|
3914
|
+
};
|
|
3915
|
+
}
|
|
3916
|
+
|
|
3900
3917
|
// src/components/FunConnectOptions/FunConnectResultStep.tsx
|
|
3901
3918
|
import React41, { useEffect as useEffect13 } from "react";
|
|
3902
3919
|
|
|
@@ -4131,10 +4148,10 @@ var FunConnectResultStep = ({
|
|
|
4131
4148
|
};
|
|
4132
4149
|
|
|
4133
4150
|
// src/components/FunConnectOptions/FunFarcasterConnectingStep.tsx
|
|
4134
|
-
import React50, { useCallback as
|
|
4151
|
+
import React50, { useCallback as useCallback10, useEffect as useEffect17, useMemo as useMemo8 } from "react";
|
|
4135
4152
|
|
|
4136
4153
|
// src/hooks/useFunListeners.ts
|
|
4137
|
-
import { useCallback as
|
|
4154
|
+
import { useCallback as useCallback8, useEffect as useEffect15, useRef as useRef6 } from "react";
|
|
4138
4155
|
|
|
4139
4156
|
// src/components/FunkitProvider/FunkitCheckoutContext.tsx
|
|
4140
4157
|
import {
|
|
@@ -4161,12 +4178,12 @@ import {
|
|
|
4161
4178
|
import { estimateGas } from "@wagmi/core";
|
|
4162
4179
|
import React42, {
|
|
4163
4180
|
createContext as createContext9,
|
|
4164
|
-
useCallback as
|
|
4181
|
+
useCallback as useCallback7,
|
|
4165
4182
|
useContext as useContext9,
|
|
4166
4183
|
useEffect as useEffect14,
|
|
4167
4184
|
useMemo as useMemo7,
|
|
4168
4185
|
useRef as useRef5,
|
|
4169
|
-
useState as
|
|
4186
|
+
useState as useState14
|
|
4170
4187
|
} from "react";
|
|
4171
4188
|
import { flushSync } from "react-dom";
|
|
4172
4189
|
import { v4 as uuid } from "uuid";
|
|
@@ -4589,29 +4606,35 @@ function validateCheckoutConfig(config) {
|
|
|
4589
4606
|
message: "Invalid targetChain configuration: Missing value"
|
|
4590
4607
|
};
|
|
4591
4608
|
}
|
|
4592
|
-
|
|
4593
|
-
|
|
4609
|
+
if (!Array.isArray(config.actionsParams)) {
|
|
4610
|
+
return {
|
|
4611
|
+
isValid: false,
|
|
4612
|
+
message: "Invalid actionsParams configuration: Has to be an array. If no actions are required, please specify an empty array ([]) instead."
|
|
4613
|
+
};
|
|
4614
|
+
}
|
|
4615
|
+
const parsedTargetAssetAmount = config.targetAssetAmount ? parseFloat(config.targetAssetAmount?.toString()) || 0 : 0;
|
|
4616
|
+
if (!Number.isFinite(parsedTargetAssetAmount) || parsedTargetAssetAmount < 0) {
|
|
4594
4617
|
return {
|
|
4595
4618
|
isValid: false,
|
|
4596
4619
|
message: "Invalid targetAssetAmount configuration: Has to be a number greater than 0"
|
|
4597
4620
|
};
|
|
4598
4621
|
}
|
|
4599
|
-
if (
|
|
4622
|
+
if (parsedTargetAssetAmount === 0 && !!config.actionsParams.length) {
|
|
4600
4623
|
return {
|
|
4601
4624
|
isValid: false,
|
|
4602
|
-
message: "Invalid
|
|
4625
|
+
message: "Invalid targetAssetAmount configuration: Has to be a number greater than 0"
|
|
4603
4626
|
};
|
|
4604
4627
|
}
|
|
4605
|
-
if (
|
|
4628
|
+
if (config.disableEditing && !parsedTargetAssetAmount) {
|
|
4606
4629
|
return {
|
|
4607
4630
|
isValid: false,
|
|
4608
|
-
message: "Invalid
|
|
4631
|
+
message: "Invalid disableEditing configuration: Unable to disable editing if targetAssetAmount is not greater than 0"
|
|
4609
4632
|
};
|
|
4610
4633
|
}
|
|
4611
|
-
if (!config.
|
|
4634
|
+
if (!config.targetAssetTicker) {
|
|
4612
4635
|
return {
|
|
4613
4636
|
isValid: false,
|
|
4614
|
-
message: "Invalid
|
|
4637
|
+
message: "Invalid targetAssetTicker configuration: Missing value"
|
|
4615
4638
|
};
|
|
4616
4639
|
}
|
|
4617
4640
|
if (!FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO[config.targetChain]) {
|
|
@@ -4678,13 +4701,12 @@ function getFunkitEnvForCheckoutEstimation({
|
|
|
4678
4701
|
}
|
|
4679
4702
|
const checkoutPaymasterAddresses = CONTRACT_ADDRESSES.checkoutPaymasterAddress;
|
|
4680
4703
|
const sponsorAddress = checkoutPaymasterAddresses[chainId];
|
|
4681
|
-
const
|
|
4682
|
-
const originalEnvOptions = existingGlobalEnvOptions || { gasSponsor: {} };
|
|
4704
|
+
const originalEnvOptions = getEnvOptions();
|
|
4683
4705
|
const newConfig = {
|
|
4684
4706
|
...originalEnvOptions,
|
|
4685
4707
|
chain: chainId,
|
|
4686
4708
|
gasSponsor: {
|
|
4687
|
-
...originalEnvOptions
|
|
4709
|
+
...originalEnvOptions?.gasSponsor,
|
|
4688
4710
|
// Important: Use the checkout paymaster instead of gasless / token paymaster
|
|
4689
4711
|
useCheckoutSponsor: true,
|
|
4690
4712
|
sponsorAddress
|
|
@@ -4885,8 +4907,8 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
4885
4907
|
userInfo
|
|
4886
4908
|
} = useGeneralWallet();
|
|
4887
4909
|
const { switchChainAsync } = useFunkitSwitchChains({});
|
|
4888
|
-
const [activeCheckouts, setActiveCheckouts] =
|
|
4889
|
-
const [checkoutHistoryList, setCheckoutHistoryList] =
|
|
4910
|
+
const [activeCheckouts, setActiveCheckouts] = useState14({});
|
|
4911
|
+
const [checkoutHistoryList, setCheckoutHistoryList] = useState14([]);
|
|
4890
4912
|
const {
|
|
4891
4913
|
stateMap: checkoutHistoryStateMap,
|
|
4892
4914
|
depositAddrMap: checkoutHistoryDepositAddrMap,
|
|
@@ -4896,11 +4918,11 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
4896
4918
|
}, [checkoutHistoryList]);
|
|
4897
4919
|
const intervalRef = useRef5();
|
|
4898
4920
|
const [refreshSymbol, triggerRefreshSymbol] = useSymbolRefresh_default();
|
|
4899
|
-
const [historyDepositAddress, setHistoryDepositAddress] =
|
|
4900
|
-
const [isCheckoutHistoryInited, setIsCheckoutHistoryInited] =
|
|
4901
|
-
const [isRefreshingCheckoutHistory, setIsRefreshingCheckoutHistory] =
|
|
4921
|
+
const [historyDepositAddress, setHistoryDepositAddress] = useState14();
|
|
4922
|
+
const [isCheckoutHistoryInited, setIsCheckoutHistoryInited] = useState14(false);
|
|
4923
|
+
const [isRefreshingCheckoutHistory, setIsRefreshingCheckoutHistory] = useState14(true);
|
|
4902
4924
|
const isGuestUserOnCheckoutHistory = !isUserLoggedIn && !!historyDepositAddress;
|
|
4903
|
-
const _refreshCheckoutHistory =
|
|
4925
|
+
const _refreshCheckoutHistory = useCallback7(async () => {
|
|
4904
4926
|
if (!funkitConfig.apiKey) return;
|
|
4905
4927
|
if (!isUserLoggedIn && !isGuestUserOnCheckoutHistory) return;
|
|
4906
4928
|
try {
|
|
@@ -4955,7 +4977,7 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
4955
4977
|
clearInterval(intervalRef.current);
|
|
4956
4978
|
}
|
|
4957
4979
|
}, [logoutSymbol]);
|
|
4958
|
-
const _startCheckoutHistoryListener =
|
|
4980
|
+
const _startCheckoutHistoryListener = useCallback7(
|
|
4959
4981
|
(singleDepositAddr) => {
|
|
4960
4982
|
setHistoryDepositAddress(singleDepositAddr);
|
|
4961
4983
|
clearInterval(intervalRef.current);
|
|
@@ -4968,7 +4990,7 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
4968
4990
|
},
|
|
4969
4991
|
[triggerRefreshSymbol]
|
|
4970
4992
|
);
|
|
4971
|
-
const _stopCheckoutHistoryListener =
|
|
4993
|
+
const _stopCheckoutHistoryListener = useCallback7(
|
|
4972
4994
|
(cancelIntervalId) => {
|
|
4973
4995
|
clearInterval(cancelIntervalId);
|
|
4974
4996
|
if (cancelIntervalId === intervalRef.current) {
|
|
@@ -4977,7 +4999,7 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
4977
4999
|
},
|
|
4978
5000
|
[]
|
|
4979
5001
|
);
|
|
4980
|
-
const _initNewCheckout =
|
|
5002
|
+
const _initNewCheckout = useCallback7(
|
|
4981
5003
|
(initSettings, hasSufficientBalance2, sourceSymbol) => {
|
|
4982
5004
|
const newCheckoutId = uuid();
|
|
4983
5005
|
const isFastForwarded = false;
|
|
@@ -5024,7 +5046,7 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
5024
5046
|
},
|
|
5025
5047
|
[accountBalancePaymentDefaultInfo, activeCheckouts]
|
|
5026
5048
|
);
|
|
5027
|
-
const _getAndValidateCheckoutItemByCheckoutId =
|
|
5049
|
+
const _getAndValidateCheckoutItemByCheckoutId = useCallback7(
|
|
5028
5050
|
(checkoutId) => {
|
|
5029
5051
|
if (!activeCheckouts?.[checkoutId]) {
|
|
5030
5052
|
throw new Error(
|
|
@@ -5035,7 +5057,7 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
5035
5057
|
},
|
|
5036
5058
|
[activeCheckouts]
|
|
5037
5059
|
);
|
|
5038
|
-
const _updateSelectedSourceAsset =
|
|
5060
|
+
const _updateSelectedSourceAsset = useCallback7(
|
|
5039
5061
|
(checkoutId, selectedSourceAssetAddress, selectedSourceAssetSymbol, selectedSourceAssetChainId) => {
|
|
5040
5062
|
_getAndValidateCheckoutItemByCheckoutId(checkoutId);
|
|
5041
5063
|
setActiveCheckouts((prev) => {
|
|
@@ -5055,7 +5077,7 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
5055
5077
|
},
|
|
5056
5078
|
[_getAndValidateCheckoutItemByCheckoutId, activeCheckouts]
|
|
5057
5079
|
);
|
|
5058
|
-
const _updateTargetAssetAmount =
|
|
5080
|
+
const _updateTargetAssetAmount = useCallback7(
|
|
5059
5081
|
(checkoutId, newTargetAssetAmount) => {
|
|
5060
5082
|
flushSync(() => {
|
|
5061
5083
|
_getAndValidateCheckoutItemByCheckoutId(checkoutId);
|
|
@@ -5075,7 +5097,7 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
5075
5097
|
},
|
|
5076
5098
|
[_getAndValidateCheckoutItemByCheckoutId, activeCheckouts]
|
|
5077
5099
|
);
|
|
5078
|
-
const _updateSelectedPaymentMethodInfo =
|
|
5100
|
+
const _updateSelectedPaymentMethodInfo = useCallback7(
|
|
5079
5101
|
(checkoutId, newPaymentMethodInfo) => {
|
|
5080
5102
|
_getAndValidateCheckoutItemByCheckoutId(checkoutId);
|
|
5081
5103
|
setActiveCheckouts((prev) => {
|
|
@@ -5095,7 +5117,7 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
5095
5117
|
[_getAndValidateCheckoutItemByCheckoutId, activeCheckouts]
|
|
5096
5118
|
);
|
|
5097
5119
|
const [reDraftSymbol, triggerReDraftSymbol] = useSymbolRefresh_default();
|
|
5098
|
-
const _calculateAssetUsdValue =
|
|
5120
|
+
const _calculateAssetUsdValue = useCallback7(
|
|
5099
5121
|
async (chainId, tokenAddress, tokenAmount) => {
|
|
5100
5122
|
const priceInfo = await getAssetPriceInfo2({
|
|
5101
5123
|
chainId,
|
|
@@ -5112,7 +5134,7 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
5112
5134
|
},
|
|
5113
5135
|
[funkitConfig.apiKey]
|
|
5114
5136
|
);
|
|
5115
|
-
const _getCheckoutDraftDollarValue =
|
|
5137
|
+
const _getCheckoutDraftDollarValue = useCallback7(
|
|
5116
5138
|
async (checkoutId) => {
|
|
5117
5139
|
const checkoutItem = _getAndValidateCheckoutItemByCheckoutId(checkoutId);
|
|
5118
5140
|
const hasPrevDraftValue = !!checkoutItem.draftDollarValue;
|
|
@@ -5148,7 +5170,7 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
5148
5170
|
triggerReDraftSymbol
|
|
5149
5171
|
]
|
|
5150
5172
|
);
|
|
5151
|
-
const _clearCheckoutQuoteMessages =
|
|
5173
|
+
const _clearCheckoutQuoteMessages = useCallback7(
|
|
5152
5174
|
(checkoutId) => {
|
|
5153
5175
|
_getAndValidateCheckoutItemByCheckoutId(checkoutId);
|
|
5154
5176
|
setActiveCheckouts((prev) => ({
|
|
@@ -5162,7 +5184,7 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
5162
5184
|
},
|
|
5163
5185
|
[_getAndValidateCheckoutItemByCheckoutId]
|
|
5164
5186
|
);
|
|
5165
|
-
const _getCheckoutQuote =
|
|
5187
|
+
const _getCheckoutQuote = useCallback7(
|
|
5166
5188
|
async (checkoutId, sponsorInitialTransferGasLimit, newPaymentMethodInfo) => {
|
|
5167
5189
|
if (!funkitConfig?.apiKey) {
|
|
5168
5190
|
throw new Error(
|
|
@@ -5447,7 +5469,7 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
5447
5469
|
userInfo
|
|
5448
5470
|
]
|
|
5449
5471
|
);
|
|
5450
|
-
const _generateSignedBatchOperation =
|
|
5472
|
+
const _generateSignedBatchOperation = useCallback7(
|
|
5451
5473
|
async (actionsParams = [], assetChainId, bypassWalletInit, stepMessageSetter) => {
|
|
5452
5474
|
if (!funWallet || !funWalletAuth) {
|
|
5453
5475
|
throw new Error("Funwallet or auth not defined");
|
|
@@ -5531,7 +5553,7 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
5531
5553
|
},
|
|
5532
5554
|
[funWallet, funWalletAuth, isWeb3Login]
|
|
5533
5555
|
);
|
|
5534
|
-
const _generateClientMetadataForBackend =
|
|
5556
|
+
const _generateClientMetadataForBackend = useCallback7(
|
|
5535
5557
|
(checkoutId) => {
|
|
5536
5558
|
const checkoutItem = _getAndValidateCheckoutItemByCheckoutId(checkoutId);
|
|
5537
5559
|
return {
|
|
@@ -5556,7 +5578,7 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
5556
5578
|
},
|
|
5557
5579
|
[_getAndValidateCheckoutItemByCheckoutId]
|
|
5558
5580
|
);
|
|
5559
|
-
const _confirmCheckout =
|
|
5581
|
+
const _confirmCheckout = useCallback7(
|
|
5560
5582
|
async (checkoutId, shouldbatchOpBypassInit, stepMessageSetter) => {
|
|
5561
5583
|
if (!funkitConfig?.apiKey) {
|
|
5562
5584
|
throw new Error(
|
|
@@ -5629,7 +5651,7 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
5629
5651
|
switchChainAsync
|
|
5630
5652
|
]
|
|
5631
5653
|
);
|
|
5632
|
-
const _cancelCheckout =
|
|
5654
|
+
const _cancelCheckout = useCallback7(
|
|
5633
5655
|
(depositAddress) => {
|
|
5634
5656
|
return postApiDeactivateCheckout({
|
|
5635
5657
|
depositAddress,
|
|
@@ -5722,12 +5744,12 @@ var useFunkitPostCheckoutInternal = (depositAddress) => {
|
|
|
5722
5744
|
checkoutHistoryDepositAddrMap,
|
|
5723
5745
|
checkoutHistoryCurrentDepositAddrMap
|
|
5724
5746
|
} = useContext9(FunkitCheckoutContext);
|
|
5725
|
-
const [checkoutHistoryInfo, setCheckoutHistoryInfo] =
|
|
5726
|
-
const [isLoading, setIsLoading] =
|
|
5747
|
+
const [checkoutHistoryInfo, setCheckoutHistoryInfo] = useState14();
|
|
5748
|
+
const [isLoading, setIsLoading] = useState14(false);
|
|
5727
5749
|
if (!depositAddress || !isAddress2(depositAddress)) {
|
|
5728
5750
|
throw new Error("Invalid depositAddress");
|
|
5729
5751
|
}
|
|
5730
|
-
const setupCheckoutHistory =
|
|
5752
|
+
const setupCheckoutHistory = useCallback7(async () => {
|
|
5731
5753
|
try {
|
|
5732
5754
|
setIsLoading(true);
|
|
5733
5755
|
let checkoutHistory;
|
|
@@ -5790,22 +5812,22 @@ var useFunkitCheckout = (props) => {
|
|
|
5790
5812
|
const { openFunCheckoutModal } = useFunCheckoutModal();
|
|
5791
5813
|
const { openConnectModal } = useConnectModal();
|
|
5792
5814
|
const { isUserLoggedIn } = useGeneralWallet();
|
|
5793
|
-
const onErrorWrapper =
|
|
5815
|
+
const onErrorWrapper = useCallback7(
|
|
5794
5816
|
(payload) => {
|
|
5795
5817
|
logger.warn(payload.message, payload);
|
|
5796
5818
|
onError?.(payload);
|
|
5797
5819
|
},
|
|
5798
5820
|
[onError]
|
|
5799
5821
|
);
|
|
5800
|
-
const onOpenWrapper =
|
|
5822
|
+
const onOpenWrapper = useCallback7(
|
|
5801
5823
|
(newId) => {
|
|
5802
5824
|
props?.onOpen?.();
|
|
5803
5825
|
openFunCheckoutModal?.(newId);
|
|
5804
5826
|
},
|
|
5805
5827
|
[openFunCheckoutModal, props]
|
|
5806
5828
|
);
|
|
5807
|
-
const [pendingCheckoutConfig, setPendingCheckoutConfig] =
|
|
5808
|
-
const beginCheckout =
|
|
5829
|
+
const [pendingCheckoutConfig, setPendingCheckoutConfig] = useState14();
|
|
5830
|
+
const beginCheckout = useCallback7(
|
|
5809
5831
|
async (inputConfig) => {
|
|
5810
5832
|
const combinedConfig = {
|
|
5811
5833
|
...propsConfig || {},
|
|
@@ -5895,21 +5917,21 @@ function useSIWFarcasterListener(channelToken) {
|
|
|
5895
5917
|
const { getFcConnectionStatus, handleFunkitWeb2Login } = useFunkitWeb2Login();
|
|
5896
5918
|
const intervalRef = useRef6();
|
|
5897
5919
|
const [refreshSymbol, triggerRefreshSymbol] = useSymbolRefresh_default();
|
|
5898
|
-
const startStatusListener =
|
|
5920
|
+
const startStatusListener = useCallback8(() => {
|
|
5899
5921
|
clearInterval(intervalRef.current);
|
|
5900
5922
|
triggerRefreshSymbol();
|
|
5901
5923
|
intervalRef.current = setInterval(() => {
|
|
5902
5924
|
triggerRefreshSymbol();
|
|
5903
5925
|
}, FARCASTER_STATUS_INTERVAL);
|
|
5904
5926
|
}, [triggerRefreshSymbol]);
|
|
5905
|
-
const stopStatusListener =
|
|
5927
|
+
const stopStatusListener = useCallback8(() => {
|
|
5906
5928
|
clearInterval(intervalRef.current);
|
|
5907
5929
|
}, []);
|
|
5908
5930
|
useEffect15(() => {
|
|
5909
5931
|
startStatusListener();
|
|
5910
5932
|
return () => stopStatusListener();
|
|
5911
5933
|
}, []);
|
|
5912
|
-
const check =
|
|
5934
|
+
const check = useCallback8(async () => {
|
|
5913
5935
|
if (!channelToken || !initalChainid) return;
|
|
5914
5936
|
const { isCompleted, fcMeta } = await getFcConnectionStatus(channelToken);
|
|
5915
5937
|
if (!isCompleted) return;
|
|
@@ -5937,7 +5959,7 @@ function useSIWFarcasterListener(channelToken) {
|
|
|
5937
5959
|
}
|
|
5938
5960
|
|
|
5939
5961
|
// src/components/CopyAddress/CopyAddress.tsx
|
|
5940
|
-
import React46, { useCallback as
|
|
5962
|
+
import React46, { useCallback as useCallback9, useEffect as useEffect16, useState as useState15 } from "react";
|
|
5941
5963
|
|
|
5942
5964
|
// src/components/FunKeyValue/FunKeyValue.tsx
|
|
5943
5965
|
import React43 from "react";
|
|
@@ -6101,8 +6123,8 @@ function CopyAddress({
|
|
|
6101
6123
|
type,
|
|
6102
6124
|
showAddress = false
|
|
6103
6125
|
}) {
|
|
6104
|
-
const [copiedAddress, setCopiedAddress] =
|
|
6105
|
-
const copyAddressAction =
|
|
6126
|
+
const [copiedAddress, setCopiedAddress] = useState15(false);
|
|
6127
|
+
const copyAddressAction = useCallback9(() => {
|
|
6106
6128
|
if (address) {
|
|
6107
6129
|
navigator.clipboard.writeText(address);
|
|
6108
6130
|
setCopiedAddress(true);
|
|
@@ -6228,7 +6250,7 @@ function FunFarcasterConnectingStep({
|
|
|
6228
6250
|
}
|
|
6229
6251
|
}, [farcasterUri, mobile, safari]);
|
|
6230
6252
|
useSIWFarcasterListener(farcasterToken);
|
|
6231
|
-
const svgUrl =
|
|
6253
|
+
const svgUrl = useCallback10(async () => {
|
|
6232
6254
|
return (await import("./farcaster-O6OCVOGR.js")).default;
|
|
6233
6255
|
}, []);
|
|
6234
6256
|
const promptText = useMemo8(() => {
|
|
@@ -6281,10 +6303,10 @@ function FunFarcasterConnectingStep({
|
|
|
6281
6303
|
}
|
|
6282
6304
|
|
|
6283
6305
|
// src/components/FunConnectOptions/FunWeb2ConnectingStep.tsx
|
|
6284
|
-
import React53, { useCallback as
|
|
6306
|
+
import React53, { useCallback as useCallback12, useEffect as useEffect18 } from "react";
|
|
6285
6307
|
|
|
6286
6308
|
// src/components/FunInput/FunTwoFaInput.tsx
|
|
6287
|
-
import React51, { useCallback as
|
|
6309
|
+
import React51, { useCallback as useCallback11, useRef as useRef7, useState as useState16 } from "react";
|
|
6288
6310
|
var FunTwoFaInput = ({
|
|
6289
6311
|
value,
|
|
6290
6312
|
onChange,
|
|
@@ -6299,12 +6321,12 @@ var FunTwoFaInput = ({
|
|
|
6299
6321
|
const inputRefs = useRef7(
|
|
6300
6322
|
Array.from({ length: initialInputLength }, () => null)
|
|
6301
6323
|
);
|
|
6302
|
-
const [currentLength, setCurrentLength] =
|
|
6303
|
-
const [focusIndex, setFocusIndex] =
|
|
6304
|
-
const [isFocused, setIsFocused] =
|
|
6324
|
+
const [currentLength, setCurrentLength] = useState16(initialInputLength);
|
|
6325
|
+
const [focusIndex, setFocusIndex] = useState16(0);
|
|
6326
|
+
const [isFocused, setIsFocused] = useState16(false);
|
|
6305
6327
|
const onFocus = () => setIsFocused(true);
|
|
6306
6328
|
const onBlur = () => setIsFocused(false);
|
|
6307
|
-
const handleBackspace =
|
|
6329
|
+
const handleBackspace = useCallback11(
|
|
6308
6330
|
(index) => {
|
|
6309
6331
|
if (index === maxInputLength - 1 && value.length == maxInputLength) {
|
|
6310
6332
|
onChange(value.slice(0, index));
|
|
@@ -6328,7 +6350,7 @@ var FunTwoFaInput = ({
|
|
|
6328
6350
|
},
|
|
6329
6351
|
[currentLength, initialInputLength, maxInputLength, onChange, value]
|
|
6330
6352
|
);
|
|
6331
|
-
const handleChange =
|
|
6353
|
+
const handleChange = useCallback11(
|
|
6332
6354
|
(changeEvent) => {
|
|
6333
6355
|
changeEvent.stopPropagation();
|
|
6334
6356
|
const trimmedInput = changeEvent.nativeEvent.data;
|
|
@@ -6489,7 +6511,7 @@ var FunWeb2ConnectingStep = ({
|
|
|
6489
6511
|
setOtpInput("");
|
|
6490
6512
|
clearLoginError();
|
|
6491
6513
|
}, []);
|
|
6492
|
-
const handleOtpComplete =
|
|
6514
|
+
const handleOtpComplete = useCallback12(
|
|
6493
6515
|
async (finalOtpInput) => {
|
|
6494
6516
|
if (isNotNullish(initialChainId)) {
|
|
6495
6517
|
await handleFunkitWeb2Login({
|
|
@@ -6695,21 +6717,19 @@ var FunWeb3ConnectingStep = ({ selectedWallet, qrCodeUri }) => {
|
|
|
6695
6717
|
};
|
|
6696
6718
|
|
|
6697
6719
|
// src/components/FunConnectOptions/FunConnectOptions.tsx
|
|
6698
|
-
var ANIMATION_DELAY = 150;
|
|
6699
6720
|
var isSignIn = (step) => step === 0 /* SIGNIN_PRIMARY */ || step === 1 /* SIGNIN_SECONDARY */;
|
|
6700
6721
|
function FunConnectOptions({ onClose }) {
|
|
6701
|
-
const [step, setStep] =
|
|
6702
|
-
const [selectedWallet, setSelectedWallet] =
|
|
6703
|
-
const [qrCodeUri, setQrCodeUri] =
|
|
6704
|
-
const [emailInput, setEmailInput] =
|
|
6705
|
-
const [otpInput, setOtpInput] =
|
|
6706
|
-
const [farcasterUri, setFarcasterUri] =
|
|
6707
|
-
const [farcasterToken, setFarcasterToken] =
|
|
6722
|
+
const [step, setStep] = useState17(0 /* SIGNIN_PRIMARY */);
|
|
6723
|
+
const [selectedWallet, setSelectedWallet] = useState17();
|
|
6724
|
+
const [qrCodeUri, setQrCodeUri] = useState17("");
|
|
6725
|
+
const [emailInput, setEmailInput] = useState17("");
|
|
6726
|
+
const [otpInput, setOtpInput] = useState17("");
|
|
6727
|
+
const [farcasterUri, setFarcasterUri] = useState17("");
|
|
6728
|
+
const [farcasterToken, setFarcasterToken] = useState17("");
|
|
6708
6729
|
const { loginConfig } = useFunkitConfig();
|
|
6709
6730
|
const prioritizedLoginType = loginConfig.prioritizedLogin;
|
|
6710
6731
|
const hasSecondarySignIn = prioritizedLoginType !== "none" && loginConfig.web2 && loginConfig.web3;
|
|
6711
|
-
const
|
|
6712
|
-
const changeStep = useCallback12((newStep) => {
|
|
6732
|
+
const changeStep = useCallback13((newStep) => {
|
|
6713
6733
|
setStep(newStep);
|
|
6714
6734
|
if (isSignIn(newStep)) {
|
|
6715
6735
|
setSelectedWallet(void 0);
|
|
@@ -6717,17 +6737,8 @@ function FunConnectOptions({ onClose }) {
|
|
|
6717
6737
|
setOtpInput("");
|
|
6718
6738
|
}
|
|
6719
6739
|
}, []);
|
|
6720
|
-
const navigateTo =
|
|
6721
|
-
|
|
6722
|
-
setBackAnimation(true);
|
|
6723
|
-
setTimeout(() => {
|
|
6724
|
-
changeStep(step2);
|
|
6725
|
-
setBackAnimation(false);
|
|
6726
|
-
}, ANIMATION_DELAY);
|
|
6727
|
-
},
|
|
6728
|
-
[changeStep]
|
|
6729
|
-
);
|
|
6730
|
-
const handleBackToSignIn = useCallback12(
|
|
6740
|
+
const { animateOut, navigateTo } = useAnimatedNavigation(changeStep);
|
|
6741
|
+
const handleBackToSignIn = useCallback13(
|
|
6731
6742
|
(type) => {
|
|
6732
6743
|
const isPrimary = !hasSecondarySignIn || type === prioritizedLoginType;
|
|
6733
6744
|
navigateTo(
|
|
@@ -6737,7 +6748,7 @@ function FunConnectOptions({ onClose }) {
|
|
|
6737
6748
|
[navigateTo, hasSecondarySignIn, prioritizedLoginType]
|
|
6738
6749
|
);
|
|
6739
6750
|
const walletConnectors = usePreparedWalletConnectors();
|
|
6740
|
-
const onRegenerateQrCode =
|
|
6751
|
+
const onRegenerateQrCode = useCallback13(
|
|
6741
6752
|
async (wallet) => {
|
|
6742
6753
|
const sWallet = walletConnectors.find((w) => wallet.id === w.id);
|
|
6743
6754
|
const uri = await sWallet?.getQrCodeUri?.();
|
|
@@ -6745,7 +6756,7 @@ function FunConnectOptions({ onClose }) {
|
|
|
6745
6756
|
},
|
|
6746
6757
|
[walletConnectors]
|
|
6747
6758
|
);
|
|
6748
|
-
const connectToWallet =
|
|
6759
|
+
const connectToWallet = useCallback13(
|
|
6749
6760
|
async (wallet) => {
|
|
6750
6761
|
if (!wallet.ready) return;
|
|
6751
6762
|
try {
|
|
@@ -6762,7 +6773,7 @@ function FunConnectOptions({ onClose }) {
|
|
|
6762
6773
|
},
|
|
6763
6774
|
[changeStep, onRegenerateQrCode]
|
|
6764
6775
|
);
|
|
6765
|
-
const handleRetry =
|
|
6776
|
+
const handleRetry = useCallback13(() => {
|
|
6766
6777
|
if (!selectedWallet || selectedWallet.id === FUNKIT_CONNECT_WALLET_ID) {
|
|
6767
6778
|
handleBackToSignIn("web2");
|
|
6768
6779
|
} else {
|
|
@@ -6778,7 +6789,7 @@ function FunConnectOptions({ onClose }) {
|
|
|
6778
6789
|
},
|
|
6779
6790
|
[3 /* PENDING_WALLET */]: {
|
|
6780
6791
|
onBack: () => handleBackToSignIn("web3"),
|
|
6781
|
-
backAnimation
|
|
6792
|
+
backAnimation: animateOut
|
|
6782
6793
|
},
|
|
6783
6794
|
[2 /* PENDING_EMAIL */]: {
|
|
6784
6795
|
onBack: () => handleBackToSignIn("web2"),
|
|
@@ -6786,7 +6797,7 @@ function FunConnectOptions({ onClose }) {
|
|
|
6786
6797
|
},
|
|
6787
6798
|
[4 /* PENDING_FARCASTER */]: {
|
|
6788
6799
|
onBack: () => handleBackToSignIn("web2"),
|
|
6789
|
-
backAnimation
|
|
6800
|
+
backAnimation: animateOut
|
|
6790
6801
|
},
|
|
6791
6802
|
[5 /* ERROR_WEB3 */]: {
|
|
6792
6803
|
onBack: () => handleBackToSignIn("web3")
|
|
@@ -6799,7 +6810,7 @@ function FunConnectOptions({ onClose }) {
|
|
|
6799
6810
|
flexDirection: "column",
|
|
6800
6811
|
minWidth: "full",
|
|
6801
6812
|
width: "full",
|
|
6802
|
-
className:
|
|
6813
|
+
className: animateOut ? animateContentOutClass : animateContentInClass,
|
|
6803
6814
|
withTopDivider: true
|
|
6804
6815
|
},
|
|
6805
6816
|
isSignIn(step) ? /* @__PURE__ */ React57.createElement(
|
|
@@ -6903,7 +6914,7 @@ function FunSignInStep({
|
|
|
6903
6914
|
const funkitConfig = useFunkitConfig();
|
|
6904
6915
|
const prioritizedLoginType = funkitConfig.loginConfig.prioritizedLogin;
|
|
6905
6916
|
const hasSecondarySignIn = prioritizedLoginType !== "none" && funkitConfig.loginConfig.web2 && funkitConfig.loginConfig.web3;
|
|
6906
|
-
const [selectedOptionId, setSelectedOptionId] =
|
|
6917
|
+
const [selectedOptionId, setSelectedOptionId] = useState18();
|
|
6907
6918
|
const {
|
|
6908
6919
|
isSendingOtpEmail,
|
|
6909
6920
|
handleSendOtpEmail,
|
|
@@ -6913,7 +6924,7 @@ function FunSignInStep({
|
|
|
6913
6924
|
const isEmailInputValid = useMemo9(() => {
|
|
6914
6925
|
return validateEmailString(emailInput);
|
|
6915
6926
|
}, [emailInput]);
|
|
6916
|
-
const [emailError, setEmailError] =
|
|
6927
|
+
const [emailError, setEmailError] = useState18();
|
|
6917
6928
|
const wallets = usePreparedWalletConnectors();
|
|
6918
6929
|
const groupedWallets = groupBy(wallets, (wallet) => wallet.groupName);
|
|
6919
6930
|
const funkitConnectWallet2 = groupedWallets?.[RESERVED_GROUP_NAME]?.[0];
|
|
@@ -6977,7 +6988,7 @@ function FunSignInStep({
|
|
|
6977
6988
|
changeStep(3 /* PENDING_WALLET */);
|
|
6978
6989
|
}
|
|
6979
6990
|
};
|
|
6980
|
-
const handleEmailSubmit =
|
|
6991
|
+
const handleEmailSubmit = useCallback14(async () => {
|
|
6981
6992
|
if (!isEmailInputValid) return;
|
|
6982
6993
|
try {
|
|
6983
6994
|
const { success, error } = await handleSendOtpEmail(emailInput);
|
|
@@ -7323,10 +7334,10 @@ function GeneralWalletProvider({ children }) {
|
|
|
7323
7334
|
}
|
|
7324
7335
|
}, [apiKey, userInfo]);
|
|
7325
7336
|
const intervalRef = useRef8();
|
|
7326
|
-
const [isFetchingAssets, setIsFetchingAssets] =
|
|
7327
|
-
const [walletAssets, setWalletAssets] =
|
|
7337
|
+
const [isFetchingAssets, setIsFetchingAssets] = useState19(false);
|
|
7338
|
+
const [walletAssets, setWalletAssets] = useState19(null);
|
|
7328
7339
|
const [refreshSymbol, triggerRefreshSymbol] = useSymbolRefresh_default();
|
|
7329
|
-
const _fetchAssetsIfPossible =
|
|
7340
|
+
const _fetchAssetsIfPossible = useCallback15(async () => {
|
|
7330
7341
|
if (isConnected && address) {
|
|
7331
7342
|
try {
|
|
7332
7343
|
setIsFetchingAssets(true);
|
|
@@ -7375,18 +7386,18 @@ function GeneralWalletProvider({ children }) {
|
|
|
7375
7386
|
}
|
|
7376
7387
|
return totalWalletAssetsUsd2;
|
|
7377
7388
|
}, [walletAssets]);
|
|
7378
|
-
const startAssetsListener =
|
|
7389
|
+
const startAssetsListener = useCallback15(() => {
|
|
7379
7390
|
clearInterval(intervalRef.current);
|
|
7380
7391
|
triggerRefreshSymbol();
|
|
7381
7392
|
intervalRef.current = setInterval(() => {
|
|
7382
7393
|
triggerRefreshSymbol();
|
|
7383
7394
|
}, FETCH_ASSETS_INTERVAL_MS);
|
|
7384
7395
|
}, [triggerRefreshSymbol]);
|
|
7385
|
-
const stopAssetsListener =
|
|
7396
|
+
const stopAssetsListener = useCallback15(() => {
|
|
7386
7397
|
clearInterval(intervalRef.current);
|
|
7387
7398
|
}, []);
|
|
7388
|
-
const [funWalletAuth, setFunWalletAuth] =
|
|
7389
|
-
const [funWallet, setFunWallet] =
|
|
7399
|
+
const [funWalletAuth, setFunWalletAuth] = useState19(null);
|
|
7400
|
+
const [funWallet, setFunWallet] = useState19(null);
|
|
7390
7401
|
useEffect20(() => {
|
|
7391
7402
|
async function setupFunWallet() {
|
|
7392
7403
|
let newFunWalletAuth;
|
|
@@ -7424,7 +7435,7 @@ function GeneralWalletProvider({ children }) {
|
|
|
7424
7435
|
);
|
|
7425
7436
|
}, [connector, isWeb2Login, isWeb3Login, activeChain]);
|
|
7426
7437
|
const [logoutSymbol, triggerLogoutSymbol] = useSymbolRefresh_default();
|
|
7427
|
-
const handleLogout =
|
|
7438
|
+
const handleLogout = useCallback15(async () => {
|
|
7428
7439
|
logger.log("handleLogout_called");
|
|
7429
7440
|
setWalletAssets(null);
|
|
7430
7441
|
triggerLogoutSymbol();
|
|
@@ -7519,7 +7530,7 @@ var useFunkitSwitchChains = ({
|
|
|
7519
7530
|
onSettled
|
|
7520
7531
|
}) => {
|
|
7521
7532
|
const { isWeb2Login } = useContext10(GeneralWalletContext);
|
|
7522
|
-
const [pendingChainId, setPendingChainId] =
|
|
7533
|
+
const [pendingChainId, setPendingChainId] = useState19(null);
|
|
7523
7534
|
const { switchChain, switchChainAsync } = useSwitchChain({
|
|
7524
7535
|
mutation: {
|
|
7525
7536
|
onMutate: ({ chainId: _chainId }) => {
|
|
@@ -7536,7 +7547,7 @@ var useFunkitSwitchChains = ({
|
|
|
7536
7547
|
}
|
|
7537
7548
|
}
|
|
7538
7549
|
});
|
|
7539
|
-
const canSwitchChain =
|
|
7550
|
+
const canSwitchChain = useCallback15(
|
|
7540
7551
|
(params) => {
|
|
7541
7552
|
if (isWeb2Login && !FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO4[params.chainId].isFunWalletSupported) {
|
|
7542
7553
|
logger.warn(
|
|
@@ -7548,7 +7559,7 @@ var useFunkitSwitchChains = ({
|
|
|
7548
7559
|
},
|
|
7549
7560
|
[isWeb2Login]
|
|
7550
7561
|
);
|
|
7551
|
-
const switchChainWithGuard =
|
|
7562
|
+
const switchChainWithGuard = useCallback15(
|
|
7552
7563
|
(params) => {
|
|
7553
7564
|
if (canSwitchChain(params)) {
|
|
7554
7565
|
switchChain(params);
|
|
@@ -7556,7 +7567,7 @@ var useFunkitSwitchChains = ({
|
|
|
7556
7567
|
},
|
|
7557
7568
|
[canSwitchChain, switchChain]
|
|
7558
7569
|
);
|
|
7559
|
-
const switchChainAsyncWithGuard =
|
|
7570
|
+
const switchChainAsyncWithGuard = useCallback15(
|
|
7560
7571
|
async (params) => {
|
|
7561
7572
|
if (canSwitchChain(params)) {
|
|
7562
7573
|
await switchChainAsync(params);
|
|
@@ -7572,7 +7583,7 @@ var useFunkitSwitchChains = ({
|
|
|
7572
7583
|
};
|
|
7573
7584
|
|
|
7574
7585
|
// src/components/ProfileDetails/ActivityTraversalContext.tsx
|
|
7575
|
-
import React62, { createContext as createContext11, useCallback as
|
|
7586
|
+
import React62, { createContext as createContext11, useCallback as useCallback16, useContext as useContext11, useState as useState20 } from "react";
|
|
7576
7587
|
var ActivityTraversalContext = createContext11({
|
|
7577
7588
|
selectedPurchaseId: void 0,
|
|
7578
7589
|
selectedPurchaseInitView: void 0,
|
|
@@ -7582,11 +7593,11 @@ var ActivityTraversalContext = createContext11({
|
|
|
7582
7593
|
resetActivityTraversal: () => void 0
|
|
7583
7594
|
});
|
|
7584
7595
|
var ActivityTraversalProvider = ({ children }) => {
|
|
7585
|
-
const [selectedPurchaseId, setSelectedPurchaseId] =
|
|
7586
|
-
const [selectedPurchaseInitView, setSelectedPurchaseInitView] =
|
|
7587
|
-
const [returnView, setReturnView] =
|
|
7588
|
-
const [returnViewPresets, setReturnViewPresets] =
|
|
7589
|
-
const onSelectActivity =
|
|
7596
|
+
const [selectedPurchaseId, setSelectedPurchaseId] = useState20();
|
|
7597
|
+
const [selectedPurchaseInitView, setSelectedPurchaseInitView] = useState20();
|
|
7598
|
+
const [returnView, setReturnView] = useState20();
|
|
7599
|
+
const [returnViewPresets, setReturnViewPresets] = useState20({});
|
|
7600
|
+
const onSelectActivity = useCallback16(
|
|
7590
7601
|
({
|
|
7591
7602
|
depositAddress,
|
|
7592
7603
|
initialPage,
|
|
@@ -7604,7 +7615,7 @@ var ActivityTraversalProvider = ({ children }) => {
|
|
|
7604
7615
|
},
|
|
7605
7616
|
[]
|
|
7606
7617
|
);
|
|
7607
|
-
const resetActivityTraversal =
|
|
7618
|
+
const resetActivityTraversal = useCallback16(() => {
|
|
7608
7619
|
setSelectedPurchaseId(void 0);
|
|
7609
7620
|
setSelectedPurchaseInitView(void 0);
|
|
7610
7621
|
setReturnView(void 0);
|
|
@@ -7624,13 +7635,21 @@ var useActivityTraversal = () => {
|
|
|
7624
7635
|
};
|
|
7625
7636
|
|
|
7626
7637
|
// src/components/ProfileDetails/ProfileDetails.tsx
|
|
7627
|
-
import React95, { useCallback as
|
|
7638
|
+
import React95, { useCallback as useCallback17, useState as useState27 } from "react";
|
|
7639
|
+
|
|
7640
|
+
// src/hooks/useCheckoutModalTitle.ts
|
|
7641
|
+
function useCheckoutModalTitle(depositAddress, defaultTitle) {
|
|
7642
|
+
const { checkoutHistoryInfo } = useFunkitPostCheckoutInternal(depositAddress);
|
|
7643
|
+
const metadata = checkoutHistoryInfo?.clientMetadata;
|
|
7644
|
+
const modalTitle = metadata?.initSettings.config.modalTitle;
|
|
7645
|
+
return modalTitle ?? defaultTitle;
|
|
7646
|
+
}
|
|
7628
7647
|
|
|
7629
7648
|
// src/components/FunCheckoutHistoryModal/FunCheckoutHistoryContent.tsx
|
|
7630
|
-
import
|
|
7649
|
+
import React80 from "react";
|
|
7631
7650
|
|
|
7632
7651
|
// src/components/FunCheckoutHistoryModal/FunCheckoutHistoryDetail.tsx
|
|
7633
|
-
import
|
|
7652
|
+
import React72 from "react";
|
|
7634
7653
|
|
|
7635
7654
|
// src/hooks/useCheckoutStateBooleans.ts
|
|
7636
7655
|
import { CheckoutState as CheckoutState4 } from "@funkit/api-base";
|
|
@@ -7712,7 +7731,7 @@ function FunCallToAction({
|
|
|
7712
7731
|
// src/components/FunCheckoutHistoryModal/FunCheckoutHistoryTransaction.tsx
|
|
7713
7732
|
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO5 } from "@funkit/core";
|
|
7714
7733
|
import { useEffect as useEffect21, useRef as useRef9 } from "react";
|
|
7715
|
-
import
|
|
7734
|
+
import React70, { useMemo as useMemo12, useState as useState21 } from "react";
|
|
7716
7735
|
|
|
7717
7736
|
// src/utils/formatTimestamp.ts
|
|
7718
7737
|
var fullMonthNames = [
|
|
@@ -7983,10 +8002,143 @@ var Chain3 = ({
|
|
|
7983
8002
|
};
|
|
7984
8003
|
var Chain_default = Chain3;
|
|
7985
8004
|
|
|
8005
|
+
// src/components/FunAssetAvatar/FunAssetAvatar.tsx
|
|
8006
|
+
import React68, { useMemo as useMemo11 } from "react";
|
|
8007
|
+
|
|
8008
|
+
// src/consts/assets.ts
|
|
8009
|
+
var ASSET_LOGO_SRCS = {
|
|
8010
|
+
ETH: "https://www.iconarchive.com/download/i109534/cjdowner/cryptocurrency-flat/Ethereum-ETH.1024.png",
|
|
8011
|
+
MATIC: "https://altcoinsbox.com/wp-content/uploads/2023/03/matic-logo.webp",
|
|
8012
|
+
ARB: "https://cryptologos.cc/logos/arbitrum-arb-logo.png",
|
|
8013
|
+
LDO: "https://cryptologos.cc/logos/lido-dao-ldo-logo.png",
|
|
8014
|
+
AARBUSDCN: "https://assets.coingecko.com/coins/images/14318/large/aUSDC.e260d492.png?1696514006",
|
|
8015
|
+
CRV: "https://cryptologos.cc/logos/curve-dao-token-crv-logo.png",
|
|
8016
|
+
USDC: "https://cryptologos.cc/logos/usd-coin-usdc-logo.png",
|
|
8017
|
+
USDT: "https://icons.iconarchive.com/icons/cjdowner/cryptocurrency-flat/512/Tether-USDT-icon.png",
|
|
8018
|
+
DAI: "https://cryptologos.cc/logos/multi-collateral-dai-dai-logo.png",
|
|
8019
|
+
WBTC: "https://cryptologos.cc/logos/wrapped-bitcoin-wbtc-logo.png",
|
|
8020
|
+
GRT: "https://cryptologos.cc/logos/the-graph-grt-logo.png",
|
|
8021
|
+
SHIB: "https://cryptologos.cc/logos/shiba-inu-shib-logo.png",
|
|
8022
|
+
QNT: "https://cryptologos.cc/logos/quant-qnt-logo.png",
|
|
8023
|
+
AAVE: "https://cryptologos.cc/logos/aave-aave-logo.png",
|
|
8024
|
+
UNI: "https://cryptologos.cc/logos/uniswap-uni-logo.png",
|
|
8025
|
+
SNX: "https://cryptologos.cc/logos/synthetix-snx-logo.png",
|
|
8026
|
+
CRO: "https://cryptologos.cc/logos/cronos-cro-logo.png",
|
|
8027
|
+
RNDR: "https://altcoinsbox.com/wp-content/uploads/2023/03/render-token-logo.webp",
|
|
8028
|
+
SAND: "https://cdn3d.iconscout.com/3d/premium/thumb/the-sandbox-sand-cryptocurrency-5108582-4263919.png?f=webp",
|
|
8029
|
+
APE: "https://cryptologos.cc/logos/apecoin-ape-ape-logo.png",
|
|
8030
|
+
IMX: "https://cryptologos.cc/logos/immutable-x-imx-logo.png",
|
|
8031
|
+
INJ: "https://cryptologos.cc/logos/injective-inj-logo.png",
|
|
8032
|
+
MKR: "https://cryptologos.cc/logos/maker-mkr-logo.png",
|
|
8033
|
+
LINK: "https://cryptologos.cc/logos/chainlink-link-logo.png",
|
|
8034
|
+
PYUSD: "https://www.paypalobjects.com/devdoc/coin-PYUSD%20220x219.png",
|
|
8035
|
+
DEGEN: "https://assets.coingecko.com/coins/images/34515/large/android-chrome-512x512.png?1706198225",
|
|
8036
|
+
AERO: "https://assets.coingecko.com/coins/images/31745/large/token.png?1696530564",
|
|
8037
|
+
APOLWMATIC: "https://polygonscan.com/token/images/aave_wmatic.png",
|
|
8038
|
+
MFER: "https://assets.coingecko.com/coins/images/36550/large/mfercoin-logo.png?1711876821",
|
|
8039
|
+
$MFER: "https://assets.coingecko.com/coins/images/36550/large/mfercoin-logo.png?1711876821",
|
|
8040
|
+
ROOST: "https://assets.coingecko.com/coins/images/36458/large/roost.jpeg?1711493580",
|
|
8041
|
+
BSHIB: "https://assets.coingecko.com/coins/images/36092/large/logocg.png?1710478223",
|
|
8042
|
+
BRETT: "https://assets.coingecko.com/coins/images/35529/large/1000050750.png?1709031995",
|
|
8043
|
+
BLERF: "https://assets.coingecko.com/coins/images/36473/large/BLERF.png?1711527025",
|
|
8044
|
+
BENTO: "https://assets.coingecko.com/coins/images/37138/large/logo-bento-200-200.png?1713419221",
|
|
8045
|
+
CBETH: "https://assets.coingecko.com/coins/images/27008/large/cbeth.png?1709186989",
|
|
8046
|
+
PENDLE: "https://assets.coingecko.com/coins/images/15069/large/Pendle_Logo_Normal-03.png?1696514728",
|
|
8047
|
+
WEETH: "https://assets.coingecko.com/coins/images/33033/large/weETH.png?1701438396",
|
|
8048
|
+
GMX: "https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/arbitrum/assets/0xfc5A1A6EB076a2C7aD06eD22C90d7E710E35ad0a/logo.png",
|
|
8049
|
+
TYBG: "https://assets.coingecko.com/coins/images/34563/large/tybg.png?1705400778",
|
|
8050
|
+
LUCK: "https://s3.us-west-2.amazonaws.com/sdk-cdn.fun.xyz/images/luck.jpg",
|
|
8051
|
+
WSTETH: "https://assets.coingecko.com/coins/images/18834/large/wstETH.png?1696518295",
|
|
8052
|
+
WETH: "https://www.cryptocompare.com/media/38553079/weth.png",
|
|
8053
|
+
MNT: "https://img.cryptorank.io/coins/mantle1681720399218.png",
|
|
8054
|
+
USDE: "https://holder.io/wp-content/uploads/coins/3/usde--3-74923.png"
|
|
8055
|
+
};
|
|
8056
|
+
|
|
8057
|
+
// src/components/FunAssetAvatar/FunAssetAvatar.css.ts
|
|
8058
|
+
var assetContainerStyle = "uwrdc21";
|
|
8059
|
+
var chainContainerStyle = "uwrdc23 _1rsrm2fju _1rsrm2fu0 _1rsrm2f11 _1rsrm2fi _1rsrm2fx";
|
|
8060
|
+
var containerStyle = "uwrdc20";
|
|
8061
|
+
|
|
8062
|
+
// src/components/FunAssetAvatar/FunAssetAvatar.tsx
|
|
8063
|
+
var fallbackAssetSrc = "https://static1.squarespace.com/static/54735678e4b025d4e207e7b3/t/59605876cd0f689a4a30e51d/1499486328449/Dollar_Circle.png";
|
|
8064
|
+
function FunAssetAvatar({
|
|
8065
|
+
assetSrc,
|
|
8066
|
+
assetTicker,
|
|
8067
|
+
assetName,
|
|
8068
|
+
assetIconSize = "20",
|
|
8069
|
+
chainId,
|
|
8070
|
+
prioritizeDefaults = true,
|
|
8071
|
+
hideIfUnknown = false
|
|
8072
|
+
}) {
|
|
8073
|
+
const chainMetadata = chainMetadataById[parseInt((chainId || "").toString())] || null;
|
|
8074
|
+
const finalAssetSrc = useMemo11(() => {
|
|
8075
|
+
const normalizedTicker = assetTicker?.toUpperCase() || "";
|
|
8076
|
+
const defaultSrc = ASSET_LOGO_SRCS?.[normalizedTicker];
|
|
8077
|
+
if (prioritizeDefaults) {
|
|
8078
|
+
return defaultSrc || assetSrc;
|
|
8079
|
+
} else {
|
|
8080
|
+
return assetSrc || defaultSrc;
|
|
8081
|
+
}
|
|
8082
|
+
}, [assetSrc, assetTicker, prioritizeDefaults]);
|
|
8083
|
+
const showChainIcon = isNotNullish(chainMetadata);
|
|
8084
|
+
const chainIconSize = parseInt(assetIconSize) / 2;
|
|
8085
|
+
return hideIfUnknown && !finalAssetSrc ? null : /* @__PURE__ */ React68.createElement(Box, { id: "container", alignSelf: "center" }, /* @__PURE__ */ React68.createElement(
|
|
8086
|
+
Box,
|
|
8087
|
+
{
|
|
8088
|
+
width: assetIconSize,
|
|
8089
|
+
height: assetIconSize,
|
|
8090
|
+
className: containerStyle
|
|
8091
|
+
},
|
|
8092
|
+
/* @__PURE__ */ React68.createElement(
|
|
8093
|
+
Box,
|
|
8094
|
+
{
|
|
8095
|
+
width: assetIconSize,
|
|
8096
|
+
height: assetIconSize,
|
|
8097
|
+
className: assetContainerStyle
|
|
8098
|
+
},
|
|
8099
|
+
/* @__PURE__ */ React68.createElement(
|
|
8100
|
+
AsyncImage,
|
|
8101
|
+
{
|
|
8102
|
+
alt: assetName,
|
|
8103
|
+
src: finalAssetSrc,
|
|
8104
|
+
fallbackSrc: fallbackAssetSrc,
|
|
8105
|
+
background: void 0,
|
|
8106
|
+
borderColor: "generalBorderDim",
|
|
8107
|
+
borderRadius: "full",
|
|
8108
|
+
height: assetIconSize,
|
|
8109
|
+
width: assetIconSize,
|
|
8110
|
+
testId: `fun-asset-${assetTicker}-icon`,
|
|
8111
|
+
useAsImage: true
|
|
8112
|
+
}
|
|
8113
|
+
)
|
|
8114
|
+
),
|
|
8115
|
+
showChainIcon ? /* @__PURE__ */ React68.createElement(
|
|
8116
|
+
Box,
|
|
8117
|
+
{
|
|
8118
|
+
width: "half",
|
|
8119
|
+
height: "half",
|
|
8120
|
+
className: chainContainerStyle
|
|
8121
|
+
},
|
|
8122
|
+
/* @__PURE__ */ React68.createElement(
|
|
8123
|
+
AsyncImage,
|
|
8124
|
+
{
|
|
8125
|
+
alt: chainMetadata.name,
|
|
8126
|
+
src: chainMetadata.iconUrl || "",
|
|
8127
|
+
background: chainMetadata.iconBackground,
|
|
8128
|
+
borderRadius: "1",
|
|
8129
|
+
height: chainIconSize - 2,
|
|
8130
|
+
width: chainIconSize - 2,
|
|
8131
|
+
testId: `fun-asset-chain-${chainId}-icon`
|
|
8132
|
+
}
|
|
8133
|
+
)
|
|
8134
|
+
) : null
|
|
8135
|
+
));
|
|
8136
|
+
}
|
|
8137
|
+
|
|
7986
8138
|
// src/components/Icons/StatusIcons.tsx
|
|
7987
|
-
import
|
|
8139
|
+
import React69 from "react";
|
|
7988
8140
|
var CompletedStatusIcon = ({ size = 14 }) => {
|
|
7989
|
-
return /* @__PURE__ */
|
|
8141
|
+
return /* @__PURE__ */ React69.createElement(
|
|
7990
8142
|
"svg",
|
|
7991
8143
|
{
|
|
7992
8144
|
width: size,
|
|
@@ -7995,21 +8147,21 @@ var CompletedStatusIcon = ({ size = 14 }) => {
|
|
|
7995
8147
|
fill: "none",
|
|
7996
8148
|
xmlns: "http://www.w3.org/2000/svg"
|
|
7997
8149
|
},
|
|
7998
|
-
/* @__PURE__ */
|
|
8150
|
+
/* @__PURE__ */ React69.createElement(
|
|
7999
8151
|
"path",
|
|
8000
8152
|
{
|
|
8001
8153
|
d: "M3.69434 3.69141H12.3097V12.3068H3.69434V3.69141Z",
|
|
8002
8154
|
fill: "white"
|
|
8003
8155
|
}
|
|
8004
8156
|
),
|
|
8005
|
-
/* @__PURE__ */
|
|
8157
|
+
/* @__PURE__ */ React69.createElement(
|
|
8006
8158
|
"path",
|
|
8007
8159
|
{
|
|
8008
8160
|
d: "M15.6943 7.84615C15.6943 12.1795 12.1814 15.6923 7.84811 15.6923C3.5148 15.6923 0.00195312 12.1795 0.00195312 7.84615C0.00195312 3.51284 3.5148 0 7.84811 0C12.1814 0 15.6943 3.51284 15.6943 7.84615Z",
|
|
8009
8161
|
fill: "#2AA344"
|
|
8010
8162
|
}
|
|
8011
8163
|
),
|
|
8012
|
-
/* @__PURE__ */
|
|
8164
|
+
/* @__PURE__ */ React69.createElement(
|
|
8013
8165
|
"path",
|
|
8014
8166
|
{
|
|
8015
8167
|
fillRule: "evenodd",
|
|
@@ -8021,7 +8173,7 @@ var CompletedStatusIcon = ({ size = 14 }) => {
|
|
|
8021
8173
|
);
|
|
8022
8174
|
};
|
|
8023
8175
|
var PendingStatusIcon = ({ size = 14 }) => {
|
|
8024
|
-
return /* @__PURE__ */
|
|
8176
|
+
return /* @__PURE__ */ React69.createElement(
|
|
8025
8177
|
"svg",
|
|
8026
8178
|
{
|
|
8027
8179
|
width: size,
|
|
@@ -8030,7 +8182,7 @@ var PendingStatusIcon = ({ size = 14 }) => {
|
|
|
8030
8182
|
fill: "none",
|
|
8031
8183
|
xmlns: "http://www.w3.org/2000/svg"
|
|
8032
8184
|
},
|
|
8033
|
-
/* @__PURE__ */
|
|
8185
|
+
/* @__PURE__ */ React69.createElement(
|
|
8034
8186
|
"rect",
|
|
8035
8187
|
{
|
|
8036
8188
|
x: "3.69336",
|
|
@@ -8040,8 +8192,8 @@ var PendingStatusIcon = ({ size = 14 }) => {
|
|
|
8040
8192
|
fill: "white"
|
|
8041
8193
|
}
|
|
8042
8194
|
),
|
|
8043
|
-
/* @__PURE__ */
|
|
8044
|
-
/* @__PURE__ */
|
|
8195
|
+
/* @__PURE__ */ React69.createElement("circle", { cx: "7.84713", cy: "7.84615", r: "7.84615", fill: "#F6851B" }),
|
|
8196
|
+
/* @__PURE__ */ React69.createElement(
|
|
8045
8197
|
"path",
|
|
8046
8198
|
{
|
|
8047
8199
|
d: "M7.68167 5L7.68167 8.27967L9.50491 9.91071",
|
|
@@ -8054,7 +8206,7 @@ var PendingStatusIcon = ({ size = 14 }) => {
|
|
|
8054
8206
|
);
|
|
8055
8207
|
};
|
|
8056
8208
|
var FailedStatusIcon = ({ size = 14 }) => {
|
|
8057
|
-
return /* @__PURE__ */
|
|
8209
|
+
return /* @__PURE__ */ React69.createElement(
|
|
8058
8210
|
"svg",
|
|
8059
8211
|
{
|
|
8060
8212
|
width: size,
|
|
@@ -8063,7 +8215,7 @@ var FailedStatusIcon = ({ size = 14 }) => {
|
|
|
8063
8215
|
fill: "none",
|
|
8064
8216
|
xmlns: "http://www.w3.org/2000/svg"
|
|
8065
8217
|
},
|
|
8066
|
-
/* @__PURE__ */
|
|
8218
|
+
/* @__PURE__ */ React69.createElement(
|
|
8067
8219
|
"rect",
|
|
8068
8220
|
{
|
|
8069
8221
|
x: "3.69336",
|
|
@@ -8073,8 +8225,8 @@ var FailedStatusIcon = ({ size = 14 }) => {
|
|
|
8073
8225
|
fill: "white"
|
|
8074
8226
|
}
|
|
8075
8227
|
),
|
|
8076
|
-
/* @__PURE__ */
|
|
8077
|
-
/* @__PURE__ */
|
|
8228
|
+
/* @__PURE__ */ React69.createElement("circle", { cx: "7.84615", cy: "7.84615", r: "7.84615", fill: "#F34126" }),
|
|
8229
|
+
/* @__PURE__ */ React69.createElement(
|
|
8078
8230
|
"path",
|
|
8079
8231
|
{
|
|
8080
8232
|
d: "M6 6L10 10",
|
|
@@ -8083,7 +8235,7 @@ var FailedStatusIcon = ({ size = 14 }) => {
|
|
|
8083
8235
|
strokeLinecap: "round"
|
|
8084
8236
|
}
|
|
8085
8237
|
),
|
|
8086
|
-
/* @__PURE__ */
|
|
8238
|
+
/* @__PURE__ */ React69.createElement(
|
|
8087
8239
|
"path",
|
|
8088
8240
|
{
|
|
8089
8241
|
d: "M10 6L6 10",
|
|
@@ -8101,8 +8253,9 @@ var ContentExpanded = "_8bejan0";
|
|
|
8101
8253
|
var Divider = "_8bejan2";
|
|
8102
8254
|
|
|
8103
8255
|
// src/components/FunCheckoutHistoryModal/FunCheckoutHistoryTransaction.tsx
|
|
8256
|
+
var fallbackAssetSrc2 = "https://static1.squarespace.com/static/54735678e4b025d4e207e7b3/t/59605876cd0f689a4a30e51d/1499486328449/Dollar_Circle.png";
|
|
8104
8257
|
function FunTxSummaryBox({ children }) {
|
|
8105
|
-
return /* @__PURE__ */
|
|
8258
|
+
return /* @__PURE__ */ React70.createElement(
|
|
8106
8259
|
Box,
|
|
8107
8260
|
{
|
|
8108
8261
|
background: "offBackground",
|
|
@@ -8120,7 +8273,7 @@ function FunTxSummaryBox({ children }) {
|
|
|
8120
8273
|
);
|
|
8121
8274
|
}
|
|
8122
8275
|
function FunTxSummaryLineItem({ children, ...otherProps }) {
|
|
8123
|
-
return /* @__PURE__ */
|
|
8276
|
+
return /* @__PURE__ */ React70.createElement(
|
|
8124
8277
|
Box,
|
|
8125
8278
|
{
|
|
8126
8279
|
display: "flex",
|
|
@@ -8139,7 +8292,7 @@ function FunTxSummaryCollapsibleBox({
|
|
|
8139
8292
|
isExpanded,
|
|
8140
8293
|
children
|
|
8141
8294
|
}) {
|
|
8142
|
-
return /* @__PURE__ */
|
|
8295
|
+
return /* @__PURE__ */ React70.createElement(
|
|
8143
8296
|
Box,
|
|
8144
8297
|
{
|
|
8145
8298
|
display: "flex",
|
|
@@ -8151,7 +8304,7 @@ function FunTxSummaryCollapsibleBox({
|
|
|
8151
8304
|
);
|
|
8152
8305
|
}
|
|
8153
8306
|
function FunTxSummaryLineItemKeyText({ text }) {
|
|
8154
|
-
return /* @__PURE__ */
|
|
8307
|
+
return /* @__PURE__ */ React70.createElement(
|
|
8155
8308
|
Text,
|
|
8156
8309
|
{
|
|
8157
8310
|
weight: "medium",
|
|
@@ -8166,7 +8319,7 @@ function StatusTag({
|
|
|
8166
8319
|
type
|
|
8167
8320
|
}) {
|
|
8168
8321
|
const color = type === "failed" || type === "expired" ? "error" : type === "processing" ? "standby" : "buttonSuccess";
|
|
8169
|
-
return /* @__PURE__ */
|
|
8322
|
+
return /* @__PURE__ */ React70.createElement(Box, { display: "flex", alignItems: "center", gap: "4", justifyContent: "flex-end" }, type === "failed" || type === "expired" ? /* @__PURE__ */ React70.createElement(FailedStatusIcon, null) : type === "processing" ? /* @__PURE__ */ React70.createElement(PendingStatusIcon, null) : /* @__PURE__ */ React70.createElement(CompletedStatusIcon, null), /* @__PURE__ */ React70.createElement(Text, { color, size: "12", weight: "medium" }, type.charAt(0).toUpperCase() + type.slice(1)));
|
|
8170
8323
|
}
|
|
8171
8324
|
function FunTxSummaryHistory({
|
|
8172
8325
|
checkoutHistoryItem
|
|
@@ -8176,29 +8329,65 @@ function FunTxSummaryHistory({
|
|
|
8176
8329
|
);
|
|
8177
8330
|
const checkoutItem = checkoutHistoryItem.clientMetadata;
|
|
8178
8331
|
const checkoutConfig = checkoutItem.initSettings.config;
|
|
8179
|
-
const
|
|
8332
|
+
const sourceSymbol = checkoutItem.selectedSourceAssetInfo.symbol;
|
|
8333
|
+
const sourceAmount = sourceSymbol ? formatCryptoAndStringify(
|
|
8180
8334
|
Number(checkoutItem.latestQuote?.finalPaymentTokenAmount) || 0,
|
|
8181
|
-
|
|
8335
|
+
sourceSymbol
|
|
8182
8336
|
) : formatCurrencyAndStringify(
|
|
8183
8337
|
checkoutItem.finalDollarValue || checkoutItem.draftDollarValue || 0
|
|
8184
8338
|
);
|
|
8185
8339
|
const targetAmount = getCheckoutItemDisplay(checkoutConfig, checkoutItem);
|
|
8186
|
-
return /* @__PURE__ */
|
|
8340
|
+
return /* @__PURE__ */ React70.createElement(React70.Fragment, null, /* @__PURE__ */ React70.createElement(FunTxSummaryBox, null, /* @__PURE__ */ React70.createElement(FunTxSummaryLineItem, null, /* @__PURE__ */ React70.createElement(FunTxSummaryLineItemKeyText, { text: "Status" }), /* @__PURE__ */ React70.createElement(
|
|
8187
8341
|
StatusTag,
|
|
8188
8342
|
{
|
|
8189
8343
|
type: isExpired ? "expired" : isError ? "failed" : isCompleted ? "completed" : "processing"
|
|
8190
8344
|
}
|
|
8191
|
-
)), /* @__PURE__ */
|
|
8345
|
+
)), /* @__PURE__ */ React70.createElement(Box, { className: Divider, borderColor: "hoverState" }), /* @__PURE__ */ React70.createElement(FunTxSummaryLineItem, null, /* @__PURE__ */ React70.createElement(FunTxSummaryLineItemKeyText, { text: "Pay" }), /* @__PURE__ */ React70.createElement(Box, { display: "flex", alignItems: "center", gap: "5" }, sourceSymbol && /* @__PURE__ */ React70.createElement(
|
|
8346
|
+
FunAssetAvatar,
|
|
8347
|
+
{
|
|
8348
|
+
assetIconSize: "15",
|
|
8349
|
+
assetTicker: sourceSymbol,
|
|
8350
|
+
assetName: sourceSymbol,
|
|
8351
|
+
hideIfUnknown: true
|
|
8352
|
+
}
|
|
8353
|
+
), /* @__PURE__ */ React70.createElement(
|
|
8354
|
+
Text,
|
|
8355
|
+
{
|
|
8356
|
+
size: "12",
|
|
8357
|
+
weight: "medium",
|
|
8358
|
+
color: "primaryText",
|
|
8359
|
+
textAlign: "right"
|
|
8360
|
+
},
|
|
8361
|
+
sourceAmount
|
|
8362
|
+
))), /* @__PURE__ */ React70.createElement(Box, { className: Divider, borderColor: "hoverState" }), /* @__PURE__ */ React70.createElement(FunTxSummaryLineItem, null, /* @__PURE__ */ React70.createElement(FunTxSummaryLineItemKeyText, { text: "Receive" }), /* @__PURE__ */ React70.createElement(Box, { display: "flex", gap: "5", alignItems: "center" }, /* @__PURE__ */ React70.createElement(
|
|
8363
|
+
AsyncImage,
|
|
8364
|
+
{
|
|
8365
|
+
src: checkoutConfig.iconSrc ?? fallbackAssetSrc2,
|
|
8366
|
+
fallbackSrc: fallbackAssetSrc2,
|
|
8367
|
+
width: 15,
|
|
8368
|
+
height: 15,
|
|
8369
|
+
useAsImage: true
|
|
8370
|
+
}
|
|
8371
|
+
), /* @__PURE__ */ React70.createElement(
|
|
8372
|
+
Text,
|
|
8373
|
+
{
|
|
8374
|
+
size: "12",
|
|
8375
|
+
weight: "medium",
|
|
8376
|
+
color: "primaryText",
|
|
8377
|
+
textAlign: "right"
|
|
8378
|
+
},
|
|
8379
|
+
targetAmount
|
|
8380
|
+
)))));
|
|
8192
8381
|
}
|
|
8193
8382
|
function OrderDetail({
|
|
8194
8383
|
checkoutHistoryItem
|
|
8195
8384
|
}) {
|
|
8196
|
-
const [isExpanded, setIsExpanded] =
|
|
8197
|
-
const [hasScrolled, setHasScrolled] =
|
|
8385
|
+
const [isExpanded, setIsExpanded] = useState21(false);
|
|
8386
|
+
const [hasScrolled, setHasScrolled] = useState21(false);
|
|
8198
8387
|
const contentRef = useRef9(null);
|
|
8199
8388
|
const { isProcessing, isError, isExpired, isTerminal, isCompleted } = useCheckoutStateBooleans(checkoutHistoryItem.state);
|
|
8200
8389
|
const checkoutItem = checkoutHistoryItem.clientMetadata;
|
|
8201
|
-
const estimatedEndTimeInfo =
|
|
8390
|
+
const estimatedEndTimeInfo = useMemo12(() => {
|
|
8202
8391
|
return getEstimateEndTimeInfo(
|
|
8203
8392
|
checkoutHistoryItem.createdTimeMs,
|
|
8204
8393
|
checkoutItem
|
|
@@ -8215,7 +8404,7 @@ function OrderDetail({
|
|
|
8215
8404
|
}, [isExpanded, hasScrolled]);
|
|
8216
8405
|
const fromExplorerInfo = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO5[checkoutHistoryItem.fromChainId].explorerInfo;
|
|
8217
8406
|
const toExplorerInfo = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO5[checkoutHistoryItem.toChainId].explorerInfo;
|
|
8218
|
-
return /* @__PURE__ */
|
|
8407
|
+
return /* @__PURE__ */ React70.createElement(Box, { ref: contentRef }, /* @__PURE__ */ React70.createElement(
|
|
8219
8408
|
Box,
|
|
8220
8409
|
{
|
|
8221
8410
|
display: "flex",
|
|
@@ -8225,9 +8414,9 @@ function OrderDetail({
|
|
|
8225
8414
|
marginBottom: "8",
|
|
8226
8415
|
alignItems: "center"
|
|
8227
8416
|
},
|
|
8228
|
-
/* @__PURE__ */
|
|
8229
|
-
/* @__PURE__ */
|
|
8230
|
-
), /* @__PURE__ */
|
|
8417
|
+
/* @__PURE__ */ React70.createElement(Text, { size: "12", weight: "medium", color: "tertiaryText" }, "More details"),
|
|
8418
|
+
/* @__PURE__ */ React70.createElement(Text, { color: "tertiaryText" }, /* @__PURE__ */ React70.createElement(ArrowIcon, { size: 10, direction: isExpanded ? "down" : "right" }))
|
|
8419
|
+
), /* @__PURE__ */ React70.createElement(FunTxSummaryCollapsibleBox, { isExpanded }, /* @__PURE__ */ React70.createElement(FunTxSummaryBox, null, /* @__PURE__ */ React70.createElement(FunTxSummaryLineItem, null, /* @__PURE__ */ React70.createElement(FunTxSummaryLineItemKeyText, { text: "Deposit address" }), /* @__PURE__ */ React70.createElement(
|
|
8231
8420
|
Box,
|
|
8232
8421
|
{
|
|
8233
8422
|
display: "flex",
|
|
@@ -8235,7 +8424,7 @@ function OrderDetail({
|
|
|
8235
8424
|
alignItems: "center",
|
|
8236
8425
|
gap: "4"
|
|
8237
8426
|
},
|
|
8238
|
-
/* @__PURE__ */
|
|
8427
|
+
/* @__PURE__ */ React70.createElement(
|
|
8239
8428
|
Box,
|
|
8240
8429
|
{
|
|
8241
8430
|
fontFamily: "body",
|
|
@@ -8243,7 +8432,7 @@ function OrderDetail({
|
|
|
8243
8432
|
fontWeight: "medium",
|
|
8244
8433
|
color: "primaryText"
|
|
8245
8434
|
},
|
|
8246
|
-
/* @__PURE__ */
|
|
8435
|
+
/* @__PURE__ */ React70.createElement(
|
|
8247
8436
|
ChainLineItem,
|
|
8248
8437
|
{
|
|
8249
8438
|
chainId: Number(checkoutHistoryItem.fromChainId),
|
|
@@ -8253,7 +8442,7 @@ function OrderDetail({
|
|
|
8253
8442
|
}
|
|
8254
8443
|
)
|
|
8255
8444
|
),
|
|
8256
|
-
/* @__PURE__ */
|
|
8445
|
+
/* @__PURE__ */ React70.createElement(
|
|
8257
8446
|
Text,
|
|
8258
8447
|
{
|
|
8259
8448
|
size: "12",
|
|
@@ -8264,13 +8453,13 @@ function OrderDetail({
|
|
|
8264
8453
|
" ",
|
|
8265
8454
|
formatAddress(checkoutHistoryItem.depositAddr)
|
|
8266
8455
|
),
|
|
8267
|
-
/* @__PURE__ */
|
|
8456
|
+
/* @__PURE__ */ React70.createElement(
|
|
8268
8457
|
FunRedirectButton,
|
|
8269
8458
|
{
|
|
8270
8459
|
to: `${fromExplorerInfo.url}/address/${checkoutHistoryItem.depositAddr}`
|
|
8271
8460
|
}
|
|
8272
8461
|
)
|
|
8273
|
-
)), isCompleted ? /* @__PURE__ */
|
|
8462
|
+
)), isCompleted ? /* @__PURE__ */ React70.createElement(React70.Fragment, null, /* @__PURE__ */ React70.createElement(Box, { className: Divider, borderColor: "hoverState" }), /* @__PURE__ */ React70.createElement(FunTxSummaryLineItem, null, /* @__PURE__ */ React70.createElement(FunTxSummaryLineItemKeyText, { text: "Destination address" }), /* @__PURE__ */ React70.createElement(
|
|
8274
8463
|
Box,
|
|
8275
8464
|
{
|
|
8276
8465
|
display: "flex",
|
|
@@ -8278,7 +8467,7 @@ function OrderDetail({
|
|
|
8278
8467
|
alignItems: "center",
|
|
8279
8468
|
gap: "4"
|
|
8280
8469
|
},
|
|
8281
|
-
/* @__PURE__ */
|
|
8470
|
+
/* @__PURE__ */ React70.createElement(
|
|
8282
8471
|
Box,
|
|
8283
8472
|
{
|
|
8284
8473
|
fontFamily: "body",
|
|
@@ -8286,7 +8475,7 @@ function OrderDetail({
|
|
|
8286
8475
|
fontWeight: "medium",
|
|
8287
8476
|
color: "primaryText"
|
|
8288
8477
|
},
|
|
8289
|
-
/* @__PURE__ */
|
|
8478
|
+
/* @__PURE__ */ React70.createElement(
|
|
8290
8479
|
ChainLineItem,
|
|
8291
8480
|
{
|
|
8292
8481
|
chainId: Number(checkoutHistoryItem.toChainId),
|
|
@@ -8296,7 +8485,7 @@ function OrderDetail({
|
|
|
8296
8485
|
}
|
|
8297
8486
|
)
|
|
8298
8487
|
),
|
|
8299
|
-
/* @__PURE__ */
|
|
8488
|
+
/* @__PURE__ */ React70.createElement(
|
|
8300
8489
|
Text,
|
|
8301
8490
|
{
|
|
8302
8491
|
size: "12",
|
|
@@ -8307,13 +8496,13 @@ function OrderDetail({
|
|
|
8307
8496
|
" ",
|
|
8308
8497
|
formatAddress(checkoutHistoryItem.recipientAddr)
|
|
8309
8498
|
),
|
|
8310
|
-
/* @__PURE__ */
|
|
8499
|
+
/* @__PURE__ */ React70.createElement(
|
|
8311
8500
|
FunRedirectButton,
|
|
8312
8501
|
{
|
|
8313
8502
|
to: `${toExplorerInfo.url}/address/${checkoutHistoryItem.recipientAddr}`
|
|
8314
8503
|
}
|
|
8315
8504
|
)
|
|
8316
|
-
))) : null), /* @__PURE__ */
|
|
8505
|
+
))) : null), /* @__PURE__ */ React70.createElement(FunTxSummaryBox, null, /* @__PURE__ */ React70.createElement(FunTxSummaryLineItem, null, /* @__PURE__ */ React70.createElement(FunTxSummaryLineItemKeyText, { text: "Order submitted" }), /* @__PURE__ */ React70.createElement(
|
|
8317
8506
|
Text,
|
|
8318
8507
|
{
|
|
8319
8508
|
color: "primaryText",
|
|
@@ -8326,12 +8515,12 @@ function OrderDetail({
|
|
|
8326
8515
|
year: "none",
|
|
8327
8516
|
month: "short"
|
|
8328
8517
|
})
|
|
8329
|
-
)), /* @__PURE__ */
|
|
8518
|
+
)), /* @__PURE__ */ React70.createElement(Box, { className: Divider, borderColor: "hoverState" }), /* @__PURE__ */ React70.createElement(FunTxSummaryLineItem, null, /* @__PURE__ */ React70.createElement(
|
|
8330
8519
|
FunTxSummaryLineItemKeyText,
|
|
8331
8520
|
{
|
|
8332
8521
|
text: isError ? "Order failed" : isExpired ? "Order expired" : isProcessing ? "Order delivery" : "Order filled"
|
|
8333
8522
|
}
|
|
8334
|
-
), /* @__PURE__ */
|
|
8523
|
+
), /* @__PURE__ */ React70.createElement(
|
|
8335
8524
|
Text,
|
|
8336
8525
|
{
|
|
8337
8526
|
color: "primaryText",
|
|
@@ -8358,27 +8547,27 @@ function OrderDetail({
|
|
|
8358
8547
|
}
|
|
8359
8548
|
|
|
8360
8549
|
// src/components/FunCheckoutHistoryModal/FunCheckoutStatus.tsx
|
|
8361
|
-
import
|
|
8550
|
+
import React71, { useMemo as useMemo13 } from "react";
|
|
8362
8551
|
function FunCheckoutStatus({
|
|
8363
8552
|
checkoutHistoryItem
|
|
8364
8553
|
}) {
|
|
8365
8554
|
const { isCompleted, isFailed } = useCheckoutStateBooleans(
|
|
8366
8555
|
checkoutHistoryItem.state
|
|
8367
8556
|
);
|
|
8368
|
-
return /* @__PURE__ */
|
|
8557
|
+
return /* @__PURE__ */ React71.createElement(Box, { display: "flex", justifyContent: "center" }, isCompleted ? /* @__PURE__ */ React71.createElement(CompletedStatusIcon, { size: 74 }) : isFailed ? /* @__PURE__ */ React71.createElement(FailedStatusIcon, { size: 74 }) : /* @__PURE__ */ React71.createElement(PendingStatus, { checkoutHistoryItem }));
|
|
8369
8558
|
}
|
|
8370
8559
|
function PendingStatus({ checkoutHistoryItem }) {
|
|
8371
8560
|
const checkoutItem = checkoutHistoryItem.clientMetadata;
|
|
8372
8561
|
const totalSeconds = Math.ceil(
|
|
8373
8562
|
(checkoutItem?.latestQuote?.finalTimeEstimationMs || 0) / 1e3
|
|
8374
8563
|
);
|
|
8375
|
-
const estimatedEndTimeInfo =
|
|
8564
|
+
const estimatedEndTimeInfo = useMemo13(() => {
|
|
8376
8565
|
return getEstimateEndTimeInfo(
|
|
8377
8566
|
checkoutHistoryItem.createdTimeMs,
|
|
8378
8567
|
checkoutItem
|
|
8379
8568
|
);
|
|
8380
8569
|
}, [checkoutItem, checkoutHistoryItem.createdTimeMs]);
|
|
8381
|
-
return /* @__PURE__ */
|
|
8570
|
+
return /* @__PURE__ */ React71.createElement(
|
|
8382
8571
|
FunCountdown,
|
|
8383
8572
|
{
|
|
8384
8573
|
strokeWidth: 3,
|
|
@@ -8388,7 +8577,7 @@ function PendingStatus({ checkoutHistoryItem }) {
|
|
|
8388
8577
|
),
|
|
8389
8578
|
countdownSeconds: totalSeconds
|
|
8390
8579
|
},
|
|
8391
|
-
(remainingSeconds) => /* @__PURE__ */
|
|
8580
|
+
(remainingSeconds) => /* @__PURE__ */ React71.createElement(Box, { display: "flex", flexDirection: "column", alignItems: "center" }, /* @__PURE__ */ React71.createElement(Text, { size: "10", color: "tertiaryText" }, remainingSeconds > 0 ? "Processing" : "Order delayed"), /* @__PURE__ */ React71.createElement(Text, { size: "13", color: "primaryText" }, formatSecondsToCountdownForm(remainingSeconds)))
|
|
8392
8581
|
);
|
|
8393
8582
|
}
|
|
8394
8583
|
|
|
@@ -8403,7 +8592,7 @@ function FunCheckoutHistoryDetail({
|
|
|
8403
8592
|
useCheckoutHistoryListener(isProcessing, checkoutHistoryInfo.depositAddr);
|
|
8404
8593
|
useWalletAssetsListener(isProcessing || isCompleted);
|
|
8405
8594
|
const GetHelpButton = ({ text = "Get Help \u{1F449}" }) => {
|
|
8406
|
-
return /* @__PURE__ */
|
|
8595
|
+
return /* @__PURE__ */ React72.createElement(
|
|
8407
8596
|
FunLinkButton,
|
|
8408
8597
|
{
|
|
8409
8598
|
hasPadding: false,
|
|
@@ -8414,15 +8603,15 @@ function FunCheckoutHistoryDetail({
|
|
|
8414
8603
|
}
|
|
8415
8604
|
);
|
|
8416
8605
|
};
|
|
8417
|
-
return /* @__PURE__ */
|
|
8606
|
+
return /* @__PURE__ */ React72.createElement(Box, { display: "flex", flexDirection: "column", gap: "24" }, /* @__PURE__ */ React72.createElement(Box, { display: "flex", flexDirection: "column", gap: "24" }, /* @__PURE__ */ React72.createElement(FunCheckoutStatus, { checkoutHistoryItem: checkoutHistoryInfo }), /* @__PURE__ */ React72.createElement(FunTxSummaryHistory, { checkoutHistoryItem: checkoutHistoryInfo })), isFailed ? /* @__PURE__ */ React72.createElement(
|
|
8418
8607
|
FunCallToAction,
|
|
8419
8608
|
{
|
|
8420
8609
|
badgeText: "Notice",
|
|
8421
8610
|
badgeColor: "buttonTextWarning",
|
|
8422
8611
|
badgeBackground: "standby"
|
|
8423
8612
|
},
|
|
8424
|
-
/* @__PURE__ */
|
|
8425
|
-
/* @__PURE__ */
|
|
8613
|
+
/* @__PURE__ */ React72.createElement(Text, { size: "13", weight: "medium", color: "primaryText" }, "A problem occurred processing your purchase. We are actively working to resolve this."),
|
|
8614
|
+
/* @__PURE__ */ React72.createElement(
|
|
8426
8615
|
FunLinkButton,
|
|
8427
8616
|
{
|
|
8428
8617
|
hasPadding: false,
|
|
@@ -8434,22 +8623,22 @@ function FunCheckoutHistoryDetail({
|
|
|
8434
8623
|
onClick: () => setCurrentPage("help" /* HELP */)
|
|
8435
8624
|
}
|
|
8436
8625
|
)
|
|
8437
|
-
) : null, /* @__PURE__ */
|
|
8626
|
+
) : null, /* @__PURE__ */ React72.createElement(FunDivider, null), /* @__PURE__ */ React72.createElement(OrderDetail, { checkoutHistoryItem: checkoutHistoryInfo }), !isFailed ? /* @__PURE__ */ React72.createElement(
|
|
8438
8627
|
FunAlert,
|
|
8439
8628
|
{
|
|
8440
8629
|
icon: null,
|
|
8441
|
-
description: /* @__PURE__ */
|
|
8630
|
+
description: /* @__PURE__ */ React72.createElement(Text, { size: "10", color: "secondaryText" }, "Need help? ", /* @__PURE__ */ React72.createElement(GetHelpButton, { text: "Contact us" }))
|
|
8442
8631
|
}
|
|
8443
8632
|
) : null);
|
|
8444
8633
|
}
|
|
8445
8634
|
|
|
8446
8635
|
// src/components/FunCheckoutHistoryModal/FunCheckoutHistoryHelp.tsx
|
|
8447
8636
|
import { sendSupportMessage } from "@funkit/api-base";
|
|
8448
|
-
import
|
|
8637
|
+
import React79, { useEffect as useEffect23, useMemo as useMemo15, useRef as useRef11, useState as useState23 } from "react";
|
|
8449
8638
|
import { createPortal as createPortal2 } from "react-dom";
|
|
8450
8639
|
|
|
8451
8640
|
// src/components/FunInput/FunTextAreaInput.tsx
|
|
8452
|
-
import
|
|
8641
|
+
import React73 from "react";
|
|
8453
8642
|
function FunTextAreaInput({
|
|
8454
8643
|
placeholder,
|
|
8455
8644
|
value,
|
|
@@ -8463,9 +8652,10 @@ function FunTextAreaInput({
|
|
|
8463
8652
|
type: "text"
|
|
8464
8653
|
},
|
|
8465
8654
|
error,
|
|
8466
|
-
overrideBorderWidth
|
|
8655
|
+
overrideBorderWidth,
|
|
8656
|
+
overrideBackground
|
|
8467
8657
|
}) {
|
|
8468
|
-
const [focused, setFocused] =
|
|
8658
|
+
const [focused, setFocused] = React73.useState(false);
|
|
8469
8659
|
const onFocus = () => setFocused(true);
|
|
8470
8660
|
const onBlur = () => setFocused(false);
|
|
8471
8661
|
const getBorderColor = () => {
|
|
@@ -8477,7 +8667,7 @@ function FunTextAreaInput({
|
|
|
8477
8667
|
hover: "inputBorderHover"
|
|
8478
8668
|
};
|
|
8479
8669
|
};
|
|
8480
|
-
return /* @__PURE__ */
|
|
8670
|
+
return /* @__PURE__ */ React73.createElement(Box, { color: "primaryText", display: "flex", flexDirection: "column", gap: "8" }, label && /* @__PURE__ */ React73.createElement(Text, { color: textColor, size: "10", weight: "medium" }, label), /* @__PURE__ */ React73.createElement(
|
|
8481
8671
|
Box,
|
|
8482
8672
|
{
|
|
8483
8673
|
borderRadius: "connectButton",
|
|
@@ -8491,9 +8681,10 @@ function FunTextAreaInput({
|
|
|
8491
8681
|
borderColor: getBorderColor(),
|
|
8492
8682
|
borderWidth: overrideBorderWidth ?? "1",
|
|
8493
8683
|
borderStyle: "solid",
|
|
8494
|
-
padding: "4"
|
|
8684
|
+
padding: "4",
|
|
8685
|
+
background: overrideBackground || "inputBackground"
|
|
8495
8686
|
},
|
|
8496
|
-
/* @__PURE__ */
|
|
8687
|
+
/* @__PURE__ */ React73.createElement(
|
|
8497
8688
|
"textarea",
|
|
8498
8689
|
{
|
|
8499
8690
|
type: inputProps?.type || "text",
|
|
@@ -8521,11 +8712,11 @@ function FunTextAreaInput({
|
|
|
8521
8712
|
}
|
|
8522
8713
|
}
|
|
8523
8714
|
)
|
|
8524
|
-
), error && typeof error === "string" && /* @__PURE__ */
|
|
8715
|
+
), error && typeof error === "string" && /* @__PURE__ */ React73.createElement(Text, { color: "error", size: "14", weight: "medium" }, error));
|
|
8525
8716
|
}
|
|
8526
8717
|
|
|
8527
8718
|
// src/components/FunNotification/FunNotification.tsx
|
|
8528
|
-
import
|
|
8719
|
+
import React74 from "react";
|
|
8529
8720
|
function FunNotification({
|
|
8530
8721
|
type = "default",
|
|
8531
8722
|
description,
|
|
@@ -8537,7 +8728,7 @@ function FunNotification({
|
|
|
8537
8728
|
}) {
|
|
8538
8729
|
const isVisible = isVisibleProps ?? true;
|
|
8539
8730
|
const isPermanent = isVisibleProps == void 0;
|
|
8540
|
-
return /* @__PURE__ */
|
|
8731
|
+
return /* @__PURE__ */ React74.createElement(
|
|
8541
8732
|
Box,
|
|
8542
8733
|
{
|
|
8543
8734
|
display: "flex",
|
|
@@ -8547,7 +8738,7 @@ function FunNotification({
|
|
|
8547
8738
|
marginBottom: isPermanent ? void 0 : isVisible ? "8" : "0",
|
|
8548
8739
|
...containerProps
|
|
8549
8740
|
},
|
|
8550
|
-
/* @__PURE__ */
|
|
8741
|
+
/* @__PURE__ */ React74.createElement(
|
|
8551
8742
|
Box,
|
|
8552
8743
|
{
|
|
8553
8744
|
display: "flex",
|
|
@@ -8556,7 +8747,7 @@ function FunNotification({
|
|
|
8556
8747
|
width: "full",
|
|
8557
8748
|
gap: "2"
|
|
8558
8749
|
},
|
|
8559
|
-
/* @__PURE__ */
|
|
8750
|
+
/* @__PURE__ */ React74.createElement(
|
|
8560
8751
|
Text,
|
|
8561
8752
|
{
|
|
8562
8753
|
size: "10",
|
|
@@ -8567,17 +8758,17 @@ function FunNotification({
|
|
|
8567
8758
|
},
|
|
8568
8759
|
description
|
|
8569
8760
|
),
|
|
8570
|
-
actionText ? /* @__PURE__ */
|
|
8761
|
+
actionText ? /* @__PURE__ */ React74.createElement(FunButton, { type: "secondary", title: actionText, onClick: onAction }) : null
|
|
8571
8762
|
)
|
|
8572
8763
|
);
|
|
8573
8764
|
}
|
|
8574
8765
|
|
|
8575
8766
|
// src/components/FunSelect/FunSelect.tsx
|
|
8576
|
-
import
|
|
8767
|
+
import React77, { useMemo as useMemo14, useState as useState22 } from "react";
|
|
8577
8768
|
|
|
8578
8769
|
// src/components/Icons/SelectDropdownIcon.tsx
|
|
8579
|
-
import
|
|
8580
|
-
var SelectDropdownIcon = () => /* @__PURE__ */
|
|
8770
|
+
import React75 from "react";
|
|
8771
|
+
var SelectDropdownIcon = () => /* @__PURE__ */ React75.createElement(
|
|
8581
8772
|
"svg",
|
|
8582
8773
|
{
|
|
8583
8774
|
width: "7",
|
|
@@ -8586,8 +8777,8 @@ var SelectDropdownIcon = () => /* @__PURE__ */ React74.createElement(
|
|
|
8586
8777
|
fill: "none",
|
|
8587
8778
|
xmlns: "http://www.w3.org/2000/svg"
|
|
8588
8779
|
},
|
|
8589
|
-
/* @__PURE__ */
|
|
8590
|
-
/* @__PURE__ */
|
|
8780
|
+
/* @__PURE__ */ React75.createElement("path", { d: "M3.94444 0L6.59063 3.75H1.29825L3.94444 0Z", fill: "currentColor" }),
|
|
8781
|
+
/* @__PURE__ */ React75.createElement(
|
|
8591
8782
|
"path",
|
|
8592
8783
|
{
|
|
8593
8784
|
d: "M3.94444 10L6.59063 6.25H1.29825L3.94444 10Z",
|
|
@@ -8597,7 +8788,7 @@ var SelectDropdownIcon = () => /* @__PURE__ */ React74.createElement(
|
|
|
8597
8788
|
);
|
|
8598
8789
|
|
|
8599
8790
|
// src/components/FunSelect/FunClickOutside.tsx
|
|
8600
|
-
import
|
|
8791
|
+
import React76 from "react";
|
|
8601
8792
|
import { useEffect as useEffect22, useRef as useRef10 } from "react";
|
|
8602
8793
|
function FunClickOutside({
|
|
8603
8794
|
children,
|
|
@@ -8624,7 +8815,7 @@ function FunClickOutside({
|
|
|
8624
8815
|
onClick?.();
|
|
8625
8816
|
}
|
|
8626
8817
|
};
|
|
8627
|
-
return /* @__PURE__ */
|
|
8818
|
+
return /* @__PURE__ */ React76.createElement("div", { ref: wrapperRef }, children);
|
|
8628
8819
|
}
|
|
8629
8820
|
|
|
8630
8821
|
// src/components/FunSelect/FunSelect.tsx
|
|
@@ -8637,9 +8828,9 @@ var FunSelect = ({
|
|
|
8637
8828
|
if (hasDuplicateValues(options)) {
|
|
8638
8829
|
throw new Error("Duplicate values detected in FunSelect options.");
|
|
8639
8830
|
}
|
|
8640
|
-
const [isDropdownOpen, setIsDropdownOpen] =
|
|
8641
|
-
const [selectedValue, setSelectedValue] =
|
|
8642
|
-
const selectedLabel =
|
|
8831
|
+
const [isDropdownOpen, setIsDropdownOpen] = useState22(false);
|
|
8832
|
+
const [selectedValue, setSelectedValue] = useState22(initValue);
|
|
8833
|
+
const selectedLabel = useMemo14(
|
|
8643
8834
|
() => options.find(({ value }) => value === selectedValue)?.label,
|
|
8644
8835
|
[options, selectedValue]
|
|
8645
8836
|
);
|
|
@@ -8648,7 +8839,7 @@ var FunSelect = ({
|
|
|
8648
8839
|
onChange(newValue);
|
|
8649
8840
|
setIsDropdownOpen(false);
|
|
8650
8841
|
};
|
|
8651
|
-
return /* @__PURE__ */
|
|
8842
|
+
return /* @__PURE__ */ React77.createElement(Box, { position: "relative", fontFamily: "body", width: "full" }, /* @__PURE__ */ React77.createElement(FunClickOutside, { onClick: () => setIsDropdownOpen(false) }, /* @__PURE__ */ React77.createElement(
|
|
8652
8843
|
Text,
|
|
8653
8844
|
{
|
|
8654
8845
|
color: "secondaryText",
|
|
@@ -8657,7 +8848,7 @@ var FunSelect = ({
|
|
|
8657
8848
|
style: { paddingBottom: 8 }
|
|
8658
8849
|
},
|
|
8659
8850
|
label
|
|
8660
|
-
), /* @__PURE__ */
|
|
8851
|
+
), /* @__PURE__ */ React77.createElement(
|
|
8661
8852
|
FunSelectEntry,
|
|
8662
8853
|
{
|
|
8663
8854
|
activeLabel: selectedLabel,
|
|
@@ -8666,7 +8857,7 @@ var FunSelect = ({
|
|
|
8666
8857
|
setIsDropdownOpen(!isDropdownOpen);
|
|
8667
8858
|
}
|
|
8668
8859
|
}
|
|
8669
|
-
), /* @__PURE__ */
|
|
8860
|
+
), /* @__PURE__ */ React77.createElement(Box, { position: "absolute", style: { zIndex: 5, minWidth: 200 } }, /* @__PURE__ */ React77.createElement(
|
|
8670
8861
|
FunSelectDropdown,
|
|
8671
8862
|
{
|
|
8672
8863
|
handleSelect,
|
|
@@ -8685,7 +8876,7 @@ var FunSelectEntry = ({
|
|
|
8685
8876
|
onClick,
|
|
8686
8877
|
isDropdownOpen
|
|
8687
8878
|
}) => {
|
|
8688
|
-
return /* @__PURE__ */
|
|
8879
|
+
return /* @__PURE__ */ React77.createElement(
|
|
8689
8880
|
Box,
|
|
8690
8881
|
{
|
|
8691
8882
|
display: "flex",
|
|
@@ -8706,7 +8897,7 @@ var FunSelectEntry = ({
|
|
|
8706
8897
|
hover: isDropdownOpen ? void 0 : "primaryText"
|
|
8707
8898
|
}
|
|
8708
8899
|
},
|
|
8709
|
-
activeLabel && /* @__PURE__ */
|
|
8900
|
+
activeLabel && /* @__PURE__ */ React77.createElement(
|
|
8710
8901
|
Text,
|
|
8711
8902
|
{
|
|
8712
8903
|
color: "secondaryText",
|
|
@@ -8716,7 +8907,7 @@ var FunSelectEntry = ({
|
|
|
8716
8907
|
},
|
|
8717
8908
|
activeLabel
|
|
8718
8909
|
),
|
|
8719
|
-
/* @__PURE__ */
|
|
8910
|
+
/* @__PURE__ */ React77.createElement(SelectDropdownIcon, null)
|
|
8720
8911
|
);
|
|
8721
8912
|
};
|
|
8722
8913
|
var FunSelectDropdown = ({
|
|
@@ -8728,9 +8919,9 @@ var FunSelectDropdown = ({
|
|
|
8728
8919
|
}) => {
|
|
8729
8920
|
if (!isDropdownOpen) return null;
|
|
8730
8921
|
if (!options.length) {
|
|
8731
|
-
return /* @__PURE__ */
|
|
8922
|
+
return /* @__PURE__ */ React77.createElement(Text, { size: "14", color: "secondaryText", weight: "medium" }, "No options found.");
|
|
8732
8923
|
}
|
|
8733
|
-
return /* @__PURE__ */
|
|
8924
|
+
return /* @__PURE__ */ React77.createElement(
|
|
8734
8925
|
Box,
|
|
8735
8926
|
{
|
|
8736
8927
|
borderRadius: "4",
|
|
@@ -8744,7 +8935,7 @@ var FunSelectDropdown = ({
|
|
|
8744
8935
|
flexDirection: "column",
|
|
8745
8936
|
gap: "0"
|
|
8746
8937
|
},
|
|
8747
|
-
options.map((optionItem) => /* @__PURE__ */
|
|
8938
|
+
options.map((optionItem) => /* @__PURE__ */ React77.createElement(
|
|
8748
8939
|
FunSelectOptionItem,
|
|
8749
8940
|
{
|
|
8750
8941
|
key: optionItem.value,
|
|
@@ -8762,7 +8953,7 @@ var FunSelectOptionItem = ({
|
|
|
8762
8953
|
isDisabled = false,
|
|
8763
8954
|
onClick
|
|
8764
8955
|
}) => {
|
|
8765
|
-
return /* @__PURE__ */
|
|
8956
|
+
return /* @__PURE__ */ React77.createElement(
|
|
8766
8957
|
Box,
|
|
8767
8958
|
{
|
|
8768
8959
|
onClick: isDisabled ? () => void 0 : () => onClick(),
|
|
@@ -8778,7 +8969,7 @@ var FunSelectOptionItem = ({
|
|
|
8778
8969
|
display: "flex",
|
|
8779
8970
|
paddingY: "8"
|
|
8780
8971
|
},
|
|
8781
|
-
/* @__PURE__ */
|
|
8972
|
+
/* @__PURE__ */ React77.createElement(
|
|
8782
8973
|
Box,
|
|
8783
8974
|
{
|
|
8784
8975
|
display: "flex",
|
|
@@ -8786,15 +8977,15 @@ var FunSelectOptionItem = ({
|
|
|
8786
8977
|
alignItems: "center",
|
|
8787
8978
|
width: "40"
|
|
8788
8979
|
},
|
|
8789
|
-
isActive && /* @__PURE__ */
|
|
8980
|
+
isActive && /* @__PURE__ */ React77.createElement(CheckIcon, null)
|
|
8790
8981
|
),
|
|
8791
|
-
/* @__PURE__ */
|
|
8982
|
+
/* @__PURE__ */ React77.createElement(Text, { color: "primaryText", weight: "medium", size: "13" }, label)
|
|
8792
8983
|
);
|
|
8793
8984
|
};
|
|
8794
8985
|
|
|
8795
8986
|
// src/components/Icons/SuccessIcon.tsx
|
|
8796
|
-
import
|
|
8797
|
-
var SuccessIcon = () => /* @__PURE__ */
|
|
8987
|
+
import React78 from "react";
|
|
8988
|
+
var SuccessIcon = () => /* @__PURE__ */ React78.createElement(
|
|
8798
8989
|
"svg",
|
|
8799
8990
|
{
|
|
8800
8991
|
width: "50",
|
|
@@ -8803,7 +8994,7 @@ var SuccessIcon = () => /* @__PURE__ */ React77.createElement(
|
|
|
8803
8994
|
fill: "none",
|
|
8804
8995
|
xmlns: "http://www.w3.org/2000/svg"
|
|
8805
8996
|
},
|
|
8806
|
-
/* @__PURE__ */
|
|
8997
|
+
/* @__PURE__ */ React78.createElement(
|
|
8807
8998
|
"path",
|
|
8808
8999
|
{
|
|
8809
9000
|
d: "M24.9766 49.2891C21.6641 49.2891 18.5469 48.6562 15.625 47.3906C12.7031 46.1406 10.125 44.3984 7.89062 42.1641C5.67188 39.9297 3.92969 37.3516 2.66406 34.4297C1.39844 31.5078 0.765625 28.3906 0.765625 25.0781C0.765625 21.7656 1.39844 18.6484 2.66406 15.7266C3.92969 12.8047 5.67188 10.2344 7.89062 8.01562C10.125 5.78125 12.6953 4.03125 15.6016 2.76562C18.5234 1.5 21.6406 0.867188 24.9531 0.867188C28.2812 0.867188 31.4062 1.5 34.3281 2.76562C37.25 4.03125 39.8281 5.78125 42.0625 8.01562C44.2969 10.2344 46.0469 12.8047 47.3125 15.7266C48.5781 18.6484 49.2109 21.7656 49.2109 25.0781C49.2109 28.3906 48.5781 31.5078 47.3125 34.4297C46.0469 37.3516 44.2969 39.9297 42.0625 42.1641C39.8281 44.3984 37.25 46.1406 34.3281 47.3906C31.4062 48.6562 28.2891 49.2891 24.9766 49.2891ZM22.375 36.6328C22.8125 36.6328 23.2109 36.5312 23.5703 36.3281C23.9453 36.125 24.2734 35.8203 24.5547 35.4141L35.5234 18.3047C35.6797 18.0547 35.8203 17.7891 35.9453 17.5078C36.0703 17.2109 36.1328 16.9297 36.1328 16.6641C36.1328 16.0547 35.8984 15.5625 35.4297 15.1875C34.9766 14.8125 34.4609 14.625 33.8828 14.625C33.1172 14.625 32.4844 15.0312 31.9844 15.8438L22.2812 31.3594L17.7812 25.6406C17.4688 25.25 17.1641 24.9766 16.8672 24.8203C16.5703 24.6641 16.2344 24.5859 15.8594 24.5859C15.2656 24.5859 14.7578 24.8047 14.3359 25.2422C13.9297 25.6641 13.7266 26.1719 13.7266 26.7656C13.7266 27.0625 13.7812 27.3516 13.8906 27.6328C14 27.9141 14.1562 28.1875 14.3594 28.4531L20.1016 35.4375C20.4453 35.8594 20.7969 36.1641 21.1562 36.3516C21.5156 36.5391 21.9219 36.6328 22.375 36.6328Z",
|
|
@@ -8838,18 +9029,18 @@ function FunCheckoutHistoryHelp({
|
|
|
8838
9029
|
}) {
|
|
8839
9030
|
const { appName, apiKey } = useFunkitConfig();
|
|
8840
9031
|
const { userInfo } = useGeneralWallet();
|
|
8841
|
-
const [isSubmitting, setIsSubmitting] =
|
|
8842
|
-
const [emailInput, setEmailInput] =
|
|
8843
|
-
const [subjectInput, setSubjectInput] =
|
|
8844
|
-
const [resolutionInput, setResolutionInput] =
|
|
9032
|
+
const [isSubmitting, setIsSubmitting] = useState23(false);
|
|
9033
|
+
const [emailInput, setEmailInput] = useState23("");
|
|
9034
|
+
const [subjectInput, setSubjectInput] = useState23("");
|
|
9035
|
+
const [resolutionInput, setResolutionInput] = useState23(
|
|
8845
9036
|
RESOLUTION_OPTIONS[0].value
|
|
8846
9037
|
);
|
|
8847
|
-
const [descriptionInput, setDescriptionInput] =
|
|
8848
|
-
const [errorMessage, setErrorMessage] =
|
|
8849
|
-
const isEmailInputValid =
|
|
9038
|
+
const [descriptionInput, setDescriptionInput] = useState23("");
|
|
9039
|
+
const [errorMessage, setErrorMessage] = useState23();
|
|
9040
|
+
const isEmailInputValid = useMemo15(() => {
|
|
8850
9041
|
return validateEmailString(emailInput);
|
|
8851
9042
|
}, [emailInput]);
|
|
8852
|
-
const [processStage, setProcessStage] =
|
|
9043
|
+
const [processStage, setProcessStage] = useState23(
|
|
8853
9044
|
0 /* INPUT */
|
|
8854
9045
|
);
|
|
8855
9046
|
const wrapperRef = useRef11(null);
|
|
@@ -8933,17 +9124,17 @@ function FunCheckoutHistoryHelp({
|
|
|
8933
9124
|
}
|
|
8934
9125
|
};
|
|
8935
9126
|
if (processStage === 1 /* SUCCESS */) {
|
|
8936
|
-
return /* @__PURE__ */
|
|
9127
|
+
return /* @__PURE__ */ React79.createElement(Box, { display: "flex", flexDirection: "column", gap: "24", paddingTop: "16" }, /* @__PURE__ */ React79.createElement(Box, { paddingY: "12", paddingX: "24" }, /* @__PURE__ */ React79.createElement(
|
|
8937
9128
|
FunMessage,
|
|
8938
9129
|
{
|
|
8939
9130
|
title: "Request sent",
|
|
8940
9131
|
description: "Our team has received your request and will be in touch shortly. We appreciate your patience.",
|
|
8941
|
-
icon: /* @__PURE__ */
|
|
9132
|
+
icon: /* @__PURE__ */ React79.createElement(SuccessIcon, null)
|
|
8942
9133
|
}
|
|
8943
|
-
)), /* @__PURE__ */
|
|
9134
|
+
)), /* @__PURE__ */ React79.createElement(FunButton, { title: "Close", onClick: onBackFromHelpPage }));
|
|
8944
9135
|
}
|
|
8945
9136
|
const bottomSectionRef = document.getElementById(HELP_SCREEN_BOTTOM_BAR_ID);
|
|
8946
|
-
return /* @__PURE__ */
|
|
9137
|
+
return /* @__PURE__ */ React79.createElement(Box, { ref: wrapperRef }, /* @__PURE__ */ React79.createElement(Box, { display: "flex", flexDirection: "column", gap: "24" }, /* @__PURE__ */ React79.createElement(Box, { display: "flex", flexDirection: "column", gap: "10" }, /* @__PURE__ */ React79.createElement(Text, { color: "primaryText", size: "20", weight: "medium" }, "Tell us more"), /* @__PURE__ */ React79.createElement(Text, { color: "secondaryText", size: "10" }, "If you're experiencing an issue or have a question, please fill out the form below and our support team will get back to you as soon as possible.")), /* @__PURE__ */ React79.createElement(Box, { display: "flex", flexDirection: "column", gap: "12", position: "relative" }, /* @__PURE__ */ React79.createElement(
|
|
8947
9138
|
FunInput,
|
|
8948
9139
|
{
|
|
8949
9140
|
label: "Email*",
|
|
@@ -8952,7 +9143,7 @@ function FunCheckoutHistoryHelp({
|
|
|
8952
9143
|
value: emailInput,
|
|
8953
9144
|
onChange: (e) => setEmailInput(e?.target?.value)
|
|
8954
9145
|
}
|
|
8955
|
-
), /* @__PURE__ */
|
|
9146
|
+
), /* @__PURE__ */ React79.createElement(
|
|
8956
9147
|
FunInput,
|
|
8957
9148
|
{
|
|
8958
9149
|
label: "Subject*",
|
|
@@ -8961,7 +9152,7 @@ function FunCheckoutHistoryHelp({
|
|
|
8961
9152
|
value: subjectInput,
|
|
8962
9153
|
onChange: (e) => setSubjectInput(e?.target?.value)
|
|
8963
9154
|
}
|
|
8964
|
-
), /* @__PURE__ */
|
|
9155
|
+
), /* @__PURE__ */ React79.createElement(
|
|
8965
9156
|
FunTextAreaInput,
|
|
8966
9157
|
{
|
|
8967
9158
|
label: "Description*",
|
|
@@ -8970,7 +9161,7 @@ function FunCheckoutHistoryHelp({
|
|
|
8970
9161
|
value: descriptionInput,
|
|
8971
9162
|
onChange: (e) => setDescriptionInput(e?.target?.value)
|
|
8972
9163
|
}
|
|
8973
|
-
), /* @__PURE__ */
|
|
9164
|
+
), /* @__PURE__ */ React79.createElement(
|
|
8974
9165
|
FunSelect,
|
|
8975
9166
|
{
|
|
8976
9167
|
label: "Resolution preference*",
|
|
@@ -8979,7 +9170,7 @@ function FunCheckoutHistoryHelp({
|
|
|
8979
9170
|
onChange: setResolutionInput
|
|
8980
9171
|
}
|
|
8981
9172
|
))), bottomSectionRef && createPortal2(
|
|
8982
|
-
/* @__PURE__ */
|
|
9173
|
+
/* @__PURE__ */ React79.createElement(
|
|
8983
9174
|
Dialog.BottomBar,
|
|
8984
9175
|
{
|
|
8985
9176
|
actionButtonProps: {
|
|
@@ -8987,7 +9178,7 @@ function FunCheckoutHistoryHelp({
|
|
|
8987
9178
|
onClick: onSubmitIssue,
|
|
8988
9179
|
isDisabled: isSubmitting || !subjectInput || !descriptionInput || !emailInput || !isEmailInputValid || !resolutionInput
|
|
8989
9180
|
},
|
|
8990
|
-
topSection: /* @__PURE__ */
|
|
9181
|
+
topSection: /* @__PURE__ */ React79.createElement(
|
|
8991
9182
|
FunNotification,
|
|
8992
9183
|
{
|
|
8993
9184
|
description: errorMessage,
|
|
@@ -9003,6 +9194,7 @@ function FunCheckoutHistoryHelp({
|
|
|
9003
9194
|
|
|
9004
9195
|
// src/components/FunCheckoutHistoryModal/FunCheckoutHistoryContent.tsx
|
|
9005
9196
|
var HELP_SCREEN_BOTTOM_BAR_ID = "help-screen-bottom-section";
|
|
9197
|
+
var DEFAULT_CHECKOUT_HISTORY_DETAIL_TITLE = "Your Purchase";
|
|
9006
9198
|
function FunCheckoutHistoryContent({
|
|
9007
9199
|
depositAddress,
|
|
9008
9200
|
currentPage,
|
|
@@ -9010,7 +9202,7 @@ function FunCheckoutHistoryContent({
|
|
|
9010
9202
|
onBackFromHelpPage
|
|
9011
9203
|
}) {
|
|
9012
9204
|
const { checkoutHistoryInfo, isLoading } = useFunkitPostCheckoutInternal(depositAddress);
|
|
9013
|
-
return /* @__PURE__ */
|
|
9205
|
+
return /* @__PURE__ */ React80.createElement(Box, null, isLoading || !checkoutHistoryInfo ? /* @__PURE__ */ React80.createElement(
|
|
9014
9206
|
Box,
|
|
9015
9207
|
{
|
|
9016
9208
|
width: "full",
|
|
@@ -9021,14 +9213,14 @@ function FunCheckoutHistoryContent({
|
|
|
9021
9213
|
justifyContent: "center",
|
|
9022
9214
|
color: "primaryText"
|
|
9023
9215
|
},
|
|
9024
|
-
/* @__PURE__ */
|
|
9025
|
-
) : checkoutHistoryInfo ? currentPage === "detail" /* DETAIL */ ? /* @__PURE__ */
|
|
9216
|
+
/* @__PURE__ */ React80.createElement(SpinnerIcon, null)
|
|
9217
|
+
) : checkoutHistoryInfo ? currentPage === "detail" /* DETAIL */ ? /* @__PURE__ */ React80.createElement(
|
|
9026
9218
|
FunCheckoutHistoryDetail,
|
|
9027
9219
|
{
|
|
9028
9220
|
checkoutHistoryInfo,
|
|
9029
9221
|
setCurrentPage
|
|
9030
9222
|
}
|
|
9031
|
-
) : currentPage === "help" /* HELP */ ? /* @__PURE__ */
|
|
9223
|
+
) : currentPage === "help" /* HELP */ ? /* @__PURE__ */ React80.createElement(
|
|
9032
9224
|
FunCheckoutHistoryHelp,
|
|
9033
9225
|
{
|
|
9034
9226
|
checkoutHistoryInfo,
|
|
@@ -9039,144 +9231,11 @@ function FunCheckoutHistoryContent({
|
|
|
9039
9231
|
|
|
9040
9232
|
// src/components/ProfileDetails/FunProfileViews/ActivityHistory/ActivityHistory.tsx
|
|
9041
9233
|
import { CheckoutState as CheckoutState5 } from "@funkit/api-base";
|
|
9042
|
-
import React84, { useEffect as useEffect24, useMemo as useMemo17, useState as
|
|
9234
|
+
import React84, { useEffect as useEffect24, useMemo as useMemo17, useState as useState24 } from "react";
|
|
9043
9235
|
|
|
9044
9236
|
// src/components/FunNotification/FunCheckoutNotification.tsx
|
|
9045
9237
|
import React83, { useMemo as useMemo16 } from "react";
|
|
9046
9238
|
|
|
9047
|
-
// src/components/FunAssetAvatar/FunAssetAvatar.tsx
|
|
9048
|
-
import React80, { useMemo as useMemo15 } from "react";
|
|
9049
|
-
|
|
9050
|
-
// src/consts/assets.ts
|
|
9051
|
-
var ASSET_LOGO_SRCS = {
|
|
9052
|
-
ETH: "https://www.iconarchive.com/download/i109534/cjdowner/cryptocurrency-flat/Ethereum-ETH.1024.png",
|
|
9053
|
-
MATIC: "https://altcoinsbox.com/wp-content/uploads/2023/03/matic-logo.webp",
|
|
9054
|
-
ARB: "https://cryptologos.cc/logos/arbitrum-arb-logo.png",
|
|
9055
|
-
LDO: "https://cryptologos.cc/logos/lido-dao-ldo-logo.png",
|
|
9056
|
-
AARBUSDCN: "https://assets.coingecko.com/coins/images/14318/large/aUSDC.e260d492.png?1696514006",
|
|
9057
|
-
CRV: "https://cryptologos.cc/logos/curve-dao-token-crv-logo.png",
|
|
9058
|
-
USDC: "https://cryptologos.cc/logos/usd-coin-usdc-logo.png",
|
|
9059
|
-
USDT: "https://icons.iconarchive.com/icons/cjdowner/cryptocurrency-flat/512/Tether-USDT-icon.png",
|
|
9060
|
-
DAI: "https://cryptologos.cc/logos/multi-collateral-dai-dai-logo.png",
|
|
9061
|
-
WBTC: "https://cryptologos.cc/logos/wrapped-bitcoin-wbtc-logo.png",
|
|
9062
|
-
GRT: "https://cryptologos.cc/logos/the-graph-grt-logo.png",
|
|
9063
|
-
SHIB: "https://cryptologos.cc/logos/shiba-inu-shib-logo.png",
|
|
9064
|
-
QNT: "https://cryptologos.cc/logos/quant-qnt-logo.png",
|
|
9065
|
-
AAVE: "https://cryptologos.cc/logos/aave-aave-logo.png",
|
|
9066
|
-
UNI: "https://cryptologos.cc/logos/uniswap-uni-logo.png",
|
|
9067
|
-
SNX: "https://cryptologos.cc/logos/synthetix-snx-logo.png",
|
|
9068
|
-
CRO: "https://cryptologos.cc/logos/cronos-cro-logo.png",
|
|
9069
|
-
RNDR: "https://altcoinsbox.com/wp-content/uploads/2023/03/render-token-logo.webp",
|
|
9070
|
-
SAND: "https://cdn3d.iconscout.com/3d/premium/thumb/the-sandbox-sand-cryptocurrency-5108582-4263919.png?f=webp",
|
|
9071
|
-
APE: "https://cryptologos.cc/logos/apecoin-ape-ape-logo.png",
|
|
9072
|
-
IMX: "https://cryptologos.cc/logos/immutable-x-imx-logo.png",
|
|
9073
|
-
INJ: "https://cryptologos.cc/logos/injective-inj-logo.png",
|
|
9074
|
-
MKR: "https://cryptologos.cc/logos/maker-mkr-logo.png",
|
|
9075
|
-
LINK: "https://cryptologos.cc/logos/chainlink-link-logo.png",
|
|
9076
|
-
PYUSD: "https://www.paypalobjects.com/devdoc/coin-PYUSD%20220x219.png",
|
|
9077
|
-
DEGEN: "https://assets.coingecko.com/coins/images/34515/large/android-chrome-512x512.png?1706198225",
|
|
9078
|
-
AERO: "https://assets.coingecko.com/coins/images/31745/large/token.png?1696530564",
|
|
9079
|
-
APOLWMATIC: "https://polygonscan.com/token/images/aave_wmatic.png",
|
|
9080
|
-
MFER: "https://assets.coingecko.com/coins/images/36550/large/mfercoin-logo.png?1711876821",
|
|
9081
|
-
$MFER: "https://assets.coingecko.com/coins/images/36550/large/mfercoin-logo.png?1711876821",
|
|
9082
|
-
ROOST: "https://assets.coingecko.com/coins/images/36458/large/roost.jpeg?1711493580",
|
|
9083
|
-
BSHIB: "https://assets.coingecko.com/coins/images/36092/large/logocg.png?1710478223",
|
|
9084
|
-
BRETT: "https://assets.coingecko.com/coins/images/35529/large/1000050750.png?1709031995",
|
|
9085
|
-
BLERF: "https://assets.coingecko.com/coins/images/36473/large/BLERF.png?1711527025",
|
|
9086
|
-
BENTO: "https://assets.coingecko.com/coins/images/37138/large/logo-bento-200-200.png?1713419221",
|
|
9087
|
-
CBETH: "https://assets.coingecko.com/coins/images/27008/large/cbeth.png?1709186989",
|
|
9088
|
-
PENDLE: "https://assets.coingecko.com/coins/images/15069/large/Pendle_Logo_Normal-03.png?1696514728",
|
|
9089
|
-
WEETH: "https://assets.coingecko.com/coins/images/33033/large/weETH.png?1701438396",
|
|
9090
|
-
GMX: "https://raw.githubusercontent.com/Uniswap/assets/master/blockchains/arbitrum/assets/0xfc5A1A6EB076a2C7aD06eD22C90d7E710E35ad0a/logo.png",
|
|
9091
|
-
TYBG: "https://assets.coingecko.com/coins/images/34563/large/tybg.png?1705400778",
|
|
9092
|
-
LUCK: "https://s3.us-west-2.amazonaws.com/sdk-cdn.fun.xyz/images/luck.jpg",
|
|
9093
|
-
WSTETH: "https://assets.coingecko.com/coins/images/18834/large/wstETH.png?1696518295",
|
|
9094
|
-
WETH: "https://www.cryptocompare.com/media/38553079/weth.png",
|
|
9095
|
-
MNT: "https://img.cryptorank.io/coins/mantle1681720399218.png",
|
|
9096
|
-
USDE: "https://holder.io/wp-content/uploads/coins/3/usde--3-74923.png"
|
|
9097
|
-
};
|
|
9098
|
-
|
|
9099
|
-
// src/components/FunAssetAvatar/FunAssetAvatar.css.ts
|
|
9100
|
-
var assetContainerStyle = "uwrdc21";
|
|
9101
|
-
var chainContainerStyle = "uwrdc23 _1rsrm2fju _1rsrm2fu0 _1rsrm2f11 _1rsrm2fi _1rsrm2fx";
|
|
9102
|
-
var containerStyle = "uwrdc20";
|
|
9103
|
-
|
|
9104
|
-
// src/components/FunAssetAvatar/FunAssetAvatar.tsx
|
|
9105
|
-
var fallbackAssetSrc = "https://static1.squarespace.com/static/54735678e4b025d4e207e7b3/t/59605876cd0f689a4a30e51d/1499486328449/Dollar_Circle.png";
|
|
9106
|
-
function FunAssetAvatar({
|
|
9107
|
-
assetSrc,
|
|
9108
|
-
assetTicker,
|
|
9109
|
-
assetName,
|
|
9110
|
-
assetIconSize = "20",
|
|
9111
|
-
chainId,
|
|
9112
|
-
prioritizeDefaults = true,
|
|
9113
|
-
hideIfUnknown = false
|
|
9114
|
-
}) {
|
|
9115
|
-
const chainMetadata = chainMetadataById[parseInt((chainId || "").toString())] || null;
|
|
9116
|
-
const finalAssetSrc = useMemo15(() => {
|
|
9117
|
-
const normalizedTicker = assetTicker?.toUpperCase() || "";
|
|
9118
|
-
const defaultSrc = ASSET_LOGO_SRCS?.[normalizedTicker];
|
|
9119
|
-
if (prioritizeDefaults) {
|
|
9120
|
-
return defaultSrc || assetSrc;
|
|
9121
|
-
} else {
|
|
9122
|
-
return assetSrc || defaultSrc;
|
|
9123
|
-
}
|
|
9124
|
-
}, [assetSrc, assetTicker, prioritizeDefaults]);
|
|
9125
|
-
const showChainIcon = isNotNullish(chainMetadata);
|
|
9126
|
-
const chainIconSize = parseInt(assetIconSize) / 2;
|
|
9127
|
-
return hideIfUnknown && !finalAssetSrc ? null : /* @__PURE__ */ React80.createElement(Box, { id: "container", alignSelf: "center" }, /* @__PURE__ */ React80.createElement(
|
|
9128
|
-
Box,
|
|
9129
|
-
{
|
|
9130
|
-
width: assetIconSize,
|
|
9131
|
-
height: assetIconSize,
|
|
9132
|
-
className: containerStyle
|
|
9133
|
-
},
|
|
9134
|
-
/* @__PURE__ */ React80.createElement(
|
|
9135
|
-
Box,
|
|
9136
|
-
{
|
|
9137
|
-
width: assetIconSize,
|
|
9138
|
-
height: assetIconSize,
|
|
9139
|
-
className: assetContainerStyle
|
|
9140
|
-
},
|
|
9141
|
-
/* @__PURE__ */ React80.createElement(
|
|
9142
|
-
AsyncImage,
|
|
9143
|
-
{
|
|
9144
|
-
alt: assetName,
|
|
9145
|
-
src: finalAssetSrc,
|
|
9146
|
-
fallbackSrc: fallbackAssetSrc,
|
|
9147
|
-
background: void 0,
|
|
9148
|
-
borderColor: "generalBorderDim",
|
|
9149
|
-
borderRadius: "full",
|
|
9150
|
-
height: assetIconSize,
|
|
9151
|
-
width: assetIconSize,
|
|
9152
|
-
testId: `fun-asset-${assetTicker}-icon`,
|
|
9153
|
-
useAsImage: true
|
|
9154
|
-
}
|
|
9155
|
-
)
|
|
9156
|
-
),
|
|
9157
|
-
showChainIcon ? /* @__PURE__ */ React80.createElement(
|
|
9158
|
-
Box,
|
|
9159
|
-
{
|
|
9160
|
-
width: "half",
|
|
9161
|
-
height: "half",
|
|
9162
|
-
className: chainContainerStyle
|
|
9163
|
-
},
|
|
9164
|
-
/* @__PURE__ */ React80.createElement(
|
|
9165
|
-
AsyncImage,
|
|
9166
|
-
{
|
|
9167
|
-
alt: chainMetadata.name,
|
|
9168
|
-
src: chainMetadata.iconUrl || "",
|
|
9169
|
-
background: chainMetadata.iconBackground,
|
|
9170
|
-
borderRadius: "1",
|
|
9171
|
-
height: chainIconSize - 2,
|
|
9172
|
-
width: chainIconSize - 2,
|
|
9173
|
-
testId: `fun-asset-chain-${chainId}-icon`
|
|
9174
|
-
}
|
|
9175
|
-
)
|
|
9176
|
-
) : null
|
|
9177
|
-
));
|
|
9178
|
-
}
|
|
9179
|
-
|
|
9180
9239
|
// src/components/FunButton/FunViewTxButton.tsx
|
|
9181
9240
|
import React81 from "react";
|
|
9182
9241
|
function FunViewTxButton({
|
|
@@ -9410,7 +9469,7 @@ function ActivityHistory({
|
|
|
9410
9469
|
onSelectActivity
|
|
9411
9470
|
}) {
|
|
9412
9471
|
const { returnViewPresets } = useActivityTraversal();
|
|
9413
|
-
const [activeTab, setActiveTab] =
|
|
9472
|
+
const [activeTab, setActiveTab] = useState24(
|
|
9414
9473
|
returnViewPresets?.activeTab ?? "All" /* ALL */
|
|
9415
9474
|
);
|
|
9416
9475
|
const triggerScrollToTop = (scrollPosition) => {
|
|
@@ -9499,7 +9558,7 @@ function ActivityHistory({
|
|
|
9499
9558
|
|
|
9500
9559
|
// src/components/ProfileDetails/FunProfileViews/Home/index.tsx
|
|
9501
9560
|
import clsx8 from "clsx";
|
|
9502
|
-
import React93, { useMemo as useMemo18, useRef as useRef12, useState as
|
|
9561
|
+
import React93, { useMemo as useMemo18, useRef as useRef12, useState as useState26 } from "react";
|
|
9503
9562
|
import { Virtuoso } from "react-virtuoso";
|
|
9504
9563
|
import { useAccount as useAccount5 } from "wagmi";
|
|
9505
9564
|
|
|
@@ -9848,7 +9907,7 @@ var HomeCheckoutDisplayRowSkeleton = () => {
|
|
|
9848
9907
|
};
|
|
9849
9908
|
|
|
9850
9909
|
// src/components/ProfileDetails/FunProfileViews/Home/HomeTokenDisplayRow.tsx
|
|
9851
|
-
import React92, { useState as
|
|
9910
|
+
import React92, { useState as useState25 } from "react";
|
|
9852
9911
|
|
|
9853
9912
|
// src/utils/assets.ts
|
|
9854
9913
|
import {
|
|
@@ -10104,7 +10163,7 @@ var HomeTokenBalanceDisplayRow = ({ asset }) => {
|
|
|
10104
10163
|
asset.tokenBalance,
|
|
10105
10164
|
asset.decimals
|
|
10106
10165
|
);
|
|
10107
|
-
const [hasHover, setHasHover] =
|
|
10166
|
+
const [hasHover, setHasHover] = useState25(false);
|
|
10108
10167
|
return /* @__PURE__ */ React92.createElement(
|
|
10109
10168
|
Box,
|
|
10110
10169
|
{
|
|
@@ -10200,7 +10259,7 @@ var ProfileTitleSection = ({
|
|
|
10200
10259
|
onLogout,
|
|
10201
10260
|
onClose
|
|
10202
10261
|
}) => {
|
|
10203
|
-
const [isDisconnectExpanded, setIsDisconnectExpanded] =
|
|
10262
|
+
const [isDisconnectExpanded, setIsDisconnectExpanded] = useState26(false);
|
|
10204
10263
|
return /* @__PURE__ */ React93.createElement(
|
|
10205
10264
|
Box,
|
|
10206
10265
|
{
|
|
@@ -10295,7 +10354,7 @@ function Home({
|
|
|
10295
10354
|
useWalletAssetsListener();
|
|
10296
10355
|
useCheckoutHistoryListener();
|
|
10297
10356
|
const { userInfo, handleLogout, walletAssets, totalWalletAssetsUsd } = useGeneralWallet();
|
|
10298
|
-
const [selectedView, setSelectedView] =
|
|
10357
|
+
const [selectedView, setSelectedView] = useState26(defaultHomeTab);
|
|
10299
10358
|
const { checkoutHistoryList, isCheckoutHistoryInited } = useFunkitAllPostCheckoutsInternal();
|
|
10300
10359
|
const { returnViewPresets } = useActivityTraversal();
|
|
10301
10360
|
const checkoutsListRef = useRef12(null);
|
|
@@ -10528,13 +10587,11 @@ function Settings() {
|
|
|
10528
10587
|
}
|
|
10529
10588
|
|
|
10530
10589
|
// src/components/ProfileDetails/ProfileDetails.tsx
|
|
10531
|
-
var ANIMATION_DELAY2 = 150;
|
|
10532
10590
|
var PROFILE_SIDE_PADDING = "18";
|
|
10533
|
-
function ProfileDetails({ onClose }) {
|
|
10534
|
-
const [
|
|
10535
|
-
const [
|
|
10536
|
-
|
|
10537
|
-
"assets" /* ASSETS */
|
|
10591
|
+
function ProfileDetails({ onClose, defaultTab }) {
|
|
10592
|
+
const [view, setView] = useState27(0 /* HOME */);
|
|
10593
|
+
const [selectedHomeTab, setSelectedHomeTab] = useState27(
|
|
10594
|
+
defaultTab ?? "assets" /* ASSETS */
|
|
10538
10595
|
);
|
|
10539
10596
|
const {
|
|
10540
10597
|
onSelectActivity,
|
|
@@ -10543,22 +10600,20 @@ function ProfileDetails({ onClose }) {
|
|
|
10543
10600
|
returnView,
|
|
10544
10601
|
resetActivityTraversal
|
|
10545
10602
|
} = useActivityTraversal();
|
|
10546
|
-
const
|
|
10603
|
+
const historyDetailTitle = useCheckoutModalTitle(
|
|
10604
|
+
selectedPurchaseId || "0x",
|
|
10605
|
+
DEFAULT_CHECKOUT_HISTORY_DETAIL_TITLE
|
|
10606
|
+
);
|
|
10607
|
+
const [singleActivityPage, setSingleActivityPage] = useState27(
|
|
10547
10608
|
selectedPurchaseInitView ?? "detail" /* DETAIL */
|
|
10548
10609
|
);
|
|
10549
|
-
const resetView =
|
|
10610
|
+
const resetView = useCallback17(() => {
|
|
10550
10611
|
setView(returnView ?? 0 /* HOME */);
|
|
10551
10612
|
setSelectedHomeTab("checkouts" /* CHECKOUTS */);
|
|
10552
10613
|
resetActivityTraversal();
|
|
10553
10614
|
}, [resetActivityTraversal, returnView]);
|
|
10554
|
-
const animate =
|
|
10555
|
-
|
|
10556
|
-
setTimeout(() => {
|
|
10557
|
-
callback();
|
|
10558
|
-
setAnimateOut(false);
|
|
10559
|
-
}, ANIMATION_DELAY2);
|
|
10560
|
-
}, []);
|
|
10561
|
-
const onSelectActivityWrapper = useCallback16(
|
|
10615
|
+
const { animateOut, animate } = useAnimatedNavigation(void 0);
|
|
10616
|
+
const onSelectActivityWrapper = useCallback17(
|
|
10562
10617
|
(activity) => {
|
|
10563
10618
|
onSelectActivity({
|
|
10564
10619
|
...activity,
|
|
@@ -10575,7 +10630,7 @@ function ProfileDetails({ onClose }) {
|
|
|
10575
10630
|
},
|
|
10576
10631
|
["detail" /* DETAIL */]: {
|
|
10577
10632
|
onBack: () => animate(resetView),
|
|
10578
|
-
title:
|
|
10633
|
+
title: historyDetailTitle
|
|
10579
10634
|
}
|
|
10580
10635
|
};
|
|
10581
10636
|
const dialogTitleMap = {
|
|
@@ -10630,7 +10685,7 @@ function ProfileDetails({ onClose }) {
|
|
|
10630
10685
|
|
|
10631
10686
|
// src/components/AccountModal/AccountModal.tsx
|
|
10632
10687
|
var TITLE_ID = "fun_account_modal_title";
|
|
10633
|
-
function AccountModal({ onClose, open }) {
|
|
10688
|
+
function AccountModal({ onClose, open, defaultTab }) {
|
|
10634
10689
|
const { walletAddress } = useGeneralWallet();
|
|
10635
10690
|
if (!walletAddress) return null;
|
|
10636
10691
|
return /* @__PURE__ */ React96.createElement(
|
|
@@ -10641,7 +10696,7 @@ function AccountModal({ onClose, open }) {
|
|
|
10641
10696
|
titleId: TITLE_ID,
|
|
10642
10697
|
isSmartCloseable: true
|
|
10643
10698
|
},
|
|
10644
|
-
/* @__PURE__ */ React96.createElement(ActivityTraversalProvider, null, /* @__PURE__ */ React96.createElement(ProfileDetails, { onClose }))
|
|
10699
|
+
/* @__PURE__ */ React96.createElement(ActivityTraversalProvider, null, /* @__PURE__ */ React96.createElement(ProfileDetails, { onClose, defaultTab }))
|
|
10645
10700
|
);
|
|
10646
10701
|
}
|
|
10647
10702
|
|
|
@@ -10827,8 +10882,7 @@ function FunDevTestModal({ onClose, open }) {
|
|
|
10827
10882
|
}
|
|
10828
10883
|
|
|
10829
10884
|
// src/components/FunCheckoutHistoryModal/FunCheckoutHistoryModal.tsx
|
|
10830
|
-
import React101, {
|
|
10831
|
-
var ANIMATION_DELAY3 = 150;
|
|
10885
|
+
import React101, { useState as useState28 } from "react";
|
|
10832
10886
|
function FunCheckoutHistoryModal({
|
|
10833
10887
|
onClose,
|
|
10834
10888
|
open,
|
|
@@ -10840,15 +10894,12 @@ function FunCheckoutHistoryModal({
|
|
|
10840
10894
|
"Unable to open checkout history modal without a depositAddress"
|
|
10841
10895
|
);
|
|
10842
10896
|
}
|
|
10843
|
-
const [currentPage, setCurrentPage] =
|
|
10844
|
-
const
|
|
10845
|
-
|
|
10846
|
-
|
|
10847
|
-
|
|
10848
|
-
|
|
10849
|
-
setAnimateOut(false);
|
|
10850
|
-
}, ANIMATION_DELAY3);
|
|
10851
|
-
}, []);
|
|
10897
|
+
const [currentPage, setCurrentPage] = useState28(initialPage);
|
|
10898
|
+
const detailTitle = useCheckoutModalTitle(
|
|
10899
|
+
depositAddress,
|
|
10900
|
+
DEFAULT_CHECKOUT_HISTORY_DETAIL_TITLE
|
|
10901
|
+
);
|
|
10902
|
+
const { animateOut, navigateTo } = useAnimatedNavigation(setCurrentPage);
|
|
10852
10903
|
const historyTitle = {
|
|
10853
10904
|
["help" /* HELP */]: {
|
|
10854
10905
|
onBack: () => navigateTo("detail" /* DETAIL */),
|
|
@@ -10856,7 +10907,7 @@ function FunCheckoutHistoryModal({
|
|
|
10856
10907
|
onClose
|
|
10857
10908
|
},
|
|
10858
10909
|
["detail" /* DETAIL */]: {
|
|
10859
|
-
title:
|
|
10910
|
+
title: detailTitle,
|
|
10860
10911
|
onClose
|
|
10861
10912
|
}
|
|
10862
10913
|
};
|
|
@@ -10886,7 +10937,7 @@ import {
|
|
|
10886
10937
|
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO8,
|
|
10887
10938
|
getTokenInfo as getTokenInfo2
|
|
10888
10939
|
} from "@funkit/core";
|
|
10889
|
-
import React168, { useCallback as useCallback29, useEffect as useEffect32, useMemo as useMemo32, useRef as useRef15, useState as
|
|
10940
|
+
import React168, { useCallback as useCallback29, useEffect as useEffect32, useMemo as useMemo32, useRef as useRef15, useState as useState43 } from "react";
|
|
10890
10941
|
import { arbitrum, mainnet as mainnet6, mantle as mantle2, zkSync as zkSync3 } from "viem/chains";
|
|
10891
10942
|
|
|
10892
10943
|
// src/hooks/useCheckoutAccountBalanceTransfer.ts
|
|
@@ -10971,14 +11022,14 @@ function useCheckoutQuoteNotification(checkoutId) {
|
|
|
10971
11022
|
}
|
|
10972
11023
|
|
|
10973
11024
|
// src/hooks/useMesh.tsx
|
|
10974
|
-
import React128, { useCallback as useCallback20, useMemo as useMemo20, useRef as useRef13, useState as
|
|
11025
|
+
import React128, { useCallback as useCallback20, useMemo as useMemo20, useRef as useRef13, useState as useState30 } from "react";
|
|
10975
11026
|
import { useAccount as useAccount8 } from "wagmi";
|
|
10976
11027
|
|
|
10977
11028
|
// src/components/FunkitProvider/FunkitMeshProvider.tsx
|
|
10978
11029
|
import {
|
|
10979
11030
|
createLink
|
|
10980
11031
|
} from "@meshconnect/web-link-sdk";
|
|
10981
|
-
import React102, { createContext as createContext12, useCallback as useCallback19, useContext as useContext14, useState as
|
|
11032
|
+
import React102, { createContext as createContext12, useCallback as useCallback19, useContext as useContext14, useState as useState29 } from "react";
|
|
10982
11033
|
var FunkitMeshContext = createContext12({
|
|
10983
11034
|
meshBrokerDataMap: {},
|
|
10984
11035
|
setDataMapAndCache: () => void 0
|
|
@@ -11004,7 +11055,7 @@ function fetchDataMapFromCache() {
|
|
|
11004
11055
|
}
|
|
11005
11056
|
}
|
|
11006
11057
|
function FunkitMeshProvider({ children }) {
|
|
11007
|
-
const [meshBrokerDataMap, setMeshBrokerDataMap] =
|
|
11058
|
+
const [meshBrokerDataMap, setMeshBrokerDataMap] = useState29(
|
|
11008
11059
|
fetchDataMapFromCache()
|
|
11009
11060
|
);
|
|
11010
11061
|
const setDataMapAndCache = useCallback19(
|
|
@@ -12029,6 +12080,19 @@ var WeBullIcon = ({ size = 24 }) => {
|
|
|
12029
12080
|
);
|
|
12030
12081
|
};
|
|
12031
12082
|
|
|
12083
|
+
// src/utils/indexBy.ts
|
|
12084
|
+
function indexBy(items, getKey) {
|
|
12085
|
+
const indexedItems = {};
|
|
12086
|
+
for (const item of items) {
|
|
12087
|
+
const key = getKey(item);
|
|
12088
|
+
if (!key) {
|
|
12089
|
+
continue;
|
|
12090
|
+
}
|
|
12091
|
+
indexedItems[key] = item;
|
|
12092
|
+
}
|
|
12093
|
+
return indexedItems;
|
|
12094
|
+
}
|
|
12095
|
+
|
|
12032
12096
|
// src/hooks/useMesh.tsx
|
|
12033
12097
|
function createFunSelectOption(exchangeName, exchangeIcon, fullInfo = true, hasActiveConnection) {
|
|
12034
12098
|
return {
|
|
@@ -12058,7 +12122,7 @@ var getMeshExchangeIconMap = (size) => ({
|
|
|
12058
12122
|
["OkCoin" /* OkCoin */]: /* @__PURE__ */ React128.createElement(OkcoinIcon, { size }),
|
|
12059
12123
|
["Etoro" /* Etoro */]: /* @__PURE__ */ React128.createElement(EtoroIcon, { size }),
|
|
12060
12124
|
["CexIo" /* CexIo */]: /* @__PURE__ */ React128.createElement(CexloIcon, { size }),
|
|
12061
|
-
["
|
|
12125
|
+
["OKX" /* Okx */]: /* @__PURE__ */ React128.createElement(OkxIcon, { size }),
|
|
12062
12126
|
["Bitfinex" /* Bitfinex */]: /* @__PURE__ */ React128.createElement(BitfinexIcon, { size }),
|
|
12063
12127
|
["BitfinexDirect" /* BitfinexDirect */]: /* @__PURE__ */ React128.createElement(BitfinexIcon, { size }),
|
|
12064
12128
|
["ETrade" /* ETrade */]: /* @__PURE__ */ React128.createElement(EtradeIcon, { size }),
|
|
@@ -12075,47 +12139,43 @@ var getMeshExchangeIconMap = (size) => ({
|
|
|
12075
12139
|
["Coinlist" /* Coinlist */]: /* @__PURE__ */ React128.createElement(CoinlistIcon, { size }),
|
|
12076
12140
|
["BitFlyer" /* BitFlyer */]: /* @__PURE__ */ React128.createElement(BitFlyerIcon, { size })
|
|
12077
12141
|
});
|
|
12078
|
-
var
|
|
12079
|
-
|
|
12080
|
-
|
|
12081
|
-
|
|
12142
|
+
var FALLBACK_EXCHANGES = ["Coinbase" /* Coinbase */, "Binance" /* Binance */];
|
|
12143
|
+
var FALLBACK_EXCHANGES_STRING = FALLBACK_EXCHANGES.join(",");
|
|
12144
|
+
var getSupportedExchanges = () => {
|
|
12145
|
+
if (typeof window !== "undefined") {
|
|
12146
|
+
return flags.getString("supported_exchanges" /* SupportedExchanges */, FALLBACK_EXCHANGES_STRING).split(",").map((exchange) => exchange.trim()).filter(Boolean);
|
|
12147
|
+
}
|
|
12148
|
+
return FALLBACK_EXCHANGES;
|
|
12149
|
+
};
|
|
12150
|
+
var EXCHANGE_NAMES = {
|
|
12151
|
+
["OKX" /* Okx */]: "OKX"
|
|
12152
|
+
};
|
|
12082
12153
|
var useMeshExchanges = ({
|
|
12083
12154
|
fullInfo = true,
|
|
12084
12155
|
iconSize = 20
|
|
12085
12156
|
}) => {
|
|
12086
12157
|
const { hasActiveConnectionCheck } = useFunkitMesh({});
|
|
12087
|
-
const options = useMemo20(() => {
|
|
12158
|
+
const { options, valueToOption } = useMemo20(() => {
|
|
12088
12159
|
const FUNKIT_MESH_EXCHANGE_DEFAULT_MAP = getMeshExchangeIconMap(iconSize);
|
|
12089
|
-
|
|
12090
|
-
|
|
12091
|
-
|
|
12092
|
-
"supported_exchanges" /* SupportedExchanges */,
|
|
12093
|
-
FALLBACK_EXCHANGES_STRING
|
|
12094
|
-
);
|
|
12095
|
-
}
|
|
12096
|
-
return supportedExchangesString.split(",").filter(Boolean).map((exchange) => {
|
|
12097
|
-
const normalizedExchange = exchange.trim();
|
|
12160
|
+
const supportedExchanges = getSupportedExchanges();
|
|
12161
|
+
const options2 = supportedExchanges.map((exchange) => {
|
|
12162
|
+
const icon = FUNKIT_MESH_EXCHANGE_DEFAULT_MAP[exchange];
|
|
12098
12163
|
return createFunSelectOption(
|
|
12099
|
-
|
|
12100
|
-
|
|
12164
|
+
EXCHANGE_NAMES[exchange] || exchange,
|
|
12165
|
+
icon,
|
|
12101
12166
|
fullInfo,
|
|
12102
|
-
hasActiveConnectionCheck(
|
|
12167
|
+
hasActiveConnectionCheck(exchange)
|
|
12103
12168
|
);
|
|
12104
12169
|
});
|
|
12170
|
+
const valueToOption2 = indexBy(options2, (item) => item.value);
|
|
12171
|
+
return { options: options2, valueToOption: valueToOption2 };
|
|
12105
12172
|
}, [fullInfo, hasActiveConnectionCheck, iconSize]);
|
|
12106
|
-
const optionsMap = useMemo20(() => {
|
|
12107
|
-
const obj = {};
|
|
12108
|
-
options.forEach((option) => {
|
|
12109
|
-
obj[`${option.value}`] = option.label;
|
|
12110
|
-
});
|
|
12111
|
-
return obj;
|
|
12112
|
-
}, [options]);
|
|
12113
12173
|
const preparePaymentInfo = (meshMeta) => {
|
|
12114
12174
|
const brokerName = meshMeta.accessToken?.brokerName ?? "";
|
|
12115
12175
|
return {
|
|
12116
12176
|
paymentMethod: "brokerage" /* BROKERAGE */,
|
|
12117
12177
|
title: brokerName,
|
|
12118
|
-
titleIcon:
|
|
12178
|
+
titleIcon: valueToOption[brokerName]?.label,
|
|
12119
12179
|
description: meshMeta.accessToken?.accountTokens?.[0]?.account?.accountId ?? "",
|
|
12120
12180
|
meta: meshMeta
|
|
12121
12181
|
};
|
|
@@ -12147,8 +12207,8 @@ var useMeshNetworkInfo = (exchange) => {
|
|
|
12147
12207
|
};
|
|
12148
12208
|
var useMeshActiveNetworkInfo = (exchange) => {
|
|
12149
12209
|
const { chain: activeChain } = useAccount8();
|
|
12150
|
-
const [meshNetworkId, setMeshNetworkId] =
|
|
12151
|
-
const [meshSupportedTokens, setMeshSupportedTokens] =
|
|
12210
|
+
const [meshNetworkId, setMeshNetworkId] = useState30(null);
|
|
12211
|
+
const [meshSupportedTokens, setMeshSupportedTokens] = useState30([]);
|
|
12152
12212
|
const networkandExchange = useRef13(`${exchange}${meshNetworkId}`);
|
|
12153
12213
|
const meshSupportedTokensEqualLength = useEqualMeshNetworkSupportedTokens(
|
|
12154
12214
|
meshSupportedTokens,
|
|
@@ -12310,7 +12370,7 @@ import React131, {
|
|
|
12310
12370
|
useContext as useContext16,
|
|
12311
12371
|
useEffect as useEffect25,
|
|
12312
12372
|
useMemo as useMemo21,
|
|
12313
|
-
useState as
|
|
12373
|
+
useState as useState31
|
|
12314
12374
|
} from "react";
|
|
12315
12375
|
|
|
12316
12376
|
// src/components/FunkitProvider/FunkitSandboxContext.tsx
|
|
@@ -12320,7 +12380,7 @@ var useIsFunkitSandboxMode = () => useContext15(FunkitSandboxContext);
|
|
|
12320
12380
|
|
|
12321
12381
|
// src/components/FunkitProvider/FunkitMoonpayProvider.tsx
|
|
12322
12382
|
var MoonPayOriginalProvider = (props) => {
|
|
12323
|
-
const [MoonPayProviderInner, setMoonPayProviderInner] =
|
|
12383
|
+
const [MoonPayProviderInner, setMoonPayProviderInner] = useState31(null);
|
|
12324
12384
|
useEffect25(() => {
|
|
12325
12385
|
const loadMoonPayProviderInner = async () => {
|
|
12326
12386
|
try {
|
|
@@ -12347,7 +12407,7 @@ function FunkitMoonpayProvider({
|
|
|
12347
12407
|
return /* @__PURE__ */ React131.createElement(MoonPayOriginalProvider, { apiKey: moonpayApiKey, debug }, /* @__PURE__ */ React131.createElement(FunkitMoonpayContext.Provider, { value: { moonpayApiKey } }, children));
|
|
12348
12408
|
}
|
|
12349
12409
|
function useFunkitUserIp() {
|
|
12350
|
-
const [userIpInfo, setUserIpInfo] =
|
|
12410
|
+
const [userIpInfo, setUserIpInfo] = useState31(
|
|
12351
12411
|
null
|
|
12352
12412
|
);
|
|
12353
12413
|
const { moonpayApiKey } = useContext16(FunkitMoonpayContext);
|
|
@@ -12394,7 +12454,7 @@ import React136, {
|
|
|
12394
12454
|
useCallback as useCallback22,
|
|
12395
12455
|
useEffect as useEffect26,
|
|
12396
12456
|
useMemo as useMemo22,
|
|
12397
|
-
useState as
|
|
12457
|
+
useState as useState32
|
|
12398
12458
|
} from "react";
|
|
12399
12459
|
|
|
12400
12460
|
// src/components/Icons/DeviceConfirmationIcon.tsx
|
|
@@ -12495,12 +12555,12 @@ function FunMeshVerificationStep({
|
|
|
12495
12555
|
exchange,
|
|
12496
12556
|
accessToken
|
|
12497
12557
|
}) {
|
|
12498
|
-
const [twoFactorCode, setTwoFactorCode] =
|
|
12558
|
+
const [twoFactorCode, setTwoFactorCode] = useState32("");
|
|
12499
12559
|
const funkitConfig = useFunkitConfig();
|
|
12500
|
-
const [screen, setScreen] =
|
|
12501
|
-
const [isExecuting, setIsExecuting] =
|
|
12502
|
-
const [executionError, setExecutionError] =
|
|
12503
|
-
const [executionContent, setExecutionContent] =
|
|
12560
|
+
const [screen, setScreen] = useState32(0 /* INITIAL */);
|
|
12561
|
+
const [isExecuting, setIsExecuting] = useState32(false);
|
|
12562
|
+
const [executionError, setExecutionError] = useState32("");
|
|
12563
|
+
const [executionContent, setExecutionContent] = useState32(null);
|
|
12504
12564
|
const executionStatus = executionContent?.status;
|
|
12505
12565
|
const isButtonVisible = useMemo22(() => {
|
|
12506
12566
|
return executionStatus && screen !== 0 /* INITIAL */ && screen !== 5 /* FAILED */;
|
|
@@ -12723,7 +12783,7 @@ var VerificationPopup = ({
|
|
|
12723
12783
|
import React144 from "react";
|
|
12724
12784
|
|
|
12725
12785
|
// src/components/FunPayments/FunPaymentMeshType.tsx
|
|
12726
|
-
import React141, { useMemo as useMemo23, useState as
|
|
12786
|
+
import React141, { useMemo as useMemo23, useState as useState33 } from "react";
|
|
12727
12787
|
import { createPortal as createPortal3 } from "react-dom";
|
|
12728
12788
|
|
|
12729
12789
|
// src/components/FunNoResults/FunNoResults.tsx
|
|
@@ -12790,8 +12850,7 @@ var FunNoResults = ({ children }) => {
|
|
|
12790
12850
|
justifyContent: "center",
|
|
12791
12851
|
alignItems: "center",
|
|
12792
12852
|
gap: "12",
|
|
12793
|
-
color: "secondaryText"
|
|
12794
|
-
paddingTop: "12"
|
|
12853
|
+
color: "secondaryText"
|
|
12795
12854
|
},
|
|
12796
12855
|
/* @__PURE__ */ React138.createElement(SearchSkeletonIcon, null),
|
|
12797
12856
|
/* @__PURE__ */ React138.createElement(Text, { color: "secondaryText", size: "10" }, children)
|
|
@@ -12896,8 +12955,8 @@ function FunPaymentMeshType({
|
|
|
12896
12955
|
isParentLoading,
|
|
12897
12956
|
onContinue
|
|
12898
12957
|
}) {
|
|
12899
|
-
const [searchInput, setSearchInput] =
|
|
12900
|
-
const [exchange, setExchange] =
|
|
12958
|
+
const [searchInput, setSearchInput] = useState33("");
|
|
12959
|
+
const [exchange, setExchange] = useState33();
|
|
12901
12960
|
const { options } = useMeshExchanges({ iconSize: 20 });
|
|
12902
12961
|
const handleSearch = (event) => {
|
|
12903
12962
|
setExchange(void 0);
|
|
@@ -12918,7 +12977,7 @@ function FunPaymentMeshType({
|
|
|
12918
12977
|
onChange: handleSearch,
|
|
12919
12978
|
prefixIcon: "SearchIcon"
|
|
12920
12979
|
}
|
|
12921
|
-
), /* @__PURE__ */ React141.createElement(Box, { style: { minHeight: 200 } }, filteredOptions?.length === 0 ? /* @__PURE__ */ React141.createElement(FunNoResults, null, "No results found") : /* @__PURE__ */ React141.createElement(
|
|
12980
|
+
), /* @__PURE__ */ React141.createElement(Box, { display: "flex", justifyContent: "center", style: { minHeight: 200 } }, filteredOptions?.length === 0 ? /* @__PURE__ */ React141.createElement(FunNoResults, null, "No results found") : /* @__PURE__ */ React141.createElement(
|
|
12922
12981
|
FunSelectBrokerage,
|
|
12923
12982
|
{
|
|
12924
12983
|
handleSelect: (selectedExchange) => {
|
|
@@ -12947,7 +13006,7 @@ function FunPaymentMeshType({
|
|
|
12947
13006
|
|
|
12948
13007
|
// src/components/FunPayments/FunPaymentMoonpayType.tsx
|
|
12949
13008
|
import { getMoonpayUrlSignature } from "@funkit/api-base";
|
|
12950
|
-
import React142, { memo, useEffect as useEffect27, useMemo as useMemo24, useState as
|
|
13009
|
+
import React142, { memo, useEffect as useEffect27, useMemo as useMemo24, useState as useState34 } from "react";
|
|
12951
13010
|
|
|
12952
13011
|
// src/utils/colors.ts
|
|
12953
13012
|
function colorToHex(color) {
|
|
@@ -12976,7 +13035,7 @@ var stretchStyle = "_1kmpeyf1";
|
|
|
12976
13035
|
|
|
12977
13036
|
// src/components/FunPayments/FunPaymentMoonpayType.tsx
|
|
12978
13037
|
var MoonPayBuyWidget = memo(function Widget(props) {
|
|
12979
|
-
const [MoonPayBuyWidgetInner, setMoonPayBuyWidgetInner] =
|
|
13038
|
+
const [MoonPayBuyWidgetInner, setMoonPayBuyWidgetInner] = useState34(null);
|
|
12980
13039
|
useEffect27(() => {
|
|
12981
13040
|
const loadMoonPayBuyWidgetInner = async () => {
|
|
12982
13041
|
try {
|
|
@@ -13001,7 +13060,7 @@ function FunPaymentMoonpayType({
|
|
|
13001
13060
|
}) {
|
|
13002
13061
|
const { active: active2 } = useActiveTheme();
|
|
13003
13062
|
const isSandboxMode = useIsFunkitSandboxMode();
|
|
13004
|
-
const [isSupportedRegion, setIsSupportedRegion] =
|
|
13063
|
+
const [isSupportedRegion, setIsSupportedRegion] = useState34(true);
|
|
13005
13064
|
const funkitConfig = useFunkitConfig();
|
|
13006
13065
|
const { userInfo } = useGeneralWallet();
|
|
13007
13066
|
const currencyCode = useMemo24(() => {
|
|
@@ -13218,7 +13277,7 @@ import {
|
|
|
13218
13277
|
meshPreviewTransfer as meshPreviewTransfer2
|
|
13219
13278
|
} from "@funkit/api-base";
|
|
13220
13279
|
import { ERC20_ABI, isAddress as isAddress3, USDT_ABI } from "@funkit/core";
|
|
13221
|
-
import React155, { useCallback as useCallback24, useMemo as useMemo29, useState as
|
|
13280
|
+
import React155, { useCallback as useCallback24, useMemo as useMemo29, useState as useState38 } from "react";
|
|
13222
13281
|
import { createPortal as createPortal5 } from "react-dom";
|
|
13223
13282
|
import { useAccount as useAccount9, useSendTransaction, useWriteContract } from "wagmi";
|
|
13224
13283
|
|
|
@@ -13242,7 +13301,7 @@ function isMainnetUsdt(chainId, address) {
|
|
|
13242
13301
|
|
|
13243
13302
|
// src/components/FunPayments/FunPaymentMethods.tsx
|
|
13244
13303
|
import { getAssetPriceInfo as getAssetPriceInfo3 } from "@funkit/api-base";
|
|
13245
|
-
import React149, { useCallback as useCallback23, useMemo as useMemo26, useState as
|
|
13304
|
+
import React149, { useCallback as useCallback23, useMemo as useMemo26, useState as useState35 } from "react";
|
|
13246
13305
|
import { createPortal as createPortal4 } from "react-dom";
|
|
13247
13306
|
|
|
13248
13307
|
// src/hooks/useUsableWalletAssetsForCheckout.ts
|
|
@@ -13384,51 +13443,38 @@ var LightningIcon = ({ color }) => {
|
|
|
13384
13443
|
};
|
|
13385
13444
|
|
|
13386
13445
|
// src/components/FunPayments/FunPaymentMethods.tsx
|
|
13446
|
+
var getBrokerageConditionalIcons = () => {
|
|
13447
|
+
const supportedExchanges = getSupportedExchanges();
|
|
13448
|
+
const iconMap = getMeshExchangeIconMap(12);
|
|
13449
|
+
return supportedExchanges.filter((exchange) => iconMap[exchange]).slice(0, 5).map((exchange) => iconMap[exchange]);
|
|
13450
|
+
};
|
|
13387
13451
|
var PAYMENT_METHOD_CONFIG = {
|
|
13388
13452
|
["balance" /* ACCOUNT_BALANCE */]: {
|
|
13389
13453
|
label: DEFAULT_TEXT_CUSTOMIZATIONS.accountBalance,
|
|
13390
13454
|
labelDynamic: (textCustomizations, walletAddress) => {
|
|
13391
13455
|
const walletSuffix = walletAddress ? ` (${walletAddress})` : "";
|
|
13392
|
-
|
|
13393
|
-
return `${textCustomizations.accountBalance}${walletSuffix}`;
|
|
13394
|
-
}
|
|
13395
|
-
return flags.getBool("payment_method_copy_v1" /* PaymentMethodCopyV1 */, false) ? `Wallet${walletSuffix}` : `${textCustomizations.accountBalance}${walletSuffix}`;
|
|
13456
|
+
return `${textCustomizations.accountBalance}${walletSuffix}`;
|
|
13396
13457
|
},
|
|
13397
13458
|
timeIconDynamic: (color) => /* @__PURE__ */ React149.createElement(LightningIcon, { color }),
|
|
13398
13459
|
timeRange: "Instant",
|
|
13399
13460
|
conditionalIcon: null,
|
|
13400
|
-
isEnabledForOnramp: false,
|
|
13401
|
-
// TODO: Deprecate
|
|
13402
13461
|
isEnabledForCheckout: true,
|
|
13403
13462
|
disclaimerTextFn: (dynamicLimit) => `${dynamicLimit} \u2022 Instant`
|
|
13404
13463
|
},
|
|
13405
13464
|
["card" /* CARD */]: {
|
|
13406
13465
|
label: DEFAULT_TEXT_CUSTOMIZATIONS.debitOrCredit,
|
|
13407
|
-
labelDynamic: (textCustomizations) =>
|
|
13408
|
-
if (textCustomizations.debitOrCredit !== DEFAULT_TEXT_CUSTOMIZATIONS.debitOrCredit) {
|
|
13409
|
-
return textCustomizations.debitOrCredit;
|
|
13410
|
-
}
|
|
13411
|
-
return flags.getBool("payment_method_copy_v1" /* PaymentMethodCopyV1 */, false) ? "Card" : textCustomizations.debitOrCredit;
|
|
13412
|
-
},
|
|
13466
|
+
labelDynamic: (textCustomizations) => textCustomizations.debitOrCredit,
|
|
13413
13467
|
timeIconDynamic: (color) => /* @__PURE__ */ React149.createElement(ClockIcon, { color }),
|
|
13414
|
-
conditionalIcon: /* @__PURE__ */ React149.createElement(CombinedCreditCardOptionsIcon, null),
|
|
13415
|
-
isEnabledForOnramp: true,
|
|
13416
|
-
// TODO: Deprecate
|
|
13468
|
+
conditionalIcon: () => /* @__PURE__ */ React149.createElement(CombinedCreditCardOptionsIcon, null),
|
|
13417
13469
|
isEnabledForCheckout: true,
|
|
13418
13470
|
disclaimerTextFn: () => "$10,000 limit \u2022 2min"
|
|
13419
13471
|
},
|
|
13420
13472
|
["brokerage" /* BROKERAGE */]: {
|
|
13421
13473
|
label: DEFAULT_TEXT_CUSTOMIZATIONS.brokerageOrExchange,
|
|
13422
|
-
labelDynamic: (textCustomizations) =>
|
|
13423
|
-
if (textCustomizations.brokerageOrExchange !== DEFAULT_TEXT_CUSTOMIZATIONS.brokerageOrExchange) {
|
|
13424
|
-
return textCustomizations.brokerageOrExchange;
|
|
13425
|
-
}
|
|
13426
|
-
return flags.getBool("payment_method_copy_v1" /* PaymentMethodCopyV1 */, false) ? "Exchange" : textCustomizations.brokerageOrExchange;
|
|
13427
|
-
},
|
|
13474
|
+
labelDynamic: (textCustomizations) => textCustomizations.brokerageOrExchange,
|
|
13428
13475
|
timeIconDynamic: (color) => /* @__PURE__ */ React149.createElement(ClockIcon, { color }),
|
|
13429
|
-
|
|
13430
|
-
|
|
13431
|
-
// TODO: Deprecate
|
|
13476
|
+
// Note: This needs to be a function fetch fresh supported exchanges instead of using the default from the server
|
|
13477
|
+
conditionalIcon: () => /* @__PURE__ */ React149.createElement(Box, { display: "flex", gap: "2", alignItems: "center" }, getBrokerageConditionalIcons()),
|
|
13432
13478
|
isEnabledForCheckout: true,
|
|
13433
13479
|
disclaimerTextFn: () => "No limit \u2022 3 mins"
|
|
13434
13480
|
},
|
|
@@ -13437,8 +13483,6 @@ var PAYMENT_METHOD_CONFIG = {
|
|
|
13437
13483
|
labelDynamic: (textCustomizations) => textCustomizations.transferCrypto,
|
|
13438
13484
|
timeIconDynamic: (color) => /* @__PURE__ */ React149.createElement(ClockIcon, { color }),
|
|
13439
13485
|
conditionalIcon: null,
|
|
13440
|
-
isEnabledForOnramp: true,
|
|
13441
|
-
// TODO: Deprecate
|
|
13442
13486
|
isEnabledForCheckout: false,
|
|
13443
13487
|
disclaimerTextFn: () => void 0
|
|
13444
13488
|
}
|
|
@@ -13472,7 +13516,7 @@ function AddPaymentMethodItem({
|
|
|
13472
13516
|
}
|
|
13473
13517
|
const getDynamicValueIconComponent = () => {
|
|
13474
13518
|
if (paymentMethod !== "balance" /* ACCOUNT_BALANCE */ || !checkoutItem || !usableWalletAssets) {
|
|
13475
|
-
return config.conditionalIcon;
|
|
13519
|
+
return config.conditionalIcon?.();
|
|
13476
13520
|
}
|
|
13477
13521
|
const uniqueChainIds = Array.from(
|
|
13478
13522
|
new Set(Object.values(usableWalletAssets).map((asset) => asset.chainId))
|
|
@@ -13503,7 +13547,7 @@ function AddPaymentMethodItem({
|
|
|
13503
13547
|
FunPaymentMethodItem,
|
|
13504
13548
|
{
|
|
13505
13549
|
isActive,
|
|
13506
|
-
keyIcon: isWalletBalanceAndAssetStillLoading ? /* @__PURE__ */ React149.createElement(SpinnerIcon, {
|
|
13550
|
+
keyIcon: isWalletBalanceAndAssetStillLoading ? /* @__PURE__ */ React149.createElement(SpinnerIcon, { size: 24 }) : /* @__PURE__ */ React149.createElement(
|
|
13507
13551
|
Box,
|
|
13508
13552
|
{
|
|
13509
13553
|
display: "flex",
|
|
@@ -13571,13 +13615,14 @@ function FunPaymentMethods({
|
|
|
13571
13615
|
const { isUserLoggedIn } = useGeneralWallet();
|
|
13572
13616
|
const { checkoutItem, updateTargetAssetAmount, getCheckoutDraftDollarValue } = useFunkitPreCheckoutInternal(checkoutId);
|
|
13573
13617
|
const defaultPaymentMethod = checkoutItem?.initSettings.config.defaultPaymentMethod;
|
|
13574
|
-
const [selectedOption, setSelectedOption] =
|
|
13618
|
+
const [selectedOption, setSelectedOption] = useState35(
|
|
13575
13619
|
defaultPaymentMethod || null
|
|
13576
13620
|
);
|
|
13577
13621
|
const usableWalletAssets = useUsableWalletAssetsForCheckout(checkoutId);
|
|
13578
13622
|
const totalUsableWalletAssetsUsd = Object.values(
|
|
13579
13623
|
usableWalletAssets ?? {}
|
|
13580
13624
|
).reduce((total, asset) => total + (asset.totalUsdValue || 0), 0);
|
|
13625
|
+
const isEmptyWallet = totalUsableWalletAssetsUsd < 0.01;
|
|
13581
13626
|
const maxUsdUsableAsset = useMemo26(() => {
|
|
13582
13627
|
if (!depositAmount || !usableWalletAssets) {
|
|
13583
13628
|
return null;
|
|
@@ -13677,7 +13722,17 @@ function FunPaymentMethods({
|
|
|
13677
13722
|
return !disabled;
|
|
13678
13723
|
});
|
|
13679
13724
|
}, [isUserLoggedIn]);
|
|
13680
|
-
const
|
|
13725
|
+
const selectablePaymentMethods = useMemo26(() => {
|
|
13726
|
+
return enabledPaymentMethods.filter((paymentMethod) => {
|
|
13727
|
+
switch (paymentMethod) {
|
|
13728
|
+
case "balance" /* ACCOUNT_BALANCE */:
|
|
13729
|
+
return !isEmptyWallet;
|
|
13730
|
+
default:
|
|
13731
|
+
return true;
|
|
13732
|
+
}
|
|
13733
|
+
});
|
|
13734
|
+
}, [isEmptyWallet, enabledPaymentMethods]);
|
|
13735
|
+
const [isContinuing, setIsContinuing] = useState35(false);
|
|
13681
13736
|
const canContinue = useMemo26(() => {
|
|
13682
13737
|
return isNotNullish(selectedOption) && Object.values(PaymentMethod).includes(selectedOption) && !isContinuing && !checkoutItem?.isDrafting && enabledPaymentMethods.includes(selectedOption);
|
|
13683
13738
|
}, [
|
|
@@ -13702,36 +13757,45 @@ function FunPaymentMethods({
|
|
|
13702
13757
|
const isLoading = notificationConfig.notificationType === "default" && isContinuing;
|
|
13703
13758
|
const bottomSectionRef = document.getElementById(CHECKOUT_MODAL_BOTTOM_BAR_ID);
|
|
13704
13759
|
function paymentMethodList() {
|
|
13705
|
-
const expressOption =
|
|
13706
|
-
|
|
13707
|
-
|
|
13708
|
-
|
|
13709
|
-
|
|
13710
|
-
|
|
13711
|
-
|
|
13712
|
-
|
|
13713
|
-
isClickable: !isContinuing,
|
|
13714
|
-
onClick: () => setSelectedOption(expressOption),
|
|
13715
|
-
disclaimerText: PAYMENT_METHOD_CONFIG[expressOption].disclaimerTextFn(
|
|
13716
|
-
formatCurrencyAndStringify(totalUsableWalletAssetsUsd)
|
|
13717
|
-
)
|
|
13718
|
-
}
|
|
13719
|
-
), /* @__PURE__ */ React149.createElement(Text, { size: "13", weight: "medium", color: "secondaryText" }, "More options"), enabledPaymentMethods.filter((pm) => pm !== expressOption).map((paymentMethod) => {
|
|
13720
|
-
return /* @__PURE__ */ React149.createElement(
|
|
13760
|
+
const expressOption = selectablePaymentMethods.includes("balance" /* ACCOUNT_BALANCE */) && hasSufficientBalance2 ? "balance" /* ACCOUNT_BALANCE */ : selectablePaymentMethods.includes("card" /* CARD */) ? "card" /* CARD */ : void 0;
|
|
13761
|
+
const unselectablePaymentMethods = enabledPaymentMethods.filter(
|
|
13762
|
+
(paymentMethod) => !selectablePaymentMethods.includes(paymentMethod)
|
|
13763
|
+
);
|
|
13764
|
+
return /* @__PURE__ */ React149.createElement(
|
|
13765
|
+
React149.Fragment,
|
|
13766
|
+
null,
|
|
13767
|
+
expressOption && /* @__PURE__ */ React149.createElement(React149.Fragment, null, /* @__PURE__ */ React149.createElement(Text, { size: "13", weight: "medium", color: "secondaryText" }, "Express checkout"), /* @__PURE__ */ React149.createElement(
|
|
13721
13768
|
AddPaymentMethodItem,
|
|
13722
13769
|
{
|
|
13723
|
-
key:
|
|
13770
|
+
key: expressOption,
|
|
13724
13771
|
checkoutId,
|
|
13725
|
-
paymentMethod,
|
|
13726
|
-
isActive:
|
|
13772
|
+
paymentMethod: expressOption,
|
|
13773
|
+
isActive: expressOption === selectedOption,
|
|
13727
13774
|
isClickable: !isContinuing,
|
|
13728
|
-
onClick: () => setSelectedOption(
|
|
13729
|
-
disclaimerText: PAYMENT_METHOD_CONFIG[
|
|
13775
|
+
onClick: () => setSelectedOption(expressOption),
|
|
13776
|
+
disclaimerText: PAYMENT_METHOD_CONFIG[expressOption].disclaimerTextFn(
|
|
13730
13777
|
formatCurrencyAndStringify(totalUsableWalletAssetsUsd)
|
|
13731
13778
|
)
|
|
13732
13779
|
}
|
|
13733
|
-
)
|
|
13734
|
-
|
|
13780
|
+
), /* @__PURE__ */ React149.createElement(Text, { size: "13", weight: "medium", color: "secondaryText" }, "More options")),
|
|
13781
|
+
// Moving unselectable payment methods to the end/bottom
|
|
13782
|
+
[...selectablePaymentMethods, ...unselectablePaymentMethods].filter((paymentMethod) => paymentMethod !== expressOption).map((paymentMethod) => {
|
|
13783
|
+
return /* @__PURE__ */ React149.createElement(
|
|
13784
|
+
AddPaymentMethodItem,
|
|
13785
|
+
{
|
|
13786
|
+
key: paymentMethod,
|
|
13787
|
+
checkoutId,
|
|
13788
|
+
paymentMethod,
|
|
13789
|
+
isActive: paymentMethod === selectedOption,
|
|
13790
|
+
isClickable: selectablePaymentMethods.includes(paymentMethod) && !isContinuing,
|
|
13791
|
+
onClick: () => setSelectedOption(paymentMethod),
|
|
13792
|
+
disclaimerText: PAYMENT_METHOD_CONFIG[paymentMethod].disclaimerTextFn(
|
|
13793
|
+
formatCurrencyAndStringify(totalUsableWalletAssetsUsd)
|
|
13794
|
+
)
|
|
13795
|
+
}
|
|
13796
|
+
);
|
|
13797
|
+
})
|
|
13798
|
+
);
|
|
13735
13799
|
}
|
|
13736
13800
|
return /* @__PURE__ */ React149.createElement(Box, null, /* @__PURE__ */ React149.createElement(Box, { display: "flex", flexDirection: "column", gap: "18" }, primaryInfo, /* @__PURE__ */ React149.createElement(
|
|
13737
13801
|
Box,
|
|
@@ -13770,7 +13834,7 @@ function FunPaymentMethods({
|
|
|
13770
13834
|
}
|
|
13771
13835
|
|
|
13772
13836
|
// src/components/FunTransactionSummary/FunTransactionSummary.tsx
|
|
13773
|
-
import React152, { useMemo as useMemo27, useState as
|
|
13837
|
+
import React152, { useMemo as useMemo27, useState as useState36 } from "react";
|
|
13774
13838
|
|
|
13775
13839
|
// src/components/Icons/CaretDownIcon.tsx
|
|
13776
13840
|
import React150 from "react";
|
|
@@ -13883,7 +13947,7 @@ function FeesLineItem({
|
|
|
13883
13947
|
isLoading,
|
|
13884
13948
|
paymentMethod
|
|
13885
13949
|
}) {
|
|
13886
|
-
const [isExpanded, setIsExpanded] =
|
|
13950
|
+
const [isExpanded, setIsExpanded] = useState36(false);
|
|
13887
13951
|
const toggle = () => setIsExpanded(!isExpanded);
|
|
13888
13952
|
const hasPlatformFees = feesItem?.platformFeesUsd && Number(feesItem.platformFeesUsd) > 0;
|
|
13889
13953
|
return /* @__PURE__ */ React152.createElement(Box, { width: "full" }, /* @__PURE__ */ React152.createElement(
|
|
@@ -13940,7 +14004,7 @@ function PaymentRouteLineItem({
|
|
|
13940
14004
|
destinationChainId
|
|
13941
14005
|
}) {
|
|
13942
14006
|
const isSameChain = destinationChainId === sourceChainId;
|
|
13943
|
-
const [isExpanded, setIsExpanded] =
|
|
14007
|
+
const [isExpanded, setIsExpanded] = useState36(false);
|
|
13944
14008
|
const toggle = () => setIsExpanded(!isExpanded);
|
|
13945
14009
|
return /* @__PURE__ */ React152.createElement(Box, { width: "full" }, /* @__PURE__ */ React152.createElement(
|
|
13946
14010
|
FunTxSummaryLineItemCollapsibleTrigger,
|
|
@@ -14133,7 +14197,7 @@ var FunInfoIcon = ({ size = 14 }) => /* @__PURE__ */ React153.createElement(
|
|
|
14133
14197
|
);
|
|
14134
14198
|
|
|
14135
14199
|
// src/components/FunCheckoutModal/FunCheckoutPrimaryInfo.tsx
|
|
14136
|
-
import React154, { useEffect as useEffect28, useMemo as useMemo28, useState as
|
|
14200
|
+
import React154, { useEffect as useEffect28, useMemo as useMemo28, useState as useState37 } from "react";
|
|
14137
14201
|
function CheckoutPrimaryInfoSnapshot({
|
|
14138
14202
|
checkoutItem,
|
|
14139
14203
|
isLoading,
|
|
@@ -14181,7 +14245,7 @@ function CheckoutPrimaryInfo({
|
|
|
14181
14245
|
preserveMinHeight = true
|
|
14182
14246
|
}) {
|
|
14183
14247
|
const { checkoutItem, getCheckoutDraftDollarValue } = useFunkitPreCheckoutInternal(checkoutId);
|
|
14184
|
-
const [isForceRefresh, setIsForceRefresh] =
|
|
14248
|
+
const [isForceRefresh, setIsForceRefresh] = useState37(false);
|
|
14185
14249
|
useEffect28(() => {
|
|
14186
14250
|
if (isForceRefresh || !isNotNullish(checkoutItem?.draftDollarValue)) {
|
|
14187
14251
|
setIsForceRefresh(false);
|
|
@@ -14392,13 +14456,13 @@ function FunCheckoutConfirmationStep({
|
|
|
14392
14456
|
const hasDraftValueAndMethodError = checkoutItem?.selectedPaymentMethodInfo?.paymentMethod === "card" /* CARD */ && isAmountInvalidForMoonpay({
|
|
14393
14457
|
amountUsd: (checkoutItem?.draftDollarValue || 0).toString()
|
|
14394
14458
|
});
|
|
14395
|
-
const [isConfirming, setIsConfirming] =
|
|
14396
|
-
const [checkoutStepMessage, setCheckoutStepMessage] =
|
|
14397
|
-
const [confirmationError, setConfirmationError] =
|
|
14459
|
+
const [isConfirming, setIsConfirming] = useState38(false);
|
|
14460
|
+
const [checkoutStepMessage, setCheckoutStepMessage] = useState38("");
|
|
14461
|
+
const [confirmationError, setConfirmationError] = useState38("");
|
|
14398
14462
|
const hasCheckoutConfirmationError = confirmationError !== "";
|
|
14399
|
-
const [isPostCheckoutLoading, setIsPostCheckoutLoading] =
|
|
14400
|
-
const [postCheckoutStepMessage, setPostCheckoutStepMessage] =
|
|
14401
|
-
const [postCheckoutError, setPostCheckoutError] =
|
|
14463
|
+
const [isPostCheckoutLoading, setIsPostCheckoutLoading] = useState38(false);
|
|
14464
|
+
const [postCheckoutStepMessage, setPostCheckoutStepMessage] = useState38("");
|
|
14465
|
+
const [postCheckoutError, setPostCheckoutError] = useState38("");
|
|
14402
14466
|
const hasPostCheckoutError = postCheckoutError !== "";
|
|
14403
14467
|
const handleMeshPostCheckout = useCallback24(
|
|
14404
14468
|
async (depositAddress) => {
|
|
@@ -14476,9 +14540,14 @@ function FunCheckoutConfirmationStep({
|
|
|
14476
14540
|
onFinish?.(depositAddress);
|
|
14477
14541
|
} catch (err) {
|
|
14478
14542
|
logger.error("postCheckoutFundingError", err);
|
|
14479
|
-
|
|
14480
|
-
|
|
14481
|
-
|
|
14543
|
+
const userRejectedRegExp = /user\s?rejected/gi;
|
|
14544
|
+
if (err instanceof Error && (userRejectedRegExp.test(err.name) || userRejectedRegExp.test(err.message))) {
|
|
14545
|
+
setPostCheckoutError("Signature denied");
|
|
14546
|
+
} else {
|
|
14547
|
+
setPostCheckoutError(
|
|
14548
|
+
"An error occurred trying to fund the checkout. Please try again or contact support for help."
|
|
14549
|
+
);
|
|
14550
|
+
}
|
|
14482
14551
|
setPostCheckoutStepMessage("");
|
|
14483
14552
|
} finally {
|
|
14484
14553
|
setIsPostCheckoutLoading(false);
|
|
@@ -14637,7 +14706,7 @@ function FunCheckoutConfirmationStep({
|
|
|
14637
14706
|
}
|
|
14638
14707
|
|
|
14639
14708
|
// src/components/FunCheckoutModal/FunCheckoutConnectExchangeStep.tsx
|
|
14640
|
-
import React161, { useCallback as useCallback25, useState as
|
|
14709
|
+
import React161, { useCallback as useCallback25, useState as useState39 } from "react";
|
|
14641
14710
|
import { createPortal as createPortal6 } from "react-dom";
|
|
14642
14711
|
|
|
14643
14712
|
// src/components/FunGuarantees/FunGuarantees.tsx
|
|
@@ -14768,8 +14837,8 @@ var FunCheckoutConnectExchangeStep = ({
|
|
|
14768
14837
|
}) => {
|
|
14769
14838
|
const { preparePaymentInfo } = useMeshExchanges({ fullInfo: false });
|
|
14770
14839
|
const { appName } = useFunkitConfig();
|
|
14771
|
-
const [meshPreError, setMeshPreError] =
|
|
14772
|
-
const [isLoadingMeshModal, setIsLoadingMeshModal] =
|
|
14840
|
+
const [meshPreError, setMeshPreError] = useState39("");
|
|
14841
|
+
const [isLoadingMeshModal, setIsLoadingMeshModal] = useState39(false);
|
|
14773
14842
|
const icon = getMeshExchangeIconMap(48)[exchange];
|
|
14774
14843
|
const handleFinish = useCallback25(
|
|
14775
14844
|
(meshMeta) => {
|
|
@@ -14809,7 +14878,7 @@ var FunCheckoutConnectExchangeStep = ({
|
|
|
14809
14878
|
FunMessage,
|
|
14810
14879
|
{
|
|
14811
14880
|
icon,
|
|
14812
|
-
title: `${appName} uses
|
|
14881
|
+
title: `${appName} uses a 3rd party to connect your ${exchange} account.`,
|
|
14813
14882
|
gap: "18"
|
|
14814
14883
|
}
|
|
14815
14884
|
), /* @__PURE__ */ React161.createElement(FunGuarantees, { exchange }), /* @__PURE__ */ React161.createElement(
|
|
@@ -14831,7 +14900,7 @@ var FunCheckoutConnectExchangeStep = ({
|
|
|
14831
14900
|
}
|
|
14832
14901
|
),
|
|
14833
14902
|
actionButtonProps: {
|
|
14834
|
-
title: "Continue to
|
|
14903
|
+
title: "Continue to 3rd Party",
|
|
14835
14904
|
onClick: onClickContinue,
|
|
14836
14905
|
isLoading: isLoadingMeshModal,
|
|
14837
14906
|
isDisabled: isLoadingMeshModal || meshPreError !== ""
|
|
@@ -14844,15 +14913,15 @@ var FunCheckoutConnectExchangeStep = ({
|
|
|
14844
14913
|
|
|
14845
14914
|
// src/components/FunCheckoutModal/FunCheckoutInputAmountStep.tsx
|
|
14846
14915
|
import { getAssetPriceInfo as getAssetPriceInfo4 } from "@funkit/api-base";
|
|
14847
|
-
import React163, { useCallback as useCallback27, useEffect as useEffect30, useMemo as useMemo30, useState as
|
|
14916
|
+
import React163, { useCallback as useCallback27, useEffect as useEffect30, useMemo as useMemo30, useState as useState41 } from "react";
|
|
14848
14917
|
import { createPortal as createPortal7 } from "react-dom";
|
|
14849
14918
|
|
|
14850
14919
|
// src/hooks/useDynamicFont.ts
|
|
14851
|
-
import { useCallback as useCallback26, useEffect as useEffect29, useRef as useRef14, useState as
|
|
14920
|
+
import { useCallback as useCallback26, useEffect as useEffect29, useRef as useRef14, useState as useState40 } from "react";
|
|
14852
14921
|
var SIZE_STEP = 1;
|
|
14853
14922
|
var ALLOWANCE = 20;
|
|
14854
14923
|
var useDynamicFont = (inputValue, max, min = 16) => {
|
|
14855
|
-
const [fontSize, setFontSize] =
|
|
14924
|
+
const [fontSize, setFontSize] = useState40(max);
|
|
14856
14925
|
const inputRef = useRef14(null);
|
|
14857
14926
|
const canvasRef = useRef14(document.createElement("canvas"));
|
|
14858
14927
|
useEffect29(() => {
|
|
@@ -14863,14 +14932,14 @@ var useDynamicFont = (inputValue, max, min = 16) => {
|
|
|
14863
14932
|
const fontSize2 = inputRef.current.style.fontSize;
|
|
14864
14933
|
const fontFamily = window.getComputedStyle(inputRef.current).fontFamily;
|
|
14865
14934
|
context.font = `${fontSize2} ${fontFamily}`;
|
|
14866
|
-
return Math.
|
|
14935
|
+
return Math.ceil(context.measureText(" " + text).width);
|
|
14867
14936
|
};
|
|
14868
14937
|
const resizeText = () => {
|
|
14869
14938
|
if (!inputRef.current) return;
|
|
14870
14939
|
const textWidth = measureTextWidth(inputValue);
|
|
14871
14940
|
if (textWidth === void 0) return;
|
|
14872
14941
|
const maxWidth = inputRef.current.getBoundingClientRect().width;
|
|
14873
|
-
if (fontSize > min && textWidth
|
|
14942
|
+
if (fontSize > min && textWidth >= maxWidth) {
|
|
14874
14943
|
setFontSize((prevSize) => prevSize - SIZE_STEP);
|
|
14875
14944
|
} else if (fontSize < max && textWidth < maxWidth - ALLOWANCE) {
|
|
14876
14945
|
setFontSize((prevSize) => prevSize + SIZE_STEP);
|
|
@@ -14931,12 +15000,12 @@ var FunCheckoutInputAmountStep = ({
|
|
|
14931
15000
|
const { isCheckoutPostActionRequired, isCheckoutCrFlow } = useCheckoutType(checkoutItem);
|
|
14932
15001
|
const isArbitraryOrTransferFlow = isCheckoutPostActionRequired || isCheckoutCrFlow;
|
|
14933
15002
|
const { walletAssets } = useGeneralWallet();
|
|
14934
|
-
const [isAmountInAbsolute, setIsAmountInAbsolute] =
|
|
14935
|
-
const [isInited, setIsInited] =
|
|
15003
|
+
const [isAmountInAbsolute, setIsAmountInAbsolute] = useState41(false);
|
|
15004
|
+
const [isInited, setIsInited] = useState41(false);
|
|
14936
15005
|
const initialAssetAmount = checkoutItem?.initSettings.config.targetAssetAmount || 0;
|
|
14937
|
-
const [amountInput, setAmountInput] =
|
|
14938
|
-
const [unitPrice, setUnitPrice] =
|
|
14939
|
-
const [errorMessage, setErrorMessage] =
|
|
15006
|
+
const [amountInput, setAmountInput] = useState41("");
|
|
15007
|
+
const [unitPrice, setUnitPrice] = useState41(null);
|
|
15008
|
+
const [errorMessage, setErrorMessage] = useState41("");
|
|
14940
15009
|
const config = checkoutItem?.initSettings?.config;
|
|
14941
15010
|
useEffect30(() => {
|
|
14942
15011
|
const fetchPrice = async () => {
|
|
@@ -14988,7 +15057,7 @@ var FunCheckoutInputAmountStep = ({
|
|
|
14988
15057
|
const { error: inputLimitError } = useAmountRestriction(
|
|
14989
15058
|
finalAmounts.usdEquivalent
|
|
14990
15059
|
);
|
|
14991
|
-
const [isContinuing, setIsContinuing] =
|
|
15060
|
+
const [isContinuing, setIsContinuing] = useState41(false);
|
|
14992
15061
|
const onClickContinue = useCallback27(async () => {
|
|
14993
15062
|
setIsContinuing(true);
|
|
14994
15063
|
updateTargetAssetAmount(finalAmounts.absoluteEquivalent);
|
|
@@ -15076,7 +15145,8 @@ var FunCheckoutInputAmountStep = ({
|
|
|
15076
15145
|
display: "flex",
|
|
15077
15146
|
gap: "3",
|
|
15078
15147
|
justifyContent: "center",
|
|
15079
|
-
alignItems: "flex-end"
|
|
15148
|
+
alignItems: "flex-end",
|
|
15149
|
+
width: "full"
|
|
15080
15150
|
},
|
|
15081
15151
|
/* @__PURE__ */ React163.createElement(
|
|
15082
15152
|
FunInput,
|
|
@@ -15119,9 +15189,8 @@ var FunCheckoutInputAmountStep = ({
|
|
|
15119
15189
|
paddingX: "6",
|
|
15120
15190
|
color: {
|
|
15121
15191
|
base: "actionColor",
|
|
15122
|
-
hover: isLoading ?
|
|
15192
|
+
hover: isLoading ? void 0 : "actionColorHover"
|
|
15123
15193
|
},
|
|
15124
|
-
disableHoverStyles: isLoading,
|
|
15125
15194
|
onClick: isLoading ? void 0 : handleIsAmountInAbsoluteToggle
|
|
15126
15195
|
},
|
|
15127
15196
|
isLoading && !convertedAmount ? /* @__PURE__ */ React163.createElement(Box, { alignItems: "center", display: "flex", gap: "8" }, /* @__PURE__ */ React163.createElement(FunSkeletonBlock, { height: "14", width: "60" }), isAmountInAbsolute || /* @__PURE__ */ React163.createElement(Text, { color: "actionColorDisabled", size: "14" }, ticker)) : /* @__PURE__ */ React163.createElement(Text, { color: "actionColorDisabled", size: "14" }, convertedAmount)
|
|
@@ -15186,7 +15255,7 @@ import {
|
|
|
15186
15255
|
FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS as FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS3,
|
|
15187
15256
|
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO7
|
|
15188
15257
|
} from "@funkit/core";
|
|
15189
|
-
import React166, { useCallback as useCallback28, useEffect as useEffect31, useMemo as useMemo31, useState as
|
|
15258
|
+
import React166, { useCallback as useCallback28, useEffect as useEffect31, useMemo as useMemo31, useState as useState42 } from "react";
|
|
15190
15259
|
import { createPortal as createPortal8 } from "react-dom";
|
|
15191
15260
|
|
|
15192
15261
|
// src/components/FunAsset/FunAssetItem.tsx
|
|
@@ -15361,11 +15430,11 @@ function MeshOrAccountSelectAsset({
|
|
|
15361
15430
|
onBack,
|
|
15362
15431
|
isOnFinishLoading
|
|
15363
15432
|
}) {
|
|
15364
|
-
const [accountHoldingsMap, setAccountHoldingsMap] =
|
|
15365
|
-
const [isLoadingAssets, setIsLoadingAssets] =
|
|
15366
|
-
const [fetchAssetsError, setFetchAssetsError] =
|
|
15433
|
+
const [accountHoldingsMap, setAccountHoldingsMap] = useState42({});
|
|
15434
|
+
const [isLoadingAssets, setIsLoadingAssets] = useState42(true);
|
|
15435
|
+
const [fetchAssetsError, setFetchAssetsError] = useState42("");
|
|
15367
15436
|
const hasFetchAssetsError = !!fetchAssetsError;
|
|
15368
|
-
const [selectedChainTokenSymbol, setSelectedChainTokenSymbol] =
|
|
15437
|
+
const [selectedChainTokenSymbol, setSelectedChainTokenSymbol] = useState42("");
|
|
15369
15438
|
const { checkoutItem, updateSourceAsset } = useFunkitPreCheckoutInternal(checkoutId);
|
|
15370
15439
|
const { isCheckoutCrFlow } = useCheckoutType(checkoutItem);
|
|
15371
15440
|
const draftDollarValueNormalized = checkoutItem?.draftDollarValue || 0;
|
|
@@ -15608,7 +15677,7 @@ function MeshOrAccountSelectAsset({
|
|
|
15608
15677
|
onFinish
|
|
15609
15678
|
]);
|
|
15610
15679
|
const { quoteNotification, clearCheckoutQuoteMessages } = useCheckoutQuoteNotification(checkoutId || "");
|
|
15611
|
-
const [insufficientAssetError, setInsufficientAssetError] =
|
|
15680
|
+
const [insufficientAssetError, setInsufficientAssetError] = useState42("");
|
|
15612
15681
|
const hasInsufficientAssetError = !!insufficientAssetError;
|
|
15613
15682
|
const { messageType, quoteMessage } = quoteNotification;
|
|
15614
15683
|
const hasError = hasFetchAssetsError || hasInsufficientAssetError || messageType === "error";
|
|
@@ -15781,7 +15850,6 @@ function FunCheckoutVerifyDetailsStep({
|
|
|
15781
15850
|
|
|
15782
15851
|
// src/components/FunCheckoutModal/FunCheckoutModal.tsx
|
|
15783
15852
|
var CHECKOUT_MODAL_BOTTOM_BAR_ID = "checkout-modal-bottom-bar";
|
|
15784
|
-
var ANIMATION_DELAY4 = 150;
|
|
15785
15853
|
function useSourceAssetConfirm(checkoutId, setCheckoutStep) {
|
|
15786
15854
|
const { checkoutItem, getCheckoutQuote } = useFunkitPreCheckoutInternal(
|
|
15787
15855
|
checkoutId || ""
|
|
@@ -15792,7 +15860,7 @@ function useSourceAssetConfirm(checkoutId, setCheckoutStep) {
|
|
|
15792
15860
|
checkoutItem?.selectedPaymentMethodInfo?.meta?.accessToken?.brokerName
|
|
15793
15861
|
);
|
|
15794
15862
|
const { accountBalancePaymentDefaultInfo, isWeb2Login } = useGeneralWallet();
|
|
15795
|
-
const [isSourceAssetConfirming, setIsSourceAssetConfirming] =
|
|
15863
|
+
const [isSourceAssetConfirming, setIsSourceAssetConfirming] = useState43(false);
|
|
15796
15864
|
const onSourceAssetConfirmed = useCallback29(
|
|
15797
15865
|
async (onStartCallback, onEndCallback) => {
|
|
15798
15866
|
try {
|
|
@@ -15944,9 +16012,9 @@ function usePickSourceAssetForCard(checkoutItem) {
|
|
|
15944
16012
|
var ESTIMATE_REFRESH_INTERVAL_SEC = 60;
|
|
15945
16013
|
function useRefreshAsset(checkoutStep, onSourceAssetConfirmed) {
|
|
15946
16014
|
const intervalRef = useRef15(void 0);
|
|
15947
|
-
const [isRegeneratingQuote, setIsRegeneratingQuote] =
|
|
15948
|
-
const [countdown, setCountdownSeconds] =
|
|
15949
|
-
const [countdownKey, setCountdownKey] =
|
|
16015
|
+
const [isRegeneratingQuote, setIsRegeneratingQuote] = useState43(false);
|
|
16016
|
+
const [countdown, setCountdownSeconds] = useState43(0);
|
|
16017
|
+
const [countdownKey, setCountdownKey] = useState43(1);
|
|
15950
16018
|
useEffect32(() => {
|
|
15951
16019
|
if (checkoutStep !== "confirmation" /* CONFIRMATION */) return;
|
|
15952
16020
|
intervalRef.current = setInterval(() => {
|
|
@@ -16015,29 +16083,22 @@ function FunCheckoutModal({
|
|
|
16015
16083
|
const mobile = isMobile();
|
|
16016
16084
|
const { textCustomizations } = useFunkitConfig();
|
|
16017
16085
|
const { updateSourceAsset, updateSelectedPaymentMethodInfo, reDraftSymbol } = useFunkitPreCheckoutInternal(checkoutId);
|
|
16018
|
-
const [isSoftHidden, setIsSoftHidden] =
|
|
16019
|
-
const [animateOut, setAnimateOut] = useState41(false);
|
|
16086
|
+
const [isSoftHidden, setIsSoftHidden] = useState43(false);
|
|
16020
16087
|
const { checkoutItem } = useFunkitPreCheckoutInternal(checkoutId || "");
|
|
16021
16088
|
const { isCheckoutPostActionRequired, isCheckoutCrFlow } = useCheckoutType(checkoutItem);
|
|
16022
|
-
const [checkoutStep, setCheckoutStep] =
|
|
16089
|
+
const [checkoutStep, setCheckoutStep] = useState43(
|
|
16023
16090
|
checkoutItem?.isFastForwarded ? (
|
|
16024
16091
|
// Direct execution flow: go directly to confirmation page
|
|
16025
16092
|
"confirmation" /* CONFIRMATION */
|
|
16026
16093
|
) : checkoutItem?.initSettings.config.disableEditing || isCheckoutPostActionRequired ? "select_payment" /* SELECT_PAYMENT_METHOD */ : "input_amount" /* INPUT_AMOUNT */
|
|
16027
16094
|
);
|
|
16095
|
+
const { animateOut, navigateTo } = useAnimatedNavigation(setCheckoutStep);
|
|
16028
16096
|
const { clearCheckoutQuoteMessages } = useCheckoutQuoteNotification(
|
|
16029
16097
|
checkoutId || ""
|
|
16030
16098
|
);
|
|
16031
16099
|
useEffect32(() => {
|
|
16032
16100
|
clearCheckoutQuoteMessages();
|
|
16033
16101
|
}, [checkoutStep]);
|
|
16034
|
-
const navigateTo = (step) => {
|
|
16035
|
-
setAnimateOut(true);
|
|
16036
|
-
setTimeout(() => {
|
|
16037
|
-
setCheckoutStep(step);
|
|
16038
|
-
setAnimateOut(false);
|
|
16039
|
-
}, ANIMATION_DELAY4);
|
|
16040
|
-
};
|
|
16041
16102
|
const titleConfig = useMemo32(() => {
|
|
16042
16103
|
const baseTitle = checkoutItem?.initSettings?.config?.modalTitle || "Checkout";
|
|
16043
16104
|
const selectedPaymentMethod2 = checkoutItem?.selectedPaymentMethodInfo?.paymentMethod;
|
|
@@ -16100,7 +16161,8 @@ function FunCheckoutModal({
|
|
|
16100
16161
|
checkoutItem?.isFastForwarded,
|
|
16101
16162
|
checkoutItem?.selectedPaymentMethodInfo?.paymentMethod,
|
|
16102
16163
|
checkoutStep,
|
|
16103
|
-
isCheckoutPostActionRequired
|
|
16164
|
+
isCheckoutPostActionRequired,
|
|
16165
|
+
navigateTo
|
|
16104
16166
|
]);
|
|
16105
16167
|
const onCloseWrapper = useCallback29(() => {
|
|
16106
16168
|
checkoutItem?.initSettings?.onClose?.();
|
|
@@ -16153,7 +16215,8 @@ function FunCheckoutModal({
|
|
|
16153
16215
|
pickSourceAssetForCard,
|
|
16154
16216
|
triggerSourceAssetConfirmedFn,
|
|
16155
16217
|
updateSelectedPaymentMethodInfo,
|
|
16156
|
-
updateSourceAsset
|
|
16218
|
+
updateSourceAsset,
|
|
16219
|
+
navigateTo
|
|
16157
16220
|
]
|
|
16158
16221
|
);
|
|
16159
16222
|
const {
|
|
@@ -16168,7 +16231,7 @@ function FunCheckoutModal({
|
|
|
16168
16231
|
updateSelectedPaymentMethodInfo(finalizedPaymentMethodInfo);
|
|
16169
16232
|
navigateTo("select_asset" /* SELECT_ASSET */);
|
|
16170
16233
|
},
|
|
16171
|
-
[updateSelectedPaymentMethodInfo]
|
|
16234
|
+
[updateSelectedPaymentMethodInfo, navigateTo]
|
|
16172
16235
|
);
|
|
16173
16236
|
const handleExchangeConfirm = (brokerage) => {
|
|
16174
16237
|
if (hasActiveConnectionCheck(brokerage)) {
|
|
@@ -16316,27 +16379,27 @@ function FunCheckoutModal({
|
|
|
16316
16379
|
|
|
16317
16380
|
// src/components/FunkitProvider/ModalContext.tsx
|
|
16318
16381
|
function useModalStateValue() {
|
|
16319
|
-
const [isModalOpen, setModalOpen] =
|
|
16382
|
+
const [isModalOpen, setModalOpen] = useState44(false);
|
|
16320
16383
|
return {
|
|
16321
16384
|
closeModal: useCallback30(() => setModalOpen(false), []),
|
|
16322
16385
|
isModalOpen,
|
|
16323
16386
|
openModal: useCallback30(() => setModalOpen(true), [])
|
|
16324
16387
|
};
|
|
16325
16388
|
}
|
|
16326
|
-
function
|
|
16327
|
-
const [isModalOpen, setModalOpen] =
|
|
16328
|
-
const [
|
|
16389
|
+
function useModalStateValueWithProp() {
|
|
16390
|
+
const [isModalOpen, setModalOpen] = useState44(false);
|
|
16391
|
+
const [prop, setProp] = useState44(null);
|
|
16329
16392
|
return {
|
|
16330
16393
|
closeModal: useCallback30(() => {
|
|
16331
16394
|
setTimeout(() => {
|
|
16332
|
-
|
|
16395
|
+
setProp(null);
|
|
16333
16396
|
}, DialogAnimationTimeOut);
|
|
16334
16397
|
setModalOpen(false);
|
|
16335
16398
|
}, []),
|
|
16336
16399
|
isModalOpen,
|
|
16337
|
-
|
|
16338
|
-
openModal: useCallback30((
|
|
16339
|
-
|
|
16400
|
+
prop,
|
|
16401
|
+
openModal: useCallback30((prop2) => {
|
|
16402
|
+
if (prop2 !== null) setProp(prop2);
|
|
16340
16403
|
setModalOpen(true);
|
|
16341
16404
|
}, [])
|
|
16342
16405
|
};
|
|
@@ -16360,26 +16423,27 @@ function ModalProvider({ children }) {
|
|
|
16360
16423
|
const {
|
|
16361
16424
|
closeModal: closeAccountModal,
|
|
16362
16425
|
isModalOpen: accountModalOpen,
|
|
16363
|
-
openModal: openAccountModal
|
|
16364
|
-
|
|
16426
|
+
openModal: openAccountModal,
|
|
16427
|
+
prop: accountModalTab
|
|
16428
|
+
} = useModalStateValueWithProp();
|
|
16365
16429
|
const {
|
|
16366
16430
|
closeModal: closeChainModal,
|
|
16367
16431
|
isModalOpen: chainModalOpen,
|
|
16368
16432
|
openModal: openChainModal
|
|
16369
16433
|
} = useModalStateValue();
|
|
16370
|
-
const [isWalletConnectModalOpen, setIsWalletConnectModalOpen] =
|
|
16434
|
+
const [isWalletConnectModalOpen, setIsWalletConnectModalOpen] = useState44(false);
|
|
16371
16435
|
const {
|
|
16372
16436
|
closeModal: closeFunCheckoutModal,
|
|
16373
16437
|
isModalOpen: funCheckoutModalOpen,
|
|
16374
16438
|
openModal: openFunCheckoutModal,
|
|
16375
|
-
|
|
16376
|
-
} =
|
|
16439
|
+
prop: funCheckoutModalId
|
|
16440
|
+
} = useModalStateValueWithProp();
|
|
16377
16441
|
const {
|
|
16378
16442
|
closeModal: closeFunCheckoutHistoryModal,
|
|
16379
16443
|
isModalOpen: funCheckoutHistoryModalOpen,
|
|
16380
16444
|
openModal: openFunCheckoutHistoryModal,
|
|
16381
|
-
|
|
16382
|
-
} =
|
|
16445
|
+
prop: depositAddressInitialPageCombined
|
|
16446
|
+
} = useModalStateValueWithProp();
|
|
16383
16447
|
const {
|
|
16384
16448
|
closeModal: closeFunDevTestModal,
|
|
16385
16449
|
isModalOpen: funDevTestModalOpen,
|
|
@@ -16412,6 +16476,7 @@ function ModalProvider({ children }) {
|
|
|
16412
16476
|
value: useMemo33(
|
|
16413
16477
|
() => ({
|
|
16414
16478
|
accountModalOpen,
|
|
16479
|
+
accountModalTab,
|
|
16415
16480
|
chainModalOpen,
|
|
16416
16481
|
connectModalOpen,
|
|
16417
16482
|
isWalletConnectModalOpen,
|
|
@@ -16430,6 +16495,7 @@ function ModalProvider({ children }) {
|
|
|
16430
16495
|
}),
|
|
16431
16496
|
[
|
|
16432
16497
|
accountModalOpen,
|
|
16498
|
+
accountModalTab,
|
|
16433
16499
|
chainModalOpen,
|
|
16434
16500
|
connectModalOpen,
|
|
16435
16501
|
isWalletConnectModalOpen,
|
|
@@ -16451,7 +16517,14 @@ function ModalProvider({ children }) {
|
|
|
16451
16517
|
},
|
|
16452
16518
|
children,
|
|
16453
16519
|
/* @__PURE__ */ React169.createElement(ConnectModal, { onClose: closeConnectModal, open: connectModalOpen }),
|
|
16454
|
-
/* @__PURE__ */ React169.createElement(
|
|
16520
|
+
/* @__PURE__ */ React169.createElement(
|
|
16521
|
+
AccountModal,
|
|
16522
|
+
{
|
|
16523
|
+
onClose: closeAccountModal,
|
|
16524
|
+
open: accountModalOpen,
|
|
16525
|
+
defaultTab: accountModalTab
|
|
16526
|
+
}
|
|
16527
|
+
),
|
|
16455
16528
|
/* @__PURE__ */ React169.createElement(ChainModal, { onClose: closeChainModal, open: chainModalOpen }),
|
|
16456
16529
|
/* @__PURE__ */ React169.createElement(
|
|
16457
16530
|
FunCheckoutModal,
|
|
@@ -16521,19 +16594,6 @@ function useFunCheckoutHistoryModal() {
|
|
|
16521
16594
|
return { funCheckoutHistoryModalOpen, openFunCheckoutHistoryModal };
|
|
16522
16595
|
}
|
|
16523
16596
|
|
|
16524
|
-
// src/utils/indexBy.ts
|
|
16525
|
-
function indexBy(items, getKey) {
|
|
16526
|
-
const indexedItems = {};
|
|
16527
|
-
for (const item of items) {
|
|
16528
|
-
const key = getKey(item);
|
|
16529
|
-
if (!key) {
|
|
16530
|
-
continue;
|
|
16531
|
-
}
|
|
16532
|
-
indexedItems[key] = item;
|
|
16533
|
-
}
|
|
16534
|
-
return indexedItems;
|
|
16535
|
-
}
|
|
16536
|
-
|
|
16537
16597
|
// src/wallets/downloadUrls.ts
|
|
16538
16598
|
var getExtensionDownloadUrl = (wallet) => {
|
|
16539
16599
|
const browser = getBrowser();
|
|
@@ -16810,15 +16870,15 @@ var FunkitWeb2Provider = ({
|
|
|
16810
16870
|
const { connectAsync } = useConnect2();
|
|
16811
16871
|
const { chains } = useConfig5();
|
|
16812
16872
|
const { connectors, disconnectAsync } = useDisconnect2();
|
|
16813
|
-
const [privy, setPrivy] =
|
|
16814
|
-
const [privyIframeUrl, setPrivyIframeUrl] =
|
|
16815
|
-
const [loginMethod, setLoginMethod] =
|
|
16873
|
+
const [privy, setPrivy] = useState45(null);
|
|
16874
|
+
const [privyIframeUrl, setPrivyIframeUrl] = useState45();
|
|
16875
|
+
const [loginMethod, setLoginMethod] = useState45(
|
|
16816
16876
|
getLoginMethodFromCache() || null
|
|
16817
16877
|
);
|
|
16818
16878
|
const wallets = useWalletConnectors();
|
|
16819
|
-
const [isLoggingIn, setIsLoggingIn] =
|
|
16820
|
-
const [loginErrorMessage, setLoginErrorMessage] =
|
|
16821
|
-
const [loggedInUser, setLoggedInUser] =
|
|
16879
|
+
const [isLoggingIn, setIsLoggingIn] = useState45(false);
|
|
16880
|
+
const [loginErrorMessage, setLoginErrorMessage] = useState45("");
|
|
16881
|
+
const [loggedInUser, setLoggedInUser] = useState45(null);
|
|
16822
16882
|
const setLoginMethodAndCache = useCallback31(
|
|
16823
16883
|
(method) => {
|
|
16824
16884
|
try {
|
|
@@ -17079,7 +17139,7 @@ var FunkitWeb2Provider = ({
|
|
|
17079
17139
|
},
|
|
17080
17140
|
[privy, setLoginMethodAndCache]
|
|
17081
17141
|
);
|
|
17082
|
-
const [isSendingOtpEmail, setIsSendingOtpEmail] =
|
|
17142
|
+
const [isSendingOtpEmail, setIsSendingOtpEmail] = useState45(false);
|
|
17083
17143
|
const handleSendOtpEmail = useCallback31(
|
|
17084
17144
|
async (emailAddress) => {
|
|
17085
17145
|
try {
|
|
@@ -17106,7 +17166,7 @@ var FunkitWeb2Provider = ({
|
|
|
17106
17166
|
},
|
|
17107
17167
|
[privy, setLoginMethodAndCache]
|
|
17108
17168
|
);
|
|
17109
|
-
const [isGeneratingFcUri, setIsGeneratingFcUri] =
|
|
17169
|
+
const [isGeneratingFcUri, setIsGeneratingFcUri] = useState45(false);
|
|
17110
17170
|
const handleGenerateFcUri = useCallback31(async () => {
|
|
17111
17171
|
try {
|
|
17112
17172
|
if (!privy) throw new Error(ERROR_MESSAGES.PRIVY_NOT_INITIALIZED);
|
|
@@ -17250,13 +17310,13 @@ function useConnectionStatus() {
|
|
|
17250
17310
|
}
|
|
17251
17311
|
|
|
17252
17312
|
// src/components/FunkitProvider/ShowBalanceContext.tsx
|
|
17253
|
-
import React171, { createContext as createContext17, useContext as useContext19, useState as
|
|
17313
|
+
import React171, { createContext as createContext17, useContext as useContext19, useState as useState46 } from "react";
|
|
17254
17314
|
var ShowBalanceContext = createContext17({
|
|
17255
17315
|
showBalance: void 0,
|
|
17256
17316
|
setShowBalance: () => void 0
|
|
17257
17317
|
});
|
|
17258
17318
|
function ShowBalanceProvider({ children }) {
|
|
17259
|
-
const [showBalance, setShowBalance] =
|
|
17319
|
+
const [showBalance, setShowBalance] = useState46();
|
|
17260
17320
|
return /* @__PURE__ */ React171.createElement(ShowBalanceContext.Provider, { value: { showBalance, setShowBalance } }, children);
|
|
17261
17321
|
}
|
|
17262
17322
|
var useShowBalance = () => useContext19(ShowBalanceContext);
|
|
@@ -17266,9 +17326,9 @@ import React172 from "react";
|
|
|
17266
17326
|
import { useAccount as useAccount12, useBalance, useConfig as useConfig6 } from "wagmi";
|
|
17267
17327
|
|
|
17268
17328
|
// src/hooks/useIsMounted.ts
|
|
17269
|
-
import { useCallback as useCallback32, useEffect as useEffect35, useState as
|
|
17329
|
+
import { useCallback as useCallback32, useEffect as useEffect35, useState as useState47 } from "react";
|
|
17270
17330
|
function useIsMounted() {
|
|
17271
|
-
const [isMounted, setIsMounted] =
|
|
17331
|
+
const [isMounted, setIsMounted] = useState47(false);
|
|
17272
17332
|
useEffect35(() => {
|
|
17273
17333
|
setIsMounted(true);
|
|
17274
17334
|
return () => {
|
|
@@ -17373,7 +17433,7 @@ function ConnectButtonRenderer({
|
|
|
17373
17433
|
chainModalOpen,
|
|
17374
17434
|
connectModalOpen,
|
|
17375
17435
|
mounted: isMounted(),
|
|
17376
|
-
openAccountModal:
|
|
17436
|
+
openAccountModal: () => openAccountModal?.(null),
|
|
17377
17437
|
openChainModal: openChainModal ?? noop2,
|
|
17378
17438
|
openConnectModal: openConnectModal ?? noop2
|
|
17379
17439
|
}));
|
|
@@ -17546,7 +17606,7 @@ function ConnectButton({
|
|
|
17546
17606
|
const chains = useFunkitConnectChains();
|
|
17547
17607
|
const connectionStatus = useConnectionStatus();
|
|
17548
17608
|
const { setShowBalance } = useShowBalance();
|
|
17549
|
-
const [ready, setReady] =
|
|
17609
|
+
const [ready, setReady] = useState48(false);
|
|
17550
17610
|
const { i18n: i18n2 } = useContext20(I18nContext);
|
|
17551
17611
|
useEffect36(() => {
|
|
17552
17612
|
setShowBalance(showBalance);
|
|
@@ -18428,7 +18488,7 @@ function setFunkitConnectVersion({ version }) {
|
|
|
18428
18488
|
localStorage.setItem(storageKey5, version);
|
|
18429
18489
|
}
|
|
18430
18490
|
function getCurrentSdkVersion() {
|
|
18431
|
-
return "3.0.0
|
|
18491
|
+
return "3.0.0";
|
|
18432
18492
|
}
|
|
18433
18493
|
function useFingerprint() {
|
|
18434
18494
|
const fingerprint = useCallback33(() => {
|