@funkit/connect 6.10.0 → 6.11.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 +13 -0
- package/dist/hooks/useFiatExchangeRates.d.ts +5 -0
- package/dist/index.css +4 -4
- package/dist/index.js +226 -118
- package/dist/modals/CheckoutModal/InputAmount/InputAmountLoaded.d.ts +4 -1
- package/dist/modals/CheckoutModal/InputAmount/state.d.ts +9 -1
- package/dist/utils/flags/config.d.ts +13 -1
- package/dist/utils/flags/impl.d.ts +13 -1
- package/dist/utils/getExchangeRate.d.ts +4 -0
- package/dist/wallets/walletConnectors/index.js +47 -47
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -522,7 +522,7 @@ import React251, {
|
|
|
522
522
|
useCallback as useCallback49,
|
|
523
523
|
useContext as useContext17,
|
|
524
524
|
useEffect as useEffect54,
|
|
525
|
-
useMemo as
|
|
525
|
+
useMemo as useMemo41,
|
|
526
526
|
useState as useState72
|
|
527
527
|
} from "react";
|
|
528
528
|
import { useConfig as useConfig6, useConnect as useConnect2, useDisconnect as useDisconnect2 } from "wagmi";
|
|
@@ -1089,7 +1089,7 @@ import React250, {
|
|
|
1089
1089
|
useCallback as useCallback48,
|
|
1090
1090
|
useContext as useContext16,
|
|
1091
1091
|
useEffect as useEffect53,
|
|
1092
|
-
useMemo as
|
|
1092
|
+
useMemo as useMemo40,
|
|
1093
1093
|
useState as useState71
|
|
1094
1094
|
} from "react";
|
|
1095
1095
|
import { useAccount as useAccount10, useAccountEffect as useAccountEffect2, useConfig as useConfig5 } from "wagmi";
|
|
@@ -3121,7 +3121,40 @@ var flagConfig = {
|
|
|
3121
3121
|
},
|
|
3122
3122
|
[FlagKey.EnableBitcoin]: {
|
|
3123
3123
|
type: "boolean",
|
|
3124
|
-
default_value:
|
|
3124
|
+
default_value: false,
|
|
3125
|
+
overrides: [
|
|
3126
|
+
{
|
|
3127
|
+
if_any: [
|
|
3128
|
+
{
|
|
3129
|
+
key: "userId",
|
|
3130
|
+
type: "pctRollout",
|
|
3131
|
+
pct: 10
|
|
3132
|
+
},
|
|
3133
|
+
{
|
|
3134
|
+
key: "userId",
|
|
3135
|
+
type: "isAnyOf",
|
|
3136
|
+
values: [
|
|
3137
|
+
"0x236c60C57a8B9ca563Fb0dA5199FDdCB686d91E8",
|
|
3138
|
+
"0x2e0Fa1cE3F0F6a85542c1E4F941116c0E885292E",
|
|
3139
|
+
"0x28b8848C6c3aaBF4669997563dc07888eb3B0960",
|
|
3140
|
+
"0x9C64fD7d9826E6d552dD8bc53e5C96F7C3F38528",
|
|
3141
|
+
"0xfe5AD22465dc20340bfFb641F4AbbcAA7a1BB2Ed",
|
|
3142
|
+
"0x9CB7F86F360459cC96C74a0F81aF2C4cC7a54bd2",
|
|
3143
|
+
"0x21b94a3E67c4a72d3D15f478A696c5175f036092",
|
|
3144
|
+
"0x2A8Bd916E85d98d8175258De99fc0ddbcC102eF6",
|
|
3145
|
+
"0x8a5505F1b274d8fC23986AF60Dd3Ca3857095BB8",
|
|
3146
|
+
"0x0B6E49e9D1528F59BaBF3C5337A4c96E987f81aa",
|
|
3147
|
+
"0x84Bc1AC5621d2B44C5D3e3E79b45C2885406026D",
|
|
3148
|
+
"0x0D0377aa9CCA769931821842aB0E1A75e7DD6dD6",
|
|
3149
|
+
"0x7B0195921183f7E04f0D331c1DAF7C1bB208CC4E",
|
|
3150
|
+
"0xda6b07Eb94f699F511a943e9bFC12B64B7fe3486",
|
|
3151
|
+
"0x3c937d73f7FE55b386c309C65087d9F5bdd1a780"
|
|
3152
|
+
]
|
|
3153
|
+
}
|
|
3154
|
+
],
|
|
3155
|
+
value: true
|
|
3156
|
+
}
|
|
3157
|
+
]
|
|
3125
3158
|
}
|
|
3126
3159
|
};
|
|
3127
3160
|
|
|
@@ -8650,7 +8683,7 @@ import {
|
|
|
8650
8683
|
formatCryptoAndStringify as formatCryptoAndStringify2,
|
|
8651
8684
|
formatCurrencyAndStringify as formatCurrencyAndStringify3
|
|
8652
8685
|
} from "@funkit/utils";
|
|
8653
|
-
import React93, { useEffect as useEffect27, useState as useState27 } from "react";
|
|
8686
|
+
import React93, { useEffect as useEffect27, useMemo as useMemo13, useState as useState27 } from "react";
|
|
8654
8687
|
import { createPortal as createPortal2 } from "react-dom";
|
|
8655
8688
|
import { useDebounce } from "use-debounce";
|
|
8656
8689
|
import { useAccount as useAccount3 } from "wagmi";
|
|
@@ -11544,9 +11577,10 @@ var useAssetSymbolPrice = ({
|
|
|
11544
11577
|
refetchInterval
|
|
11545
11578
|
});
|
|
11546
11579
|
return {
|
|
11547
|
-
...priceQuery,
|
|
11548
11580
|
asset: assetQuery.data,
|
|
11549
|
-
|
|
11581
|
+
error: assetQuery.error || priceQuery.error,
|
|
11582
|
+
isLoading: priceQuery.isLoading || assetQuery.isLoading,
|
|
11583
|
+
price: priceQuery.price
|
|
11550
11584
|
};
|
|
11551
11585
|
};
|
|
11552
11586
|
|
|
@@ -12300,7 +12334,6 @@ var WithdrawContent = ({
|
|
|
12300
12334
|
onContinue,
|
|
12301
12335
|
config,
|
|
12302
12336
|
withdrawalItem
|
|
12303
|
-
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: <explanation>
|
|
12304
12337
|
}) => {
|
|
12305
12338
|
const sourceTokenBalance = withdrawalItem?.withdrawalSourceTokenBalance?.() || 0;
|
|
12306
12339
|
const token = config.sourceTokenSymbol;
|
|
@@ -12324,30 +12357,33 @@ var WithdrawContent = ({
|
|
|
12324
12357
|
handleTokenChange,
|
|
12325
12358
|
selectedChainName
|
|
12326
12359
|
} = useWithdrawalAssets(config);
|
|
12327
|
-
const
|
|
12360
|
+
const {
|
|
12361
|
+
asset: targetAssetInfo,
|
|
12362
|
+
error: targetAssetFetchError,
|
|
12363
|
+
price: targetUnitPrice
|
|
12364
|
+
} = useAssetSymbolPrice({
|
|
12328
12365
|
chainId: selectedChainId.toString(),
|
|
12329
12366
|
symbol: selectedToken,
|
|
12330
12367
|
refetchInterval: PRICE_REFRESH_INTERVAL
|
|
12331
12368
|
});
|
|
12332
|
-
const targetAssetAmount =
|
|
12369
|
+
const targetAssetAmount = targetUnitPrice ? Number(debouncedAmount) / targetUnitPrice : void 0;
|
|
12333
12370
|
useEffect27(() => {
|
|
12334
12371
|
setTimeout(() => {
|
|
12335
12372
|
updateTargetAssetAmount(targetAssetAmount ?? 0);
|
|
12336
12373
|
}, 0);
|
|
12337
12374
|
}, [targetAssetAmount, updateTargetAssetAmount]);
|
|
12338
12375
|
useEffect27(() => {
|
|
12339
|
-
|
|
12340
|
-
if (!asset) {
|
|
12376
|
+
if (!targetAssetInfo) {
|
|
12341
12377
|
return;
|
|
12342
12378
|
}
|
|
12343
12379
|
updateTargetAsset({
|
|
12344
|
-
targetAsset:
|
|
12380
|
+
targetAsset: targetAssetInfo.address,
|
|
12345
12381
|
targetChain: selectedChainId.toString(),
|
|
12346
|
-
targetAssetTicker:
|
|
12382
|
+
targetAssetTicker: targetAssetInfo.symbol,
|
|
12347
12383
|
targetAssetMinAmount: 0,
|
|
12348
12384
|
iconSrc: getTokenIconUrl(selectedToken)
|
|
12349
12385
|
});
|
|
12350
|
-
}, [
|
|
12386
|
+
}, [targetAssetInfo, updateTargetAsset, selectedChainId, selectedToken]);
|
|
12351
12387
|
const {
|
|
12352
12388
|
isLoading: isQuoteLoading,
|
|
12353
12389
|
data: quote,
|
|
@@ -12361,7 +12397,7 @@ var WithdrawContent = ({
|
|
|
12361
12397
|
sourceAmount: Number(debouncedAmount),
|
|
12362
12398
|
chainId: selectedChainId.toString(),
|
|
12363
12399
|
symbol: selectedToken,
|
|
12364
|
-
targetAsset:
|
|
12400
|
+
targetAsset: targetAssetInfo?.address
|
|
12365
12401
|
});
|
|
12366
12402
|
const {
|
|
12367
12403
|
isConnected,
|
|
@@ -12480,7 +12516,7 @@ var WithdrawContent = ({
|
|
|
12480
12516
|
const bottomSectionRef = useBottomSectionRef("withdrawal");
|
|
12481
12517
|
const showAddressError = addressInputTouched && !isValidAddress && recipientAddress !== "";
|
|
12482
12518
|
const showAmountError = amountInputTouched && amount !== "" && !isWithdrawAmountValid;
|
|
12483
|
-
const canContinue = recipientAddress && amount && token && selectedChainId && (
|
|
12519
|
+
const canContinue = recipientAddress && amount && token && selectedChainId && (quote || isPlaceholderData || isQuoteLoading && isInstantQuoting) && !showAmountError && !showAddressError && !isCheckingAddressRisk && !addressAssessment && isValidAddressAndChain && amount === debouncedAmount;
|
|
12484
12520
|
const { totalImpactUsd, gasUsd } = extractRelayFeeInfo(
|
|
12485
12521
|
quote?.baseQuote?.metadata
|
|
12486
12522
|
);
|
|
@@ -12488,6 +12524,24 @@ var WithdrawContent = ({
|
|
|
12488
12524
|
const receiveAmountFiat = quote || isInstantQuoting ? Number(debouncedAmount || 0) : 0;
|
|
12489
12525
|
const receiveAmountFiatTotal = receiveAmountFiat - totalImpactUsd - gasUsd;
|
|
12490
12526
|
const withdrawButtonText = getWithdrawButtonText();
|
|
12527
|
+
const errorNotification = useMemo13(() => {
|
|
12528
|
+
if (quoteErrorObject) {
|
|
12529
|
+
return {
|
|
12530
|
+
message: getRelayQuoteErrorDisplayMessage(quoteErrorObject.message),
|
|
12531
|
+
type: "default"
|
|
12532
|
+
};
|
|
12533
|
+
}
|
|
12534
|
+
if (withdrawalError) {
|
|
12535
|
+
return withdrawalError;
|
|
12536
|
+
}
|
|
12537
|
+
if (targetAssetFetchError) {
|
|
12538
|
+
return {
|
|
12539
|
+
message: "Failed to fetch asset price",
|
|
12540
|
+
type: "default"
|
|
12541
|
+
};
|
|
12542
|
+
}
|
|
12543
|
+
return null;
|
|
12544
|
+
}, [quoteErrorObject, targetAssetFetchError, withdrawalError]);
|
|
12491
12545
|
return /* @__PURE__ */ React93.createElement(Box, { id: "withdrawal-flow", display: "flex", flexDirection: "column", gap: "18" }, /* @__PURE__ */ React93.createElement(Box, { display: "flex", flexDirection: "column", gap: "8" }, /* @__PURE__ */ React93.createElement(Box, { display: "flex", flexDirection: "column", gap: "4" }, /* @__PURE__ */ React93.createElement(Text, { size: "12", weight: "medium" }, "Recipient address"), /* @__PURE__ */ React93.createElement(
|
|
12492
12546
|
FunInput,
|
|
12493
12547
|
{
|
|
@@ -12632,9 +12686,9 @@ var WithdrawContent = ({
|
|
|
12632
12686
|
topSection: /* @__PURE__ */ React93.createElement(
|
|
12633
12687
|
FunNotification,
|
|
12634
12688
|
{
|
|
12635
|
-
description:
|
|
12636
|
-
type:
|
|
12637
|
-
isVisible: !!
|
|
12689
|
+
description: errorNotification?.message,
|
|
12690
|
+
type: errorNotification?.type,
|
|
12691
|
+
isVisible: !!errorNotification
|
|
12638
12692
|
}
|
|
12639
12693
|
),
|
|
12640
12694
|
actionButtonProps: {
|
|
@@ -12674,7 +12728,7 @@ function getCheckoutCompletionTime(checkout) {
|
|
|
12674
12728
|
}
|
|
12675
12729
|
|
|
12676
12730
|
// src/components/FunCheckoutHistory/FunCheckoutHistoryDetail.tsx
|
|
12677
|
-
import React215, { useCallback as useCallback42, useMemo as
|
|
12731
|
+
import React215, { useCallback as useCallback42, useMemo as useMemo35, useState as useState61 } from "react";
|
|
12678
12732
|
import { createPortal as createPortal14 } from "react-dom";
|
|
12679
12733
|
|
|
12680
12734
|
// src/components/HelpAlert/HelpAlert.tsx
|
|
@@ -13362,7 +13416,7 @@ import {
|
|
|
13362
13416
|
FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS as FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS3,
|
|
13363
13417
|
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO12
|
|
13364
13418
|
} from "@funkit/chains";
|
|
13365
|
-
import { useMemo as
|
|
13419
|
+
import { useMemo as useMemo14 } from "react";
|
|
13366
13420
|
|
|
13367
13421
|
// src/utils/assets.ts
|
|
13368
13422
|
import { formatUnits } from "viem";
|
|
@@ -13420,7 +13474,7 @@ var processWalletAssets = (walletAssets, targetChain) => {
|
|
|
13420
13474
|
};
|
|
13421
13475
|
function useWalletAssetHoldings(targetChain) {
|
|
13422
13476
|
const { walletAssets, isLoading, totalWalletAssetsUsd } = useWalletAssets();
|
|
13423
|
-
const processedAssets =
|
|
13477
|
+
const processedAssets = useMemo14(
|
|
13424
13478
|
() => processWalletAssets(walletAssets, targetChain),
|
|
13425
13479
|
[targetChain, walletAssets]
|
|
13426
13480
|
);
|
|
@@ -14907,7 +14961,7 @@ var BankIconActive = ({ size = 20 }) => {
|
|
|
14907
14961
|
|
|
14908
14962
|
// src/components/FunConnectOptions/FunSignInStep.tsx
|
|
14909
14963
|
import { groupBy, isMobile as isMobile8, isSafari as isSafari3, redirectInMobile as redirectInMobile2 } from "@funkit/utils";
|
|
14910
|
-
import React209, { Fragment as Fragment2, useCallback as useCallback41, useMemo as
|
|
14964
|
+
import React209, { Fragment as Fragment2, useCallback as useCallback41, useMemo as useMemo34, useState as useState59 } from "react";
|
|
14911
14965
|
|
|
14912
14966
|
// src/providers/walletConnectDeepLink.ts
|
|
14913
14967
|
var storageKey2 = "WALLETCONNECT_DEEPLINK_CHOICE";
|
|
@@ -15325,7 +15379,7 @@ var SocialsIcon = () => {
|
|
|
15325
15379
|
};
|
|
15326
15380
|
|
|
15327
15381
|
// src/components/FunConnectOptions/FunConnectOptions.tsx
|
|
15328
|
-
import React208, { useCallback as useCallback40, useMemo as
|
|
15382
|
+
import React208, { useCallback as useCallback40, useMemo as useMemo33, useState as useState58 } from "react";
|
|
15329
15383
|
|
|
15330
15384
|
// src/hooks/useAnimatedNavigation.ts
|
|
15331
15385
|
import { useCallback as useCallback19, useState as useState29 } from "react";
|
|
@@ -15405,11 +15459,11 @@ import {
|
|
|
15405
15459
|
} from "react";
|
|
15406
15460
|
|
|
15407
15461
|
// src/hooks/useCheckoutQuoteNotification.ts
|
|
15408
|
-
import { useMemo as
|
|
15462
|
+
import { useMemo as useMemo15 } from "react";
|
|
15409
15463
|
function useCheckoutQuoteNotification() {
|
|
15410
15464
|
const { clearCheckoutQuoteMessages } = useQuoteContext();
|
|
15411
15465
|
const { quoteErrorMessage, quoteStepMessage } = useQuoteContext();
|
|
15412
|
-
const quoteNotification =
|
|
15466
|
+
const quoteNotification = useMemo15(() => {
|
|
15413
15467
|
if (quoteErrorMessage !== "") {
|
|
15414
15468
|
return {
|
|
15415
15469
|
messageType: "error",
|
|
@@ -16907,7 +16961,7 @@ function CheckoutHelp({
|
|
|
16907
16961
|
}
|
|
16908
16962
|
|
|
16909
16963
|
// src/modals/CheckoutModal/ConfirmationStep/ConfirmationStep.tsx
|
|
16910
|
-
import React149, { useEffect as useEffect34, useMemo as
|
|
16964
|
+
import React149, { useEffect as useEffect34, useMemo as useMemo20, useState as useState40 } from "react";
|
|
16911
16965
|
import { createPortal as createPortal7 } from "react-dom";
|
|
16912
16966
|
|
|
16913
16967
|
// src/providers/UserPresenceContext.tsx
|
|
@@ -17009,7 +17063,7 @@ import {
|
|
|
17009
17063
|
} from "@funkit/utils";
|
|
17010
17064
|
import NumberFlow from "@number-flow/react";
|
|
17011
17065
|
import { motion as motion7 } from "motion/react";
|
|
17012
|
-
import React138, { useMemo as
|
|
17066
|
+
import React138, { useMemo as useMemo17 } from "react";
|
|
17013
17067
|
|
|
17014
17068
|
// src/consts/design.ts
|
|
17015
17069
|
var mapFontLineHeightToNumberFlowHeight = {
|
|
@@ -17028,7 +17082,7 @@ function useReceiveAmountLabel(_) {
|
|
|
17028
17082
|
// src/components/FunAssetAvatar/FunAssetAvatar.tsx
|
|
17029
17083
|
import { isNotNullish as isNotNullish6 } from "@funkit/utils";
|
|
17030
17084
|
import clsx16 from "clsx";
|
|
17031
|
-
import React137, { useMemo as
|
|
17085
|
+
import React137, { useMemo as useMemo16 } from "react";
|
|
17032
17086
|
|
|
17033
17087
|
// src/components/FunAssetAvatar/FunAssetAvatar.css.ts
|
|
17034
17088
|
var chainContainerStyle = "uwrdc22 _1rsrm2f18 _1rsrm2fa _1rsrm2f4 _1rsrm2f4g";
|
|
@@ -17048,7 +17102,7 @@ function FunAssetAvatar({
|
|
|
17048
17102
|
largeChainIcon = false
|
|
17049
17103
|
}) {
|
|
17050
17104
|
const chainMetadata = chainMetadataById[Number.parseInt((chainId || "").toString())] || null;
|
|
17051
|
-
const finalAssetSrc =
|
|
17105
|
+
const finalAssetSrc = useMemo16(() => {
|
|
17052
17106
|
const normalizedTicker = assetTicker?.toUpperCase() || "";
|
|
17053
17107
|
const defaultSrc = ASSET_LOGO_SRCS[normalizedTicker];
|
|
17054
17108
|
if (prioritizeDefaults) {
|
|
@@ -17148,7 +17202,7 @@ function PaymentAmountSummary({
|
|
|
17148
17202
|
})
|
|
17149
17203
|
});
|
|
17150
17204
|
const sourceTokenAmount = quote?.finalPaymentTokenAmount ? Number.parseFloat(quote.finalPaymentTokenAmount) : void 0;
|
|
17151
|
-
const paymentTokenUsdAmount =
|
|
17205
|
+
const paymentTokenUsdAmount = useMemo17(() => {
|
|
17152
17206
|
if (!quote) {
|
|
17153
17207
|
return void 0;
|
|
17154
17208
|
}
|
|
@@ -17156,7 +17210,7 @@ function PaymentAmountSummary({
|
|
|
17156
17210
|
quote.baseQuote.estSubtotalUsd + Number.parseFloat(quote.finalPaymentFeeUsd) - Number.parseFloat(quote.finalSpreadUsd)
|
|
17157
17211
|
);
|
|
17158
17212
|
}, [quote]);
|
|
17159
|
-
const receiveTokenUsdAmount =
|
|
17213
|
+
const receiveTokenUsdAmount = useMemo17(() => {
|
|
17160
17214
|
if (!quote) {
|
|
17161
17215
|
return void 0;
|
|
17162
17216
|
}
|
|
@@ -17475,7 +17529,7 @@ var DirectExecutionBrokerageAndCardAlert = () => {
|
|
|
17475
17529
|
};
|
|
17476
17530
|
|
|
17477
17531
|
// src/modals/CheckoutModal/ConfirmationStep/DisclaimerText.tsx
|
|
17478
|
-
import React144, { useMemo as
|
|
17532
|
+
import React144, { useMemo as useMemo18 } from "react";
|
|
17479
17533
|
var DisclaimerText = ({
|
|
17480
17534
|
continueText,
|
|
17481
17535
|
isCardPayment,
|
|
@@ -17510,7 +17564,7 @@ var DisclaimerText = ({
|
|
|
17510
17564
|
), ", and the ", /* @__PURE__ */ React144.createElement(FunLinkButton, { href: "https://morpho.org/", inline: true, text: "terms" }), " applicable to third-party Morpho vaults", ".") : /* @__PURE__ */ React144.createElement(React144.Fragment, null, showCardDisclaimer && `${cardDisclaimer} `, "By clicking on ", continueText, ", you agree to our", " ", /* @__PURE__ */ React144.createElement(FunLinkButton, { href: FUN_TERMS_URL, inline: true, text: "terms" }), ".");
|
|
17511
17565
|
};
|
|
17512
17566
|
function useCardDisclaimer(checkoutItem, finalConvertedAssetName) {
|
|
17513
|
-
const cardDisclaimer =
|
|
17567
|
+
const cardDisclaimer = useMemo18(() => {
|
|
17514
17568
|
if (!checkoutItem || !finalConvertedAssetName) {
|
|
17515
17569
|
return null;
|
|
17516
17570
|
}
|
|
@@ -18093,7 +18147,7 @@ function usePostCheckout({
|
|
|
18093
18147
|
}
|
|
18094
18148
|
|
|
18095
18149
|
// src/modals/CheckoutModal/ConfirmationStep/useQuoteRefresh.ts
|
|
18096
|
-
import { useCallback as useCallback26, useEffect as useEffect33, useMemo as
|
|
18150
|
+
import { useCallback as useCallback26, useEffect as useEffect33, useMemo as useMemo19, useRef as useRef15, useState as useState39 } from "react";
|
|
18097
18151
|
|
|
18098
18152
|
// src/hooks/useCountdown.tsx
|
|
18099
18153
|
import React148 from "react";
|
|
@@ -18356,7 +18410,7 @@ function useQuoteRefresh({
|
|
|
18356
18410
|
},
|
|
18357
18411
|
[isOnHold, restartCountdown, setCheckoutQuote, triggerAssetConfirm]
|
|
18358
18412
|
);
|
|
18359
|
-
const quoteError =
|
|
18413
|
+
const quoteError = useMemo19(() => {
|
|
18360
18414
|
if (quoteErrorMessage && !isQuoting) {
|
|
18361
18415
|
return {
|
|
18362
18416
|
message: quoteErrorMessage,
|
|
@@ -18489,7 +18543,7 @@ function ConfirmationStep({
|
|
|
18489
18543
|
refreshIntervalSeconds: directExecutionType === DirectExecutionType2.RELAY ? RELAY_ESTIMATE_REFRESH_INTERVAL_SEC : DEFAULT_ESTIMATE_REFRESH_INTERVAL_SEC
|
|
18490
18544
|
})
|
|
18491
18545
|
);
|
|
18492
|
-
const error =
|
|
18546
|
+
const error = useMemo20(() => {
|
|
18493
18547
|
if (!isInitialQuoting && moonpayAmountCheck?.isInvalid) {
|
|
18494
18548
|
return {
|
|
18495
18549
|
message: moonpayAmountCheck.message,
|
|
@@ -18504,7 +18558,7 @@ function ConfirmationStep({
|
|
|
18504
18558
|
quoteError,
|
|
18505
18559
|
isInitialQuoting
|
|
18506
18560
|
]);
|
|
18507
|
-
const stepMessage =
|
|
18561
|
+
const stepMessage = useMemo20(() => {
|
|
18508
18562
|
if (initialQuoteStep) {
|
|
18509
18563
|
return initialQuoteStep;
|
|
18510
18564
|
}
|
|
@@ -18561,7 +18615,7 @@ function ConfirmationStep({
|
|
|
18561
18615
|
const isStepLoading = isInitialQuoting || isContinuing || isRefreshing;
|
|
18562
18616
|
const uiCustomizations = funkitConfig.uiCustomizations?.confirmationScreen;
|
|
18563
18617
|
const customRecipient = checkoutItem?.initSettings.config.customRecipient;
|
|
18564
|
-
const showKatanaBridgeAlert =
|
|
18618
|
+
const showKatanaBridgeAlert = useMemo20(() => {
|
|
18565
18619
|
const relayQuoteMetadata = latestQuote?.baseQuote?.metadata;
|
|
18566
18620
|
if (!relayQuoteMetadata) {
|
|
18567
18621
|
return false;
|
|
@@ -18575,7 +18629,7 @@ function ConfirmationStep({
|
|
|
18575
18629
|
// https://fun-xyz.slack.com/archives/C08PVUDA1M2/p1752179735981389?thread_ts=1752176009.628309&cid=C08PVUDA1M2
|
|
18576
18630
|
swapImpact + appFeePercent > KATANA_BRIDGE_ALERT_THRESHOLD_PERCENT;
|
|
18577
18631
|
}, [funkitConfig.apiKey, latestQuote, checkoutItem]);
|
|
18578
|
-
const showDirectExecutionNotificationBanner =
|
|
18632
|
+
const showDirectExecutionNotificationBanner = useMemo20(() => {
|
|
18579
18633
|
const isRelayEnabled = checkoutItem !== null && getIsRelayEnabled({
|
|
18580
18634
|
fromChainId: checkoutItem.selectedSourceAssetInfo.chainId,
|
|
18581
18635
|
fromTokenAddress: checkoutItem.selectedSourceAssetInfo.address || "",
|
|
@@ -18972,8 +19026,27 @@ var useMeldLimitError = (amount, fiatCurrency) => {
|
|
|
18972
19026
|
return void 0;
|
|
18973
19027
|
};
|
|
18974
19028
|
|
|
19029
|
+
// src/hooks/useFiatExchangeRates.ts
|
|
19030
|
+
import { getFiatExchangeRates } from "@funkit/api-base";
|
|
19031
|
+
import { useQuery as useQuery15 } from "@tanstack/react-query";
|
|
19032
|
+
function useFiatExchangeRates(enabled = true) {
|
|
19033
|
+
const { data, isLoading, error } = useQuery15({
|
|
19034
|
+
queryKey: ["fiatExchangeRates"],
|
|
19035
|
+
queryFn: () => getFiatExchangeRates(),
|
|
19036
|
+
refetchOnMount: false,
|
|
19037
|
+
refetchOnReconnect: false,
|
|
19038
|
+
refetchOnWindowFocus: false,
|
|
19039
|
+
gcTime: 1e3 * 60 * 60,
|
|
19040
|
+
// 1 hour
|
|
19041
|
+
enabled
|
|
19042
|
+
});
|
|
19043
|
+
return { data, isLoading, error };
|
|
19044
|
+
}
|
|
19045
|
+
|
|
18975
19046
|
// src/modals/CheckoutModal/InputAmount/InputAmountLoaded.tsx
|
|
18976
|
-
import {
|
|
19047
|
+
import {
|
|
19048
|
+
MeldServiceProvider as MeldServiceProvider2
|
|
19049
|
+
} from "@funkit/api-base";
|
|
18977
19050
|
import {
|
|
18978
19051
|
FlagKey as FlagKey23,
|
|
18979
19052
|
formatCryptoAndStringify as formatCryptoAndStringify4,
|
|
@@ -18981,7 +19054,7 @@ import {
|
|
|
18981
19054
|
isTokenEquivalent as isTokenEquivalent5,
|
|
18982
19055
|
round as round4
|
|
18983
19056
|
} from "@funkit/utils";
|
|
18984
|
-
import React163, { useMemo as
|
|
19057
|
+
import React163, { useMemo as useMemo22 } from "react";
|
|
18985
19058
|
|
|
18986
19059
|
// src/components/CurrencySelector/CurrencySelector.tsx
|
|
18987
19060
|
import React152 from "react";
|
|
@@ -20162,7 +20235,7 @@ var useMeldLink = (sourceAmount, sourceCurrencyCode = "USD") => {
|
|
|
20162
20235
|
|
|
20163
20236
|
// src/modals/CheckoutModal/MeldQuotes/useMeldQuotes.tsx
|
|
20164
20237
|
import { getMeldQuotes } from "@funkit/api-base";
|
|
20165
|
-
import { useQuery as
|
|
20238
|
+
import { useQuery as useQuery16 } from "@tanstack/react-query";
|
|
20166
20239
|
import { useDebounce as useDebounce2 } from "use-debounce";
|
|
20167
20240
|
var DEBOUNCE_DELAY = 500;
|
|
20168
20241
|
var COUNTDOWN_INTERVAL_SEC = 60;
|
|
@@ -20175,7 +20248,7 @@ var useMeldQuotes = (sourceAmount, fiatCurrency) => {
|
|
|
20175
20248
|
const destinationCurrencyCode = useMeldCryptoCurrencyCode();
|
|
20176
20249
|
const isPolymarket = isPolymarketCustomer(apiKey);
|
|
20177
20250
|
const sourceCurrencyCode = fiatCurrency || "USD";
|
|
20178
|
-
const query =
|
|
20251
|
+
const query = useQuery16({
|
|
20179
20252
|
queryKey: [
|
|
20180
20253
|
"meld",
|
|
20181
20254
|
"quotes",
|
|
@@ -20228,6 +20301,22 @@ var useMeldQuotes = (sourceAmount, fiatCurrency) => {
|
|
|
20228
20301
|
};
|
|
20229
20302
|
};
|
|
20230
20303
|
|
|
20304
|
+
// src/utils/getExchangeRate.ts
|
|
20305
|
+
var DEFAULT_BIPS_MARKUP = 500;
|
|
20306
|
+
var getExchangeRate = (currency, currencyExchangeRates, bipsMarkup = DEFAULT_BIPS_MARKUP) => {
|
|
20307
|
+
if (!currency || !currencyExchangeRates) {
|
|
20308
|
+
return void 0;
|
|
20309
|
+
}
|
|
20310
|
+
if (currency === "USD") {
|
|
20311
|
+
return 1;
|
|
20312
|
+
}
|
|
20313
|
+
const exchangeRate = currency in currencyExchangeRates ? currencyExchangeRates[currency] : void 0;
|
|
20314
|
+
if (!exchangeRate) {
|
|
20315
|
+
return void 0;
|
|
20316
|
+
}
|
|
20317
|
+
return exchangeRate * (1 + bipsMarkup / 1e4);
|
|
20318
|
+
};
|
|
20319
|
+
|
|
20231
20320
|
// src/components/Icons/SwitchIcon.tsx
|
|
20232
20321
|
import React160 from "react";
|
|
20233
20322
|
var SwitchIcon = () => {
|
|
@@ -20519,7 +20608,7 @@ var QuickOptions = ({
|
|
|
20519
20608
|
import {
|
|
20520
20609
|
useCallback as useCallback29,
|
|
20521
20610
|
useEffect as useEffect35,
|
|
20522
|
-
useMemo as
|
|
20611
|
+
useMemo as useMemo21,
|
|
20523
20612
|
useReducer as useReducer3,
|
|
20524
20613
|
useRef as useRef17,
|
|
20525
20614
|
useState as useState42
|
|
@@ -20588,9 +20677,11 @@ function initializeState({
|
|
|
20588
20677
|
paymentMethod,
|
|
20589
20678
|
quickOptions,
|
|
20590
20679
|
sourceHolding,
|
|
20591
|
-
unitPrice: realUnitPrice
|
|
20680
|
+
unitPrice: realUnitPrice,
|
|
20681
|
+
fiatCurrencyExchangeRate,
|
|
20682
|
+
meldEnabled
|
|
20592
20683
|
}) {
|
|
20593
|
-
const { targetAssetAmount, targetChain, targetAssetTicker } = checkoutConfig;
|
|
20684
|
+
const { targetAssetAmount, targetChain, targetAssetTicker, isDefiMode } = checkoutConfig;
|
|
20594
20685
|
const isInputInFiat = true;
|
|
20595
20686
|
const unitPrice = isStablecoin(targetAssetTicker) ? 1 : realUnitPrice;
|
|
20596
20687
|
const usdAvailableAmount = getUsdAvailableAmount(
|
|
@@ -20622,14 +20713,24 @@ function initializeState({
|
|
|
20622
20713
|
if (defaultAmount !== void 0) {
|
|
20623
20714
|
return defaultAmount;
|
|
20624
20715
|
}
|
|
20716
|
+
const targetAssetFiat = typeof targetAssetAmount !== "undefined" ? targetAssetAmount * unitPrice : void 0;
|
|
20625
20717
|
if (paymentMethod === "balance" /* ACCOUNT_BALANCE */) {
|
|
20718
|
+
if (isDefiMode && typeof targetAssetFiat !== "undefined" && usdAvailableAmount !== null && usdAvailableAmount >= targetAssetFiat) {
|
|
20719
|
+
return targetAssetFiat;
|
|
20720
|
+
}
|
|
20626
20721
|
return calcInitialFiatAmount(usdAvailableAmount ?? 0);
|
|
20627
20722
|
}
|
|
20723
|
+
if (isDefiMode && !meldEnabled && typeof targetAssetFiat !== "undefined") {
|
|
20724
|
+
return targetAssetFiat;
|
|
20725
|
+
}
|
|
20726
|
+
if (typeof targetAssetFiat !== "undefined" && typeof fiatCurrencyExchangeRate !== "undefined" && isDefiMode) {
|
|
20727
|
+
return targetAssetFiat * fiatCurrencyExchangeRate;
|
|
20728
|
+
}
|
|
20628
20729
|
if (paymentMethod === "card" /* CARD */) {
|
|
20629
20730
|
return getDefaultAmountFromQuickOptions(quickOptions);
|
|
20630
20731
|
}
|
|
20631
|
-
if (
|
|
20632
|
-
return
|
|
20732
|
+
if (typeof targetAssetFiat !== "undefined") {
|
|
20733
|
+
return targetAssetFiat;
|
|
20633
20734
|
}
|
|
20634
20735
|
return USD_INITIAL_AMOUNT;
|
|
20635
20736
|
}
|
|
@@ -20642,7 +20743,9 @@ function initializeState({
|
|
|
20642
20743
|
locale,
|
|
20643
20744
|
usdAvailableAmount,
|
|
20644
20745
|
usdMaxAmount,
|
|
20645
|
-
usdMinAmount
|
|
20746
|
+
usdMinAmount,
|
|
20747
|
+
fiatCurrencyExchangeRate,
|
|
20748
|
+
meldEnabled
|
|
20646
20749
|
};
|
|
20647
20750
|
}
|
|
20648
20751
|
function reduceState(state, action) {
|
|
@@ -20766,7 +20869,7 @@ var MAX_WIDTH = 310;
|
|
|
20766
20869
|
function useAmountInput(options) {
|
|
20767
20870
|
const isMeldEnabled = useIsMeldEnabled();
|
|
20768
20871
|
const [state, dispatch] = useReducer3(reduceState, options, initializeState);
|
|
20769
|
-
const derivedState =
|
|
20872
|
+
const derivedState = useMemo21(() => getDerivedState(state), [state]);
|
|
20770
20873
|
const inputRef = useRef17(null);
|
|
20771
20874
|
const { inputValue, locale } = state;
|
|
20772
20875
|
const { inputDecimals, inputPrefix, placeholder } = derivedState;
|
|
@@ -21098,6 +21201,7 @@ function InputAmountLoaded({
|
|
|
21098
21201
|
onClose,
|
|
21099
21202
|
sourceHolding,
|
|
21100
21203
|
unitPrice,
|
|
21204
|
+
currencyExchangeRates,
|
|
21101
21205
|
defaultFiatCurrency,
|
|
21102
21206
|
textCustomizations
|
|
21103
21207
|
}) {
|
|
@@ -21108,12 +21212,15 @@ function InputAmountLoaded({
|
|
|
21108
21212
|
const isCardCheckout = paymentMethod === "card" /* CARD */;
|
|
21109
21213
|
const meldEnabled = useIsMeldEnabled() && isCardCheckout;
|
|
21110
21214
|
const { targetAssetTicker, targetAssetMinAmount } = checkoutConfig;
|
|
21111
|
-
const { updateTargetAssetAmount } = useCheckoutContext();
|
|
21215
|
+
const { updateTargetAssetAmount, checkoutItem } = useCheckoutContext();
|
|
21112
21216
|
const { apiKey } = useFunkitConfig();
|
|
21113
|
-
const { checkoutItem } = useCheckoutContext();
|
|
21114
21217
|
const minUsd = targetAssetMinAmount && unitPrice ? Math.ceil(targetAssetMinAmount * unitPrice * 100) / 100 : void 0;
|
|
21115
21218
|
const fiatCurrency = modalState.fiatCurrency ?? defaultFiatCurrency;
|
|
21116
21219
|
const quickOptions = useFiatAmountOptions(fiatCurrency);
|
|
21220
|
+
const fiatCurrencyExchangeRate = getExchangeRate(
|
|
21221
|
+
fiatCurrency,
|
|
21222
|
+
currencyExchangeRates
|
|
21223
|
+
);
|
|
21117
21224
|
const {
|
|
21118
21225
|
assetAmount,
|
|
21119
21226
|
fiatAmount,
|
|
@@ -21142,7 +21249,9 @@ function InputAmountLoaded({
|
|
|
21142
21249
|
paymentMethod,
|
|
21143
21250
|
quickOptions,
|
|
21144
21251
|
sourceHolding,
|
|
21145
|
-
unitPrice
|
|
21252
|
+
unitPrice,
|
|
21253
|
+
fiatCurrencyExchangeRate,
|
|
21254
|
+
meldEnabled
|
|
21146
21255
|
});
|
|
21147
21256
|
const {
|
|
21148
21257
|
meldQuotesQuery,
|
|
@@ -21153,7 +21262,7 @@ function InputAmountLoaded({
|
|
|
21153
21262
|
selectedQuote,
|
|
21154
21263
|
isSelectedQuoteUnavailable
|
|
21155
21264
|
} = useMeld(manuallySelectedQuote, fiatAmount, fiatCurrency);
|
|
21156
|
-
const error =
|
|
21265
|
+
const error = useMemo22(() => {
|
|
21157
21266
|
if (isCardCheckout) {
|
|
21158
21267
|
if (isSelectedQuoteUnavailable) {
|
|
21159
21268
|
return {
|
|
@@ -21198,8 +21307,8 @@ function InputAmountLoaded({
|
|
|
21198
21307
|
if (assetAmount2 === void 0) {
|
|
21199
21308
|
return;
|
|
21200
21309
|
}
|
|
21201
|
-
updateTargetAssetAmount(assetAmount2);
|
|
21202
21310
|
if (!meldEnabled) {
|
|
21311
|
+
updateTargetAssetAmount(assetAmount2);
|
|
21203
21312
|
onNext({});
|
|
21204
21313
|
return;
|
|
21205
21314
|
}
|
|
@@ -21438,7 +21547,7 @@ function YouPayYouReceiveWrapper({
|
|
|
21438
21547
|
|
|
21439
21548
|
// src/modals/CheckoutModal/InputAmount/InputAmountLoading.tsx
|
|
21440
21549
|
import { formatCryptoAndStringify as formatCryptoAndStringify5 } from "@funkit/utils";
|
|
21441
|
-
import React164, { useMemo as
|
|
21550
|
+
import React164, { useMemo as useMemo23 } from "react";
|
|
21442
21551
|
function InputAmountLoading({
|
|
21443
21552
|
modalState,
|
|
21444
21553
|
sourceHoldingError,
|
|
@@ -21450,7 +21559,7 @@ function InputAmountLoading({
|
|
|
21450
21559
|
const isSourceNavWidgetEnabled = modalState.startingStep === "select_asset" /* SELECT_ASSET */;
|
|
21451
21560
|
const targetAssetAmount = checkoutItem?.initSettings.config.targetAssetAmount;
|
|
21452
21561
|
const targetAssetTicker = checkoutItem?.initSettings.config.targetAssetTicker;
|
|
21453
|
-
const error =
|
|
21562
|
+
const error = useMemo23(() => {
|
|
21454
21563
|
if (sourceHoldingError) {
|
|
21455
21564
|
return {
|
|
21456
21565
|
message: /* @__PURE__ */ React164.createElement("div", null, "Unable to retrieve your account balance. Please try re-linking your account.", " "),
|
|
@@ -21530,7 +21639,7 @@ function InputAmountLoading({
|
|
|
21530
21639
|
}
|
|
21531
21640
|
|
|
21532
21641
|
// src/modals/CheckoutModal/InputAmount/useAvailableBalanceForCheckout.ts
|
|
21533
|
-
import { useMemo as
|
|
21642
|
+
import { useMemo as useMemo24 } from "react";
|
|
21534
21643
|
function useAvailableBalanceForCheckout(paymentMethodInfo, targetChainId, assetChainId, assetSymbol) {
|
|
21535
21644
|
const { data: walletAssetHoldings, isLoading: isLoadingWalletAssetHoldings } = useWalletAssetHoldings(targetChainId);
|
|
21536
21645
|
const holdings = {
|
|
@@ -21540,7 +21649,7 @@ function useAvailableBalanceForCheckout(paymentMethodInfo, targetChainId, assetC
|
|
|
21540
21649
|
["token_transfer" /* TOKEN_TRANSFER */]: null,
|
|
21541
21650
|
["virtual_bank" /* VIRTUAL_BANK */]: null
|
|
21542
21651
|
}[paymentMethodInfo.paymentMethod];
|
|
21543
|
-
const holdingItem =
|
|
21652
|
+
const holdingItem = useMemo24(() => {
|
|
21544
21653
|
if (!assetSymbol || !holdings) {
|
|
21545
21654
|
return;
|
|
21546
21655
|
}
|
|
@@ -21599,7 +21708,7 @@ var InputAmountInfo = {
|
|
|
21599
21708
|
disableBack: ({ state, isSourceNavWidgetEnabled }) => state.paymentMethodInfo?.paymentMethod === "card" /* CARD */ && isSourceNavWidgetEnabled
|
|
21600
21709
|
};
|
|
21601
21710
|
function InputAmount(props) {
|
|
21602
|
-
const { paymentMethodInfo } = props.modalState;
|
|
21711
|
+
const { paymentMethodInfo, isDefiMode } = props.modalState;
|
|
21603
21712
|
const { textCustomizations } = useFunkitConfig();
|
|
21604
21713
|
const { setCheckoutQuote } = useQuoteContext();
|
|
21605
21714
|
const { checkoutItem } = useCheckoutContext();
|
|
@@ -21613,6 +21722,10 @@ function InputAmount(props) {
|
|
|
21613
21722
|
checkoutItem?.selectedSourceAssetInfo.chainId ?? "",
|
|
21614
21723
|
checkoutItem?.selectedSourceAssetInfo.symbol ?? null
|
|
21615
21724
|
);
|
|
21725
|
+
const {
|
|
21726
|
+
data: currencyExchangeRates,
|
|
21727
|
+
isLoading: isCurrencyExchangeRatesLoading
|
|
21728
|
+
} = useFiatExchangeRates(!!isDefiMode);
|
|
21616
21729
|
const { data: defaultCurrency, isLoading: isMeldDefaultCurrencyLoading } = useMeldDefaultCurrency(paymentMethodInfo.paymentMethod);
|
|
21617
21730
|
const isMeld = paymentMethodInfo.paymentMethod === "card" /* CARD */;
|
|
21618
21731
|
useMeldCurrencies(isMeld);
|
|
@@ -21621,7 +21734,9 @@ function InputAmount(props) {
|
|
|
21621
21734
|
chainId: checkoutItem?.initSettings.config.targetChain,
|
|
21622
21735
|
assetTokenAddress: checkoutItem?.initSettings.config.targetAsset
|
|
21623
21736
|
});
|
|
21624
|
-
const
|
|
21737
|
+
const skipExchangeRates = paymentMethodInfo.paymentMethod !== "card" /* CARD */ || !isDefiMode;
|
|
21738
|
+
const exchangeRatesLoaded = !isCurrencyExchangeRatesLoading && !!currencyExchangeRates;
|
|
21739
|
+
const isLoaded = !!(checkoutItem && unitPrice && !sourceHoldingError && !isLoadingSourceHolding && !isMeldDefaultCurrencyLoading && (skipExchangeRates || exchangeRatesLoaded));
|
|
21625
21740
|
useEffect36(() => setCheckoutQuote(null), []);
|
|
21626
21741
|
if (isLoaded) {
|
|
21627
21742
|
return /* @__PURE__ */ React165.createElement(
|
|
@@ -21631,6 +21746,7 @@ function InputAmount(props) {
|
|
|
21631
21746
|
checkoutConfig: checkoutItem.initSettings.config,
|
|
21632
21747
|
sourceHolding: sourceHolding ?? null,
|
|
21633
21748
|
unitPrice,
|
|
21749
|
+
currencyExchangeRates,
|
|
21634
21750
|
defaultFiatCurrency: defaultCurrency,
|
|
21635
21751
|
textCustomizations: textCustomizations.confirmationScreen
|
|
21636
21752
|
}
|
|
@@ -22039,7 +22155,7 @@ function LoadingAccount({
|
|
|
22039
22155
|
|
|
22040
22156
|
// src/modals/CheckoutModal/MeldCurrencySelect/MeldCurrencySelect.tsx
|
|
22041
22157
|
import clsx18 from "clsx";
|
|
22042
|
-
import React169, { useMemo as
|
|
22158
|
+
import React169, { useMemo as useMemo25, useState as useState43 } from "react";
|
|
22043
22159
|
|
|
22044
22160
|
// src/css/scrollStyles.css.ts
|
|
22045
22161
|
var hideScrollBar = "_163ehmk0";
|
|
@@ -22095,7 +22211,7 @@ function MeldCurrencySelect({
|
|
|
22095
22211
|
const [selectedCurrency, setSelectedCurrency] = useState43(
|
|
22096
22212
|
defaultCurrency
|
|
22097
22213
|
);
|
|
22098
|
-
const filteredOptions =
|
|
22214
|
+
const filteredOptions = useMemo25(() => {
|
|
22099
22215
|
const newOptions = data?.filter(
|
|
22100
22216
|
({ name, currencyCode }) => currencyCode.toLowerCase().includes(query.toLowerCase()) || name.toLowerCase().includes(query.toLowerCase())
|
|
22101
22217
|
) ?? [];
|
|
@@ -22231,7 +22347,7 @@ function MeldQuotes({
|
|
|
22231
22347
|
}
|
|
22232
22348
|
|
|
22233
22349
|
// src/modals/CheckoutModal/MoonpaySetup.tsx
|
|
22234
|
-
import React172, { useCallback as useCallback30, useMemo as
|
|
22350
|
+
import React172, { useCallback as useCallback30, useMemo as useMemo27, useState as useState45 } from "react";
|
|
22235
22351
|
|
|
22236
22352
|
// src/components/FunPayments/FunPaymentMoonpayType.css.ts
|
|
22237
22353
|
var mpClass = "_1kmpeyf0";
|
|
@@ -22240,7 +22356,7 @@ var stretchStyle = "_1kmpeyf1";
|
|
|
22240
22356
|
// src/components/FunPayments/FunPaymentMoonpayType.tsx
|
|
22241
22357
|
import { getMoonpayUrlSignature } from "@funkit/api-base";
|
|
22242
22358
|
import { colorToHex } from "@funkit/utils";
|
|
22243
|
-
import React171, { Fragment, useEffect as useEffect38, useMemo as
|
|
22359
|
+
import React171, { Fragment, useEffect as useEffect38, useMemo as useMemo26, useState as useState44 } from "react";
|
|
22244
22360
|
var LazyMoonPayBuyWidget = (props) => {
|
|
22245
22361
|
const [MoonPayBuyWidget, setMoonPayBuyWidget] = useState44(null);
|
|
22246
22362
|
useEffect38(() => {
|
|
@@ -22271,7 +22387,7 @@ function FunPaymentMoonpayType({
|
|
|
22271
22387
|
const isSandboxMode = useIsFunkitSandboxMode();
|
|
22272
22388
|
const funkitConfig = useFunkitConfig();
|
|
22273
22389
|
const { userInfo } = useGeneralWallet();
|
|
22274
|
-
const currencyCode =
|
|
22390
|
+
const currencyCode = useMemo26(() => {
|
|
22275
22391
|
return generateMoonpayCurrencyCode(depositToken, depositTokenChainId);
|
|
22276
22392
|
}, [depositToken, depositTokenChainId]);
|
|
22277
22393
|
const depositTokenAmountStringFormatted = formatTokenAmountForMoonpay(
|
|
@@ -22294,7 +22410,7 @@ function FunPaymentMoonpayType({
|
|
|
22294
22410
|
});
|
|
22295
22411
|
return signature || "";
|
|
22296
22412
|
};
|
|
22297
|
-
const moonpayButtonColor =
|
|
22413
|
+
const moonpayButtonColor = useMemo26(() => {
|
|
22298
22414
|
const primaryButtonHex = colorToHex(activeTheme.colors.buttonPrimary);
|
|
22299
22415
|
if (["#FFF", "#FFFF", "#FFFFFF", "#FFFFFFFF"].includes(primaryButtonHex)) {
|
|
22300
22416
|
return void 0;
|
|
@@ -22357,7 +22473,7 @@ function MoonpaySetup({
|
|
|
22357
22473
|
depositAddress: paymentAddress
|
|
22358
22474
|
});
|
|
22359
22475
|
}, [onNext, paymentAddress]);
|
|
22360
|
-
const MoonpayWidget =
|
|
22476
|
+
const MoonpayWidget = useMemo27(() => {
|
|
22361
22477
|
return /* @__PURE__ */ React172.createElement(
|
|
22362
22478
|
FunPaymentMoonpayType,
|
|
22363
22479
|
{
|
|
@@ -22388,7 +22504,7 @@ function MoonpaySetup({
|
|
|
22388
22504
|
// src/modals/CheckoutModal/SelectAsset.tsx
|
|
22389
22505
|
import { FUNKIT_CONNECT_SUPPORTED_CHECKOUT_CHAINS_INFO_LIST as FUNKIT_CONNECT_SUPPORTED_CHECKOUT_CHAINS_INFO_LIST2 } from "@funkit/chains";
|
|
22390
22506
|
import { formatCurrencyAndStringify as formatCurrencyAndStringify11, isTokenEquivalent as isTokenEquivalent6 } from "@funkit/utils";
|
|
22391
|
-
import React175, { useEffect as useEffect39, useMemo as
|
|
22507
|
+
import React175, { useEffect as useEffect39, useMemo as useMemo29, useState as useState46 } from "react";
|
|
22392
22508
|
import { createPortal as createPortal11 } from "react-dom";
|
|
22393
22509
|
|
|
22394
22510
|
// src/components/Dropdown/ReceiveTokenDropdown.tsx
|
|
@@ -22517,13 +22633,13 @@ var NewTokenDepositAlert = ({
|
|
|
22517
22633
|
|
|
22518
22634
|
// src/hooks/useAllowedAssets.ts
|
|
22519
22635
|
import { getAllowedAssets } from "@funkit/api-base";
|
|
22520
|
-
import { useQuery as
|
|
22521
|
-
import { useCallback as useCallback31, useMemo as
|
|
22636
|
+
import { useQuery as useQuery17 } from "@tanstack/react-query";
|
|
22637
|
+
import { useCallback as useCallback31, useMemo as useMemo28 } from "react";
|
|
22522
22638
|
function useAllowedAssets() {
|
|
22523
22639
|
const { apiKey } = useFunkitConfig();
|
|
22524
22640
|
const { checkoutItem } = useCheckoutContext();
|
|
22525
22641
|
const isRelayEnabled = useSourceTokenRelayEnabled();
|
|
22526
|
-
const { data: allowedAssets, isLoading } =
|
|
22642
|
+
const { data: allowedAssets, isLoading } = useQuery17({
|
|
22527
22643
|
queryKey: ["getAllowedAssets", apiKey],
|
|
22528
22644
|
queryFn: () => getAllowedAssets({ apiKey, logger }),
|
|
22529
22645
|
refetchOnMount: false,
|
|
@@ -22532,7 +22648,7 @@ function useAllowedAssets() {
|
|
|
22532
22648
|
staleTime: 5 * 60 * 1e3,
|
|
22533
22649
|
gcTime: Number.POSITIVE_INFINITY
|
|
22534
22650
|
});
|
|
22535
|
-
const tokens =
|
|
22651
|
+
const tokens = useMemo28(() => {
|
|
22536
22652
|
if (!allowedAssets) {
|
|
22537
22653
|
return {};
|
|
22538
22654
|
}
|
|
@@ -22609,13 +22725,7 @@ function useEnrichedAccountHoldings({
|
|
|
22609
22725
|
}) {
|
|
22610
22726
|
const { isAllowed, isLoading } = useAllowedAssets();
|
|
22611
22727
|
const { loginType, walletAddress } = useGeneralWallet();
|
|
22612
|
-
const
|
|
22613
|
-
chainId: checkoutConfig?.targetChain,
|
|
22614
|
-
assetTokenAddress: checkoutConfig?.targetAsset,
|
|
22615
|
-
amount: checkoutConfig?.targetAssetAmount
|
|
22616
|
-
});
|
|
22617
|
-
const minValueThreshold = checkoutConfig?.isDefiMode ? targetAssetUsdAmount : void 0;
|
|
22618
|
-
const enrichedAccountHoldings = useMemo28(() => {
|
|
22728
|
+
const enrichedAccountHoldings = useMemo29(() => {
|
|
22619
22729
|
if (!checkoutConfig) {
|
|
22620
22730
|
return [];
|
|
22621
22731
|
}
|
|
@@ -22633,14 +22743,12 @@ function useEnrichedAccountHoldings({
|
|
|
22633
22743
|
isAllowedForCheckout: isAllowed(
|
|
22634
22744
|
asset.pickedChainId,
|
|
22635
22745
|
asset.tokenAddress
|
|
22636
|
-
)
|
|
22637
|
-
minValueThreshold
|
|
22746
|
+
)
|
|
22638
22747
|
});
|
|
22639
22748
|
return { asset, usableForCheckout };
|
|
22640
22749
|
});
|
|
22641
22750
|
}, [
|
|
22642
22751
|
accountHoldings,
|
|
22643
|
-
minValueThreshold,
|
|
22644
22752
|
checkoutConfig,
|
|
22645
22753
|
isAllowed,
|
|
22646
22754
|
loginType,
|
|
@@ -22657,7 +22765,7 @@ function useAssetOptions({
|
|
|
22657
22765
|
chainId,
|
|
22658
22766
|
dynamicTargetAssetCandidates
|
|
22659
22767
|
}) {
|
|
22660
|
-
const assetOptions =
|
|
22768
|
+
const assetOptions = useMemo29(() => {
|
|
22661
22769
|
return enrichedAccountHoldings.filter(
|
|
22662
22770
|
({ asset }) => chainId !== void 0 ? asset.pickedChainId === chainId.toString() : true
|
|
22663
22771
|
).map(({ asset, usableForCheckout }) => {
|
|
@@ -22737,7 +22845,7 @@ function MeshOrAccountSelectAsset({
|
|
|
22737
22845
|
targetAssetMinAmount: 0
|
|
22738
22846
|
};
|
|
22739
22847
|
const [selectedTargetAsset, setSelectedTargetAsset] = useState46(defaultTargetAsset);
|
|
22740
|
-
const defaultTokenSymbols =
|
|
22848
|
+
const defaultTokenSymbols = useMemo29(() => {
|
|
22741
22849
|
if (!checkoutConfig) {
|
|
22742
22850
|
return [];
|
|
22743
22851
|
}
|
|
@@ -22804,7 +22912,7 @@ function MeshOrAccountSelectAsset({
|
|
|
22804
22912
|
handleTargetAssetUpdate(tokenItem);
|
|
22805
22913
|
onFinish();
|
|
22806
22914
|
});
|
|
22807
|
-
const selectedChainTokenSymbol =
|
|
22915
|
+
const selectedChainTokenSymbol = useMemo29(() => {
|
|
22808
22916
|
if (explicitlySelectedChainTokenSymbol) {
|
|
22809
22917
|
const assetExists = assetOptions.find(
|
|
22810
22918
|
({ asset }) => asset.chainSymbolKey === explicitlySelectedChainTokenSymbol
|
|
@@ -23524,7 +23632,7 @@ var LightningBoltIcon = ({ size = 16 }) => /* @__PURE__ */ React179.createElemen
|
|
|
23524
23632
|
|
|
23525
23633
|
// src/components/QRCode/QRCode.tsx
|
|
23526
23634
|
import QRCodeUtil from "qrcode";
|
|
23527
|
-
import React180, { useMemo as
|
|
23635
|
+
import React180, { useMemo as useMemo30 } from "react";
|
|
23528
23636
|
var generateMatrix = (value, errorCorrectionLevel) => {
|
|
23529
23637
|
const { data } = QRCodeUtil.create(value, { errorCorrectionLevel }).modules;
|
|
23530
23638
|
const sqrt = Math.sqrt(data.length);
|
|
@@ -23552,7 +23660,7 @@ function QRCode({
|
|
|
23552
23660
|
}) {
|
|
23553
23661
|
const { activeTheme } = useActiveTheme();
|
|
23554
23662
|
const size = sizeProp - Number.parseInt(outsidePadding, 10) * 2;
|
|
23555
|
-
const dots =
|
|
23663
|
+
const dots = useMemo30(() => {
|
|
23556
23664
|
const dots2 = [];
|
|
23557
23665
|
const matrix = generateMatrix(uri, ecl);
|
|
23558
23666
|
const cellSize = size / matrix.length;
|
|
@@ -24095,7 +24203,7 @@ var TransferTokenDetails = ({
|
|
|
24095
24203
|
// src/hooks/useTokenTransfer.ts
|
|
24096
24204
|
import { bitcoinChain as bitcoinChain2, solanaChain as solanaChain4 } from "@funkit/chains";
|
|
24097
24205
|
import { FlagKey as FlagKey26 } from "@funkit/utils";
|
|
24098
|
-
import { useMemo as
|
|
24206
|
+
import { useMemo as useMemo31 } from "react";
|
|
24099
24207
|
import { mainnet as mainnet9, polygon as polygon7 } from "viem/chains";
|
|
24100
24208
|
|
|
24101
24209
|
// src/utils/transfer.ts
|
|
@@ -24188,7 +24296,7 @@ var useMinTransferValue = (selectedChainId) => {
|
|
|
24188
24296
|
};
|
|
24189
24297
|
var useMinTransferValues = (chainIds) => {
|
|
24190
24298
|
const limits = useMinTransferLimits();
|
|
24191
|
-
return
|
|
24299
|
+
return useMemo31(() => {
|
|
24192
24300
|
return chainIds.reduce(
|
|
24193
24301
|
(acc, id) => {
|
|
24194
24302
|
const limit = getMinTransferValueForChain(id, limits);
|
|
@@ -24889,7 +24997,7 @@ var FiatAccountDetail = {
|
|
|
24889
24997
|
|
|
24890
24998
|
// src/modals/CheckoutModal/VirtualFiatAccount/KycIframe.tsx
|
|
24891
24999
|
import { BridgeCustomerStatus as BridgeCustomerStatus7 } from "@funkit/api-base";
|
|
24892
|
-
import React196, { useCallback as useCallback35, useEffect as useEffect42, useMemo as
|
|
25000
|
+
import React196, { useCallback as useCallback35, useEffect as useEffect42, useMemo as useMemo32, useState as useState53 } from "react";
|
|
24893
25001
|
function useIframeListener(listeners) {
|
|
24894
25002
|
const handleMessage = useCallback35(
|
|
24895
25003
|
(event) => {
|
|
@@ -24942,7 +25050,7 @@ function KycIframe({
|
|
|
24942
25050
|
const { clearVirtualFiatAccounts } = useClearFrogAccountsCache();
|
|
24943
25051
|
const { data: kycLink, isLoading: isLinkLoading } = useLoadKycLink(modalState);
|
|
24944
25052
|
const [iframeLoading, setIframeLoading] = useState53(true);
|
|
24945
|
-
const listeners =
|
|
25053
|
+
const listeners = useMemo32(
|
|
24946
25054
|
() => ({
|
|
24947
25055
|
load: () => {
|
|
24948
25056
|
logger.info("KYC iframe loaded");
|
|
@@ -25939,7 +26047,7 @@ function FunConnectOptions({
|
|
|
25939
26047
|
}
|
|
25940
26048
|
}
|
|
25941
26049
|
};
|
|
25942
|
-
const stepComponent =
|
|
26050
|
+
const stepComponent = useMemo33(() => {
|
|
25943
26051
|
switch (step) {
|
|
25944
26052
|
case 0 /* SIGNIN_PRIMARY */:
|
|
25945
26053
|
case 1 /* SIGNIN_SECONDARY */:
|
|
@@ -26048,7 +26156,7 @@ var FULL_SOCIAL_LOGIN_OPTIONS = [
|
|
|
26048
26156
|
function useEnabledSocialLogins() {
|
|
26049
26157
|
const funkitConfig = useFunkitConfig();
|
|
26050
26158
|
const { web2SocialLogins } = funkitConfig.loginConfig;
|
|
26051
|
-
const enabledSocialItems =
|
|
26159
|
+
const enabledSocialItems = useMemo34(() => {
|
|
26052
26160
|
return FULL_SOCIAL_LOGIN_OPTIONS.filter(
|
|
26053
26161
|
(oAuthItem) => !!web2SocialLogins[oAuthItem.funkitKey]
|
|
26054
26162
|
);
|
|
@@ -26077,7 +26185,7 @@ function FunSignInStep({
|
|
|
26077
26185
|
handleOauthRedirect,
|
|
26078
26186
|
handleGenerateFcUri
|
|
26079
26187
|
} = useFunkitWeb2Login();
|
|
26080
|
-
const isEmailInputValid =
|
|
26188
|
+
const isEmailInputValid = useMemo34(() => {
|
|
26081
26189
|
return validateEmailString(emailInput);
|
|
26082
26190
|
}, [emailInput]);
|
|
26083
26191
|
const [emailError, setEmailError] = useState59();
|
|
@@ -26653,7 +26761,7 @@ function FunCheckoutHistoryDetail({
|
|
|
26653
26761
|
isActiveCheckout
|
|
26654
26762
|
]
|
|
26655
26763
|
);
|
|
26656
|
-
const primaryButtonProps =
|
|
26764
|
+
const primaryButtonProps = useMemo35(() => {
|
|
26657
26765
|
if (!isCheckoutLoaded) {
|
|
26658
26766
|
return void 0;
|
|
26659
26767
|
}
|
|
@@ -26742,7 +26850,7 @@ var CheckoutAlert = ({ state, refundState, onHelp }) => {
|
|
|
26742
26850
|
|
|
26743
26851
|
// src/components/FunCheckoutHistory/FunCheckoutHistoryHelp.tsx
|
|
26744
26852
|
import { sendSupportMessage } from "@funkit/api-base";
|
|
26745
|
-
import React218, { useEffect as useEffect49, useMemo as
|
|
26853
|
+
import React218, { useEffect as useEffect49, useMemo as useMemo36, useRef as useRef23, useState as useState62 } from "react";
|
|
26746
26854
|
import { createPortal as createPortal15 } from "react-dom";
|
|
26747
26855
|
|
|
26748
26856
|
// src/components/FunInput/FunTextAreaInput.tsx
|
|
@@ -26895,7 +27003,7 @@ function FunCheckoutHistoryHelp({
|
|
|
26895
27003
|
);
|
|
26896
27004
|
const [descriptionInput, setDescriptionInput] = useState62("");
|
|
26897
27005
|
const [errorMessage, setErrorMessage] = useState62();
|
|
26898
|
-
const isEmailInputValid =
|
|
27006
|
+
const isEmailInputValid = useMemo36(() => {
|
|
26899
27007
|
return validateEmailString(emailInput);
|
|
26900
27008
|
}, [emailInput]);
|
|
26901
27009
|
const [processStage, setProcessStage] = useState62(
|
|
@@ -27087,7 +27195,7 @@ import {
|
|
|
27087
27195
|
formatTimestamp as formatTimestamp2,
|
|
27088
27196
|
isTokenEquivalent as isTokenEquivalent7
|
|
27089
27197
|
} from "@funkit/utils";
|
|
27090
|
-
import React219, { useCallback as useCallback43, useMemo as
|
|
27198
|
+
import React219, { useCallback as useCallback43, useMemo as useMemo37, useRef as useRef24, useState as useState63 } from "react";
|
|
27091
27199
|
import { createPortal as createPortal16 } from "react-dom";
|
|
27092
27200
|
function FunDirectExecutionStatusTagLoaded({
|
|
27093
27201
|
directExecution
|
|
@@ -27128,7 +27236,7 @@ function FunDirectExecutionHistoryDetail({
|
|
|
27128
27236
|
]
|
|
27129
27237
|
);
|
|
27130
27238
|
const isWithdrawal = directExecution?.clientMetadata?.isWithdrawal;
|
|
27131
|
-
const buttonProps =
|
|
27239
|
+
const buttonProps = useMemo37(() => {
|
|
27132
27240
|
if (!isLoaded) {
|
|
27133
27241
|
return void 0;
|
|
27134
27242
|
}
|
|
@@ -27541,7 +27649,7 @@ function useCheckoutModalTitle(depositAddress, defaultTitle) {
|
|
|
27541
27649
|
import { IN_PROGRESS_CHECKOUT_STATES as IN_PROGRESS_CHECKOUT_STATES2 } from "@funkit/api-base";
|
|
27542
27650
|
import { formatTimestampToDate, fullMonthNames } from "@funkit/utils";
|
|
27543
27651
|
import clsx20 from "clsx";
|
|
27544
|
-
import React232, { useEffect as useEffect50, useMemo as
|
|
27652
|
+
import React232, { useEffect as useEffect50, useMemo as useMemo38, useRef as useRef25, useState as useState67 } from "react";
|
|
27545
27653
|
import { Virtuoso } from "react-virtuoso";
|
|
27546
27654
|
import { useAccount as useAccount7 } from "wagmi";
|
|
27547
27655
|
|
|
@@ -28088,7 +28196,7 @@ function Home({
|
|
|
28088
28196
|
const virtuosoDiv = virtuosoParentRef.current?.firstChild;
|
|
28089
28197
|
virtuosoDiv?.classList.add(animateVirtuosoInClass);
|
|
28090
28198
|
}, []);
|
|
28091
|
-
const AssetsList =
|
|
28199
|
+
const AssetsList = useMemo38(() => {
|
|
28092
28200
|
if (walletAssets && !Object.keys(walletAssets).length) {
|
|
28093
28201
|
return /* @__PURE__ */ React232.createElement(EmptyTabAlert, null);
|
|
28094
28202
|
}
|
|
@@ -28115,7 +28223,7 @@ function Home({
|
|
|
28115
28223
|
}
|
|
28116
28224
|
));
|
|
28117
28225
|
}, [walletAssets]);
|
|
28118
|
-
const CheckoutsList =
|
|
28226
|
+
const CheckoutsList = useMemo38(() => {
|
|
28119
28227
|
if (checkoutHistoryList.length === 0 && isCheckoutHistoryInited) {
|
|
28120
28228
|
return /* @__PURE__ */ React232.createElement(EmptyTabAlert, null);
|
|
28121
28229
|
}
|
|
@@ -28809,7 +28917,7 @@ var FunCheckoutBlocked = ({ reason }) => {
|
|
|
28809
28917
|
|
|
28810
28918
|
// src/modals/CheckoutModal/TransferToken/CheckoutNotifications.tsx
|
|
28811
28919
|
import clsx23 from "clsx";
|
|
28812
|
-
import React247, { useEffect as useEffect52, useMemo as
|
|
28920
|
+
import React247, { useEffect as useEffect52, useMemo as useMemo39, useState as useState70 } from "react";
|
|
28813
28921
|
|
|
28814
28922
|
// src/components/FunNotificationBanner/FunNotificationShowMoreButton.tsx
|
|
28815
28923
|
import React242 from "react";
|
|
@@ -28858,7 +28966,7 @@ import {
|
|
|
28858
28966
|
getCheckoutsByUserId as getCheckoutsByUserId2
|
|
28859
28967
|
} from "@funkit/api-base";
|
|
28860
28968
|
import { FlagKey as FlagKey27 } from "@funkit/utils";
|
|
28861
|
-
import { useQuery as
|
|
28969
|
+
import { useQuery as useQuery18 } from "@tanstack/react-query";
|
|
28862
28970
|
var hasCorrectPaymentMethod = (checkout, paymentMethod) => !paymentMethod || checkout.clientMetadata.selectedPaymentMethodInfo?.paymentMethod === paymentMethod;
|
|
28863
28971
|
var isRecent = (checkout, timestampCutoff) => checkout.createdTimeMs > timestampCutoff;
|
|
28864
28972
|
var DEFAULT_NOTIF_CUTOFF = 7 * 24 * 60 * 60 * 1e3;
|
|
@@ -28873,7 +28981,7 @@ var useRecentCheckouts = ({
|
|
|
28873
28981
|
const { isUserLoggedIn, userInfo } = useGeneralWallet();
|
|
28874
28982
|
const { apiKey } = useFunkitConfig();
|
|
28875
28983
|
const { listRefresh } = useCheckoutRefreshInterval();
|
|
28876
|
-
const query =
|
|
28984
|
+
const query = useQuery18({
|
|
28877
28985
|
queryKey: ["checkouts", userInfo.id],
|
|
28878
28986
|
queryFn: async () => {
|
|
28879
28987
|
const checkouts = await getCheckoutsByUserId2({
|
|
@@ -28896,7 +29004,7 @@ var useRecentCheckouts = ({
|
|
|
28896
29004
|
import {
|
|
28897
29005
|
getDirectExecutionsByUserId as getDirectExecutionsByUserId2
|
|
28898
29006
|
} from "@funkit/api-base";
|
|
28899
|
-
import { useQuery as
|
|
29007
|
+
import { useQuery as useQuery19 } from "@tanstack/react-query";
|
|
28900
29008
|
var isRecent2 = (de, timestampCutoff) => de.createdTimeMs > timestampCutoff;
|
|
28901
29009
|
var useRecentDirectExecutions = ({
|
|
28902
29010
|
isVisible
|
|
@@ -28904,7 +29012,7 @@ var useRecentDirectExecutions = ({
|
|
|
28904
29012
|
const { isUserLoggedIn, userInfo } = useGeneralWallet();
|
|
28905
29013
|
const { apiKey } = useFunkitConfig();
|
|
28906
29014
|
const { listRefresh } = useCheckoutRefreshInterval();
|
|
28907
|
-
const query =
|
|
29015
|
+
const query = useQuery19({
|
|
28908
29016
|
queryKey: ["directExecutions", userInfo.id],
|
|
28909
29017
|
queryFn: async () => {
|
|
28910
29018
|
const directExecutions = await getDirectExecutionsByUserId2({
|
|
@@ -29617,11 +29725,11 @@ var FunNotificationBanner = ({
|
|
|
29617
29725
|
import {
|
|
29618
29726
|
getCheckoutByDepositAddress as getCheckoutByDepositAddress2
|
|
29619
29727
|
} from "@funkit/api-base";
|
|
29620
|
-
import { useQuery as
|
|
29728
|
+
import { useQuery as useQuery20 } from "@tanstack/react-query";
|
|
29621
29729
|
var useCheckout = (depositAddress, initial) => {
|
|
29622
29730
|
const { apiKey } = useFunkitConfig();
|
|
29623
29731
|
const { itemRefresh } = useCheckoutRefreshInterval();
|
|
29624
|
-
const query =
|
|
29732
|
+
const query = useQuery20({
|
|
29625
29733
|
queryKey: ["checkouts", "checkout", depositAddress],
|
|
29626
29734
|
queryFn: () => (
|
|
29627
29735
|
// biome-ignore lint/style/noNonNullAssertion: already checked for null
|
|
@@ -29878,19 +29986,19 @@ var CheckoutNotifications = ({
|
|
|
29878
29986
|
}
|
|
29879
29987
|
setInitialDirectExecutions(directExecutions);
|
|
29880
29988
|
}, [initialDirectExecutions, directExecutions]);
|
|
29881
|
-
const displayedDirectExecutions =
|
|
29989
|
+
const displayedDirectExecutions = useMemo39(() => {
|
|
29882
29990
|
if (!directExecutions) {
|
|
29883
29991
|
return [];
|
|
29884
29992
|
}
|
|
29885
29993
|
return getUpdatedDirectExecutions(directExecutions, initialDirectExecutions).filter(({ txHash }) => !closedNotifications.includes(txHash)).slice(0, MAX_COUNT);
|
|
29886
29994
|
}, [initialDirectExecutions, directExecutions, closedNotifications]);
|
|
29887
|
-
const displayedCheckouts =
|
|
29995
|
+
const displayedCheckouts = useMemo39(() => {
|
|
29888
29996
|
if (!checkouts) {
|
|
29889
29997
|
return [];
|
|
29890
29998
|
}
|
|
29891
29999
|
return getUpdatedCheckouts(checkouts, initialCheckouts).filter(({ depositAddr }) => !closedNotifications.includes(depositAddr)).slice(0, MAX_COUNT);
|
|
29892
30000
|
}, [initialCheckouts, checkouts, closedNotifications]);
|
|
29893
|
-
const combinedNotifications =
|
|
30001
|
+
const combinedNotifications = useMemo39(() => {
|
|
29894
30002
|
return [
|
|
29895
30003
|
...displayedDirectExecutions.map(
|
|
29896
30004
|
(item) => ({ ...item, isDirectExecution: true })
|
|
@@ -29900,7 +30008,7 @@ var CheckoutNotifications = ({
|
|
|
29900
30008
|
)
|
|
29901
30009
|
].sort((a, b) => b.createdTimeMs - a.createdTimeMs);
|
|
29902
30010
|
}, [displayedDirectExecutions, displayedCheckouts]);
|
|
29903
|
-
const displayedNotifications =
|
|
30011
|
+
const displayedNotifications = useMemo39(() => {
|
|
29904
30012
|
return isExpanded ? combinedNotifications : combinedNotifications.slice(0, COLLAPSED_COUNT);
|
|
29905
30013
|
}, [isExpanded, combinedNotifications]);
|
|
29906
30014
|
const handleNotificationClose = (id) => setClosedNotifications((prev) => [...prev, id]);
|
|
@@ -30237,7 +30345,7 @@ function ModalProvider({ children }) {
|
|
|
30237
30345
|
return /* @__PURE__ */ React250.createElement(
|
|
30238
30346
|
ModalContext.Provider,
|
|
30239
30347
|
{
|
|
30240
|
-
value:
|
|
30348
|
+
value: useMemo40(
|
|
30241
30349
|
() => ({
|
|
30242
30350
|
accountModalOpen,
|
|
30243
30351
|
accountModalTab,
|
|
@@ -31008,7 +31116,7 @@ var FunkitWeb2Provider = ({
|
|
|
31008
31116
|
},
|
|
31009
31117
|
[privy]
|
|
31010
31118
|
);
|
|
31011
|
-
const web2UserInfo =
|
|
31119
|
+
const web2UserInfo = useMemo41(() => {
|
|
31012
31120
|
if (!loggedInUser || !loggedInUser?.linked_accounts || !loggedInUser?.linked_accounts?.length) {
|
|
31013
31121
|
return PLACEHOLDER_FUNKIT_USER_INFO;
|
|
31014
31122
|
}
|
|
@@ -32052,7 +32160,7 @@ function setFunkitConnectVersion({ version }) {
|
|
|
32052
32160
|
localStorage.setItem(storageKey5, version);
|
|
32053
32161
|
}
|
|
32054
32162
|
function getCurrentSdkVersion() {
|
|
32055
|
-
return "6.
|
|
32163
|
+
return "6.11.0";
|
|
32056
32164
|
}
|
|
32057
32165
|
function useFingerprint() {
|
|
32058
32166
|
const fingerprint = useCallback51(() => {
|