@funkit/connect 5.0.4 → 5.0.5
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 +10 -0
- package/dist/components/CopyAddress/CopyIconButton.d.ts +1 -0
- package/dist/components/FunAssetAvatar/FunAssetAvatar.css.d.ts +0 -2
- package/dist/components/FunAssetAvatar/FunAssetAvatar.d.ts +1 -2
- package/dist/components/FunCheckoutBlocked/FunCheckoutBlocked.d.ts +1 -1
- package/dist/components/FunPaymentMethodItem/FunPaymentMethodItem.d.ts +6 -4
- package/dist/components/FunPayments/FunPaymentMethods.d.ts +1 -0
- package/dist/components/FunSkeletonLoader/FunSkeletonBlock.d.ts +2 -2
- package/dist/components/QRCode/QRCodeSkeletonLoader.d.ts +7 -0
- package/dist/components/SourcePaymentMethodItem/SourcePaymentMethodItem.d.ts +7 -0
- package/dist/consts/animations.d.ts +1 -0
- package/dist/domains/{checkoutState.d.ts → checkout.d.ts} +3 -0
- package/dist/domains/{checkoutFees.d.ts → fees.d.ts} +1 -1
- package/dist/domains/paymentMethods.d.ts +1 -1
- package/dist/domains/quote.d.ts +1 -1
- package/dist/hooks/useCheckoutAccountBalanceTransfer.d.ts +1 -1
- package/dist/hooks/useIsBlacklisted.d.ts +6 -0
- package/dist/index.css +3 -10
- package/dist/index.js +652 -580
- package/dist/modals/CheckoutModal/CheckoutNotification.d.ts +1 -1
- package/dist/modals/CheckoutModal/ConfirmationStep/ConfirmationStep.d.ts +1 -1
- package/dist/modals/CheckoutModal/ConfirmationStep/useCheckoutConfirmation.d.ts +6 -0
- package/dist/modals/CheckoutModal/stepTransition.d.ts +4 -0
- package/dist/providers/FunkitMoonpayProvider.d.ts +0 -2
- package/dist/providers/GeneralWalletProvider.d.ts +9 -10
- package/dist/utils/checkout.d.ts +1 -1
- package/dist/utils/flags/config.d.ts +1 -1
- package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
- package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
- package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
- package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
- package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
- package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
- package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
- package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
- package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
- package/dist/wallets/walletConnectors/index.js +67 -67
- package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
- package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
- package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
- package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
- package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
- package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
- package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
- package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
- package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
- package/package.json +3 -3
- package/dist/hooks/useIsCheckoutRisky.d.ts +0 -4
- /package/dist/components/{FunPaymentMethodItem/FunPaymentMethodItem.css.d.ts → SourcePaymentMethodItem/SourcePaymentMethodItem.css.d.ts} +0 -0
package/dist/index.js
CHANGED
|
@@ -183,7 +183,7 @@ var PLACEHOLDER_FUNKIT_USER_INFO = {
|
|
|
183
183
|
// src/providers/FunkitConfigContext.tsx
|
|
184
184
|
var DEFAULT_TEXT_CUSTOMIZATIONS = {
|
|
185
185
|
brokerageOrExchange: "Connect Exchange",
|
|
186
|
-
debitOrCredit: "
|
|
186
|
+
debitOrCredit: "Use card",
|
|
187
187
|
accountBalance: "Wallet",
|
|
188
188
|
selectAccount: "Select an exchange",
|
|
189
189
|
sourceMethodTitle: "Your source",
|
|
@@ -527,7 +527,7 @@ function Avatar({ address, imageUrl, loading, size }) {
|
|
|
527
527
|
}
|
|
528
528
|
|
|
529
529
|
// src/components/ConnectButton/ConnectButton.tsx
|
|
530
|
-
import
|
|
530
|
+
import React210, { useEffect as useEffect46, useState as useState66 } from "react";
|
|
531
531
|
|
|
532
532
|
// src/css/touchableStyles.css.ts
|
|
533
533
|
var active = { shrink: "_7rkubb8", shrinkSm: "_7rkubb9" };
|
|
@@ -631,12 +631,12 @@ import PrivyJS, {
|
|
|
631
631
|
getUserEmbeddedWallet,
|
|
632
632
|
LocalStorage
|
|
633
633
|
} from "@privy-io/js-sdk-core";
|
|
634
|
-
import
|
|
634
|
+
import React207, {
|
|
635
635
|
createContext as createContext18,
|
|
636
636
|
useCallback as useCallback42,
|
|
637
637
|
useContext as useContext18,
|
|
638
|
-
useEffect as
|
|
639
|
-
useMemo as
|
|
638
|
+
useEffect as useEffect44,
|
|
639
|
+
useMemo as useMemo39,
|
|
640
640
|
useState as useState63
|
|
641
641
|
} from "react";
|
|
642
642
|
import { useConfig as useConfig5, useConnect as useConnect2, useDisconnect as useDisconnect2 } from "wagmi";
|
|
@@ -1049,12 +1049,12 @@ var useFunkitConnectChainsById = () => groupChainsById(useFunkitConnectChains())
|
|
|
1049
1049
|
var useInitialChainId = () => useContext4(FunkitConnectChainContext).initialChainId;
|
|
1050
1050
|
|
|
1051
1051
|
// src/providers/ModalContext.tsx
|
|
1052
|
-
import
|
|
1052
|
+
import React206, {
|
|
1053
1053
|
createContext as createContext17,
|
|
1054
1054
|
useCallback as useCallback41,
|
|
1055
1055
|
useContext as useContext17,
|
|
1056
|
-
useEffect as
|
|
1057
|
-
useMemo as
|
|
1056
|
+
useEffect as useEffect43,
|
|
1057
|
+
useMemo as useMemo38,
|
|
1058
1058
|
useState as useState62
|
|
1059
1059
|
} from "react";
|
|
1060
1060
|
import { useAccount as useAccount10, useAccountEffect as useAccountEffect2, useConfig as useConfig4 } from "wagmi";
|
|
@@ -3148,19 +3148,27 @@ var flagConfig = {
|
|
|
3148
3148
|
[FlagKey.TokenTransferSourceChainsAndAssets]: {
|
|
3149
3149
|
type: "string",
|
|
3150
3150
|
default_value: JSON.stringify({
|
|
3151
|
+
// // mainnet
|
|
3152
|
+
// 1: ['USDC', 'DAI', 'ETH'],
|
|
3153
|
+
// // base
|
|
3154
|
+
// 8453: ['ETH', 'USDC', 'USDT', 'DAI', 'WETH'],
|
|
3155
|
+
// // arbitrum
|
|
3156
|
+
// 42161: ['USDC', 'USDT', 'DAI', 'ETH', 'WETH'],
|
|
3157
|
+
// // polygon
|
|
3158
|
+
// 137: ['USDC', 'USDC.e', 'USDT', 'POL', 'DAI', 'WETH'],
|
|
3151
3159
|
// mainnet
|
|
3152
|
-
1: [
|
|
3160
|
+
1: [],
|
|
3153
3161
|
// base
|
|
3154
|
-
8453: [
|
|
3162
|
+
8453: [],
|
|
3155
3163
|
// arbitrum
|
|
3156
|
-
42161: [
|
|
3164
|
+
42161: [],
|
|
3157
3165
|
// polygon
|
|
3158
|
-
137: ["USDC", "USDC.e"
|
|
3166
|
+
137: ["USDC", "USDC.e"]
|
|
3159
3167
|
})
|
|
3160
3168
|
},
|
|
3161
3169
|
[FlagKey.EnableTokenTransferUniversalDepositAddress]: {
|
|
3162
3170
|
type: "boolean",
|
|
3163
|
-
default_value:
|
|
3171
|
+
default_value: false
|
|
3164
3172
|
},
|
|
3165
3173
|
[FlagKey.MaxCheckoutUsd]: {
|
|
3166
3174
|
type: "string",
|
|
@@ -5749,8 +5757,38 @@ var HOME_TOKEN_BALANCE_DISPLAY_ROW_HEIGHT = 52;
|
|
|
5749
5757
|
var DEFAULT_ICON_SIZE = "24";
|
|
5750
5758
|
var OVERLAY_Z_INDEX = 100;
|
|
5751
5759
|
|
|
5752
|
-
// src/domains/
|
|
5760
|
+
// src/domains/checkout.ts
|
|
5761
|
+
import {
|
|
5762
|
+
getRiskAssessmentForAddress
|
|
5763
|
+
} from "@funkit/api-base";
|
|
5753
5764
|
import { CheckoutState as CheckoutState3 } from "@funkit/api-base";
|
|
5765
|
+
var BLOCKED_RISK_LEVELS = ["Severe", "High"];
|
|
5766
|
+
var hasRisk = async (apiKey, walletAddress, customRecipient) => {
|
|
5767
|
+
const getUserWalletRisk = walletAddress ? getRiskAssessmentForAddress({
|
|
5768
|
+
address: walletAddress,
|
|
5769
|
+
apiKey,
|
|
5770
|
+
logger
|
|
5771
|
+
}).then((assessment) => assessment?.risk) : null;
|
|
5772
|
+
const getRecipientWalletRisk = customRecipient ? getRiskAssessmentForAddress({
|
|
5773
|
+
address: customRecipient,
|
|
5774
|
+
apiKey,
|
|
5775
|
+
logger
|
|
5776
|
+
}).then((assessment) => assessment?.risk) : null;
|
|
5777
|
+
const addressRisks = await Promise.all([
|
|
5778
|
+
getUserWalletRisk,
|
|
5779
|
+
getRecipientWalletRisk
|
|
5780
|
+
]);
|
|
5781
|
+
const isCheckoutRisky = addressRisks.some(
|
|
5782
|
+
(risk) => risk ? BLOCKED_RISK_LEVELS.includes(risk) : false
|
|
5783
|
+
);
|
|
5784
|
+
logger.log("riskAssessment_isCheckoutRisky", {
|
|
5785
|
+
isCheckoutRisky,
|
|
5786
|
+
addressRisks,
|
|
5787
|
+
walletAddress,
|
|
5788
|
+
customRecipient
|
|
5789
|
+
});
|
|
5790
|
+
return isCheckoutRisky;
|
|
5791
|
+
};
|
|
5754
5792
|
function getCheckoutStateBooleans(checkoutState, refundState) {
|
|
5755
5793
|
const isProcessing = IN_PROGRESS_CHECKOUT_STATES.includes(checkoutState);
|
|
5756
5794
|
const isCompleted = checkoutState === CheckoutState3.COMPLETED;
|
|
@@ -6418,7 +6456,7 @@ var MAXIMUM_MOONPAY_DEPOSIT_AMOUNT_USD = 1e4;
|
|
|
6418
6456
|
var generateMoonpayCurrencyCode = (tokenSymbol, chainId) => {
|
|
6419
6457
|
let moonpayChainName = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO4[chainId]?.moonpayChainName;
|
|
6420
6458
|
if (moonpayChainName == null) {
|
|
6421
|
-
throw new Error("
|
|
6459
|
+
throw new Error("MoonPay not supported on testnets");
|
|
6422
6460
|
}
|
|
6423
6461
|
if (moonpayChainName !== "") {
|
|
6424
6462
|
moonpayChainName = `_${moonpayChainName}`;
|
|
@@ -6675,6 +6713,7 @@ var circleSkeletonClass = "dj0x603";
|
|
|
6675
6713
|
function FunSkeletonBlock({
|
|
6676
6714
|
width = "full",
|
|
6677
6715
|
borderRadius = "4",
|
|
6716
|
+
height,
|
|
6678
6717
|
...props
|
|
6679
6718
|
}) {
|
|
6680
6719
|
return /* @__PURE__ */ React63.createElement(
|
|
@@ -6683,7 +6722,11 @@ function FunSkeletonBlock({
|
|
|
6683
6722
|
borderRadius,
|
|
6684
6723
|
className: animateSkeletonClass,
|
|
6685
6724
|
width,
|
|
6686
|
-
...props
|
|
6725
|
+
...props,
|
|
6726
|
+
style: {
|
|
6727
|
+
// when height is passed as a theme value, it will already contain 'px' suffix, if passed as BoxProps['height'], it will missing the suffix
|
|
6728
|
+
height: height.endsWith("px") ? height : `${height}px`
|
|
6729
|
+
}
|
|
6687
6730
|
}
|
|
6688
6731
|
);
|
|
6689
6732
|
}
|
|
@@ -10463,12 +10506,12 @@ import clsx9 from "clsx";
|
|
|
10463
10506
|
import React113, { useMemo as useMemo15 } from "react";
|
|
10464
10507
|
|
|
10465
10508
|
// src/components/FunAssetAvatar/FunAssetAvatar.css.ts
|
|
10466
|
-
var
|
|
10467
|
-
var chainContainerStyle = "uwrdc21";
|
|
10509
|
+
var chainContainerStyle = "uwrdc22 _1rsrm2fy _1rsrm2fa _1rsrm2f4 _1rsrm2f3p";
|
|
10468
10510
|
var containerStyle = "uwrdc20";
|
|
10469
|
-
var largeChainContainerStyle = "uwrdc22";
|
|
10470
10511
|
|
|
10471
10512
|
// src/components/FunAssetAvatar/FunAssetAvatar.tsx
|
|
10513
|
+
var smallClipPath = "polygon( 99.725% 55.276%,99.725% 55.276%,99.777% 54.755%,99.823% 54.233%,99.865% 53.709%,99.9% 53.183%,99.931% 52.656%,99.956% 52.128%,99.975% 51.598%,99.989% 51.067%,99.997% 50.534%,100% 50%,100% 50%,99.346% 41.89%,97.451% 34.196%,94.419% 27.022%,90.353% 20.471%,85.355% 14.645%,79.529% 9.647%,72.978% 5.581%,65.804% 2.549%,58.11% 0.654%,50% 0%,50% 0%,41.89% 0.654%,34.196% 2.549%,27.022% 5.581%,20.471% 9.647%,14.645% 14.645%,9.647% 20.471%,5.581% 27.022%,2.549% 34.196%,0.654% 41.89%,0% 50%,0% 50%,0.654% 58.11%,2.549% 65.804%,5.581% 72.978%,9.647% 79.529%,14.645% 85.355%,20.471% 90.353%,27.022% 94.419%,34.196% 97.451%,41.89% 99.346%,50% 100%,50% 100%,50.534% 99.997%,51.067% 99.989%,51.598% 99.975%,52.128% 99.956%,52.656% 99.931%,53.183% 99.9%,53.709% 99.865%,54.233% 99.823%,54.755% 99.777%,55.276% 99.725%,55.276% 99.725%,55.224% 99.259%,55.177% 98.792%,55.136% 98.323%,55.1% 97.853%,55.07% 97.381%,55.045% 96.907%,55.025% 96.433%,55.011% 95.956%,55.003% 95.479%,55% 95%,55% 95%,55.524% 88.512%,57.039% 82.357%,59.465% 76.618%,62.718% 71.376%,66.716% 66.716%,71.376% 62.718%,76.618% 59.465%,82.357% 57.039%,88.512% 55.524%,95% 55%,95% 55%,95.479% 55.003%,95.956% 55.011%,96.433% 55.025%,96.907% 55.045%,97.381% 55.07%,97.853% 55.1%,98.323% 55.136%,98.792% 55.177%,99.259% 55.224%,99.725% 55.276% )";
|
|
10514
|
+
var largeClipPath = "polygon( 100% 47.911%,100% 47.911%,98.601% 47.377%,97.177% 46.894%,95.729% 46.464%,94.26% 46.088%,92.769% 45.766%,91.258% 45.5%,89.728% 45.292%,88.181% 45.141%,86.617% 45.05%,85.037% 45.02%,85.037% 45.02%,78.546% 45.543%,72.388% 47.06%,66.647% 49.486%,61.403% 52.741%,56.74% 56.74%,52.741% 61.403%,49.486% 66.647%,47.06% 72.388%,45.543% 78.546%,45.02% 85.037%,45.02% 85.037%,45.05% 86.617%,45.141% 88.181%,45.292% 89.728%,45.5% 91.258%,45.766% 92.769%,46.088% 94.26%,46.464% 95.729%,46.894% 97.177%,47.377% 98.601%,47.911% 100%,47.911% 100%,40.094% 99.059%,32.696% 96.962%,25.811% 93.804%,19.535% 89.682%,13.963% 84.691%,9.19% 78.925%,5.312% 72.479%,2.425% 65.45%,0.622% 57.933%,0% 50.022%,0% 50.022%,0.655% 41.908%,2.55% 34.211%,5.583% 27.034%,9.651% 20.48%,14.651% 14.651%,20.48% 9.651%,27.034% 5.583%,34.211% 2.55%,41.908% 0.655%,50.022% 0%,50.022% 0%,57.933% 0.622%,65.45% 2.425%,72.479% 5.312%,78.925% 9.19%,84.691% 13.963%,89.682% 19.535%,93.804% 25.811%,96.962% 32.696%,99.059% 40.094%,100% 47.911% )";
|
|
10472
10515
|
function FunAssetAvatar({
|
|
10473
10516
|
assetSrc,
|
|
10474
10517
|
assetTicker,
|
|
@@ -10477,7 +10520,6 @@ function FunAssetAvatar({
|
|
|
10477
10520
|
chainId,
|
|
10478
10521
|
prioritizeDefaults = true,
|
|
10479
10522
|
hideIfUnknown = false,
|
|
10480
|
-
borderedChainIcon = true,
|
|
10481
10523
|
largeChainIcon = false
|
|
10482
10524
|
}) {
|
|
10483
10525
|
const chainMetadata = chainMetadataById[Number.parseInt((chainId || "").toString())] || null;
|
|
@@ -10490,7 +10532,8 @@ function FunAssetAvatar({
|
|
|
10490
10532
|
return assetSrc || defaultSrc;
|
|
10491
10533
|
}, [assetSrc, assetTicker, prioritizeDefaults]);
|
|
10492
10534
|
const showChainIcon = isNotNullish6(chainMetadata);
|
|
10493
|
-
const chainIconSize = Number.parseInt(assetIconSize) / 2;
|
|
10535
|
+
const chainIconSize = Number.parseInt(assetIconSize) / 2 + 2;
|
|
10536
|
+
const chainContainerSize = chainIconSize + 4;
|
|
10494
10537
|
return hideIfUnknown && !finalAssetSrc ? null : /* @__PURE__ */ React113.createElement(Box, { id: "container", alignSelf: "center" }, /* @__PURE__ */ React113.createElement(
|
|
10495
10538
|
Box,
|
|
10496
10539
|
{
|
|
@@ -10498,36 +10541,52 @@ function FunAssetAvatar({
|
|
|
10498
10541
|
height: assetIconSize,
|
|
10499
10542
|
className: containerStyle
|
|
10500
10543
|
},
|
|
10501
|
-
/* @__PURE__ */ React113.createElement(
|
|
10502
|
-
|
|
10544
|
+
/* @__PURE__ */ React113.createElement(
|
|
10545
|
+
Box,
|
|
10503
10546
|
{
|
|
10504
|
-
alt: assetName,
|
|
10505
|
-
src: finalAssetSrc,
|
|
10506
|
-
fallbackSrc: FALLBACK_ASSET,
|
|
10507
|
-
background: void 0,
|
|
10508
|
-
borderColor: "generalBorderDim",
|
|
10509
|
-
borderRadius: "full",
|
|
10510
|
-
height: assetIconSize,
|
|
10511
10547
|
width: assetIconSize,
|
|
10512
|
-
|
|
10513
|
-
|
|
10514
|
-
|
|
10515
|
-
|
|
10548
|
+
height: assetIconSize,
|
|
10549
|
+
style: {
|
|
10550
|
+
// apply clip-paths only if we're showing the chain icon
|
|
10551
|
+
...showChainIcon && {
|
|
10552
|
+
clipPath: chainIconSize <= 10 ? largeClipPath : smallClipPath
|
|
10553
|
+
}
|
|
10554
|
+
}
|
|
10555
|
+
},
|
|
10556
|
+
/* @__PURE__ */ React113.createElement(
|
|
10557
|
+
AsyncImage,
|
|
10558
|
+
{
|
|
10559
|
+
alt: assetName,
|
|
10560
|
+
src: finalAssetSrc,
|
|
10561
|
+
fallbackSrc: FALLBACK_ASSET,
|
|
10562
|
+
background: void 0,
|
|
10563
|
+
borderColor: "generalBorderDim",
|
|
10564
|
+
borderRadius: "full",
|
|
10565
|
+
height: assetIconSize,
|
|
10566
|
+
width: assetIconSize,
|
|
10567
|
+
testId: `fun-asset-${assetTicker}-icon`,
|
|
10568
|
+
useAsImage: true
|
|
10569
|
+
}
|
|
10570
|
+
)
|
|
10571
|
+
),
|
|
10516
10572
|
showChainIcon ? /* @__PURE__ */ React113.createElement(
|
|
10517
10573
|
Box,
|
|
10518
10574
|
{
|
|
10519
|
-
|
|
10520
|
-
|
|
10521
|
-
|
|
10522
|
-
|
|
10575
|
+
style: {
|
|
10576
|
+
width: chainContainerSize,
|
|
10577
|
+
height: chainContainerSize,
|
|
10578
|
+
bottom: `-${chainIconSize / 2}px`,
|
|
10579
|
+
right: `-${chainIconSize / 2}px`,
|
|
10580
|
+
backgroundColor: "transparent"
|
|
10581
|
+
},
|
|
10582
|
+
className: clsx9(chainContainerStyle)
|
|
10523
10583
|
},
|
|
10524
10584
|
/* @__PURE__ */ React113.createElement(
|
|
10525
10585
|
AsyncImage,
|
|
10526
10586
|
{
|
|
10527
10587
|
alt: chainMetadata.name,
|
|
10528
10588
|
src: chainMetadata.iconUrl || "",
|
|
10529
|
-
|
|
10530
|
-
borderRadius: "1",
|
|
10589
|
+
borderRadius: "full",
|
|
10531
10590
|
height: largeChainIcon ? chainIconSize : chainIconSize - 2,
|
|
10532
10591
|
width: largeChainIcon ? chainIconSize : chainIconSize - 2,
|
|
10533
10592
|
testId: `fun-asset-chain-${chainId}-icon`
|
|
@@ -11718,86 +11777,15 @@ function ChainModal({ onClose, open }) {
|
|
|
11718
11777
|
}
|
|
11719
11778
|
|
|
11720
11779
|
// src/modals/CheckoutModal/FunCheckoutModal.tsx
|
|
11721
|
-
import
|
|
11722
|
-
|
|
11723
|
-
// src/hooks/useIsCheckoutRisky.ts
|
|
11724
|
-
import { getRiskAssessmentForAddress } from "@funkit/api-base";
|
|
11725
|
-
import { FlagKey as FlagKey7 } from "@funkit/utils";
|
|
11726
|
-
import { useQuery as useQuery3 } from "@tanstack/react-query";
|
|
11727
|
-
import { useEffect as useEffect25 } from "react";
|
|
11728
|
-
var BLOCKED_RISK_LEVELS = ["Severe", "High"];
|
|
11729
|
-
var hasRisk = async (apiKey, walletAddress, customRecipient) => {
|
|
11730
|
-
const getUserWalletRisk = walletAddress ? getRiskAssessmentForAddress({
|
|
11731
|
-
address: walletAddress,
|
|
11732
|
-
apiKey,
|
|
11733
|
-
logger
|
|
11734
|
-
}).then((assessment) => assessment?.risk) : null;
|
|
11735
|
-
const getRecipientWalletRisk = customRecipient ? getRiskAssessmentForAddress({
|
|
11736
|
-
address: customRecipient,
|
|
11737
|
-
apiKey,
|
|
11738
|
-
logger
|
|
11739
|
-
}).then((assessment) => assessment?.risk) : null;
|
|
11740
|
-
const addressRisks = await Promise.all([
|
|
11741
|
-
getUserWalletRisk,
|
|
11742
|
-
getRecipientWalletRisk
|
|
11743
|
-
]);
|
|
11744
|
-
const isCheckoutRisky = addressRisks.some(
|
|
11745
|
-
(risk) => BLOCKED_RISK_LEVELS.includes(risk || "")
|
|
11746
|
-
);
|
|
11747
|
-
logger.log("riskAssessment_isCheckoutRisky", {
|
|
11748
|
-
isCheckoutRisky,
|
|
11749
|
-
addressRisks,
|
|
11750
|
-
walletAddress,
|
|
11751
|
-
customRecipient
|
|
11752
|
-
});
|
|
11753
|
-
return isCheckoutRisky;
|
|
11754
|
-
};
|
|
11755
|
-
function useIsBlacklisted(walletAddress, customRecipient) {
|
|
11756
|
-
const flagStr = useFlag(FlagKey7.AddressBlacklist);
|
|
11757
|
-
const blacklist = safeJSONParse(flagStr)?.map((addr) => addr.toLowerCase()) || [];
|
|
11758
|
-
const isWalletBlacklisted = walletAddress ? blacklist.includes(walletAddress.toLowerCase()) : false;
|
|
11759
|
-
const isRecipientBlacklisted = customRecipient ? blacklist.includes(customRecipient.toLowerCase()) : false;
|
|
11760
|
-
useEffect25(() => {
|
|
11761
|
-
logger.log("riskAssessment_isBlacklisted", {
|
|
11762
|
-
isWalletBlacklisted,
|
|
11763
|
-
isRecipientBlacklisted,
|
|
11764
|
-
walletAddress,
|
|
11765
|
-
customRecipient
|
|
11766
|
-
});
|
|
11767
|
-
}, [
|
|
11768
|
-
isWalletBlacklisted,
|
|
11769
|
-
isRecipientBlacklisted,
|
|
11770
|
-
walletAddress,
|
|
11771
|
-
customRecipient
|
|
11772
|
-
]);
|
|
11773
|
-
return isWalletBlacklisted || isRecipientBlacklisted;
|
|
11774
|
-
}
|
|
11775
|
-
var useIsCheckoutRisky = (checkoutItem) => {
|
|
11776
|
-
const { walletAddress } = useGeneralWallet();
|
|
11777
|
-
const { apiKey } = useFunkitConfig();
|
|
11778
|
-
const customRecipient = checkoutItem.initSettings.config.customRecipient;
|
|
11779
|
-
const isBlacklisted = useIsBlacklisted(
|
|
11780
|
-
walletAddress || void 0,
|
|
11781
|
-
customRecipient
|
|
11782
|
-
);
|
|
11783
|
-
const { data: isRisky } = useQuery3({
|
|
11784
|
-
queryKey: ["isCheckoutBlocked", walletAddress, customRecipient],
|
|
11785
|
-
queryFn: ({ queryKey: [_, walletAddress2, customRecipient2] }) => hasRisk(apiKey, walletAddress2 || void 0, customRecipient2),
|
|
11786
|
-
refetchOnWindowFocus: false,
|
|
11787
|
-
refetchOnMount: false,
|
|
11788
|
-
staleTime: 5 * 60 * 1e3,
|
|
11789
|
-
gcTime: Number.POSITIVE_INFINITY
|
|
11790
|
-
});
|
|
11791
|
-
return { isCheckoutRisky: isBlacklisted || isRisky };
|
|
11792
|
-
};
|
|
11780
|
+
import React204 from "react";
|
|
11793
11781
|
|
|
11794
11782
|
// src/components/DydxSwitchModalTab/DydxSwitchModalTab.tsx
|
|
11795
11783
|
import React130, { useCallback as useCallback23 } from "react";
|
|
11796
11784
|
|
|
11797
11785
|
// src/hooks/useFunkitMaxCheckoutUsdInfo.ts
|
|
11798
|
-
import { FlagKey as
|
|
11786
|
+
import { FlagKey as FlagKey7, formatCurrencyAndStringify as formatCurrencyAndStringify4 } from "@funkit/utils";
|
|
11799
11787
|
var useFunkitMaxCheckoutUsdInfo = () => {
|
|
11800
|
-
const maxCheckoutUsd = Number(useFlag(
|
|
11788
|
+
const maxCheckoutUsd = Number(useFlag(FlagKey7.MaxCheckoutUsd));
|
|
11801
11789
|
const limitText = maxCheckoutUsd === Number.MAX_VALUE ? "no" : formatCurrencyAndStringify4(maxCheckoutUsd, {
|
|
11802
11790
|
decimalPrecisionForSuffix: 0,
|
|
11803
11791
|
minimumSignificantDigits: 0,
|
|
@@ -11931,15 +11919,15 @@ var FunCheckoutBlocked = ({ reason }) => {
|
|
|
11931
11919
|
};
|
|
11932
11920
|
|
|
11933
11921
|
// src/providers/FunkitMoonpayProvider.tsx
|
|
11934
|
-
import { useQuery as
|
|
11922
|
+
import { useQuery as useQuery3 } from "@tanstack/react-query";
|
|
11935
11923
|
import React132, {
|
|
11936
11924
|
createContext as createContext14,
|
|
11937
11925
|
useContext as useContext14,
|
|
11938
|
-
useEffect as
|
|
11926
|
+
useEffect as useEffect25,
|
|
11939
11927
|
useMemo as useMemo17,
|
|
11940
11928
|
useState as useState32
|
|
11941
11929
|
} from "react";
|
|
11942
|
-
import { FlagKey as
|
|
11930
|
+
import { FlagKey as FlagKey8 } from "@funkit/utils";
|
|
11943
11931
|
|
|
11944
11932
|
// src/providers/FunkitSandboxContext.tsx
|
|
11945
11933
|
import { createContext as createContext13, useContext as useContext13 } from "react";
|
|
@@ -11949,7 +11937,7 @@ var useIsFunkitSandboxMode = () => useContext13(FunkitSandboxContext);
|
|
|
11949
11937
|
// src/providers/FunkitMoonpayProvider.tsx
|
|
11950
11938
|
var LazyMoonPayProvider = (props) => {
|
|
11951
11939
|
const [MoonPayProvider, setMoonPayProvider] = useState32(null);
|
|
11952
|
-
|
|
11940
|
+
useEffect25(() => {
|
|
11953
11941
|
const loadMoonPayProvider = async () => {
|
|
11954
11942
|
const module = await import("@moonpay/moonpay-react");
|
|
11955
11943
|
setMoonPayProvider(() => module.MoonPayProvider);
|
|
@@ -11993,7 +11981,7 @@ var isCountryBlocked = (blockedList, userIpInfo) => {
|
|
|
11993
11981
|
function useFunkitUserIp() {
|
|
11994
11982
|
const { moonpayApiKey } = useContext14(FunkitMoonpayContext);
|
|
11995
11983
|
const { getFlag, isLoading: isLoadingFlags } = useFlags();
|
|
11996
|
-
const { data: userIpInfo, isLoading: isLoadingGeoCheck } =
|
|
11984
|
+
const { data: userIpInfo, isLoading: isLoadingGeoCheck } = useQuery3({
|
|
11997
11985
|
queryKey: ["getUserIpInfo"],
|
|
11998
11986
|
queryFn: async () => {
|
|
11999
11987
|
try {
|
|
@@ -12021,7 +12009,7 @@ function useFunkitUserIp() {
|
|
|
12021
12009
|
if (!userIpInfo) {
|
|
12022
12010
|
return true;
|
|
12023
12011
|
}
|
|
12024
|
-
const blockedList = getFlag(
|
|
12012
|
+
const blockedList = getFlag(FlagKey8.BlockedCountries, ALL_MATCH).split(",");
|
|
12025
12013
|
return isCountryBlocked(blockedList, userIpInfo);
|
|
12026
12014
|
}, [getFlag, isLoadingFlags, isLoadingGeoCheck, userIpInfo]);
|
|
12027
12015
|
return {
|
|
@@ -12033,7 +12021,7 @@ function useFunkitUserIp() {
|
|
|
12033
12021
|
|
|
12034
12022
|
// src/modals/CheckoutModal/CheckoutNotifications.tsx
|
|
12035
12023
|
import clsx14 from "clsx";
|
|
12036
|
-
import React139, { useEffect as
|
|
12024
|
+
import React139, { useEffect as useEffect27, useMemo as useMemo18, useState as useState34 } from "react";
|
|
12037
12025
|
|
|
12038
12026
|
// src/components/FunNotificationBanner/FunNotificationShowMoreButton.tsx
|
|
12039
12027
|
import React134 from "react";
|
|
@@ -12105,8 +12093,8 @@ var FunNotificationShowMoreButton = ({
|
|
|
12105
12093
|
import {
|
|
12106
12094
|
getCheckoutsByUserId as getCheckoutsByUserId2
|
|
12107
12095
|
} from "@funkit/api-base";
|
|
12108
|
-
import { FlagKey as
|
|
12109
|
-
import { useQuery as
|
|
12096
|
+
import { FlagKey as FlagKey9 } from "@funkit/utils";
|
|
12097
|
+
import { useQuery as useQuery4 } from "@tanstack/react-query";
|
|
12110
12098
|
var hasCorrectPaymentMethod = (checkout, paymentMethod) => {
|
|
12111
12099
|
if (!paymentMethod) return true;
|
|
12112
12100
|
return checkout.clientMetadata.selectedPaymentMethodInfo?.paymentMethod === paymentMethod;
|
|
@@ -12114,7 +12102,7 @@ var hasCorrectPaymentMethod = (checkout, paymentMethod) => {
|
|
|
12114
12102
|
var isRecent = (checkout, timestampCutoff) => checkout.createdTimeMs > timestampCutoff;
|
|
12115
12103
|
var DEFAULT_CUTOFF = 7 * 24 * 60 * 60 * 1e3;
|
|
12116
12104
|
function useCheckoutRefreshInterval() {
|
|
12117
|
-
const str = useFlag(
|
|
12105
|
+
const str = useFlag(FlagKey9.CheckoutNotificationsRefreshInterval);
|
|
12118
12106
|
return safeJSONParse(str) || { listRefresh: 50 * 1e3, itemRefresh: 5 * 1e3 };
|
|
12119
12107
|
}
|
|
12120
12108
|
var useRecentCheckouts = ({
|
|
@@ -12127,7 +12115,7 @@ var useRecentCheckouts = ({
|
|
|
12127
12115
|
const { listRefresh } = useCheckoutRefreshInterval();
|
|
12128
12116
|
const defaultTimestampCutoff = Date.now() - DEFAULT_CUTOFF;
|
|
12129
12117
|
const timestampCutoff = newerThanMs ?? defaultTimestampCutoff;
|
|
12130
|
-
const query =
|
|
12118
|
+
const query = useQuery4({
|
|
12131
12119
|
queryKey: ["checkouts", userInfo.id],
|
|
12132
12120
|
queryFn: async () => {
|
|
12133
12121
|
const checkouts = await getCheckoutsByUserId2({
|
|
@@ -12159,7 +12147,7 @@ var showMoreButtonStyle = "_4yitd93 _1rsrm2fsl _1rsrm2f12 _1rsrm2fz _1rsrm2fj3 _
|
|
|
12159
12147
|
// src/components/FunNotificationBanner/FunNotificationBannerIcon.tsx
|
|
12160
12148
|
import clsx12 from "clsx";
|
|
12161
12149
|
import { motion, useAnimate } from "motion/react";
|
|
12162
|
-
import React135, { useCallback as useCallback24, useEffect as
|
|
12150
|
+
import React135, { useCallback as useCallback24, useEffect as useEffect26, useRef as useRef12 } from "react";
|
|
12163
12151
|
|
|
12164
12152
|
// src/components/FunNotificationBanner/FunNotificationBannerIcon.css.ts
|
|
12165
12153
|
var STATUS_SPINNER_BOTTOM_POSITION = -5;
|
|
@@ -12609,7 +12597,7 @@ var FunNotificationBannerIcon = ({
|
|
|
12609
12597
|
]);
|
|
12610
12598
|
}, [animate]);
|
|
12611
12599
|
const statusRef = useRef12(status);
|
|
12612
|
-
|
|
12600
|
+
useEffect26(() => {
|
|
12613
12601
|
if (statusRef.current !== status) {
|
|
12614
12602
|
if (statusRef.current === "processing" && status === "completed") {
|
|
12615
12603
|
triggerAnimationProcessingToCompleted();
|
|
@@ -12853,11 +12841,11 @@ var FunNotificationBannerSummary = ({
|
|
|
12853
12841
|
import {
|
|
12854
12842
|
getCheckoutByDepositAddress as getCheckoutByDepositAddress2
|
|
12855
12843
|
} from "@funkit/api-base";
|
|
12856
|
-
import { useQuery as
|
|
12844
|
+
import { useQuery as useQuery5 } from "@tanstack/react-query";
|
|
12857
12845
|
var useCheckout = (depositAddress, initial) => {
|
|
12858
12846
|
const { apiKey } = useFunkitConfig();
|
|
12859
12847
|
const { itemRefresh } = useCheckoutRefreshInterval();
|
|
12860
|
-
const query =
|
|
12848
|
+
const query = useQuery5({
|
|
12861
12849
|
queryKey: ["checkouts", "checkout", depositAddress],
|
|
12862
12850
|
queryFn: () => (
|
|
12863
12851
|
// biome-ignore lint/style/noNonNullAssertion: already checked for null
|
|
@@ -12963,7 +12951,7 @@ var CheckoutNotifications = ({
|
|
|
12963
12951
|
const [initialCheckouts, setInitialCheckouts] = useState34();
|
|
12964
12952
|
const [closedNotifications, setClosedNotifications] = useState34([]);
|
|
12965
12953
|
const { data: checkouts } = useRecentCheckouts({ isVisible });
|
|
12966
|
-
|
|
12954
|
+
useEffect27(() => {
|
|
12967
12955
|
if (initialCheckouts || !checkouts) return;
|
|
12968
12956
|
setInitialCheckouts(checkouts);
|
|
12969
12957
|
}, [initialCheckouts, checkouts]);
|
|
@@ -13024,12 +13012,12 @@ import {
|
|
|
13024
13012
|
import { useMemo as useMemo19 } from "react";
|
|
13025
13013
|
|
|
13026
13014
|
// src/providers/FunkitQuoteContext.tsx
|
|
13027
|
-
import { FlagKey as
|
|
13015
|
+
import { FlagKey as FlagKey10, isNotNullish as isNotNullish8 } from "@funkit/utils";
|
|
13028
13016
|
import React140, {
|
|
13029
13017
|
createContext as createContext15,
|
|
13030
13018
|
useCallback as useCallback25,
|
|
13031
13019
|
useContext as useContext15,
|
|
13032
|
-
useEffect as
|
|
13020
|
+
useEffect as useEffect28,
|
|
13033
13021
|
useState as useState35
|
|
13034
13022
|
} from "react";
|
|
13035
13023
|
import { useConfig as useConfig3 } from "wagmi";
|
|
@@ -13104,7 +13092,7 @@ import {
|
|
|
13104
13092
|
getCheckoutQuote as getApiCheckoutQuote
|
|
13105
13093
|
} from "@funkit/api-base";
|
|
13106
13094
|
|
|
13107
|
-
// src/domains/
|
|
13095
|
+
// src/domains/fees.ts
|
|
13108
13096
|
import {
|
|
13109
13097
|
getAssetPriceInfo as getAssetPriceInfo2,
|
|
13110
13098
|
getMoonpayBuyQuoteForCreditCard,
|
|
@@ -13214,7 +13202,7 @@ async function evaluateCardFees({
|
|
|
13214
13202
|
logger
|
|
13215
13203
|
});
|
|
13216
13204
|
if (moonpayEstimation.errors) {
|
|
13217
|
-
throw new Error("
|
|
13205
|
+
throw new Error("MoonPay estimation error");
|
|
13218
13206
|
}
|
|
13219
13207
|
const cardProcessingFeeUsd = moonpayEstimation.feeAmount;
|
|
13220
13208
|
const moonpayCostUsd = moonpayEstimation.totalAmount - cardProcessingFeeUsd - baseQuote.estTotalUsd;
|
|
@@ -13434,12 +13422,12 @@ function FunkitQuoteProvider({ children }) {
|
|
|
13434
13422
|
const funkitConfig = useFunkitConfig();
|
|
13435
13423
|
const wagmiConfig = useConfig3();
|
|
13436
13424
|
const { walletAddress, logoutSymbol, loginType, userInfo } = useGeneralWallet();
|
|
13437
|
-
const enableFrogProxyServer = useFlag(
|
|
13425
|
+
const enableFrogProxyServer = useFlag(FlagKey10.EnableFrogProxyServer);
|
|
13438
13426
|
const [latestQuote, setLatestQuote] = useState35(null);
|
|
13439
13427
|
const [isQuoting, setIsQuoting] = useState35(false);
|
|
13440
13428
|
const [quoteStepMessage, setQuoteStepMessage] = useState35("");
|
|
13441
13429
|
const [quoteErrorMessage, setQuoteErrorMessage] = useState35("");
|
|
13442
|
-
|
|
13430
|
+
useEffect28(() => {
|
|
13443
13431
|
if (isNotNullish8(logoutSymbol)) {
|
|
13444
13432
|
setLatestQuote(null);
|
|
13445
13433
|
setQuoteProgress({
|
|
@@ -13735,11 +13723,11 @@ function CheckoutHelp({
|
|
|
13735
13723
|
}
|
|
13736
13724
|
|
|
13737
13725
|
// src/modals/CheckoutModal/ConfirmationStep/ConfirmationStep.tsx
|
|
13738
|
-
import React157, { useEffect as
|
|
13726
|
+
import React157, { useEffect as useEffect34, useMemo as useMemo26, useState as useState47 } from "react";
|
|
13739
13727
|
import { createPortal as createPortal4 } from "react-dom";
|
|
13740
13728
|
|
|
13741
13729
|
// src/providers/UserPresenceContext.tsx
|
|
13742
|
-
import React143, { useEffect as
|
|
13730
|
+
import React143, { useEffect as useEffect29 } from "react";
|
|
13743
13731
|
import {
|
|
13744
13732
|
createContext as createContext16,
|
|
13745
13733
|
useContext as useContext16,
|
|
@@ -13751,7 +13739,7 @@ var UserPresenceContext = createContext16({
|
|
|
13751
13739
|
});
|
|
13752
13740
|
var UserPresenceProvider = ({ children }) => {
|
|
13753
13741
|
const [isAway, setIsAway] = useState36(false);
|
|
13754
|
-
|
|
13742
|
+
useEffect29(() => {
|
|
13755
13743
|
let timeoutId;
|
|
13756
13744
|
const handleVisibilityChange = () => {
|
|
13757
13745
|
if (document.visibilityState === "visible") {
|
|
@@ -13776,7 +13764,7 @@ import { FlagKey as FlagKey15 } from "@funkit/utils";
|
|
|
13776
13764
|
|
|
13777
13765
|
// src/components/FunInfoBanner/FunInfoBanner.tsx
|
|
13778
13766
|
import React146 from "react";
|
|
13779
|
-
import { FlagKey as
|
|
13767
|
+
import { FlagKey as FlagKey11, safeParseJson as safeParseJson2 } from "@funkit/utils";
|
|
13780
13768
|
|
|
13781
13769
|
// src/components/FunInfoBanner/EphemeralInfoBanner.tsx
|
|
13782
13770
|
import React145, { useState as useState37 } from "react";
|
|
@@ -13976,7 +13964,7 @@ var EphemeralInfoBanner = ({
|
|
|
13976
13964
|
|
|
13977
13965
|
// src/components/FunInfoBanner/FunInfoBanner.tsx
|
|
13978
13966
|
var FunInfoBanner = () => {
|
|
13979
|
-
const bannerJson = useFlag(
|
|
13967
|
+
const bannerJson = useFlag(FlagKey11.ShowInfoBanner);
|
|
13980
13968
|
const bannerData = safeParseJson2(bannerJson);
|
|
13981
13969
|
if (!bannerData || !bannerData.message) return null;
|
|
13982
13970
|
const { expireAtMs, ...bannerProps } = bannerData;
|
|
@@ -14000,7 +13988,7 @@ import { motion as motion4, useAnimationControls } from "motion/react";
|
|
|
14000
13988
|
// src/components/FunTooltip/FunTooltip.tsx
|
|
14001
13989
|
import React147, {
|
|
14002
13990
|
useCallback as useCallback27,
|
|
14003
|
-
useEffect as
|
|
13991
|
+
useEffect as useEffect30,
|
|
14004
13992
|
useRef as useRef13,
|
|
14005
13993
|
useState as useState38
|
|
14006
13994
|
} from "react";
|
|
@@ -14041,10 +14029,10 @@ var FunTooltip = ({
|
|
|
14041
14029
|
setIsDisplayed(false);
|
|
14042
14030
|
}, HIDE_DELAY);
|
|
14043
14031
|
}, []);
|
|
14044
|
-
|
|
14032
|
+
useEffect30(() => {
|
|
14045
14033
|
return () => clearTimeout(delayRef.current);
|
|
14046
14034
|
}, []);
|
|
14047
|
-
|
|
14035
|
+
useEffect30(() => {
|
|
14048
14036
|
if (!wrapperElementRef?.current || !tooltipRef.current || !enableDynamicPositioning) {
|
|
14049
14037
|
return;
|
|
14050
14038
|
}
|
|
@@ -14202,7 +14190,7 @@ var extractFeeItems = (fees, totalUsd, isDydx) => {
|
|
|
14202
14190
|
tooltipPosition: "center"
|
|
14203
14191
|
},
|
|
14204
14192
|
{
|
|
14205
|
-
label: "
|
|
14193
|
+
label: "MoonPay cost",
|
|
14206
14194
|
value: formatCurrencyAndStringify5(moonpayCostUsd),
|
|
14207
14195
|
tooltipText: "Fee charged by MoonPay for processing your transaction."
|
|
14208
14196
|
}
|
|
@@ -14368,6 +14356,15 @@ import {
|
|
|
14368
14356
|
import NumberFlow from "@number-flow/react";
|
|
14369
14357
|
import { motion as motion5 } from "motion/react";
|
|
14370
14358
|
import React150, { useMemo as useMemo21 } from "react";
|
|
14359
|
+
|
|
14360
|
+
// src/consts/animations.ts
|
|
14361
|
+
var mapFontLineHeightToNumberFlowHeight = {
|
|
14362
|
+
"14px": "18px",
|
|
14363
|
+
"20px": "21px",
|
|
14364
|
+
"48px": "60px"
|
|
14365
|
+
};
|
|
14366
|
+
|
|
14367
|
+
// src/components/FunTransactionSummary/PaymentMethodSummary.tsx
|
|
14371
14368
|
function PaymentMethodSummary({
|
|
14372
14369
|
paymentMethodInfo,
|
|
14373
14370
|
walletAddress,
|
|
@@ -14384,6 +14381,7 @@ function PaymentMethodSummary({
|
|
|
14384
14381
|
const destinationIcon = customDestinationConfig?.icon ?? walletIcon;
|
|
14385
14382
|
const destinationText = customDestinationConfig?.text ?? formatAddress5(customRecipient ?? walletAddress ?? "");
|
|
14386
14383
|
const { apiKey } = useFunkitConfig();
|
|
14384
|
+
const { activeTheme } = useActiveTheme();
|
|
14387
14385
|
return /* @__PURE__ */ React150.createElement(
|
|
14388
14386
|
FunTxSummaryBox,
|
|
14389
14387
|
{
|
|
@@ -14412,7 +14410,16 @@ function PaymentMethodSummary({
|
|
|
14412
14410
|
/* @__PURE__ */ React150.createElement(Box, { width: "15", height: "15", display: "flex", alignItems: "center" }, destinationIcon),
|
|
14413
14411
|
/* @__PURE__ */ React150.createElement(Text, { weight: "medium", color: "primaryText", size: "12" }, destinationText)
|
|
14414
14412
|
)), /* @__PURE__ */ React150.createElement(FunTxSummaryDivider, null)),
|
|
14415
|
-
/* @__PURE__ */ React150.createElement(FunTxSummaryLineItem, null, /* @__PURE__ */ React150.createElement(FunTxSummaryLineItemKeyText, { text: "Estimated time" }), isLoading ?
|
|
14413
|
+
/* @__PURE__ */ React150.createElement(FunTxSummaryLineItem, null, /* @__PURE__ */ React150.createElement(FunTxSummaryLineItemKeyText, { text: "Estimated time" }), isLoading ? (
|
|
14414
|
+
// height has to match the lineHeight of the text, keep these in sync to prevent layout shifts
|
|
14415
|
+
/* @__PURE__ */ React150.createElement(
|
|
14416
|
+
FunSkeletonBlock,
|
|
14417
|
+
{
|
|
14418
|
+
height: activeTheme.fontSize["12"].lineHeight,
|
|
14419
|
+
width: "54"
|
|
14420
|
+
}
|
|
14421
|
+
)
|
|
14422
|
+
) : /* @__PURE__ */ React150.createElement(Text, { weight: "medium", size: "12", textAlign: "right" }, estimatedTime === 0 ? "-" : formatSecondsToReadableForm2(estimatedTime, true)))
|
|
14416
14423
|
);
|
|
14417
14424
|
}
|
|
14418
14425
|
function PaymentAmountSummary({
|
|
@@ -14461,8 +14468,7 @@ function PaymentAmountSummary({
|
|
|
14461
14468
|
assetTicker: sourceSymbol,
|
|
14462
14469
|
assetName: sourceSymbol,
|
|
14463
14470
|
assetSrc: sourceIcon,
|
|
14464
|
-
chainId: areSameChains ? void 0 : sourceChainId
|
|
14465
|
-
hideIfUnknown: true
|
|
14471
|
+
chainId: areSameChains ? void 0 : sourceChainId
|
|
14466
14472
|
}
|
|
14467
14473
|
),
|
|
14468
14474
|
isLoading
|
|
@@ -14497,7 +14503,21 @@ function PaymentAmountSummaryItem({
|
|
|
14497
14503
|
icon,
|
|
14498
14504
|
valueSymbol
|
|
14499
14505
|
}) {
|
|
14500
|
-
|
|
14506
|
+
const { activeTheme } = useActiveTheme();
|
|
14507
|
+
return /* @__PURE__ */ React150.createElement(FunTxSummaryLineItem, null, /* @__PURE__ */ React150.createElement(FunTxSummaryLineItemKeyText, { text: label }), isLoading ? /* @__PURE__ */ React150.createElement(
|
|
14508
|
+
Box,
|
|
14509
|
+
{
|
|
14510
|
+
alignItems: "center",
|
|
14511
|
+
display: "flex",
|
|
14512
|
+
gap: "8",
|
|
14513
|
+
style: {
|
|
14514
|
+
// match the height of the final rendered height of the number component rendered by NumberFlow, keep in sync in case the `fontSize` changes
|
|
14515
|
+
height: mapFontLineHeightToNumberFlowHeight[activeTheme.fontSize["12"].lineHeight] ?? activeTheme.fontSize["12"].lineHeight
|
|
14516
|
+
}
|
|
14517
|
+
},
|
|
14518
|
+
/* @__PURE__ */ React150.createElement(FunSkeletonCircle, { size: "15" }),
|
|
14519
|
+
/* @__PURE__ */ React150.createElement(FunSkeletonBlock, { height: "10", width: "93" })
|
|
14520
|
+
) : /* @__PURE__ */ React150.createElement(Box, { display: "flex", justifyContent: "flex-end", flexDirection: "column" }, paymentTokenAmount === void 0 || Number.isNaN(paymentTokenAmount) ? "-" : /* @__PURE__ */ React150.createElement(Box, { display: "flex", alignItems: "center", gap: "5" }, /* @__PURE__ */ React150.createElement(motion5.div, { layout: true }, /* @__PURE__ */ React150.createElement(Box, { display: "flex", alignItems: "center", gap: "5" }, icon, /* @__PURE__ */ React150.createElement(
|
|
14501
14521
|
Box,
|
|
14502
14522
|
{
|
|
14503
14523
|
fontWeight: "medium",
|
|
@@ -14553,6 +14573,7 @@ function CheckoutPrimaryInfo({
|
|
|
14553
14573
|
config,
|
|
14554
14574
|
isLoading = false
|
|
14555
14575
|
}) {
|
|
14576
|
+
const { activeTheme } = useActiveTheme();
|
|
14556
14577
|
const checkoutItemDisplay = useCheckoutItemDisplay({ checkoutConfig: config });
|
|
14557
14578
|
return /* @__PURE__ */ React152.createElement(
|
|
14558
14579
|
Box,
|
|
@@ -14563,7 +14584,16 @@ function CheckoutPrimaryInfo({
|
|
|
14563
14584
|
justifyContent: "center",
|
|
14564
14585
|
gap: "4"
|
|
14565
14586
|
},
|
|
14566
|
-
isLoading ?
|
|
14587
|
+
isLoading ? (
|
|
14588
|
+
// match the height of the final rendered height of the AnimatedDollarValue component, keep in sync in case the `fontSize` changes
|
|
14589
|
+
/* @__PURE__ */ React152.createElement(
|
|
14590
|
+
FunSkeletonBlock,
|
|
14591
|
+
{
|
|
14592
|
+
height: mapFontLineHeightToNumberFlowHeight[activeTheme.fontSize["40"].lineHeight] ?? activeTheme.fontSize["40"].lineHeight,
|
|
14593
|
+
width: "120"
|
|
14594
|
+
}
|
|
14595
|
+
)
|
|
14596
|
+
) : quote ? /* @__PURE__ */ React152.createElement(
|
|
14567
14597
|
Box,
|
|
14568
14598
|
{
|
|
14569
14599
|
fontSize: "40",
|
|
@@ -14666,11 +14696,11 @@ import { ClientError as ClientError2 } from "@funkit/utils";
|
|
|
14666
14696
|
import { useState as useState41 } from "react";
|
|
14667
14697
|
|
|
14668
14698
|
// src/hooks/useAutoClearState.ts
|
|
14669
|
-
import { useCallback as useCallback28, useEffect as
|
|
14699
|
+
import { useCallback as useCallback28, useEffect as useEffect31, useRef as useRef14, useState as useState40 } from "react";
|
|
14670
14700
|
function useAutoClearState(initialValue = null) {
|
|
14671
14701
|
const [state, setState] = useState40(initialValue);
|
|
14672
14702
|
const timeoutRef = useRef14();
|
|
14673
|
-
|
|
14703
|
+
useEffect31(() => {
|
|
14674
14704
|
return () => {
|
|
14675
14705
|
if (timeoutRef.current !== void 0) {
|
|
14676
14706
|
clearTimeout(timeoutRef.current);
|
|
@@ -14692,16 +14722,38 @@ function useAutoClearState(initialValue = null) {
|
|
|
14692
14722
|
];
|
|
14693
14723
|
}
|
|
14694
14724
|
|
|
14725
|
+
// src/hooks/useIsBlacklisted.ts
|
|
14726
|
+
import { FlagKey as FlagKey12 } from "@funkit/utils";
|
|
14727
|
+
import { useMemo as useMemo23 } from "react";
|
|
14728
|
+
var useIsBlacklisted = (walletAddress, customRecipient) => {
|
|
14729
|
+
const flagStr = useFlag(FlagKey12.AddressBlacklist);
|
|
14730
|
+
const blacklist = useMemo23(
|
|
14731
|
+
() => safeJSONParse(flagStr)?.map((addr) => addr.toLowerCase()) || [],
|
|
14732
|
+
[flagStr]
|
|
14733
|
+
);
|
|
14734
|
+
return {
|
|
14735
|
+
isWalletBlacklisted: walletAddress ? blacklist.includes(walletAddress.toLowerCase()) : false,
|
|
14736
|
+
isCustomRecipientBlacklisted: customRecipient ? blacklist.includes(customRecipient.toLowerCase()) : false
|
|
14737
|
+
};
|
|
14738
|
+
};
|
|
14739
|
+
|
|
14695
14740
|
// src/modals/CheckoutModal/ConfirmationStep/useCheckoutConfirmation.ts
|
|
14696
14741
|
var CHECKOUT_CONFIRMATION_UI_ERRORS = {
|
|
14697
14742
|
QUOTE_EXPIRED: {
|
|
14698
14743
|
durationMs: 5e3,
|
|
14699
14744
|
message: "Quote expired. Please re-confirm the new checkout quote.",
|
|
14700
|
-
type: "error"
|
|
14745
|
+
type: "error",
|
|
14746
|
+
code: "QUOTE_EXPIRED" /* QUOTE_EXPIRED */
|
|
14701
14747
|
},
|
|
14702
14748
|
GENERIC_ERROR: {
|
|
14703
14749
|
message: "An error occurred during checkout. Please try again.",
|
|
14704
|
-
type: "error"
|
|
14750
|
+
type: "error",
|
|
14751
|
+
code: "GENERIC_ERROR" /* GENERIC_ERROR */
|
|
14752
|
+
},
|
|
14753
|
+
RISK_ERROR: {
|
|
14754
|
+
message: `Sorry, ${FUN_ORG_NAME} Checkout is unable to proceed for security reasons.`,
|
|
14755
|
+
type: "warning",
|
|
14756
|
+
code: "RISK_ERROR" /* RISK_ERROR */
|
|
14705
14757
|
}
|
|
14706
14758
|
};
|
|
14707
14759
|
function isQuoteExpiredError(error) {
|
|
@@ -14711,10 +14763,15 @@ function toCheckoutConfirmationError(error) {
|
|
|
14711
14763
|
if (error instanceof Error && isQuoteExpiredError(error)) {
|
|
14712
14764
|
return CHECKOUT_CONFIRMATION_UI_ERRORS.QUOTE_EXPIRED;
|
|
14713
14765
|
}
|
|
14766
|
+
if (error instanceof Error) {
|
|
14767
|
+
const confirmationError = CHECKOUT_CONFIRMATION_UI_ERRORS[error.message];
|
|
14768
|
+
if (confirmationError) return confirmationError;
|
|
14769
|
+
}
|
|
14714
14770
|
if (error instanceof ClientError2) {
|
|
14715
14771
|
return {
|
|
14716
14772
|
message: error.rawMessage,
|
|
14717
|
-
type: "error"
|
|
14773
|
+
type: "error",
|
|
14774
|
+
code: "GENERIC_ERROR" /* GENERIC_ERROR */
|
|
14718
14775
|
};
|
|
14719
14776
|
}
|
|
14720
14777
|
return CHECKOUT_CONFIRMATION_UI_ERRORS.GENERIC_ERROR;
|
|
@@ -14724,8 +14781,11 @@ function useCheckoutConfirmation({
|
|
|
14724
14781
|
onSuccess
|
|
14725
14782
|
}) {
|
|
14726
14783
|
const { checkoutItem, confirmCheckout } = useCheckoutContext();
|
|
14784
|
+
const customRecipient = checkoutItem?.initSettings.config.customRecipient;
|
|
14785
|
+
const { apiKey } = useFunkitConfig();
|
|
14727
14786
|
const { latestQuote } = useQuoteContext();
|
|
14728
|
-
const { loginType, funWallet } = useGeneralWallet();
|
|
14787
|
+
const { loginType, funWallet, walletAddress } = useGeneralWallet();
|
|
14788
|
+
const { isCustomRecipientBlacklisted, isWalletBlacklisted } = useIsBlacklisted(walletAddress, customRecipient);
|
|
14729
14789
|
const [error, setError] = useAutoClearState();
|
|
14730
14790
|
const [isLoading, setIsLoading] = useState41(false);
|
|
14731
14791
|
const [step, setStep] = useState41(null);
|
|
@@ -14735,6 +14795,17 @@ function useCheckoutConfirmation({
|
|
|
14735
14795
|
return;
|
|
14736
14796
|
}
|
|
14737
14797
|
setIsLoading(true);
|
|
14798
|
+
logger.log("riskAssessment_isBlacklisted", {
|
|
14799
|
+
isWalletBlacklisted,
|
|
14800
|
+
isCustomRecipientBlacklisted,
|
|
14801
|
+
walletAddress,
|
|
14802
|
+
customRecipient
|
|
14803
|
+
});
|
|
14804
|
+
const isRisky = await hasRisk(apiKey, walletAddress, customRecipient);
|
|
14805
|
+
const isCheckoutRisky = isRisky || isWalletBlacklisted || isCustomRecipientBlacklisted;
|
|
14806
|
+
if (isCheckoutRisky) {
|
|
14807
|
+
throw new Error("RISK_ERROR" /* RISK_ERROR */);
|
|
14808
|
+
}
|
|
14738
14809
|
let shouldBatchOpBypassInit = false;
|
|
14739
14810
|
if (!isCheckoutCrFlow(checkoutItem) && loginType !== "web3" /* Web3 */) {
|
|
14740
14811
|
const targetChainId = checkoutItem.initSettings.config.targetChain;
|
|
@@ -14778,7 +14849,7 @@ function useCheckoutConfirmation({
|
|
|
14778
14849
|
import { useState as useState43 } from "react";
|
|
14779
14850
|
|
|
14780
14851
|
// src/modals/CheckoutModal/useSourceAssetConfirm.tsx
|
|
14781
|
-
import { useEffect as
|
|
14852
|
+
import { useEffect as useEffect32, useState as useState42 } from "react";
|
|
14782
14853
|
|
|
14783
14854
|
// src/hooks/useCheckoutAccountBalanceTransfer.ts
|
|
14784
14855
|
import { useCallback as useCallback29 } from "react";
|
|
@@ -14834,8 +14905,8 @@ function useCheckoutAccountBalanceTransfer() {
|
|
|
14834
14905
|
}
|
|
14835
14906
|
|
|
14836
14907
|
// src/hooks/useMesh.tsx
|
|
14837
|
-
import { useQuery as
|
|
14838
|
-
import React155, { useMemo as
|
|
14908
|
+
import { useQuery as useQuery6 } from "@tanstack/react-query";
|
|
14909
|
+
import React155, { useMemo as useMemo24 } from "react";
|
|
14839
14910
|
import { FlagKey as FlagKey13 } from "@funkit/utils";
|
|
14840
14911
|
|
|
14841
14912
|
// src/components/FunSelectBrokerage/FunBrokerageItem.tsx
|
|
@@ -14892,7 +14963,7 @@ var useSupportedExchanges = () => {
|
|
|
14892
14963
|
FlagKey13.SupportedExchangesV2,
|
|
14893
14964
|
FALLBACK_EXCHANGES_STRING
|
|
14894
14965
|
);
|
|
14895
|
-
return
|
|
14966
|
+
return useMemo24(() => {
|
|
14896
14967
|
return supportedExchangesFlag.split(",").flatMap((value) => {
|
|
14897
14968
|
const brokerNameOrType = value.trim();
|
|
14898
14969
|
if (!brokerNameOrType) {
|
|
@@ -14916,7 +14987,7 @@ var useMeshExchanges = ({
|
|
|
14916
14987
|
}) => {
|
|
14917
14988
|
const { getActiveConnection } = useFunkitMesh();
|
|
14918
14989
|
const supportedExchanges = useSupportedExchanges();
|
|
14919
|
-
const options =
|
|
14990
|
+
const options = useMemo24(() => {
|
|
14920
14991
|
return supportedExchanges.map((brokerType) => {
|
|
14921
14992
|
const hasActiveConnection = !!getActiveConnection(brokerType);
|
|
14922
14993
|
return createFunSelectOption(
|
|
@@ -14944,7 +15015,7 @@ var useMeshActiveNetworkInfo = (chainId, brokerType) => {
|
|
|
14944
15015
|
};
|
|
14945
15016
|
function useMeshIntegrations() {
|
|
14946
15017
|
const { apiKey } = useFunkitConfig();
|
|
14947
|
-
const { data, isLoading } =
|
|
15018
|
+
const { data, isLoading } = useQuery6({
|
|
14948
15019
|
queryKey: ["funkit-mesh-integrations", apiKey],
|
|
14949
15020
|
queryFn: async () => {
|
|
14950
15021
|
return await fetchMeshTransferIntegrations(apiKey);
|
|
@@ -14986,7 +15057,7 @@ function useMeshAccountHoldings(targetChain, connection) {
|
|
|
14986
15057
|
const { integrations } = useMeshIntegrations();
|
|
14987
15058
|
const meshDeviceId = getMeshDeviceIdFromLocalStorage();
|
|
14988
15059
|
const enableFrogProxyServer = useFlag(FlagKey13.EnableFrogProxyServer);
|
|
14989
|
-
const query =
|
|
15060
|
+
const query = useQuery6({
|
|
14990
15061
|
queryKey: [
|
|
14991
15062
|
{
|
|
14992
15063
|
apiKey,
|
|
@@ -15106,7 +15177,7 @@ function useHackyTriggerWorkaroundReactDevBrainExplode() {
|
|
|
15106
15177
|
function useTriggerQuoteAndOtherStuffsWithExtremeCaution(onResult, setPreloadedQuoteData) {
|
|
15107
15178
|
const [assetRefresh, triggerAssetConfirm] = useHackyTriggerWorkaroundReactDevBrainExplode();
|
|
15108
15179
|
const { isSourceAssetConfirming, onSourceAssetConfirmed } = useSourceAssetConfirm(setPreloadedQuoteData);
|
|
15109
|
-
|
|
15180
|
+
useEffect32(() => {
|
|
15110
15181
|
if (assetRefresh === 0) {
|
|
15111
15182
|
return;
|
|
15112
15183
|
}
|
|
@@ -15505,7 +15576,7 @@ function usePostCheckout({
|
|
|
15505
15576
|
}
|
|
15506
15577
|
|
|
15507
15578
|
// src/modals/CheckoutModal/ConfirmationStep/useQuoteRefresh.ts
|
|
15508
|
-
import { useCallback as useCallback32, useEffect as
|
|
15579
|
+
import { useCallback as useCallback32, useEffect as useEffect33, useMemo as useMemo25, useRef as useRef15, useState as useState46 } from "react";
|
|
15509
15580
|
|
|
15510
15581
|
// src/hooks/useCountdown.tsx
|
|
15511
15582
|
import React156 from "react";
|
|
@@ -15614,7 +15685,7 @@ function useQuoteRefresh({
|
|
|
15614
15685
|
},
|
|
15615
15686
|
[isOnHold, restartCountdown, setCheckoutQuote, triggerAssetConfirm]
|
|
15616
15687
|
);
|
|
15617
|
-
const quoteError =
|
|
15688
|
+
const quoteError = useMemo25(() => {
|
|
15618
15689
|
if (quoteErrorMessage && !isQuoting) {
|
|
15619
15690
|
return {
|
|
15620
15691
|
message: quoteErrorMessage,
|
|
@@ -15623,7 +15694,7 @@ function useQuoteRefresh({
|
|
|
15623
15694
|
}
|
|
15624
15695
|
return null;
|
|
15625
15696
|
}, [isQuoting, quoteErrorMessage]);
|
|
15626
|
-
|
|
15697
|
+
useEffect33(() => {
|
|
15627
15698
|
if (isPendingRefresh && !isOnHold) {
|
|
15628
15699
|
setIsPendingRefresh(false);
|
|
15629
15700
|
refreshQuote();
|
|
@@ -15685,16 +15756,16 @@ var ConfirmationStepInfo = {
|
|
|
15685
15756
|
var DEFAULT_CONTINUE_TEXT = "Confirm Order";
|
|
15686
15757
|
function ConfirmationStep({
|
|
15687
15758
|
modalState,
|
|
15688
|
-
onNext
|
|
15759
|
+
onNext,
|
|
15760
|
+
setModalState
|
|
15689
15761
|
}) {
|
|
15690
|
-
const { targetChainId } = modalState;
|
|
15691
|
-
const { paymentMethod } = modalState.paymentMethodInfo;
|
|
15692
15762
|
const { checkoutItem, updateTargetAssetAmount } = useCheckoutContext();
|
|
15693
15763
|
const { latestQuote } = useQuoteContext();
|
|
15694
15764
|
const funkitConfig = useFunkitConfig();
|
|
15695
15765
|
const { walletAddress } = useGeneralWallet();
|
|
15696
15766
|
const showTagline = useFlag(FlagKey15.ShowPoweredTagline, false);
|
|
15697
|
-
const
|
|
15767
|
+
const { paymentMethodInfo } = modalState;
|
|
15768
|
+
const moonpayAmountCheck = paymentMethodInfo.paymentMethod === "card" /* CARD */ ? checkAmountForMoonpay(checkoutItem?.finalDollarValue || 0) : void 0;
|
|
15698
15769
|
const {
|
|
15699
15770
|
handlePostCheckout,
|
|
15700
15771
|
isPostCheckoutLoading,
|
|
@@ -15710,9 +15781,13 @@ function ConfirmationStep({
|
|
|
15710
15781
|
handleCheckoutConfirmation,
|
|
15711
15782
|
isConfirming
|
|
15712
15783
|
} = useCheckoutConfirmation({
|
|
15713
|
-
|
|
15714
|
-
|
|
15715
|
-
|
|
15784
|
+
onError: (error2) => {
|
|
15785
|
+
if (error2.code === "RISK_ERROR" /* RISK_ERROR */) {
|
|
15786
|
+
setModalState((state) => ({ ...state, isBlocked: true }));
|
|
15787
|
+
} else {
|
|
15788
|
+
refreshQuote(true);
|
|
15789
|
+
}
|
|
15790
|
+
},
|
|
15716
15791
|
onSuccess: handlePostCheckout
|
|
15717
15792
|
});
|
|
15718
15793
|
const { unlinkBrokerage } = useFunkitMesh();
|
|
@@ -15731,7 +15806,7 @@ function ConfirmationStep({
|
|
|
15731
15806
|
setSuggestedAssetAmount(maxTargetAssetAmount);
|
|
15732
15807
|
}
|
|
15733
15808
|
});
|
|
15734
|
-
|
|
15809
|
+
useEffect34(() => {
|
|
15735
15810
|
triggerNewQuote({ maxRetries: 1 });
|
|
15736
15811
|
}, []);
|
|
15737
15812
|
const isContinuing = isConfirming || isPostCheckoutLoading;
|
|
@@ -15740,7 +15815,7 @@ function ConfirmationStep({
|
|
|
15740
15815
|
// Block updates to the current quote during confirmation and post-checkout
|
|
15741
15816
|
useQuoteRefresh({ isOnHold: isInitialQuoting || isContinuing || isAway })
|
|
15742
15817
|
);
|
|
15743
|
-
const error =
|
|
15818
|
+
const error = useMemo26(() => {
|
|
15744
15819
|
if (!isInitialQuoting && moonpayAmountCheck?.isInvalid) {
|
|
15745
15820
|
return {
|
|
15746
15821
|
message: moonpayAmountCheck.message,
|
|
@@ -15755,7 +15830,7 @@ function ConfirmationStep({
|
|
|
15755
15830
|
quoteError,
|
|
15756
15831
|
isInitialQuoting
|
|
15757
15832
|
]);
|
|
15758
|
-
const stepMessage =
|
|
15833
|
+
const stepMessage = useMemo26(() => {
|
|
15759
15834
|
if (initialQuoteStep) return initialQuoteStep;
|
|
15760
15835
|
if (postCheckoutStepMessage) return postCheckoutStepMessage;
|
|
15761
15836
|
if (confirmationStepMessage) return confirmationStepMessage;
|
|
@@ -15773,13 +15848,10 @@ function ConfirmationStep({
|
|
|
15773
15848
|
checkoutConfig: checkoutItem?.initSettings.config,
|
|
15774
15849
|
hideAmount: true
|
|
15775
15850
|
});
|
|
15776
|
-
const textCustomizations = funkitConfig.textCustomizations.confirmationScreen;
|
|
15777
|
-
const uiCustomizations = funkitConfig.uiCustomizations?.confirmationScreen;
|
|
15778
15851
|
const estimatedTime = useCheckoutTimeEstimate(
|
|
15779
15852
|
latestQuote?.finalTimeEstimationMs,
|
|
15780
|
-
paymentMethod
|
|
15853
|
+
paymentMethodInfo.paymentMethod
|
|
15781
15854
|
);
|
|
15782
|
-
const customRecipient = checkoutItem?.initSettings.config.customRecipient;
|
|
15783
15855
|
const continueConfig = () => {
|
|
15784
15856
|
if (!quoteError) {
|
|
15785
15857
|
return {
|
|
@@ -15802,8 +15874,11 @@ function ConfirmationStep({
|
|
|
15802
15874
|
handleContinue: () => refreshQuote(true)
|
|
15803
15875
|
};
|
|
15804
15876
|
};
|
|
15877
|
+
const isQuoteLoading = isInitialQuoting || isQuoting;
|
|
15805
15878
|
const isStepLoading = isInitialQuoting || isContinuing || isRefreshing;
|
|
15806
|
-
const
|
|
15879
|
+
const textCustomizations = funkitConfig.textCustomizations.confirmationScreen;
|
|
15880
|
+
const uiCustomizations = funkitConfig.uiCustomizations?.confirmationScreen;
|
|
15881
|
+
const customRecipient = checkoutItem?.initSettings.config.customRecipient;
|
|
15807
15882
|
return /* @__PURE__ */ React157.createElement(Box, null, /* @__PURE__ */ React157.createElement(
|
|
15808
15883
|
Box,
|
|
15809
15884
|
{
|
|
@@ -15818,16 +15893,16 @@ function ConfirmationStep({
|
|
|
15818
15893
|
showTokenAmount: uiCustomizations?.showTokenAmount,
|
|
15819
15894
|
config: checkoutItem.initSettings.config,
|
|
15820
15895
|
quote: latestQuote,
|
|
15821
|
-
isLoading:
|
|
15896
|
+
isLoading: isQuoteLoading
|
|
15822
15897
|
}
|
|
15823
15898
|
),
|
|
15824
15899
|
/* @__PURE__ */ React157.createElement(
|
|
15825
15900
|
PaymentMethodSummary,
|
|
15826
15901
|
{
|
|
15827
|
-
paymentMethodInfo
|
|
15902
|
+
paymentMethodInfo,
|
|
15828
15903
|
walletAddress,
|
|
15829
15904
|
customRecipient,
|
|
15830
|
-
isLoading:
|
|
15905
|
+
isLoading: isQuoteLoading,
|
|
15831
15906
|
estimatedTime,
|
|
15832
15907
|
customDestinationConfig: uiCustomizations?.destinationConfig
|
|
15833
15908
|
}
|
|
@@ -15835,21 +15910,15 @@ function ConfirmationStep({
|
|
|
15835
15910
|
/* @__PURE__ */ React157.createElement(
|
|
15836
15911
|
PaymentAmountSummary,
|
|
15837
15912
|
{
|
|
15838
|
-
isLoading:
|
|
15839
|
-
targetChainId,
|
|
15913
|
+
isLoading: isQuoteLoading,
|
|
15914
|
+
targetChainId: modalState.targetChainId,
|
|
15840
15915
|
checkoutItem,
|
|
15841
15916
|
quote: latestQuote,
|
|
15842
15917
|
textCustomizations,
|
|
15843
15918
|
uiCustomizations
|
|
15844
15919
|
}
|
|
15845
15920
|
),
|
|
15846
|
-
/* @__PURE__ */ React157.createElement(
|
|
15847
|
-
PaymentFeesSummary,
|
|
15848
|
-
{
|
|
15849
|
-
isLoading: isInitialQuoting || isQuoting,
|
|
15850
|
-
quote: latestQuote
|
|
15851
|
-
}
|
|
15852
|
-
),
|
|
15921
|
+
/* @__PURE__ */ React157.createElement(PaymentFeesSummary, { isLoading: isQuoteLoading, quote: latestQuote }),
|
|
15853
15922
|
/* @__PURE__ */ React157.createElement(Box, { display: "flex", flexDirection: "column", gap: "4" }, /* @__PURE__ */ React157.createElement(FunInfoBanner, null), /* @__PURE__ */ React157.createElement(
|
|
15854
15923
|
FunAlert,
|
|
15855
15924
|
{
|
|
@@ -15859,7 +15928,7 @@ function ConfirmationStep({
|
|
|
15859
15928
|
showDydxDisclaimer: showTagline,
|
|
15860
15929
|
checkoutItem,
|
|
15861
15930
|
continueText: DEFAULT_CONTINUE_TEXT,
|
|
15862
|
-
isCardPayment: paymentMethod === "card" /* CARD */,
|
|
15931
|
+
isCardPayment: paymentMethodInfo.paymentMethod === "card" /* CARD */,
|
|
15863
15932
|
finalConvertedAssetName
|
|
15864
15933
|
}
|
|
15865
15934
|
))
|
|
@@ -16132,7 +16201,7 @@ function ConnectExchange({
|
|
|
16132
16201
|
|
|
16133
16202
|
// src/modals/CheckoutModal/InputAmount/InputAmount.tsx
|
|
16134
16203
|
import { isMobile as isMobile12 } from "@funkit/utils";
|
|
16135
|
-
import React170, { useEffect as
|
|
16204
|
+
import React170, { useEffect as useEffect36 } from "react";
|
|
16136
16205
|
|
|
16137
16206
|
// src/modals/CheckoutModal/InputAmount/InputAmountLoaded.tsx
|
|
16138
16207
|
import {
|
|
@@ -16140,7 +16209,7 @@ import {
|
|
|
16140
16209
|
formatCryptoAndStringify as formatCryptoAndStringify3,
|
|
16141
16210
|
formatCurrencyAndStringify as formatCurrencyAndStringify8
|
|
16142
16211
|
} from "@funkit/utils";
|
|
16143
|
-
import React168, { useMemo as
|
|
16212
|
+
import React168, { useMemo as useMemo27 } from "react";
|
|
16144
16213
|
|
|
16145
16214
|
// src/components/Icons/SwitchIcon.tsx
|
|
16146
16215
|
import React164 from "react";
|
|
@@ -16167,14 +16236,14 @@ var SwitchIcon = () => {
|
|
|
16167
16236
|
};
|
|
16168
16237
|
|
|
16169
16238
|
// src/hooks/useDynamicFont.ts
|
|
16170
|
-
import { useCallback as useCallback34, useEffect as
|
|
16239
|
+
import { useCallback as useCallback34, useEffect as useEffect35, useRef as useRef16, useState as useState49 } from "react";
|
|
16171
16240
|
var SIZE_STEP = 1;
|
|
16172
16241
|
var ALLOWANCE = 20;
|
|
16173
16242
|
var useDynamicFont = (inputValue, max, min = 16) => {
|
|
16174
16243
|
const [fontSize, setFontSize] = useState49(max);
|
|
16175
16244
|
const inputRef = useRef16(null);
|
|
16176
16245
|
const canvasRef = useRef16(document.createElement("canvas"));
|
|
16177
|
-
|
|
16246
|
+
useEffect35(() => {
|
|
16178
16247
|
const measureTextWidth = (text) => {
|
|
16179
16248
|
if (!inputRef.current) return void 0;
|
|
16180
16249
|
const context = canvasRef.current.getContext("2d");
|
|
@@ -16624,7 +16693,7 @@ function InputAmountLoaded({
|
|
|
16624
16693
|
maxUsd: Number.parseFloat(maxCheckoutUsdString),
|
|
16625
16694
|
minUsd
|
|
16626
16695
|
});
|
|
16627
|
-
const error =
|
|
16696
|
+
const error = useMemo27(() => {
|
|
16628
16697
|
if (usdAvailableAmount === 0) {
|
|
16629
16698
|
return {
|
|
16630
16699
|
message: "Insufficient balance, please select another asset instead.",
|
|
@@ -16659,7 +16728,7 @@ function InputAmountLoaded({
|
|
|
16659
16728
|
}
|
|
16660
16729
|
}
|
|
16661
16730
|
}, [checkoutItemTitle, inputError, usdAmount, usdAvailableAmount]);
|
|
16662
|
-
const suggestion =
|
|
16731
|
+
const suggestion = useMemo27(() => {
|
|
16663
16732
|
if (!inputError) return void 0;
|
|
16664
16733
|
switch (inputError.type) {
|
|
16665
16734
|
case "aboveAvailable": {
|
|
@@ -16797,7 +16866,7 @@ function InputAmountLoaded({
|
|
|
16797
16866
|
|
|
16798
16867
|
// src/modals/CheckoutModal/InputAmount/InputAmountLoading.tsx
|
|
16799
16868
|
import { formatCryptoAndStringify as formatCryptoAndStringify4 } from "@funkit/utils";
|
|
16800
|
-
import React169, { useMemo as
|
|
16869
|
+
import React169, { useMemo as useMemo28 } from "react";
|
|
16801
16870
|
function InputAmountLoading({
|
|
16802
16871
|
isCardCheckout,
|
|
16803
16872
|
modalState,
|
|
@@ -16810,7 +16879,7 @@ function InputAmountLoading({
|
|
|
16810
16879
|
const { unlinkBrokerage } = useFunkitMesh();
|
|
16811
16880
|
const targetAssetAmount = checkoutItem?.initSettings.config.targetAssetAmount;
|
|
16812
16881
|
const targetAssetTicker = checkoutItem?.initSettings.config.targetAssetTicker;
|
|
16813
|
-
const error =
|
|
16882
|
+
const error = useMemo28(() => {
|
|
16814
16883
|
if (sourceHoldingError) {
|
|
16815
16884
|
return {
|
|
16816
16885
|
message: /* @__PURE__ */ React169.createElement("div", null, "Unable to retrieve your account balance. Please try re-linking your account.", " ", paymentMethodInfo.paymentMethod === "brokerage" /* BROKERAGE */ && /* @__PURE__ */ React169.createElement(
|
|
@@ -16889,13 +16958,13 @@ function InputAmountLoading({
|
|
|
16889
16958
|
|
|
16890
16959
|
// src/modals/CheckoutModal/InputAmount/useAssetPrice.ts
|
|
16891
16960
|
import { getAssetPriceInfo as getAssetPriceInfo3 } from "@funkit/api-base";
|
|
16892
|
-
import { skipToken, useQuery as
|
|
16961
|
+
import { skipToken, useQuery as useQuery7 } from "@tanstack/react-query";
|
|
16893
16962
|
function useAssetPrice({
|
|
16894
16963
|
chainId,
|
|
16895
16964
|
assetTokenAddress
|
|
16896
16965
|
}) {
|
|
16897
16966
|
const { apiKey } = useFunkitConfig();
|
|
16898
|
-
const { data, error, isLoading } =
|
|
16967
|
+
const { data, error, isLoading } = useQuery7({
|
|
16899
16968
|
queryKey: ["getAssetPriceInfo", chainId, assetTokenAddress],
|
|
16900
16969
|
queryFn: chainId && assetTokenAddress ? async () => {
|
|
16901
16970
|
try {
|
|
@@ -16920,14 +16989,14 @@ function useAssetPrice({
|
|
|
16920
16989
|
}
|
|
16921
16990
|
|
|
16922
16991
|
// src/modals/CheckoutModal/InputAmount/useAvailableBalanceForCheckout.ts
|
|
16923
|
-
import { useMemo as
|
|
16992
|
+
import { useMemo as useMemo30 } from "react";
|
|
16924
16993
|
|
|
16925
16994
|
// src/modals/CheckoutModal/useWalletAssetHoldings.ts
|
|
16926
16995
|
import {
|
|
16927
16996
|
FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS as FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS3,
|
|
16928
16997
|
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO9
|
|
16929
16998
|
} from "@funkit/chains";
|
|
16930
|
-
import { useMemo as
|
|
16999
|
+
import { useMemo as useMemo29 } from "react";
|
|
16931
17000
|
|
|
16932
17001
|
// src/domains/wallet.ts
|
|
16933
17002
|
import { polygon as polygon4 } from "viem/chains";
|
|
@@ -16988,11 +17057,11 @@ var processWalletAssets = (walletAssets, targetChain) => {
|
|
|
16988
17057
|
};
|
|
16989
17058
|
function useWalletAssetHoldings(targetChain) {
|
|
16990
17059
|
const { walletAssets, isLoading } = useWalletAssets();
|
|
16991
|
-
const processedAssets =
|
|
17060
|
+
const processedAssets = useMemo29(
|
|
16992
17061
|
() => processWalletAssets(walletAssets, targetChain),
|
|
16993
17062
|
[targetChain, walletAssets]
|
|
16994
17063
|
);
|
|
16995
|
-
const totalBalance =
|
|
17064
|
+
const totalBalance = useMemo29(
|
|
16996
17065
|
() => processedAssets ? getTotalAssetBalance(processedAssets) : 0,
|
|
16997
17066
|
[processedAssets]
|
|
16998
17067
|
);
|
|
@@ -17021,7 +17090,7 @@ function useAvailableBalanceForCheckout(paymentMethodInfo, targetChainId, assetC
|
|
|
17021
17090
|
["card" /* CARD */]: null,
|
|
17022
17091
|
["token_transfer" /* TOKEN_TRANSFER */]: null
|
|
17023
17092
|
}[paymentMethodInfo.paymentMethod];
|
|
17024
|
-
const holdingItem =
|
|
17093
|
+
const holdingItem = useMemo30(() => {
|
|
17025
17094
|
if (!assetSymbol || !holdings) {
|
|
17026
17095
|
return;
|
|
17027
17096
|
}
|
|
@@ -17071,7 +17140,7 @@ function InputAmount(props) {
|
|
|
17071
17140
|
});
|
|
17072
17141
|
const isCardCheckout = props.modalState.paymentMethodInfo.paymentMethod === "card" /* CARD */;
|
|
17073
17142
|
const isLoaded = checkoutItem && unitPrice && !sourceHoldingError && !isLoadingSourceHolding;
|
|
17074
|
-
|
|
17143
|
+
useEffect36(() => setCheckoutQuote(null), []);
|
|
17075
17144
|
if (isLoaded) {
|
|
17076
17145
|
return /* @__PURE__ */ React170.createElement(
|
|
17077
17146
|
InputAmountLoaded,
|
|
@@ -17096,7 +17165,7 @@ function InputAmount(props) {
|
|
|
17096
17165
|
}
|
|
17097
17166
|
|
|
17098
17167
|
// src/modals/CheckoutModal/LoadingAccount.tsx
|
|
17099
|
-
import React175, { useEffect as
|
|
17168
|
+
import React175, { useEffect as useEffect37 } from "react";
|
|
17100
17169
|
import { POLYMARKET_API_KEY as POLYMARKET_API_KEY3 } from "@funkit/api-base";
|
|
17101
17170
|
import { FlagKey as FlagKey17 } from "@funkit/utils";
|
|
17102
17171
|
|
|
@@ -17430,7 +17499,7 @@ function LoadingAccount({
|
|
|
17430
17499
|
const { updateSelectedPaymentMethodInfo } = useCheckoutContext();
|
|
17431
17500
|
const { isLoading: isLoadingFlag, getFlag } = useFlags();
|
|
17432
17501
|
const isTokenTransferEnabled = getFlag(FlagKey17.EnableTokenTransfer);
|
|
17433
|
-
|
|
17502
|
+
useEffect37(() => {
|
|
17434
17503
|
if (hasSufficientAsset(walletAssets, targetChainId)) {
|
|
17435
17504
|
const paymentMethodInfo = createPaymentMethodInfo({
|
|
17436
17505
|
paymentMethod: "balance" /* ACCOUNT_BALANCE */,
|
|
@@ -17493,7 +17562,7 @@ import {
|
|
|
17493
17562
|
meshExecuteTransferProxy
|
|
17494
17563
|
} from "@funkit/api-base";
|
|
17495
17564
|
import { ClientError as ClientError4, FlagKey as FlagKey18, formatAddress as formatAddress6 } from "@funkit/utils";
|
|
17496
|
-
import React183, { useMemo as
|
|
17565
|
+
import React183, { useMemo as useMemo31, useState as useState50 } from "react";
|
|
17497
17566
|
import { createPortal as createPortal7 } from "react-dom";
|
|
17498
17567
|
|
|
17499
17568
|
// src/components/CopyAddress/CopyAddressButton.tsx
|
|
@@ -17568,10 +17637,10 @@ function CopyAddressButton({
|
|
|
17568
17637
|
}
|
|
17569
17638
|
|
|
17570
17639
|
// src/hooks/useMountEffect.ts
|
|
17571
|
-
import { useEffect as
|
|
17640
|
+
import { useEffect as useEffect38, useRef as useRef18 } from "react";
|
|
17572
17641
|
function useMountEffect(effect) {
|
|
17573
17642
|
const isMounted = useRef18(false);
|
|
17574
|
-
|
|
17643
|
+
useEffect38(() => {
|
|
17575
17644
|
if (isMounted.current) {
|
|
17576
17645
|
return;
|
|
17577
17646
|
}
|
|
@@ -17798,7 +17867,7 @@ function MeshVerification({
|
|
|
17798
17867
|
return () => setScreen(0 /* INITIAL */);
|
|
17799
17868
|
});
|
|
17800
17869
|
const brokerName = getExchangeName(brokerType);
|
|
17801
|
-
const verificationTitle =
|
|
17870
|
+
const verificationTitle = useMemo31(() => {
|
|
17802
17871
|
switch (executionStatus) {
|
|
17803
17872
|
case MeshExecuteTransferStatus.secondMfaRequired:
|
|
17804
17873
|
return `Additional ${brokerName} 2FA required`;
|
|
@@ -17825,7 +17894,7 @@ function MeshVerification({
|
|
|
17825
17894
|
executionContent?.verificationSteps?.length,
|
|
17826
17895
|
isSecond2fa
|
|
17827
17896
|
]);
|
|
17828
|
-
const verificationDescription =
|
|
17897
|
+
const verificationDescription = useMemo31(() => {
|
|
17829
17898
|
switch (executionStatus) {
|
|
17830
17899
|
case MeshExecuteTransferStatus.secondMfaRequired:
|
|
17831
17900
|
return `Please enable at least two 2FA methods on your ${brokerName} account. Once enabled, you will have to reconnect your account.`;
|
|
@@ -17971,7 +18040,7 @@ var VerificationPopup = ({
|
|
|
17971
18040
|
};
|
|
17972
18041
|
|
|
17973
18042
|
// src/modals/CheckoutModal/MoonpaySetup.tsx
|
|
17974
|
-
import React185, { useCallback as useCallback36, useMemo as
|
|
18043
|
+
import React185, { useCallback as useCallback36, useMemo as useMemo33, useState as useState52 } from "react";
|
|
17975
18044
|
|
|
17976
18045
|
// src/components/FunPayments/FunPaymentMoonpayType.css.ts
|
|
17977
18046
|
var mpClass = "_1kmpeyf0";
|
|
@@ -17980,10 +18049,10 @@ var stretchStyle = "_1kmpeyf1";
|
|
|
17980
18049
|
// src/components/FunPayments/FunPaymentMoonpayType.tsx
|
|
17981
18050
|
import { getMoonpayUrlSignature } from "@funkit/api-base";
|
|
17982
18051
|
import { colorToHex } from "@funkit/utils";
|
|
17983
|
-
import React184, { Fragment as Fragment3, useEffect as
|
|
18052
|
+
import React184, { Fragment as Fragment3, useEffect as useEffect39, useMemo as useMemo32, useState as useState51 } from "react";
|
|
17984
18053
|
var LazyMoonPayBuyWidget = (props) => {
|
|
17985
18054
|
const [MoonPayBuyWidget, setMoonPayBuyWidget] = useState51(null);
|
|
17986
|
-
|
|
18055
|
+
useEffect39(() => {
|
|
17987
18056
|
const loadMoonPayBuyWidget = async () => {
|
|
17988
18057
|
const module = await import("@moonpay/moonpay-react");
|
|
17989
18058
|
setMoonPayBuyWidget(() => module.MoonPayBuyWidget);
|
|
@@ -18011,7 +18080,7 @@ function FunPaymentMoonpayType({
|
|
|
18011
18080
|
const isSandboxMode = useIsFunkitSandboxMode();
|
|
18012
18081
|
const funkitConfig = useFunkitConfig();
|
|
18013
18082
|
const { userInfo } = useGeneralWallet();
|
|
18014
|
-
const currencyCode =
|
|
18083
|
+
const currencyCode = useMemo32(() => {
|
|
18015
18084
|
return generateMoonpayCurrencyCode(depositToken, depositTokenChainId);
|
|
18016
18085
|
}, [depositToken, depositTokenChainId]);
|
|
18017
18086
|
const depositTokenAmountStringFormatted = formatTokenAmountForMoonpay(
|
|
@@ -18034,7 +18103,7 @@ function FunPaymentMoonpayType({
|
|
|
18034
18103
|
});
|
|
18035
18104
|
return signature || "";
|
|
18036
18105
|
};
|
|
18037
|
-
const moonpayButtonColor =
|
|
18106
|
+
const moonpayButtonColor = useMemo32(() => {
|
|
18038
18107
|
const primaryButtonHex = colorToHex(activeTheme.colors.buttonPrimary);
|
|
18039
18108
|
if (["#FFF", "#FFFF", "#FFFFFF", "#FFFFFFFF"].includes(primaryButtonHex)) {
|
|
18040
18109
|
return void 0;
|
|
@@ -18089,7 +18158,7 @@ function MoonpaySetup({
|
|
|
18089
18158
|
depositAddress: paymentAddress
|
|
18090
18159
|
});
|
|
18091
18160
|
}, [onNext, paymentAddress]);
|
|
18092
|
-
const MoonpayWidget =
|
|
18161
|
+
const MoonpayWidget = useMemo33(() => {
|
|
18093
18162
|
return /* @__PURE__ */ React185.createElement(
|
|
18094
18163
|
FunPaymentMoonpayType,
|
|
18095
18164
|
{
|
|
@@ -18119,7 +18188,7 @@ function MoonpaySetup({
|
|
|
18119
18188
|
|
|
18120
18189
|
// src/modals/CheckoutModal/SelectAsset.tsx
|
|
18121
18190
|
import { formatCurrencyAndStringify as formatCurrencyAndStringify10 } from "@funkit/utils";
|
|
18122
|
-
import
|
|
18191
|
+
import React194, { useEffect as useEffect40, useMemo as useMemo36, useState as useState55 } from "react";
|
|
18123
18192
|
import { createPortal as createPortal8 } from "react-dom";
|
|
18124
18193
|
|
|
18125
18194
|
// src/components/Dropdown/ReceiveTokenDropdown.tsx
|
|
@@ -18128,7 +18197,7 @@ import React191, { useState as useState54 } from "react";
|
|
|
18128
18197
|
// src/components/Dropdown/BaseDropdown.tsx
|
|
18129
18198
|
import { isMobile as isMobile13 } from "@funkit/utils";
|
|
18130
18199
|
import { AnimatePresence as AnimatePresence3, motion as motion6 } from "motion/react";
|
|
18131
|
-
import React189, { useCallback as useCallback37, useMemo as
|
|
18200
|
+
import React189, { useCallback as useCallback37, useMemo as useMemo34, useState as useState53 } from "react";
|
|
18132
18201
|
|
|
18133
18202
|
// src/components/FunNoResults/FunNoResults.tsx
|
|
18134
18203
|
import React187 from "react";
|
|
@@ -18343,7 +18412,7 @@ function BaseDropdown({
|
|
|
18343
18412
|
const handleSearch = (event) => {
|
|
18344
18413
|
setSearchInput(event.target.value);
|
|
18345
18414
|
};
|
|
18346
|
-
const filteredOptions =
|
|
18415
|
+
const filteredOptions = useMemo34(
|
|
18347
18416
|
() => options.filter(
|
|
18348
18417
|
(singleOption) => singleOption.label.toLowerCase().includes(searchInput?.toLowerCase())
|
|
18349
18418
|
),
|
|
@@ -18522,18 +18591,16 @@ function BaseDropdownItem({
|
|
|
18522
18591
|
gap: horizontalIconGap
|
|
18523
18592
|
},
|
|
18524
18593
|
iconComponent && /* @__PURE__ */ React190.createElement(Box, { display: "flex", alignItems: "center", justifyContent: "center" }, iconComponent),
|
|
18525
|
-
/* @__PURE__ */ React190.createElement(Text, {
|
|
18526
|
-
tagComponent
|
|
18594
|
+
/* @__PURE__ */ React190.createElement(Text, { size: "13", weight: "medium" }, label)
|
|
18527
18595
|
),
|
|
18528
|
-
/* @__PURE__ */ React190.createElement(Box, { display: "flex", alignItems: "center", justifyContent: "center", gap: "16" },
|
|
18596
|
+
/* @__PURE__ */ React190.createElement(Box, { display: "flex", alignItems: "center", justifyContent: "center", gap: "16" }, tagComponent, /* @__PURE__ */ React190.createElement(
|
|
18529
18597
|
Box,
|
|
18530
18598
|
{
|
|
18531
18599
|
width: "16",
|
|
18532
18600
|
height: "16",
|
|
18533
|
-
display: "flex",
|
|
18534
18601
|
alignItems: "center",
|
|
18535
18602
|
justifyContent: "center",
|
|
18536
|
-
color: "primaryText"
|
|
18603
|
+
color: isSelected ? "primaryText" : "transparent"
|
|
18537
18604
|
},
|
|
18538
18605
|
/* @__PURE__ */ React190.createElement(CheckIcon, null)
|
|
18539
18606
|
))
|
|
@@ -18623,7 +18690,6 @@ var ReceiveTokenDropdown = ({
|
|
|
18623
18690
|
assetName: "receive-token-asset",
|
|
18624
18691
|
assetSrc: iconUrl,
|
|
18625
18692
|
chainId,
|
|
18626
|
-
borderedChainIcon: false,
|
|
18627
18693
|
largeChainIcon: true
|
|
18628
18694
|
}
|
|
18629
18695
|
),
|
|
@@ -18643,13 +18709,104 @@ var ReceiveTokenDropdown = ({
|
|
|
18643
18709
|
};
|
|
18644
18710
|
var ReceiveTokenDropdown_default = ReceiveTokenDropdown;
|
|
18645
18711
|
|
|
18712
|
+
// src/components/SourcePaymentMethodItem/SourcePaymentMethodItem.tsx
|
|
18713
|
+
import React193 from "react";
|
|
18714
|
+
|
|
18715
|
+
// src/components/FunPaymentMethodItem/FunPaymentMethodItem.tsx
|
|
18716
|
+
import React192 from "react";
|
|
18717
|
+
var ValueIcon = ({ valueIcon }) => {
|
|
18718
|
+
if (!valueIcon) return null;
|
|
18719
|
+
return /* @__PURE__ */ React192.createElement(
|
|
18720
|
+
Box,
|
|
18721
|
+
{
|
|
18722
|
+
height: "max",
|
|
18723
|
+
flexDirection: "row",
|
|
18724
|
+
display: "flex",
|
|
18725
|
+
alignItems: "center",
|
|
18726
|
+
justifyContent: "flex-end"
|
|
18727
|
+
},
|
|
18728
|
+
valueIcon
|
|
18729
|
+
);
|
|
18730
|
+
};
|
|
18731
|
+
var PaymentMethodWrapper = ({
|
|
18732
|
+
paddingY,
|
|
18733
|
+
isActive,
|
|
18734
|
+
isDisabled,
|
|
18735
|
+
onClick,
|
|
18736
|
+
children
|
|
18737
|
+
}) => {
|
|
18738
|
+
return /* @__PURE__ */ React192.createElement(
|
|
18739
|
+
FunOptionBox,
|
|
18740
|
+
{
|
|
18741
|
+
type: "bordered",
|
|
18742
|
+
isActive,
|
|
18743
|
+
disabled: isDisabled,
|
|
18744
|
+
onClick,
|
|
18745
|
+
paddingY,
|
|
18746
|
+
paddingRight: "11",
|
|
18747
|
+
paddingLeft: "11"
|
|
18748
|
+
},
|
|
18749
|
+
children
|
|
18750
|
+
);
|
|
18751
|
+
};
|
|
18752
|
+
var FunPaymentMethodItem = ({
|
|
18753
|
+
keyIcon,
|
|
18754
|
+
keyText,
|
|
18755
|
+
valueIcon,
|
|
18756
|
+
disclaimerText,
|
|
18757
|
+
onClick,
|
|
18758
|
+
isError = false,
|
|
18759
|
+
isDisabled = false,
|
|
18760
|
+
isActive = false
|
|
18761
|
+
}) => {
|
|
18762
|
+
return /* @__PURE__ */ React192.createElement(
|
|
18763
|
+
PaymentMethodWrapper,
|
|
18764
|
+
{
|
|
18765
|
+
isActive,
|
|
18766
|
+
isDisabled,
|
|
18767
|
+
onClick,
|
|
18768
|
+
paddingY: "11"
|
|
18769
|
+
},
|
|
18770
|
+
/* @__PURE__ */ React192.createElement(Box, { display: "flex", alignItems: "center", gap: "12" }, keyIcon ? /* @__PURE__ */ React192.createElement(Box, { flexDirection: "row", display: "flex", alignItems: "center" }, keyIcon) : null, /* @__PURE__ */ React192.createElement(Box, { display: "flex", gap: "4", flexDirection: "column" }, /* @__PURE__ */ React192.createElement(Text, { color: "primaryText", weight: "medium", size: "12" }, keyText), disclaimerText ? /* @__PURE__ */ React192.createElement(Text, { size: "12", color: isError ? "error" : "secondaryText" }, disclaimerText) : null)),
|
|
18771
|
+
/* @__PURE__ */ React192.createElement(ValueIcon, { valueIcon })
|
|
18772
|
+
);
|
|
18773
|
+
};
|
|
18774
|
+
|
|
18775
|
+
// src/components/SourcePaymentMethodItem/SourcePaymentMethodItem.css.ts
|
|
18776
|
+
var badgeStyle = "_1yofefl0";
|
|
18777
|
+
|
|
18778
|
+
// src/components/SourcePaymentMethodItem/SourcePaymentMethodItem.tsx
|
|
18779
|
+
var SourcePaymentMethodItem = ({
|
|
18780
|
+
keyIcon,
|
|
18781
|
+
keyText,
|
|
18782
|
+
disclaimerText,
|
|
18783
|
+
onClick,
|
|
18784
|
+
otherSourcesCount,
|
|
18785
|
+
isError = false,
|
|
18786
|
+
isDisabled = false,
|
|
18787
|
+
isActive = false
|
|
18788
|
+
}) => {
|
|
18789
|
+
const { textCustomizations } = useFunkitConfig();
|
|
18790
|
+
return /* @__PURE__ */ React193.createElement(
|
|
18791
|
+
PaymentMethodWrapper,
|
|
18792
|
+
{
|
|
18793
|
+
isActive,
|
|
18794
|
+
isDisabled,
|
|
18795
|
+
onClick,
|
|
18796
|
+
paddingY: "7"
|
|
18797
|
+
},
|
|
18798
|
+
/* @__PURE__ */ React193.createElement(Box, { display: "flex", flexDirection: "column", gap: "8" }, /* @__PURE__ */ React193.createElement(Text, { color: "secondaryText", size: "10" }, textCustomizations.sourceMethodTitle), /* @__PURE__ */ React193.createElement(Box, { display: "flex", gap: "6", alignItems: "center" }, keyIcon ? /* @__PURE__ */ React193.createElement(Box, { flexDirection: "row", display: "flex", alignItems: "center" }, keyIcon) : null, /* @__PURE__ */ React193.createElement(Text, { color: "primaryText", weight: "medium", size: "12" }, keyText), disclaimerText ? /* @__PURE__ */ React193.createElement(Text, { size: "12", color: isError ? "error" : "secondaryText" }, disclaimerText) : null)),
|
|
18799
|
+
/* @__PURE__ */ React193.createElement(Box, { color: "tertiaryText", display: "flex", alignItems: "center", gap: "6" }, otherSourcesCount > 0 && /* @__PURE__ */ React193.createElement(FunBadge, { borderRadius: "full" }, /* @__PURE__ */ React193.createElement(Box, { className: badgeStyle }, otherSourcesCount)), /* @__PURE__ */ React193.createElement(ArrowIcon, { direction: "right", size: 20 }))
|
|
18800
|
+
);
|
|
18801
|
+
};
|
|
18802
|
+
|
|
18646
18803
|
// src/hooks/useAllowedAssets.ts
|
|
18647
18804
|
import { getAllowedAssets } from "@funkit/api-base";
|
|
18648
|
-
import { useQuery as
|
|
18649
|
-
import { useCallback as useCallback38, useMemo as
|
|
18805
|
+
import { useQuery as useQuery8 } from "@tanstack/react-query";
|
|
18806
|
+
import { useCallback as useCallback38, useMemo as useMemo35 } from "react";
|
|
18650
18807
|
function useAllowedAssets() {
|
|
18651
18808
|
const { apiKey } = useFunkitConfig();
|
|
18652
|
-
const { data, isLoading } =
|
|
18809
|
+
const { data, isLoading } = useQuery8({
|
|
18653
18810
|
queryKey: ["getAllowedAssets", apiKey],
|
|
18654
18811
|
queryFn: () => getAllowedAssets({ apiKey, logger }),
|
|
18655
18812
|
refetchOnMount: false,
|
|
@@ -18658,7 +18815,7 @@ function useAllowedAssets() {
|
|
|
18658
18815
|
staleTime: 5 * 60 * 1e3,
|
|
18659
18816
|
gcTime: Number.POSITIVE_INFINITY
|
|
18660
18817
|
});
|
|
18661
|
-
const tokens =
|
|
18818
|
+
const tokens = useMemo35(() => {
|
|
18662
18819
|
const ret = {};
|
|
18663
18820
|
if (!data) {
|
|
18664
18821
|
return ret;
|
|
@@ -18745,94 +18902,6 @@ var useRemainingPaymentSourcesCount = (targetChainId) => {
|
|
|
18745
18902
|
return Math.max(moreSources.length + preferred.length - 1, 0);
|
|
18746
18903
|
};
|
|
18747
18904
|
|
|
18748
|
-
// src/components/FunPaymentMethodItem/FunPaymentMethodItem.tsx
|
|
18749
|
-
import React192 from "react";
|
|
18750
|
-
|
|
18751
|
-
// src/components/FunPaymentMethodItem/FunPaymentMethodItem.css.ts
|
|
18752
|
-
var badgeStyle = "_74u6re0";
|
|
18753
|
-
|
|
18754
|
-
// src/components/FunPaymentMethodItem/FunPaymentMethodItem.tsx
|
|
18755
|
-
var ValueIcon = ({ valueIcon }) => {
|
|
18756
|
-
if (!valueIcon) return null;
|
|
18757
|
-
return /* @__PURE__ */ React192.createElement(
|
|
18758
|
-
Box,
|
|
18759
|
-
{
|
|
18760
|
-
height: "max",
|
|
18761
|
-
flexDirection: "row",
|
|
18762
|
-
display: "flex",
|
|
18763
|
-
alignItems: "center",
|
|
18764
|
-
justifyContent: "flex-end"
|
|
18765
|
-
},
|
|
18766
|
-
valueIcon
|
|
18767
|
-
);
|
|
18768
|
-
};
|
|
18769
|
-
var PaymentMethodWrapper = ({
|
|
18770
|
-
paddingY,
|
|
18771
|
-
isActive,
|
|
18772
|
-
isDisabled,
|
|
18773
|
-
onClick,
|
|
18774
|
-
children
|
|
18775
|
-
}) => {
|
|
18776
|
-
return /* @__PURE__ */ React192.createElement(
|
|
18777
|
-
FunOptionBox,
|
|
18778
|
-
{
|
|
18779
|
-
type: "bordered",
|
|
18780
|
-
isActive,
|
|
18781
|
-
disabled: isDisabled,
|
|
18782
|
-
onClick,
|
|
18783
|
-
paddingY,
|
|
18784
|
-
paddingRight: "11",
|
|
18785
|
-
paddingLeft: "11"
|
|
18786
|
-
},
|
|
18787
|
-
children
|
|
18788
|
-
);
|
|
18789
|
-
};
|
|
18790
|
-
var FunPaymentMethodItem = ({
|
|
18791
|
-
keyIcon,
|
|
18792
|
-
keyText,
|
|
18793
|
-
valueIcon,
|
|
18794
|
-
disclaimerText,
|
|
18795
|
-
onClick,
|
|
18796
|
-
isError = false,
|
|
18797
|
-
isDisabled = false,
|
|
18798
|
-
isActive = false
|
|
18799
|
-
}) => {
|
|
18800
|
-
return /* @__PURE__ */ React192.createElement(
|
|
18801
|
-
PaymentMethodWrapper,
|
|
18802
|
-
{
|
|
18803
|
-
isActive,
|
|
18804
|
-
isDisabled,
|
|
18805
|
-
onClick,
|
|
18806
|
-
paddingY: "11"
|
|
18807
|
-
},
|
|
18808
|
-
/* @__PURE__ */ React192.createElement(Box, { display: "flex", alignItems: "center", gap: "12" }, keyIcon ? /* @__PURE__ */ React192.createElement(Box, { flexDirection: "row", display: "flex", alignItems: "center" }, keyIcon) : null, /* @__PURE__ */ React192.createElement(Box, { display: "flex", gap: "4", flexDirection: "column" }, /* @__PURE__ */ React192.createElement(Text, { color: "primaryText", weight: "medium", size: "12" }, keyText), disclaimerText ? /* @__PURE__ */ React192.createElement(Text, { size: "12", color: isError ? "error" : "secondaryText" }, disclaimerText) : null)),
|
|
18809
|
-
/* @__PURE__ */ React192.createElement(ValueIcon, { valueIcon })
|
|
18810
|
-
);
|
|
18811
|
-
};
|
|
18812
|
-
var SourcePaymentMethodItem = ({
|
|
18813
|
-
keyIcon,
|
|
18814
|
-
keyText,
|
|
18815
|
-
disclaimerText,
|
|
18816
|
-
onClick,
|
|
18817
|
-
otherSourcesCount,
|
|
18818
|
-
isError = false,
|
|
18819
|
-
isDisabled = false,
|
|
18820
|
-
isActive = false
|
|
18821
|
-
}) => {
|
|
18822
|
-
const { textCustomizations } = useFunkitConfig();
|
|
18823
|
-
return /* @__PURE__ */ React192.createElement(
|
|
18824
|
-
PaymentMethodWrapper,
|
|
18825
|
-
{
|
|
18826
|
-
isActive,
|
|
18827
|
-
isDisabled,
|
|
18828
|
-
onClick,
|
|
18829
|
-
paddingY: "7"
|
|
18830
|
-
},
|
|
18831
|
-
/* @__PURE__ */ React192.createElement(Box, { display: "flex", flexDirection: "column", gap: "8" }, /* @__PURE__ */ React192.createElement(Text, { color: "secondaryText", size: "10" }, textCustomizations.sourceMethodTitle), /* @__PURE__ */ React192.createElement(Box, { display: "flex", gap: "6", alignItems: "center" }, keyIcon ? /* @__PURE__ */ React192.createElement(Box, { flexDirection: "row", display: "flex", alignItems: "center" }, keyIcon) : null, /* @__PURE__ */ React192.createElement(Text, { color: "primaryText", weight: "medium", size: "12" }, keyText), disclaimerText ? /* @__PURE__ */ React192.createElement(Text, { size: "12", color: isError ? "error" : "secondaryText" }, disclaimerText) : null)),
|
|
18832
|
-
/* @__PURE__ */ React192.createElement(Box, { color: "tertiaryText", display: "flex", alignItems: "center", gap: "6" }, otherSourcesCount > 0 && /* @__PURE__ */ React192.createElement(FunBadge, { borderRadius: "full" }, /* @__PURE__ */ React192.createElement(Box, { className: badgeStyle }, otherSourcesCount)), /* @__PURE__ */ React192.createElement(ArrowIcon, { direction: "right", size: 20 }))
|
|
18833
|
-
);
|
|
18834
|
-
};
|
|
18835
|
-
|
|
18836
18905
|
// src/modals/CheckoutModal/SelectAsset.tsx
|
|
18837
18906
|
var SelectAssetInfo = {
|
|
18838
18907
|
Component: SelectAsset,
|
|
@@ -18868,7 +18937,7 @@ function useEnrichedAccountHoldings({
|
|
|
18868
18937
|
const { isAllowed, isLoading: isLoadingAllowed } = useAllowedAssets();
|
|
18869
18938
|
const { flags, isLoading: isLoadingFlags } = useFlags();
|
|
18870
18939
|
const { loginType } = useGeneralWallet();
|
|
18871
|
-
const enrichedAccountHoldings =
|
|
18940
|
+
const enrichedAccountHoldings = useMemo36(() => {
|
|
18872
18941
|
if (!checkoutItem) return [];
|
|
18873
18942
|
return Object.values(accountHoldings).map((asset) => {
|
|
18874
18943
|
const usableForCheckout = isAssetUsableToPayForCheckout(
|
|
@@ -18902,7 +18971,7 @@ function useAssetOptions({
|
|
|
18902
18971
|
isLoadingFlags,
|
|
18903
18972
|
defaultTokenSymbols
|
|
18904
18973
|
}) {
|
|
18905
|
-
const assetOptions =
|
|
18974
|
+
const assetOptions = useMemo36(() => {
|
|
18906
18975
|
if (!checkoutItem || isLoadingFlags) {
|
|
18907
18976
|
return [];
|
|
18908
18977
|
}
|
|
@@ -18951,7 +19020,7 @@ function MeshOrAccountSelectAsset({
|
|
|
18951
19020
|
const [explicitlySelectedChainTokenSymbol, setSelectedChainTokenSymbol] = useState55("");
|
|
18952
19021
|
const candidates = checkoutItem?.initSettings.config.dynamicTargetAssetCandidates;
|
|
18953
19022
|
const [userSelectedTargetAssetVertex, setUserSelectedTargetAssetVertex] = useState55(isVertexCustomer(apiKey) && candidates ? candidates[0] : null);
|
|
18954
|
-
const defaultTokenSymbols =
|
|
19023
|
+
const defaultTokenSymbols = useMemo36(() => {
|
|
18955
19024
|
if (!checkoutItem) {
|
|
18956
19025
|
return [];
|
|
18957
19026
|
}
|
|
@@ -19022,7 +19091,7 @@ function MeshOrAccountSelectAsset({
|
|
|
19022
19091
|
updateTargetAssetForVertex(tokenItem);
|
|
19023
19092
|
onFinish();
|
|
19024
19093
|
});
|
|
19025
|
-
const selectedChainTokenSymbol =
|
|
19094
|
+
const selectedChainTokenSymbol = useMemo36(() => {
|
|
19026
19095
|
if (explicitlySelectedChainTokenSymbol) {
|
|
19027
19096
|
return explicitlySelectedChainTokenSymbol;
|
|
19028
19097
|
}
|
|
@@ -19045,7 +19114,7 @@ function MeshOrAccountSelectAsset({
|
|
|
19045
19114
|
checkoutItem?.selectedSourceAssetInfo,
|
|
19046
19115
|
explicitlySelectedChainTokenSymbol
|
|
19047
19116
|
]);
|
|
19048
|
-
|
|
19117
|
+
useEffect40(() => {
|
|
19049
19118
|
const optionEl = document.getElementById(
|
|
19050
19119
|
`option-${selectedChainTokenSymbol}`
|
|
19051
19120
|
);
|
|
@@ -19059,9 +19128,9 @@ function MeshOrAccountSelectAsset({
|
|
|
19059
19128
|
const isAssetsEmpty = assetOptions.length === 0;
|
|
19060
19129
|
const isDisabled = isAssetsEmpty || !selectedChainTokenSymbol;
|
|
19061
19130
|
if (isLoadingFlags || isLoadingAllowed) {
|
|
19062
|
-
return /* @__PURE__ */
|
|
19131
|
+
return /* @__PURE__ */ React194.createElement(FunAssetLoading, { count: 5 });
|
|
19063
19132
|
}
|
|
19064
|
-
return /* @__PURE__ */
|
|
19133
|
+
return /* @__PURE__ */ React194.createElement(Box, null, /* @__PURE__ */ React194.createElement(
|
|
19065
19134
|
Box,
|
|
19066
19135
|
{
|
|
19067
19136
|
width: "full",
|
|
@@ -19071,7 +19140,7 @@ function MeshOrAccountSelectAsset({
|
|
|
19071
19140
|
flexDirection: "column",
|
|
19072
19141
|
gap: "4"
|
|
19073
19142
|
},
|
|
19074
|
-
isAssetsEmpty ? /* @__PURE__ */
|
|
19143
|
+
isAssetsEmpty ? /* @__PURE__ */ React194.createElement(FunNoResults, null, "No assets found") : isVertexCustomer(apiKey) && candidates ? /* @__PURE__ */ React194.createElement(Box, { display: "flex", flexDirection: "column", gap: "12" }, /* @__PURE__ */ React194.createElement(
|
|
19075
19144
|
ReceiveTokenDropdown_default,
|
|
19076
19145
|
{
|
|
19077
19146
|
tokens: candidates,
|
|
@@ -19081,8 +19150,8 @@ function MeshOrAccountSelectAsset({
|
|
|
19081
19150
|
setUserSelectedTargetAssetVertex(token);
|
|
19082
19151
|
}
|
|
19083
19152
|
}
|
|
19084
|
-
), /* @__PURE__ */
|
|
19085
|
-
({ asset, isDisabled: isDisabled2, badgeColors, badgeText }) => /* @__PURE__ */
|
|
19153
|
+
), /* @__PURE__ */ React194.createElement(Box, { display: "flex", flexDirection: "column" }, assetOptions.map(
|
|
19154
|
+
({ asset, isDisabled: isDisabled2, badgeColors, badgeText }) => /* @__PURE__ */ React194.createElement(
|
|
19086
19155
|
FunAssetItem,
|
|
19087
19156
|
{
|
|
19088
19157
|
key: asset.chainSymbolKey,
|
|
@@ -19094,8 +19163,8 @@ function MeshOrAccountSelectAsset({
|
|
|
19094
19163
|
onClick: () => setSelectedChainTokenSymbol(asset.chainSymbolKey)
|
|
19095
19164
|
}
|
|
19096
19165
|
)
|
|
19097
|
-
))) : /* @__PURE__ */
|
|
19098
|
-
({ asset, isDisabled: isDisabled2, badgeColors, badgeText }) => /* @__PURE__ */
|
|
19166
|
+
))) : /* @__PURE__ */ React194.createElement(Box, { display: "flex", flexDirection: "column" }, assetOptions.map(
|
|
19167
|
+
({ asset, isDisabled: isDisabled2, badgeColors, badgeText }) => /* @__PURE__ */ React194.createElement(
|
|
19099
19168
|
FunAssetItem,
|
|
19100
19169
|
{
|
|
19101
19170
|
key: asset.chainSymbolKey,
|
|
@@ -19109,10 +19178,10 @@ function MeshOrAccountSelectAsset({
|
|
|
19109
19178
|
)
|
|
19110
19179
|
))
|
|
19111
19180
|
), bottomSectionRef && createPortal8(
|
|
19112
|
-
/* @__PURE__ */
|
|
19181
|
+
/* @__PURE__ */ React194.createElement(
|
|
19113
19182
|
Dialog.BottomBar,
|
|
19114
19183
|
{
|
|
19115
|
-
topSection: /* @__PURE__ */
|
|
19184
|
+
topSection: /* @__PURE__ */ React194.createElement(
|
|
19116
19185
|
FunNotification,
|
|
19117
19186
|
{
|
|
19118
19187
|
isVisible: !!fetchHoldingsError,
|
|
@@ -19141,7 +19210,7 @@ function SelectWalletAsset({
|
|
|
19141
19210
|
const { walletAddress } = useGeneralWallet();
|
|
19142
19211
|
const otherSourcesCount = useRemainingPaymentSourcesCount(targetChainId);
|
|
19143
19212
|
const { data, isLoading, totalBalance } = useWalletAssetHoldings(targetChainId);
|
|
19144
|
-
return /* @__PURE__ */
|
|
19213
|
+
return /* @__PURE__ */ React194.createElement(Box, { display: "flex", flexDirection: "column", gap: "12" }, /* @__PURE__ */ React194.createElement(
|
|
19145
19214
|
SourcePaymentMethodItem,
|
|
19146
19215
|
{
|
|
19147
19216
|
otherSourcesCount,
|
|
@@ -19150,7 +19219,7 @@ function SelectWalletAsset({
|
|
|
19150
19219
|
keyIcon: label.icon,
|
|
19151
19220
|
onClick: onSelectSource
|
|
19152
19221
|
}
|
|
19153
|
-
), isLoading ? /* @__PURE__ */
|
|
19222
|
+
), isLoading ? /* @__PURE__ */ React194.createElement(FunAssetLoading, { count: 5 }) : /* @__PURE__ */ React194.createElement(
|
|
19154
19223
|
MeshOrAccountSelectAsset,
|
|
19155
19224
|
{
|
|
19156
19225
|
paymentMethodInfo,
|
|
@@ -19175,7 +19244,7 @@ function SelectMeshAsset({
|
|
|
19175
19244
|
);
|
|
19176
19245
|
const accountHoldings = data ?? {};
|
|
19177
19246
|
const { unlinkBrokerage } = useFunkitMesh();
|
|
19178
|
-
const fetchHoldingsError = isError ? /* @__PURE__ */
|
|
19247
|
+
const fetchHoldingsError = isError ? /* @__PURE__ */ React194.createElement("div", null, "Unable to retrieve your account balance. Please retry.", " ", /* @__PURE__ */ React194.createElement(
|
|
19179
19248
|
FunLinkButton,
|
|
19180
19249
|
{
|
|
19181
19250
|
text: "Unlink.",
|
|
@@ -19189,7 +19258,7 @@ function SelectMeshAsset({
|
|
|
19189
19258
|
}
|
|
19190
19259
|
)) : null;
|
|
19191
19260
|
const totalBalance = getTotalAssetBalance(accountHoldings);
|
|
19192
|
-
return /* @__PURE__ */
|
|
19261
|
+
return /* @__PURE__ */ React194.createElement(Box, { display: "flex", flexDirection: "column", gap: "12" }, /* @__PURE__ */ React194.createElement(
|
|
19193
19262
|
SourcePaymentMethodItem,
|
|
19194
19263
|
{
|
|
19195
19264
|
otherSourcesCount,
|
|
@@ -19198,7 +19267,7 @@ function SelectMeshAsset({
|
|
|
19198
19267
|
keyIcon: label.icon,
|
|
19199
19268
|
onClick: onSelectSource
|
|
19200
19269
|
}
|
|
19201
|
-
), isLoading ? /* @__PURE__ */
|
|
19270
|
+
), isLoading ? /* @__PURE__ */ React194.createElement(FunAssetLoading, { count: 5 }) : /* @__PURE__ */ React194.createElement(
|
|
19202
19271
|
MeshOrAccountSelectAsset,
|
|
19203
19272
|
{
|
|
19204
19273
|
paymentMethodInfo,
|
|
@@ -19223,7 +19292,7 @@ function SelectAsset({
|
|
|
19223
19292
|
const handleBrokerageDisconnected = () => {
|
|
19224
19293
|
onNext({ disconnectedBrokerage: true });
|
|
19225
19294
|
};
|
|
19226
|
-
return paymentMethodInfo.paymentMethod === "brokerage" /* BROKERAGE */ ? /* @__PURE__ */
|
|
19295
|
+
return paymentMethodInfo.paymentMethod === "brokerage" /* BROKERAGE */ ? /* @__PURE__ */ React194.createElement(
|
|
19227
19296
|
SelectMeshAsset,
|
|
19228
19297
|
{
|
|
19229
19298
|
paymentMethodInfo,
|
|
@@ -19232,7 +19301,7 @@ function SelectAsset({
|
|
|
19232
19301
|
onSelectSource: handleSelectSource,
|
|
19233
19302
|
onBrokerageDisconnected: handleBrokerageDisconnected
|
|
19234
19303
|
}
|
|
19235
|
-
) : /* @__PURE__ */
|
|
19304
|
+
) : /* @__PURE__ */ React194.createElement(
|
|
19236
19305
|
SelectWalletAsset,
|
|
19237
19306
|
{
|
|
19238
19307
|
paymentMethodInfo,
|
|
@@ -19244,11 +19313,11 @@ function SelectAsset({
|
|
|
19244
19313
|
}
|
|
19245
19314
|
|
|
19246
19315
|
// src/modals/CheckoutModal/SelectBrokerage.tsx
|
|
19247
|
-
import
|
|
19316
|
+
import React196, { useState as useState56 } from "react";
|
|
19248
19317
|
|
|
19249
19318
|
// src/components/FunSelectBrokerage/FunSelectBrokerage.tsx
|
|
19250
19319
|
import clsx19 from "clsx";
|
|
19251
|
-
import
|
|
19320
|
+
import React195 from "react";
|
|
19252
19321
|
|
|
19253
19322
|
// src/components/FunSelectBrokerage/FunSelectBrokerage.css.ts
|
|
19254
19323
|
var selectBrokerageStyle = "_1whuldv0";
|
|
@@ -19259,7 +19328,7 @@ function FunSelectBrokerage({
|
|
|
19259
19328
|
options,
|
|
19260
19329
|
selectedValue
|
|
19261
19330
|
}) {
|
|
19262
|
-
return /* @__PURE__ */
|
|
19331
|
+
return /* @__PURE__ */ React195.createElement(
|
|
19263
19332
|
Box,
|
|
19264
19333
|
{
|
|
19265
19334
|
className: clsx19(hideScrollBar, selectBrokerageStyle),
|
|
@@ -19269,7 +19338,7 @@ function FunSelectBrokerage({
|
|
|
19269
19338
|
},
|
|
19270
19339
|
options.map((optionItem) => {
|
|
19271
19340
|
const isActive = selectedValue === optionItem.value;
|
|
19272
|
-
return /* @__PURE__ */
|
|
19341
|
+
return /* @__PURE__ */ React195.createElement(
|
|
19273
19342
|
FunOptionBox,
|
|
19274
19343
|
{
|
|
19275
19344
|
key: optionItem.value,
|
|
@@ -19344,7 +19413,7 @@ function SelectBrokerage({
|
|
|
19344
19413
|
});
|
|
19345
19414
|
}
|
|
19346
19415
|
};
|
|
19347
|
-
return /* @__PURE__ */
|
|
19416
|
+
return /* @__PURE__ */ React196.createElement(Box, { display: "flex", flexDirection: "column", gap: VERTICAL_SECTION_GAP }, /* @__PURE__ */ React196.createElement(
|
|
19348
19417
|
FunInput,
|
|
19349
19418
|
{
|
|
19350
19419
|
placeholder: "Search exchanges",
|
|
@@ -19352,7 +19421,7 @@ function SelectBrokerage({
|
|
|
19352
19421
|
onChange: handleSearch,
|
|
19353
19422
|
prefixIcon: "SearchIcon"
|
|
19354
19423
|
}
|
|
19355
|
-
), /* @__PURE__ */
|
|
19424
|
+
), /* @__PURE__ */ React196.createElement(Box, { display: "flex", justifyContent: "center", style: { minHeight: 200 } }, filteredOptions.length === 0 ? /* @__PURE__ */ React196.createElement(FunNoResults, null, "No results found") : /* @__PURE__ */ React196.createElement(
|
|
19356
19425
|
FunSelectBrokerage,
|
|
19357
19426
|
{
|
|
19358
19427
|
onSelect: handleSelect,
|
|
@@ -19363,7 +19432,7 @@ function SelectBrokerage({
|
|
|
19363
19432
|
}
|
|
19364
19433
|
|
|
19365
19434
|
// src/modals/CheckoutModal/SourceChange/SourceChange.tsx
|
|
19366
|
-
import
|
|
19435
|
+
import React198, { useEffect as useEffect42, useState as useState58 } from "react";
|
|
19367
19436
|
import { POLYMARKET_API_KEY as POLYMARKET_API_KEY4 } from "@funkit/api-base";
|
|
19368
19437
|
|
|
19369
19438
|
// src/components/FunPayments/FunPaymentMethods.tsx
|
|
@@ -19371,7 +19440,7 @@ import {
|
|
|
19371
19440
|
formatCurrencyAndStringify as formatCurrencyAndStringify11,
|
|
19372
19441
|
formatSecondsToReadableForm as formatSecondsToReadableForm3
|
|
19373
19442
|
} from "@funkit/utils";
|
|
19374
|
-
import
|
|
19443
|
+
import React197, { Fragment as Fragment4, useEffect as useEffect41 } from "react";
|
|
19375
19444
|
|
|
19376
19445
|
// src/hooks/useEnabledTokenTransferChainTokens.ts
|
|
19377
19446
|
import { FlagKey as FlagKey20 } from "@funkit/utils";
|
|
@@ -20079,14 +20148,14 @@ var getDefaultTransports = () => {
|
|
|
20079
20148
|
};
|
|
20080
20149
|
|
|
20081
20150
|
// src/hooks/useUsableWalletAssetsForCheckout.ts
|
|
20082
|
-
import { useMemo as
|
|
20151
|
+
import { useMemo as useMemo37 } from "react";
|
|
20083
20152
|
function useUsableWalletAssetsForCheckout() {
|
|
20084
20153
|
const { checkoutItem } = useCheckoutContext();
|
|
20085
20154
|
const { flags } = useFlags();
|
|
20086
20155
|
const { loginType } = useGeneralWallet();
|
|
20087
20156
|
const { walletAssets } = useWalletAssets({ enableRefetchInterval: false });
|
|
20088
20157
|
const { isAllowed } = useAllowedAssets();
|
|
20089
|
-
return
|
|
20158
|
+
return useMemo37(() => {
|
|
20090
20159
|
if (!walletAssets || !checkoutItem) return;
|
|
20091
20160
|
const usableAssets = {};
|
|
20092
20161
|
for (const [assetKey, asset] of Object.entries(walletAssets)) {
|
|
@@ -20114,37 +20183,37 @@ var BrokerageConditionalIcons = () => {
|
|
|
20114
20183
|
const { getActiveConnection } = useFunkitMesh();
|
|
20115
20184
|
return supportedExchanges.filter((brokerType) => !getActiveConnection(brokerType)).map((brokerType) => {
|
|
20116
20185
|
const icon = getExchangeIcon(brokerType, 12);
|
|
20117
|
-
return icon ? /* @__PURE__ */
|
|
20186
|
+
return icon ? /* @__PURE__ */ React197.createElement(Fragment4, { key: brokerType }, icon) : null;
|
|
20118
20187
|
}).filter((icon) => icon !== null).slice(0, 5);
|
|
20119
20188
|
};
|
|
20189
|
+
var getDynamicValueIconComponent = () => {
|
|
20190
|
+
const defaultChains = getDefaultChains();
|
|
20191
|
+
return /* @__PURE__ */ React197.createElement(Box, { display: "flex", alignItems: "center", justifyContent: "flex-end" }, defaultChains.map(({ id: chainId }, index) => {
|
|
20192
|
+
const metadata = chainMetadataById[chainId];
|
|
20193
|
+
return /* @__PURE__ */ React197.createElement(
|
|
20194
|
+
Box,
|
|
20195
|
+
{
|
|
20196
|
+
key: chainId,
|
|
20197
|
+
position: "relative",
|
|
20198
|
+
style: { right: `${(defaultChains.length - index - 1) * -2}px` }
|
|
20199
|
+
},
|
|
20200
|
+
/* @__PURE__ */ React197.createElement(
|
|
20201
|
+
AsyncImage,
|
|
20202
|
+
{
|
|
20203
|
+
alt: metadata.name,
|
|
20204
|
+
borderRadius: "full",
|
|
20205
|
+
src: metadata.iconUrl,
|
|
20206
|
+
height: 12,
|
|
20207
|
+
width: 12
|
|
20208
|
+
}
|
|
20209
|
+
)
|
|
20210
|
+
);
|
|
20211
|
+
}));
|
|
20212
|
+
};
|
|
20120
20213
|
function ConnectWalletItem({ isClickable = true }) {
|
|
20121
20214
|
const { openConnectModal } = useConnectModal();
|
|
20122
20215
|
const { checkoutItem } = useCheckoutContext();
|
|
20123
20216
|
const { textCustomizations } = useFunkitConfig();
|
|
20124
|
-
const getDynamicValueIconComponent = () => {
|
|
20125
|
-
const defaultChains = getDefaultChains();
|
|
20126
|
-
return /* @__PURE__ */ React196.createElement(Box, { display: "flex", alignItems: "center", justifyContent: "flex-end" }, defaultChains.map(({ id: chainId }, index) => {
|
|
20127
|
-
const metadata = chainMetadataById[chainId];
|
|
20128
|
-
return /* @__PURE__ */ React196.createElement(
|
|
20129
|
-
Box,
|
|
20130
|
-
{
|
|
20131
|
-
key: chainId,
|
|
20132
|
-
position: "relative",
|
|
20133
|
-
style: { right: `${(defaultChains.length - index - 1) * -2}px` }
|
|
20134
|
-
},
|
|
20135
|
-
/* @__PURE__ */ React196.createElement(
|
|
20136
|
-
AsyncImage,
|
|
20137
|
-
{
|
|
20138
|
-
alt: metadata.name,
|
|
20139
|
-
borderRadius: "full",
|
|
20140
|
-
src: metadata.iconUrl,
|
|
20141
|
-
height: 12,
|
|
20142
|
-
width: 12
|
|
20143
|
-
}
|
|
20144
|
-
)
|
|
20145
|
-
);
|
|
20146
|
-
}));
|
|
20147
|
-
};
|
|
20148
20217
|
const handleWalletConnection = () => {
|
|
20149
20218
|
if (checkoutItem?.initSettings.onLoginRequired) {
|
|
20150
20219
|
checkoutItem.initSettings.onLoginRequired();
|
|
@@ -20153,10 +20222,10 @@ function ConnectWalletItem({ isClickable = true }) {
|
|
|
20153
20222
|
}
|
|
20154
20223
|
};
|
|
20155
20224
|
const walletLabel = getWalletLabel(textCustomizations);
|
|
20156
|
-
return /* @__PURE__ */
|
|
20225
|
+
return /* @__PURE__ */ React197.createElement(
|
|
20157
20226
|
FunPaymentMethodItem,
|
|
20158
20227
|
{
|
|
20159
|
-
keyIcon: /* @__PURE__ */
|
|
20228
|
+
keyIcon: /* @__PURE__ */ React197.createElement(
|
|
20160
20229
|
Box,
|
|
20161
20230
|
{
|
|
20162
20231
|
height: "20",
|
|
@@ -20165,7 +20234,7 @@ function ConnectWalletItem({ isClickable = true }) {
|
|
|
20165
20234
|
alignItems: "center",
|
|
20166
20235
|
justifyContent: "center"
|
|
20167
20236
|
},
|
|
20168
|
-
/* @__PURE__ */
|
|
20237
|
+
/* @__PURE__ */ React197.createElement(EvmWallet, null)
|
|
20169
20238
|
),
|
|
20170
20239
|
keyText: walletLabel,
|
|
20171
20240
|
valueIcon: getDynamicValueIconComponent(),
|
|
@@ -20176,16 +20245,16 @@ function ConnectWalletItem({ isClickable = true }) {
|
|
|
20176
20245
|
);
|
|
20177
20246
|
}
|
|
20178
20247
|
function SupportedChainList({ chainIdList }) {
|
|
20179
|
-
return /* @__PURE__ */
|
|
20248
|
+
return /* @__PURE__ */ React197.createElement(Box, { display: "flex", alignItems: "center", justifyContent: "flex-end" }, chainIdList.map((chainId, index) => {
|
|
20180
20249
|
const metadata = chainMetadataById[chainId];
|
|
20181
|
-
return /* @__PURE__ */
|
|
20250
|
+
return /* @__PURE__ */ React197.createElement(
|
|
20182
20251
|
Box,
|
|
20183
20252
|
{
|
|
20184
20253
|
key: chainId,
|
|
20185
20254
|
position: "relative",
|
|
20186
20255
|
style: { right: `${(chainIdList.length - index - 1) * -2}px` }
|
|
20187
20256
|
},
|
|
20188
|
-
/* @__PURE__ */
|
|
20257
|
+
/* @__PURE__ */ React197.createElement(
|
|
20189
20258
|
AsyncImage,
|
|
20190
20259
|
{
|
|
20191
20260
|
alt: metadata.name,
|
|
@@ -20202,7 +20271,7 @@ function PaymentMethodIcon({
|
|
|
20202
20271
|
paymentIcon,
|
|
20203
20272
|
keyIconSize
|
|
20204
20273
|
}) {
|
|
20205
|
-
return /* @__PURE__ */
|
|
20274
|
+
return /* @__PURE__ */ React197.createElement(
|
|
20206
20275
|
Box,
|
|
20207
20276
|
{
|
|
20208
20277
|
display: "flex",
|
|
@@ -20235,7 +20304,7 @@ var ConnectedMeshPaymentMethodItem = ({
|
|
|
20235
20304
|
const timeEstimate = useCheckoutTimeEstimate(3 * 60, "brokerage" /* BROKERAGE */);
|
|
20236
20305
|
const disclaimerText = isPending ? "Fetching balance..." : balanceError ? "Couldn't fetch balance" : `${formatCurrencyAndStringify11(sourceBalance)} \u2022 ${formatSecondsToReadableForm3(timeEstimate, true)}`;
|
|
20237
20306
|
const isDisabled = !!balanceError || sourceBalance < MIN_CHECKOUT_AMOUNT_USD;
|
|
20238
|
-
|
|
20307
|
+
useEffect41(() => {
|
|
20239
20308
|
if (isPending || isLoading || isFetching) {
|
|
20240
20309
|
return;
|
|
20241
20310
|
}
|
|
@@ -20249,7 +20318,7 @@ var ConnectedMeshPaymentMethodItem = ({
|
|
|
20249
20318
|
isFetching,
|
|
20250
20319
|
paymentMethodInfo.meta.brokerType
|
|
20251
20320
|
]);
|
|
20252
|
-
return /* @__PURE__ */
|
|
20321
|
+
return /* @__PURE__ */ React197.createElement(
|
|
20253
20322
|
FunPaymentMethodItem,
|
|
20254
20323
|
{
|
|
20255
20324
|
isDisabled,
|
|
@@ -20257,7 +20326,7 @@ var ConnectedMeshPaymentMethodItem = ({
|
|
|
20257
20326
|
isActive: isSelected,
|
|
20258
20327
|
keyIcon: label.icon,
|
|
20259
20328
|
keyText: label.text,
|
|
20260
|
-
valueIcon: isSelected ? /* @__PURE__ */
|
|
20329
|
+
valueIcon: isSelected ? /* @__PURE__ */ React197.createElement(CheckIcon, null) : null,
|
|
20261
20330
|
onClick: onSelect,
|
|
20262
20331
|
disclaimerText
|
|
20263
20332
|
}
|
|
@@ -20279,17 +20348,17 @@ var AccountBalancePaymentMethodItem = ({
|
|
|
20279
20348
|
const uniqueChainIds = Array.from(
|
|
20280
20349
|
new Set(Object.values(usableWalletAssets).map((asset) => asset.chainId))
|
|
20281
20350
|
);
|
|
20282
|
-
return /* @__PURE__ */
|
|
20351
|
+
return /* @__PURE__ */ React197.createElement(SupportedChainList, { chainIdList: uniqueChainIds });
|
|
20283
20352
|
};
|
|
20284
20353
|
const dynamicLimit = formatCurrencyAndStringify11(totalBalance);
|
|
20285
20354
|
const disclaimerText = `${dynamicLimit ?? "No limit"} \u2022 Instant`;
|
|
20286
20355
|
const walletLabel = getWalletLabel(textCustomizations, walletAddress);
|
|
20287
20356
|
const keyIconSize = "20";
|
|
20288
|
-
return /* @__PURE__ */
|
|
20357
|
+
return /* @__PURE__ */ React197.createElement(
|
|
20289
20358
|
FunPaymentMethodItem,
|
|
20290
20359
|
{
|
|
20291
20360
|
isActive,
|
|
20292
|
-
keyIcon: isLoadingAssets ? /* @__PURE__ */
|
|
20361
|
+
keyIcon: isLoadingAssets ? /* @__PURE__ */ React197.createElement(SpinnerIcon, { size: keyIconSize }) : /* @__PURE__ */ React197.createElement(
|
|
20293
20362
|
PaymentMethodIcon,
|
|
20294
20363
|
{
|
|
20295
20364
|
keyIconSize,
|
|
@@ -20314,11 +20383,11 @@ var CardPaymentMethodItem = ({
|
|
|
20314
20383
|
textCustomizations
|
|
20315
20384
|
}) => {
|
|
20316
20385
|
const timeEstimate = useCheckoutTimeEstimate(2 * 60, "card" /* CARD */);
|
|
20317
|
-
return /* @__PURE__ */
|
|
20386
|
+
return /* @__PURE__ */ React197.createElement(
|
|
20318
20387
|
FunPaymentMethodItem,
|
|
20319
20388
|
{
|
|
20320
20389
|
isActive,
|
|
20321
|
-
keyIcon: /* @__PURE__ */
|
|
20390
|
+
keyIcon: /* @__PURE__ */ React197.createElement(
|
|
20322
20391
|
PaymentMethodIcon,
|
|
20323
20392
|
{
|
|
20324
20393
|
keyIconSize,
|
|
@@ -20326,7 +20395,7 @@ var CardPaymentMethodItem = ({
|
|
|
20326
20395
|
}
|
|
20327
20396
|
),
|
|
20328
20397
|
keyText: textCustomizations.debitOrCredit,
|
|
20329
|
-
valueIcon: customValueIcon !== void 0 ? customValueIcon : /* @__PURE__ */
|
|
20398
|
+
valueIcon: customValueIcon !== void 0 ? customValueIcon : /* @__PURE__ */ React197.createElement(CombinedCreditCardOptionsIcon, null),
|
|
20330
20399
|
onClick,
|
|
20331
20400
|
isDisabled: !isClickable,
|
|
20332
20401
|
disclaimerText: `$10,000 limit \u2022 ${formatSecondsToReadableForm3(timeEstimate, true)}`
|
|
@@ -20345,13 +20414,13 @@ var TransferPaymentMethodItem = ({
|
|
|
20345
20414
|
const enabledChainTokens = useEnabledTokenTransferChainTokens();
|
|
20346
20415
|
const getTokenTransferIcon = () => {
|
|
20347
20416
|
const uniqueChainIds = Array.from(new Set(Object.keys(enabledChainTokens)));
|
|
20348
|
-
return /* @__PURE__ */
|
|
20417
|
+
return /* @__PURE__ */ React197.createElement(SupportedChainList, { chainIdList: uniqueChainIds });
|
|
20349
20418
|
};
|
|
20350
|
-
return /* @__PURE__ */
|
|
20419
|
+
return /* @__PURE__ */ React197.createElement(
|
|
20351
20420
|
FunPaymentMethodItem,
|
|
20352
20421
|
{
|
|
20353
20422
|
isActive,
|
|
20354
|
-
keyIcon: /* @__PURE__ */
|
|
20423
|
+
keyIcon: /* @__PURE__ */ React197.createElement(
|
|
20355
20424
|
PaymentMethodIcon,
|
|
20356
20425
|
{
|
|
20357
20426
|
keyIconSize,
|
|
@@ -20376,11 +20445,11 @@ var BrokeragePaymentMethodItem = ({
|
|
|
20376
20445
|
textCustomizations
|
|
20377
20446
|
}) => {
|
|
20378
20447
|
const timeEstimate = useCheckoutTimeEstimate(3 * 60, "brokerage" /* BROKERAGE */);
|
|
20379
|
-
return /* @__PURE__ */
|
|
20448
|
+
return /* @__PURE__ */ React197.createElement(
|
|
20380
20449
|
FunPaymentMethodItem,
|
|
20381
20450
|
{
|
|
20382
20451
|
isActive,
|
|
20383
|
-
keyIcon: /* @__PURE__ */
|
|
20452
|
+
keyIcon: /* @__PURE__ */ React197.createElement(
|
|
20384
20453
|
PaymentMethodIcon,
|
|
20385
20454
|
{
|
|
20386
20455
|
keyIconSize,
|
|
@@ -20388,7 +20457,7 @@ var BrokeragePaymentMethodItem = ({
|
|
|
20388
20457
|
}
|
|
20389
20458
|
),
|
|
20390
20459
|
keyText: textCustomizations.brokerageOrExchange,
|
|
20391
|
-
valueIcon: customValueIcon ?? /* @__PURE__ */
|
|
20460
|
+
valueIcon: customValueIcon ?? /* @__PURE__ */ React197.createElement(Box, { display: "flex", gap: "2", alignItems: "center" }, /* @__PURE__ */ React197.createElement(BrokerageConditionalIcons, null)),
|
|
20392
20461
|
onClick,
|
|
20393
20462
|
isDisabled: !isClickable,
|
|
20394
20463
|
disclaimerText: `No limit \u2022 ${formatSecondsToReadableForm3(timeEstimate, true)}`
|
|
@@ -20414,16 +20483,16 @@ function AddPaymentMethodItem({
|
|
|
20414
20483
|
keyIconSize: "20"
|
|
20415
20484
|
};
|
|
20416
20485
|
if (paymentMethod === "balance" /* ACCOUNT_BALANCE */) {
|
|
20417
|
-
return /* @__PURE__ */
|
|
20486
|
+
return /* @__PURE__ */ React197.createElement(ConnectWalletItem, { isClickable });
|
|
20418
20487
|
}
|
|
20419
20488
|
if (paymentMethod === "card" /* CARD */) {
|
|
20420
|
-
return /* @__PURE__ */
|
|
20489
|
+
return /* @__PURE__ */ React197.createElement(CardPaymentMethodItem, { ...commonProps });
|
|
20421
20490
|
}
|
|
20422
20491
|
if (paymentMethod === "token_transfer" /* TOKEN_TRANSFER */) {
|
|
20423
|
-
return /* @__PURE__ */
|
|
20492
|
+
return /* @__PURE__ */ React197.createElement(TransferPaymentMethodItem, { ...commonProps });
|
|
20424
20493
|
}
|
|
20425
20494
|
if (paymentMethod === "brokerage" /* BROKERAGE */) {
|
|
20426
|
-
return /* @__PURE__ */
|
|
20495
|
+
return /* @__PURE__ */ React197.createElement(BrokeragePaymentMethodItem, { ...commonProps });
|
|
20427
20496
|
}
|
|
20428
20497
|
}
|
|
20429
20498
|
|
|
@@ -20558,18 +20627,18 @@ var ConnectedSource = ({
|
|
|
20558
20627
|
}) => {
|
|
20559
20628
|
if (paymentInfo.paymentMethod === "balance" /* ACCOUNT_BALANCE */) {
|
|
20560
20629
|
const isSelected2 = selectedPaymentInfo?.paymentMethod === "balance" /* ACCOUNT_BALANCE */;
|
|
20561
|
-
return /* @__PURE__ */
|
|
20630
|
+
return /* @__PURE__ */ React198.createElement(
|
|
20562
20631
|
AccountBalancePaymentMethodItem,
|
|
20563
20632
|
{
|
|
20564
20633
|
isActive: isSelected2,
|
|
20565
20634
|
onClick: onSelect,
|
|
20566
|
-
customValueIcon: isSelected2 ? /* @__PURE__ */
|
|
20635
|
+
customValueIcon: isSelected2 ? /* @__PURE__ */ React198.createElement(CheckIcon, null) : null,
|
|
20567
20636
|
targetChainId
|
|
20568
20637
|
}
|
|
20569
20638
|
);
|
|
20570
20639
|
}
|
|
20571
20640
|
const isSelected = selectedPaymentInfo?.paymentMethod === "brokerage" /* BROKERAGE */ && selectedPaymentInfo.meta.brokerType === paymentInfo.meta.brokerType;
|
|
20572
|
-
return /* @__PURE__ */
|
|
20641
|
+
return /* @__PURE__ */ React198.createElement(
|
|
20573
20642
|
ConnectedMeshPaymentMethodItem,
|
|
20574
20643
|
{
|
|
20575
20644
|
paymentMethodInfo: paymentInfo,
|
|
@@ -20589,7 +20658,7 @@ function SourceChange({
|
|
|
20589
20658
|
const { updateSelectedPaymentMethodInfo, checkoutItem } = useCheckoutContext();
|
|
20590
20659
|
const [connectedSource, setConnectedSource] = useState58(paymentMethodInfo);
|
|
20591
20660
|
const [newSource, setNewSource] = useState58();
|
|
20592
|
-
|
|
20661
|
+
useEffect42(() => {
|
|
20593
20662
|
if (!paymentMethodInfo) return;
|
|
20594
20663
|
updateSelectedPaymentMethodInfo(paymentMethodInfo);
|
|
20595
20664
|
}, [paymentMethodInfo, updateSelectedPaymentMethodInfo]);
|
|
@@ -20659,7 +20728,7 @@ function SourceChange({
|
|
|
20659
20728
|
);
|
|
20660
20729
|
function renderSource(source) {
|
|
20661
20730
|
if (typeof source === "object") {
|
|
20662
|
-
return /* @__PURE__ */
|
|
20731
|
+
return /* @__PURE__ */ React198.createElement(
|
|
20663
20732
|
ConnectedSource,
|
|
20664
20733
|
{
|
|
20665
20734
|
key: source.title,
|
|
@@ -20671,7 +20740,7 @@ function SourceChange({
|
|
|
20671
20740
|
}
|
|
20672
20741
|
);
|
|
20673
20742
|
}
|
|
20674
|
-
return /* @__PURE__ */
|
|
20743
|
+
return /* @__PURE__ */ React198.createElement(
|
|
20675
20744
|
AddPaymentMethodItem,
|
|
20676
20745
|
{
|
|
20677
20746
|
key: source,
|
|
@@ -20681,16 +20750,16 @@ function SourceChange({
|
|
|
20681
20750
|
}
|
|
20682
20751
|
);
|
|
20683
20752
|
}
|
|
20684
|
-
return /* @__PURE__ */
|
|
20753
|
+
return /* @__PURE__ */ React198.createElement(Box, { display: "flex", flexDirection: "column", gap: "4" }, preferred.map(renderSource), preferred.length > 0 && /* @__PURE__ */ React198.createElement(FunDivider, { label: "more", marginTop: "8", marginBottom: "8" }), moreSources.map(renderSource));
|
|
20685
20754
|
}
|
|
20686
20755
|
|
|
20687
20756
|
// src/modals/CheckoutModal/TransferToken.tsx
|
|
20688
20757
|
import { FlagKey as FlagKey21, formatCurrencyAndStringify as formatCurrencyAndStringify12 } from "@funkit/utils";
|
|
20689
|
-
import
|
|
20758
|
+
import React203, { useRef as useRef19, useState as useState60 } from "react";
|
|
20690
20759
|
import { mainnet as mainnet8, polygon as polygon5 } from "viem/chains";
|
|
20691
20760
|
|
|
20692
20761
|
// src/components/CopyAddress/CopyInputDisplayedAddress.tsx
|
|
20693
|
-
import
|
|
20762
|
+
import React199 from "react";
|
|
20694
20763
|
import { truncateMiddleOfAddress as truncateMiddleOfAddressFn } from "@funkit/utils";
|
|
20695
20764
|
function CopyInputDisplayedAddress({
|
|
20696
20765
|
address,
|
|
@@ -20698,7 +20767,7 @@ function CopyInputDisplayedAddress({
|
|
|
20698
20767
|
}) {
|
|
20699
20768
|
const { copied: copiedAddress, copy: copyAddressAction } = useCopyToClipboard(address);
|
|
20700
20769
|
const truncatedAddress = truncateMiddleOfAddress ? truncateMiddleOfAddressFn(address, 40, 24, 8) : address;
|
|
20701
|
-
return /* @__PURE__ */
|
|
20770
|
+
return /* @__PURE__ */ React199.createElement(
|
|
20702
20771
|
Box,
|
|
20703
20772
|
{
|
|
20704
20773
|
display: "flex",
|
|
@@ -20718,8 +20787,8 @@ function CopyInputDisplayedAddress({
|
|
|
20718
20787
|
borderRadius: BORDER_RADIUS,
|
|
20719
20788
|
borderStyle: "solid"
|
|
20720
20789
|
},
|
|
20721
|
-
/* @__PURE__ */
|
|
20722
|
-
/* @__PURE__ */
|
|
20790
|
+
/* @__PURE__ */ React199.createElement(Text, { size: "10", color: "primaryText" }, truncatedAddress),
|
|
20791
|
+
/* @__PURE__ */ React199.createElement(
|
|
20723
20792
|
CopyIconButton,
|
|
20724
20793
|
{
|
|
20725
20794
|
isAddressCopied: copiedAddress,
|
|
@@ -20730,7 +20799,7 @@ function CopyInputDisplayedAddress({
|
|
|
20730
20799
|
}
|
|
20731
20800
|
|
|
20732
20801
|
// src/components/Dropdown/TokenDropdown.tsx
|
|
20733
|
-
import
|
|
20802
|
+
import React200, { useState as useState59 } from "react";
|
|
20734
20803
|
var TOKEN_ICON_SIZE2 = 16;
|
|
20735
20804
|
var getTokenIconUrl2 = (symbol) => {
|
|
20736
20805
|
return ASSET_LOGO_SRCS[symbol.toUpperCase()];
|
|
@@ -20763,12 +20832,12 @@ var TokenDropdown = ({
|
|
|
20763
20832
|
handleChangeSymbol(enabledTokens[0]);
|
|
20764
20833
|
}
|
|
20765
20834
|
}, [selectedSymbol, enabledTokens]);
|
|
20766
|
-
return /* @__PURE__ */
|
|
20835
|
+
return /* @__PURE__ */ React200.createElement(
|
|
20767
20836
|
BaseDropdown_default,
|
|
20768
20837
|
{
|
|
20769
20838
|
openToTopOnMobile: false,
|
|
20770
20839
|
activeItemProps: {
|
|
20771
|
-
iconComponent: /* @__PURE__ */
|
|
20840
|
+
iconComponent: /* @__PURE__ */ React200.createElement(
|
|
20772
20841
|
AsyncImage,
|
|
20773
20842
|
{
|
|
20774
20843
|
alt: selectedSymbol,
|
|
@@ -20788,10 +20857,10 @@ var TokenDropdown = ({
|
|
|
20788
20857
|
renderDropdownOption: (option, isSelected) => {
|
|
20789
20858
|
const symbol = option.value;
|
|
20790
20859
|
const iconUrl = getTokenIconUrl2(symbol);
|
|
20791
|
-
return /* @__PURE__ */
|
|
20860
|
+
return /* @__PURE__ */ React200.createElement(
|
|
20792
20861
|
BaseDropdownItem_default,
|
|
20793
20862
|
{
|
|
20794
|
-
iconComponent: /* @__PURE__ */
|
|
20863
|
+
iconComponent: /* @__PURE__ */ React200.createElement(
|
|
20795
20864
|
AsyncImage,
|
|
20796
20865
|
{
|
|
20797
20866
|
alt: option.label,
|
|
@@ -20815,8 +20884,43 @@ var TokenDropdown = ({
|
|
|
20815
20884
|
};
|
|
20816
20885
|
var TokenDropdown_default = TokenDropdown;
|
|
20817
20886
|
|
|
20887
|
+
// src/components/QRCode/QRCodeSkeletonLoader.tsx
|
|
20888
|
+
import React201 from "react";
|
|
20889
|
+
var QRCodeSkeletonLoader = ({
|
|
20890
|
+
diagonalDimension = 12
|
|
20891
|
+
}) => {
|
|
20892
|
+
const gapBetweenDots = "4";
|
|
20893
|
+
const size = diagonalDimension * 8 + (diagonalDimension - 1) * Number(gapBetweenDots);
|
|
20894
|
+
return /* @__PURE__ */ React201.createElement(
|
|
20895
|
+
Box,
|
|
20896
|
+
{
|
|
20897
|
+
display: "flex",
|
|
20898
|
+
flexDirection: "column",
|
|
20899
|
+
alignItems: "center",
|
|
20900
|
+
justifyContent: "center",
|
|
20901
|
+
gap: "4",
|
|
20902
|
+
style: { width: `${size}px`, height: `${size}px` }
|
|
20903
|
+
},
|
|
20904
|
+
Array.from({ length: diagonalDimension }, (_, index) => /* @__PURE__ */ React201.createElement(
|
|
20905
|
+
Box,
|
|
20906
|
+
{
|
|
20907
|
+
display: "flex",
|
|
20908
|
+
alignItems: "center",
|
|
20909
|
+
justifyContent: "center",
|
|
20910
|
+
gap: gapBetweenDots,
|
|
20911
|
+
key: index
|
|
20912
|
+
},
|
|
20913
|
+
Array.from({ length: diagonalDimension }, (_2, index2) => (
|
|
20914
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: no better key
|
|
20915
|
+
/* @__PURE__ */ React201.createElement(FunSkeletonCircle, { size: "8", key: index2 })
|
|
20916
|
+
))
|
|
20917
|
+
))
|
|
20918
|
+
);
|
|
20919
|
+
};
|
|
20920
|
+
var QRCodeSkeletonLoader_default = QRCodeSkeletonLoader;
|
|
20921
|
+
|
|
20818
20922
|
// src/components/Dropdown/ChainDropdown.tsx
|
|
20819
|
-
import
|
|
20923
|
+
import React202 from "react";
|
|
20820
20924
|
var CHAIN_ICON_SIZE = 16;
|
|
20821
20925
|
var ChainDropdown = ({
|
|
20822
20926
|
assets,
|
|
@@ -20829,12 +20933,12 @@ var ChainDropdown = ({
|
|
|
20829
20933
|
(chainId) => assets[chainId].includes(selectedToken)
|
|
20830
20934
|
);
|
|
20831
20935
|
const selectedChain = chainMetadataById[selectedChainId];
|
|
20832
|
-
return /* @__PURE__ */
|
|
20936
|
+
return /* @__PURE__ */ React202.createElement(
|
|
20833
20937
|
BaseDropdown_default,
|
|
20834
20938
|
{
|
|
20835
20939
|
openToTopOnMobile: false,
|
|
20836
20940
|
activeItemProps: {
|
|
20837
|
-
iconComponent: /* @__PURE__ */
|
|
20941
|
+
iconComponent: /* @__PURE__ */ React202.createElement(
|
|
20838
20942
|
AsyncImage,
|
|
20839
20943
|
{
|
|
20840
20944
|
alt: selectedChain.name,
|
|
@@ -20853,10 +20957,10 @@ var ChainDropdown = ({
|
|
|
20853
20957
|
})),
|
|
20854
20958
|
renderDropdownOption: (option, isSelected) => {
|
|
20855
20959
|
const metadata = chainMetadataById[option.value];
|
|
20856
|
-
return /* @__PURE__ */
|
|
20960
|
+
return /* @__PURE__ */ React202.createElement(
|
|
20857
20961
|
BaseDropdownItem_default,
|
|
20858
20962
|
{
|
|
20859
|
-
iconComponent: /* @__PURE__ */
|
|
20963
|
+
iconComponent: /* @__PURE__ */ React202.createElement(
|
|
20860
20964
|
AsyncImage,
|
|
20861
20965
|
{
|
|
20862
20966
|
alt: metadata.name,
|
|
@@ -20889,7 +20993,7 @@ var ChainDropdown_default = ChainDropdown;
|
|
|
20889
20993
|
import {
|
|
20890
20994
|
initializeCheckoutTokenTransferAddress
|
|
20891
20995
|
} from "@funkit/api-base";
|
|
20892
|
-
import { useQuery as
|
|
20996
|
+
import { useQuery as useQuery9 } from "@tanstack/react-query";
|
|
20893
20997
|
var useCheckoutTransferDepositAddress = (checkoutItem, userId, recipientAddr) => {
|
|
20894
20998
|
const { apiKey } = useFunkitConfig();
|
|
20895
20999
|
const queryKey = {
|
|
@@ -20901,7 +21005,7 @@ var useCheckoutTransferDepositAddress = (checkoutItem, userId, recipientAddr) =>
|
|
|
20901
21005
|
logger,
|
|
20902
21006
|
clientMetadata: generateClientMetadataForTokenTransfer()
|
|
20903
21007
|
};
|
|
20904
|
-
const { data, isFetching } =
|
|
21008
|
+
const { data, isFetching } = useQuery9({
|
|
20905
21009
|
queryKey: ["initializeCheckoutTokenTransferAddress", queryKey],
|
|
20906
21010
|
queryFn: ({ queryKey: [_, params] }) => initializeCheckoutTokenTransferAddress(params),
|
|
20907
21011
|
refetchOnWindowFocus: false
|
|
@@ -20985,7 +21089,7 @@ function TransferToken({
|
|
|
20985
21089
|
selectedChainId.toString()
|
|
20986
21090
|
);
|
|
20987
21091
|
const isLoadingDepositAddress = depositAddress === void 0;
|
|
20988
|
-
return /* @__PURE__ */
|
|
21092
|
+
return /* @__PURE__ */ React203.createElement(Box, { id: "token-transfer-page" }, /* @__PURE__ */ React203.createElement(
|
|
20989
21093
|
Box,
|
|
20990
21094
|
{
|
|
20991
21095
|
display: "flex",
|
|
@@ -20994,17 +21098,17 @@ function TransferToken({
|
|
|
20994
21098
|
justifyContent: "center",
|
|
20995
21099
|
gap: "14"
|
|
20996
21100
|
},
|
|
20997
|
-
/* @__PURE__ */
|
|
21101
|
+
/* @__PURE__ */ React203.createElement(Box, { display: "flex", flexDirection: "column", width: "full" }, /* @__PURE__ */ React203.createElement(
|
|
20998
21102
|
SourcePaymentMethodItem,
|
|
20999
21103
|
{
|
|
21000
21104
|
otherSourcesCount,
|
|
21001
21105
|
keyText: textCustomizations.transferTokens,
|
|
21002
21106
|
disclaimerText: "No limit",
|
|
21003
|
-
keyIcon: /* @__PURE__ */
|
|
21107
|
+
keyIcon: /* @__PURE__ */ React203.createElement(LightningBoltIcon, null),
|
|
21004
21108
|
onClick: () => onNext({})
|
|
21005
21109
|
}
|
|
21006
21110
|
)),
|
|
21007
|
-
/* @__PURE__ */
|
|
21111
|
+
/* @__PURE__ */ React203.createElement(Box, { width: "full", display: "flex", flexDirection: "column", gap: "4" }, /* @__PURE__ */ React203.createElement(
|
|
21008
21112
|
Text,
|
|
21009
21113
|
{
|
|
21010
21114
|
size: "12",
|
|
@@ -21013,7 +21117,7 @@ function TransferToken({
|
|
|
21013
21117
|
style: { textTransform: "uppercase" }
|
|
21014
21118
|
},
|
|
21015
21119
|
"Token"
|
|
21016
|
-
), /* @__PURE__ */
|
|
21120
|
+
), /* @__PURE__ */ React203.createElement(
|
|
21017
21121
|
TokenDropdown_default,
|
|
21018
21122
|
{
|
|
21019
21123
|
defaultSelectedToken,
|
|
@@ -21038,7 +21142,7 @@ function TransferToken({
|
|
|
21038
21142
|
}
|
|
21039
21143
|
}
|
|
21040
21144
|
)),
|
|
21041
|
-
/* @__PURE__ */
|
|
21145
|
+
/* @__PURE__ */ React203.createElement(Box, { width: "full", display: "flex", flexDirection: "column", gap: "4" }, /* @__PURE__ */ React203.createElement(Box, { width: "full", display: "flex", flexDirection: "column", gap: "4" }, /* @__PURE__ */ React203.createElement(
|
|
21042
21146
|
Text,
|
|
21043
21147
|
{
|
|
21044
21148
|
size: "12",
|
|
@@ -21047,7 +21151,7 @@ function TransferToken({
|
|
|
21047
21151
|
style: { textTransform: "uppercase" }
|
|
21048
21152
|
},
|
|
21049
21153
|
"Chain"
|
|
21050
|
-
), /* @__PURE__ */
|
|
21154
|
+
), /* @__PURE__ */ React203.createElement(
|
|
21051
21155
|
ChainDropdown_default,
|
|
21052
21156
|
{
|
|
21053
21157
|
selectedToken,
|
|
@@ -21063,7 +21167,7 @@ function TransferToken({
|
|
|
21063
21167
|
setSelectedChainId(chainId);
|
|
21064
21168
|
}
|
|
21065
21169
|
}
|
|
21066
|
-
)), /* @__PURE__ */
|
|
21170
|
+
)), /* @__PURE__ */ React203.createElement(
|
|
21067
21171
|
Box,
|
|
21068
21172
|
{
|
|
21069
21173
|
display: "flex",
|
|
@@ -21071,10 +21175,10 @@ function TransferToken({
|
|
|
21071
21175
|
alignItems: "center",
|
|
21072
21176
|
width: "full"
|
|
21073
21177
|
},
|
|
21074
|
-
/* @__PURE__ */
|
|
21075
|
-
/* @__PURE__ */
|
|
21178
|
+
/* @__PURE__ */ React203.createElement(Text, { size: "12", color: "primaryText" }, "Minimum deposit"),
|
|
21179
|
+
/* @__PURE__ */ React203.createElement(Text, { size: "12", color: "primaryText" }, minTransferUsd === 0 ? "No minimum" : formatCurrencyAndStringify12(minTransferUsd))
|
|
21076
21180
|
)),
|
|
21077
|
-
/* @__PURE__ */
|
|
21181
|
+
/* @__PURE__ */ React203.createElement(Box, { width: "full", display: "flex", flexDirection: "column", gap: "4" }, /* @__PURE__ */ React203.createElement(
|
|
21078
21182
|
Text,
|
|
21079
21183
|
{
|
|
21080
21184
|
size: "12",
|
|
@@ -21083,15 +21187,8 @@ function TransferToken({
|
|
|
21083
21187
|
style: { textTransform: "uppercase" }
|
|
21084
21188
|
},
|
|
21085
21189
|
"Your deposit address"
|
|
21086
|
-
), isLoadingDepositAddress ? /* @__PURE__ */
|
|
21087
|
-
|
|
21088
|
-
{
|
|
21089
|
-
height: "24",
|
|
21090
|
-
style: { height: "33px" },
|
|
21091
|
-
width: "full"
|
|
21092
|
-
}
|
|
21093
|
-
) : /* @__PURE__ */ React201.createElement(CopyInputDisplayedAddress, { address: depositAddress })),
|
|
21094
|
-
/* @__PURE__ */ React201.createElement(
|
|
21190
|
+
), isLoadingDepositAddress ? /* @__PURE__ */ React203.createElement(FunSkeletonBlock, { height: "33", width: "full" }) : /* @__PURE__ */ React203.createElement(CopyInputDisplayedAddress, { address: depositAddress })),
|
|
21191
|
+
/* @__PURE__ */ React203.createElement(
|
|
21095
21192
|
Box,
|
|
21096
21193
|
{
|
|
21097
21194
|
display: "flex",
|
|
@@ -21099,31 +21196,7 @@ function TransferToken({
|
|
|
21099
21196
|
justifyContent: "center",
|
|
21100
21197
|
paddingY: "4"
|
|
21101
21198
|
},
|
|
21102
|
-
isLoadingDepositAddress ? /* @__PURE__ */
|
|
21103
|
-
Box,
|
|
21104
|
-
{
|
|
21105
|
-
display: "flex",
|
|
21106
|
-
flexDirection: "column",
|
|
21107
|
-
alignItems: "center",
|
|
21108
|
-
justifyContent: "center",
|
|
21109
|
-
gap: "4",
|
|
21110
|
-
style: { width: "140px" }
|
|
21111
|
-
},
|
|
21112
|
-
Array.from({ length: 12 }, (_, index) => /* @__PURE__ */ React201.createElement(
|
|
21113
|
-
Box,
|
|
21114
|
-
{
|
|
21115
|
-
display: "flex",
|
|
21116
|
-
alignItems: "center",
|
|
21117
|
-
justifyContent: "center",
|
|
21118
|
-
gap: "4",
|
|
21119
|
-
key: index
|
|
21120
|
-
},
|
|
21121
|
-
Array.from({ length: 12 }, (_2, index2) => (
|
|
21122
|
-
// biome-ignore lint/suspicious/noArrayIndexKey: no better key
|
|
21123
|
-
/* @__PURE__ */ React201.createElement(FunSkeletonCircle, { size: "8", key: index2 })
|
|
21124
|
-
))
|
|
21125
|
-
))
|
|
21126
|
-
) : /* @__PURE__ */ React201.createElement(
|
|
21199
|
+
isLoadingDepositAddress ? /* @__PURE__ */ React203.createElement(QRCodeSkeletonLoader_default, { diagonalDimension: 12 }) : /* @__PURE__ */ React203.createElement(
|
|
21127
21200
|
QRCode,
|
|
21128
21201
|
{
|
|
21129
21202
|
logoSize: 24,
|
|
@@ -21137,7 +21210,7 @@ function TransferToken({
|
|
|
21137
21210
|
}
|
|
21138
21211
|
)
|
|
21139
21212
|
),
|
|
21140
|
-
/* @__PURE__ */
|
|
21213
|
+
/* @__PURE__ */ React203.createElement(Box, { display: "flex", flexDirection: "column", gap: "8" }, /* @__PURE__ */ React203.createElement(FunInfoBanner, null), /* @__PURE__ */ React203.createElement(
|
|
21141
21214
|
Box,
|
|
21142
21215
|
{
|
|
21143
21216
|
display: "flex",
|
|
@@ -21146,21 +21219,21 @@ function TransferToken({
|
|
|
21146
21219
|
width: "full",
|
|
21147
21220
|
ref: disclaimerTextWrapperRef
|
|
21148
21221
|
},
|
|
21149
|
-
/* @__PURE__ */
|
|
21222
|
+
/* @__PURE__ */ React203.createElement(Text, { size: "10", color: "secondaryText", weight: "medium" }, "Send in the accepted token to the address above and it will auto swap to ", targetAssetTicker, " in your ", appNameWalletDisplayText, ", minus", " ", /* @__PURE__ */ React203.createElement(
|
|
21150
21223
|
FunLinkButton,
|
|
21151
21224
|
{
|
|
21152
21225
|
href: "https://intercom.help/funxyz/en/articles/10073209-fun-xyz-s-fee-breakdown",
|
|
21153
21226
|
inline: true,
|
|
21154
21227
|
text: "fees"
|
|
21155
21228
|
}
|
|
21156
|
-
), ".", " ", /* @__PURE__ */
|
|
21229
|
+
), ".", " ", /* @__PURE__ */ React203.createElement(
|
|
21157
21230
|
FunLinkButton,
|
|
21158
21231
|
{
|
|
21159
21232
|
href: "https://fun.xyz/terms",
|
|
21160
21233
|
inline: true,
|
|
21161
21234
|
text: "Terms & conditions"
|
|
21162
21235
|
}
|
|
21163
|
-
), " ", "apply. Experiencing problems?", " ", /* @__PURE__ */
|
|
21236
|
+
), " ", "apply. Experiencing problems?", " ", /* @__PURE__ */ React203.createElement(
|
|
21164
21237
|
FunLinkButton,
|
|
21165
21238
|
{
|
|
21166
21239
|
href: "https://intercom.help/funxyz/en/articles/10003876-direct-deposit-guide-faqs",
|
|
@@ -21304,7 +21377,7 @@ function useTitleConfig(checkoutItem, state) {
|
|
|
21304
21377
|
// src/modals/CheckoutModal/FunCheckoutModal.tsx
|
|
21305
21378
|
function FunCheckoutModalStepComponent(props) {
|
|
21306
21379
|
const { Component: Component2 } = CheckoutModalSteps[props.modalState.step];
|
|
21307
|
-
return /* @__PURE__ */
|
|
21380
|
+
return /* @__PURE__ */ React204.createElement(Component2, { ...props });
|
|
21308
21381
|
}
|
|
21309
21382
|
function FunCheckoutModalInner({
|
|
21310
21383
|
checkoutItem,
|
|
@@ -21312,7 +21385,6 @@ function FunCheckoutModalInner({
|
|
|
21312
21385
|
open
|
|
21313
21386
|
}) {
|
|
21314
21387
|
const { isUserGeoblocked } = useFunkitUserIp();
|
|
21315
|
-
const { isCheckoutRisky } = useIsCheckoutRisky(checkoutItem);
|
|
21316
21388
|
const {
|
|
21317
21389
|
animation,
|
|
21318
21390
|
modalState,
|
|
@@ -21342,7 +21414,7 @@ function FunCheckoutModalInner({
|
|
|
21342
21414
|
setModalState
|
|
21343
21415
|
};
|
|
21344
21416
|
const isInitialStep = modalState.step === "loading_account" /* LOADING_ACCOUNT */;
|
|
21345
|
-
const isBlocked = isUserGeoblocked ||
|
|
21417
|
+
const isBlocked = isUserGeoblocked || modalState.isBlocked;
|
|
21346
21418
|
const hasBack = hasHistoryEntry && !disableBack;
|
|
21347
21419
|
const checkoutConfig = checkoutItem.initSettings.config;
|
|
21348
21420
|
const showDydxSwitch = !hasBack && modalState.step !== "checkout_complete" /* CHECKOUT_COMPLETE */;
|
|
@@ -21350,7 +21422,7 @@ function FunCheckoutModalInner({
|
|
|
21350
21422
|
depositAddress: checkoutItem.depositAddress ?? void 0,
|
|
21351
21423
|
isCheckoutDetailView: modalState.step === "checkout_complete" /* CHECKOUT_COMPLETE */,
|
|
21352
21424
|
paddingTop: 0,
|
|
21353
|
-
topbar: /* @__PURE__ */
|
|
21425
|
+
topbar: /* @__PURE__ */ React204.createElement(
|
|
21354
21426
|
Dialog.Title,
|
|
21355
21427
|
{
|
|
21356
21428
|
hasBackButton: hasBack && !isBlocked,
|
|
@@ -21364,7 +21436,7 @@ function FunCheckoutModalInner({
|
|
|
21364
21436
|
),
|
|
21365
21437
|
withTopDivider: checkoutConfig.modalTitleMeta ? "always" : "scroll"
|
|
21366
21438
|
});
|
|
21367
|
-
return /* @__PURE__ */
|
|
21439
|
+
return /* @__PURE__ */ React204.createElement(
|
|
21368
21440
|
Dialog,
|
|
21369
21441
|
{
|
|
21370
21442
|
open,
|
|
@@ -21373,7 +21445,7 @@ function FunCheckoutModalInner({
|
|
|
21373
21445
|
isHidden: modalState.isSoftHidden
|
|
21374
21446
|
},
|
|
21375
21447
|
topbar,
|
|
21376
|
-
/* @__PURE__ */
|
|
21448
|
+
/* @__PURE__ */ React204.createElement(
|
|
21377
21449
|
Dialog.Content,
|
|
21378
21450
|
{
|
|
21379
21451
|
fullHeight: showFullHeight,
|
|
@@ -21383,22 +21455,22 @@ function FunCheckoutModalInner({
|
|
|
21383
21455
|
withTopDivider,
|
|
21384
21456
|
withBottomDivider: modalState.step === "transfer_token" /* TRANSFER_TOKEN */ ? "never" : "scroll"
|
|
21385
21457
|
},
|
|
21386
|
-
isBlocked ? /* @__PURE__ */
|
|
21458
|
+
isBlocked ? /* @__PURE__ */ React204.createElement(
|
|
21387
21459
|
FunCheckoutBlocked,
|
|
21388
21460
|
{
|
|
21389
21461
|
reason: isUserGeoblocked ? "geoblock" : "security"
|
|
21390
21462
|
}
|
|
21391
|
-
) : /* @__PURE__ */
|
|
21463
|
+
) : /* @__PURE__ */ React204.createElement(React204.Fragment, null, /* @__PURE__ */ React204.createElement(
|
|
21392
21464
|
DydxSwitchTab,
|
|
21393
21465
|
{
|
|
21394
21466
|
checkoutItem,
|
|
21395
21467
|
showSwitch: showDydxSwitch,
|
|
21396
21468
|
onClose: onCloseWrapper
|
|
21397
21469
|
}
|
|
21398
|
-
), /* @__PURE__ */
|
|
21470
|
+
), /* @__PURE__ */ React204.createElement(FunCheckoutModalStepComponent, { ...modalProps }))
|
|
21399
21471
|
),
|
|
21400
|
-
/* @__PURE__ */
|
|
21401
|
-
!isBlocked && /* @__PURE__ */
|
|
21472
|
+
/* @__PURE__ */ React204.createElement(Dialog.BottomSection, { id: CHECKOUT_MODAL_BOTTOM_BAR_ID }),
|
|
21473
|
+
!isBlocked && /* @__PURE__ */ React204.createElement(
|
|
21402
21474
|
CheckoutNotifications,
|
|
21403
21475
|
{
|
|
21404
21476
|
onHelp: handleCheckoutHelp,
|
|
@@ -21412,7 +21484,7 @@ function FunCheckoutModal({ onClose, open }) {
|
|
|
21412
21484
|
if (!checkoutItem) {
|
|
21413
21485
|
return null;
|
|
21414
21486
|
}
|
|
21415
|
-
return /* @__PURE__ */
|
|
21487
|
+
return /* @__PURE__ */ React204.createElement(
|
|
21416
21488
|
FunCheckoutModalInner,
|
|
21417
21489
|
{
|
|
21418
21490
|
checkoutItem,
|
|
@@ -21423,7 +21495,7 @@ function FunCheckoutModal({ onClose, open }) {
|
|
|
21423
21495
|
}
|
|
21424
21496
|
|
|
21425
21497
|
// src/modals/ConnectModal/ConnectModal.tsx
|
|
21426
|
-
import
|
|
21498
|
+
import React205 from "react";
|
|
21427
21499
|
import { useAccount as useAccount9 } from "wagmi";
|
|
21428
21500
|
var TITLE_ID2 = "rk_connect_title";
|
|
21429
21501
|
function ConnectModal({
|
|
@@ -21434,12 +21506,12 @@ function ConnectModal({
|
|
|
21434
21506
|
const connectionStatus = useConnectionStatus();
|
|
21435
21507
|
const { disconnect } = useFunkitDisconnect();
|
|
21436
21508
|
const { isConnecting } = useAccount9();
|
|
21437
|
-
const onConnectModalCancel =
|
|
21509
|
+
const onConnectModalCancel = React205.useCallback(() => {
|
|
21438
21510
|
if (isConnecting) disconnect();
|
|
21439
21511
|
onClose();
|
|
21440
21512
|
}, [onClose, disconnect, isConnecting]);
|
|
21441
21513
|
if (connectionStatus === "disconnected" || connectionStatus === "loading") {
|
|
21442
|
-
return /* @__PURE__ */
|
|
21514
|
+
return /* @__PURE__ */ React205.createElement(
|
|
21443
21515
|
Dialog,
|
|
21444
21516
|
{
|
|
21445
21517
|
onClose: onConnectModalCancel,
|
|
@@ -21447,7 +21519,7 @@ function ConnectModal({
|
|
|
21447
21519
|
titleId: TITLE_ID2,
|
|
21448
21520
|
isSmartCloseable: true
|
|
21449
21521
|
},
|
|
21450
|
-
/* @__PURE__ */
|
|
21522
|
+
/* @__PURE__ */ React205.createElement(
|
|
21451
21523
|
FunConnectOptions,
|
|
21452
21524
|
{
|
|
21453
21525
|
onClose: onConnectModalCancel,
|
|
@@ -21535,13 +21607,13 @@ function ModalProvider({ children }) {
|
|
|
21535
21607
|
onConnect: () => closeModals(isUnauthenticated),
|
|
21536
21608
|
onDisconnect: closeModals
|
|
21537
21609
|
});
|
|
21538
|
-
|
|
21610
|
+
useEffect43(() => {
|
|
21539
21611
|
if (isUnauthenticated) closeModals();
|
|
21540
21612
|
}, [isUnauthenticated]);
|
|
21541
|
-
return /* @__PURE__ */
|
|
21613
|
+
return /* @__PURE__ */ React206.createElement(
|
|
21542
21614
|
ModalContext.Provider,
|
|
21543
21615
|
{
|
|
21544
|
-
value:
|
|
21616
|
+
value: useMemo38(
|
|
21545
21617
|
() => ({
|
|
21546
21618
|
accountModalOpen,
|
|
21547
21619
|
accountModalTab,
|
|
@@ -21576,7 +21648,7 @@ function ModalProvider({ children }) {
|
|
|
21576
21648
|
)
|
|
21577
21649
|
},
|
|
21578
21650
|
children,
|
|
21579
|
-
/* @__PURE__ */
|
|
21651
|
+
/* @__PURE__ */ React206.createElement(
|
|
21580
21652
|
ConnectModal,
|
|
21581
21653
|
{
|
|
21582
21654
|
onClose: closeConnectModal,
|
|
@@ -21584,7 +21656,7 @@ function ModalProvider({ children }) {
|
|
|
21584
21656
|
walletsOnly: !!walletsOnly
|
|
21585
21657
|
}
|
|
21586
21658
|
),
|
|
21587
|
-
/* @__PURE__ */
|
|
21659
|
+
/* @__PURE__ */ React206.createElement(
|
|
21588
21660
|
AccountModal,
|
|
21589
21661
|
{
|
|
21590
21662
|
onClose: closeAccountModal,
|
|
@@ -21592,8 +21664,8 @@ function ModalProvider({ children }) {
|
|
|
21592
21664
|
defaultTab: accountModalTab
|
|
21593
21665
|
}
|
|
21594
21666
|
),
|
|
21595
|
-
/* @__PURE__ */
|
|
21596
|
-
/* @__PURE__ */
|
|
21667
|
+
/* @__PURE__ */ React206.createElement(ChainModal, { onClose: closeChainModal, open: chainModalOpen }),
|
|
21668
|
+
/* @__PURE__ */ React206.createElement(
|
|
21597
21669
|
FunCheckoutModal,
|
|
21598
21670
|
{
|
|
21599
21671
|
onClose: closeFunCheckoutModal,
|
|
@@ -21939,7 +22011,7 @@ var FunkitWeb2Provider = ({
|
|
|
21939
22011
|
},
|
|
21940
22012
|
[]
|
|
21941
22013
|
);
|
|
21942
|
-
|
|
22014
|
+
useEffect44(() => {
|
|
21943
22015
|
const newPrivy = new PrivyJS({
|
|
21944
22016
|
appId: DEFAULT_PRIVY_APP_ID,
|
|
21945
22017
|
storage: new LocalStorage(),
|
|
@@ -22146,7 +22218,7 @@ var FunkitWeb2Provider = ({
|
|
|
22146
22218
|
}
|
|
22147
22219
|
}
|
|
22148
22220
|
}, [handleFunkitWeb2Login, initChainId, loginMethod]);
|
|
22149
|
-
|
|
22221
|
+
useEffect44(() => {
|
|
22150
22222
|
if (privy && privyIframeUrl && isNotNullish13(initChainId)) {
|
|
22151
22223
|
const iframe = document.getElementById(
|
|
22152
22224
|
PRIVY_IFRAME_ID
|
|
@@ -22261,7 +22333,7 @@ var FunkitWeb2Provider = ({
|
|
|
22261
22333
|
},
|
|
22262
22334
|
[privy]
|
|
22263
22335
|
);
|
|
22264
|
-
const web2UserInfo =
|
|
22336
|
+
const web2UserInfo = useMemo39(() => {
|
|
22265
22337
|
if (!loggedInUser || !loggedInUser?.linked_accounts || !loggedInUser?.linked_accounts?.length) {
|
|
22266
22338
|
return PLACEHOLDER_FUNKIT_USER_INFO;
|
|
22267
22339
|
}
|
|
@@ -22328,7 +22400,7 @@ var FunkitWeb2Provider = ({
|
|
|
22328
22400
|
handleFunkitWeb2Logout,
|
|
22329
22401
|
web2UserInfo
|
|
22330
22402
|
};
|
|
22331
|
-
return /* @__PURE__ */
|
|
22403
|
+
return /* @__PURE__ */ React207.createElement(FunkitWeb2Context.Provider, { value: contextValue }, privyIframeUrl ? /* @__PURE__ */ React207.createElement(
|
|
22332
22404
|
"iframe",
|
|
22333
22405
|
{
|
|
22334
22406
|
id: PRIVY_IFRAME_ID,
|
|
@@ -22361,7 +22433,7 @@ function useConnectionStatus() {
|
|
|
22361
22433
|
}
|
|
22362
22434
|
|
|
22363
22435
|
// src/providers/ShowBalanceContext.tsx
|
|
22364
|
-
import
|
|
22436
|
+
import React208, {
|
|
22365
22437
|
createContext as createContext19,
|
|
22366
22438
|
useContext as useContext19,
|
|
22367
22439
|
useState as useState64
|
|
@@ -22372,20 +22444,20 @@ var ShowBalanceContext = createContext19({
|
|
|
22372
22444
|
});
|
|
22373
22445
|
function ShowBalanceProvider({ children }) {
|
|
22374
22446
|
const [showBalance, setShowBalance] = useState64();
|
|
22375
|
-
return /* @__PURE__ */
|
|
22447
|
+
return /* @__PURE__ */ React208.createElement(ShowBalanceContext.Provider, { value: { showBalance, setShowBalance } }, children);
|
|
22376
22448
|
}
|
|
22377
22449
|
var useShowBalance = () => useContext19(ShowBalanceContext);
|
|
22378
22450
|
|
|
22379
22451
|
// src/components/ConnectButton/ConnectButtonRenderer.tsx
|
|
22380
22452
|
import { formatCurrencyAndStringify as formatCurrencyAndStringify13, isMobile as isMobile14, noop as noop8 } from "@funkit/utils";
|
|
22381
|
-
import
|
|
22453
|
+
import React209 from "react";
|
|
22382
22454
|
import { useAccount as useAccount12, useBalance, useConfig as useConfig6 } from "wagmi";
|
|
22383
22455
|
|
|
22384
22456
|
// src/hooks/useIsMounted.ts
|
|
22385
|
-
import { useCallback as useCallback43, useEffect as
|
|
22457
|
+
import { useCallback as useCallback43, useEffect as useEffect45, useState as useState65 } from "react";
|
|
22386
22458
|
function useIsMounted() {
|
|
22387
22459
|
const [isMounted, setIsMounted] = useState65(false);
|
|
22388
|
-
|
|
22460
|
+
useEffect45(() => {
|
|
22389
22461
|
setIsMounted(true);
|
|
22390
22462
|
return () => {
|
|
22391
22463
|
setIsMounted(false);
|
|
@@ -22469,7 +22541,7 @@ function ConnectButtonRenderer({
|
|
|
22469
22541
|
const { openChainModal } = useChainModal();
|
|
22470
22542
|
const { openAccountModal } = useAccountModal();
|
|
22471
22543
|
const { accountModalOpen, chainModalOpen, connectModalOpen } = useModalState();
|
|
22472
|
-
return /* @__PURE__ */
|
|
22544
|
+
return /* @__PURE__ */ React209.createElement(React209.Fragment, null, children({
|
|
22473
22545
|
account: address ? {
|
|
22474
22546
|
address,
|
|
22475
22547
|
balanceDecimals: balanceData?.decimals,
|
|
@@ -22525,7 +22597,7 @@ function ChainSelectorButton({
|
|
|
22525
22597
|
openChainModal,
|
|
22526
22598
|
chain
|
|
22527
22599
|
}) {
|
|
22528
|
-
return /* @__PURE__ */
|
|
22600
|
+
return /* @__PURE__ */ React210.createElement(
|
|
22529
22601
|
Box,
|
|
22530
22602
|
{
|
|
22531
22603
|
alignItems: "center",
|
|
@@ -22553,7 +22625,7 @@ function ChainSelectorButton({
|
|
|
22553
22625
|
type: "button",
|
|
22554
22626
|
...connectButtonStyles
|
|
22555
22627
|
},
|
|
22556
|
-
unsupportedChain ? /* @__PURE__ */
|
|
22628
|
+
unsupportedChain ? /* @__PURE__ */ React210.createElement(Box, { alignItems: "center", display: "flex", height: "24", paddingX: "4" }, "Wrong network") : /* @__PURE__ */ React210.createElement(Box, { alignItems: "center", display: "flex", gap: "6" }, chain.hasIcon ? /* @__PURE__ */ React210.createElement(
|
|
22557
22629
|
Box,
|
|
22558
22630
|
{
|
|
22559
22631
|
display: mapResponsiveValue(
|
|
@@ -22563,7 +22635,7 @@ function ChainSelectorButton({
|
|
|
22563
22635
|
height: "12",
|
|
22564
22636
|
width: "12"
|
|
22565
22637
|
},
|
|
22566
|
-
/* @__PURE__ */
|
|
22638
|
+
/* @__PURE__ */ React210.createElement(
|
|
22567
22639
|
AsyncImage,
|
|
22568
22640
|
{
|
|
22569
22641
|
alt: chain.name ?? "Chain icon",
|
|
@@ -22574,7 +22646,7 @@ function ChainSelectorButton({
|
|
|
22574
22646
|
src: chain.iconUrl
|
|
22575
22647
|
}
|
|
22576
22648
|
)
|
|
22577
|
-
) : null, /* @__PURE__ */
|
|
22649
|
+
) : null, /* @__PURE__ */ React210.createElement(
|
|
22578
22650
|
Box,
|
|
22579
22651
|
{
|
|
22580
22652
|
display: mapResponsiveValue(chainStatus, (value) => {
|
|
@@ -22594,7 +22666,7 @@ function AccountButton({
|
|
|
22594
22666
|
showBalance,
|
|
22595
22667
|
accountStatus
|
|
22596
22668
|
}) {
|
|
22597
|
-
return /* @__PURE__ */
|
|
22669
|
+
return /* @__PURE__ */ React210.createElement(
|
|
22598
22670
|
Box,
|
|
22599
22671
|
{
|
|
22600
22672
|
alignItems: "center",
|
|
@@ -22614,7 +22686,7 @@ function AccountButton({
|
|
|
22614
22686
|
gap: "16",
|
|
22615
22687
|
...connectButtonStyles
|
|
22616
22688
|
},
|
|
22617
|
-
account.displayBalance && /* @__PURE__ */
|
|
22689
|
+
account.displayBalance && /* @__PURE__ */ React210.createElement(
|
|
22618
22690
|
Box,
|
|
22619
22691
|
{
|
|
22620
22692
|
display: mapResponsiveValue(
|
|
@@ -22624,7 +22696,7 @@ function AccountButton({
|
|
|
22624
22696
|
},
|
|
22625
22697
|
account.displayBalance
|
|
22626
22698
|
),
|
|
22627
|
-
/* @__PURE__ */
|
|
22699
|
+
/* @__PURE__ */ React210.createElement(Box, { alignItems: "center", display: "flex", gap: "6" }, /* @__PURE__ */ React210.createElement(
|
|
22628
22700
|
Box,
|
|
22629
22701
|
{
|
|
22630
22702
|
display: mapResponsiveValue(
|
|
@@ -22632,7 +22704,7 @@ function AccountButton({
|
|
|
22632
22704
|
(value) => value === "full" || value === "avatar" ? "block" : "none"
|
|
22633
22705
|
)
|
|
22634
22706
|
},
|
|
22635
|
-
/* @__PURE__ */
|
|
22707
|
+
/* @__PURE__ */ React210.createElement(
|
|
22636
22708
|
Avatar,
|
|
22637
22709
|
{
|
|
22638
22710
|
address: account.address,
|
|
@@ -22641,7 +22713,7 @@ function AccountButton({
|
|
|
22641
22713
|
size: 12
|
|
22642
22714
|
}
|
|
22643
22715
|
)
|
|
22644
|
-
), /* @__PURE__ */
|
|
22716
|
+
), /* @__PURE__ */ React210.createElement(
|
|
22645
22717
|
Box,
|
|
22646
22718
|
{
|
|
22647
22719
|
display: mapResponsiveValue(
|
|
@@ -22668,11 +22740,11 @@ function ConnectButton({
|
|
|
22668
22740
|
const connectionStatus = useConnectionStatus();
|
|
22669
22741
|
const { setShowBalance } = useShowBalance();
|
|
22670
22742
|
const [ready, setReady] = useState66(false);
|
|
22671
|
-
|
|
22743
|
+
useEffect46(() => {
|
|
22672
22744
|
setShowBalance(showBalance);
|
|
22673
22745
|
if (!ready) setReady(true);
|
|
22674
22746
|
}, [showBalance, setShowBalance, ready]);
|
|
22675
|
-
return ready ? /* @__PURE__ */
|
|
22747
|
+
return ready ? /* @__PURE__ */ React210.createElement(ConnectButtonRenderer, null, ({
|
|
22676
22748
|
account,
|
|
22677
22749
|
chain,
|
|
22678
22750
|
mounted,
|
|
@@ -22682,7 +22754,7 @@ function ConnectButton({
|
|
|
22682
22754
|
}) => {
|
|
22683
22755
|
const ready2 = mounted && connectionStatus !== "loading";
|
|
22684
22756
|
const unsupportedChain = chain?.unsupported ?? false;
|
|
22685
|
-
return /* @__PURE__ */
|
|
22757
|
+
return /* @__PURE__ */ React210.createElement(
|
|
22686
22758
|
Box,
|
|
22687
22759
|
{
|
|
22688
22760
|
display: "flex",
|
|
@@ -22698,7 +22770,7 @@ function ConnectButton({
|
|
|
22698
22770
|
},
|
|
22699
22771
|
ready2 && account && connectionStatus === "connected" ? (
|
|
22700
22772
|
// Logged in: Chain Button & Account Button
|
|
22701
|
-
/* @__PURE__ */
|
|
22773
|
+
/* @__PURE__ */ React210.createElement(React210.Fragment, null, showChainSelector && chain && (chains.length > 1 || unsupportedChain) && /* @__PURE__ */ React210.createElement(
|
|
22702
22774
|
ChainSelectorButton,
|
|
22703
22775
|
{
|
|
22704
22776
|
unsupportedChain,
|
|
@@ -22706,7 +22778,7 @@ function ConnectButton({
|
|
|
22706
22778
|
openChainModal,
|
|
22707
22779
|
chain
|
|
22708
22780
|
}
|
|
22709
|
-
), !unsupportedChain && /* @__PURE__ */
|
|
22781
|
+
), !unsupportedChain && /* @__PURE__ */ React210.createElement(
|
|
22710
22782
|
AccountButton,
|
|
22711
22783
|
{
|
|
22712
22784
|
openAccountModal,
|
|
@@ -22717,7 +22789,7 @@ function ConnectButton({
|
|
|
22717
22789
|
))
|
|
22718
22790
|
) : (
|
|
22719
22791
|
// Not logged in: Connect Button
|
|
22720
|
-
/* @__PURE__ */
|
|
22792
|
+
/* @__PURE__ */ React210.createElement(
|
|
22721
22793
|
Box,
|
|
22722
22794
|
{
|
|
22723
22795
|
as: "button",
|
|
@@ -22735,19 +22807,19 @@ function ConnectButton({
|
|
|
22735
22807
|
type: "button",
|
|
22736
22808
|
...connectButtonStyles
|
|
22737
22809
|
},
|
|
22738
|
-
/* @__PURE__ */
|
|
22810
|
+
/* @__PURE__ */ React210.createElement(Box, { display: "flex", gap: "8", alignItems: "center" }, mounted && label, suffixIcon)
|
|
22739
22811
|
)
|
|
22740
22812
|
)
|
|
22741
22813
|
);
|
|
22742
|
-
}) : /* @__PURE__ */
|
|
22814
|
+
}) : /* @__PURE__ */ React210.createElement(React210.Fragment, null);
|
|
22743
22815
|
}
|
|
22744
22816
|
ConnectButton.__defaultProps = defaultProps;
|
|
22745
22817
|
ConnectButton.Custom = ConnectButtonRenderer;
|
|
22746
22818
|
|
|
22747
22819
|
// src/components/Icons/FunkitPaymentsIconLine.tsx
|
|
22748
|
-
import
|
|
22820
|
+
import React211 from "react";
|
|
22749
22821
|
function MetaMaskPaymentIcon({ size = 16 }) {
|
|
22750
|
-
return /* @__PURE__ */
|
|
22822
|
+
return /* @__PURE__ */ React211.createElement(
|
|
22751
22823
|
"svg",
|
|
22752
22824
|
{
|
|
22753
22825
|
width: size,
|
|
@@ -22756,7 +22828,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
22756
22828
|
fill: "none",
|
|
22757
22829
|
xmlns: "http://www.w3.org/2000/svg"
|
|
22758
22830
|
},
|
|
22759
|
-
/* @__PURE__ */
|
|
22831
|
+
/* @__PURE__ */ React211.createElement(
|
|
22760
22832
|
"path",
|
|
22761
22833
|
{
|
|
22762
22834
|
d: "M24.0891 3.1199L15.3446 9.61456L16.9617 5.7828L24.0891 3.1199Z",
|
|
@@ -22767,7 +22839,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
22767
22839
|
strokeLinejoin: "round"
|
|
22768
22840
|
}
|
|
22769
22841
|
),
|
|
22770
|
-
/* @__PURE__ */
|
|
22842
|
+
/* @__PURE__ */ React211.createElement(
|
|
22771
22843
|
"path",
|
|
22772
22844
|
{
|
|
22773
22845
|
d: "M3.90207 3.1199L12.5763 9.67608L11.0383 5.7828L3.90207 3.1199Z",
|
|
@@ -22778,7 +22850,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
22778
22850
|
strokeLinejoin: "round"
|
|
22779
22851
|
}
|
|
22780
22852
|
),
|
|
22781
|
-
/* @__PURE__ */
|
|
22853
|
+
/* @__PURE__ */ React211.createElement(
|
|
22782
22854
|
"path",
|
|
22783
22855
|
{
|
|
22784
22856
|
d: "M20.9429 18.1745L18.6139 21.7426L23.597 23.1136L25.0295 18.2536L20.9429 18.1745Z",
|
|
@@ -22789,7 +22861,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
22789
22861
|
strokeLinejoin: "round"
|
|
22790
22862
|
}
|
|
22791
22863
|
),
|
|
22792
|
-
/* @__PURE__ */
|
|
22864
|
+
/* @__PURE__ */ React211.createElement(
|
|
22793
22865
|
"path",
|
|
22794
22866
|
{
|
|
22795
22867
|
d: "M2.97929 18.2536L4.40301 23.1136L9.38607 21.7426L7.05713 18.1745L2.97929 18.2536Z",
|
|
@@ -22800,7 +22872,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
22800
22872
|
strokeLinejoin: "round"
|
|
22801
22873
|
}
|
|
22802
22874
|
),
|
|
22803
|
-
/* @__PURE__ */
|
|
22875
|
+
/* @__PURE__ */ React211.createElement(
|
|
22804
22876
|
"path",
|
|
22805
22877
|
{
|
|
22806
22878
|
d: "M9.10483 12.1456L7.71626 14.2461L12.6642 14.4658L12.4884 9.14877L9.10483 12.1456Z",
|
|
@@ -22811,7 +22883,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
22811
22883
|
strokeLinejoin: "round"
|
|
22812
22884
|
}
|
|
22813
22885
|
),
|
|
22814
|
-
/* @__PURE__ */
|
|
22886
|
+
/* @__PURE__ */ React211.createElement(
|
|
22815
22887
|
"path",
|
|
22816
22888
|
{
|
|
22817
22889
|
d: "M18.8864 12.1456L15.4589 9.08725L15.3446 14.4658L20.2837 14.2461L18.8864 12.1456Z",
|
|
@@ -22822,7 +22894,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
22822
22894
|
strokeLinejoin: "round"
|
|
22823
22895
|
}
|
|
22824
22896
|
),
|
|
22825
|
-
/* @__PURE__ */
|
|
22897
|
+
/* @__PURE__ */ React211.createElement(
|
|
22826
22898
|
"path",
|
|
22827
22899
|
{
|
|
22828
22900
|
d: "M9.38606 21.7426L12.3566 20.2925L9.79033 18.2888L9.38606 21.7426Z",
|
|
@@ -22833,7 +22905,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
22833
22905
|
strokeLinejoin: "round"
|
|
22834
22906
|
}
|
|
22835
22907
|
),
|
|
22836
|
-
/* @__PURE__ */
|
|
22908
|
+
/* @__PURE__ */ React211.createElement(
|
|
22837
22909
|
"path",
|
|
22838
22910
|
{
|
|
22839
22911
|
d: "M15.6347 20.2925L18.6139 21.7426L18.2009 18.2888L15.6347 20.2925Z",
|
|
@@ -22844,7 +22916,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
22844
22916
|
strokeLinejoin: "round"
|
|
22845
22917
|
}
|
|
22846
22918
|
),
|
|
22847
|
-
/* @__PURE__ */
|
|
22919
|
+
/* @__PURE__ */ React211.createElement(
|
|
22848
22920
|
"path",
|
|
22849
22921
|
{
|
|
22850
22922
|
d: "M18.6139 21.7426L15.6347 20.2925L15.8719 22.2348L15.8456 23.0521L18.6139 21.7426Z",
|
|
@@ -22855,7 +22927,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
22855
22927
|
strokeLinejoin: "round"
|
|
22856
22928
|
}
|
|
22857
22929
|
),
|
|
22858
|
-
/* @__PURE__ */
|
|
22930
|
+
/* @__PURE__ */ React211.createElement(
|
|
22859
22931
|
"path",
|
|
22860
22932
|
{
|
|
22861
22933
|
d: "M9.38606 21.7426L12.1544 23.0521L12.1368 22.2348L12.3566 20.2925L9.38606 21.7426Z",
|
|
@@ -22866,7 +22938,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
22866
22938
|
strokeLinejoin: "round"
|
|
22867
22939
|
}
|
|
22868
22940
|
),
|
|
22869
|
-
/* @__PURE__ */
|
|
22941
|
+
/* @__PURE__ */ React211.createElement(
|
|
22870
22942
|
"path",
|
|
22871
22943
|
{
|
|
22872
22944
|
d: "M12.1984 17.0056L9.72002 16.2762L11.4689 15.4765L12.1984 17.0056Z",
|
|
@@ -22877,7 +22949,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
22877
22949
|
strokeLinejoin: "round"
|
|
22878
22950
|
}
|
|
22879
22951
|
),
|
|
22880
|
-
/* @__PURE__ */
|
|
22952
|
+
/* @__PURE__ */ React211.createElement(
|
|
22881
22953
|
"path",
|
|
22882
22954
|
{
|
|
22883
22955
|
d: "M15.7928 17.0056L16.5223 15.4765L18.28 16.2762L15.7928 17.0056Z",
|
|
@@ -22888,7 +22960,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
22888
22960
|
strokeLinejoin: "round"
|
|
22889
22961
|
}
|
|
22890
22962
|
),
|
|
22891
|
-
/* @__PURE__ */
|
|
22963
|
+
/* @__PURE__ */ React211.createElement(
|
|
22892
22964
|
"path",
|
|
22893
22965
|
{
|
|
22894
22966
|
d: "M9.38606 21.7426L9.80791 18.1745L7.05712 18.2536L9.38606 21.7426Z",
|
|
@@ -22899,7 +22971,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
22899
22971
|
strokeLinejoin: "round"
|
|
22900
22972
|
}
|
|
22901
22973
|
),
|
|
22902
|
-
/* @__PURE__ */
|
|
22974
|
+
/* @__PURE__ */ React211.createElement(
|
|
22903
22975
|
"path",
|
|
22904
22976
|
{
|
|
22905
22977
|
d: "M18.1921 18.1745L18.6139 21.7426L20.9429 18.2536L18.1921 18.1745Z",
|
|
@@ -22910,7 +22982,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
22910
22982
|
strokeLinejoin: "round"
|
|
22911
22983
|
}
|
|
22912
22984
|
),
|
|
22913
|
-
/* @__PURE__ */
|
|
22985
|
+
/* @__PURE__ */ React211.createElement(
|
|
22914
22986
|
"path",
|
|
22915
22987
|
{
|
|
22916
22988
|
d: "M20.2837 14.2461L15.3446 14.4658L15.8016 17.0057L16.5311 15.4765L18.2888 16.2762L20.2837 14.2461Z",
|
|
@@ -22921,7 +22993,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
22921
22993
|
strokeLinejoin: "round"
|
|
22922
22994
|
}
|
|
22923
22995
|
),
|
|
22924
|
-
/* @__PURE__ */
|
|
22996
|
+
/* @__PURE__ */ React211.createElement(
|
|
22925
22997
|
"path",
|
|
22926
22998
|
{
|
|
22927
22999
|
d: "M9.72002 16.2762L11.4777 15.4765L12.1984 17.0057L12.6642 14.4658L7.71626 14.2461L9.72002 16.2762Z",
|
|
@@ -22932,7 +23004,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
22932
23004
|
strokeLinejoin: "round"
|
|
22933
23005
|
}
|
|
22934
23006
|
),
|
|
22935
|
-
/* @__PURE__ */
|
|
23007
|
+
/* @__PURE__ */ React211.createElement(
|
|
22936
23008
|
"path",
|
|
22937
23009
|
{
|
|
22938
23010
|
d: "M7.71626 14.2461L9.79033 18.2888L9.72002 16.2762L7.71626 14.2461Z",
|
|
@@ -22943,7 +23015,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
22943
23015
|
strokeLinejoin: "round"
|
|
22944
23016
|
}
|
|
22945
23017
|
),
|
|
22946
|
-
/* @__PURE__ */
|
|
23018
|
+
/* @__PURE__ */ React211.createElement(
|
|
22947
23019
|
"path",
|
|
22948
23020
|
{
|
|
22949
23021
|
d: "M18.2888 16.2762L18.2009 18.2888L20.2837 14.2461L18.2888 16.2762Z",
|
|
@@ -22954,7 +23026,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
22954
23026
|
strokeLinejoin: "round"
|
|
22955
23027
|
}
|
|
22956
23028
|
),
|
|
22957
|
-
/* @__PURE__ */
|
|
23029
|
+
/* @__PURE__ */ React211.createElement(
|
|
22958
23030
|
"path",
|
|
22959
23031
|
{
|
|
22960
23032
|
d: "M12.6642 14.4658L12.1984 17.0057L12.7784 20.0025L12.9102 16.0565L12.6642 14.4658Z",
|
|
@@ -22965,7 +23037,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
22965
23037
|
strokeLinejoin: "round"
|
|
22966
23038
|
}
|
|
22967
23039
|
),
|
|
22968
|
-
/* @__PURE__ */
|
|
23040
|
+
/* @__PURE__ */ React211.createElement(
|
|
22969
23041
|
"path",
|
|
22970
23042
|
{
|
|
22971
23043
|
d: "M15.3446 14.4658L15.1073 16.0477L15.2128 20.0025L15.8016 17.0057L15.3446 14.4658Z",
|
|
@@ -22976,7 +23048,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
22976
23048
|
strokeLinejoin: "round"
|
|
22977
23049
|
}
|
|
22978
23050
|
),
|
|
22979
|
-
/* @__PURE__ */
|
|
23051
|
+
/* @__PURE__ */ React211.createElement(
|
|
22980
23052
|
"path",
|
|
22981
23053
|
{
|
|
22982
23054
|
d: "M15.8016 17.0056L15.2128 20.0025L15.6347 20.2925L18.2009 18.2888L18.2888 16.2762L15.8016 17.0056Z",
|
|
@@ -22987,7 +23059,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
22987
23059
|
strokeLinejoin: "round"
|
|
22988
23060
|
}
|
|
22989
23061
|
),
|
|
22990
|
-
/* @__PURE__ */
|
|
23062
|
+
/* @__PURE__ */ React211.createElement(
|
|
22991
23063
|
"path",
|
|
22992
23064
|
{
|
|
22993
23065
|
d: "M9.72002 16.2762L9.79033 18.2888L12.3566 20.2925L12.7784 20.0025L12.1984 17.0056L9.72002 16.2762Z",
|
|
@@ -22998,7 +23070,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
22998
23070
|
strokeLinejoin: "round"
|
|
22999
23071
|
}
|
|
23000
23072
|
),
|
|
23001
|
-
/* @__PURE__ */
|
|
23073
|
+
/* @__PURE__ */ React211.createElement(
|
|
23002
23074
|
"path",
|
|
23003
23075
|
{
|
|
23004
23076
|
d: "M15.8456 23.0521L15.8719 22.2348L15.6522 22.0414H12.339L12.1368 22.2348L12.1544 23.0521L9.38606 21.7426L10.3528 22.5336L12.3126 23.8958H15.6786L17.6472 22.5336L18.6139 21.7426L15.8456 23.0521Z",
|
|
@@ -23009,7 +23081,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
23009
23081
|
strokeLinejoin: "round"
|
|
23010
23082
|
}
|
|
23011
23083
|
),
|
|
23012
|
-
/* @__PURE__ */
|
|
23084
|
+
/* @__PURE__ */ React211.createElement(
|
|
23013
23085
|
"path",
|
|
23014
23086
|
{
|
|
23015
23087
|
d: "M15.6347 20.2925L15.2128 20.0025H12.7784L12.3566 20.2925L12.1368 22.2348L12.339 22.0414H15.6522L15.8719 22.2348L15.6347 20.2925Z",
|
|
@@ -23020,7 +23092,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
23020
23092
|
strokeLinejoin: "round"
|
|
23021
23093
|
}
|
|
23022
23094
|
),
|
|
23023
|
-
/* @__PURE__ */
|
|
23095
|
+
/* @__PURE__ */ React211.createElement(
|
|
23024
23096
|
"path",
|
|
23025
23097
|
{
|
|
23026
23098
|
d: "M24.4583 10.0364L25.2053 6.45072L24.0891 3.1199L15.6347 9.39485L18.8864 12.1456L23.4827 13.4903L24.5022 12.3038L24.0628 11.9874L24.7658 11.3459L24.221 10.924L24.924 10.3879L24.4583 10.0364Z",
|
|
@@ -23031,7 +23103,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
23031
23103
|
strokeLinejoin: "round"
|
|
23032
23104
|
}
|
|
23033
23105
|
),
|
|
23034
|
-
/* @__PURE__ */
|
|
23106
|
+
/* @__PURE__ */ React211.createElement(
|
|
23035
23107
|
"path",
|
|
23036
23108
|
{
|
|
23037
23109
|
d: "M2.79472 6.45072L3.54174 10.0364L3.06717 10.3879L3.77024 10.924L3.23415 11.3459L3.93722 11.9874L3.4978 12.3038L4.50847 13.4903L9.10483 12.1456L12.3566 9.39485L3.90207 3.1199L2.79472 6.45072Z",
|
|
@@ -23042,7 +23114,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
23042
23114
|
strokeLinejoin: "round"
|
|
23043
23115
|
}
|
|
23044
23116
|
),
|
|
23045
|
-
/* @__PURE__ */
|
|
23117
|
+
/* @__PURE__ */ React211.createElement(
|
|
23046
23118
|
"path",
|
|
23047
23119
|
{
|
|
23048
23120
|
d: "M23.4827 13.4903L18.8864 12.1456L20.2837 14.2461L18.2009 18.2888L20.9429 18.2536H25.0295L23.4827 13.4903Z",
|
|
@@ -23053,7 +23125,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
23053
23125
|
strokeLinejoin: "round"
|
|
23054
23126
|
}
|
|
23055
23127
|
),
|
|
23056
|
-
/* @__PURE__ */
|
|
23128
|
+
/* @__PURE__ */ React211.createElement(
|
|
23057
23129
|
"path",
|
|
23058
23130
|
{
|
|
23059
23131
|
d: "M9.10484 12.1456L4.50848 13.4903L2.97929 18.2536H7.05713L9.79033 18.2888L7.71626 14.2461L9.10484 12.1456Z",
|
|
@@ -23064,7 +23136,7 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
23064
23136
|
strokeLinejoin: "round"
|
|
23065
23137
|
}
|
|
23066
23138
|
),
|
|
23067
|
-
/* @__PURE__ */
|
|
23139
|
+
/* @__PURE__ */ React211.createElement(
|
|
23068
23140
|
"path",
|
|
23069
23141
|
{
|
|
23070
23142
|
d: "M15.3446 14.4658L15.6347 9.39485L16.9705 5.7828H11.0383L12.3566 9.39485L12.6642 14.4658L12.7696 16.0653L12.7784 20.0025H15.2128L15.2304 16.0653L15.3446 14.4658Z",
|
|
@@ -23078,14 +23150,14 @@ function MetaMaskPaymentIcon({ size = 16 }) {
|
|
|
23078
23150
|
);
|
|
23079
23151
|
}
|
|
23080
23152
|
function MastercardPaymentIcon({ size = 16 }) {
|
|
23081
|
-
return /* @__PURE__ */
|
|
23153
|
+
return /* @__PURE__ */ React211.createElement(
|
|
23082
23154
|
"svg",
|
|
23083
23155
|
{
|
|
23084
23156
|
xmlns: "http://www.w3.org/2000/svg",
|
|
23085
23157
|
height: size,
|
|
23086
23158
|
viewBox: "0 0 152.407 108"
|
|
23087
23159
|
},
|
|
23088
|
-
/* @__PURE__ */
|
|
23160
|
+
/* @__PURE__ */ React211.createElement("g", null, /* @__PURE__ */ React211.createElement("rect", { width: "152.407", height: "108", fill: "transparent" }), /* @__PURE__ */ React211.createElement("g", null, /* @__PURE__ */ React211.createElement(
|
|
23089
23161
|
"rect",
|
|
23090
23162
|
{
|
|
23091
23163
|
x: "60.4117",
|
|
@@ -23094,21 +23166,21 @@ function MastercardPaymentIcon({ size = 16 }) {
|
|
|
23094
23166
|
height: "56.6064",
|
|
23095
23167
|
fill: "#ff5f00"
|
|
23096
23168
|
}
|
|
23097
|
-
), /* @__PURE__ */
|
|
23169
|
+
), /* @__PURE__ */ React211.createElement(
|
|
23098
23170
|
"path",
|
|
23099
23171
|
{
|
|
23100
23172
|
d: "M382.20839,306a35.9375,35.9375,0,0,1,13.7499-28.3032,36,36,0,1,0,0,56.6064A35.938,35.938,0,0,1,382.20839,306Z",
|
|
23101
23173
|
transform: "translate(-319.79649 -252)",
|
|
23102
23174
|
fill: "#eb001b"
|
|
23103
23175
|
}
|
|
23104
|
-
), /* @__PURE__ */
|
|
23176
|
+
), /* @__PURE__ */ React211.createElement(
|
|
23105
23177
|
"path",
|
|
23106
23178
|
{
|
|
23107
23179
|
d: "M454.20349,306a35.99867,35.99867,0,0,1-58.2452,28.3032,36.00518,36.00518,0,0,0,0-56.6064A35.99867,35.99867,0,0,1,454.20349,306Z",
|
|
23108
23180
|
transform: "translate(-319.79649 -252)",
|
|
23109
23181
|
fill: "#f79e1b"
|
|
23110
23182
|
}
|
|
23111
|
-
), /* @__PURE__ */
|
|
23183
|
+
), /* @__PURE__ */ React211.createElement(
|
|
23112
23184
|
"path",
|
|
23113
23185
|
{
|
|
23114
23186
|
d: "M450.76889,328.3077v-1.1589h.4673v-.2361h-1.1901v.2361h.4675v1.1589Zm2.3105,0v-1.3973h-.3648l-.41959.9611-.41971-.9611h-.365v1.3973h.2576v-1.054l.3935.9087h.2671l.39351-.911v1.0563Z",
|
|
@@ -23122,7 +23194,7 @@ function FunkitPaymentsIconLine({
|
|
|
23122
23194
|
size = 16,
|
|
23123
23195
|
gap = "2"
|
|
23124
23196
|
}) {
|
|
23125
|
-
return /* @__PURE__ */
|
|
23197
|
+
return /* @__PURE__ */ React211.createElement(
|
|
23126
23198
|
Box,
|
|
23127
23199
|
{
|
|
23128
23200
|
display: "flex",
|
|
@@ -23131,9 +23203,9 @@ function FunkitPaymentsIconLine({
|
|
|
23131
23203
|
alignItems: "center",
|
|
23132
23204
|
justifyContent: "center"
|
|
23133
23205
|
},
|
|
23134
|
-
/* @__PURE__ */
|
|
23135
|
-
/* @__PURE__ */
|
|
23136
|
-
/* @__PURE__ */
|
|
23206
|
+
/* @__PURE__ */ React211.createElement(MetaMaskPaymentIcon, { size }),
|
|
23207
|
+
/* @__PURE__ */ React211.createElement(MastercardPaymentIcon, { size }),
|
|
23208
|
+
/* @__PURE__ */ React211.createElement(CoinbaseIcon, { size })
|
|
23137
23209
|
);
|
|
23138
23210
|
}
|
|
23139
23211
|
|
|
@@ -23192,7 +23264,7 @@ var useUpdateActiveFunkitCheckout = () => {
|
|
|
23192
23264
|
|
|
23193
23265
|
// src/providers/FunkitProvider.tsx
|
|
23194
23266
|
import { QueryClientProvider } from "@tanstack/react-query";
|
|
23195
|
-
import
|
|
23267
|
+
import React212, { createContext as createContext20, useContext as useContext20 } from "react";
|
|
23196
23268
|
import { WagmiProvider, useAccountEffect as useAccountEffect3 } from "wagmi";
|
|
23197
23269
|
|
|
23198
23270
|
// src/utils/funkitProvider.ts
|
|
@@ -23270,26 +23342,26 @@ function validateFunkitProviderProps(props) {
|
|
|
23270
23342
|
}
|
|
23271
23343
|
|
|
23272
23344
|
// src/providers/useFingerprint.ts
|
|
23273
|
-
import { useCallback as useCallback44, useEffect as
|
|
23345
|
+
import { useCallback as useCallback44, useEffect as useEffect47 } from "react";
|
|
23274
23346
|
var storageKey5 = "funkit-connect-version";
|
|
23275
23347
|
function setFunkitConnectVersion({ version }) {
|
|
23276
23348
|
localStorage.setItem(storageKey5, version);
|
|
23277
23349
|
}
|
|
23278
23350
|
function getCurrentSdkVersion() {
|
|
23279
|
-
return "5.0.
|
|
23351
|
+
return "5.0.5";
|
|
23280
23352
|
}
|
|
23281
23353
|
function useFingerprint() {
|
|
23282
23354
|
const fingerprint = useCallback44(() => {
|
|
23283
23355
|
setFunkitConnectVersion({ version: getCurrentSdkVersion() });
|
|
23284
23356
|
}, []);
|
|
23285
|
-
|
|
23357
|
+
useEffect47(() => {
|
|
23286
23358
|
fingerprint();
|
|
23287
23359
|
}, [fingerprint]);
|
|
23288
23360
|
}
|
|
23289
23361
|
|
|
23290
23362
|
// src/providers/usePreloadImages.ts
|
|
23291
23363
|
import { isNotNullish as isNotNullish14 } from "@funkit/utils";
|
|
23292
|
-
import { useCallback as useCallback45, useEffect as
|
|
23364
|
+
import { useCallback as useCallback45, useEffect as useEffect48 } from "react";
|
|
23293
23365
|
function usePreloadImages() {
|
|
23294
23366
|
const funkitConnectChains = useFunkitConnectChains();
|
|
23295
23367
|
const walletConnectors = useWalletConnectors();
|
|
@@ -23299,7 +23371,7 @@ function usePreloadImages() {
|
|
|
23299
23371
|
...funkitConnectChains.map((chain) => chain.iconUrl).filter(isNotNullish14)
|
|
23300
23372
|
);
|
|
23301
23373
|
}, [walletConnectors, funkitConnectChains]);
|
|
23302
|
-
|
|
23374
|
+
useEffect48(() => {
|
|
23303
23375
|
preloadImages();
|
|
23304
23376
|
}, [preloadImages]);
|
|
23305
23377
|
}
|
|
@@ -23327,7 +23399,7 @@ function FunkitProvider(props) {
|
|
|
23327
23399
|
!!props.debug,
|
|
23328
23400
|
getCurrentSdkVersion()
|
|
23329
23401
|
);
|
|
23330
|
-
const MainChild = /* @__PURE__ */
|
|
23402
|
+
const MainChild = /* @__PURE__ */ React212.createElement(FunkitThemeProvider, { theme: props.theme }, /* @__PURE__ */ React212.createElement(
|
|
23331
23403
|
FunkitProviderInner,
|
|
23332
23404
|
{
|
|
23333
23405
|
avatar: props.avatar,
|
|
@@ -23340,7 +23412,7 @@ function FunkitProvider(props) {
|
|
|
23340
23412
|
},
|
|
23341
23413
|
props.children
|
|
23342
23414
|
));
|
|
23343
|
-
return finalWagmiConfig && finalQueryClient ? /* @__PURE__ */
|
|
23415
|
+
return finalWagmiConfig && finalQueryClient ? /* @__PURE__ */ React212.createElement(WagmiProvider, { config: finalWagmiConfig }, /* @__PURE__ */ React212.createElement(QueryClientProvider, { client: finalQueryClient }, MainChild)) : MainChild;
|
|
23344
23416
|
}
|
|
23345
23417
|
function FunkitProviderInner({
|
|
23346
23418
|
avatar,
|
|
@@ -23360,7 +23432,7 @@ function FunkitProviderInner({
|
|
|
23360
23432
|
const avatarContext = avatar ?? defaultAvatar;
|
|
23361
23433
|
const isSandboxMode = !!sandbox;
|
|
23362
23434
|
const modalSizeFinal = modalSize || ModalSizeOptions.COMPACT;
|
|
23363
|
-
return /* @__PURE__ */
|
|
23435
|
+
return /* @__PURE__ */ React212.createElement(FunkitConfigContext.Provider, { value: funkitConfig }, /* @__PURE__ */ React212.createElement(FunkitConnectChainProvider, { initialChain }, /* @__PURE__ */ React212.createElement(ModalSizeProvider, { modalSize: modalSizeFinal }, /* @__PURE__ */ React212.createElement(FunkitWeb2Provider, null, /* @__PURE__ */ React212.createElement(GeneralWalletProvider, null, /* @__PURE__ */ React212.createElement(FunkitFlagsProvider, null, /* @__PURE__ */ React212.createElement(FunkitCheckoutHistoryProvider, null, /* @__PURE__ */ React212.createElement(FunkitCheckoutProvider, null, /* @__PURE__ */ React212.createElement(FunkitQuoteProvider, null, /* @__PURE__ */ React212.createElement(FunkitSandboxContext.Provider, { value: isSandboxMode }, /* @__PURE__ */ React212.createElement(FunkitMeshProvider, null, /* @__PURE__ */ React212.createElement(AvatarContext.Provider, { value: avatarContext }, /* @__PURE__ */ React212.createElement(ThemeIdContext2.Provider, { value: id }, /* @__PURE__ */ React212.createElement(ShowBalanceProvider, null, /* @__PURE__ */ React212.createElement(FunkitMoonpayProvider, { debug: !!debug }, /* @__PURE__ */ React212.createElement(UserPresenceProvider, null, /* @__PURE__ */ React212.createElement(ModalProvider, null, activeTheme ? /* @__PURE__ */ React212.createElement(
|
|
23364
23436
|
"div",
|
|
23365
23437
|
{
|
|
23366
23438
|
...createThemeRootProps2(id),
|
|
@@ -23369,7 +23441,7 @@ function FunkitProviderInner({
|
|
|
23369
23441
|
height: "100%"
|
|
23370
23442
|
}
|
|
23371
23443
|
},
|
|
23372
|
-
/* @__PURE__ */
|
|
23444
|
+
/* @__PURE__ */ React212.createElement(
|
|
23373
23445
|
"style",
|
|
23374
23446
|
{
|
|
23375
23447
|
dangerouslySetInnerHTML: {
|