@embarkai/ui-kit 0.4.3 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/iframe/index.html +1 -1
- package/dist/iframe/main.js +1 -1
- package/dist/index.cjs +40 -7
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +38 -7
- 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.5</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.5";
|
|
6266
6266
|
var IframeWallet = class {
|
|
6267
6267
|
constructor() {
|
|
6268
6268
|
console.log("=".repeat(60));
|
package/dist/index.cjs
CHANGED
|
@@ -13948,6 +13948,12 @@ var init_EmailNotConnectedWarning = __esm({
|
|
|
13948
13948
|
});
|
|
13949
13949
|
|
|
13950
13950
|
// src/internal/components/ManageWalletMenu/hooks/useLinkSocial.ts
|
|
13951
|
+
function normalizeSocialLinkError(message) {
|
|
13952
|
+
if (message === "X_ALREADY_LINKED") {
|
|
13953
|
+
return "This X account is already linked to another account";
|
|
13954
|
+
}
|
|
13955
|
+
return message;
|
|
13956
|
+
}
|
|
13951
13957
|
function useLinkSocial() {
|
|
13952
13958
|
const qc = (0, import_react_query32.useQueryClient)();
|
|
13953
13959
|
const address = useSession((st) => st.address);
|
|
@@ -14007,7 +14013,7 @@ function useLinkSocial() {
|
|
|
14007
14013
|
setPage("manage-wallet" /* MANAGE_WALLET */);
|
|
14008
14014
|
} catch (e) {
|
|
14009
14015
|
console.error(`[ManageWallet] Failed to link ${providerIdRaw}:`, e);
|
|
14010
|
-
const message = e?.message || `Failed to link ${providerIdRaw}
|
|
14016
|
+
const message = normalizeSocialLinkError(e?.message || `Failed to link ${providerIdRaw}`);
|
|
14011
14017
|
setAlert({ title: "Error", message });
|
|
14012
14018
|
setProviderType(null);
|
|
14013
14019
|
} finally {
|
|
@@ -14200,11 +14206,23 @@ var init_useLinkTelegram = __esm({
|
|
|
14200
14206
|
});
|
|
14201
14207
|
|
|
14202
14208
|
// src/internal/components/ManageWalletMenu/ProviderCard.tsx
|
|
14203
|
-
function
|
|
14204
|
-
|
|
14205
|
-
|
|
14209
|
+
function getProviderCaption(provider) {
|
|
14210
|
+
const providerName = provider.provider;
|
|
14211
|
+
switch (providerName) {
|
|
14212
|
+
case "email":
|
|
14213
|
+
return provider.externalId;
|
|
14214
|
+
case "wallet":
|
|
14215
|
+
if (provider.externalId && provider.externalId.startsWith("0x") && provider.externalId.length >= 14) {
|
|
14216
|
+
return `${provider.externalId.slice(0, 10)}...${provider.externalId.slice(-4)}`;
|
|
14217
|
+
}
|
|
14218
|
+
return provider.externalId || providerName;
|
|
14219
|
+
// @ts-expect-error x === twitter
|
|
14220
|
+
case "x":
|
|
14221
|
+
case "telegram":
|
|
14222
|
+
return (provider?.meta?.username ? `@${provider.meta.username}` : provider.externalId).toLowerCase();
|
|
14223
|
+
default:
|
|
14224
|
+
return provider.externalId || providerName;
|
|
14206
14225
|
}
|
|
14207
|
-
return externalId;
|
|
14208
14226
|
}
|
|
14209
14227
|
function ProviderCard(props) {
|
|
14210
14228
|
const { t } = useT();
|
|
@@ -14233,7 +14251,7 @@ function ProviderCard(props) {
|
|
|
14233
14251
|
style: { maxWidth: 184 },
|
|
14234
14252
|
className: "block w-full font-bold text-xs whitespace-nowrap text-ellipsis overflow-hidden",
|
|
14235
14253
|
title: props.externalId,
|
|
14236
|
-
children:
|
|
14254
|
+
children: getProviderCaption(props)
|
|
14237
14255
|
}
|
|
14238
14256
|
)
|
|
14239
14257
|
] }),
|
|
@@ -19149,7 +19167,7 @@ var init_package = __esm({
|
|
|
19149
19167
|
"package.json"() {
|
|
19150
19168
|
package_default = {
|
|
19151
19169
|
name: "@embarkai/ui-kit",
|
|
19152
|
-
version: "0.4.
|
|
19170
|
+
version: "0.4.5",
|
|
19153
19171
|
description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
|
|
19154
19172
|
type: "module",
|
|
19155
19173
|
main: "./dist/index.cjs",
|
|
@@ -24924,6 +24942,16 @@ var init_smartAccountTransactions = __esm({
|
|
|
24924
24942
|
}
|
|
24925
24943
|
});
|
|
24926
24944
|
|
|
24945
|
+
// src/internal/exportedQueryKeys.ts
|
|
24946
|
+
var USER_PROFILE_QUERY_KEY;
|
|
24947
|
+
var init_exportedQueryKeys = __esm({
|
|
24948
|
+
"src/internal/exportedQueryKeys.ts"() {
|
|
24949
|
+
init_profile();
|
|
24950
|
+
init_constants6();
|
|
24951
|
+
USER_PROFILE_QUERY_KEY = QUERY_KEYS.userProfile;
|
|
24952
|
+
}
|
|
24953
|
+
});
|
|
24954
|
+
|
|
24927
24955
|
// src/index.ts
|
|
24928
24956
|
var index_exports = {};
|
|
24929
24957
|
__export(index_exports, {
|
|
@@ -24932,6 +24960,7 @@ __export(index_exports, {
|
|
|
24932
24960
|
ConnectWalletButton: () => ConnectWalletButton,
|
|
24933
24961
|
ErrorCodes: () => ErrorCodes,
|
|
24934
24962
|
Hash: () => Hash,
|
|
24963
|
+
KEYSHARE_RECOVERY_STATS_QUERY_KEY: () => KEYSHARE_RECOVERY_STATS_QUERY,
|
|
24935
24964
|
KeyshareBackup: () => KeyshareBackupMenu,
|
|
24936
24965
|
LOCAL_STORAGE_I18N_KEY: () => LOCAL_STORAGE_I18N_KEY,
|
|
24937
24966
|
LangToggle: () => LangToggle,
|
|
@@ -24940,6 +24969,7 @@ __export(index_exports, {
|
|
|
24940
24969
|
Provider: () => Provider,
|
|
24941
24970
|
ThemeToggle: () => ThemeToggle,
|
|
24942
24971
|
TransactionsList: () => TransactionsList,
|
|
24972
|
+
USER_PROFILE_QUERY_KEY: () => USER_PROFILE_QUERY_KEY,
|
|
24943
24973
|
UserOpStatus: () => UserOpStatus,
|
|
24944
24974
|
UserOperationTimeoutError: () => UserOperationTimeoutError,
|
|
24945
24975
|
UserRejectedError: () => UserRejectedError,
|
|
@@ -25060,6 +25090,7 @@ var init_index = __esm({
|
|
|
25060
25090
|
init_smartAccountTransactions();
|
|
25061
25091
|
init_iframe_manager();
|
|
25062
25092
|
init_i18n();
|
|
25093
|
+
init_exportedQueryKeys();
|
|
25063
25094
|
STYLES_TAG_ID = "account-abstraction-provider-autostyles";
|
|
25064
25095
|
autorun();
|
|
25065
25096
|
}
|
|
@@ -25072,6 +25103,7 @@ init_index();
|
|
|
25072
25103
|
ConnectWalletButton,
|
|
25073
25104
|
ErrorCodes,
|
|
25074
25105
|
Hash,
|
|
25106
|
+
KEYSHARE_RECOVERY_STATS_QUERY_KEY,
|
|
25075
25107
|
KeyshareBackup,
|
|
25076
25108
|
LOCAL_STORAGE_I18N_KEY,
|
|
25077
25109
|
LangToggle,
|
|
@@ -25080,6 +25112,7 @@ init_index();
|
|
|
25080
25112
|
Provider,
|
|
25081
25113
|
ThemeToggle,
|
|
25082
25114
|
TransactionsList,
|
|
25115
|
+
USER_PROFILE_QUERY_KEY,
|
|
25083
25116
|
UserOpStatus,
|
|
25084
25117
|
UserOperationTimeoutError,
|
|
25085
25118
|
UserRejectedError,
|
package/dist/index.d.cts
CHANGED
|
@@ -2963,4 +2963,8 @@ declare function combineI18NResources(...resourses: TranslationResources[]): Tra
|
|
|
2963
2963
|
declare function getAvailableLanguages(resourses: TranslationResources): string[];
|
|
2964
2964
|
declare function getLanguageIcon(languageKey: string): string | null;
|
|
2965
2965
|
|
|
2966
|
-
|
|
2966
|
+
declare const KEYSHARE_RECOVERY_STATS_QUERY = "keyshare-recovery-stats-query";
|
|
2967
|
+
|
|
2968
|
+
declare const USER_PROFILE_QUERY_KEY: string;
|
|
2969
|
+
|
|
2970
|
+
export { AccountAbstractionError, type AccountSession, Address, type AddressProps, type Asset, type CallbacksConfig, ConnectWalletButton, type ConnectWalletButtonProps, type DirectTransactionParams, ErrorCodes, type FingerprintVerificationResult, Hash, type HashProps, KEYSHARE_RECOVERY_STATS_QUERY as KEYSHARE_RECOVERY_STATS_QUERY_KEY, 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, useDirectWallet, useErc3643Compliance, useError, useHasServerVault, useHydrated, useIFrameReady, useIsMobileView, useLinkedProfiles, useLoadingStatus, useLogout, 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
|
@@ -2963,4 +2963,8 @@ declare function combineI18NResources(...resourses: TranslationResources[]): Tra
|
|
|
2963
2963
|
declare function getAvailableLanguages(resourses: TranslationResources): string[];
|
|
2964
2964
|
declare function getLanguageIcon(languageKey: string): string | null;
|
|
2965
2965
|
|
|
2966
|
-
|
|
2966
|
+
declare const KEYSHARE_RECOVERY_STATS_QUERY = "keyshare-recovery-stats-query";
|
|
2967
|
+
|
|
2968
|
+
declare const USER_PROFILE_QUERY_KEY: string;
|
|
2969
|
+
|
|
2970
|
+
export { AccountAbstractionError, type AccountSession, Address, type AddressProps, type Asset, type CallbacksConfig, ConnectWalletButton, type ConnectWalletButtonProps, type DirectTransactionParams, ErrorCodes, type FingerprintVerificationResult, Hash, type HashProps, KEYSHARE_RECOVERY_STATS_QUERY as KEYSHARE_RECOVERY_STATS_QUERY_KEY, 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, useDirectWallet, useErc3643Compliance, useError, useHasServerVault, useHydrated, useIFrameReady, useIsMobileView, useLinkedProfiles, useLoadingStatus, useLogout, useNicknameResolve, useOpenPage, useProviderConfig, useRecoveryUserId, useSendDirectTransaction, useSendTransaction, useSession, useSmartAccountTransactions, useTokenBalance, useTokenInfo, useTransactions, useTransferToLinkedWallet, useUserOpStatus, useWalletMode, verifyFingerprint, verifyFingerprintDetailed, wagmiConfig, waitForStoreHydration, waitForUserOperationReceipt };
|
package/dist/index.js
CHANGED
|
@@ -13890,6 +13890,12 @@ var init_EmailNotConnectedWarning = __esm({
|
|
|
13890
13890
|
// src/internal/components/ManageWalletMenu/hooks/useLinkSocial.ts
|
|
13891
13891
|
import { useQueryClient as useQueryClient16 } from "@tanstack/react-query";
|
|
13892
13892
|
import React6, { useEffect as useEffect31 } from "react";
|
|
13893
|
+
function normalizeSocialLinkError(message) {
|
|
13894
|
+
if (message === "X_ALREADY_LINKED") {
|
|
13895
|
+
return "This X account is already linked to another account";
|
|
13896
|
+
}
|
|
13897
|
+
return message;
|
|
13898
|
+
}
|
|
13893
13899
|
function useLinkSocial() {
|
|
13894
13900
|
const qc = useQueryClient16();
|
|
13895
13901
|
const address = useSession((st) => st.address);
|
|
@@ -13949,7 +13955,7 @@ function useLinkSocial() {
|
|
|
13949
13955
|
setPage("manage-wallet" /* MANAGE_WALLET */);
|
|
13950
13956
|
} catch (e) {
|
|
13951
13957
|
console.error(`[ManageWallet] Failed to link ${providerIdRaw}:`, e);
|
|
13952
|
-
const message = e?.message || `Failed to link ${providerIdRaw}
|
|
13958
|
+
const message = normalizeSocialLinkError(e?.message || `Failed to link ${providerIdRaw}`);
|
|
13953
13959
|
setAlert({ title: "Error", message });
|
|
13954
13960
|
setProviderType(null);
|
|
13955
13961
|
} finally {
|
|
@@ -14140,11 +14146,23 @@ var init_useLinkTelegram = __esm({
|
|
|
14140
14146
|
// src/internal/components/ManageWalletMenu/ProviderCard.tsx
|
|
14141
14147
|
import { CheckCircle as CheckCircle3, Clock, Trash2 as Trash23 } from "lucide-react";
|
|
14142
14148
|
import { jsx as jsx73, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
14143
|
-
function
|
|
14144
|
-
|
|
14145
|
-
|
|
14149
|
+
function getProviderCaption(provider) {
|
|
14150
|
+
const providerName = provider.provider;
|
|
14151
|
+
switch (providerName) {
|
|
14152
|
+
case "email":
|
|
14153
|
+
return provider.externalId;
|
|
14154
|
+
case "wallet":
|
|
14155
|
+
if (provider.externalId && provider.externalId.startsWith("0x") && provider.externalId.length >= 14) {
|
|
14156
|
+
return `${provider.externalId.slice(0, 10)}...${provider.externalId.slice(-4)}`;
|
|
14157
|
+
}
|
|
14158
|
+
return provider.externalId || providerName;
|
|
14159
|
+
// @ts-expect-error x === twitter
|
|
14160
|
+
case "x":
|
|
14161
|
+
case "telegram":
|
|
14162
|
+
return (provider?.meta?.username ? `@${provider.meta.username}` : provider.externalId).toLowerCase();
|
|
14163
|
+
default:
|
|
14164
|
+
return provider.externalId || providerName;
|
|
14146
14165
|
}
|
|
14147
|
-
return externalId;
|
|
14148
14166
|
}
|
|
14149
14167
|
function ProviderCard(props) {
|
|
14150
14168
|
const { t } = useT();
|
|
@@ -14173,7 +14191,7 @@ function ProviderCard(props) {
|
|
|
14173
14191
|
style: { maxWidth: 184 },
|
|
14174
14192
|
className: "block w-full font-bold text-xs whitespace-nowrap text-ellipsis overflow-hidden",
|
|
14175
14193
|
title: props.externalId,
|
|
14176
|
-
children:
|
|
14194
|
+
children: getProviderCaption(props)
|
|
14177
14195
|
}
|
|
14178
14196
|
)
|
|
14179
14197
|
] }),
|
|
@@ -19068,7 +19086,7 @@ var init_package = __esm({
|
|
|
19068
19086
|
"package.json"() {
|
|
19069
19087
|
package_default = {
|
|
19070
19088
|
name: "@embarkai/ui-kit",
|
|
19071
|
-
version: "0.4.
|
|
19089
|
+
version: "0.4.5",
|
|
19072
19090
|
description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
|
|
19073
19091
|
type: "module",
|
|
19074
19092
|
main: "./dist/index.cjs",
|
|
@@ -24857,6 +24875,16 @@ var init_smartAccountTransactions = __esm({
|
|
|
24857
24875
|
}
|
|
24858
24876
|
});
|
|
24859
24877
|
|
|
24878
|
+
// src/internal/exportedQueryKeys.ts
|
|
24879
|
+
var USER_PROFILE_QUERY_KEY;
|
|
24880
|
+
var init_exportedQueryKeys = __esm({
|
|
24881
|
+
"src/internal/exportedQueryKeys.ts"() {
|
|
24882
|
+
init_profile();
|
|
24883
|
+
init_constants6();
|
|
24884
|
+
USER_PROFILE_QUERY_KEY = QUERY_KEYS.userProfile;
|
|
24885
|
+
}
|
|
24886
|
+
});
|
|
24887
|
+
|
|
24860
24888
|
// src/index.ts
|
|
24861
24889
|
function autorun() {
|
|
24862
24890
|
try {
|
|
@@ -24913,6 +24941,7 @@ var init_index = __esm({
|
|
|
24913
24941
|
init_smartAccountTransactions();
|
|
24914
24942
|
init_iframe_manager();
|
|
24915
24943
|
init_i18n();
|
|
24944
|
+
init_exportedQueryKeys();
|
|
24916
24945
|
STYLES_TAG_ID = "account-abstraction-provider-autostyles";
|
|
24917
24946
|
autorun();
|
|
24918
24947
|
}
|
|
@@ -24924,6 +24953,7 @@ export {
|
|
|
24924
24953
|
ConnectWalletButton,
|
|
24925
24954
|
ErrorCodes,
|
|
24926
24955
|
Hash,
|
|
24956
|
+
KEYSHARE_RECOVERY_STATS_QUERY as KEYSHARE_RECOVERY_STATS_QUERY_KEY,
|
|
24927
24957
|
KeyshareBackupMenu as KeyshareBackup,
|
|
24928
24958
|
LOCAL_STORAGE_I18N_KEY,
|
|
24929
24959
|
LangToggle,
|
|
@@ -24932,6 +24962,7 @@ export {
|
|
|
24932
24962
|
Provider,
|
|
24933
24963
|
ThemeToggle,
|
|
24934
24964
|
TransactionsList,
|
|
24965
|
+
USER_PROFILE_QUERY_KEY,
|
|
24935
24966
|
UserOpStatus,
|
|
24936
24967
|
UserOperationTimeoutError,
|
|
24937
24968
|
UserRejectedError,
|