@embarkai/ui-kit 0.4.10 → 0.4.11
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 +60 -43
- package/dist/index.d.cts +19 -4
- package/dist/index.d.ts +19 -4
- package/dist/index.js +57 -41
- package/package.json +1 -1
package/dist/iframe/index.html
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<meta http-equiv="X-Content-Type-Options" content="nosniff" />
|
|
16
16
|
<meta http-equiv="Referrer-Policy" content="strict-origin-when-cross-origin" />
|
|
17
17
|
|
|
18
|
-
<title>EmbarkAI Secure Wallet - iframe version 0.4.
|
|
18
|
+
<title>EmbarkAI Secure Wallet - iframe version 0.4.11</title>
|
|
19
19
|
|
|
20
20
|
<!-- Styles will be injected by build process -->
|
|
21
21
|
<style>
|
package/dist/iframe/main.js
CHANGED
|
@@ -6262,7 +6262,7 @@ var SigningManager = class extends TokenRefreshApiClient {
|
|
|
6262
6262
|
};
|
|
6263
6263
|
|
|
6264
6264
|
// src/iframe/main.ts
|
|
6265
|
-
var IFRAME_VERSION = "0.4.
|
|
6265
|
+
var IFRAME_VERSION = "0.4.11";
|
|
6266
6266
|
var IframeWallet = class {
|
|
6267
6267
|
constructor() {
|
|
6268
6268
|
console.log("=".repeat(60));
|
package/dist/index.cjs
CHANGED
|
@@ -15813,6 +15813,55 @@ var init_constants6 = __esm({
|
|
|
15813
15813
|
}
|
|
15814
15814
|
});
|
|
15815
15815
|
|
|
15816
|
+
// src/internal/components/SecurityMenu/hooks.ts
|
|
15817
|
+
function useConnectedApps() {
|
|
15818
|
+
const session = useSession((st) => st.session);
|
|
15819
|
+
const userId = session?.mpcUserId || null;
|
|
15820
|
+
return (0, import_react_query42.useQuery)({
|
|
15821
|
+
retry: false,
|
|
15822
|
+
enabled: !!userId,
|
|
15823
|
+
queryKey: [CONNECTED_TRUSTED_APPS_QUERY, userId],
|
|
15824
|
+
queryFn: async () => {
|
|
15825
|
+
const iframeManager = getIframeManager();
|
|
15826
|
+
return await iframeManager.getTrustedApps(userId).catch(() => {
|
|
15827
|
+
console.error("[ConnectedApps] Failed to load connected apps from iframe");
|
|
15828
|
+
return [];
|
|
15829
|
+
});
|
|
15830
|
+
}
|
|
15831
|
+
});
|
|
15832
|
+
}
|
|
15833
|
+
function useKeyshareRecoveryStats() {
|
|
15834
|
+
const session = useSession((st) => st.session);
|
|
15835
|
+
const userId = session?.mpcUserId || null;
|
|
15836
|
+
return (0, import_react_query42.useQuery)({
|
|
15837
|
+
enabled: !!userId,
|
|
15838
|
+
queryKey: [KEYSHARE_RECOVERY_STATS_QUERY, userId],
|
|
15839
|
+
queryFn: async () => {
|
|
15840
|
+
const iframeManager = getIframeManager();
|
|
15841
|
+
if (!iframeManager) {
|
|
15842
|
+
throw new Error("Iframe manager not available");
|
|
15843
|
+
}
|
|
15844
|
+
const keyshareInfo = await getKeyshareInfo(userId);
|
|
15845
|
+
const shareRecoveryStats = await getShareRecoveryStats();
|
|
15846
|
+
return {
|
|
15847
|
+
keyshareInfo,
|
|
15848
|
+
shareRecoveryStats
|
|
15849
|
+
};
|
|
15850
|
+
}
|
|
15851
|
+
});
|
|
15852
|
+
}
|
|
15853
|
+
var import_react_query42;
|
|
15854
|
+
var init_hooks2 = __esm({
|
|
15855
|
+
"src/internal/components/SecurityMenu/hooks.ts"() {
|
|
15856
|
+
init_SessionContext();
|
|
15857
|
+
import_react_query42 = require("@tanstack/react-query");
|
|
15858
|
+
init_keyshare();
|
|
15859
|
+
init_iframe_manager();
|
|
15860
|
+
init_vaultClient();
|
|
15861
|
+
init_constants6();
|
|
15862
|
+
}
|
|
15863
|
+
});
|
|
15864
|
+
|
|
15816
15865
|
// src/internal/components/SecurityMenu/ConnectedApps.tsx
|
|
15817
15866
|
function Application(props) {
|
|
15818
15867
|
const { appLogo, appName, origin, trustedAt, untrustApp } = props;
|
|
@@ -15876,20 +15925,7 @@ function Application(props) {
|
|
|
15876
15925
|
function ConnectedApps(props) {
|
|
15877
15926
|
const { isLoading: isParentLoading, untrustApp } = props;
|
|
15878
15927
|
const { t } = useT();
|
|
15879
|
-
const
|
|
15880
|
-
const userId = session?.mpcUserId || null;
|
|
15881
|
-
const { data: connectedApps = [], isLoading: isConnectedAppsLoading } = (0, import_react_query42.useQuery)({
|
|
15882
|
-
retry: false,
|
|
15883
|
-
enabled: !!userId,
|
|
15884
|
-
queryKey: [CONNECTED_TRUSTED_APPS_QUERY, userId],
|
|
15885
|
-
queryFn: async () => {
|
|
15886
|
-
const iframeManager = getIframeManager();
|
|
15887
|
-
return await iframeManager.getTrustedApps(userId).catch(() => {
|
|
15888
|
-
console.error("[ConnectedApps] Failed to load connected apps from iframe");
|
|
15889
|
-
return [];
|
|
15890
|
-
});
|
|
15891
|
-
}
|
|
15892
|
-
});
|
|
15928
|
+
const { data: connectedApps = [], isLoading: isConnectedAppsLoading } = useConnectedApps();
|
|
15893
15929
|
const isLoading = isConnectedAppsLoading || isParentLoading;
|
|
15894
15930
|
if (isLoading) return null;
|
|
15895
15931
|
if (!isLoading && connectedApps.length === 0)
|
|
@@ -15908,20 +15944,17 @@ function ConnectedApps(props) {
|
|
|
15908
15944
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: connectedApps.map((app, index) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Application, { ...app, untrustApp }, index)) })
|
|
15909
15945
|
] });
|
|
15910
15946
|
}
|
|
15911
|
-
var
|
|
15947
|
+
var import_dayjs5, import_lodash_es7, import_lucide_react52, import_jsx_runtime82;
|
|
15912
15948
|
var init_ConnectedApps = __esm({
|
|
15913
15949
|
"src/internal/components/SecurityMenu/ConnectedApps.tsx"() {
|
|
15914
15950
|
init_utils2();
|
|
15915
|
-
init_SessionContext();
|
|
15916
15951
|
init_i18n();
|
|
15917
|
-
import_react_query42 = require("@tanstack/react-query");
|
|
15918
15952
|
import_dayjs5 = __toESM(require("dayjs"), 1);
|
|
15919
15953
|
import_lodash_es7 = require("lodash-es");
|
|
15920
15954
|
import_lucide_react52 = require("lucide-react");
|
|
15921
|
-
init_iframe_manager();
|
|
15922
15955
|
init_button();
|
|
15923
15956
|
init_highlight();
|
|
15924
|
-
|
|
15957
|
+
init_hooks2();
|
|
15925
15958
|
import_jsx_runtime82 = require("react/jsx-runtime");
|
|
15926
15959
|
}
|
|
15927
15960
|
});
|
|
@@ -16202,22 +16235,7 @@ function SecurityMenu() {
|
|
|
16202
16235
|
const userId = import_auth20.jwtTokenManager.getUserId();
|
|
16203
16236
|
const serverHasKeyshare = import_auth20.jwtTokenManager.getHasKeyshare() ?? false;
|
|
16204
16237
|
const [appToUntrust, untrustApp] = (0, import_react60.useState)(null);
|
|
16205
|
-
const { data: recoveryData, isLoading: isRecoveryLoading } = (
|
|
16206
|
-
enabled: !!userId,
|
|
16207
|
-
queryKey: [KEYSHARE_RECOVERY_STATS_QUERY, userId],
|
|
16208
|
-
queryFn: async () => {
|
|
16209
|
-
const iframeManager = getIframeManager();
|
|
16210
|
-
if (!iframeManager) {
|
|
16211
|
-
throw new Error("Iframe manager not available");
|
|
16212
|
-
}
|
|
16213
|
-
const keyshareInfo = await getKeyshareInfo(userId);
|
|
16214
|
-
const shareRecoveryStats = await getShareRecoveryStats();
|
|
16215
|
-
return {
|
|
16216
|
-
keyshareInfo,
|
|
16217
|
-
shareRecoveryStats
|
|
16218
|
-
};
|
|
16219
|
-
}
|
|
16220
|
-
});
|
|
16238
|
+
const { data: recoveryData, isLoading: isRecoveryLoading } = useKeyshareRecoveryStats();
|
|
16221
16239
|
const localInfo = recoveryData?.keyshareInfo || {};
|
|
16222
16240
|
const hasServerBackup = !!recoveryData?.shareRecoveryStats?.created || recoveryData?.shareRecoveryStats?.devices?.length > 0;
|
|
16223
16241
|
const { mutate: handleUntrustApp, isPending: isUntrustingApp } = (0, import_react_query43.useMutation)({
|
|
@@ -16300,15 +16318,14 @@ var init_SecurityMenu = __esm({
|
|
|
16300
16318
|
import_lucide_react57 = require("lucide-react");
|
|
16301
16319
|
import_react60 = require("react");
|
|
16302
16320
|
init_auth();
|
|
16303
|
-
init_keyshare();
|
|
16304
16321
|
init_useLayoutDataStore();
|
|
16305
16322
|
init_useLayoutStore();
|
|
16306
16323
|
init_iframe_manager();
|
|
16307
|
-
init_vaultClient();
|
|
16308
16324
|
init_Expandable2();
|
|
16309
16325
|
init_button();
|
|
16310
16326
|
init_ConnectedApps();
|
|
16311
16327
|
init_constants6();
|
|
16328
|
+
init_hooks2();
|
|
16312
16329
|
init_Keyshare2();
|
|
16313
16330
|
init_UntrustApplication();
|
|
16314
16331
|
import_jsx_runtime88 = require("react/jsx-runtime");
|
|
@@ -19223,7 +19240,7 @@ var init_package = __esm({
|
|
|
19223
19240
|
"package.json"() {
|
|
19224
19241
|
package_default = {
|
|
19225
19242
|
name: "@embarkai/ui-kit",
|
|
19226
|
-
version: "0.4.
|
|
19243
|
+
version: "0.4.11",
|
|
19227
19244
|
description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
|
|
19228
19245
|
type: "module",
|
|
19229
19246
|
main: "./dist/index.cjs",
|
|
@@ -25083,7 +25100,6 @@ var USER_PROFILE_QUERY_KEY;
|
|
|
25083
25100
|
var init_exportedQueryKeys = __esm({
|
|
25084
25101
|
"src/internal/exportedQueryKeys.ts"() {
|
|
25085
25102
|
init_profile();
|
|
25086
|
-
init_constants6();
|
|
25087
25103
|
USER_PROFILE_QUERY_KEY = QUERY_KEYS.userProfile;
|
|
25088
25104
|
}
|
|
25089
25105
|
});
|
|
@@ -25093,11 +25109,9 @@ var index_exports = {};
|
|
|
25093
25109
|
__export(index_exports, {
|
|
25094
25110
|
AccountAbstractionError: () => AccountAbstractionError,
|
|
25095
25111
|
Address: () => Address,
|
|
25096
|
-
CONNECTED_TRUSTED_APPS_QUERY_KEY: () => CONNECTED_TRUSTED_APPS_QUERY,
|
|
25097
25112
|
ConnectWalletButton: () => ConnectWalletButton,
|
|
25098
25113
|
ErrorCodes: () => ErrorCodes,
|
|
25099
25114
|
Hash: () => Hash,
|
|
25100
|
-
KEYSHARE_RECOVERY_STATS_QUERY_KEY: () => KEYSHARE_RECOVERY_STATS_QUERY,
|
|
25101
25115
|
KeyshareBackup: () => KeyshareBackupMenu,
|
|
25102
25116
|
LOCAL_STORAGE_I18N_KEY: () => LOCAL_STORAGE_I18N_KEY,
|
|
25103
25117
|
LangToggle: () => LangToggle,
|
|
@@ -25141,6 +25155,7 @@ __export(index_exports, {
|
|
|
25141
25155
|
useBalance: () => useBalance,
|
|
25142
25156
|
useBlockscoutAssets: () => useBlockscoutAssets,
|
|
25143
25157
|
useColorMode: () => useColorMode,
|
|
25158
|
+
useConnectedApps: () => useConnectedApps,
|
|
25144
25159
|
useDirectWallet: () => useDirectWallet,
|
|
25145
25160
|
useErc3643Compliance: () => useErc3643Compliance,
|
|
25146
25161
|
useError: () => useError,
|
|
@@ -25148,6 +25163,7 @@ __export(index_exports, {
|
|
|
25148
25163
|
useHydrated: () => useHydrated,
|
|
25149
25164
|
useIFrameReady: () => useIFrameReady,
|
|
25150
25165
|
useIsMobileView: () => useIsMobileView,
|
|
25166
|
+
useKeyshareRecoveryStats: () => useKeyshareRecoveryStats,
|
|
25151
25167
|
useLinkedProfiles: () => useLinkedProfiles,
|
|
25152
25168
|
useLoadingStatus: () => useLoadingStatus,
|
|
25153
25169
|
useLogout: () => useLogout,
|
|
@@ -25218,6 +25234,7 @@ var init_index = __esm({
|
|
|
25218
25234
|
init_clients2();
|
|
25219
25235
|
init_auth();
|
|
25220
25236
|
init_profile();
|
|
25237
|
+
init_hooks2();
|
|
25221
25238
|
init_linkedProfiles();
|
|
25222
25239
|
init_nickname_fingerprint();
|
|
25223
25240
|
init_errors();
|
|
@@ -25239,11 +25256,9 @@ init_index();
|
|
|
25239
25256
|
0 && (module.exports = {
|
|
25240
25257
|
AccountAbstractionError,
|
|
25241
25258
|
Address,
|
|
25242
|
-
CONNECTED_TRUSTED_APPS_QUERY_KEY,
|
|
25243
25259
|
ConnectWalletButton,
|
|
25244
25260
|
ErrorCodes,
|
|
25245
25261
|
Hash,
|
|
25246
|
-
KEYSHARE_RECOVERY_STATS_QUERY_KEY,
|
|
25247
25262
|
KeyshareBackup,
|
|
25248
25263
|
LOCAL_STORAGE_I18N_KEY,
|
|
25249
25264
|
LangToggle,
|
|
@@ -25287,6 +25302,7 @@ init_index();
|
|
|
25287
25302
|
useBalance,
|
|
25288
25303
|
useBlockscoutAssets,
|
|
25289
25304
|
useColorMode,
|
|
25305
|
+
useConnectedApps,
|
|
25290
25306
|
useDirectWallet,
|
|
25291
25307
|
useErc3643Compliance,
|
|
25292
25308
|
useError,
|
|
@@ -25294,6 +25310,7 @@ init_index();
|
|
|
25294
25310
|
useHydrated,
|
|
25295
25311
|
useIFrameReady,
|
|
25296
25312
|
useIsMobileView,
|
|
25313
|
+
useKeyshareRecoveryStats,
|
|
25297
25314
|
useLinkedProfiles,
|
|
25298
25315
|
useLoadingStatus,
|
|
25299
25316
|
useLogout,
|
package/dist/index.d.cts
CHANGED
|
@@ -1802,6 +1802,24 @@ declare function getUserProfile(): Promise<UserProfile>;
|
|
|
1802
1802
|
*/
|
|
1803
1803
|
declare function updateUserProfile(updates: UpdateProfileRequest): Promise<UserProfile>;
|
|
1804
1804
|
|
|
1805
|
+
declare function useConnectedApps(): _tanstack_react_query.UseQueryResult<any[] | {
|
|
1806
|
+
userId: string;
|
|
1807
|
+
projectId: string;
|
|
1808
|
+
origin: string;
|
|
1809
|
+
trustedAt: number;
|
|
1810
|
+
appName?: string;
|
|
1811
|
+
appLogo?: string;
|
|
1812
|
+
}[], Error>;
|
|
1813
|
+
declare function useKeyshareRecoveryStats(): _tanstack_react_query.UseQueryResult<{
|
|
1814
|
+
keyshareInfo: {
|
|
1815
|
+
hasKeyshare: boolean;
|
|
1816
|
+
ownerAddress?: `0x${string}`;
|
|
1817
|
+
sessionId?: string;
|
|
1818
|
+
keyshareSize?: number;
|
|
1819
|
+
};
|
|
1820
|
+
shareRecoveryStats: RecoveryStats;
|
|
1821
|
+
}, Error>;
|
|
1822
|
+
|
|
1805
1823
|
interface LinkedProfileDisplay extends AuthProvider {
|
|
1806
1824
|
displayName: string;
|
|
1807
1825
|
icon?: React.ComponentType<{
|
|
@@ -2981,9 +2999,6 @@ declare function combineI18NResources(...resourses: TranslationResources[]): Tra
|
|
|
2981
2999
|
declare function getAvailableLanguages(resourses: TranslationResources): string[];
|
|
2982
3000
|
declare function getLanguageIcon(languageKey: string): string | null;
|
|
2983
3001
|
|
|
2984
|
-
declare const KEYSHARE_RECOVERY_STATS_QUERY = "keyshare-recovery-stats-query";
|
|
2985
|
-
declare const CONNECTED_TRUSTED_APPS_QUERY = "connected-trusted-apps-query";
|
|
2986
|
-
|
|
2987
3002
|
declare const USER_PROFILE_QUERY_KEY: string;
|
|
2988
3003
|
|
|
2989
|
-
export { AccountAbstractionError, type AccountSession, Address, type AddressProps, type Asset,
|
|
3004
|
+
export { AccountAbstractionError, type AccountSession, Address, type AddressProps, type Asset, type CallbacksConfig, ConnectWalletButton, type ConnectWalletButtonProps, type DirectTransactionParams, ErrorCodes, type FingerprintVerificationResult, Hash, type HashProps, KeyshareBackupMenu as KeyshareBackup, LOCAL_STORAGE_I18N_KEY, LangToggle, type NicknameAvailability, type NicknameAvatar, type NicknameChangeResult, type NicknameInfo, type NicknameResolution, type NicknameResolveRequest, type NicknameResolvedTarget, type NicknameValidationResult, PASSPORT_TRANSLATIONS, PageKey, type PageOpenParams, Provider, type ProviderConfig, type ProviderDetail, type ProviderProps, type RegisterSmartAccountResult, type SendTransactionParams, type SendTransactionResult, type SignTypedDataParams, type SmartAccountEntry, ThemeToggle, type TokenBalance, type Transaction, TransactionsList, type TransferToLinkedParams, type TypedDataDomain, type TypedDataField, USER_PROFILE_QUERY_KEY, type UpdateProfileRequest, type UseDirectWalletReturn, type UseErc3643ComplianceOptions, type UseErc3643ComplianceResult, type UseLogoutReturn, type UseNicknameResolveOptions, type UseNicknameResolveResult, type UseSendDirectTransactionReturn, type UseSendTransactionReturn, type UseTransferToLinkedReturn, type UseUserOpStatusOptions, type UseUserOpStatusReturn, type UseWalletModeReturn, type UserOpMempool, type SendTransactionParams$1 as UserOpSendTransactionParams, type UserOpState, UserOpStatus, type UserOpStatusProps, type UserOperation, type UserOperationByHash, type UserOperationReceipt, UserOperationTimeoutError, type UserProfile, UserRejectedError, type WaitForReceiptOptions, type WalletMode, type WalletReadyStatus, type WatchToken, combineI18NResources, createAccountAbstractionError, deployAccount, destroyIframeManager, generateFingerprint, getAllSmartAccounts, getAvailableLanguages, getExplorerUrl, getIframeManager, getLanguageIcon, getShareRecoveryStats, getSmartAccountForChain, getUserOperationByHash, getUserOperationReceipt, getUserProfile, looksLikeNickname, prepareUserOperation, requireActiveChainId, sendUserOperation, signTypedData, updateUserProfile, useAccountSession, useActiveChainId, useAddress, useAssets, useBalance, useBlockscoutAssets, useColorMode, useConnectedApps, useDirectWallet, useErc3643Compliance, useError, useHasServerVault, useHydrated, useIFrameReady, useIsMobileView, useKeyshareRecoveryStats, useLinkedProfiles, useLoadingStatus, useLogout, useNativeWalletSignature, useNicknameResolve, useOpenPage, useProviderConfig, useRecoveryUserId, useSendDirectTransaction, useSendTransaction, useSession, useSmartAccountTransactions, useTokenBalance, useTokenInfo, useTransactions, useTransferToLinkedWallet, useUserOpStatus, useWalletMode, verifyFingerprint, verifyFingerprintDetailed, wagmiConfig, waitForStoreHydration, waitForUserOperationReceipt };
|
package/dist/index.d.ts
CHANGED
|
@@ -1802,6 +1802,24 @@ declare function getUserProfile(): Promise<UserProfile>;
|
|
|
1802
1802
|
*/
|
|
1803
1803
|
declare function updateUserProfile(updates: UpdateProfileRequest): Promise<UserProfile>;
|
|
1804
1804
|
|
|
1805
|
+
declare function useConnectedApps(): _tanstack_react_query.UseQueryResult<any[] | {
|
|
1806
|
+
userId: string;
|
|
1807
|
+
projectId: string;
|
|
1808
|
+
origin: string;
|
|
1809
|
+
trustedAt: number;
|
|
1810
|
+
appName?: string;
|
|
1811
|
+
appLogo?: string;
|
|
1812
|
+
}[], Error>;
|
|
1813
|
+
declare function useKeyshareRecoveryStats(): _tanstack_react_query.UseQueryResult<{
|
|
1814
|
+
keyshareInfo: {
|
|
1815
|
+
hasKeyshare: boolean;
|
|
1816
|
+
ownerAddress?: `0x${string}`;
|
|
1817
|
+
sessionId?: string;
|
|
1818
|
+
keyshareSize?: number;
|
|
1819
|
+
};
|
|
1820
|
+
shareRecoveryStats: RecoveryStats;
|
|
1821
|
+
}, Error>;
|
|
1822
|
+
|
|
1805
1823
|
interface LinkedProfileDisplay extends AuthProvider {
|
|
1806
1824
|
displayName: string;
|
|
1807
1825
|
icon?: React.ComponentType<{
|
|
@@ -2981,9 +2999,6 @@ declare function combineI18NResources(...resourses: TranslationResources[]): Tra
|
|
|
2981
2999
|
declare function getAvailableLanguages(resourses: TranslationResources): string[];
|
|
2982
3000
|
declare function getLanguageIcon(languageKey: string): string | null;
|
|
2983
3001
|
|
|
2984
|
-
declare const KEYSHARE_RECOVERY_STATS_QUERY = "keyshare-recovery-stats-query";
|
|
2985
|
-
declare const CONNECTED_TRUSTED_APPS_QUERY = "connected-trusted-apps-query";
|
|
2986
|
-
|
|
2987
3002
|
declare const USER_PROFILE_QUERY_KEY: string;
|
|
2988
3003
|
|
|
2989
|
-
export { AccountAbstractionError, type AccountSession, Address, type AddressProps, type Asset,
|
|
3004
|
+
export { AccountAbstractionError, type AccountSession, Address, type AddressProps, type Asset, type CallbacksConfig, ConnectWalletButton, type ConnectWalletButtonProps, type DirectTransactionParams, ErrorCodes, type FingerprintVerificationResult, Hash, type HashProps, KeyshareBackupMenu as KeyshareBackup, LOCAL_STORAGE_I18N_KEY, LangToggle, type NicknameAvailability, type NicknameAvatar, type NicknameChangeResult, type NicknameInfo, type NicknameResolution, type NicknameResolveRequest, type NicknameResolvedTarget, type NicknameValidationResult, PASSPORT_TRANSLATIONS, PageKey, type PageOpenParams, Provider, type ProviderConfig, type ProviderDetail, type ProviderProps, type RegisterSmartAccountResult, type SendTransactionParams, type SendTransactionResult, type SignTypedDataParams, type SmartAccountEntry, ThemeToggle, type TokenBalance, type Transaction, TransactionsList, type TransferToLinkedParams, type TypedDataDomain, type TypedDataField, USER_PROFILE_QUERY_KEY, type UpdateProfileRequest, type UseDirectWalletReturn, type UseErc3643ComplianceOptions, type UseErc3643ComplianceResult, type UseLogoutReturn, type UseNicknameResolveOptions, type UseNicknameResolveResult, type UseSendDirectTransactionReturn, type UseSendTransactionReturn, type UseTransferToLinkedReturn, type UseUserOpStatusOptions, type UseUserOpStatusReturn, type UseWalletModeReturn, type UserOpMempool, type SendTransactionParams$1 as UserOpSendTransactionParams, type UserOpState, UserOpStatus, type UserOpStatusProps, type UserOperation, type UserOperationByHash, type UserOperationReceipt, UserOperationTimeoutError, type UserProfile, UserRejectedError, type WaitForReceiptOptions, type WalletMode, type WalletReadyStatus, type WatchToken, combineI18NResources, createAccountAbstractionError, deployAccount, destroyIframeManager, generateFingerprint, getAllSmartAccounts, getAvailableLanguages, getExplorerUrl, getIframeManager, getLanguageIcon, getShareRecoveryStats, getSmartAccountForChain, getUserOperationByHash, getUserOperationReceipt, getUserProfile, looksLikeNickname, prepareUserOperation, requireActiveChainId, sendUserOperation, signTypedData, updateUserProfile, useAccountSession, useActiveChainId, useAddress, useAssets, useBalance, useBlockscoutAssets, useColorMode, useConnectedApps, useDirectWallet, useErc3643Compliance, useError, useHasServerVault, useHydrated, useIFrameReady, useIsMobileView, useKeyshareRecoveryStats, useLinkedProfiles, useLoadingStatus, useLogout, useNativeWalletSignature, useNicknameResolve, useOpenPage, useProviderConfig, useRecoveryUserId, useSendDirectTransaction, useSendTransaction, useSession, useSmartAccountTransactions, useTokenBalance, useTokenInfo, useTransactions, useTransferToLinkedWallet, useUserOpStatus, useWalletMode, verifyFingerprint, verifyFingerprintDetailed, wagmiConfig, waitForStoreHydration, waitForUserOperationReceipt };
|
package/dist/index.js
CHANGED
|
@@ -15745,8 +15745,55 @@ var init_constants6 = __esm({
|
|
|
15745
15745
|
}
|
|
15746
15746
|
});
|
|
15747
15747
|
|
|
15748
|
-
// src/internal/components/SecurityMenu/
|
|
15748
|
+
// src/internal/components/SecurityMenu/hooks.ts
|
|
15749
15749
|
import { useQuery as useQuery18 } from "@tanstack/react-query";
|
|
15750
|
+
function useConnectedApps() {
|
|
15751
|
+
const session = useSession((st) => st.session);
|
|
15752
|
+
const userId = session?.mpcUserId || null;
|
|
15753
|
+
return useQuery18({
|
|
15754
|
+
retry: false,
|
|
15755
|
+
enabled: !!userId,
|
|
15756
|
+
queryKey: [CONNECTED_TRUSTED_APPS_QUERY, userId],
|
|
15757
|
+
queryFn: async () => {
|
|
15758
|
+
const iframeManager = getIframeManager();
|
|
15759
|
+
return await iframeManager.getTrustedApps(userId).catch(() => {
|
|
15760
|
+
console.error("[ConnectedApps] Failed to load connected apps from iframe");
|
|
15761
|
+
return [];
|
|
15762
|
+
});
|
|
15763
|
+
}
|
|
15764
|
+
});
|
|
15765
|
+
}
|
|
15766
|
+
function useKeyshareRecoveryStats() {
|
|
15767
|
+
const session = useSession((st) => st.session);
|
|
15768
|
+
const userId = session?.mpcUserId || null;
|
|
15769
|
+
return useQuery18({
|
|
15770
|
+
enabled: !!userId,
|
|
15771
|
+
queryKey: [KEYSHARE_RECOVERY_STATS_QUERY, userId],
|
|
15772
|
+
queryFn: async () => {
|
|
15773
|
+
const iframeManager = getIframeManager();
|
|
15774
|
+
if (!iframeManager) {
|
|
15775
|
+
throw new Error("Iframe manager not available");
|
|
15776
|
+
}
|
|
15777
|
+
const keyshareInfo = await getKeyshareInfo(userId);
|
|
15778
|
+
const shareRecoveryStats = await getShareRecoveryStats();
|
|
15779
|
+
return {
|
|
15780
|
+
keyshareInfo,
|
|
15781
|
+
shareRecoveryStats
|
|
15782
|
+
};
|
|
15783
|
+
}
|
|
15784
|
+
});
|
|
15785
|
+
}
|
|
15786
|
+
var init_hooks2 = __esm({
|
|
15787
|
+
"src/internal/components/SecurityMenu/hooks.ts"() {
|
|
15788
|
+
init_SessionContext();
|
|
15789
|
+
init_keyshare();
|
|
15790
|
+
init_iframe_manager();
|
|
15791
|
+
init_vaultClient();
|
|
15792
|
+
init_constants6();
|
|
15793
|
+
}
|
|
15794
|
+
});
|
|
15795
|
+
|
|
15796
|
+
// src/internal/components/SecurityMenu/ConnectedApps.tsx
|
|
15750
15797
|
import dayjs5 from "dayjs";
|
|
15751
15798
|
import { omit } from "lodash-es";
|
|
15752
15799
|
import { AppWindowMac, Info as Info5, ShieldBanIcon, ShieldCheckIcon } from "lucide-react";
|
|
@@ -15813,20 +15860,7 @@ function Application(props) {
|
|
|
15813
15860
|
function ConnectedApps(props) {
|
|
15814
15861
|
const { isLoading: isParentLoading, untrustApp } = props;
|
|
15815
15862
|
const { t } = useT();
|
|
15816
|
-
const
|
|
15817
|
-
const userId = session?.mpcUserId || null;
|
|
15818
|
-
const { data: connectedApps = [], isLoading: isConnectedAppsLoading } = useQuery18({
|
|
15819
|
-
retry: false,
|
|
15820
|
-
enabled: !!userId,
|
|
15821
|
-
queryKey: [CONNECTED_TRUSTED_APPS_QUERY, userId],
|
|
15822
|
-
queryFn: async () => {
|
|
15823
|
-
const iframeManager = getIframeManager();
|
|
15824
|
-
return await iframeManager.getTrustedApps(userId).catch(() => {
|
|
15825
|
-
console.error("[ConnectedApps] Failed to load connected apps from iframe");
|
|
15826
|
-
return [];
|
|
15827
|
-
});
|
|
15828
|
-
}
|
|
15829
|
-
});
|
|
15863
|
+
const { data: connectedApps = [], isLoading: isConnectedAppsLoading } = useConnectedApps();
|
|
15830
15864
|
const isLoading = isConnectedAppsLoading || isParentLoading;
|
|
15831
15865
|
if (isLoading) return null;
|
|
15832
15866
|
if (!isLoading && connectedApps.length === 0)
|
|
@@ -15848,12 +15882,10 @@ function ConnectedApps(props) {
|
|
|
15848
15882
|
var init_ConnectedApps = __esm({
|
|
15849
15883
|
"src/internal/components/SecurityMenu/ConnectedApps.tsx"() {
|
|
15850
15884
|
init_utils2();
|
|
15851
|
-
init_SessionContext();
|
|
15852
15885
|
init_i18n();
|
|
15853
|
-
init_iframe_manager();
|
|
15854
15886
|
init_button();
|
|
15855
15887
|
init_highlight();
|
|
15856
|
-
|
|
15888
|
+
init_hooks2();
|
|
15857
15889
|
}
|
|
15858
15890
|
});
|
|
15859
15891
|
|
|
@@ -16122,7 +16154,7 @@ var init_UntrustApplication = __esm({
|
|
|
16122
16154
|
});
|
|
16123
16155
|
|
|
16124
16156
|
// src/internal/components/SecurityMenu/SecurityMenu.tsx
|
|
16125
|
-
import { useMutation as useMutation17,
|
|
16157
|
+
import { useMutation as useMutation17, useQueryClient as useQueryClient22 } from "@tanstack/react-query";
|
|
16126
16158
|
import { ArrowLeft as ArrowLeft17 } from "lucide-react";
|
|
16127
16159
|
import { useState as useState23 } from "react";
|
|
16128
16160
|
import { jsx as jsx88, jsxs as jsxs81 } from "react/jsx-runtime";
|
|
@@ -16134,22 +16166,7 @@ function SecurityMenu() {
|
|
|
16134
16166
|
const userId = jwtTokenManager2.getUserId();
|
|
16135
16167
|
const serverHasKeyshare = jwtTokenManager2.getHasKeyshare() ?? false;
|
|
16136
16168
|
const [appToUntrust, untrustApp] = useState23(null);
|
|
16137
|
-
const { data: recoveryData, isLoading: isRecoveryLoading } =
|
|
16138
|
-
enabled: !!userId,
|
|
16139
|
-
queryKey: [KEYSHARE_RECOVERY_STATS_QUERY, userId],
|
|
16140
|
-
queryFn: async () => {
|
|
16141
|
-
const iframeManager = getIframeManager();
|
|
16142
|
-
if (!iframeManager) {
|
|
16143
|
-
throw new Error("Iframe manager not available");
|
|
16144
|
-
}
|
|
16145
|
-
const keyshareInfo = await getKeyshareInfo(userId);
|
|
16146
|
-
const shareRecoveryStats = await getShareRecoveryStats();
|
|
16147
|
-
return {
|
|
16148
|
-
keyshareInfo,
|
|
16149
|
-
shareRecoveryStats
|
|
16150
|
-
};
|
|
16151
|
-
}
|
|
16152
|
-
});
|
|
16169
|
+
const { data: recoveryData, isLoading: isRecoveryLoading } = useKeyshareRecoveryStats();
|
|
16153
16170
|
const localInfo = recoveryData?.keyshareInfo || {};
|
|
16154
16171
|
const hasServerBackup = !!recoveryData?.shareRecoveryStats?.created || recoveryData?.shareRecoveryStats?.devices?.length > 0;
|
|
16155
16172
|
const { mutate: handleUntrustApp, isPending: isUntrustingApp } = useMutation17({
|
|
@@ -16228,15 +16245,14 @@ var init_SecurityMenu = __esm({
|
|
|
16228
16245
|
"src/internal/components/SecurityMenu/SecurityMenu.tsx"() {
|
|
16229
16246
|
init_i18n();
|
|
16230
16247
|
init_auth();
|
|
16231
|
-
init_keyshare();
|
|
16232
16248
|
init_useLayoutDataStore();
|
|
16233
16249
|
init_useLayoutStore();
|
|
16234
16250
|
init_iframe_manager();
|
|
16235
|
-
init_vaultClient();
|
|
16236
16251
|
init_Expandable2();
|
|
16237
16252
|
init_button();
|
|
16238
16253
|
init_ConnectedApps();
|
|
16239
16254
|
init_constants6();
|
|
16255
|
+
init_hooks2();
|
|
16240
16256
|
init_Keyshare2();
|
|
16241
16257
|
init_UntrustApplication();
|
|
16242
16258
|
}
|
|
@@ -19142,7 +19158,7 @@ var init_package = __esm({
|
|
|
19142
19158
|
"package.json"() {
|
|
19143
19159
|
package_default = {
|
|
19144
19160
|
name: "@embarkai/ui-kit",
|
|
19145
|
-
version: "0.4.
|
|
19161
|
+
version: "0.4.11",
|
|
19146
19162
|
description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
|
|
19147
19163
|
type: "module",
|
|
19148
19164
|
main: "./dist/index.cjs",
|
|
@@ -25010,7 +25026,6 @@ var USER_PROFILE_QUERY_KEY;
|
|
|
25010
25026
|
var init_exportedQueryKeys = __esm({
|
|
25011
25027
|
"src/internal/exportedQueryKeys.ts"() {
|
|
25012
25028
|
init_profile();
|
|
25013
|
-
init_constants6();
|
|
25014
25029
|
USER_PROFILE_QUERY_KEY = QUERY_KEYS.userProfile;
|
|
25015
25030
|
}
|
|
25016
25031
|
});
|
|
@@ -25061,6 +25076,7 @@ var init_index = __esm({
|
|
|
25061
25076
|
init_clients2();
|
|
25062
25077
|
init_auth();
|
|
25063
25078
|
init_profile();
|
|
25079
|
+
init_hooks2();
|
|
25064
25080
|
init_linkedProfiles();
|
|
25065
25081
|
init_nickname_fingerprint();
|
|
25066
25082
|
init_errors();
|
|
@@ -25081,11 +25097,9 @@ init_index();
|
|
|
25081
25097
|
export {
|
|
25082
25098
|
AccountAbstractionError,
|
|
25083
25099
|
Address,
|
|
25084
|
-
CONNECTED_TRUSTED_APPS_QUERY as CONNECTED_TRUSTED_APPS_QUERY_KEY,
|
|
25085
25100
|
ConnectWalletButton,
|
|
25086
25101
|
ErrorCodes,
|
|
25087
25102
|
Hash,
|
|
25088
|
-
KEYSHARE_RECOVERY_STATS_QUERY as KEYSHARE_RECOVERY_STATS_QUERY_KEY,
|
|
25089
25103
|
KeyshareBackupMenu as KeyshareBackup,
|
|
25090
25104
|
LOCAL_STORAGE_I18N_KEY,
|
|
25091
25105
|
LangToggle,
|
|
@@ -25129,6 +25143,7 @@ export {
|
|
|
25129
25143
|
useBalance,
|
|
25130
25144
|
useBlockscoutAssets,
|
|
25131
25145
|
useColorMode,
|
|
25146
|
+
useConnectedApps,
|
|
25132
25147
|
useDirectWallet,
|
|
25133
25148
|
useErc3643Compliance,
|
|
25134
25149
|
useError,
|
|
@@ -25136,6 +25151,7 @@ export {
|
|
|
25136
25151
|
useHydrated,
|
|
25137
25152
|
useIFrameReady,
|
|
25138
25153
|
useIsMobileView,
|
|
25154
|
+
useKeyshareRecoveryStats,
|
|
25139
25155
|
useLinkedProfiles,
|
|
25140
25156
|
useLoadingStatus,
|
|
25141
25157
|
useLogout,
|