@funkit/connect 3.4.3 → 3.4.4

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/dist/index.js CHANGED
@@ -2149,6 +2149,10 @@ var useFunkitAccount = () => {
2149
2149
  isWeb3Login
2150
2150
  };
2151
2151
  };
2152
+ var useFunkitUserInfo = () => {
2153
+ const { userInfo } = useContext6(GeneralWalletContext);
2154
+ return userInfo;
2155
+ };
2152
2156
  var useFunkitDisconnect = () => {
2153
2157
  const disconnectReturn = useDisconnect();
2154
2158
  const { handleLogout } = useContext6(GeneralWalletContext);
@@ -4464,6 +4468,7 @@ function FunkitCheckoutProvider({ children }) {
4464
4468
  const shouldUpdateCheckoutItemAmount = isCheckoutCrFlow(checkoutItem) || !isCheckoutPostActionRequired(config);
4465
4469
  return {
4466
4470
  initSettings: {
4471
+ ...checkoutItem.initSettings,
4467
4472
  config: {
4468
4473
  ...config,
4469
4474
  checkoutItemAmount: shouldUpdateCheckoutItemAmount ? newTargetAssetAmount : config.checkoutItemAmount,
@@ -5220,6 +5225,15 @@ import { keepPreviousData, useQuery as useQuery2 } from "@tanstack/react-query";
5220
5225
  import { polygon } from "viem/chains";
5221
5226
  import { useAccount as useAccount4 } from "wagmi";
5222
5227
 
5228
+ // src/utils/assets.ts
5229
+ import {
5230
+ dydxChain as dydxChain2,
5231
+ FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO6,
5232
+ STABLECOIN_SYMBOLS
5233
+ } from "@funkit/core";
5234
+ import { formatUnits } from "viem";
5235
+ import { arbitrum, mainnet as mainnet4, mantle, zkSync as zkSync2 } from "viem/chains";
5236
+
5223
5237
  // src/utils/combineChainSymbolOrAddress.ts
5224
5238
  function combineChainSymbolOrAddress({
5225
5239
  chainId,
@@ -5229,168 +5243,434 @@ function combineChainSymbolOrAddress({
5229
5243
  return `${chainId}|${symbolOrAddress}`;
5230
5244
  }
5231
5245
 
5232
- // src/hooks/useWalletAssets.ts
5233
- var FETCH_ASSETS_INTERVAL_MS = 6e4;
5234
- function assetIsKnownAsset(asset) {
5235
- return asset.totalUsdValue !== null && asset.price !== null;
5236
- }
5237
- var POLYGON_USDCE_TOKEN = "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174";
5238
- function normalizeAssetSymbol(asset) {
5239
- if (asset.chainId === polygon.id.toString() && asset.contractAddress === POLYGON_USDCE_TOKEN) {
5240
- return { ...asset, symbol: "USDC.e" };
5241
- }
5242
- return asset;
5243
- }
5244
- function combineAssets(assets) {
5245
- const combinedAssets = {};
5246
- for (const chainAssets of Object.values(assets)) {
5247
- for (const [currentAddress, asset] of Object.entries(chainAssets)) {
5248
- if (!assetIsKnownAsset(asset)) {
5249
- continue;
5250
- }
5251
- const normalizedAsset = normalizeAssetSymbol(asset);
5252
- const chainAddress = combineChainSymbolOrAddress({
5253
- chainId: normalizedAsset.chainId,
5254
- symbolOrAddress: currentAddress
5255
- });
5256
- if (!chainAddress) {
5257
- continue;
5258
- }
5259
- combinedAssets[chainAddress] = normalizedAsset;
5260
- }
5261
- }
5262
- return combinedAssets;
5263
- }
5264
- async function fetchAssets(address, apiKey) {
5265
- if (address === void 0) {
5266
- return void 0;
5267
- }
5268
- const assets = await getAllWalletTokens({
5269
- walletAddress: address,
5270
- onlyVerifiedTokens: true,
5271
- apiKey,
5272
- signal: singletonAssetAbort.getAbortSignal()
5273
- }).catch((err) => {
5274
- logger.error("_fetchAssetsIfPossible:error", err);
5275
- throw err;
5276
- });
5277
- const assetsCombined = combineAssets(assets);
5278
- const totalWalletAssetsUsd = Object.values(assetsCombined).reduce(
5279
- (acc, asset) => acc + (asset.totalUsdValue ?? 0),
5280
- 0
5246
+ // src/utils/assets.ts
5247
+ var ASSETS_LOW_VALUE_THRESHOLD = 0.1;
5248
+ var getNormalizedTokenBalance = (tokenBalance, decimals) => {
5249
+ return Number(formatUnits(BigInt(tokenBalance), decimals));
5250
+ };
5251
+ var isAssetUsableToPayForCheckout = (flags, checkoutItem, paymentMethod, assetChainId, assetTokenAddress, isWeb2Login, isWeb3Login) => {
5252
+ const targetChainId = checkoutItem.initSettings.config.targetChain;
5253
+ const isSameAsPurchasingToken = !isCheckoutPostActionRequired(checkoutItem.initSettings.config) && // however, if the destination is custom recipient address, it is possible to transfer money
5254
+ // TODO: this is not 100% correct, should also check if sourceAddr != customRecipientAddr
5255
+ !isCheckoutCrFlow(checkoutItem) && paymentMethod === "balance" /* ACCOUNT_BALANCE */ && targetChainId === assetChainId && checkoutItem.initSettings.config.targetAsset.toLowerCase() === assetTokenAddress.toLowerCase();
5256
+ const isConnectedAccountSupported = (
5257
+ // User is logged in with web2, ensure that the chain is supported for FunWallet
5258
+ isWeb2Login && FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO6[assetChainId].isFunWalletSupported || // User is logged in with web3 or not logged in at all, ignore
5259
+ isWeb3Login || !isWeb2Login && !isWeb3Login
5260
+ );
5261
+ const isZkSyncAssetsDisabled = flags["disable_zksync_source_assets" /* DisableZkSyncSourceAssets */] ?? true;
5262
+ const isMantleAssetsDisabled = flags["disable_mantle_source_assets" /* DisableMantleSourceAssets */] ?? true;
5263
+ const isAssetDisabled = (
5264
+ // Disable all mantle assets
5265
+ isMantleAssetsDisabled && assetChainId === mantle.id.toString() || // Disable all zksync assets
5266
+ isZkSyncAssetsDisabled && assetChainId === zkSync2.id.toString()
5281
5267
  );
5268
+ const isPickedChainSupportedForCheckout = isConnectedAccountSupported && FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO6[assetChainId].isCheckoutSupported && !isAssetDisabled;
5269
+ const isUsable = !isSameAsPurchasingToken && isPickedChainSupportedForCheckout;
5282
5270
  return {
5283
- walletAssets: assetsCombined,
5284
- totalWalletAssetsUsd
5271
+ isUsable,
5272
+ reason: isUsable ? "" : isSameAsPurchasingToken ? "Not Applicable" : !isPickedChainSupportedForCheckout ? "Unsupported" : ""
5285
5273
  };
5286
- }
5287
- var useWalletAssets = ({
5288
- enableRefetchInterval = true,
5289
- refetchOnMount = true
5274
+ };
5275
+ var getAssetSymbolWithMaxUsdValue = ({
5276
+ accountHoldingsMap,
5277
+ filterSymbols
5290
5278
  }) => {
5291
- const { address, isConnected } = useAccount4();
5292
- const { apiKey } = useFunkitConfig();
5293
- const { data, isLoading, isFetching } = useQuery2({
5294
- queryKey: ["getWalletAssets", address, apiKey],
5295
- queryFn: ({ queryKey: [_, addr, key] }) => fetchAssets(addr, key),
5296
- placeholderData: keepPreviousData,
5297
- enabled: address !== void 0 && isConnected,
5298
- refetchOnMount,
5299
- refetchInterval: enableRefetchInterval ? FETCH_ASSETS_INTERVAL_MS : void 0
5300
- });
5301
- return {
5302
- walletAssets: data?.walletAssets,
5303
- totalWalletAssetsUsd: data?.totalWalletAssetsUsd ?? 0,
5304
- isLoading,
5305
- isFetching
5306
- };
5279
+ return Object.keys(accountHoldingsMap).filter(
5280
+ (symbol) => filterSymbols === void 0 || filterSymbols?.includes(symbol)
5281
+ ).reduce((max, current) => {
5282
+ const currentItem = accountHoldingsMap[current];
5283
+ if (!currentItem || !isNotNullish(currentItem.usdAmount)) {
5284
+ return max;
5285
+ }
5286
+ if (max === null) {
5287
+ return current;
5288
+ }
5289
+ const maxItem = accountHoldingsMap[max];
5290
+ if (isNotNullish(maxItem?.usdAmount)) {
5291
+ return maxItem.usdAmount > currentItem.usdAmount ? max : current;
5292
+ }
5293
+ return max;
5294
+ }, null);
5307
5295
  };
5308
-
5309
- // src/modals/FunCheckoutHistoryModal/FunCheckoutHistoryTransaction.tsx
5310
- import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO6 } from "@funkit/core";
5311
- import { useEffect as useEffect20, useRef as useRef7 } from "react";
5312
- import React99, { useState as useState21 } from "react";
5313
-
5314
- // src/components/AsyncImage/AsyncImage.tsx
5315
- import React35, { useMemo as useMemo7, useReducer as useReducer2, useState as useState12 } from "react";
5316
-
5317
- // src/components/AsyncImage/useAsyncImage.ts
5318
- import { useEffect as useEffect13, useReducer } from "react";
5319
- var cachedUrls = /* @__PURE__ */ new Map();
5320
- var cachedRequestPromises = /* @__PURE__ */ new Map();
5321
- async function loadAsyncImage(asyncImage) {
5322
- const cachedRequestPromise = cachedRequestPromises.get(asyncImage);
5323
- if (cachedRequestPromise) {
5324
- return cachedRequestPromise;
5296
+ var L1_FEES_ESTIMATE = 20;
5297
+ var L2_FEES_ESTIMATE = 1;
5298
+ var L2_COST_MARGIN_MULTIPLIER = 1.2;
5299
+ var MESH_L1_FEES_ESTIMATE = 8;
5300
+ var MESH_L2_FEES_ESTIMATE = 2;
5301
+ var MESH_CUSTOM_CLIENT_FEE_PERCENT = 0.055;
5302
+ var getMeshFeesUsdEstimate = (asset) => {
5303
+ let meshFeeEstimate = 0;
5304
+ meshFeeEstimate += (asset.usdAmount || 0) * MESH_CUSTOM_CLIENT_FEE_PERCENT;
5305
+ const sourceChainId = asset.pickedChainId;
5306
+ if (sourceChainId === mainnet4.id.toString()) {
5307
+ meshFeeEstimate += MESH_L1_FEES_ESTIMATE;
5308
+ } else {
5309
+ meshFeeEstimate += MESH_L2_FEES_ESTIMATE;
5325
5310
  }
5326
- const load = async () => asyncImage().then(async (url) => {
5327
- cachedUrls.set(asyncImage, url);
5328
- return url;
5329
- });
5330
- const requestPromise = load().catch(() => {
5331
- return load().catch(() => {
5332
- cachedRequestPromises.delete(asyncImage);
5333
- });
5311
+ return meshFeeEstimate;
5312
+ };
5313
+ var getBaseFeeUsdEstimate = (checkoutItem, asset) => {
5314
+ const targetChainId = checkoutItem.initSettings.config.targetChain;
5315
+ const sourceChainId = asset.pickedChainId;
5316
+ if (targetChainId !== mainnet4.id.toString() && sourceChainId !== mainnet4.id.toString()) {
5317
+ return L2_FEES_ESTIMATE;
5318
+ } else {
5319
+ return L1_FEES_ESTIMATE;
5320
+ }
5321
+ };
5322
+ var getFeesUsdEstimate = (checkoutItem, asset) => {
5323
+ let feeEstimate = 0;
5324
+ feeEstimate += getBaseFeeUsdEstimate(checkoutItem, asset);
5325
+ if (checkoutItem.selectedPaymentMethodInfo?.paymentMethod === "brokerage" /* BROKERAGE */) {
5326
+ feeEstimate += getMeshFeesUsdEstimate(asset);
5327
+ }
5328
+ return feeEstimate;
5329
+ };
5330
+ var isAssetUsdAmountSufficient = (checkoutItem, asset) => {
5331
+ if (!isNotNullish(asset?.usdAmount)) {
5332
+ return false;
5333
+ }
5334
+ if (!isNotNullish(checkoutItem?.draftDollarValue)) {
5335
+ return false;
5336
+ }
5337
+ return asset.usdAmount > checkoutItem?.draftDollarValue + getFeesUsdEstimate(checkoutItem, asset);
5338
+ };
5339
+ var getRecommendedAsset = (flags, checkoutItem, accountHoldingsMap, isWeb3Login, isWeb2Login) => {
5340
+ const highestValueAssetSymbol = getAssetSymbolWithMaxUsdValue({
5341
+ accountHoldingsMap
5334
5342
  });
5335
- cachedRequestPromises.set(asyncImage, requestPromise);
5336
- return requestPromise;
5337
- }
5338
- async function loadImages(...urls) {
5339
- return await Promise.all(
5340
- urls.map((url) => typeof url === "function" ? loadAsyncImage(url) : url)
5343
+ if (!isNotNullish(highestValueAssetSymbol) || !isAssetUsdAmountSufficient(
5344
+ checkoutItem,
5345
+ accountHoldingsMap[highestValueAssetSymbol]
5346
+ )) {
5347
+ return null;
5348
+ }
5349
+ const assetsOnL1 = Object.keys(accountHoldingsMap)?.filter(
5350
+ (chainSymbolKey) => accountHoldingsMap[chainSymbolKey].pickedChainId === mainnet4.id.toString()
5341
5351
  );
5342
- }
5343
- function useForceUpdate() {
5344
- const [, forceUpdate] = useReducer((x) => x + 1, 0);
5345
- return forceUpdate;
5346
- }
5347
- function useAsyncImage(url) {
5348
- const cachedUrl = typeof url === "function" ? cachedUrls.get(url) : void 0;
5349
- const forceUpdate = useForceUpdate();
5350
- useEffect13(() => {
5351
- if (typeof url === "function" && !cachedUrl) {
5352
- loadAsyncImage(url).then(forceUpdate);
5353
- }
5354
- }, [url, cachedUrl, forceUpdate]);
5355
- return typeof url === "function" ? cachedUrl : url;
5356
- }
5357
-
5358
- // src/components/AsyncImage/AsyncImage.tsx
5359
- function useTriggeredOnce() {
5360
- return useReducer2(() => true, false);
5361
- }
5362
- function AsyncImage({
5363
- alt,
5364
- background,
5365
- borderColor,
5366
- borderRadius,
5367
- boxShadow,
5368
- height,
5369
- useAsImage,
5370
- src: srcProp,
5371
- fallbackSrc,
5372
- fallbackElement,
5373
- width,
5374
- testId
5375
- }) {
5376
- const src3 = useAsyncImage(srcProp || fallbackSrc);
5377
- const isRemoteImage = src3 !== void 0 && /^http/.test(src3);
5378
- const [isRemoteImageLoaded, setRemoteImageLoaded] = useTriggeredOnce();
5379
- const [hasError, setHasError] = useState12(
5380
- srcProp === void 0 && fallbackSrc === void 0
5352
+ const assetsOnL2 = Object.keys(accountHoldingsMap)?.filter(
5353
+ (chainSymbolKey) => accountHoldingsMap[chainSymbolKey].pickedChainId !== mainnet4.id.toString()
5381
5354
  );
5382
- const { asyncStyle, imgProps } = useMemo7(() => {
5383
- const asyncStyle2 = !useAsImage ? getRemoteImageStyles(isRemoteImage, isRemoteImageLoaded, src3) : {};
5384
- if (useAsImage || isRemoteImage) {
5385
- const imgProps2 = {
5386
- as: "img",
5387
- src: src3,
5388
- "aria-hidden": true,
5389
- onError: ({
5390
- currentTarget
5391
- }) => {
5392
- currentTarget.onerror = null;
5393
- if (fallbackSrc !== void 0) {
5355
+ const highestValueL1Asset = assetsOnL1.length ? getAssetSymbolWithMaxUsdValue({
5356
+ accountHoldingsMap,
5357
+ filterSymbols: assetsOnL1
5358
+ }) : null;
5359
+ const highestValueL2Asset = assetsOnL2.length ? getAssetSymbolWithMaxUsdValue({
5360
+ accountHoldingsMap,
5361
+ filterSymbols: assetsOnL2
5362
+ }) : null;
5363
+ if (!isNotNullish(highestValueL1Asset) && !isNotNullish(highestValueL2Asset)) {
5364
+ return null;
5365
+ }
5366
+ const highestValueL1UsdAmount = highestValueL1Asset ? accountHoldingsMap[highestValueL1Asset]?.usdAmount || 0 : null;
5367
+ const highestValueL2UsdAmount = highestValueL2Asset ? accountHoldingsMap[highestValueL2Asset]?.usdAmount || 0 : null;
5368
+ if (!isNotNullish(highestValueL1UsdAmount) && !isNotNullish(highestValueL2UsdAmount)) {
5369
+ return null;
5370
+ }
5371
+ const checkoutConfig = checkoutItem.initSettings.config;
5372
+ const targetChainId = getMockedTargetChainId(checkoutConfig, [
5373
+ dydxChain2.id.toString()
5374
+ ]);
5375
+ const targetChainIdAssetSymbol = Object.keys(accountHoldingsMap).find(
5376
+ (chainIdSymbol) => {
5377
+ const item = accountHoldingsMap[chainIdSymbol];
5378
+ if (item.pickedChainId === targetChainId && item.tokenAddress === checkoutConfig.targetAsset) {
5379
+ return chainIdSymbol;
5380
+ }
5381
+ return null;
5382
+ }
5383
+ );
5384
+ if (isCheckoutPostActionRequired(checkoutItem.initSettings.config) || isCheckoutCrFlow(checkoutItem)) {
5385
+ if (targetChainIdAssetSymbol && isAssetUsdAmountSufficient(
5386
+ checkoutItem,
5387
+ accountHoldingsMap[targetChainIdAssetSymbol]
5388
+ )) {
5389
+ return {
5390
+ symbol: targetChainIdAssetSymbol,
5391
+ label: "Cheapest"
5392
+ };
5393
+ }
5394
+ }
5395
+ const usableAssetHoldingMap = checkoutItem ? Object.fromEntries(
5396
+ Object.entries(accountHoldingsMap).filter(
5397
+ ([_, item]) => isAssetUsableToPayForCheckout(
5398
+ flags,
5399
+ checkoutItem,
5400
+ checkoutItem?.selectedPaymentMethodInfo?.paymentMethod,
5401
+ item.pickedChainId,
5402
+ item.tokenAddress,
5403
+ isWeb2Login,
5404
+ isWeb3Login
5405
+ ).isUsable
5406
+ )
5407
+ ) : {};
5408
+ const highestValueUsableAssetSymbol = getAssetSymbolWithMaxUsdValue({
5409
+ accountHoldingsMap: usableAssetHoldingMap
5410
+ });
5411
+ if (!isNotNullish(highestValueUsableAssetSymbol) || !isAssetUsdAmountSufficient(
5412
+ checkoutItem,
5413
+ usableAssetHoldingMap[highestValueUsableAssetSymbol]
5414
+ )) {
5415
+ return null;
5416
+ }
5417
+ const stableAssetOnTargetChainSymbols = STABLECOIN_SYMBOLS.map(
5418
+ (symbol) => combineChainSymbolOrAddress({
5419
+ chainId: targetChainId,
5420
+ symbolOrAddress: symbol
5421
+ })
5422
+ );
5423
+ const highestValueStableAssetOnTargetChain = getAssetSymbolWithMaxUsdValue({
5424
+ accountHoldingsMap: usableAssetHoldingMap,
5425
+ filterSymbols: stableAssetOnTargetChainSymbols.filter(
5426
+ (asset) => asset !== null
5427
+ )
5428
+ });
5429
+ if (isNotNullish(highestValueStableAssetOnTargetChain) && isAssetUsdAmountSufficient(
5430
+ checkoutItem,
5431
+ usableAssetHoldingMap[highestValueStableAssetOnTargetChain]
5432
+ )) {
5433
+ return {
5434
+ symbol: highestValueStableAssetOnTargetChain,
5435
+ label: "Cheapest"
5436
+ };
5437
+ }
5438
+ const targetChainIdEthSymbol = combineChainSymbolOrAddress({
5439
+ chainId: targetChainId,
5440
+ symbolOrAddress: "ETH"
5441
+ });
5442
+ if (isNotNullish(targetChainIdEthSymbol) && isAssetUsdAmountSufficient(
5443
+ checkoutItem,
5444
+ usableAssetHoldingMap[targetChainIdEthSymbol]
5445
+ )) {
5446
+ return {
5447
+ symbol: targetChainIdEthSymbol,
5448
+ label: "Cheapest"
5449
+ };
5450
+ }
5451
+ const targetChainCoreToken = targetChainId ? FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO6[targetChainId].coreToken : null;
5452
+ const targetChainIdAndCoreTokenSymbol = targetChainCoreToken?.symbol && combineChainSymbolOrAddress({
5453
+ chainId: targetChainId,
5454
+ symbolOrAddress: targetChainCoreToken?.symbol
5455
+ });
5456
+ if (isNotNullish(targetChainIdAndCoreTokenSymbol) && isAssetUsdAmountSufficient(
5457
+ checkoutItem,
5458
+ usableAssetHoldingMap[targetChainIdAndCoreTokenSymbol]
5459
+ )) {
5460
+ return {
5461
+ symbol: targetChainIdAndCoreTokenSymbol,
5462
+ label: "Cheapest"
5463
+ };
5464
+ }
5465
+ const highestValueUsableL2Asset = assetsOnL2.length ? getAssetSymbolWithMaxUsdValue({
5466
+ accountHoldingsMap: usableAssetHoldingMap,
5467
+ filterSymbols: assetsOnL2
5468
+ }) : null;
5469
+ const highestValueUsableL2UsdAmount = highestValueUsableL2Asset ? usableAssetHoldingMap[highestValueUsableL2Asset]?.usdAmount || 0 : null;
5470
+ if (targetChainId !== mainnet4.id.toString() && isNotNullish(highestValueUsableL2Asset) && isAssetUsdAmountSufficient(
5471
+ checkoutItem,
5472
+ usableAssetHoldingMap[highestValueUsableL2Asset]
5473
+ )) {
5474
+ return {
5475
+ symbol: highestValueUsableL2Asset,
5476
+ label: "Cheapest"
5477
+ };
5478
+ }
5479
+ const highestValueUsableAssetUsdAmount = highestValueUsableAssetSymbol ? usableAssetHoldingMap[highestValueUsableAssetSymbol]?.usdAmount || 0 : null;
5480
+ if (isNotNullish(highestValueUsableL2UsdAmount) && isNotNullish(highestValueUsableL2Asset) && highestValueUsableL2UsdAmount * L2_COST_MARGIN_MULTIPLIER > (highestValueUsableAssetUsdAmount || 0)) {
5481
+ return {
5482
+ symbol: highestValueUsableL2Asset,
5483
+ label: null
5484
+ };
5485
+ }
5486
+ return {
5487
+ symbol: highestValueUsableAssetSymbol,
5488
+ label: null
5489
+ };
5490
+ };
5491
+ var getTotalAssetBalance = (assets) => {
5492
+ const maxUsdBalance = Object.values(assets).reduce(
5493
+ (acc, { usdAmount }) => (usdAmount ?? 0) + acc,
5494
+ 0
5495
+ );
5496
+ return formatCurrencyAndStringify(maxUsdBalance);
5497
+ };
5498
+ var FALLBACK_CHAIN_ID = arbitrum.id.toString();
5499
+ var getMockedTargetChainId = ({ targetChain }, mockedChains = []) => {
5500
+ return mockedChains.includes(targetChain) ? FALLBACK_CHAIN_ID : targetChain;
5501
+ };
5502
+
5503
+ // src/hooks/useWalletAssets.ts
5504
+ var FETCH_ASSETS_INTERVAL_MS = 6e4;
5505
+ function assetIsKnownAsset(asset) {
5506
+ return asset.totalUsdValue !== null && asset.price !== null;
5507
+ }
5508
+ var POLYGON_USDCE_TOKEN = "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174";
5509
+ function normalizeAssetSymbol(asset) {
5510
+ if (asset.chainId === polygon.id.toString() && asset.contractAddress === POLYGON_USDCE_TOKEN) {
5511
+ return { ...asset, symbol: "USDC.e" };
5512
+ }
5513
+ return asset;
5514
+ }
5515
+ function combineAssets(assets) {
5516
+ const combinedAssets = {};
5517
+ for (const chainAssets of Object.values(assets)) {
5518
+ for (const [currentAddress, asset] of Object.entries(chainAssets)) {
5519
+ if (!assetIsKnownAsset(asset)) {
5520
+ continue;
5521
+ }
5522
+ const normalizedAsset = normalizeAssetSymbol(asset);
5523
+ const chainAddress = combineChainSymbolOrAddress({
5524
+ chainId: normalizedAsset.chainId,
5525
+ symbolOrAddress: currentAddress
5526
+ });
5527
+ if (!chainAddress) {
5528
+ continue;
5529
+ }
5530
+ combinedAssets[chainAddress] = normalizedAsset;
5531
+ }
5532
+ }
5533
+ return combinedAssets;
5534
+ }
5535
+ async function fetchAssets(address, apiKey) {
5536
+ if (address === void 0) {
5537
+ return void 0;
5538
+ }
5539
+ const assets = await getAllWalletTokens({
5540
+ walletAddress: address,
5541
+ onlyVerifiedTokens: true,
5542
+ apiKey,
5543
+ signal: singletonAssetAbort.getAbortSignal()
5544
+ }).catch((err) => {
5545
+ logger.error("_fetchAssetsIfPossible:error", err);
5546
+ throw err;
5547
+ });
5548
+ const assetsCombined = combineAssets(assets);
5549
+ const filteredAssetsCombined = Object.entries(assetsCombined).reduce(
5550
+ (acc, [address2, asset]) => {
5551
+ if (asset.totalUsdValue && asset.totalUsdValue >= ASSETS_LOW_VALUE_THRESHOLD) {
5552
+ acc[address2] = asset;
5553
+ }
5554
+ return acc;
5555
+ },
5556
+ {}
5557
+ );
5558
+ const totalWalletAssetsUsd = Object.values(filteredAssetsCombined).reduce(
5559
+ (acc, asset) => acc + (asset.totalUsdValue ?? 0),
5560
+ 0
5561
+ );
5562
+ return {
5563
+ walletAssets: filteredAssetsCombined,
5564
+ totalWalletAssetsUsd
5565
+ };
5566
+ }
5567
+ var useWalletAssets = ({
5568
+ enableRefetchInterval = true,
5569
+ refetchOnMount = true
5570
+ }) => {
5571
+ const { address, isConnected } = useAccount4();
5572
+ const { apiKey } = useFunkitConfig();
5573
+ const { data, isLoading, isFetching } = useQuery2({
5574
+ queryKey: ["getWalletAssets", address, apiKey],
5575
+ queryFn: ({ queryKey: [_, addr, key] }) => fetchAssets(addr, key),
5576
+ placeholderData: keepPreviousData,
5577
+ enabled: address !== void 0 && isConnected,
5578
+ refetchOnMount,
5579
+ refetchInterval: enableRefetchInterval ? FETCH_ASSETS_INTERVAL_MS : void 0
5580
+ });
5581
+ return {
5582
+ walletAssets: data?.walletAssets,
5583
+ totalWalletAssetsUsd: data?.totalWalletAssetsUsd ?? 0,
5584
+ isLoading,
5585
+ isFetching
5586
+ };
5587
+ };
5588
+
5589
+ // src/modals/FunCheckoutHistoryModal/FunCheckoutHistoryTransaction.tsx
5590
+ import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO7 } from "@funkit/core";
5591
+ import { useEffect as useEffect20, useRef as useRef7 } from "react";
5592
+ import React99, { useState as useState21 } from "react";
5593
+
5594
+ // src/components/AsyncImage/AsyncImage.tsx
5595
+ import React35, { useMemo as useMemo7, useReducer as useReducer2, useState as useState12 } from "react";
5596
+
5597
+ // src/components/AsyncImage/useAsyncImage.ts
5598
+ import { useEffect as useEffect13, useReducer } from "react";
5599
+ var cachedUrls = /* @__PURE__ */ new Map();
5600
+ var cachedRequestPromises = /* @__PURE__ */ new Map();
5601
+ async function loadAsyncImage(asyncImage) {
5602
+ const cachedRequestPromise = cachedRequestPromises.get(asyncImage);
5603
+ if (cachedRequestPromise) {
5604
+ return cachedRequestPromise;
5605
+ }
5606
+ const load = async () => asyncImage().then(async (url) => {
5607
+ cachedUrls.set(asyncImage, url);
5608
+ return url;
5609
+ });
5610
+ const requestPromise = load().catch(() => {
5611
+ return load().catch(() => {
5612
+ cachedRequestPromises.delete(asyncImage);
5613
+ });
5614
+ });
5615
+ cachedRequestPromises.set(asyncImage, requestPromise);
5616
+ return requestPromise;
5617
+ }
5618
+ async function loadImages(...urls) {
5619
+ return await Promise.all(
5620
+ urls.map((url) => typeof url === "function" ? loadAsyncImage(url) : url)
5621
+ );
5622
+ }
5623
+ function useForceUpdate() {
5624
+ const [, forceUpdate] = useReducer((x) => x + 1, 0);
5625
+ return forceUpdate;
5626
+ }
5627
+ function useAsyncImage(url) {
5628
+ const cachedUrl = typeof url === "function" ? cachedUrls.get(url) : void 0;
5629
+ const forceUpdate = useForceUpdate();
5630
+ useEffect13(() => {
5631
+ if (typeof url === "function" && !cachedUrl) {
5632
+ loadAsyncImage(url).then(forceUpdate);
5633
+ }
5634
+ }, [url, cachedUrl, forceUpdate]);
5635
+ return typeof url === "function" ? cachedUrl : url;
5636
+ }
5637
+
5638
+ // src/components/AsyncImage/AsyncImage.tsx
5639
+ function useTriggeredOnce() {
5640
+ return useReducer2(() => true, false);
5641
+ }
5642
+ function AsyncImage({
5643
+ alt,
5644
+ background,
5645
+ borderColor,
5646
+ borderRadius,
5647
+ boxShadow,
5648
+ height,
5649
+ useAsImage,
5650
+ src: srcProp,
5651
+ fallbackSrc,
5652
+ fallbackElement,
5653
+ width,
5654
+ testId
5655
+ }) {
5656
+ const src3 = useAsyncImage(srcProp || fallbackSrc);
5657
+ const isRemoteImage = src3 !== void 0 && /^http/.test(src3);
5658
+ const [isRemoteImageLoaded, setRemoteImageLoaded] = useTriggeredOnce();
5659
+ const [hasError, setHasError] = useState12(
5660
+ srcProp === void 0 && fallbackSrc === void 0
5661
+ );
5662
+ const { asyncStyle, imgProps } = useMemo7(() => {
5663
+ const asyncStyle2 = !useAsImage ? getRemoteImageStyles(isRemoteImage, isRemoteImageLoaded, src3) : {};
5664
+ if (useAsImage || isRemoteImage) {
5665
+ const imgProps2 = {
5666
+ as: "img",
5667
+ src: src3,
5668
+ "aria-hidden": true,
5669
+ onError: ({
5670
+ currentTarget
5671
+ }) => {
5672
+ currentTarget.onerror = null;
5673
+ if (fallbackSrc !== void 0) {
5394
5674
  currentTarget.src = fallbackSrc;
5395
5675
  } else {
5396
5676
  setHasError(true);
@@ -9632,7 +9912,7 @@ var AddressRedirectButton = ({
9632
9912
  chainId,
9633
9913
  address
9634
9914
  }) => {
9635
- const explorerInfo = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO6[chainId].explorerInfo;
9915
+ const explorerInfo = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO7[chainId].explorerInfo;
9636
9916
  return /* @__PURE__ */ React99.createElement(
9637
9917
  FunRedirectButton,
9638
9918
  {
@@ -11065,629 +11345,364 @@ function ActivityHistory({
11065
11345
  }
11066
11346
  });
11067
11347
  },
11068
- checkoutHistoryItem
11069
- }
11070
- ))) : /* @__PURE__ */ React115.createElement(Box, { paddingTop: "16" }, /* @__PURE__ */ React115.createElement(FunNotification, { description: "No activity yet." }))
11071
- ));
11072
- }
11073
-
11074
- // src/modals/ProfileDetails/FunProfileViews/Home/index.tsx
11075
- import clsx9 from "clsx";
11076
- import React124, { useMemo as useMemo18, useRef as useRef11, useState as useState28 } from "react";
11077
- import { Virtuoso } from "react-virtuoso";
11078
- import { useAccount as useAccount6 } from "wagmi";
11079
-
11080
- // src/components/Icons/GreenRoundCheckmark.tsx
11081
- import React116 from "react";
11082
- var GreenRoundCheckmark = ({ size = 15 }) => {
11083
- return /* @__PURE__ */ React116.createElement(
11084
- "svg",
11085
- {
11086
- width: size,
11087
- height: size,
11088
- viewBox: "0 0 10 11",
11089
- fill: "none",
11090
- xmlns: "http://www.w3.org/2000/svg"
11091
- },
11092
- /* @__PURE__ */ React116.createElement(
11093
- "path",
11094
- {
11095
- d: "M5 10.4551C4.31315 10.4551 3.66862 10.3249 3.06641 10.0645C2.46419 9.80729 1.93522 9.45085 1.47949 8.99512C1.02376 8.53613 0.66569 8.00716 0.405273 7.4082C0.148112 6.80599 0.0195312 6.16146 0.0195312 5.47461C0.0195312 4.78776 0.148112 4.14323 0.405273 3.54102C0.66569 2.9388 1.02376 2.40983 1.47949 1.9541C1.93522 1.49837 2.46419 1.14193 3.06641 0.884766C3.66862 0.624349 4.31315 0.494141 5 0.494141C5.68685 0.494141 6.33138 0.624349 6.93359 0.884766C7.53581 1.14193 8.06478 1.49837 8.52051 1.9541C8.97624 2.40983 9.33268 2.9388 9.58984 3.54102C9.85026 4.14323 9.98047 4.78776 9.98047 5.47461C9.98047 6.16146 9.85026 6.80599 9.58984 7.4082C9.33268 8.00716 8.97624 8.53613 8.52051 8.99512C8.06478 9.45085 7.53581 9.80729 6.93359 10.0645C6.33138 10.3249 5.68685 10.4551 5 10.4551ZM4.45312 7.85742C4.53776 7.85742 4.61426 7.83789 4.68262 7.79883C4.75098 7.75977 4.8112 7.70117 4.86328 7.62305L7.1582 4.00488C7.1875 3.95605 7.21517 3.90397 7.24121 3.84863C7.26725 3.79329 7.28027 3.73796 7.28027 3.68262C7.28027 3.56868 7.23796 3.47917 7.15332 3.41406C7.06868 3.3457 6.97428 3.31152 6.87012 3.31152C6.72689 3.31152 6.6097 3.38639 6.51855 3.53613L4.43359 6.88574L3.44238 5.60645C3.38053 5.52507 3.32031 5.46973 3.26172 5.44043C3.20638 5.41113 3.1429 5.39648 3.07129 5.39648C2.96061 5.39648 2.86784 5.43717 2.79297 5.51855C2.7181 5.59668 2.68066 5.69108 2.68066 5.80176C2.68066 5.8571 2.69043 5.91243 2.70996 5.96777C2.73275 6.01986 2.76204 6.07031 2.79785 6.11914L4.02344 7.62305C4.08854 7.70768 4.15527 7.7679 4.22363 7.80371C4.29199 7.83952 4.36849 7.85742 4.45312 7.85742Z",
11096
- fill: "#66CC00"
11097
- }
11098
- )
11099
- );
11100
- };
11101
-
11102
- // src/components/Icons/LogoutIcon.tsx
11103
- import React117 from "react";
11104
- var LogoutIcon = ({ size = 16 }) => {
11105
- return /* @__PURE__ */ React117.createElement(
11106
- "svg",
11107
- {
11108
- width: size,
11109
- height: size,
11110
- viewBox: "0 0 16 16",
11111
- fill: "none",
11112
- xmlns: "http://www.w3.org/2000/svg"
11113
- },
11114
- /* @__PURE__ */ React117.createElement(
11115
- "path",
11116
- {
11117
- d: "M9.33463 13.3337H4.0013C3.26492 13.3337 2.66797 12.7367 2.66797 12.0003V4.00033C2.66797 3.26395 3.26492 2.66699 4.0013 2.66699H9.33463M6.66797 8.00033H14.0013M14.0013 8.00033L12.0013 10.0003M14.0013 8.00033L12.0013 6.00033",
11118
- stroke: "currentColor",
11119
- strokeWidth: "1.33333",
11120
- strokeLinecap: "round",
11121
- strokeLinejoin: "round",
11122
- color: "currentColor"
11123
- }
11124
- )
11125
- );
11126
- };
11127
-
11128
- // src/components/Icons/SettingsIcon.tsx
11129
- import React118 from "react";
11130
- var SettingsIcon = ({ size = 16 }) => {
11131
- return /* @__PURE__ */ React118.createElement(
11132
- "svg",
11133
- {
11134
- width: size,
11135
- height: size,
11136
- viewBox: "0 0 17 17",
11137
- fill: "none",
11138
- xmlns: "http://www.w3.org/2000/svg"
11139
- },
11140
- /* @__PURE__ */ React118.createElement(
11141
- "path",
11142
- {
11143
- d: "M8.75 10.167C9.85457 10.167 10.75 9.27156 10.75 8.16699C10.75 7.06242 9.85457 6.16699 8.75 6.16699C7.64543 6.16699 6.75 7.06242 6.75 8.16699C6.75 9.27156 7.64543 10.167 8.75 10.167Z",
11144
- stroke: "currentColor"
11145
- }
11146
- ),
11147
- /* @__PURE__ */ React118.createElement(
11148
- "path",
11149
- {
11150
- d: "M9.92726 1.60149C9.68219 1.5 9.37159 1.5 8.75032 1.5C8.12906 1.5 7.81846 1.5 7.57339 1.60149C7.2467 1.73682 6.98714 1.99639 6.85181 2.32309C6.79004 2.47223 6.76586 2.64567 6.7564 2.89866C6.7425 3.27045 6.55183 3.61459 6.22962 3.80062C5.90742 3.98664 5.51405 3.97969 5.18512 3.80584C4.96129 3.68753 4.799 3.62175 4.63895 3.60068C4.28835 3.55452 3.93378 3.64953 3.65323 3.8648C3.44282 4.02625 3.2875 4.29527 2.97688 4.83329C2.66625 5.37131 2.51094 5.64032 2.47632 5.90327C2.43016 6.25387 2.52517 6.60844 2.74044 6.889C2.8387 7.01707 2.97679 7.12467 3.19112 7.25933C3.50619 7.45733 3.70892 7.7946 3.7089 8.16667C3.70888 8.53873 3.50616 8.87593 3.19111 9.07387C2.97676 9.2086 2.83864 9.31627 2.74038 9.44433C2.5251 9.72487 2.4301 10.0794 2.47626 10.43C2.51087 10.6929 2.66618 10.962 2.97681 11.5C3.28744 12.038 3.44276 12.3071 3.65316 12.4685C3.93371 12.6837 4.28828 12.7787 4.63888 12.7326C4.79892 12.7115 4.9612 12.6457 5.18502 12.5275C5.51397 12.3536 5.90736 12.3467 6.22959 12.5327C6.55182 12.7187 6.7425 13.0629 6.7564 13.4347C6.76586 13.6877 6.79004 13.8611 6.85181 14.0103C6.98714 14.3369 7.2467 14.5965 7.57339 14.7319C7.81846 14.8333 8.12906 14.8333 8.75032 14.8333C9.37159 14.8333 9.68219 14.8333 9.92726 14.7319C10.2539 14.5965 10.5135 14.3369 10.6488 14.0103C10.7106 13.8611 10.7348 13.6877 10.7443 13.4347C10.7581 13.0629 10.9488 12.7187 11.271 12.5327C11.5932 12.3466 11.9866 12.3536 12.3156 12.5275C12.5394 12.6457 12.7017 12.7115 12.8617 12.7325C13.2123 12.7787 13.5669 12.6837 13.8474 12.4685C14.0578 12.307 14.2131 12.038 14.5237 11.4999C14.8344 10.9619 14.9897 10.6929 15.0243 10.43C15.0705 10.0794 14.9755 9.7248 14.7602 9.44427C14.6619 9.3162 14.5238 9.20853 14.3095 9.07387C13.9945 8.87593 13.7917 8.53867 13.7917 8.1666C13.7917 7.79453 13.9945 7.4574 14.3095 7.25947C14.5239 7.12473 14.662 7.01713 14.7603 6.889C14.9755 6.60849 15.0705 6.25391 15.0244 5.90331C14.9898 5.64037 14.8345 5.37135 14.5238 4.83333C14.2132 4.29531 14.0579 4.0263 13.8475 3.86485C13.5669 3.64957 13.2123 3.55457 12.8617 3.60073C12.7017 3.62179 12.5395 3.68757 12.3156 3.80587C11.9867 3.97973 11.5933 3.98668 11.2711 3.80064C10.9488 3.61461 10.7581 3.27044 10.7443 2.89863C10.7348 2.64565 10.7106 2.47222 10.6488 2.32309C10.5135 1.99639 10.2539 1.73682 9.92726 1.60149Z",
11151
- stroke: "currentColor"
11152
- }
11153
- )
11154
- );
11155
- };
11156
-
11157
- // src/css/scrollStyles.css.ts
11158
- var hideScrollBar = "_163ehmk0";
11159
-
11160
- // src/modals/ProfileDetails/FunProfileViews/Home/Home.css.ts
11161
- var animateContentInClass2 = "_26hmws7";
11162
- var animateContentOutClass2 = "_26hmws9";
11163
- var animateTitleInClass2 = "_26hmws5";
11164
- var animateTitleOutClass2 = "_26hmws6";
11165
- var animateVirtuosoInClass = "_26hmws8";
11166
-
11167
- // src/modals/ProfileDetails/FunProfileViews/Home/HomeCheckoutDisplayRow.tsx
11168
- import clsx8 from "clsx";
11169
- import React122 from "react";
11170
-
11171
- // src/components/FunSkeletonLoader/FunSkeletonBlock.tsx
11172
- import React119 from "react";
11173
-
11174
- // src/components/FunSkeletonLoader/FunSkeletonLoader.css.ts
11175
- var animateSkeletonClass = "dj0x602 _1rsrm2fnq";
11176
- var circleSkeletonClass = "dj0x603";
11177
-
11178
- // src/components/FunSkeletonLoader/FunSkeletonBlock.tsx
11179
- function FunSkeletonBlock({
11180
- width = "full",
11181
- ...props
11182
- }) {
11183
- return /* @__PURE__ */ React119.createElement(
11184
- Box,
11185
- {
11186
- borderRadius: "4",
11187
- className: animateSkeletonClass,
11188
- width,
11189
- ...props
11190
- }
11191
- );
11348
+ checkoutHistoryItem
11349
+ }
11350
+ ))) : /* @__PURE__ */ React115.createElement(Box, { paddingTop: "16" }, /* @__PURE__ */ React115.createElement(FunNotification, { description: "No activity yet." }))
11351
+ ));
11192
11352
  }
11193
11353
 
11194
- // src/components/FunSkeletonLoader/FunSkeletonCircle.tsx
11195
- import clsx7 from "clsx";
11196
- import React120 from "react";
11197
- function FunSkeletonCircle({
11198
- size = "20",
11199
- ...props
11200
- }) {
11201
- return /* @__PURE__ */ React120.createElement(
11202
- Box,
11203
- {
11204
- borderRadius: "full",
11205
- className: clsx7(
11206
- animateSkeletonClass,
11207
- circleSkeletonClass
11208
- ),
11209
- height: size,
11210
- width: size,
11211
- ...props
11212
- }
11213
- );
11214
- }
11354
+ // src/modals/ProfileDetails/FunProfileViews/Home/index.tsx
11355
+ import clsx9 from "clsx";
11356
+ import React124, { useMemo as useMemo18, useRef as useRef11, useState as useState28 } from "react";
11357
+ import { Virtuoso } from "react-virtuoso";
11358
+ import { useAccount as useAccount6 } from "wagmi";
11215
11359
 
11216
- // src/components/Icons/RedRoundErrorCross.tsx
11217
- import React121 from "react";
11218
- var RedRoundErrorCross = ({ size = 15 }) => {
11219
- return /* @__PURE__ */ React121.createElement(
11360
+ // src/components/Icons/GreenRoundCheckmark.tsx
11361
+ import React116 from "react";
11362
+ var GreenRoundCheckmark = ({ size = 15 }) => {
11363
+ return /* @__PURE__ */ React116.createElement(
11220
11364
  "svg",
11221
11365
  {
11222
11366
  width: size,
11223
11367
  height: size,
11224
- viewBox: "0 0 8 9",
11368
+ viewBox: "0 0 10 11",
11225
11369
  fill: "none",
11226
11370
  xmlns: "http://www.w3.org/2000/svg"
11227
11371
  },
11228
- /* @__PURE__ */ React121.createElement("circle", { cx: "4", cy: "4.5", r: "4", fill: "#F34126" }),
11229
- /* @__PURE__ */ React121.createElement(
11372
+ /* @__PURE__ */ React116.createElement(
11230
11373
  "path",
11231
11374
  {
11232
- d: "M2.57111 2.59761L4 4.02654L5.42889 2.59761C5.54807 2.47844 5.7369 2.46734 5.87797 2.57755L5.90238 2.59979C6.03254 2.72994 6.03254 2.94096 5.90238 3.07111L4.47346 4.5L5.90238 5.92889C6.02156 6.04806 6.03266 6.2369 5.92244 6.37797L5.90022 6.40239C5.77007 6.53254 5.55904 6.53254 5.42888 6.40238L4 4.97346L2.57111 6.40239C2.45193 6.52156 2.2631 6.53266 2.12203 6.42245L2.09761 6.40021C1.96746 6.27006 1.96746 6.05904 2.09761 5.92889L3.52654 4.5L2.09761 3.07111C1.97844 2.95194 1.96734 2.7631 2.07755 2.62203L2.09978 2.59761C2.22993 2.46746 2.44095 2.46746 2.57111 2.59761ZM2.36024 6.33149L2.35293 6.33242C2.35536 6.33217 2.3578 6.33185 2.36024 6.33149ZM2.31088 6.33152L2.31385 6.33194L2.31088 6.33152ZM2.3814 6.3269L2.37242 6.3292C2.37542 6.32852 2.37842 6.32775 2.3814 6.3269ZM2.40026 6.32026L2.39333 6.323C2.39564 6.32215 2.39795 6.32123 2.40026 6.32026ZM2.25106 6.31043L2.23334 6.29839C2.24074 6.30415 2.2485 6.30919 2.25656 6.31353L2.25106 6.31043ZM2.41976 6.31047L2.4144 6.31349C2.4144 6.31349 2.41796 6.31153 2.41976 6.31047ZM5.81353 6.24343L5.81042 6.24894L5.79839 6.26667C5.80415 6.25927 5.80919 6.25149 5.81353 6.24343ZM5.82275 6.2231L5.82025 6.22939C5.82114 6.22729 5.82197 6.2252 5.82275 6.2231ZM5.82913 6.20184L5.82703 6.21006C5.82778 6.20739 5.8285 6.20462 5.82913 6.20184ZM5.83241 6.18215L5.83152 6.18912C5.83186 6.18683 5.83216 6.18449 5.83241 6.18215ZM5.66455 2.83328L4 4.49787L2.33545 2.83328L2.33327 2.83545L3.99787 4.5L2.33327 6.16455L2.33545 6.16672L4 4.50213L5.66455 6.16672L5.66673 6.16455L4.00213 4.5L5.66673 2.83545L5.66455 2.83328ZM5.83331 6.16189L5.83332 6.16672L5.83331 6.16189ZM5.83149 6.13977L5.83242 6.14707C5.83216 6.14465 5.83186 6.1422 5.83149 6.13977ZM5.8269 6.1186L5.8292 6.12758C5.82852 6.12458 5.82776 6.12158 5.8269 6.1186ZM5.82026 6.09974L5.823 6.10667C5.82214 6.10436 5.82123 6.10204 5.82026 6.09974ZM5.81048 6.08024L5.81349 6.0856C5.81349 6.0856 5.81153 6.08203 5.81048 6.08024ZM2.18651 2.9144L2.18903 2.9189L2.18651 2.9144ZM2.177 2.89333L2.17924 2.89907C2.17845 2.89716 2.17772 2.89526 2.177 2.89333ZM2.1708 2.87242L2.17226 2.87835C2.17174 2.87638 2.17125 2.87441 2.1708 2.87242ZM2.16751 2.85227L2.16806 2.85705L2.16751 2.85227ZM2.16674 2.83061L2.16667 2.83545L2.16674 2.83061ZM2.16848 2.81088L2.16806 2.81385L2.16848 2.81088ZM2.18957 2.75106L2.20161 2.73333C2.19585 2.74073 2.1908 2.74851 2.18647 2.75657L2.18957 2.75106ZM2.41433 2.68647L2.41984 2.68957L2.43756 2.70161C2.43016 2.69585 2.42238 2.69081 2.41433 2.68647ZM5.5856 2.68651L5.5811 2.68903L5.5856 2.68651ZM2.2565 2.68651L2.25199 2.68903L2.2565 2.68651ZM5.74344 2.68647L5.74894 2.68957L5.76666 2.70161C5.75926 2.69585 5.75149 2.69081 5.74344 2.68647ZM2.27691 2.67725L2.27183 2.67924L2.27691 2.67725ZM2.3933 2.67699L2.40029 2.67975C2.39796 2.67877 2.39564 2.67785 2.3933 2.67699ZM5.60667 2.677L5.60093 2.67924C5.60284 2.67846 5.60473 2.67771 5.60667 2.677ZM5.7231 2.67725L5.72939 2.67975C5.72729 2.67887 5.7252 2.67804 5.7231 2.67725ZM2.29821 2.67086L2.29254 2.67226L2.29821 2.67086ZM2.37241 2.6708L2.38143 2.6731C2.37842 2.67225 2.37542 2.67148 2.37241 2.6708ZM5.62758 2.6708L5.62165 2.67226C5.62363 2.67173 5.62559 2.67125 5.62758 2.6708ZM5.70184 2.67087L5.71006 2.67297C5.7074 2.67221 5.70463 2.67151 5.70184 2.67087ZM2.31856 2.66752L2.31385 2.66806L2.31856 2.66752ZM2.35224 2.66751L2.36022 2.66851C2.35757 2.66811 2.35491 2.66778 2.35224 2.66751ZM5.64774 2.66751L5.64295 2.66806L5.64774 2.66751ZM5.68148 2.66752L5.68912 2.66848C5.68661 2.6681 5.68405 2.66778 5.68148 2.66752ZM5.65972 2.66674L5.66941 2.66674C5.66618 2.66664 5.66295 2.66664 5.65972 2.66674ZM2.33059 2.66674L2.34028 2.66674C2.33705 2.66664 2.33382 2.66664 2.33059 2.66674Z",
11233
- fill: "white"
11375
+ d: "M5 10.4551C4.31315 10.4551 3.66862 10.3249 3.06641 10.0645C2.46419 9.80729 1.93522 9.45085 1.47949 8.99512C1.02376 8.53613 0.66569 8.00716 0.405273 7.4082C0.148112 6.80599 0.0195312 6.16146 0.0195312 5.47461C0.0195312 4.78776 0.148112 4.14323 0.405273 3.54102C0.66569 2.9388 1.02376 2.40983 1.47949 1.9541C1.93522 1.49837 2.46419 1.14193 3.06641 0.884766C3.66862 0.624349 4.31315 0.494141 5 0.494141C5.68685 0.494141 6.33138 0.624349 6.93359 0.884766C7.53581 1.14193 8.06478 1.49837 8.52051 1.9541C8.97624 2.40983 9.33268 2.9388 9.58984 3.54102C9.85026 4.14323 9.98047 4.78776 9.98047 5.47461C9.98047 6.16146 9.85026 6.80599 9.58984 7.4082C9.33268 8.00716 8.97624 8.53613 8.52051 8.99512C8.06478 9.45085 7.53581 9.80729 6.93359 10.0645C6.33138 10.3249 5.68685 10.4551 5 10.4551ZM4.45312 7.85742C4.53776 7.85742 4.61426 7.83789 4.68262 7.79883C4.75098 7.75977 4.8112 7.70117 4.86328 7.62305L7.1582 4.00488C7.1875 3.95605 7.21517 3.90397 7.24121 3.84863C7.26725 3.79329 7.28027 3.73796 7.28027 3.68262C7.28027 3.56868 7.23796 3.47917 7.15332 3.41406C7.06868 3.3457 6.97428 3.31152 6.87012 3.31152C6.72689 3.31152 6.6097 3.38639 6.51855 3.53613L4.43359 6.88574L3.44238 5.60645C3.38053 5.52507 3.32031 5.46973 3.26172 5.44043C3.20638 5.41113 3.1429 5.39648 3.07129 5.39648C2.96061 5.39648 2.86784 5.43717 2.79297 5.51855C2.7181 5.59668 2.68066 5.69108 2.68066 5.80176C2.68066 5.8571 2.69043 5.91243 2.70996 5.96777C2.73275 6.01986 2.76204 6.07031 2.79785 6.11914L4.02344 7.62305C4.08854 7.70768 4.15527 7.7679 4.22363 7.80371C4.29199 7.83952 4.36849 7.85742 4.45312 7.85742Z",
11376
+ fill: "#66CC00"
11234
11377
  }
11235
11378
  )
11236
11379
  );
11237
11380
  };
11238
11381
 
11239
- // src/modals/ProfileDetails/FunProfileViews/Home/HomeCheckoutDisplayRow.css.ts
11240
- var homeCheckoutDisplayRowStyle = { defaultBorder: "ukct4t1 _1rsrm2f10k _1rsrm2fwo", defaultBackground: "_1rsrm2fpq _1rsrm2fls", hoverBackground: "_1rsrm2fll" };
11241
-
11242
- // src/modals/ProfileDetails/FunProfileViews/Home/HomeCheckoutDisplayRow.tsx
11243
- var HOME_CHECKOUT_DISPLAY_ROW_HEIGHT = 52;
11244
- var ASSET_ICON_SIZE = "24";
11245
- var TEXT_SIZE_MEDIUM = "13";
11246
- var TEXT_SIZE_SMALL = "10";
11247
- var STATUS_FLEX_GAP_X = "4";
11248
- var STATUS_ICON_SIZE = "8";
11249
- var STATUS_TEXT_SIZE = TEXT_SIZE_SMALL;
11250
- var TEXT_SKELETON_MARGIN_TOP = "2";
11251
- var TEXT_SKELETON_MARGIN_BOTTOM = "3";
11252
- var TEXT_SKELETON_WIDTH_SHORT = "48";
11253
- var TEXT_SKELETON_WIDTH_MEDIUM = "72";
11254
- var TEXT_SKELETON_WIDTH_LONG = "96";
11255
- var ROW_FLEX_GAP_X = "8";
11256
- var ROW_PADDING_Y = "8";
11257
- var HomeCheckoutDisplayRow = ({
11258
- checkoutHistoryItem,
11259
- onSelect
11260
- }) => {
11261
- const { isProcessing, isCompleted, isError, isExpired, isFailed } = useCheckoutStateBooleans(checkoutHistoryItem.state);
11262
- const checkoutClientMetadata = checkoutHistoryItem.clientMetadata;
11263
- const getStatusElement = () => {
11264
- if (isCompleted) {
11265
- return /* @__PURE__ */ React122.createElement(
11266
- Box,
11267
- {
11268
- display: "flex",
11269
- flexDirection: "row",
11270
- gap: STATUS_FLEX_GAP_X,
11271
- alignItems: "center"
11272
- },
11273
- /* @__PURE__ */ React122.createElement(GreenRoundCheckmark, { size: parseInt(STATUS_ICON_SIZE) }),
11274
- /* @__PURE__ */ React122.createElement(Text, { size: STATUS_TEXT_SIZE, color: "success" }, "Completed")
11275
- );
11276
- } else if (isError || isFailed || isExpired) {
11277
- return /* @__PURE__ */ React122.createElement(
11278
- Box,
11279
- {
11280
- display: "flex",
11281
- flexDirection: "row",
11282
- gap: STATUS_FLEX_GAP_X,
11283
- alignItems: "center"
11284
- },
11285
- /* @__PURE__ */ React122.createElement(RedRoundErrorCross, { size: parseInt(STATUS_ICON_SIZE) }),
11286
- /* @__PURE__ */ React122.createElement(Text, { size: STATUS_TEXT_SIZE, color: "error" }, "Failed")
11287
- );
11288
- } else if (isProcessing) {
11289
- return /* @__PURE__ */ React122.createElement(
11290
- Box,
11291
- {
11292
- display: "flex",
11293
- flexDirection: "row",
11294
- gap: STATUS_FLEX_GAP_X,
11295
- alignItems: "center"
11296
- },
11297
- /* @__PURE__ */ React122.createElement(
11298
- Box,
11299
- {
11300
- width: STATUS_ICON_SIZE,
11301
- height: STATUS_ICON_SIZE,
11302
- borderRadius: "full",
11303
- background: "standby"
11304
- }
11305
- ),
11306
- /* @__PURE__ */ React122.createElement(Text, { size: STATUS_TEXT_SIZE, color: "standby" }, "Processing")
11307
- );
11308
- }
11309
- };
11310
- return /* @__PURE__ */ React122.createElement(
11311
- Box,
11382
+ // src/components/Icons/LogoutIcon.tsx
11383
+ import React117 from "react";
11384
+ var LogoutIcon = ({ size = 16 }) => {
11385
+ return /* @__PURE__ */ React117.createElement(
11386
+ "svg",
11312
11387
  {
11313
- className: clsx8(
11314
- homeCheckoutDisplayRowStyle.defaultBorder,
11315
- homeCheckoutDisplayRowStyle.defaultBackground,
11316
- !isMobile() && homeCheckoutDisplayRowStyle.hoverBackground
11317
- ),
11318
- display: "flex",
11319
- flexDirection: "column",
11320
- justifyContent: "center",
11321
- gap: "24",
11322
- paddingX: PROFILE_SIDE_PADDING,
11323
- paddingY: ROW_PADDING_Y,
11324
- role: "button",
11325
- tabIndex: 0,
11326
- borderWidth: "2",
11327
- borderStyle: "solid",
11328
- onClick: () => {
11329
- if (checkoutHistoryItem.depositAddr) {
11330
- onSelect(checkoutHistoryItem.depositAddr, "detail" /* DETAIL */);
11331
- }
11332
- }
11388
+ width: size,
11389
+ height: size,
11390
+ viewBox: "0 0 16 16",
11391
+ fill: "none",
11392
+ xmlns: "http://www.w3.org/2000/svg"
11333
11393
  },
11334
- /* @__PURE__ */ React122.createElement(Box, { display: "flex", alignItems: "center", gap: ROW_FLEX_GAP_X, width: "full" }, isNotNullish(checkoutClientMetadata.initSettings.config.iconSrc) && /* @__PURE__ */ React122.createElement(
11335
- Box,
11336
- {
11337
- display: "flex",
11338
- alignItems: "center",
11339
- justifyContent: "center",
11340
- style: {
11341
- flexShrink: 0,
11342
- minWidth: "29px"
11343
- }
11344
- },
11345
- /* @__PURE__ */ React122.createElement(
11346
- FunAssetAvatar,
11347
- {
11348
- assetSrc: checkoutClientMetadata.initSettings.config.iconSrc,
11349
- assetName: "checkout-asset",
11350
- assetIconSize: ASSET_ICON_SIZE,
11351
- prioritizeDefaults: false,
11352
- chainId: checkoutClientMetadata.initSettings.config.targetChain
11353
- }
11354
- )
11355
- ), /* @__PURE__ */ React122.createElement(Box, { display: "flex", flexDirection: "column", width: "full" }, /* @__PURE__ */ React122.createElement(
11356
- Box,
11394
+ /* @__PURE__ */ React117.createElement(
11395
+ "path",
11357
11396
  {
11358
- display: "flex",
11359
- justifyContent: "space-between",
11360
- alignItems: "center",
11361
- gap: "16"
11362
- },
11363
- /* @__PURE__ */ React122.createElement(Text, { size: TEXT_SIZE_MEDIUM, weight: "medium", color: "primaryText" }, checkoutClientMetadata.initSettings.config.checkoutItemTitle),
11364
- /* @__PURE__ */ React122.createElement(Text, { size: TEXT_SIZE_MEDIUM, weight: "medium", color: "primaryText" }, `${formatCurrencyAndStringify(
11365
- (checkoutClientMetadata?.finalDollarValue ?? // For backwards compatibility
11366
- checkoutClientMetadata?.draftDollarValue) || 0
11367
- )} USD`)
11368
- ), /* @__PURE__ */ React122.createElement(Box, { display: "flex", justifyContent: "space-between", gap: "16" }, /* @__PURE__ */ React122.createElement(Text, { size: TEXT_SIZE_SMALL, color: "secondaryText" }, formatTimestamp(new Date(checkoutHistoryItem.createdTimeMs), {
11369
- year: "none",
11370
- seconds: "none",
11371
- month: "short"
11372
- })), /* @__PURE__ */ React122.createElement(Box, null, getStatusElement()))))
11397
+ d: "M9.33463 13.3337H4.0013C3.26492 13.3337 2.66797 12.7367 2.66797 12.0003V4.00033C2.66797 3.26395 3.26492 2.66699 4.0013 2.66699H9.33463M6.66797 8.00033H14.0013M14.0013 8.00033L12.0013 10.0003M14.0013 8.00033L12.0013 6.00033",
11398
+ stroke: "currentColor",
11399
+ strokeWidth: "1.33333",
11400
+ strokeLinecap: "round",
11401
+ strokeLinejoin: "round",
11402
+ color: "currentColor"
11403
+ }
11404
+ )
11373
11405
  );
11374
11406
  };
11375
- var HomeCheckoutDisplayRowSkeleton = () => {
11376
- return /* @__PURE__ */ React122.createElement(
11377
- Box,
11407
+
11408
+ // src/components/Icons/SettingsIcon.tsx
11409
+ import React118 from "react";
11410
+ var SettingsIcon = ({ size = 16 }) => {
11411
+ return /* @__PURE__ */ React118.createElement(
11412
+ "svg",
11378
11413
  {
11379
- display: "flex",
11380
- flexDirection: "row",
11381
- alignItems: "center",
11382
- gap: ROW_FLEX_GAP_X,
11383
- paddingX: PROFILE_SIDE_PADDING,
11384
- paddingY: ROW_PADDING_Y
11414
+ width: size,
11415
+ height: size,
11416
+ viewBox: "0 0 17 17",
11417
+ fill: "none",
11418
+ xmlns: "http://www.w3.org/2000/svg"
11385
11419
  },
11386
- /* @__PURE__ */ React122.createElement(FunSkeletonCircle, { size: ASSET_ICON_SIZE }),
11387
- /* @__PURE__ */ React122.createElement(Box, { display: "flex", flexDirection: "column", style: { flexGrow: 1 } }, /* @__PURE__ */ React122.createElement(
11388
- FunSkeletonBlock,
11389
- {
11390
- height: TEXT_SIZE_MEDIUM,
11391
- marginBottom: TEXT_SKELETON_MARGIN_BOTTOM,
11392
- marginTop: TEXT_SKELETON_MARGIN_TOP,
11393
- width: TEXT_SKELETON_WIDTH_LONG
11394
- }
11395
- ), /* @__PURE__ */ React122.createElement(
11396
- FunSkeletonBlock,
11397
- {
11398
- height: TEXT_SIZE_SMALL,
11399
- marginBottom: TEXT_SKELETON_MARGIN_BOTTOM,
11400
- marginTop: TEXT_SKELETON_MARGIN_TOP,
11401
- width: TEXT_SKELETON_WIDTH_MEDIUM
11402
- }
11403
- )),
11404
- /* @__PURE__ */ React122.createElement(Box, { alignItems: "flex-end", display: "flex", flexDirection: "column" }, /* @__PURE__ */ React122.createElement(
11405
- FunSkeletonBlock,
11420
+ /* @__PURE__ */ React118.createElement(
11421
+ "path",
11406
11422
  {
11407
- height: TEXT_SIZE_MEDIUM,
11408
- marginBottom: TEXT_SKELETON_MARGIN_BOTTOM,
11409
- marginTop: TEXT_SKELETON_MARGIN_TOP,
11410
- width: TEXT_SKELETON_WIDTH_MEDIUM
11423
+ d: "M8.75 10.167C9.85457 10.167 10.75 9.27156 10.75 8.16699C10.75 7.06242 9.85457 6.16699 8.75 6.16699C7.64543 6.16699 6.75 7.06242 6.75 8.16699C6.75 9.27156 7.64543 10.167 8.75 10.167Z",
11424
+ stroke: "currentColor"
11411
11425
  }
11412
- ), /* @__PURE__ */ React122.createElement(
11413
- FunSkeletonBlock,
11426
+ ),
11427
+ /* @__PURE__ */ React118.createElement(
11428
+ "path",
11414
11429
  {
11415
- height: STATUS_TEXT_SIZE,
11416
- marginBottom: TEXT_SKELETON_MARGIN_BOTTOM,
11417
- marginTop: TEXT_SKELETON_MARGIN_TOP,
11418
- width: TEXT_SKELETON_WIDTH_SHORT
11430
+ d: "M9.92726 1.60149C9.68219 1.5 9.37159 1.5 8.75032 1.5C8.12906 1.5 7.81846 1.5 7.57339 1.60149C7.2467 1.73682 6.98714 1.99639 6.85181 2.32309C6.79004 2.47223 6.76586 2.64567 6.7564 2.89866C6.7425 3.27045 6.55183 3.61459 6.22962 3.80062C5.90742 3.98664 5.51405 3.97969 5.18512 3.80584C4.96129 3.68753 4.799 3.62175 4.63895 3.60068C4.28835 3.55452 3.93378 3.64953 3.65323 3.8648C3.44282 4.02625 3.2875 4.29527 2.97688 4.83329C2.66625 5.37131 2.51094 5.64032 2.47632 5.90327C2.43016 6.25387 2.52517 6.60844 2.74044 6.889C2.8387 7.01707 2.97679 7.12467 3.19112 7.25933C3.50619 7.45733 3.70892 7.7946 3.7089 8.16667C3.70888 8.53873 3.50616 8.87593 3.19111 9.07387C2.97676 9.2086 2.83864 9.31627 2.74038 9.44433C2.5251 9.72487 2.4301 10.0794 2.47626 10.43C2.51087 10.6929 2.66618 10.962 2.97681 11.5C3.28744 12.038 3.44276 12.3071 3.65316 12.4685C3.93371 12.6837 4.28828 12.7787 4.63888 12.7326C4.79892 12.7115 4.9612 12.6457 5.18502 12.5275C5.51397 12.3536 5.90736 12.3467 6.22959 12.5327C6.55182 12.7187 6.7425 13.0629 6.7564 13.4347C6.76586 13.6877 6.79004 13.8611 6.85181 14.0103C6.98714 14.3369 7.2467 14.5965 7.57339 14.7319C7.81846 14.8333 8.12906 14.8333 8.75032 14.8333C9.37159 14.8333 9.68219 14.8333 9.92726 14.7319C10.2539 14.5965 10.5135 14.3369 10.6488 14.0103C10.7106 13.8611 10.7348 13.6877 10.7443 13.4347C10.7581 13.0629 10.9488 12.7187 11.271 12.5327C11.5932 12.3466 11.9866 12.3536 12.3156 12.5275C12.5394 12.6457 12.7017 12.7115 12.8617 12.7325C13.2123 12.7787 13.5669 12.6837 13.8474 12.4685C14.0578 12.307 14.2131 12.038 14.5237 11.4999C14.8344 10.9619 14.9897 10.6929 15.0243 10.43C15.0705 10.0794 14.9755 9.7248 14.7602 9.44427C14.6619 9.3162 14.5238 9.20853 14.3095 9.07387C13.9945 8.87593 13.7917 8.53867 13.7917 8.1666C13.7917 7.79453 13.9945 7.4574 14.3095 7.25947C14.5239 7.12473 14.662 7.01713 14.7603 6.889C14.9755 6.60849 15.0705 6.25391 15.0244 5.90331C14.9898 5.64037 14.8345 5.37135 14.5238 4.83333C14.2132 4.29531 14.0579 4.0263 13.8475 3.86485C13.5669 3.64957 13.2123 3.55457 12.8617 3.60073C12.7017 3.62179 12.5395 3.68757 12.3156 3.80587C11.9867 3.97973 11.5933 3.98668 11.2711 3.80064C10.9488 3.61461 10.7581 3.27044 10.7443 2.89863C10.7348 2.64565 10.7106 2.47222 10.6488 2.32309C10.5135 1.99639 10.2539 1.73682 9.92726 1.60149Z",
11431
+ stroke: "currentColor"
11419
11432
  }
11420
- ))
11433
+ )
11421
11434
  );
11422
11435
  };
11423
11436
 
11424
- // src/modals/ProfileDetails/FunProfileViews/Home/HomeTokenDisplayRow.tsx
11425
- import React123, { useState as useState27 } from "react";
11437
+ // src/css/scrollStyles.css.ts
11438
+ var hideScrollBar = "_163ehmk0";
11426
11439
 
11427
- // src/utils/assets.ts
11428
- import {
11429
- dydxChain as dydxChain2,
11430
- FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO7,
11431
- STABLECOIN_SYMBOLS
11432
- } from "@funkit/core";
11433
- import { formatUnits } from "viem";
11434
- import { arbitrum, mainnet as mainnet4, mantle, zkSync as zkSync2 } from "viem/chains";
11435
- var getNormalizedTokenBalance = (tokenBalance, decimals) => {
11436
- return Number(formatUnits(BigInt(tokenBalance), decimals));
11437
- };
11438
- var isAssetUsableToPayForCheckout = (flags, checkoutItem, paymentMethod, assetChainId, assetTokenAddress, isWeb2Login, isWeb3Login) => {
11439
- const targetChainId = checkoutItem.initSettings.config.targetChain;
11440
- const isSameAsPurchasingToken = !isCheckoutPostActionRequired(checkoutItem.initSettings.config) && // however, if the destination is custom recipient address, it is possible to transfer money
11441
- // TODO: this is not 100% correct, should also check if sourceAddr != customRecipientAddr
11442
- !isCheckoutCrFlow(checkoutItem) && paymentMethod === "balance" /* ACCOUNT_BALANCE */ && targetChainId === assetChainId && checkoutItem.initSettings.config.targetAsset.toLowerCase() === assetTokenAddress.toLowerCase();
11443
- const isConnectedAccountSupported = (
11444
- // User is logged in with web2, ensure that the chain is supported for FunWallet
11445
- isWeb2Login && FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO7[assetChainId].isFunWalletSupported || // User is logged in with web3 or not logged in at all, ignore
11446
- isWeb3Login || !isWeb2Login && !isWeb3Login
11447
- );
11448
- const isZkSyncAssetsDisabled = flags["disable_zksync_source_assets" /* DisableZkSyncSourceAssets */] ?? true;
11449
- const isMantleAssetsDisabled = flags["disable_mantle_source_assets" /* DisableMantleSourceAssets */] ?? true;
11450
- const isAssetDisabled = (
11451
- // Disable all mantle assets
11452
- isMantleAssetsDisabled && assetChainId === mantle.id.toString() || // Disable all zksync assets
11453
- isZkSyncAssetsDisabled && assetChainId === zkSync2.id.toString()
11454
- );
11455
- const isPickedChainSupportedForCheckout = isConnectedAccountSupported && FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO7[assetChainId].isCheckoutSupported && !isAssetDisabled;
11456
- const isUsable = !isSameAsPurchasingToken && isPickedChainSupportedForCheckout;
11457
- return {
11458
- isUsable,
11459
- reason: isUsable ? "" : isSameAsPurchasingToken ? "Not Applicable" : !isPickedChainSupportedForCheckout ? "Unsupported" : ""
11460
- };
11461
- };
11462
- var getAssetSymbolWithMaxUsdValue = ({
11463
- accountHoldingsMap,
11464
- filterSymbols
11465
- }) => {
11466
- return Object.keys(accountHoldingsMap).filter(
11467
- (symbol) => filterSymbols === void 0 || filterSymbols?.includes(symbol)
11468
- ).reduce((max, current) => {
11469
- const currentItem = accountHoldingsMap[current];
11470
- if (!currentItem || !isNotNullish(currentItem.usdAmount)) {
11471
- return max;
11472
- }
11473
- if (max === null) {
11474
- return current;
11475
- }
11476
- const maxItem = accountHoldingsMap[max];
11477
- if (isNotNullish(maxItem?.usdAmount)) {
11478
- return maxItem.usdAmount > currentItem.usdAmount ? max : current;
11479
- }
11480
- return max;
11481
- }, null);
11482
- };
11483
- var L1_FEES_ESTIMATE = 20;
11484
- var L2_FEES_ESTIMATE = 1;
11485
- var L2_COST_MARGIN_MULTIPLIER = 1.2;
11486
- var MESH_L1_FEES_ESTIMATE = 8;
11487
- var MESH_L2_FEES_ESTIMATE = 2;
11488
- var MESH_CUSTOM_CLIENT_FEE_PERCENT = 0.055;
11489
- var getMeshFeesUsdEstimate = (asset) => {
11490
- let meshFeeEstimate = 0;
11491
- meshFeeEstimate += (asset.usdAmount || 0) * MESH_CUSTOM_CLIENT_FEE_PERCENT;
11492
- const sourceChainId = asset.pickedChainId;
11493
- if (sourceChainId === mainnet4.id.toString()) {
11494
- meshFeeEstimate += MESH_L1_FEES_ESTIMATE;
11495
- } else {
11496
- meshFeeEstimate += MESH_L2_FEES_ESTIMATE;
11497
- }
11498
- return meshFeeEstimate;
11499
- };
11500
- var getBaseFeeUsdEstimate = (checkoutItem, asset) => {
11501
- const targetChainId = checkoutItem.initSettings.config.targetChain;
11502
- const sourceChainId = asset.pickedChainId;
11503
- if (targetChainId !== mainnet4.id.toString() && sourceChainId !== mainnet4.id.toString()) {
11504
- return L2_FEES_ESTIMATE;
11505
- } else {
11506
- return L1_FEES_ESTIMATE;
11507
- }
11508
- };
11509
- var getFeesUsdEstimate = (checkoutItem, asset) => {
11510
- let feeEstimate = 0;
11511
- feeEstimate += getBaseFeeUsdEstimate(checkoutItem, asset);
11512
- if (checkoutItem.selectedPaymentMethodInfo?.paymentMethod === "brokerage" /* BROKERAGE */) {
11513
- feeEstimate += getMeshFeesUsdEstimate(asset);
11514
- }
11515
- return feeEstimate;
11516
- };
11517
- var isAssetUsdAmountSufficient = (checkoutItem, asset) => {
11518
- if (!isNotNullish(asset?.usdAmount)) {
11519
- return false;
11520
- }
11521
- if (!isNotNullish(checkoutItem?.draftDollarValue)) {
11522
- return false;
11523
- }
11524
- return asset.usdAmount > checkoutItem?.draftDollarValue + getFeesUsdEstimate(checkoutItem, asset);
11525
- };
11526
- var getRecommendedAsset = (flags, checkoutItem, accountHoldingsMap, isWeb3Login, isWeb2Login) => {
11527
- const highestValueAssetSymbol = getAssetSymbolWithMaxUsdValue({
11528
- accountHoldingsMap
11529
- });
11530
- if (!isNotNullish(highestValueAssetSymbol) || !isAssetUsdAmountSufficient(
11531
- checkoutItem,
11532
- accountHoldingsMap[highestValueAssetSymbol]
11533
- )) {
11534
- return null;
11535
- }
11536
- const assetsOnL1 = Object.keys(accountHoldingsMap)?.filter(
11537
- (chainSymbolKey) => accountHoldingsMap[chainSymbolKey].pickedChainId === mainnet4.id.toString()
11538
- );
11539
- const assetsOnL2 = Object.keys(accountHoldingsMap)?.filter(
11540
- (chainSymbolKey) => accountHoldingsMap[chainSymbolKey].pickedChainId !== mainnet4.id.toString()
11541
- );
11542
- const highestValueL1Asset = assetsOnL1.length ? getAssetSymbolWithMaxUsdValue({
11543
- accountHoldingsMap,
11544
- filterSymbols: assetsOnL1
11545
- }) : null;
11546
- const highestValueL2Asset = assetsOnL2.length ? getAssetSymbolWithMaxUsdValue({
11547
- accountHoldingsMap,
11548
- filterSymbols: assetsOnL2
11549
- }) : null;
11550
- if (!isNotNullish(highestValueL1Asset) && !isNotNullish(highestValueL2Asset)) {
11551
- return null;
11552
- }
11553
- const highestValueL1UsdAmount = highestValueL1Asset ? accountHoldingsMap[highestValueL1Asset]?.usdAmount || 0 : null;
11554
- const highestValueL2UsdAmount = highestValueL2Asset ? accountHoldingsMap[highestValueL2Asset]?.usdAmount || 0 : null;
11555
- if (!isNotNullish(highestValueL1UsdAmount) && !isNotNullish(highestValueL2UsdAmount)) {
11556
- return null;
11557
- }
11558
- const checkoutConfig = checkoutItem.initSettings.config;
11559
- const targetChainId = getMockedTargetChainId(checkoutConfig, [
11560
- dydxChain2.id.toString()
11561
- ]);
11562
- const targetChainIdAssetSymbol = Object.keys(accountHoldingsMap).find(
11563
- (chainIdSymbol) => {
11564
- const item = accountHoldingsMap[chainIdSymbol];
11565
- if (item.pickedChainId === targetChainId && item.tokenAddress === checkoutConfig.targetAsset) {
11566
- return chainIdSymbol;
11567
- }
11568
- return null;
11440
+ // src/modals/ProfileDetails/FunProfileViews/Home/Home.css.ts
11441
+ var animateContentInClass2 = "_26hmws7";
11442
+ var animateContentOutClass2 = "_26hmws9";
11443
+ var animateTitleInClass2 = "_26hmws5";
11444
+ var animateTitleOutClass2 = "_26hmws6";
11445
+ var animateVirtuosoInClass = "_26hmws8";
11446
+
11447
+ // src/modals/ProfileDetails/FunProfileViews/Home/HomeCheckoutDisplayRow.tsx
11448
+ import clsx8 from "clsx";
11449
+ import React122 from "react";
11450
+
11451
+ // src/components/FunSkeletonLoader/FunSkeletonBlock.tsx
11452
+ import React119 from "react";
11453
+
11454
+ // src/components/FunSkeletonLoader/FunSkeletonLoader.css.ts
11455
+ var animateSkeletonClass = "dj0x602 _1rsrm2fnq";
11456
+ var circleSkeletonClass = "dj0x603";
11457
+
11458
+ // src/components/FunSkeletonLoader/FunSkeletonBlock.tsx
11459
+ function FunSkeletonBlock({
11460
+ width = "full",
11461
+ ...props
11462
+ }) {
11463
+ return /* @__PURE__ */ React119.createElement(
11464
+ Box,
11465
+ {
11466
+ borderRadius: "4",
11467
+ className: animateSkeletonClass,
11468
+ width,
11469
+ ...props
11569
11470
  }
11570
11471
  );
11571
- if (isCheckoutPostActionRequired(checkoutItem.initSettings.config) || isCheckoutCrFlow(checkoutItem)) {
11572
- if (targetChainIdAssetSymbol && isAssetUsdAmountSufficient(
11573
- checkoutItem,
11574
- accountHoldingsMap[targetChainIdAssetSymbol]
11575
- )) {
11576
- return {
11577
- symbol: targetChainIdAssetSymbol,
11578
- label: "Cheapest"
11579
- };
11472
+ }
11473
+
11474
+ // src/components/FunSkeletonLoader/FunSkeletonCircle.tsx
11475
+ import clsx7 from "clsx";
11476
+ import React120 from "react";
11477
+ function FunSkeletonCircle({
11478
+ size = "20",
11479
+ ...props
11480
+ }) {
11481
+ return /* @__PURE__ */ React120.createElement(
11482
+ Box,
11483
+ {
11484
+ borderRadius: "full",
11485
+ className: clsx7(
11486
+ animateSkeletonClass,
11487
+ circleSkeletonClass
11488
+ ),
11489
+ height: size,
11490
+ width: size,
11491
+ ...props
11580
11492
  }
11581
- }
11582
- const usableAssetHoldingMap = checkoutItem ? Object.fromEntries(
11583
- Object.entries(accountHoldingsMap).filter(
11584
- ([_, item]) => isAssetUsableToPayForCheckout(
11585
- flags,
11586
- checkoutItem,
11587
- checkoutItem?.selectedPaymentMethodInfo?.paymentMethod,
11588
- item.pickedChainId,
11589
- item.tokenAddress,
11590
- isWeb2Login,
11591
- isWeb3Login
11592
- ).isUsable
11593
- )
11594
- ) : {};
11595
- const highestValueUsableAssetSymbol = getAssetSymbolWithMaxUsdValue({
11596
- accountHoldingsMap: usableAssetHoldingMap
11597
- });
11598
- if (!isNotNullish(highestValueUsableAssetSymbol) || !isAssetUsdAmountSufficient(
11599
- checkoutItem,
11600
- usableAssetHoldingMap[highestValueUsableAssetSymbol]
11601
- )) {
11602
- return null;
11603
- }
11604
- const stableAssetOnTargetChainSymbols = STABLECOIN_SYMBOLS.map(
11605
- (symbol) => combineChainSymbolOrAddress({
11606
- chainId: targetChainId,
11607
- symbolOrAddress: symbol
11608
- })
11609
11493
  );
11610
- const highestValueStableAssetOnTargetChain = getAssetSymbolWithMaxUsdValue({
11611
- accountHoldingsMap: usableAssetHoldingMap,
11612
- filterSymbols: stableAssetOnTargetChainSymbols.filter(
11613
- (asset) => asset !== null
11494
+ }
11495
+
11496
+ // src/components/Icons/RedRoundErrorCross.tsx
11497
+ import React121 from "react";
11498
+ var RedRoundErrorCross = ({ size = 15 }) => {
11499
+ return /* @__PURE__ */ React121.createElement(
11500
+ "svg",
11501
+ {
11502
+ width: size,
11503
+ height: size,
11504
+ viewBox: "0 0 8 9",
11505
+ fill: "none",
11506
+ xmlns: "http://www.w3.org/2000/svg"
11507
+ },
11508
+ /* @__PURE__ */ React121.createElement("circle", { cx: "4", cy: "4.5", r: "4", fill: "#F34126" }),
11509
+ /* @__PURE__ */ React121.createElement(
11510
+ "path",
11511
+ {
11512
+ d: "M2.57111 2.59761L4 4.02654L5.42889 2.59761C5.54807 2.47844 5.7369 2.46734 5.87797 2.57755L5.90238 2.59979C6.03254 2.72994 6.03254 2.94096 5.90238 3.07111L4.47346 4.5L5.90238 5.92889C6.02156 6.04806 6.03266 6.2369 5.92244 6.37797L5.90022 6.40239C5.77007 6.53254 5.55904 6.53254 5.42888 6.40238L4 4.97346L2.57111 6.40239C2.45193 6.52156 2.2631 6.53266 2.12203 6.42245L2.09761 6.40021C1.96746 6.27006 1.96746 6.05904 2.09761 5.92889L3.52654 4.5L2.09761 3.07111C1.97844 2.95194 1.96734 2.7631 2.07755 2.62203L2.09978 2.59761C2.22993 2.46746 2.44095 2.46746 2.57111 2.59761ZM2.36024 6.33149L2.35293 6.33242C2.35536 6.33217 2.3578 6.33185 2.36024 6.33149ZM2.31088 6.33152L2.31385 6.33194L2.31088 6.33152ZM2.3814 6.3269L2.37242 6.3292C2.37542 6.32852 2.37842 6.32775 2.3814 6.3269ZM2.40026 6.32026L2.39333 6.323C2.39564 6.32215 2.39795 6.32123 2.40026 6.32026ZM2.25106 6.31043L2.23334 6.29839C2.24074 6.30415 2.2485 6.30919 2.25656 6.31353L2.25106 6.31043ZM2.41976 6.31047L2.4144 6.31349C2.4144 6.31349 2.41796 6.31153 2.41976 6.31047ZM5.81353 6.24343L5.81042 6.24894L5.79839 6.26667C5.80415 6.25927 5.80919 6.25149 5.81353 6.24343ZM5.82275 6.2231L5.82025 6.22939C5.82114 6.22729 5.82197 6.2252 5.82275 6.2231ZM5.82913 6.20184L5.82703 6.21006C5.82778 6.20739 5.8285 6.20462 5.82913 6.20184ZM5.83241 6.18215L5.83152 6.18912C5.83186 6.18683 5.83216 6.18449 5.83241 6.18215ZM5.66455 2.83328L4 4.49787L2.33545 2.83328L2.33327 2.83545L3.99787 4.5L2.33327 6.16455L2.33545 6.16672L4 4.50213L5.66455 6.16672L5.66673 6.16455L4.00213 4.5L5.66673 2.83545L5.66455 2.83328ZM5.83331 6.16189L5.83332 6.16672L5.83331 6.16189ZM5.83149 6.13977L5.83242 6.14707C5.83216 6.14465 5.83186 6.1422 5.83149 6.13977ZM5.8269 6.1186L5.8292 6.12758C5.82852 6.12458 5.82776 6.12158 5.8269 6.1186ZM5.82026 6.09974L5.823 6.10667C5.82214 6.10436 5.82123 6.10204 5.82026 6.09974ZM5.81048 6.08024L5.81349 6.0856C5.81349 6.0856 5.81153 6.08203 5.81048 6.08024ZM2.18651 2.9144L2.18903 2.9189L2.18651 2.9144ZM2.177 2.89333L2.17924 2.89907C2.17845 2.89716 2.17772 2.89526 2.177 2.89333ZM2.1708 2.87242L2.17226 2.87835C2.17174 2.87638 2.17125 2.87441 2.1708 2.87242ZM2.16751 2.85227L2.16806 2.85705L2.16751 2.85227ZM2.16674 2.83061L2.16667 2.83545L2.16674 2.83061ZM2.16848 2.81088L2.16806 2.81385L2.16848 2.81088ZM2.18957 2.75106L2.20161 2.73333C2.19585 2.74073 2.1908 2.74851 2.18647 2.75657L2.18957 2.75106ZM2.41433 2.68647L2.41984 2.68957L2.43756 2.70161C2.43016 2.69585 2.42238 2.69081 2.41433 2.68647ZM5.5856 2.68651L5.5811 2.68903L5.5856 2.68651ZM2.2565 2.68651L2.25199 2.68903L2.2565 2.68651ZM5.74344 2.68647L5.74894 2.68957L5.76666 2.70161C5.75926 2.69585 5.75149 2.69081 5.74344 2.68647ZM2.27691 2.67725L2.27183 2.67924L2.27691 2.67725ZM2.3933 2.67699L2.40029 2.67975C2.39796 2.67877 2.39564 2.67785 2.3933 2.67699ZM5.60667 2.677L5.60093 2.67924C5.60284 2.67846 5.60473 2.67771 5.60667 2.677ZM5.7231 2.67725L5.72939 2.67975C5.72729 2.67887 5.7252 2.67804 5.7231 2.67725ZM2.29821 2.67086L2.29254 2.67226L2.29821 2.67086ZM2.37241 2.6708L2.38143 2.6731C2.37842 2.67225 2.37542 2.67148 2.37241 2.6708ZM5.62758 2.6708L5.62165 2.67226C5.62363 2.67173 5.62559 2.67125 5.62758 2.6708ZM5.70184 2.67087L5.71006 2.67297C5.7074 2.67221 5.70463 2.67151 5.70184 2.67087ZM2.31856 2.66752L2.31385 2.66806L2.31856 2.66752ZM2.35224 2.66751L2.36022 2.66851C2.35757 2.66811 2.35491 2.66778 2.35224 2.66751ZM5.64774 2.66751L5.64295 2.66806L5.64774 2.66751ZM5.68148 2.66752L5.68912 2.66848C5.68661 2.6681 5.68405 2.66778 5.68148 2.66752ZM5.65972 2.66674L5.66941 2.66674C5.66618 2.66664 5.66295 2.66664 5.65972 2.66674ZM2.33059 2.66674L2.34028 2.66674C2.33705 2.66664 2.33382 2.66664 2.33059 2.66674Z",
11513
+ fill: "white"
11514
+ }
11614
11515
  )
11615
- });
11616
- if (isNotNullish(highestValueStableAssetOnTargetChain) && isAssetUsdAmountSufficient(
11617
- checkoutItem,
11618
- usableAssetHoldingMap[highestValueStableAssetOnTargetChain]
11619
- )) {
11620
- return {
11621
- symbol: highestValueStableAssetOnTargetChain,
11622
- label: "Cheapest"
11623
- };
11624
- }
11625
- const targetChainIdEthSymbol = combineChainSymbolOrAddress({
11626
- chainId: targetChainId,
11627
- symbolOrAddress: "ETH"
11628
- });
11629
- if (isNotNullish(targetChainIdEthSymbol) && isAssetUsdAmountSufficient(
11630
- checkoutItem,
11631
- usableAssetHoldingMap[targetChainIdEthSymbol]
11632
- )) {
11633
- return {
11634
- symbol: targetChainIdEthSymbol,
11635
- label: "Cheapest"
11636
- };
11637
- }
11638
- const targetChainCoreToken = targetChainId ? FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO7[targetChainId].coreToken : null;
11639
- const targetChainIdAndCoreTokenSymbol = targetChainCoreToken?.symbol && combineChainSymbolOrAddress({
11640
- chainId: targetChainId,
11641
- symbolOrAddress: targetChainCoreToken?.symbol
11642
- });
11643
- if (isNotNullish(targetChainIdAndCoreTokenSymbol) && isAssetUsdAmountSufficient(
11644
- checkoutItem,
11645
- usableAssetHoldingMap[targetChainIdAndCoreTokenSymbol]
11646
- )) {
11647
- return {
11648
- symbol: targetChainIdAndCoreTokenSymbol,
11649
- label: "Cheapest"
11650
- };
11651
- }
11652
- const highestValueUsableL2Asset = assetsOnL2.length ? getAssetSymbolWithMaxUsdValue({
11653
- accountHoldingsMap: usableAssetHoldingMap,
11654
- filterSymbols: assetsOnL2
11655
- }) : null;
11656
- const highestValueUsableL2UsdAmount = highestValueUsableL2Asset ? usableAssetHoldingMap[highestValueUsableL2Asset]?.usdAmount || 0 : null;
11657
- if (targetChainId !== mainnet4.id.toString() && isNotNullish(highestValueUsableL2Asset) && isAssetUsdAmountSufficient(
11658
- checkoutItem,
11659
- usableAssetHoldingMap[highestValueUsableL2Asset]
11660
- )) {
11661
- return {
11662
- symbol: highestValueUsableL2Asset,
11663
- label: "Cheapest"
11664
- };
11665
- }
11666
- const highestValueUsableAssetUsdAmount = highestValueUsableAssetSymbol ? usableAssetHoldingMap[highestValueUsableAssetSymbol]?.usdAmount || 0 : null;
11667
- if (isNotNullish(highestValueUsableL2UsdAmount) && isNotNullish(highestValueUsableL2Asset) && highestValueUsableL2UsdAmount * L2_COST_MARGIN_MULTIPLIER > (highestValueUsableAssetUsdAmount || 0)) {
11668
- return {
11669
- symbol: highestValueUsableL2Asset,
11670
- label: null
11671
- };
11672
- }
11673
- return {
11674
- symbol: highestValueUsableAssetSymbol,
11675
- label: null
11676
- };
11516
+ );
11677
11517
  };
11678
- var getTotalAssetBalance = (assets) => {
11679
- const maxUsdBalance = Object.values(assets).reduce(
11680
- (acc, { usdAmount }) => (usdAmount ?? 0) + acc,
11681
- 0
11518
+
11519
+ // src/modals/ProfileDetails/FunProfileViews/Home/HomeCheckoutDisplayRow.css.ts
11520
+ var homeCheckoutDisplayRowStyle = { defaultBorder: "ukct4t1 _1rsrm2f10k _1rsrm2fwo", defaultBackground: "_1rsrm2fpq _1rsrm2fls", hoverBackground: "_1rsrm2fll" };
11521
+
11522
+ // src/modals/ProfileDetails/FunProfileViews/Home/HomeCheckoutDisplayRow.tsx
11523
+ var HOME_CHECKOUT_DISPLAY_ROW_HEIGHT = 52;
11524
+ var ASSET_ICON_SIZE = "24";
11525
+ var TEXT_SIZE_MEDIUM = "13";
11526
+ var TEXT_SIZE_SMALL = "10";
11527
+ var STATUS_FLEX_GAP_X = "4";
11528
+ var STATUS_ICON_SIZE = "8";
11529
+ var STATUS_TEXT_SIZE = TEXT_SIZE_SMALL;
11530
+ var TEXT_SKELETON_MARGIN_TOP = "2";
11531
+ var TEXT_SKELETON_MARGIN_BOTTOM = "3";
11532
+ var TEXT_SKELETON_WIDTH_SHORT = "48";
11533
+ var TEXT_SKELETON_WIDTH_MEDIUM = "72";
11534
+ var TEXT_SKELETON_WIDTH_LONG = "96";
11535
+ var ROW_FLEX_GAP_X = "8";
11536
+ var ROW_PADDING_Y = "8";
11537
+ var HomeCheckoutDisplayRow = ({
11538
+ checkoutHistoryItem,
11539
+ onSelect
11540
+ }) => {
11541
+ const { isProcessing, isCompleted, isError, isExpired, isFailed } = useCheckoutStateBooleans(checkoutHistoryItem.state);
11542
+ const checkoutClientMetadata = checkoutHistoryItem.clientMetadata;
11543
+ const getStatusElement = () => {
11544
+ if (isCompleted) {
11545
+ return /* @__PURE__ */ React122.createElement(
11546
+ Box,
11547
+ {
11548
+ display: "flex",
11549
+ flexDirection: "row",
11550
+ gap: STATUS_FLEX_GAP_X,
11551
+ alignItems: "center"
11552
+ },
11553
+ /* @__PURE__ */ React122.createElement(GreenRoundCheckmark, { size: parseInt(STATUS_ICON_SIZE) }),
11554
+ /* @__PURE__ */ React122.createElement(Text, { size: STATUS_TEXT_SIZE, color: "success" }, "Completed")
11555
+ );
11556
+ } else if (isError || isFailed || isExpired) {
11557
+ return /* @__PURE__ */ React122.createElement(
11558
+ Box,
11559
+ {
11560
+ display: "flex",
11561
+ flexDirection: "row",
11562
+ gap: STATUS_FLEX_GAP_X,
11563
+ alignItems: "center"
11564
+ },
11565
+ /* @__PURE__ */ React122.createElement(RedRoundErrorCross, { size: parseInt(STATUS_ICON_SIZE) }),
11566
+ /* @__PURE__ */ React122.createElement(Text, { size: STATUS_TEXT_SIZE, color: "error" }, "Failed")
11567
+ );
11568
+ } else if (isProcessing) {
11569
+ return /* @__PURE__ */ React122.createElement(
11570
+ Box,
11571
+ {
11572
+ display: "flex",
11573
+ flexDirection: "row",
11574
+ gap: STATUS_FLEX_GAP_X,
11575
+ alignItems: "center"
11576
+ },
11577
+ /* @__PURE__ */ React122.createElement(
11578
+ Box,
11579
+ {
11580
+ width: STATUS_ICON_SIZE,
11581
+ height: STATUS_ICON_SIZE,
11582
+ borderRadius: "full",
11583
+ background: "standby"
11584
+ }
11585
+ ),
11586
+ /* @__PURE__ */ React122.createElement(Text, { size: STATUS_TEXT_SIZE, color: "standby" }, "Processing")
11587
+ );
11588
+ }
11589
+ };
11590
+ return /* @__PURE__ */ React122.createElement(
11591
+ Box,
11592
+ {
11593
+ className: clsx8(
11594
+ homeCheckoutDisplayRowStyle.defaultBorder,
11595
+ homeCheckoutDisplayRowStyle.defaultBackground,
11596
+ !isMobile() && homeCheckoutDisplayRowStyle.hoverBackground
11597
+ ),
11598
+ display: "flex",
11599
+ flexDirection: "column",
11600
+ justifyContent: "center",
11601
+ gap: "24",
11602
+ paddingX: PROFILE_SIDE_PADDING,
11603
+ paddingY: ROW_PADDING_Y,
11604
+ role: "button",
11605
+ tabIndex: 0,
11606
+ borderWidth: "2",
11607
+ borderStyle: "solid",
11608
+ onClick: () => {
11609
+ if (checkoutHistoryItem.depositAddr) {
11610
+ onSelect(checkoutHistoryItem.depositAddr, "detail" /* DETAIL */);
11611
+ }
11612
+ }
11613
+ },
11614
+ /* @__PURE__ */ React122.createElement(Box, { display: "flex", alignItems: "center", gap: ROW_FLEX_GAP_X, width: "full" }, isNotNullish(checkoutClientMetadata.initSettings.config.iconSrc) && /* @__PURE__ */ React122.createElement(
11615
+ Box,
11616
+ {
11617
+ display: "flex",
11618
+ alignItems: "center",
11619
+ justifyContent: "center",
11620
+ style: {
11621
+ flexShrink: 0,
11622
+ minWidth: "29px"
11623
+ }
11624
+ },
11625
+ /* @__PURE__ */ React122.createElement(
11626
+ FunAssetAvatar,
11627
+ {
11628
+ assetSrc: checkoutClientMetadata.initSettings.config.iconSrc,
11629
+ assetName: "checkout-asset",
11630
+ assetIconSize: ASSET_ICON_SIZE,
11631
+ prioritizeDefaults: false,
11632
+ chainId: checkoutClientMetadata.initSettings.config.targetChain
11633
+ }
11634
+ )
11635
+ ), /* @__PURE__ */ React122.createElement(Box, { display: "flex", flexDirection: "column", width: "full" }, /* @__PURE__ */ React122.createElement(
11636
+ Box,
11637
+ {
11638
+ display: "flex",
11639
+ justifyContent: "space-between",
11640
+ alignItems: "center",
11641
+ gap: "16"
11642
+ },
11643
+ /* @__PURE__ */ React122.createElement(Text, { size: TEXT_SIZE_MEDIUM, weight: "medium", color: "primaryText" }, checkoutClientMetadata.initSettings.config.checkoutItemTitle),
11644
+ /* @__PURE__ */ React122.createElement(Text, { size: TEXT_SIZE_MEDIUM, weight: "medium", color: "primaryText" }, `${formatCurrencyAndStringify(
11645
+ (checkoutClientMetadata?.finalDollarValue ?? // For backwards compatibility
11646
+ checkoutClientMetadata?.draftDollarValue) || 0
11647
+ )} USD`)
11648
+ ), /* @__PURE__ */ React122.createElement(Box, { display: "flex", justifyContent: "space-between", gap: "16" }, /* @__PURE__ */ React122.createElement(Text, { size: TEXT_SIZE_SMALL, color: "secondaryText" }, formatTimestamp(new Date(checkoutHistoryItem.createdTimeMs), {
11649
+ year: "none",
11650
+ seconds: "none",
11651
+ month: "short"
11652
+ })), /* @__PURE__ */ React122.createElement(Box, null, getStatusElement()))))
11682
11653
  );
11683
- return formatCurrencyAndStringify(maxUsdBalance);
11684
11654
  };
11685
- var FALLBACK_CHAIN_ID = arbitrum.id.toString();
11686
- var getMockedTargetChainId = ({ targetChain }, mockedChains = []) => {
11687
- return mockedChains.includes(targetChain) ? FALLBACK_CHAIN_ID : targetChain;
11655
+ var HomeCheckoutDisplayRowSkeleton = () => {
11656
+ return /* @__PURE__ */ React122.createElement(
11657
+ Box,
11658
+ {
11659
+ display: "flex",
11660
+ flexDirection: "row",
11661
+ alignItems: "center",
11662
+ gap: ROW_FLEX_GAP_X,
11663
+ paddingX: PROFILE_SIDE_PADDING,
11664
+ paddingY: ROW_PADDING_Y
11665
+ },
11666
+ /* @__PURE__ */ React122.createElement(FunSkeletonCircle, { size: ASSET_ICON_SIZE }),
11667
+ /* @__PURE__ */ React122.createElement(Box, { display: "flex", flexDirection: "column", style: { flexGrow: 1 } }, /* @__PURE__ */ React122.createElement(
11668
+ FunSkeletonBlock,
11669
+ {
11670
+ height: TEXT_SIZE_MEDIUM,
11671
+ marginBottom: TEXT_SKELETON_MARGIN_BOTTOM,
11672
+ marginTop: TEXT_SKELETON_MARGIN_TOP,
11673
+ width: TEXT_SKELETON_WIDTH_LONG
11674
+ }
11675
+ ), /* @__PURE__ */ React122.createElement(
11676
+ FunSkeletonBlock,
11677
+ {
11678
+ height: TEXT_SIZE_SMALL,
11679
+ marginBottom: TEXT_SKELETON_MARGIN_BOTTOM,
11680
+ marginTop: TEXT_SKELETON_MARGIN_TOP,
11681
+ width: TEXT_SKELETON_WIDTH_MEDIUM
11682
+ }
11683
+ )),
11684
+ /* @__PURE__ */ React122.createElement(Box, { alignItems: "flex-end", display: "flex", flexDirection: "column" }, /* @__PURE__ */ React122.createElement(
11685
+ FunSkeletonBlock,
11686
+ {
11687
+ height: TEXT_SIZE_MEDIUM,
11688
+ marginBottom: TEXT_SKELETON_MARGIN_BOTTOM,
11689
+ marginTop: TEXT_SKELETON_MARGIN_TOP,
11690
+ width: TEXT_SKELETON_WIDTH_MEDIUM
11691
+ }
11692
+ ), /* @__PURE__ */ React122.createElement(
11693
+ FunSkeletonBlock,
11694
+ {
11695
+ height: STATUS_TEXT_SIZE,
11696
+ marginBottom: TEXT_SKELETON_MARGIN_BOTTOM,
11697
+ marginTop: TEXT_SKELETON_MARGIN_TOP,
11698
+ width: TEXT_SKELETON_WIDTH_SHORT
11699
+ }
11700
+ ))
11701
+ );
11688
11702
  };
11689
11703
 
11690
11704
  // src/modals/ProfileDetails/FunProfileViews/Home/HomeTokenDisplayRow.tsx
11705
+ import React123, { useState as useState27 } from "react";
11691
11706
  var HOME_TOKEN_BALANCE_DISPLAY_ROW_HEIGHT = 52;
11692
11707
  var ASSET_ICON_SIZE2 = "24";
11693
11708
  var TEXT_SIZE = "13";
@@ -12584,7 +12599,9 @@ var hasRisk = async (apiKey, walletAddress, customRecipient) => {
12584
12599
  );
12585
12600
  logger.log("riskAssessment_isCheckoutRisky", {
12586
12601
  isCheckoutRisky,
12587
- addressRisks
12602
+ addressRisks,
12603
+ walletAddress,
12604
+ customRecipient
12588
12605
  });
12589
12606
  return isCheckoutRisky;
12590
12607
  };
@@ -14333,7 +14350,7 @@ function FunPaymentMethods({
14333
14350
  const totalUsableWalletAssetsUsd = Object.values(
14334
14351
  usableWalletAssets ?? {}
14335
14352
  ).reduce((total, asset) => total + (asset.totalUsdValue || 0), 0);
14336
- const isEmptyWallet = totalUsableWalletAssetsUsd < 0.01;
14353
+ const isEmptyWallet = totalUsableWalletAssetsUsd < ASSETS_LOW_VALUE_THRESHOLD;
14337
14354
  const maxUsdUsableAsset = useMemo21(() => {
14338
14355
  if (!usableWalletAssets) {
14339
14356
  return null;
@@ -21287,7 +21304,7 @@ function setFunkitConnectVersion({ version }) {
21287
21304
  localStorage.setItem(storageKey5, version);
21288
21305
  }
21289
21306
  function getCurrentSdkVersion() {
21290
- return "3.4.3";
21307
+ return "3.4.4";
21291
21308
  }
21292
21309
  function useFingerprint() {
21293
21310
  const fingerprint = useCallback37(() => {
@@ -21483,5 +21500,6 @@ export {
21483
21500
  useFunkitAccount,
21484
21501
  useFunkitCheckout,
21485
21502
  useFunkitDisconnect,
21486
- useFunkitSwitchChains
21503
+ useFunkitSwitchChains,
21504
+ useFunkitUserInfo
21487
21505
  };