@embarkai/ui-kit 0.4.91 → 0.4.92
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 +63 -63
- package/dist/index.js +3 -3
- package/package.json +2 -2
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.92</title>
|
|
19
19
|
|
|
20
20
|
<!-- Styles will be injected by build process -->
|
|
21
21
|
<style>
|
package/dist/iframe/main.js
CHANGED
|
@@ -6414,7 +6414,7 @@ var SigningManager = class extends TokenRefreshApiClient {
|
|
|
6414
6414
|
};
|
|
6415
6415
|
|
|
6416
6416
|
// src/iframe/main.ts
|
|
6417
|
-
var IFRAME_VERSION = "0.4.
|
|
6417
|
+
var IFRAME_VERSION = "0.4.92";
|
|
6418
6418
|
var IframeWallet = class {
|
|
6419
6419
|
constructor() {
|
|
6420
6420
|
__publicField(this, "messenger");
|
package/dist/index.cjs
CHANGED
|
@@ -28952,7 +28952,7 @@ var init_package = __esm({
|
|
|
28952
28952
|
"package.json"() {
|
|
28953
28953
|
package_default = {
|
|
28954
28954
|
name: "@embarkai/ui-kit",
|
|
28955
|
-
version: "0.4.
|
|
28955
|
+
version: "0.4.92",
|
|
28956
28956
|
description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
|
|
28957
28957
|
type: "module",
|
|
28958
28958
|
main: "./dist/index.cjs",
|
|
@@ -29007,9 +29007,9 @@ var init_package = __esm({
|
|
|
29007
29007
|
clsx: "^2.1.1",
|
|
29008
29008
|
dayjs: "^1.11.21",
|
|
29009
29009
|
"dkls23-wasm": "^0.1.1",
|
|
29010
|
-
"framer-motion": "^12.40.0",
|
|
29011
29010
|
"lodash-es": "^4.18.1",
|
|
29012
29011
|
"lucide-react": "^1.28.0",
|
|
29012
|
+
motion: "^13.1.1",
|
|
29013
29013
|
qrcode: "^1.5.4",
|
|
29014
29014
|
viem: "^2.52.2",
|
|
29015
29015
|
wagmi: "^3.7.5",
|
|
@@ -29619,7 +29619,7 @@ function Dialog2() {
|
|
|
29619
29619
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
29620
29620
|
const setPostAuthNavigation = useLayoutDataStore((st) => st.setPostAuthNavigation);
|
|
29621
29621
|
const { colorMode, isDialogOpen, dialogTitle, dialogDescription, dialogContent, isDialogForced, setIsSettings } = useLayoutStore();
|
|
29622
|
-
(0,
|
|
29622
|
+
(0, import_react98.useEffect)(() => setIsSettings(!!session), [session, setIsSettings]);
|
|
29623
29623
|
usePageMapper();
|
|
29624
29624
|
useAutoConnect();
|
|
29625
29625
|
useBackupStatusChanges();
|
|
@@ -29648,8 +29648,8 @@ function Dialog2() {
|
|
|
29648
29648
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(DialogTitle, { children: dialogTitle }) }),
|
|
29649
29649
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(DialogDescription, { className: "sr-only", children: dialogDescription }),
|
|
29650
29650
|
!isHeaderHidden && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(Header, {}),
|
|
29651
|
-
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
29652
|
-
|
|
29651
|
+
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_react97.AnimatePresence, { mode: "wait", initial: false, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
29652
|
+
import_react97.motion.div,
|
|
29653
29653
|
{
|
|
29654
29654
|
initial: { opacity: 0, height: transitionPageHeight },
|
|
29655
29655
|
animate: { opacity: 1, height: "auto" },
|
|
@@ -29667,13 +29667,13 @@ function Dialog2() {
|
|
|
29667
29667
|
}
|
|
29668
29668
|
);
|
|
29669
29669
|
}
|
|
29670
|
-
var
|
|
29670
|
+
var import_react97, import_react98, import_jsx_runtime130, EMBARKAI_DIALOG_ONBOARDING_ID;
|
|
29671
29671
|
var init_Dialog = __esm({
|
|
29672
29672
|
"src/internal/components/Dialog/Dialog.tsx"() {
|
|
29673
29673
|
init_ProviderContext();
|
|
29674
29674
|
init_SessionContext();
|
|
29675
|
-
|
|
29676
|
-
|
|
29675
|
+
import_react97 = require("motion/react");
|
|
29676
|
+
import_react98 = require("react");
|
|
29677
29677
|
init_constants();
|
|
29678
29678
|
init_useAutoConnect();
|
|
29679
29679
|
init_useBackupStatusChanges();
|
|
@@ -29706,12 +29706,12 @@ function DirectWalletHandler() {
|
|
|
29706
29706
|
const externalAddress = useExternalWalletStore((st) => st.externalAddress);
|
|
29707
29707
|
const isExternalConnected = useExternalWalletStore((st) => st.isExternalConnected);
|
|
29708
29708
|
const { address, isConnected, chain, connector } = (0, import_wagmi9.useConnection)();
|
|
29709
|
-
(0,
|
|
29709
|
+
(0, import_react99.useEffect)(() => {
|
|
29710
29710
|
const { setConfigMode, setActiveMode } = useExternalWalletStore.getState();
|
|
29711
29711
|
setConfigMode(walletMode);
|
|
29712
29712
|
if (walletMode !== "both") setActiveMode(walletMode);
|
|
29713
29713
|
}, [walletMode]);
|
|
29714
|
-
(0,
|
|
29714
|
+
(0, import_react99.useEffect)(() => {
|
|
29715
29715
|
if ((!!externalAddress || isExternalConnected) && !isConnected) {
|
|
29716
29716
|
useExternalWalletStore.getState().clearExternalWallet();
|
|
29717
29717
|
return;
|
|
@@ -29726,10 +29726,10 @@ function DirectWalletHandler() {
|
|
|
29726
29726
|
}, [isConnected, address, isExternalConnected, externalAddress, connector, chain]);
|
|
29727
29727
|
return null;
|
|
29728
29728
|
}
|
|
29729
|
-
var
|
|
29729
|
+
var import_react99, import_wagmi9;
|
|
29730
29730
|
var init_DirectWalletHandler = __esm({
|
|
29731
29731
|
"src/internal/components/DirectWalletHandler.tsx"() {
|
|
29732
|
-
|
|
29732
|
+
import_react99 = require("react");
|
|
29733
29733
|
import_wagmi9 = require("wagmi");
|
|
29734
29734
|
init_ProviderContext();
|
|
29735
29735
|
init_useExternalWalletStore();
|
|
@@ -29737,14 +29737,14 @@ var init_DirectWalletHandler = __esm({
|
|
|
29737
29737
|
});
|
|
29738
29738
|
|
|
29739
29739
|
// src/internal/components/TssManager.tsx
|
|
29740
|
-
var
|
|
29740
|
+
var import_react100, TssManagerWithRef;
|
|
29741
29741
|
var init_TssManager = __esm({
|
|
29742
29742
|
"src/internal/components/TssManager.tsx"() {
|
|
29743
29743
|
init_SessionContext();
|
|
29744
|
-
|
|
29744
|
+
import_react100 = __toESM(require("react"), 1);
|
|
29745
29745
|
init_auth();
|
|
29746
29746
|
init_clients();
|
|
29747
|
-
TssManagerWithRef =
|
|
29747
|
+
TssManagerWithRef = import_react100.default.forwardRef((props, ref) => {
|
|
29748
29748
|
const { mpcPin } = props;
|
|
29749
29749
|
const usePaymaster = useSession((st) => st.usePaymaster);
|
|
29750
29750
|
const publicClient = useSession((st) => st.publicClient);
|
|
@@ -29752,14 +29752,14 @@ var init_TssManager = __esm({
|
|
|
29752
29752
|
const setStatus = useSession((st) => st.setStatus);
|
|
29753
29753
|
const setSession = useSession((st) => st.setSession);
|
|
29754
29754
|
const setAddress = useSession((st) => st.setAddress);
|
|
29755
|
-
const onSessionCreated = (0,
|
|
29755
|
+
const onSessionCreated = (0, import_react100.useCallback)(
|
|
29756
29756
|
(session, address) => {
|
|
29757
29757
|
setSession(session);
|
|
29758
29758
|
setAddress(address);
|
|
29759
29759
|
},
|
|
29760
29760
|
[setSession, setAddress]
|
|
29761
29761
|
);
|
|
29762
|
-
const createSessionWithKeyshare =
|
|
29762
|
+
const createSessionWithKeyshare = import_react100.default.useCallback(
|
|
29763
29763
|
async (userId, hasServerKeyshare, isNewUser) => {
|
|
29764
29764
|
setStatus("checking key management setup...");
|
|
29765
29765
|
await ensureKeyshare(userId, hasServerKeyshare, setStatus, isNewUser);
|
|
@@ -29784,7 +29784,7 @@ var init_TssManager = __esm({
|
|
|
29784
29784
|
},
|
|
29785
29785
|
[setStatus, usePaymaster, activeChainId, publicClient, mpcPin]
|
|
29786
29786
|
);
|
|
29787
|
-
|
|
29787
|
+
import_react100.default.useImperativeHandle(ref, () => ({ createSessionWithKeyshare }), [createSessionWithKeyshare]);
|
|
29788
29788
|
return null;
|
|
29789
29789
|
});
|
|
29790
29790
|
}
|
|
@@ -29808,7 +29808,7 @@ function waitForStoreHydration() {
|
|
|
29808
29808
|
}
|
|
29809
29809
|
function SessionProvider({ children }) {
|
|
29810
29810
|
const config = useProviderConfig().config;
|
|
29811
|
-
return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
|
|
29811
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_react101.Fragment, {
|
|
29812
29812
|
/** dApp's router might have its own error boundaries setup via imported @embarkai/ui-kitErrorBoundary */
|
|
29813
29813
|
children: [
|
|
29814
29814
|
children,
|
|
@@ -29828,11 +29828,11 @@ function SessionProvider({ children }) {
|
|
|
29828
29828
|
]
|
|
29829
29829
|
});
|
|
29830
29830
|
}
|
|
29831
|
-
var import_read22,
|
|
29831
|
+
var import_read22, import_react101, import_zustand17, import_middleware4, import_jsx_runtime131, useSession, requireActiveChainId;
|
|
29832
29832
|
var init_SessionContext = __esm({
|
|
29833
29833
|
"src/context/SessionContext.tsx"() {
|
|
29834
29834
|
import_read22 = require("@embarkai/core/read");
|
|
29835
|
-
|
|
29835
|
+
import_react101 = require("react");
|
|
29836
29836
|
import_zustand17 = require("zustand");
|
|
29837
29837
|
import_middleware4 = require("zustand/middleware");
|
|
29838
29838
|
init_ErrorBoundary2();
|
|
@@ -32300,10 +32300,10 @@ function clearLegacyWagmiStorage() {
|
|
|
32300
32300
|
}
|
|
32301
32301
|
function Provider(props) {
|
|
32302
32302
|
const { children, projectId, initialConfig = {}, callbacks } = props;
|
|
32303
|
-
const callbacksRef = (0,
|
|
32304
|
-
(0,
|
|
32305
|
-
const config = (0,
|
|
32306
|
-
const updateConfig = (0,
|
|
32303
|
+
const callbacksRef = (0, import_react102.useRef)(callbacks);
|
|
32304
|
+
(0, import_react102.useEffect)(() => notifyNoProjetctId(projectId), [projectId]);
|
|
32305
|
+
const config = (0, import_react102.useRef)((0, import_lodash_es13.merge)({}, DEFAULT_PROVIDER_CONFIG, { projectId }, initialConfig));
|
|
32306
|
+
const updateConfig = (0, import_react102.useCallback)((updates) => {
|
|
32307
32307
|
const prev = config.current;
|
|
32308
32308
|
const next = { ...prev };
|
|
32309
32309
|
if (updates.projectId !== void 0) next.projectId = updates.projectId;
|
|
@@ -32337,12 +32337,12 @@ function Provider(props) {
|
|
|
32337
32337
|
if (updates.translations) next.translations = { ...next.translations, ...updates.translations };
|
|
32338
32338
|
config.current = next;
|
|
32339
32339
|
}, []);
|
|
32340
|
-
const updateCallbacks = (0,
|
|
32340
|
+
const updateCallbacks = (0, import_react102.useCallback)((updates) => {
|
|
32341
32341
|
const prev = callbacksRef.current;
|
|
32342
32342
|
const next = updates ? { ...prev, ...updates } : void 0;
|
|
32343
32343
|
callbacksRef.current = next;
|
|
32344
32344
|
}, []);
|
|
32345
|
-
(0,
|
|
32345
|
+
(0, import_react102.useEffect)(() => {
|
|
32346
32346
|
if (typeof window === "undefined" || !projectId) return;
|
|
32347
32347
|
const mergedConfig = (0, import_lodash_es13.merge)(DEFAULT_PROVIDER_CONFIG, initialConfig);
|
|
32348
32348
|
updateConfig(mergedConfig);
|
|
@@ -32362,7 +32362,7 @@ function Provider(props) {
|
|
|
32362
32362
|
useSession.getState().setActiveChainId(mergedConfig.network.chainId);
|
|
32363
32363
|
}
|
|
32364
32364
|
}, [projectId, initialConfig]);
|
|
32365
|
-
(0,
|
|
32365
|
+
(0, import_react102.useEffect)(() => {
|
|
32366
32366
|
if (typeof window === "undefined" || !projectId) return;
|
|
32367
32367
|
try {
|
|
32368
32368
|
(0, import_error_tracking4.initSdkErrorTracking)();
|
|
@@ -32391,7 +32391,7 @@ function Provider(props) {
|
|
|
32391
32391
|
console.error("[PROVIDER] Error setting up iframe manager:", error);
|
|
32392
32392
|
}
|
|
32393
32393
|
}, [projectId]);
|
|
32394
|
-
const contextValue = (0,
|
|
32394
|
+
const contextValue = (0, import_react102.useMemo)(
|
|
32395
32395
|
() => ({
|
|
32396
32396
|
config,
|
|
32397
32397
|
updateConfig,
|
|
@@ -32407,22 +32407,22 @@ function Provider(props) {
|
|
|
32407
32407
|
/* @__PURE__ */ (0, import_jsx_runtime132.jsx)(UIContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_wagmi10.WagmiProvider, { config: import_core9.wagmiConfig, children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(SessionProvider, { children }) }) })
|
|
32408
32408
|
);
|
|
32409
32409
|
}
|
|
32410
|
-
var import_core9, import_error_tracking4, import_lodash_es13,
|
|
32410
|
+
var import_core9, import_error_tracking4, import_lodash_es13, import_react102, import_wagmi10, import_jsx_runtime132, UIContext, useProviderConfig;
|
|
32411
32411
|
var init_ProviderContext = __esm({
|
|
32412
32412
|
"src/context/ProviderContext.tsx"() {
|
|
32413
32413
|
import_core9 = require("@embarkai/core");
|
|
32414
32414
|
import_error_tracking4 = require("@embarkai/core/internal/error-tracking");
|
|
32415
32415
|
import_lodash_es13 = require("lodash-es");
|
|
32416
|
-
|
|
32416
|
+
import_react102 = require("react");
|
|
32417
32417
|
import_wagmi10 = require("wagmi");
|
|
32418
32418
|
init_initial();
|
|
32419
32419
|
init_iframe_manager();
|
|
32420
32420
|
init_SessionContext();
|
|
32421
32421
|
init_utils12();
|
|
32422
32422
|
import_jsx_runtime132 = require("react/jsx-runtime");
|
|
32423
|
-
UIContext = (0,
|
|
32423
|
+
UIContext = (0, import_react102.createContext)(void 0);
|
|
32424
32424
|
useProviderConfig = () => {
|
|
32425
|
-
const ctx = (0,
|
|
32425
|
+
const ctx = (0, import_react102.useContext)(UIContext);
|
|
32426
32426
|
if (!ctx) throw new Error("useProviderConfig must be used within a Provider");
|
|
32427
32427
|
return ctx;
|
|
32428
32428
|
};
|
|
@@ -32542,7 +32542,7 @@ init_ErrorBoundary2();
|
|
|
32542
32542
|
init_lumia2();
|
|
32543
32543
|
init_embarkAI2();
|
|
32544
32544
|
var import_lucide_react82 = require("lucide-react");
|
|
32545
|
-
var
|
|
32545
|
+
var import_react103 = require("react");
|
|
32546
32546
|
init_SessionContext();
|
|
32547
32547
|
init_auth();
|
|
32548
32548
|
init_BalanceView2();
|
|
@@ -32575,10 +32575,10 @@ function ConnectWalletButton(props) {
|
|
|
32575
32575
|
const colorMode = useLayoutStore((st) => st.colorMode);
|
|
32576
32576
|
const { session, address, hasServerVault, isLoading, isIframeReady, status, setUsePaymaster } = useSession();
|
|
32577
32577
|
const connectButtonLabel = getFormattedStatus(label || "Connect", status, isIframeReady);
|
|
32578
|
-
(0,
|
|
32578
|
+
(0, import_react103.useEffect)(() => setUsePaymaster(usePaymaster), [setUsePaymaster, usePaymaster]);
|
|
32579
32579
|
const { data: profile, isLoading: isProfileLoading } = useUserProfile();
|
|
32580
32580
|
const displayName = profile?.nicknameDisplay || profile?.displayName || import_auth23.jwtTokenManager.getDisplayName();
|
|
32581
|
-
const indicators = (0,
|
|
32581
|
+
const indicators = (0, import_react103.useMemo)(() => {
|
|
32582
32582
|
const userId = session?.mpcUserId;
|
|
32583
32583
|
if (!userId) return { server: false, local: false, backup: false };
|
|
32584
32584
|
const server = import_auth23.jwtTokenManager.getHasKeyshare() ?? false;
|
|
@@ -33217,14 +33217,14 @@ var Hash = ({
|
|
|
33217
33217
|
};
|
|
33218
33218
|
|
|
33219
33219
|
// src/internal/components/TransactionsMenu/TransactionsList.tsx
|
|
33220
|
-
var
|
|
33220
|
+
var import_react104 = require("react");
|
|
33221
33221
|
init_base3();
|
|
33222
33222
|
var import_jsx_runtime139 = require("react/jsx-runtime");
|
|
33223
33223
|
var TransactionsList = ({ address, itemsCount = 10 }) => {
|
|
33224
|
-
const [transactions, setTransactions] = (0,
|
|
33225
|
-
const [loading, setLoading] = (0,
|
|
33226
|
-
const [error, setError] = (0,
|
|
33227
|
-
(0,
|
|
33224
|
+
const [transactions, setTransactions] = (0, import_react104.useState)([]);
|
|
33225
|
+
const [loading, setLoading] = (0, import_react104.useState)(true);
|
|
33226
|
+
const [error, setError] = (0, import_react104.useState)(null);
|
|
33227
|
+
(0, import_react104.useEffect)(() => {
|
|
33228
33228
|
const fetchTransactions2 = async () => {
|
|
33229
33229
|
try {
|
|
33230
33230
|
setLoading(true);
|
|
@@ -33515,13 +33515,13 @@ function useUserOpStatus(options = {}) {
|
|
|
33515
33515
|
init_useErc3643Compliance();
|
|
33516
33516
|
|
|
33517
33517
|
// src/hooks/useWalletMode.ts
|
|
33518
|
-
var
|
|
33518
|
+
var import_react105 = require("react");
|
|
33519
33519
|
init_useExternalWalletStore();
|
|
33520
33520
|
function useWalletMode() {
|
|
33521
33521
|
const configMode = useExternalWalletStore((st) => st.configMode);
|
|
33522
33522
|
const activeMode = useExternalWalletStore((st) => st.activeMode);
|
|
33523
33523
|
const setActiveMode = useExternalWalletStore((st) => st.setActiveMode);
|
|
33524
|
-
const switchMode = (0,
|
|
33524
|
+
const switchMode = (0, import_react105.useCallback)(
|
|
33525
33525
|
(mode) => {
|
|
33526
33526
|
if (configMode !== "both") return;
|
|
33527
33527
|
setActiveMode(mode);
|
|
@@ -33538,7 +33538,7 @@ function useWalletMode() {
|
|
|
33538
33538
|
|
|
33539
33539
|
// src/hooks/useDirectWallet.ts
|
|
33540
33540
|
init_useOpenPage();
|
|
33541
|
-
var
|
|
33541
|
+
var import_react106 = require("react");
|
|
33542
33542
|
var import_wagmi11 = require("wagmi");
|
|
33543
33543
|
init_useExternalWalletStore();
|
|
33544
33544
|
function useDirectWallet() {
|
|
@@ -33548,10 +33548,10 @@ function useDirectWallet() {
|
|
|
33548
33548
|
const connectorName = useExternalWalletStore((st) => st.connectorName);
|
|
33549
33549
|
const { open: openEmbarkAI } = useOpenPage();
|
|
33550
33550
|
const { mutate: wagmiDisconnect } = (0, import_wagmi11.useDisconnect)();
|
|
33551
|
-
const connect = (0,
|
|
33551
|
+
const connect = (0, import_react106.useCallback)((connectFlowType = "connect") => {
|
|
33552
33552
|
openEmbarkAI("connect-external-wallet" /* CONNECT_EXTERNAL_WALLET */, { connectFlowType });
|
|
33553
33553
|
}, []);
|
|
33554
|
-
const disconnect = (0,
|
|
33554
|
+
const disconnect = (0, import_react106.useCallback)(() => {
|
|
33555
33555
|
wagmiDisconnect();
|
|
33556
33556
|
useExternalWalletStore.getState().clearExternalWallet();
|
|
33557
33557
|
}, [wagmiDisconnect]);
|
|
@@ -33567,7 +33567,7 @@ function useDirectWallet() {
|
|
|
33567
33567
|
}
|
|
33568
33568
|
|
|
33569
33569
|
// src/hooks/useSendDirectTransaction.ts
|
|
33570
|
-
var
|
|
33570
|
+
var import_react107 = require("react");
|
|
33571
33571
|
var import_viem22 = require("viem");
|
|
33572
33572
|
var import_wagmi12 = require("wagmi");
|
|
33573
33573
|
init_useExternalWalletStore();
|
|
@@ -33576,10 +33576,10 @@ function useSendDirectTransaction() {
|
|
|
33576
33576
|
const externalChainId = useExternalWalletStore((st) => st.externalChainId);
|
|
33577
33577
|
const { sendTransactionAsync } = (0, import_wagmi12.useSendTransaction)();
|
|
33578
33578
|
const { switchChainAsync } = (0, import_wagmi12.useSwitchChain)();
|
|
33579
|
-
const [isPending, setIsPending] = (0,
|
|
33580
|
-
const [error, setError] = (0,
|
|
33581
|
-
const [txHash, setTxHash] = (0,
|
|
33582
|
-
const sendTransaction = (0,
|
|
33579
|
+
const [isPending, setIsPending] = (0, import_react107.useState)(false);
|
|
33580
|
+
const [error, setError] = (0, import_react107.useState)(null);
|
|
33581
|
+
const [txHash, setTxHash] = (0, import_react107.useState)(null);
|
|
33582
|
+
const sendTransaction = (0, import_react107.useCallback)(
|
|
33583
33583
|
async (params) => {
|
|
33584
33584
|
if (!isConnected) {
|
|
33585
33585
|
setError("No external wallet connected");
|
|
@@ -33613,7 +33613,7 @@ function useSendDirectTransaction() {
|
|
|
33613
33613
|
},
|
|
33614
33614
|
[isConnected, externalChainId, sendTransactionAsync, switchChainAsync]
|
|
33615
33615
|
);
|
|
33616
|
-
const reset = (0,
|
|
33616
|
+
const reset = (0, import_react107.useCallback)(() => {
|
|
33617
33617
|
setError(null);
|
|
33618
33618
|
setTxHash(null);
|
|
33619
33619
|
setIsPending(false);
|
|
@@ -33622,7 +33622,7 @@ function useSendDirectTransaction() {
|
|
|
33622
33622
|
}
|
|
33623
33623
|
|
|
33624
33624
|
// src/hooks/useTransferToLinkedWallet.ts
|
|
33625
|
-
var
|
|
33625
|
+
var import_react108 = require("react");
|
|
33626
33626
|
var import_viem23 = require("viem");
|
|
33627
33627
|
init_SessionContext();
|
|
33628
33628
|
init_account2();
|
|
@@ -33641,14 +33641,14 @@ var ERC20_TRANSFER_ABI2 = [
|
|
|
33641
33641
|
function useTransferToLinkedWallet() {
|
|
33642
33642
|
const session = useSession((st) => st.session);
|
|
33643
33643
|
const { profiles } = useLinkedProfiles();
|
|
33644
|
-
const [isPending, setIsPending] = (0,
|
|
33645
|
-
const [error, setError] = (0,
|
|
33646
|
-
const [userOpHash, setUserOpHash] = (0,
|
|
33647
|
-
const linkedWallets = (0,
|
|
33644
|
+
const [isPending, setIsPending] = (0, import_react108.useState)(false);
|
|
33645
|
+
const [error, setError] = (0, import_react108.useState)(null);
|
|
33646
|
+
const [userOpHash, setUserOpHash] = (0, import_react108.useState)(null);
|
|
33647
|
+
const linkedWallets = (0, import_react108.useMemo)(
|
|
33648
33648
|
() => (profiles || []).filter((p) => p.provider === "wallet" && p.externalId).map((p) => p.externalId),
|
|
33649
33649
|
[profiles]
|
|
33650
33650
|
);
|
|
33651
|
-
const transfer = (0,
|
|
33651
|
+
const transfer = (0, import_react108.useCallback)(
|
|
33652
33652
|
async (params) => {
|
|
33653
33653
|
if (!session) {
|
|
33654
33654
|
setError("No active session");
|
|
@@ -33699,7 +33699,7 @@ function useTransferToLinkedWallet() {
|
|
|
33699
33699
|
},
|
|
33700
33700
|
[session, linkedWallets]
|
|
33701
33701
|
);
|
|
33702
|
-
const reset = (0,
|
|
33702
|
+
const reset = (0, import_react108.useCallback)(() => {
|
|
33703
33703
|
setError(null);
|
|
33704
33704
|
setUserOpHash(null);
|
|
33705
33705
|
setIsPending(false);
|
|
@@ -33723,7 +33723,7 @@ function useNativeWalletSignature() {
|
|
|
33723
33723
|
|
|
33724
33724
|
// src/hooks/useLogout.ts
|
|
33725
33725
|
var import_auth25 = require("@embarkai/core/auth");
|
|
33726
|
-
var
|
|
33726
|
+
var import_react109 = require("react");
|
|
33727
33727
|
var import_wagmi14 = require("wagmi");
|
|
33728
33728
|
init_ProviderContext();
|
|
33729
33729
|
init_SessionContext();
|
|
@@ -33742,7 +33742,7 @@ function useLogout() {
|
|
|
33742
33742
|
}
|
|
33743
33743
|
}
|
|
33744
33744
|
});
|
|
33745
|
-
const logout2 = (0,
|
|
33745
|
+
const logout2 = (0, import_react109.useCallback)(async () => {
|
|
33746
33746
|
const { setSession, setIsLoading, setAddress, setStatus, setError } = useSession.getState();
|
|
33747
33747
|
const prevAddress = address;
|
|
33748
33748
|
let userId = null;
|
|
@@ -33861,7 +33861,7 @@ function useTransactions() {
|
|
|
33861
33861
|
|
|
33862
33862
|
// src/modules/assets.ts
|
|
33863
33863
|
init_SessionContext();
|
|
33864
|
-
var
|
|
33864
|
+
var import_react110 = __toESM(require("react"), 1);
|
|
33865
33865
|
var import_viem25 = require("viem");
|
|
33866
33866
|
var import_wagmi16 = require("wagmi");
|
|
33867
33867
|
var COMMON_TOKENS = [
|
|
@@ -34016,7 +34016,7 @@ function useTokenBalance2(tokenAddress, userAddress) {
|
|
|
34016
34016
|
}
|
|
34017
34017
|
});
|
|
34018
34018
|
const { tokenInfo } = useTokenInfo(tokenAddress);
|
|
34019
|
-
const formattedBalance =
|
|
34019
|
+
const formattedBalance = import_react110.default.useMemo(() => {
|
|
34020
34020
|
if (!balance || !tokenInfo) return "0";
|
|
34021
34021
|
return (0, import_viem25.formatUnits)(balance, tokenInfo.decimals);
|
|
34022
34022
|
}, [balance, tokenInfo]);
|
package/dist/index.js
CHANGED
|
@@ -28848,7 +28848,7 @@ var init_package = __esm({
|
|
|
28848
28848
|
"package.json"() {
|
|
28849
28849
|
package_default = {
|
|
28850
28850
|
name: "@embarkai/ui-kit",
|
|
28851
|
-
version: "0.4.
|
|
28851
|
+
version: "0.4.92",
|
|
28852
28852
|
description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
|
|
28853
28853
|
type: "module",
|
|
28854
28854
|
main: "./dist/index.cjs",
|
|
@@ -28903,9 +28903,9 @@ var init_package = __esm({
|
|
|
28903
28903
|
clsx: "^2.1.1",
|
|
28904
28904
|
dayjs: "^1.11.21",
|
|
28905
28905
|
"dkls23-wasm": "^0.1.1",
|
|
28906
|
-
"framer-motion": "^12.40.0",
|
|
28907
28906
|
"lodash-es": "^4.18.1",
|
|
28908
28907
|
"lucide-react": "^1.28.0",
|
|
28908
|
+
motion: "^13.1.1",
|
|
28909
28909
|
qrcode: "^1.5.4",
|
|
28910
28910
|
viem: "^2.52.2",
|
|
28911
28911
|
wagmi: "^3.7.5",
|
|
@@ -29504,7 +29504,7 @@ var init_visually_hidden = __esm({
|
|
|
29504
29504
|
});
|
|
29505
29505
|
|
|
29506
29506
|
// src/internal/components/Dialog/Dialog.tsx
|
|
29507
|
-
import { AnimatePresence, motion } from "
|
|
29507
|
+
import { AnimatePresence, motion } from "motion/react";
|
|
29508
29508
|
import { useEffect as useEffect52 } from "react";
|
|
29509
29509
|
import { jsx as jsx130, jsxs as jsxs117 } from "react/jsx-runtime";
|
|
29510
29510
|
function Dialog2() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@embarkai/ui-kit",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.92",
|
|
4
4
|
"description": "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"clsx": "^2.1.1",
|
|
44
44
|
"dayjs": "^1.11.21",
|
|
45
45
|
"dkls23-wasm": "^0.1.1",
|
|
46
|
-
"framer-motion": "^12.40.0",
|
|
47
46
|
"lodash-es": "^4.18.1",
|
|
48
47
|
"lucide-react": "^1.28.0",
|
|
48
|
+
"motion": "^13.1.1",
|
|
49
49
|
"qrcode": "^1.5.4",
|
|
50
50
|
"viem": "^2.52.2",
|
|
51
51
|
"wagmi": "^3.7.5",
|