@embarkai/ui-kit 0.4.51 → 0.4.53
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/iframe/index.html +1 -1
- package/dist/iframe/main.js +1 -1
- package/dist/index.cjs +308 -276
- package/dist/index.d.cts +61 -57
- package/dist/index.d.ts +61 -57
- package/dist/index.js +233 -202
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -805,7 +805,7 @@ var init_iframe_mpc_client = __esm({
|
|
|
805
805
|
|
|
806
806
|
// src/internal/constants.ts
|
|
807
807
|
import { Key, Mail, Wallet2 } from "lucide-react";
|
|
808
|
-
var LOCAL_COLOR_MODE_KEY, LOOCAL_BACKUP_STATUS_KEY, DEFAULT_AUTH_MENU_HEIGHT, DEFAULT_MAIN_MENU_HEIGHT, MAX_CONTENT_HEIGHT, MAIN_DIALOG_ANIMATION_SPEED, Y_ANIMATION_SETUP, BLOCKSCOUT_QUERY_STALE_TIME, BLOCKSCOUT_QUERY_GC_TIME, BLOCKSCOUT_REFRESH_DEBOUNCE, IPFS_GATEWAY, PROVIDERS_META;
|
|
808
|
+
var LOCAL_COLOR_MODE_KEY, LOOCAL_BACKUP_STATUS_KEY, DEFAULT_AUTH_MENU_HEIGHT, DEFAULT_MAIN_MENU_HEIGHT, MAX_CONTENT_HEIGHT, MAIN_DIALOG_ANIMATION_SPEED, Y_ANIMATION_SETUP, BLOCKSCOUT_QUERY_STALE_TIME, BLOCKSCOUT_QUERY_GC_TIME, BLOCKSCOUT_REFRESH_DEBOUNCE, IPFS_GATEWAY, PROVIDERS_META, WRAPPED_TOKENS;
|
|
809
809
|
var init_constants = __esm({
|
|
810
810
|
"src/internal/constants.ts"() {
|
|
811
811
|
init_assets();
|
|
@@ -831,6 +831,7 @@ var init_constants = __esm({
|
|
|
831
831
|
// Alias for twitter (API uses 'x')
|
|
832
832
|
wallet: { name: "Wallet", icon: Wallet2, description: "External wallet (EOA)" }
|
|
833
833
|
};
|
|
834
|
+
WRAPPED_TOKENS = ["WETH", "WBTC", "WBNB", "WLUMIA"];
|
|
834
835
|
}
|
|
835
836
|
});
|
|
836
837
|
|
|
@@ -11429,7 +11430,7 @@ function ChainItem(props) {
|
|
|
11429
11430
|
children: name
|
|
11430
11431
|
}
|
|
11431
11432
|
),
|
|
11432
|
-
/* @__PURE__ */ jsx51(Badge, { variant: "secondary", children: badge })
|
|
11433
|
+
/* @__PURE__ */ jsx51(Badge, { variant: badge.toLowerCase() === "mainnet" ? "success" : "secondary", children: badge })
|
|
11433
11434
|
] }),
|
|
11434
11435
|
isActiveChain && paymasterAddress && /* @__PURE__ */ jsxs45("div", { className: "flex items-center gap-[var(--ui-kit-gap)] text-xs", children: [
|
|
11435
11436
|
/* @__PURE__ */ jsx51("span", { className: "flex-none uppercase", children: "Paymaster" }),
|
|
@@ -11554,7 +11555,7 @@ function ChainsMenu() {
|
|
|
11554
11555
|
/* @__PURE__ */ jsx52(
|
|
11555
11556
|
Switch,
|
|
11556
11557
|
{
|
|
11557
|
-
labels: { checked: "
|
|
11558
|
+
labels: { checked: "MAINNETS", unchecked: "ALL" },
|
|
11558
11559
|
checked: isTestnets,
|
|
11559
11560
|
onChange: () => setIsTestnets(!isTestnets)
|
|
11560
11561
|
}
|
|
@@ -17825,7 +17826,7 @@ var init_BalanceView2 = __esm({
|
|
|
17825
17826
|
});
|
|
17826
17827
|
|
|
17827
17828
|
// src/internal/components/PortfolioMenu/PortfolioItem.tsx
|
|
17828
|
-
import { useQuery as useQuery16
|
|
17829
|
+
import { useQuery as useQuery16 } from "@tanstack/react-query";
|
|
17829
17830
|
import { LoaderIcon as LoaderIcon7, ShieldAlertIcon, SparklesIcon } from "lucide-react";
|
|
17830
17831
|
import { formatUnits as formatUnits5 } from "viem";
|
|
17831
17832
|
import { Fragment as Fragment30, jsx as jsx83, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
@@ -17844,6 +17845,9 @@ function isSecurityToken(asset) {
|
|
|
17844
17845
|
if (!("type" in asset)) return false;
|
|
17845
17846
|
return asset.type === "erc3643";
|
|
17846
17847
|
}
|
|
17848
|
+
function isProjectAssetConfig(asset) {
|
|
17849
|
+
return "balanceQueryKey" in asset && "balanceQuery" in asset;
|
|
17850
|
+
}
|
|
17847
17851
|
function isAssetRateAvailable(symbol) {
|
|
17848
17852
|
switch (symbol) {
|
|
17849
17853
|
// list of prohibited symbols without market data on Binance
|
|
@@ -17856,7 +17860,7 @@ function isAssetRateAvailable(symbol) {
|
|
|
17856
17860
|
}
|
|
17857
17861
|
}
|
|
17858
17862
|
function checkWrapedTokenSymbol(symbol) {
|
|
17859
|
-
if (
|
|
17863
|
+
if (WRAPPED_TOKENS.includes(symbol)) {
|
|
17860
17864
|
return symbol.slice(1);
|
|
17861
17865
|
}
|
|
17862
17866
|
return symbol.toUpperCase();
|
|
@@ -17927,11 +17931,17 @@ function PortfolioItemImage(props) {
|
|
|
17927
17931
|
function PortfolioItem(props) {
|
|
17928
17932
|
const { address, asset, isProjectAsset } = props;
|
|
17929
17933
|
const providerConfig = useProviderConfig().config.current;
|
|
17930
|
-
const { assets: projectAssets, showBalanceAs: showBalanceAsSymbol } = providerConfig.projectAssets || {};
|
|
17931
17934
|
const customAssetRateQuery = providerConfig.portfolio?.assetRateQuery;
|
|
17932
|
-
const
|
|
17933
|
-
|
|
17934
|
-
|
|
17935
|
+
const projectAssetQuery = isProjectAsset && isProjectAssetConfig(asset) ? {
|
|
17936
|
+
queryKey: asset.balanceQueryKey,
|
|
17937
|
+
queryFn: asset.balanceQuery
|
|
17938
|
+
} : void 0;
|
|
17939
|
+
const { data: projectAssetBalance } = useQuery16({
|
|
17940
|
+
enabled: !!projectAssetQuery,
|
|
17941
|
+
retry: false,
|
|
17942
|
+
queryKey: projectAssetQuery?.queryKey ?? ["project-asset-balance-disabled", asset.symbol],
|
|
17943
|
+
queryFn: async () => projectAssetQuery?.queryFn() ?? null
|
|
17944
|
+
});
|
|
17935
17945
|
const isNft = isNftAsset(asset);
|
|
17936
17946
|
const isSecurity = isSecurityToken(asset);
|
|
17937
17947
|
const embeddedRate = Number(asset.exchangeRateUsd || 0);
|
|
@@ -17944,8 +17954,8 @@ function PortfolioItem(props) {
|
|
|
17944
17954
|
// customAssetRateQueryKey
|
|
17945
17955
|
queryFn: async () => await resolveAssetRate(asset.symbol, asset.address, customAssetRateQuery)
|
|
17946
17956
|
});
|
|
17947
|
-
const
|
|
17948
|
-
const renderBalance =
|
|
17957
|
+
const hasProjectAssetBalance = isProjectAsset && projectAssetBalance != null;
|
|
17958
|
+
const renderBalance = hasProjectAssetBalance ? projectAssetBalance.cryptoFormatted : Number(formatUnits5(BigInt(asset?.balance || "0"), asset?.decimals || 18));
|
|
17949
17959
|
const resolvedRate = hasEmbeddedRate ? embeddedRate : Number(assetRate?.price || 0);
|
|
17950
17960
|
const usdRenderBalance = resolvedRate > 0 ? renderBalance * resolvedRate : 0;
|
|
17951
17961
|
const shortContractAddress = asset.address ? truncateMiddle(asset.address, 6, 4) : null;
|
|
@@ -18008,10 +18018,11 @@ function PortfolioItem(props) {
|
|
|
18008
18018
|
}
|
|
18009
18019
|
);
|
|
18010
18020
|
}
|
|
18011
|
-
var
|
|
18021
|
+
var SKIP_SYMBOLS2, ASSETS_RATES_QUERY_KEY;
|
|
18012
18022
|
var init_PortfolioItem = __esm({
|
|
18013
18023
|
"src/internal/components/PortfolioMenu/PortfolioItem.tsx"() {
|
|
18014
18024
|
init_ProviderContext();
|
|
18025
|
+
init_constants();
|
|
18015
18026
|
init_no_image();
|
|
18016
18027
|
init_tokens();
|
|
18017
18028
|
init_base2();
|
|
@@ -18019,21 +18030,20 @@ var init_PortfolioItem = __esm({
|
|
|
18019
18030
|
init_utils2();
|
|
18020
18031
|
init_truncateMiddle();
|
|
18021
18032
|
init_BalanceView2();
|
|
18022
|
-
WRAPPED_SYMBOLS = ["WETH", "WBTC", "WBNB", "WLUMIA"];
|
|
18023
18033
|
SKIP_SYMBOLS2 = ["TEST"];
|
|
18024
18034
|
ASSETS_RATES_QUERY_KEY = "lumia-passport-assets-rates-query-key";
|
|
18025
18035
|
}
|
|
18026
18036
|
});
|
|
18027
18037
|
|
|
18028
18038
|
// src/internal/components/PortfolioMenu/PortfolioMenu.tsx
|
|
18029
|
-
import { useQueryClient as
|
|
18039
|
+
import { useQueryClient as useQueryClient19 } from "@tanstack/react-query";
|
|
18030
18040
|
import { AlertCircle as AlertCircle4, ArrowLeft as ArrowLeft16, Gem, Loader as Loader19, RefreshCw as RefreshCw2 } from "lucide-react";
|
|
18031
18041
|
import { useCallback as useCallback23 } from "react";
|
|
18032
18042
|
import { jsx as jsx84, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
18033
18043
|
function PortfolioMenu() {
|
|
18034
18044
|
const { assets: projectAssets = [] } = useProviderConfig().config.current?.projectAssets || {};
|
|
18035
18045
|
const { t } = useT();
|
|
18036
|
-
const qc =
|
|
18046
|
+
const qc = useQueryClient19();
|
|
18037
18047
|
const address = useSession((st) => st.address);
|
|
18038
18048
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
18039
18049
|
const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
|
|
@@ -18329,17 +18339,11 @@ var init_ReceiveMenu2 = __esm({
|
|
|
18329
18339
|
});
|
|
18330
18340
|
|
|
18331
18341
|
// src/internal/components/SecurityMenu/constants.ts
|
|
18332
|
-
var KEYSHARE_RECOVERY_STATS_QUERY, CONNECTED_TRUSTED_APPS_QUERY
|
|
18342
|
+
var KEYSHARE_RECOVERY_STATS_QUERY, CONNECTED_TRUSTED_APPS_QUERY;
|
|
18333
18343
|
var init_constants5 = __esm({
|
|
18334
18344
|
"src/internal/components/SecurityMenu/constants.ts"() {
|
|
18335
18345
|
KEYSHARE_RECOVERY_STATS_QUERY = "keyshare-recovery-stats-query";
|
|
18336
18346
|
CONNECTED_TRUSTED_APPS_QUERY = "connected-trusted-apps-query";
|
|
18337
|
-
WELL_KNOWN_PROJECTS = {
|
|
18338
|
-
// '327733f6-2e85-4afc-a505-e2c55d0a2659': 'https://staging-hub.lumia.org',
|
|
18339
|
-
"11062797-f0a6-4737-bad8-086d1125dde1": "https://parlay.money",
|
|
18340
|
-
"f7a70f92-58e9-4fe9-b713-61c27a24e3d6": "https://embark-demo-dapp.pages.dev"
|
|
18341
|
-
// https://account.embarkai.io
|
|
18342
|
-
};
|
|
18343
18347
|
}
|
|
18344
18348
|
});
|
|
18345
18349
|
|
|
@@ -18399,7 +18403,7 @@ import { Fragment as Fragment32, jsx as jsx86, jsxs as jsxs80 } from "react/jsx-
|
|
|
18399
18403
|
function Application(props) {
|
|
18400
18404
|
const { projectId, logo, name, appUrl, trustedAuthorizedApp, firstConnectedAt, untrustApp } = props;
|
|
18401
18405
|
const { t } = useT();
|
|
18402
|
-
const projectUrl = appUrl ||
|
|
18406
|
+
const projectUrl = appUrl || null;
|
|
18403
18407
|
return /* @__PURE__ */ jsxs80(
|
|
18404
18408
|
"div",
|
|
18405
18409
|
{
|
|
@@ -18512,7 +18516,6 @@ var init_ConnectedApps = __esm({
|
|
|
18512
18516
|
init_i18n();
|
|
18513
18517
|
init_button();
|
|
18514
18518
|
init_highlight();
|
|
18515
|
-
init_constants5();
|
|
18516
18519
|
init_hooks2();
|
|
18517
18520
|
}
|
|
18518
18521
|
});
|
|
@@ -18755,12 +18758,12 @@ var init_UntrustApplication = __esm({
|
|
|
18755
18758
|
});
|
|
18756
18759
|
|
|
18757
18760
|
// src/internal/components/SecurityMenu/SecurityMenu.tsx
|
|
18758
|
-
import { useMutation as useMutation17, useQueryClient as
|
|
18761
|
+
import { useMutation as useMutation17, useQueryClient as useQueryClient20 } from "@tanstack/react-query";
|
|
18759
18762
|
import { ArrowLeft as ArrowLeft18 } from "lucide-react";
|
|
18760
18763
|
import { useState as useState24 } from "react";
|
|
18761
18764
|
import { jsx as jsx91, jsxs as jsxs85 } from "react/jsx-runtime";
|
|
18762
18765
|
function SecurityMenu() {
|
|
18763
|
-
const qc =
|
|
18766
|
+
const qc = useQueryClient20();
|
|
18764
18767
|
const { t } = useT();
|
|
18765
18768
|
const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
|
|
18766
18769
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
@@ -19376,7 +19379,6 @@ function useAvailableSenders() {
|
|
|
19376
19379
|
return;
|
|
19377
19380
|
}
|
|
19378
19381
|
lastCalcedSenders.current = sendersAccumulator.map((s) => `${s.name}-${s.address}`);
|
|
19379
|
-
console.info("[SENDER SELECTOR] setting bridge senders", sendersAccumulator);
|
|
19380
19382
|
useBridgeStore.getState().setBridgeSenders(sendersAccumulator);
|
|
19381
19383
|
useFlowSelectorStore.getState().setRenderKey(`sender-selected-${Date.now()}`);
|
|
19382
19384
|
}, [address, profiles]);
|
|
@@ -19776,11 +19778,11 @@ var init_useOperationHashesStore = __esm({
|
|
|
19776
19778
|
});
|
|
19777
19779
|
|
|
19778
19780
|
// src/internal/components/SendMenu/hyperbridge/hooks/useBridge.ts
|
|
19779
|
-
import { useMutation as useMutation19, useQueryClient as
|
|
19781
|
+
import { useMutation as useMutation19, useQueryClient as useQueryClient21 } from "@tanstack/react-query";
|
|
19780
19782
|
import { useCallback as useCallback26 } from "react";
|
|
19781
19783
|
import { useSwitchChain, useWalletClient } from "wagmi";
|
|
19782
19784
|
function useBridge() {
|
|
19783
|
-
const qc =
|
|
19785
|
+
const qc = useQueryClient21();
|
|
19784
19786
|
const { t } = useT();
|
|
19785
19787
|
const address = useSession((st) => st.address);
|
|
19786
19788
|
const { data: walletClient } = useWalletClient();
|
|
@@ -19995,7 +19997,11 @@ function useHyperlaneRoutes() {
|
|
|
19995
19997
|
retry: false,
|
|
19996
19998
|
enabled: !!address && page === "send" /* SEND */ && flow === "bridge",
|
|
19997
19999
|
queryKey: [HYPERLANE_WARP_ROUTES_QUERY_KEY, address],
|
|
19998
|
-
queryFn: async () =>
|
|
20000
|
+
queryFn: async () => {
|
|
20001
|
+
const warpRoutes = await getHyperlaneWarpRoutes();
|
|
20002
|
+
useFlowSelectorStore.getState().setRenderKey(`hyperlane-bridge-warp-routes-loaded-${Date.now()}`);
|
|
20003
|
+
return warpRoutes;
|
|
20004
|
+
}
|
|
19999
20005
|
});
|
|
20000
20006
|
useEffect35(() => {
|
|
20001
20007
|
if (!errorWarpRoutes) return;
|
|
@@ -20096,12 +20102,18 @@ var init_ResolveChainIcon = __esm({
|
|
|
20096
20102
|
|
|
20097
20103
|
// src/internal/components/SendMenu/hyperbridge/hooks/useBridgeBalance.ts
|
|
20098
20104
|
import { CHAINS_BROWSERS_TRANSPORTS as CHAINS_BROWSERS_TRANSPORTS2 } from "@embarkai/core";
|
|
20099
|
-
import { useQuery as useQuery20, useQueryClient as
|
|
20105
|
+
import { useQuery as useQuery20, useQueryClient as useQueryClient22 } from "@tanstack/react-query";
|
|
20100
20106
|
import { useCallback as useCallback27, useEffect as useEffect37 } from "react";
|
|
20101
20107
|
import { createPublicClient as createPublicClient2, erc20Abi as erc20Abi2, formatUnits as formatUnits7, http as http3 } from "viem";
|
|
20102
20108
|
import { useSwitchChain as useSwitchChain2 } from "wagmi";
|
|
20109
|
+
function checkWrapedTokenSymbol2(symbol) {
|
|
20110
|
+
if (WRAPPED_TOKENS.includes(symbol)) {
|
|
20111
|
+
return symbol.slice(1);
|
|
20112
|
+
}
|
|
20113
|
+
return symbol.toUpperCase();
|
|
20114
|
+
}
|
|
20103
20115
|
function useBridgeBalance(hyperlaneWarpRoutes) {
|
|
20104
|
-
const qc =
|
|
20116
|
+
const qc = useQueryClient22();
|
|
20105
20117
|
const { t } = useT();
|
|
20106
20118
|
const address = useSession((st) => st.address);
|
|
20107
20119
|
const directWalletAddress = useExternalWalletStore((st) => st.externalAddress);
|
|
@@ -20125,7 +20137,7 @@ function useBridgeBalance(hyperlaneWarpRoutes) {
|
|
|
20125
20137
|
enabled: bridgeSender === "embarkai-wallet" && !!selectedWarpRoute && !!address && !!originChain,
|
|
20126
20138
|
address
|
|
20127
20139
|
});
|
|
20128
|
-
const embarkTokenBalanace = assets.find((a) =>
|
|
20140
|
+
const embarkTokenBalanace = assets.find((a) => selectedWarpRoute?.symbol === checkWrapedTokenSymbol2(a.symbol));
|
|
20129
20141
|
const originChainMeta = CHAINS_UI_META[originChain];
|
|
20130
20142
|
const isSelectedTokenNative = selectedWarpRoute?.symbol?.toUpperCase() === originChainMeta?.chain?.nativeCurrency?.symbol?.toUpperCase();
|
|
20131
20143
|
const { data: externalBalanceData, isLoading: isExternalBalanceLoading } = useQuery20({
|
|
@@ -20236,6 +20248,7 @@ function useBridgeBalance(hyperlaneWarpRoutes) {
|
|
|
20236
20248
|
var EXTERNAL_WALLET_BRIDGING_BALANCE_QUERY, EXTERNAL_WALLET_BRIDGING_NATIVE_BALANCE_QUERY;
|
|
20237
20249
|
var init_useBridgeBalance = __esm({
|
|
20238
20250
|
"src/internal/components/SendMenu/hyperbridge/hooks/useBridgeBalance.ts"() {
|
|
20251
|
+
init_constants();
|
|
20239
20252
|
init_SessionContext();
|
|
20240
20253
|
init_i18n();
|
|
20241
20254
|
init_useBlockscoutAssets();
|
|
@@ -20254,10 +20267,10 @@ import { ArrowLeftRightIcon, ArrowRightLeftIcon, LoaderIcon as LoaderIcon9, Wall
|
|
|
20254
20267
|
import { Fragment as Fragment35 } from "react";
|
|
20255
20268
|
import { Fragment as Fragment36, jsx as jsx96, jsxs as jsxs89 } from "react/jsx-runtime";
|
|
20256
20269
|
function SelectStep(props) {
|
|
20257
|
-
const { swapChains, hyperlaneWarpRoutes, isLoadingWarpRoutes, handleQuoteEstimation } = props;
|
|
20270
|
+
const { swapChains, hyperlaneWarpRoutes = [], isLoadingWarpRoutes, handleQuoteEstimation } = props;
|
|
20258
20271
|
const { t } = useT();
|
|
20259
20272
|
const {
|
|
20260
|
-
bridgeSenders,
|
|
20273
|
+
bridgeSenders = [],
|
|
20261
20274
|
bridgeSender,
|
|
20262
20275
|
originChain,
|
|
20263
20276
|
destinationChain,
|
|
@@ -20761,7 +20774,7 @@ var init_SuccessStep = __esm({
|
|
|
20761
20774
|
});
|
|
20762
20775
|
|
|
20763
20776
|
// src/internal/components/SendMenu/hyperbridge/steps/HistoryStep.tsx
|
|
20764
|
-
import { useQueryClient as
|
|
20777
|
+
import { useQueryClient as useQueryClient23 } from "@tanstack/react-query";
|
|
20765
20778
|
import dayjs7 from "dayjs";
|
|
20766
20779
|
import { ArrowRightIcon, DownloadIcon as DownloadIcon2, ExternalLinkIcon as ExternalLinkIcon3, InfoIcon as InfoIcon4, LoaderIcon as LoaderIcon11 } from "lucide-react";
|
|
20767
20780
|
import { jsx as jsx100, jsxs as jsxs92 } from "react/jsx-runtime";
|
|
@@ -20882,7 +20895,7 @@ function HistoryItem(props) {
|
|
|
20882
20895
|
txStatus
|
|
20883
20896
|
} = props;
|
|
20884
20897
|
const { t } = useT();
|
|
20885
|
-
const qc =
|
|
20898
|
+
const qc = useQueryClient23();
|
|
20886
20899
|
const address = useSession((st) => st.address);
|
|
20887
20900
|
const warpRoutes = qc.getQueryData([HYPERLANE_WARP_ROUTES_QUERY_KEY, address]);
|
|
20888
20901
|
const assetWarpRoute = warpRoutes?.find((route) => {
|
|
@@ -21165,12 +21178,11 @@ function HyperlaneBridge() {
|
|
|
21165
21178
|
const { hyperlaneWarpRoutes, isLoadingWarpRoutes } = useHyperlaneRoutes();
|
|
21166
21179
|
const { directWalletProfile } = useAvailableSenders();
|
|
21167
21180
|
useMenuTitle(hyperlaneWarpRoutes);
|
|
21168
|
-
useEffect38(
|
|
21169
|
-
|
|
21181
|
+
useEffect38(() => {
|
|
21182
|
+
return () => {
|
|
21170
21183
|
useBridgeStore.getState().resetSelections();
|
|
21171
|
-
}
|
|
21172
|
-
|
|
21173
|
-
);
|
|
21184
|
+
};
|
|
21185
|
+
}, []);
|
|
21174
21186
|
return /* @__PURE__ */ jsxs94(Fragment38, { children: [
|
|
21175
21187
|
bridgeStep === "sender-selector" && /* @__PURE__ */ jsx102(SenderSelector, { directWalletProfile }),
|
|
21176
21188
|
bridgeStep === "select" && /* @__PURE__ */ jsx102(
|
|
@@ -21321,7 +21333,7 @@ var init_useErc3643Compliance = __esm({
|
|
|
21321
21333
|
|
|
21322
21334
|
// src/hooks/useNicknameResolve.ts
|
|
21323
21335
|
import { useQuery as useQuery21 } from "@tanstack/react-query";
|
|
21324
|
-
import {
|
|
21336
|
+
import { useEffect as useEffect39, useMemo as useMemo14, useState as useState28 } from "react";
|
|
21325
21337
|
function looksLikeNickname(input) {
|
|
21326
21338
|
if (!input) return false;
|
|
21327
21339
|
if (input.startsWith("0x")) return false;
|
|
@@ -21352,7 +21364,7 @@ function useNicknameResolve(input, options) {
|
|
|
21352
21364
|
}, [normalized, isNicknameInput, enabled]);
|
|
21353
21365
|
const query = useQuery21({
|
|
21354
21366
|
queryKey: [...QUERY_KEYS.nicknameResolve(debouncedInput), chainId],
|
|
21355
|
-
queryFn: () => resolveNickname(debouncedInput, chainId),
|
|
21367
|
+
queryFn: async () => await resolveNickname(debouncedInput, chainId),
|
|
21356
21368
|
enabled: enabled && isNicknameInput && debouncedInput.length > 0,
|
|
21357
21369
|
staleTime: 1e3 * 60 * 5,
|
|
21358
21370
|
// 5 minutes - addresses don't change often
|
|
@@ -21388,8 +21400,8 @@ var init_useNicknameResolve = __esm({
|
|
|
21388
21400
|
"src/hooks/useNicknameResolve.ts"() {
|
|
21389
21401
|
init_nickname();
|
|
21390
21402
|
init_profile();
|
|
21391
|
-
init_nickname_validation();
|
|
21392
21403
|
init_nickname_fingerprint();
|
|
21404
|
+
init_nickname_validation();
|
|
21393
21405
|
DEBOUNCE_MS2 = 300;
|
|
21394
21406
|
}
|
|
21395
21407
|
});
|
|
@@ -21833,79 +21845,84 @@ var init_AssetList = __esm({
|
|
|
21833
21845
|
});
|
|
21834
21846
|
|
|
21835
21847
|
// src/internal/components/SendMenu/send/components/NicknameData.tsx
|
|
21836
|
-
import {
|
|
21848
|
+
import { AtSign as AtSign2, CheckCircle2 as CheckCircle24, ShieldAlert, ShieldCheck as ShieldCheck2 } from "lucide-react";
|
|
21849
|
+
import { useEffect as useEffect40 } from "react";
|
|
21837
21850
|
import { jsx as jsx107, jsxs as jsxs98 } from "react/jsx-runtime";
|
|
21838
21851
|
function NicknameData(props) {
|
|
21839
21852
|
const { resolvedNicknameData, isNicknameInput } = props;
|
|
21840
21853
|
const {
|
|
21854
|
+
data: nicknameData,
|
|
21841
21855
|
resolvedAddress,
|
|
21842
21856
|
isResolving,
|
|
21857
|
+
isFingerprintVerified,
|
|
21843
21858
|
isNotFound,
|
|
21844
21859
|
isWalletNotSetup,
|
|
21845
|
-
isFrozen
|
|
21846
|
-
isFingerprintVerified,
|
|
21847
|
-
data: nicknameData
|
|
21860
|
+
isFrozen
|
|
21848
21861
|
} = resolvedNicknameData;
|
|
21849
|
-
|
|
21850
|
-
|
|
21851
|
-
|
|
21852
|
-
|
|
21853
|
-
|
|
21862
|
+
useEffect40(() => {
|
|
21863
|
+
if (!resolvedNicknameData?.data?.fingerprint || !isNicknameInput) return;
|
|
21864
|
+
useFlowSelectorStore.getState().setRenderKey(`nickname-resolved-${Date.now()}`);
|
|
21865
|
+
}, [resolvedNicknameData, isNicknameInput]);
|
|
21866
|
+
useEffect40(() => {
|
|
21867
|
+
if (isResolving) return;
|
|
21868
|
+
let errMessage = null;
|
|
21869
|
+
switch (true) {
|
|
21870
|
+
case isNotFound:
|
|
21871
|
+
errMessage = "Nickname not found";
|
|
21872
|
+
break;
|
|
21873
|
+
case isWalletNotSetup:
|
|
21874
|
+
errMessage = "This user has not set up wallet yet";
|
|
21875
|
+
break;
|
|
21876
|
+
case isFrozen:
|
|
21877
|
+
errMessage = "This handle is frozen. Proceed with caution.";
|
|
21878
|
+
break;
|
|
21879
|
+
default:
|
|
21880
|
+
errMessage = null;
|
|
21881
|
+
}
|
|
21882
|
+
if (!errMessage) return;
|
|
21883
|
+
useFlowSelectorStore.getState().setError(errMessage);
|
|
21884
|
+
}, [isResolving, isNotFound, isWalletNotSetup, isFrozen]);
|
|
21885
|
+
if (isResolving || !isNicknameInput || !resolvedAddress || !nicknameData) return null;
|
|
21886
|
+
return /* @__PURE__ */ jsxs98("div", { className: "flex items-center gap-[var(--ui-kit-gap)] rounded-[var(--ui-kit-el-bdrs)] px-[var(--ui-kit-gap)]", children: [
|
|
21887
|
+
nicknameData.avatarSvg ? /* @__PURE__ */ jsx107(
|
|
21888
|
+
"img",
|
|
21889
|
+
{
|
|
21890
|
+
src: nicknameData.avatarSvg,
|
|
21891
|
+
alt: nicknameData.handle,
|
|
21892
|
+
className: "w-12 h-12 rounded-full object-cover flex-shrink-0",
|
|
21893
|
+
onError: (e) => {
|
|
21894
|
+
e.currentTarget.onerror = null;
|
|
21895
|
+
e.currentTarget.src = no_image_default;
|
|
21896
|
+
}
|
|
21897
|
+
}
|
|
21898
|
+
) : /* @__PURE__ */ jsx107("div", { className: "w-12 h-12 rounded-full bg-[var(--ui-kit-secondary)] flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsx107(AtSign2, { className: "w-5 h-5" }) }),
|
|
21899
|
+
/* @__PURE__ */ jsxs98("div", { className: "flex flex-col gap-1", children: [
|
|
21900
|
+
/* @__PURE__ */ jsxs98("div", { className: "flex items-center gap-[var(--ui-kit-gap)] text-[10px] text-[var(--ui-kit-bg-success)]", children: [
|
|
21901
|
+
/* @__PURE__ */ jsx107(CheckCircle24, { className: "w-4 h-4 flex-shrink-0" }),
|
|
21902
|
+
/* @__PURE__ */ jsx107("span", { children: nicknameData.handle })
|
|
21903
|
+
] }),
|
|
21904
|
+
nicknameData.fingerprint && /* @__PURE__ */ jsxs98(
|
|
21905
|
+
"div",
|
|
21854
21906
|
{
|
|
21855
|
-
|
|
21856
|
-
|
|
21857
|
-
|
|
21858
|
-
|
|
21859
|
-
|
|
21860
|
-
|
|
21861
|
-
|
|
21907
|
+
className: cn(
|
|
21908
|
+
"flex items-center gap-[var(--ui-kit-gap)] text-[10px]",
|
|
21909
|
+
isFingerprintVerified ? "text-[var(--ui-kit-bg-success)]" : "text-[var(--ui-kit-bg-error)]"
|
|
21910
|
+
),
|
|
21911
|
+
children: [
|
|
21912
|
+
isFingerprintVerified ? /* @__PURE__ */ jsx107(ShieldCheck2, { className: "w-4 h-4 flex-shrink-0" }) : /* @__PURE__ */ jsx107(ShieldAlert, { className: "w-4 h-4 flex-shrink-0" }),
|
|
21913
|
+
/* @__PURE__ */ jsx107("span", { children: `${resolvedAddress.slice(0, 6)}...${resolvedAddress.slice(-4)} : ` }),
|
|
21914
|
+
/* @__PURE__ */ jsx107("span", { children: isFingerprintVerified ? "Verified" : "FAILED" })
|
|
21915
|
+
]
|
|
21862
21916
|
}
|
|
21863
|
-
)
|
|
21864
|
-
|
|
21865
|
-
|
|
21866
|
-
/* @__PURE__ */ jsx107(CheckCircle24, { className: "w-4 h-4 flex-shrink-0" }),
|
|
21867
|
-
/* @__PURE__ */ jsx107("span", { children: nicknameData.handle })
|
|
21868
|
-
] }),
|
|
21869
|
-
nicknameData.fingerprint && /* @__PURE__ */ jsxs98(
|
|
21870
|
-
"div",
|
|
21871
|
-
{
|
|
21872
|
-
className: cn(
|
|
21873
|
-
"flex items-center gap-[var(--ui-kit-gap)] text-[10px]",
|
|
21874
|
-
isFingerprintVerified ? "text-[var(--ui-kit-bg-success)]" : "text-[var(--ui-kit-bg-error)]"
|
|
21875
|
-
),
|
|
21876
|
-
children: [
|
|
21877
|
-
isFingerprintVerified ? /* @__PURE__ */ jsx107(ShieldCheck2, { className: "w-4 h-4 flex-shrink-0" }) : /* @__PURE__ */ jsx107(ShieldAlert, { className: "w-4 h-4 flex-shrink-0" }),
|
|
21878
|
-
/* @__PURE__ */ jsx107("span", { children: `${resolvedAddress.slice(0, 6)}...${resolvedAddress.slice(-4)} : ` }),
|
|
21879
|
-
/* @__PURE__ */ jsx107("span", { children: isFingerprintVerified ? "Verified" : "FAILED" })
|
|
21880
|
-
]
|
|
21881
|
-
}
|
|
21882
|
-
)
|
|
21883
|
-
] })
|
|
21884
|
-
] });
|
|
21885
|
-
if (isFrozen && !isResolving) {
|
|
21886
|
-
return /* @__PURE__ */ jsxs98(Highlight, { type: "warning", className: "flex gap-[var(--ui-kit-gap)]", children: [
|
|
21887
|
-
/* @__PURE__ */ jsx107(AlertTriangle6, { className: "w-4 h-4" }),
|
|
21888
|
-
/* @__PURE__ */ jsx107("span", { children: "This handle is frozen. Proceed with caution." })
|
|
21889
|
-
] });
|
|
21890
|
-
}
|
|
21891
|
-
if (isWalletNotSetup && !isResolving) {
|
|
21892
|
-
return /* @__PURE__ */ jsxs98(Highlight, { type: "error", className: "flex gap-[var(--ui-kit-gap)]", children: [
|
|
21893
|
-
/* @__PURE__ */ jsx107(AlertCircle5, { className: "w-4 h-4" }),
|
|
21894
|
-
/* @__PURE__ */ jsx107("span", { children: "This user has not set up wallet yet" })
|
|
21895
|
-
] });
|
|
21896
|
-
}
|
|
21897
|
-
if (isNotFound && !isResolving) {
|
|
21898
|
-
return /* @__PURE__ */ jsxs98(Highlight, { type: "error", className: "flex gap-[var(--ui-kit-gap)]", children: [
|
|
21899
|
-
/* @__PURE__ */ jsx107(AlertCircle5, { className: "w-4 h-4" }),
|
|
21900
|
-
/* @__PURE__ */ jsx107("span", { children: "Nickname not found" })
|
|
21901
|
-
] });
|
|
21902
|
-
}
|
|
21917
|
+
)
|
|
21918
|
+
] })
|
|
21919
|
+
] });
|
|
21903
21920
|
}
|
|
21904
21921
|
var init_NicknameData = __esm({
|
|
21905
21922
|
"src/internal/components/SendMenu/send/components/NicknameData.tsx"() {
|
|
21906
21923
|
init_no_image();
|
|
21907
21924
|
init_utils2();
|
|
21908
|
-
|
|
21925
|
+
init_useFlowSelector();
|
|
21909
21926
|
}
|
|
21910
21927
|
});
|
|
21911
21928
|
|
|
@@ -21920,7 +21937,7 @@ var init_components3 = __esm({
|
|
|
21920
21937
|
});
|
|
21921
21938
|
|
|
21922
21939
|
// src/internal/components/SendMenu/send/sendSteps/InputSendStep.tsx
|
|
21923
|
-
import { AlertCircle as
|
|
21940
|
+
import { AlertCircle as AlertCircle5, AtSign as AtSign3, CheckCircle2 as CheckCircle25, Loader as Loader28, Wallet2 as Wallet24 } from "lucide-react";
|
|
21924
21941
|
import { formatUnits as formatUnits10, isAddress as isAddress2 } from "viem";
|
|
21925
21942
|
import { Fragment as Fragment40, jsx as jsx108, jsxs as jsxs99 } from "react/jsx-runtime";
|
|
21926
21943
|
function InputSendStep(props) {
|
|
@@ -22099,7 +22116,7 @@ function InputSendStep(props) {
|
|
|
22099
22116
|
/* @__PURE__ */ jsx108(CheckCircle25, { className: "h-4 w-4" }),
|
|
22100
22117
|
/* @__PURE__ */ jsx108("span", { children: "Transfer compliant" })
|
|
22101
22118
|
] }) : /* @__PURE__ */ jsxs99(Fragment40, { children: [
|
|
22102
|
-
/* @__PURE__ */ jsx108(
|
|
22119
|
+
/* @__PURE__ */ jsx108(AlertCircle5, { className: "h-4 w-4" }),
|
|
22103
22120
|
/* @__PURE__ */ jsx108("span", { children: complianceError || "Transfer not allowed" })
|
|
22104
22121
|
] })
|
|
22105
22122
|
}
|
|
@@ -22135,17 +22152,12 @@ var init_InputSendStep = __esm({
|
|
|
22135
22152
|
});
|
|
22136
22153
|
|
|
22137
22154
|
// src/internal/components/SendMenu/send/sendSteps/ConfirmSendStep.tsx
|
|
22138
|
-
import {
|
|
22155
|
+
import { useMutation as useMutation20 } from "@tanstack/react-query";
|
|
22156
|
+
import { AlertTriangle as AlertTriangle6, AtSign as AtSign4, Loader as Loader29, Shield as Shield2, ShieldAlert as ShieldAlert2, ShieldCheck as ShieldCheck3 } from "lucide-react";
|
|
22139
22157
|
import { Fragment as Fragment41, jsx as jsx109, jsxs as jsxs100 } from "react/jsx-runtime";
|
|
22140
22158
|
function ConfirmSendStep(props) {
|
|
22141
|
-
const {
|
|
22142
|
-
|
|
22143
|
-
refreshBalances,
|
|
22144
|
-
erc3643Compliance,
|
|
22145
|
-
isNicknameInput,
|
|
22146
|
-
resolvedNicknameData,
|
|
22147
|
-
isTransactionPending
|
|
22148
|
-
} = props;
|
|
22159
|
+
const { sendTransaction, erc3643Compliance, isNicknameInput, resolvedNicknameData } = props;
|
|
22160
|
+
const { t } = useT();
|
|
22149
22161
|
const chainConfig = useSession((st) => st.chainConfig);
|
|
22150
22162
|
const { resolvedAddress, isFrozen, isFingerprintVerified, data: nicknameData } = resolvedNicknameData || {};
|
|
22151
22163
|
const { canTransfer: erc3643CanTransfer } = erc3643Compliance || {};
|
|
@@ -22154,28 +22166,34 @@ function ConfirmSendStep(props) {
|
|
|
22154
22166
|
const isNft = isNftAsset3(selectedAsset);
|
|
22155
22167
|
const isSecurity = isSecurityToken2(selectedAsset);
|
|
22156
22168
|
const effectiveAddress = isNicknameInput ? resolvedAddress : recipient;
|
|
22157
|
-
const handleConfirm
|
|
22158
|
-
|
|
22159
|
-
|
|
22160
|
-
|
|
22161
|
-
|
|
22162
|
-
|
|
22163
|
-
|
|
22164
|
-
|
|
22165
|
-
|
|
22166
|
-
|
|
22167
|
-
|
|
22168
|
-
|
|
22169
|
-
|
|
22170
|
-
|
|
22171
|
-
|
|
22172
|
-
|
|
22173
|
-
|
|
22169
|
+
const { mutate: handleConfirm, isPending: isTransactionPending } = useMutation20({
|
|
22170
|
+
mutationFn: async () => {
|
|
22171
|
+
if (!effectiveAddress || !selectedAsset) return;
|
|
22172
|
+
setTxStep("pending");
|
|
22173
|
+
const txAmount = isNft ? "1" : amount;
|
|
22174
|
+
return await sendTransaction({
|
|
22175
|
+
to: effectiveAddress,
|
|
22176
|
+
value: txAmount,
|
|
22177
|
+
assetType: selectedAsset.type,
|
|
22178
|
+
tokenAddress: selectedAsset.address,
|
|
22179
|
+
tokenId: selectedAsset.tokenId,
|
|
22180
|
+
decimals: selectedAsset.decimals
|
|
22181
|
+
});
|
|
22182
|
+
},
|
|
22183
|
+
onSuccess: (hash) => {
|
|
22184
|
+
if (hash) {
|
|
22185
|
+
setTxStep("success");
|
|
22186
|
+
} else {
|
|
22187
|
+
setTxStep("input");
|
|
22188
|
+
}
|
|
22189
|
+
},
|
|
22190
|
+
onError: (error) => {
|
|
22191
|
+
useFlowSelectorStore.getState().setError(error?.message || "Transaction failed");
|
|
22174
22192
|
}
|
|
22175
|
-
};
|
|
22193
|
+
});
|
|
22176
22194
|
return /* @__PURE__ */ jsxs100(Fragment41, { children: [
|
|
22177
22195
|
isNicknameInput && isFrozen && /* @__PURE__ */ jsxs100(Highlight, { type: "warning", className: "flex gap-[var(--ui-kit-gap)]", children: [
|
|
22178
|
-
/* @__PURE__ */ jsx109(
|
|
22196
|
+
/* @__PURE__ */ jsx109(AlertTriangle6, { className: "h-4 w-4" }),
|
|
22179
22197
|
/* @__PURE__ */ jsx109("span", { children: "This handle is frozen. Proceed with caution." })
|
|
22180
22198
|
] }),
|
|
22181
22199
|
isSecurity && erc3643CanTransfer && /* @__PURE__ */ jsxs100(Highlight, { type: "success", className: "flex gap-[var(--ui-kit-gap)]", children: [
|
|
@@ -22238,7 +22256,7 @@ function ConfirmSendStep(props) {
|
|
|
22238
22256
|
] }) : (
|
|
22239
22257
|
// Fungible token details
|
|
22240
22258
|
/* @__PURE__ */ jsxs100("div", { className: "flex justify-between leading-5 gap-[var(--ui-kit-gap)]", children: [
|
|
22241
|
-
/* @__PURE__ */ jsx109("span", { className: "text-[10px] text-[var(--ui-kit-fg-muted)]", children: "
|
|
22259
|
+
/* @__PURE__ */ jsx109("span", { className: "text-[10px] text-[var(--ui-kit-fg-muted)]", children: t("passport:common.amount") }),
|
|
22242
22260
|
/* @__PURE__ */ jsxs100("span", { className: "text-sm font-bold", children: [
|
|
22243
22261
|
amount,
|
|
22244
22262
|
" ",
|
|
@@ -22247,7 +22265,7 @@ function ConfirmSendStep(props) {
|
|
|
22247
22265
|
] })
|
|
22248
22266
|
),
|
|
22249
22267
|
/* @__PURE__ */ jsxs100("div", { className: "flex justify-between leading-5 gap-[var(--ui-kit-gap)]", children: [
|
|
22250
|
-
/* @__PURE__ */ jsx109("span", { className: "text-[10px] text-[var(--ui-kit-fg-muted)]", children: "
|
|
22268
|
+
/* @__PURE__ */ jsx109("span", { className: "text-[10px] text-[var(--ui-kit-fg-muted)]", children: t("passport:common.network") }),
|
|
22251
22269
|
/* @__PURE__ */ jsx109("span", { className: "text-sm font-bold", children: chainConfig.name })
|
|
22252
22270
|
] })
|
|
22253
22271
|
] })
|
|
@@ -22273,7 +22291,7 @@ function ConfirmSendStep(props) {
|
|
|
22273
22291
|
) : (
|
|
22274
22292
|
// Fungible token details
|
|
22275
22293
|
/* @__PURE__ */ jsxs100("div", { className: "flex justify-between leading-5 gap-[var(--ui-kit-gap)]", children: [
|
|
22276
|
-
/* @__PURE__ */ jsx109("span", { className: "text-[var(--ui-kit-fg-muted)]", children: "
|
|
22294
|
+
/* @__PURE__ */ jsx109("span", { className: "text-[var(--ui-kit-fg-muted)]", children: t("passport:common.amount") }),
|
|
22277
22295
|
/* @__PURE__ */ jsxs100("span", { className: "font-semibold", children: [
|
|
22278
22296
|
amount,
|
|
22279
22297
|
" ",
|
|
@@ -22282,24 +22300,35 @@ function ConfirmSendStep(props) {
|
|
|
22282
22300
|
] })
|
|
22283
22301
|
),
|
|
22284
22302
|
/* @__PURE__ */ jsxs100("div", { className: "flex justify-between leading-5 gap-[var(--ui-kit-gap)]", children: [
|
|
22285
|
-
/* @__PURE__ */ jsx109("span", { className: "text-[var(--ui-kit-fg-muted)]", children: "
|
|
22303
|
+
/* @__PURE__ */ jsx109("span", { className: "text-[var(--ui-kit-fg-muted)]", children: t("passport:common.network") }),
|
|
22286
22304
|
/* @__PURE__ */ jsx109("span", { children: chainConfig.name })
|
|
22287
22305
|
] })
|
|
22288
22306
|
] })
|
|
22289
22307
|
] }) }),
|
|
22290
|
-
/* @__PURE__ */ jsxs100(
|
|
22291
|
-
|
|
22292
|
-
|
|
22293
|
-
|
|
22308
|
+
/* @__PURE__ */ jsxs100(
|
|
22309
|
+
Button,
|
|
22310
|
+
{
|
|
22311
|
+
onClick: () => handleConfirm(),
|
|
22312
|
+
disabled: isTransactionPending,
|
|
22313
|
+
className: "w-full",
|
|
22314
|
+
size: "large",
|
|
22315
|
+
children: [
|
|
22316
|
+
isTransactionPending && /* @__PURE__ */ jsx109(Loader29, { className: "h-4 w-4 animate-spin" }),
|
|
22317
|
+
t("passport:common.confirm")
|
|
22318
|
+
]
|
|
22319
|
+
}
|
|
22320
|
+
)
|
|
22294
22321
|
] });
|
|
22295
22322
|
}
|
|
22296
22323
|
var init_ConfirmSendStep = __esm({
|
|
22297
22324
|
"src/internal/components/SendMenu/send/sendSteps/ConfirmSendStep.tsx"() {
|
|
22298
22325
|
init_SessionContext();
|
|
22326
|
+
init_i18n();
|
|
22299
22327
|
init_priceFormatter();
|
|
22300
22328
|
init_utils2();
|
|
22301
22329
|
init_button();
|
|
22302
22330
|
init_highlight();
|
|
22331
|
+
init_useFlowSelector();
|
|
22303
22332
|
init_useSendStore();
|
|
22304
22333
|
init_utils9();
|
|
22305
22334
|
}
|
|
@@ -22315,7 +22344,7 @@ var init_sendSteps = __esm({
|
|
|
22315
22344
|
|
|
22316
22345
|
// src/internal/components/SendMenu/send/SendMenu.tsx
|
|
22317
22346
|
import { CheckCircle2 as CheckCircle26, Loader as Loader30 } from "lucide-react";
|
|
22318
|
-
import { useEffect as
|
|
22347
|
+
import { useEffect as useEffect41, useMemo as useMemo15 } from "react";
|
|
22319
22348
|
import { parseUnits as parseUnits2 } from "viem";
|
|
22320
22349
|
import { Fragment as Fragment42, jsx as jsx110, jsxs as jsxs101 } from "react/jsx-runtime";
|
|
22321
22350
|
function SendMenu() {
|
|
@@ -22325,7 +22354,7 @@ function SendMenu() {
|
|
|
22325
22354
|
const { t } = useT();
|
|
22326
22355
|
const {
|
|
22327
22356
|
assets,
|
|
22328
|
-
refreshBalances,
|
|
22357
|
+
// refreshBalances,
|
|
22329
22358
|
isLoading: isAssetsLoading
|
|
22330
22359
|
} = useBlockscoutAssets({
|
|
22331
22360
|
address
|
|
@@ -22337,10 +22366,10 @@ function SendMenu() {
|
|
|
22337
22366
|
userOpHash,
|
|
22338
22367
|
reset
|
|
22339
22368
|
} = useSendTransaction();
|
|
22340
|
-
|
|
22369
|
+
useEffect41(() => {
|
|
22341
22370
|
useFlowSelectorStore.getState().setIsUiLocked(isAssetsLoading || isTransactionPending);
|
|
22342
22371
|
}, [isAssetsLoading, isTransactionPending]);
|
|
22343
|
-
|
|
22372
|
+
useEffect41(() => {
|
|
22344
22373
|
useFlowSelectorStore.getState().setError(sendTransactionError || null);
|
|
22345
22374
|
}, [sendTransactionError]);
|
|
22346
22375
|
const {
|
|
@@ -22355,7 +22384,7 @@ function SendMenu() {
|
|
|
22355
22384
|
} = useSendStore();
|
|
22356
22385
|
const isNft = isNftAsset3(selectedAsset);
|
|
22357
22386
|
const isSecurity = isSecurityToken2(selectedAsset);
|
|
22358
|
-
|
|
22387
|
+
useEffect41(
|
|
22359
22388
|
() => () => {
|
|
22360
22389
|
setSelectedAsset(null);
|
|
22361
22390
|
setRecipient("");
|
|
@@ -22365,13 +22394,15 @@ function SendMenu() {
|
|
|
22365
22394
|
},
|
|
22366
22395
|
[]
|
|
22367
22396
|
);
|
|
22368
|
-
|
|
22369
|
-
const
|
|
22370
|
-
if (!
|
|
22371
|
-
const
|
|
22397
|
+
useEffect41(() => {
|
|
22398
|
+
const shouldNativeDefaultAsset = assets.length > 0 && !selectedAsset;
|
|
22399
|
+
if (!shouldNativeDefaultAsset) return;
|
|
22400
|
+
const chainNativeCurrency = useSession.getState().chainConfig?.nativeCurrency;
|
|
22401
|
+
const native = assets.find((a) => a.type === "native" && a.symbol === chainNativeCurrency?.symbol);
|
|
22372
22402
|
if (isBalance(native)) return setSelectedAsset(native);
|
|
22373
22403
|
const erc20 = assets.find((a) => a.type === "erc20");
|
|
22374
22404
|
if (isBalance(erc20)) return setSelectedAsset(erc20);
|
|
22405
|
+
setSelectedAsset(assets[0]);
|
|
22375
22406
|
}, [assets, selectedAsset]);
|
|
22376
22407
|
const isNicknameInput = looksLikeNickname(recipient);
|
|
22377
22408
|
const resolvedNicknameData = useNicknameResolve(recipient, { enabled: isNicknameInput, chainId: activeChainId });
|
|
@@ -22391,7 +22422,7 @@ function SendMenu() {
|
|
|
22391
22422
|
enabled: isSecurity && !!effectiveAddress && !!complianceAmount,
|
|
22392
22423
|
chainId: activeChainId
|
|
22393
22424
|
});
|
|
22394
|
-
|
|
22425
|
+
useEffect41(() => {
|
|
22395
22426
|
const updateMenuTitle = useFlowSelectorStore.getState().setMenuTitle;
|
|
22396
22427
|
switch (true) {
|
|
22397
22428
|
case txStep === "select-asset":
|
|
@@ -22429,11 +22460,9 @@ function SendMenu() {
|
|
|
22429
22460
|
ConfirmSendStep,
|
|
22430
22461
|
{
|
|
22431
22462
|
sendTransaction,
|
|
22432
|
-
refreshBalances,
|
|
22433
22463
|
erc3643Compliance,
|
|
22434
22464
|
isNicknameInput,
|
|
22435
|
-
resolvedNicknameData
|
|
22436
|
-
isTransactionPending
|
|
22465
|
+
resolvedNicknameData
|
|
22437
22466
|
}
|
|
22438
22467
|
),
|
|
22439
22468
|
txStep === "pending" && /* @__PURE__ */ jsxs101(Highlight, { type: "info", className: "flex gap-[var(--ui-kit-gap)]", children: [
|
|
@@ -22484,7 +22513,7 @@ var init_send = __esm({
|
|
|
22484
22513
|
|
|
22485
22514
|
// src/internal/components/SendMenu/SendFlowSelector.tsx
|
|
22486
22515
|
import { ArrowLeft as ArrowLeft19, ArrowRightIcon as ArrowRightIcon2, ArrowRightLeftIcon as ArrowRightLeftIcon2, InfoIcon as InfoIcon5 } from "lucide-react";
|
|
22487
|
-
import { useEffect as
|
|
22516
|
+
import { useEffect as useEffect42 } from "react";
|
|
22488
22517
|
import { jsx as jsx111, jsxs as jsxs102 } from "react/jsx-runtime";
|
|
22489
22518
|
function SelectorFlowButtons() {
|
|
22490
22519
|
const { t } = useT();
|
|
@@ -22547,7 +22576,7 @@ function SendFlowSelector() {
|
|
|
22547
22576
|
const error = useFlowSelectorStore((st) => st.error);
|
|
22548
22577
|
const menuTitle = useFlowSelectorStore((st) => st.menuTitle);
|
|
22549
22578
|
const selectorFlow = useFlowSelectorStore((st) => st.flow);
|
|
22550
|
-
|
|
22579
|
+
useEffect42(
|
|
22551
22580
|
() => () => {
|
|
22552
22581
|
useFlowSelectorStore.getState().setError(null);
|
|
22553
22582
|
},
|
|
@@ -22713,7 +22742,7 @@ var init_constants6 = __esm({
|
|
|
22713
22742
|
// src/internal/components/SettingsMenu/SettingsMenu.tsx
|
|
22714
22743
|
import { useQuery as useQuery22 } from "@tanstack/react-query";
|
|
22715
22744
|
import { ArrowLeft as ArrowLeft20, HardDrive as HardDrive3 } from "lucide-react";
|
|
22716
|
-
import { useEffect as
|
|
22745
|
+
import { useEffect as useEffect43 } from "react";
|
|
22717
22746
|
import { jsx as jsx112, jsxs as jsxs103 } from "react/jsx-runtime";
|
|
22718
22747
|
function useSettingsButtons() {
|
|
22719
22748
|
const config = useProviderConfig().config;
|
|
@@ -22732,7 +22761,7 @@ function useSettingsButtons() {
|
|
|
22732
22761
|
if (proMode) {
|
|
22733
22762
|
settingsButtons.push({ id: "devices" /* DEVICES */, name: "Guardians", Icon: HardDrive3 });
|
|
22734
22763
|
}
|
|
22735
|
-
|
|
22764
|
+
useEffect43(() => {
|
|
22736
22765
|
const cssvEl = document.querySelector(".embarkai-ui-scope");
|
|
22737
22766
|
if (!cssvEl || !window?.getComputedStyle) {
|
|
22738
22767
|
return;
|
|
@@ -23669,12 +23698,12 @@ var init_TransactionsGroup = __esm({
|
|
|
23669
23698
|
});
|
|
23670
23699
|
|
|
23671
23700
|
// src/internal/components/TransactionsMenu/TransactionsMenu.tsx
|
|
23672
|
-
import { useQuery as useQuery23, useQueryClient as
|
|
23701
|
+
import { useQuery as useQuery23, useQueryClient as useQueryClient24 } from "@tanstack/react-query";
|
|
23673
23702
|
import { ArrowLeft as ArrowLeft22, Loader as Loader31, RefreshCw as RefreshCw3, XCircle } from "lucide-react";
|
|
23674
23703
|
import { useCallback as useCallback29, useState as useState31 } from "react";
|
|
23675
23704
|
import { jsx as jsx115, jsxs as jsxs106 } from "react/jsx-runtime";
|
|
23676
23705
|
function TransactionsMenu() {
|
|
23677
|
-
const qc =
|
|
23706
|
+
const qc = useQueryClient24();
|
|
23678
23707
|
const address = useSession((st) => st.address);
|
|
23679
23708
|
const chainConfig = useSession((st) => st.chainConfig);
|
|
23680
23709
|
const { t } = useT();
|
|
@@ -23932,7 +23961,7 @@ var init_PageMap = __esm({
|
|
|
23932
23961
|
});
|
|
23933
23962
|
|
|
23934
23963
|
// src/internal/hooks/usePageMapper.tsx
|
|
23935
|
-
import { useCallback as useCallback30, useEffect as
|
|
23964
|
+
import { useCallback as useCallback30, useEffect as useEffect44 } from "react";
|
|
23936
23965
|
import { jsx as jsx116 } from "react/jsx-runtime";
|
|
23937
23966
|
function usePageMapper() {
|
|
23938
23967
|
const page = useLayoutDataStore((st) => st.page);
|
|
@@ -23965,7 +23994,7 @@ function usePageMapper() {
|
|
|
23965
23994
|
},
|
|
23966
23995
|
[setDialogContent, setDialogDescription, setDialogTitle, setIsDialogOpen]
|
|
23967
23996
|
);
|
|
23968
|
-
|
|
23997
|
+
useEffect44(() => {
|
|
23969
23998
|
if (page === null) return closeDialog();
|
|
23970
23999
|
const pageItem = PAGE_MAP[page];
|
|
23971
24000
|
if (!pageItem) {
|
|
@@ -23989,7 +24018,7 @@ var init_usePageMapper = __esm({
|
|
|
23989
24018
|
|
|
23990
24019
|
// src/internal/hooks/useSettingsNotifications.ts
|
|
23991
24020
|
import { useQuery as useQuery24 } from "@tanstack/react-query";
|
|
23992
|
-
import { useEffect as
|
|
24021
|
+
import { useEffect as useEffect45 } from "react";
|
|
23993
24022
|
function useSettingsNotifications() {
|
|
23994
24023
|
const address = useSession((st) => st.address);
|
|
23995
24024
|
const setSettingsNotifications = useLayoutDataStore((st) => st.setSettingsNotifications);
|
|
@@ -24001,14 +24030,14 @@ function useSettingsNotifications() {
|
|
|
24001
24030
|
queryKey: [QUERY_KEYS.userProfile, address],
|
|
24002
24031
|
queryFn: getUserProfile
|
|
24003
24032
|
});
|
|
24004
|
-
|
|
24033
|
+
useEffect45(() => {
|
|
24005
24034
|
const isKYCVerified = userProfile?.kycDetails?.kycStatus === "verified";
|
|
24006
24035
|
setSettingsNotifications({
|
|
24007
24036
|
...COMPLETE_KYC_PROGRESS,
|
|
24008
24037
|
status: isKYCVerified ? "resolved" : "active"
|
|
24009
24038
|
});
|
|
24010
24039
|
}, [userProfile, setSettingsNotifications]);
|
|
24011
|
-
|
|
24040
|
+
useEffect45(() => {
|
|
24012
24041
|
setSettingsNotifications({
|
|
24013
24042
|
...EMAIL_NOT_CONNECTED_NOTIFICATION,
|
|
24014
24043
|
status: hasEmail ? "resolved" : "active"
|
|
@@ -24041,7 +24070,7 @@ var init_package = __esm({
|
|
|
24041
24070
|
"package.json"() {
|
|
24042
24071
|
package_default = {
|
|
24043
24072
|
name: "@embarkai/ui-kit",
|
|
24044
|
-
version: "0.4.
|
|
24073
|
+
version: "0.4.53",
|
|
24045
24074
|
description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
|
|
24046
24075
|
type: "module",
|
|
24047
24076
|
main: "./dist/index.cjs",
|
|
@@ -24142,12 +24171,12 @@ var init_package = __esm({
|
|
|
24142
24171
|
});
|
|
24143
24172
|
|
|
24144
24173
|
// src/internal/components/Footer/Footer.tsx
|
|
24145
|
-
import { useMutation as
|
|
24174
|
+
import { useMutation as useMutation21, useQueryClient as useQueryClient25 } from "@tanstack/react-query";
|
|
24146
24175
|
import { Loader as Loader32, LogOut } from "lucide-react";
|
|
24147
24176
|
import { useDisconnect as useDisconnect3 } from "wagmi";
|
|
24148
24177
|
import { jsx as jsx117, jsxs as jsxs107 } from "react/jsx-runtime";
|
|
24149
24178
|
function Footer() {
|
|
24150
|
-
const qc =
|
|
24179
|
+
const qc = useQueryClient25();
|
|
24151
24180
|
const { callbacksRef } = useProviderConfig();
|
|
24152
24181
|
const { t } = useT();
|
|
24153
24182
|
const address = useSession((st) => st.address);
|
|
@@ -24164,7 +24193,7 @@ function Footer() {
|
|
|
24164
24193
|
}
|
|
24165
24194
|
}
|
|
24166
24195
|
});
|
|
24167
|
-
const { mutate: disconnect, isPending: isDisconnecting } =
|
|
24196
|
+
const { mutate: disconnect, isPending: isDisconnecting } = useMutation21({
|
|
24168
24197
|
mutationFn: async (disconnectAddress) => {
|
|
24169
24198
|
if (!disconnectAddress) throw new Error("No address to disconnect");
|
|
24170
24199
|
const { setError, setStatus, setIsLoading } = useSession.getState();
|
|
@@ -24596,7 +24625,7 @@ var init_visually_hidden = __esm({
|
|
|
24596
24625
|
|
|
24597
24626
|
// src/internal/components/Dialog/Dialog.tsx
|
|
24598
24627
|
import { AnimatePresence, motion } from "framer-motion";
|
|
24599
|
-
import { useEffect as
|
|
24628
|
+
import { useEffect as useEffect46 } from "react";
|
|
24600
24629
|
import { jsx as jsx121, jsxs as jsxs110 } from "react/jsx-runtime";
|
|
24601
24630
|
function Dialog2() {
|
|
24602
24631
|
const config = useProviderConfig().config;
|
|
@@ -24608,7 +24637,7 @@ function Dialog2() {
|
|
|
24608
24637
|
const isWalletLinking = useLayoutDataStore((st) => st.isWalletLinking);
|
|
24609
24638
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
24610
24639
|
const { colorMode, isDialogOpen, dialogTitle, dialogDescription, dialogContent, isDialogForced, setIsSettings } = useLayoutStore();
|
|
24611
|
-
|
|
24640
|
+
useEffect46(() => setIsSettings(!!session), [session, setIsSettings]);
|
|
24612
24641
|
usePageMapper();
|
|
24613
24642
|
useAutoConnect();
|
|
24614
24643
|
useBackupStatusChanges();
|
|
@@ -24729,11 +24758,11 @@ var init_TssManager = __esm({
|
|
|
24729
24758
|
|
|
24730
24759
|
// src/internal/components/WalletConnectHandler.tsx
|
|
24731
24760
|
import { useConnectModal as useConnectModal2 } from "@rainbow-me/rainbowkit";
|
|
24732
|
-
import { useMutation as
|
|
24733
|
-
import React27, { useCallback as useCallback33, useEffect as
|
|
24761
|
+
import { useMutation as useMutation22, useQueryClient as useQueryClient26 } from "@tanstack/react-query";
|
|
24762
|
+
import React27, { useCallback as useCallback33, useEffect as useEffect47 } from "react";
|
|
24734
24763
|
import { useAccount, useDisconnect as useDisconnect4, useSignMessage as useSignMessage2 } from "wagmi";
|
|
24735
24764
|
function WalletConnectHandler() {
|
|
24736
|
-
const qc =
|
|
24765
|
+
const qc = useQueryClient26();
|
|
24737
24766
|
const { callbacksRef } = useProviderConfig();
|
|
24738
24767
|
const passportWalletAddress = useSession((st) => st.address);
|
|
24739
24768
|
const { address: walletAddress, isConnected, chain, connector } = useAccount();
|
|
@@ -24785,7 +24814,7 @@ function WalletConnectHandler() {
|
|
|
24785
24814
|
const [hasStartedLinking, setHasStartedLinking] = React27.useState(false);
|
|
24786
24815
|
const [modalWasOpened, setModalWasOpened] = React27.useState(false);
|
|
24787
24816
|
const [pendingModalOpen, setPendingModalOpen] = React27.useState(false);
|
|
24788
|
-
|
|
24817
|
+
useEffect47(() => {
|
|
24789
24818
|
if (isWalletLinking && !hasStartedLinking) {
|
|
24790
24819
|
console.log("[WalletConnectHandler] Starting wallet link flow:", {
|
|
24791
24820
|
isConnected,
|
|
@@ -24823,18 +24852,18 @@ function WalletConnectHandler() {
|
|
|
24823
24852
|
setProviderType,
|
|
24824
24853
|
walletMode
|
|
24825
24854
|
]);
|
|
24826
|
-
|
|
24855
|
+
useEffect47(() => {
|
|
24827
24856
|
if (pendingModalOpen && !isConnected && openConnectModal) {
|
|
24828
24857
|
setPendingModalOpen(false);
|
|
24829
24858
|
openConnectModal();
|
|
24830
24859
|
}
|
|
24831
24860
|
}, [pendingModalOpen, isConnected, openConnectModal]);
|
|
24832
|
-
|
|
24861
|
+
useEffect47(() => {
|
|
24833
24862
|
if (connectModalOpen && hasStartedLinking) {
|
|
24834
24863
|
setModalWasOpened(true);
|
|
24835
24864
|
}
|
|
24836
24865
|
}, [connectModalOpen, hasStartedLinking]);
|
|
24837
|
-
|
|
24866
|
+
useEffect47(() => {
|
|
24838
24867
|
if (modalWasOpened && !connectModalOpen && !isConnected && isWalletLinking) {
|
|
24839
24868
|
console.log("[WalletConnectHandler] Modal closed without connecting");
|
|
24840
24869
|
onLinkingComplete(false);
|
|
@@ -24842,7 +24871,7 @@ function WalletConnectHandler() {
|
|
|
24842
24871
|
setModalWasOpened(false);
|
|
24843
24872
|
}
|
|
24844
24873
|
}, [connectModalOpen, modalWasOpened, isConnected, isWalletLinking]);
|
|
24845
|
-
|
|
24874
|
+
useEffect47(() => {
|
|
24846
24875
|
if (isWalletLinking) {
|
|
24847
24876
|
const timeout = setTimeout(() => {
|
|
24848
24877
|
console.warn("[WalletConnectHandler] Wallet linking timed out, resetting state");
|
|
@@ -24861,7 +24890,7 @@ function WalletConnectHandler() {
|
|
|
24861
24890
|
}
|
|
24862
24891
|
}, [isWalletLinking, setIsWalletLinking, disconnect]);
|
|
24863
24892
|
const isAuthFlow = !passportWalletAddress;
|
|
24864
|
-
const { mutate: handleWalletSign, isPending: isWalletSigning } =
|
|
24893
|
+
const { mutate: handleWalletSign, isPending: isWalletSigning } = useMutation22({
|
|
24865
24894
|
mutationFn: async (payload) => {
|
|
24866
24895
|
const { chainId, signingWalletAddress } = payload;
|
|
24867
24896
|
if (!signingWalletAddress || !chainId) {
|
|
@@ -24962,7 +24991,7 @@ function WalletConnectHandler() {
|
|
|
24962
24991
|
setPage(passportWalletAddress ? "manage-wallet" /* MANAGE_WALLET */ : "auth" /* AUTH */);
|
|
24963
24992
|
}
|
|
24964
24993
|
});
|
|
24965
|
-
|
|
24994
|
+
useEffect47(() => {
|
|
24966
24995
|
if (!!chain?.id && isConnected && walletAddress && isWalletLinking && hasStartedLinking && modalWasOpened && !pendingModalOpen) {
|
|
24967
24996
|
console.log("[WalletConnectHandler] handleWalletSign triggered");
|
|
24968
24997
|
if (!passportWalletAddress) {
|
|
@@ -24972,7 +25001,7 @@ function WalletConnectHandler() {
|
|
|
24972
25001
|
handleWalletSign({ chainId: chain.id, signingWalletAddress: walletAddress });
|
|
24973
25002
|
}
|
|
24974
25003
|
}, [chain, isConnected, walletAddress, isWalletLinking, hasStartedLinking, modalWasOpened, pendingModalOpen]);
|
|
24975
|
-
|
|
25004
|
+
useEffect47(() => {
|
|
24976
25005
|
if (isConnected && !chain?.id && isWalletLinking && hasStartedLinking && !connectModalOpen && !isWalletSigning) {
|
|
24977
25006
|
const timeout = setTimeout(() => {
|
|
24978
25007
|
console.warn("[WalletConnectHandler] Wallet connected but chain info missing, resetting");
|
|
@@ -25008,7 +25037,7 @@ var init_WalletConnectHandler = __esm({
|
|
|
25008
25037
|
});
|
|
25009
25038
|
|
|
25010
25039
|
// src/internal/components/DirectWalletHandler.tsx
|
|
25011
|
-
import { useEffect as
|
|
25040
|
+
import { useEffect as useEffect48 } from "react";
|
|
25012
25041
|
import { useAccount as useAccount2 } from "wagmi";
|
|
25013
25042
|
function DirectWalletHandler() {
|
|
25014
25043
|
const walletMode = useProviderConfig().config.current?.wallet?.mode || "linked";
|
|
@@ -25020,13 +25049,13 @@ function DirectWalletHandler() {
|
|
|
25020
25049
|
const setExternalChainId = useExternalWalletStore((st) => st.setExternalChainId);
|
|
25021
25050
|
const setConfigMode = useExternalWalletStore((st) => st.setConfigMode);
|
|
25022
25051
|
const setActiveMode = useExternalWalletStore((st) => st.setActiveMode);
|
|
25023
|
-
|
|
25052
|
+
useEffect48(() => {
|
|
25024
25053
|
setConfigMode(walletMode);
|
|
25025
25054
|
if (walletMode !== "both") {
|
|
25026
25055
|
setActiveMode(walletMode);
|
|
25027
25056
|
}
|
|
25028
25057
|
}, [walletMode, setConfigMode, setActiveMode]);
|
|
25029
|
-
|
|
25058
|
+
useEffect48(() => {
|
|
25030
25059
|
if (isConnected && address && !isExternalConnected && connector && chain?.id) {
|
|
25031
25060
|
setExternalWallet({
|
|
25032
25061
|
address,
|
|
@@ -25035,17 +25064,17 @@ function DirectWalletHandler() {
|
|
|
25035
25064
|
});
|
|
25036
25065
|
}
|
|
25037
25066
|
}, [isConnected, address, isExternalConnected, connector, chain?.id, setExternalWallet]);
|
|
25038
|
-
|
|
25067
|
+
useEffect48(() => {
|
|
25039
25068
|
if (isExternalConnected && !isConnected) {
|
|
25040
25069
|
clearExternalWallet();
|
|
25041
25070
|
}
|
|
25042
25071
|
}, [isConnected, isExternalConnected, clearExternalWallet]);
|
|
25043
|
-
|
|
25072
|
+
useEffect48(() => {
|
|
25044
25073
|
if (isExternalConnected && isConnected && chain?.id) {
|
|
25045
25074
|
setExternalChainId(chain.id);
|
|
25046
25075
|
}
|
|
25047
25076
|
}, [chain?.id, isConnected, isExternalConnected, setExternalChainId]);
|
|
25048
|
-
|
|
25077
|
+
useEffect48(() => {
|
|
25049
25078
|
if (isExternalConnected && isConnected && address && address !== externalAddress && connector && chain?.id) {
|
|
25050
25079
|
setExternalWallet({
|
|
25051
25080
|
address,
|
|
@@ -27874,7 +27903,7 @@ import {
|
|
|
27874
27903
|
createContext,
|
|
27875
27904
|
useCallback as useCallback34,
|
|
27876
27905
|
useContext,
|
|
27877
|
-
useEffect as
|
|
27906
|
+
useEffect as useEffect49,
|
|
27878
27907
|
useMemo as useMemo17,
|
|
27879
27908
|
useRef as useRef20
|
|
27880
27909
|
} from "react";
|
|
@@ -27897,7 +27926,7 @@ function clearLegacyWagmiStorage() {
|
|
|
27897
27926
|
function Provider(props) {
|
|
27898
27927
|
const { children, projectId, initialConfig = {}, callbacks } = props;
|
|
27899
27928
|
const callbacksRef = useRef20(callbacks);
|
|
27900
|
-
|
|
27929
|
+
useEffect49(() => notifyNoProjetctId(projectId), [projectId]);
|
|
27901
27930
|
const config = useRef20(merge3({}, DEFAULT_PROVIDER_CONFIG, { projectId }, initialConfig));
|
|
27902
27931
|
const updateConfig = useCallback34((updates) => {
|
|
27903
27932
|
const prev = config.current;
|
|
@@ -27938,7 +27967,7 @@ function Provider(props) {
|
|
|
27938
27967
|
const next = updates ? { ...prev, ...updates } : void 0;
|
|
27939
27968
|
callbacksRef.current = next;
|
|
27940
27969
|
}, []);
|
|
27941
|
-
|
|
27970
|
+
useEffect49(() => {
|
|
27942
27971
|
if (typeof window === "undefined" || !projectId) return;
|
|
27943
27972
|
const mergedConfig = merge3(DEFAULT_PROVIDER_CONFIG, initialConfig);
|
|
27944
27973
|
updateConfig(mergedConfig);
|
|
@@ -27958,7 +27987,7 @@ function Provider(props) {
|
|
|
27958
27987
|
useSession.getState().setActiveChainId(mergedConfig.network.chainId);
|
|
27959
27988
|
}
|
|
27960
27989
|
}, [projectId, initialConfig]);
|
|
27961
|
-
|
|
27990
|
+
useEffect49(() => {
|
|
27962
27991
|
if (typeof window === "undefined" || !projectId) return;
|
|
27963
27992
|
try {
|
|
27964
27993
|
initSdkErrorTracking();
|
|
@@ -28048,7 +28077,7 @@ init_pro_mode();
|
|
|
28048
28077
|
init_utils2();
|
|
28049
28078
|
import { useQuery as useQuery26 } from "@tanstack/react-query";
|
|
28050
28079
|
import { Cloud as Cloud4, Laptop as Laptop2, Loader as Loader34, Shield as Shield3 } from "lucide-react";
|
|
28051
|
-
import { useEffect as
|
|
28080
|
+
import { useEffect as useEffect50, useMemo as useMemo18 } from "react";
|
|
28052
28081
|
import { Fragment as Fragment47, jsx as jsx126, jsxs as jsxs112 } from "react/jsx-runtime";
|
|
28053
28082
|
function getFormattedStatus(label, status, showStatus) {
|
|
28054
28083
|
const isStatus = showStatus && status && status !== "idle" && status !== "ready";
|
|
@@ -28068,7 +28097,7 @@ function ConnectWalletButton(props) {
|
|
|
28068
28097
|
const colorMode = useLayoutStore((st) => st.colorMode);
|
|
28069
28098
|
const { session, address, hasServerVault, isLoading, isIframeReady, status, setUsePaymaster } = useSession();
|
|
28070
28099
|
const connectButtonLabel = getFormattedStatus(label || "Connect", status, isIframeReady);
|
|
28071
|
-
|
|
28100
|
+
useEffect50(() => setUsePaymaster(usePaymaster), [setUsePaymaster, usePaymaster]);
|
|
28072
28101
|
const { data: profile, isLoading: isProfileLoading } = useQuery26({
|
|
28073
28102
|
retry: false,
|
|
28074
28103
|
enabled: !!address,
|
|
@@ -28351,7 +28380,7 @@ init_useLayoutDataStore();
|
|
|
28351
28380
|
init_getUserOperationByHash();
|
|
28352
28381
|
init_getUserOperationReceipt();
|
|
28353
28382
|
init_cn();
|
|
28354
|
-
import { AlertCircle as
|
|
28383
|
+
import { AlertCircle as AlertCircle6, CheckCircle2 as CheckCircle27, Clock as Clock2, Copy as Copy7, ExternalLink as ExternalLink3, RefreshCw as RefreshCw4 } from "lucide-react";
|
|
28355
28384
|
import * as React29 from "react";
|
|
28356
28385
|
|
|
28357
28386
|
// src/internal/components/Address.tsx
|
|
@@ -28535,19 +28564,19 @@ var UserOpStatus = ({
|
|
|
28535
28564
|
if (receipt) {
|
|
28536
28565
|
const ok = !!receipt.success;
|
|
28537
28566
|
return /* @__PURE__ */ jsxs114(Badge, { variant: ok ? "success" : "destructive", children: [
|
|
28538
|
-
ok ? /* @__PURE__ */ jsx130(CheckCircle27, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx130(
|
|
28567
|
+
ok ? /* @__PURE__ */ jsx130(CheckCircle27, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx130(AlertCircle6, { className: "h-3 w-3" }),
|
|
28539
28568
|
ok ? "Included" : "Failed"
|
|
28540
28569
|
] });
|
|
28541
28570
|
}
|
|
28542
28571
|
if (rejected) {
|
|
28543
28572
|
return /* @__PURE__ */ jsxs114(Badge, { variant: "destructive", children: [
|
|
28544
|
-
/* @__PURE__ */ jsx130(
|
|
28573
|
+
/* @__PURE__ */ jsx130(AlertCircle6, { className: "h-3 w-3" }),
|
|
28545
28574
|
" Rejected by bundler"
|
|
28546
28575
|
] });
|
|
28547
28576
|
}
|
|
28548
28577
|
if (timedOut) {
|
|
28549
28578
|
return /* @__PURE__ */ jsxs114(Badge, { variant: "warning", children: [
|
|
28550
|
-
/* @__PURE__ */ jsx130(
|
|
28579
|
+
/* @__PURE__ */ jsx130(AlertCircle6, { className: "h-3 w-3" }),
|
|
28551
28580
|
" Timeout - may be rejected"
|
|
28552
28581
|
] });
|
|
28553
28582
|
}
|
|
@@ -28655,16 +28684,16 @@ var UserOpStatus = ({
|
|
|
28655
28684
|
] })
|
|
28656
28685
|
] }),
|
|
28657
28686
|
error && /* @__PURE__ */ jsxs114("div", { className: "text-sm text-destructive flex items-center gap-1 mt-4", children: [
|
|
28658
|
-
/* @__PURE__ */ jsx130(
|
|
28687
|
+
/* @__PURE__ */ jsx130(AlertCircle6, { className: "h-4 w-4" }),
|
|
28659
28688
|
" ",
|
|
28660
28689
|
error
|
|
28661
28690
|
] }),
|
|
28662
28691
|
rejected && /* @__PURE__ */ jsxs114("div", { className: "text-sm text-destructive flex items-center gap-1 mt-4", children: [
|
|
28663
|
-
/* @__PURE__ */ jsx130(
|
|
28692
|
+
/* @__PURE__ */ jsx130(AlertCircle6, { className: "h-4 w-4" }),
|
|
28664
28693
|
"UserOperation was dropped from bundler mempool. This usually means it was invalid or replaced."
|
|
28665
28694
|
] }),
|
|
28666
28695
|
timedOut && /* @__PURE__ */ jsxs114("div", { className: "text-sm text-destructive flex items-center gap-1 mt-4", children: [
|
|
28667
|
-
/* @__PURE__ */ jsx130(
|
|
28696
|
+
/* @__PURE__ */ jsx130(AlertCircle6, { className: "h-4 w-4" }),
|
|
28668
28697
|
"Stopped polling after ",
|
|
28669
28698
|
Math.round(maxPollTimeMs / 1e3),
|
|
28670
28699
|
"s. UserOperation may have been rejected by the bundler."
|
|
@@ -28740,13 +28769,13 @@ var Hash = ({
|
|
|
28740
28769
|
|
|
28741
28770
|
// src/internal/components/TransactionsMenu/TransactionsList.tsx
|
|
28742
28771
|
init_base2();
|
|
28743
|
-
import { useEffect as
|
|
28772
|
+
import { useEffect as useEffect52, useState as useState36 } from "react";
|
|
28744
28773
|
import { jsx as jsx132, jsxs as jsxs116 } from "react/jsx-runtime";
|
|
28745
28774
|
var TransactionsList = ({ address, itemsCount = 10 }) => {
|
|
28746
28775
|
const [transactions, setTransactions] = useState36([]);
|
|
28747
28776
|
const [loading, setLoading] = useState36(true);
|
|
28748
28777
|
const [error, setError] = useState36(null);
|
|
28749
|
-
|
|
28778
|
+
useEffect52(() => {
|
|
28750
28779
|
const fetchTransactions2 = async () => {
|
|
28751
28780
|
try {
|
|
28752
28781
|
setLoading(true);
|
|
@@ -29615,6 +29644,7 @@ init_tokens();
|
|
|
29615
29644
|
init_wallets();
|
|
29616
29645
|
|
|
29617
29646
|
// src/index.ts
|
|
29647
|
+
init_constants();
|
|
29618
29648
|
init_i18n();
|
|
29619
29649
|
|
|
29620
29650
|
// src/internal/exportedQueryKeys.ts
|
|
@@ -29657,6 +29687,7 @@ export {
|
|
|
29657
29687
|
UserOperationTimeoutError,
|
|
29658
29688
|
UserRejectedError,
|
|
29659
29689
|
WALLET_ICONS,
|
|
29690
|
+
WRAPPED_TOKENS,
|
|
29660
29691
|
combineI18NResources,
|
|
29661
29692
|
createAccountAbstractionError,
|
|
29662
29693
|
deployAccount,
|