@embarkai/ui-kit 0.4.110 → 0.4.112
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 +65 -65
- package/dist/index.js +55 -49
- 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.112</title>
|
|
19
19
|
|
|
20
20
|
<!-- Styles will be injected by build process -->
|
|
21
21
|
<style>
|
package/dist/iframe/main.js
CHANGED
|
@@ -6342,7 +6342,7 @@ var SigningManager = class extends TokenRefreshApiClient {
|
|
|
6342
6342
|
};
|
|
6343
6343
|
|
|
6344
6344
|
// src/iframe/main.ts
|
|
6345
|
-
var IFRAME_VERSION = "0.4.
|
|
6345
|
+
var IFRAME_VERSION = "0.4.112";
|
|
6346
6346
|
var IframeWallet = class {
|
|
6347
6347
|
// private finchpay: FinchPayRampAPI
|
|
6348
6348
|
// private rampnow: RampnowOnrampAPI
|
package/dist/index.cjs
CHANGED
|
@@ -17661,14 +17661,7 @@ function ConnectExternalWalletMenu() {
|
|
|
17661
17661
|
} finally {
|
|
17662
17662
|
setIsPreparingConnect(false);
|
|
17663
17663
|
}
|
|
17664
|
-
|
|
17665
|
-
case (connector.id === "metaMaskSDK" && !hasInjectedWallet2):
|
|
17666
|
-
closeEmbarkAI();
|
|
17667
|
-
break;
|
|
17668
|
-
default:
|
|
17669
|
-
useLayoutStore.getState().setIsDialogForced(true);
|
|
17670
|
-
break;
|
|
17671
|
-
}
|
|
17664
|
+
useLayoutStore.getState().setIsDialogForced(true);
|
|
17672
17665
|
try {
|
|
17673
17666
|
await connect({ connector });
|
|
17674
17667
|
} catch {
|
|
@@ -17750,66 +17743,73 @@ function useExternalWalletConnnect(options) {
|
|
|
17750
17743
|
const walletMode = config.current?.wallet?.mode;
|
|
17751
17744
|
const wagmiConfig3 = (0, import_wagmi4.useConfig)();
|
|
17752
17745
|
const connectors = (0, import_wagmi4.useConnectors)();
|
|
17753
|
-
const
|
|
17754
|
-
const { mutate: connect, ...restUseConnect } = (0, import_wagmi4.useConnect)(
|
|
17755
|
-
|
|
17756
|
-
|
|
17757
|
-
|
|
17758
|
-
|
|
17759
|
-
|
|
17760
|
-
|
|
17761
|
-
chainId,
|
|
17762
|
-
connectorName: connector.name || "Unknown Wallet"
|
|
17763
|
-
});
|
|
17764
|
-
onSuccess?.({ connected: true, address: signingWalletAddress });
|
|
17765
|
-
useLayoutStore.getState().setIsDialogForced(false);
|
|
17766
|
-
},
|
|
17767
|
-
onError: async (error, { connector }) => {
|
|
17768
|
-
await dropFailedConnectorSession(error, connector, wagmiConfig3);
|
|
17769
|
-
onError?.({
|
|
17770
|
-
connected: false,
|
|
17771
|
-
connector: connector?.name || "Unknown Wallet",
|
|
17772
|
-
error
|
|
17773
|
-
});
|
|
17774
|
-
useLayoutStore.getState().setIsDialogForced(false);
|
|
17775
|
-
}
|
|
17776
|
-
}
|
|
17777
|
-
});
|
|
17778
|
-
const disconnectExternalWallet = (0, import_react48.useCallback)(() => {
|
|
17779
|
-
try {
|
|
17780
|
-
disconnect();
|
|
17781
|
-
} catch {
|
|
17782
|
-
return;
|
|
17783
|
-
}
|
|
17784
|
-
useExternalWalletStore.getState().clearExternalWallet();
|
|
17785
|
-
}, [disconnect]);
|
|
17746
|
+
const connections = (0, import_wagmi4.useConnections)();
|
|
17747
|
+
const { mutate: connect, mutateAsync: connectAsync, ...restUseConnect } = (0, import_wagmi4.useConnect)();
|
|
17748
|
+
const { mutateAsync: disconnectAsync } = (0, import_wagmi4.useDisconnect)();
|
|
17749
|
+
const disconnectExternalWallet = (0, import_react48.useCallback)(async () => {
|
|
17750
|
+
await disconnectAsync();
|
|
17751
|
+
const { externalAddress, clearExternalWallet } = useExternalWalletStore.getState();
|
|
17752
|
+
if (!!externalAddress) clearExternalWallet();
|
|
17753
|
+
}, [disconnectAsync]);
|
|
17786
17754
|
const connectExternalWallet = (0, import_react48.useCallback)(
|
|
17787
17755
|
async (walletConnectorType) => {
|
|
17788
|
-
disconnectExternalWallet();
|
|
17789
17756
|
const connector = connectors.find((c) => c.id === walletConnectorType);
|
|
17790
17757
|
if (!connector) {
|
|
17791
|
-
console.
|
|
17758
|
+
console.warn("[useExternalWalletConnect] Connector not found for:", walletConnectorType);
|
|
17792
17759
|
return;
|
|
17793
17760
|
}
|
|
17761
|
+
const existingConnection = connections.find((c) => c.connector.uid === connector.uid);
|
|
17762
|
+
if (!!existingConnection?.connector) {
|
|
17763
|
+
console.warn("[useExternalWalletConnect] Disconnecting existing connection");
|
|
17764
|
+
await disconnectExternalWallet();
|
|
17765
|
+
}
|
|
17794
17766
|
useLayoutStore.getState().setIsDialogForced(true);
|
|
17795
17767
|
try {
|
|
17796
|
-
|
|
17797
|
-
|
|
17768
|
+
connect(
|
|
17769
|
+
{ connector },
|
|
17770
|
+
{
|
|
17771
|
+
onSuccess: (connectionData, { connector: connector2 }) => {
|
|
17772
|
+
const { chainId, accounts } = connectionData;
|
|
17773
|
+
const signingWalletAddress = accounts[0];
|
|
17774
|
+
useExternalWalletStore.getState().setExternalWallet({
|
|
17775
|
+
address: signingWalletAddress,
|
|
17776
|
+
chainId,
|
|
17777
|
+
connectorName: connector2.name || "Unknown Wallet"
|
|
17778
|
+
});
|
|
17779
|
+
onSuccess?.({ connected: true, address: signingWalletAddress });
|
|
17780
|
+
setTimeout(() => useLayoutStore.getState().setIsDialogForced(false), 100);
|
|
17781
|
+
},
|
|
17782
|
+
onError: async (error, { connector: connector2 }) => {
|
|
17783
|
+
await dropFailedConnectorSession(error, connector2, wagmiConfig3);
|
|
17784
|
+
onError?.({
|
|
17785
|
+
connected: false,
|
|
17786
|
+
connector: connector2?.name || "Unknown Wallet",
|
|
17787
|
+
error
|
|
17788
|
+
});
|
|
17789
|
+
setTimeout(() => useLayoutStore.getState().setIsDialogForced(false), 100);
|
|
17790
|
+
}
|
|
17791
|
+
}
|
|
17792
|
+
);
|
|
17793
|
+
} catch (connectionError) {
|
|
17794
|
+
console.warn("[useExternalWalletConnect] Error:", connectionError);
|
|
17795
|
+
return;
|
|
17798
17796
|
}
|
|
17799
17797
|
},
|
|
17800
|
-
[connectors]
|
|
17798
|
+
[connections, connectors, onSuccess, onError]
|
|
17801
17799
|
);
|
|
17802
17800
|
return {
|
|
17803
17801
|
isAvailable: walletMode === "direct" || walletMode === "both",
|
|
17804
17802
|
mutate: connectExternalWallet,
|
|
17803
|
+
mutateAsync: connectExternalWallet,
|
|
17805
17804
|
disconnect: disconnectExternalWallet,
|
|
17806
|
-
...restUseConnect
|
|
17805
|
+
...(0, import_lodash_es13.omit)(restUseConnect, ["mutate", "mutateAsync"])
|
|
17807
17806
|
};
|
|
17808
17807
|
}
|
|
17809
|
-
var import_react48, import_wagmi4;
|
|
17808
|
+
var import_lodash_es13, import_react48, import_wagmi4;
|
|
17810
17809
|
var init_useExternalWalletConnect = __esm({
|
|
17811
17810
|
"src/internal/components/ConnectExternalWalletMenu/useExternalWalletConnect.ts"() {
|
|
17812
17811
|
init_ProviderContext();
|
|
17812
|
+
import_lodash_es13 = require("lodash-es");
|
|
17813
17813
|
import_react48 = require("react");
|
|
17814
17814
|
import_wagmi4 = require("wagmi");
|
|
17815
17815
|
init_useLayoutStore();
|
|
@@ -22874,7 +22874,7 @@ function useNicknameAvailability(currentNickname) {
|
|
|
22874
22874
|
useNicknameStore.getState().setError(error?.message || "Failed to check nickname availability");
|
|
22875
22875
|
}
|
|
22876
22876
|
});
|
|
22877
|
-
const debouncedCheckAvailability = (0, import_react69.useCallback)((0,
|
|
22877
|
+
const debouncedCheckAvailability = (0, import_react69.useCallback)((0, import_lodash_es14.debounce)(checkAvailability, DEBOUNCE_MS), [checkAvailability]);
|
|
22878
22878
|
(0, import_react69.useEffect)(() => {
|
|
22879
22879
|
if (!currentNickname) return;
|
|
22880
22880
|
const normalizedInputValue = normalizeNickname(nicknameValue);
|
|
@@ -22889,12 +22889,12 @@ function useNicknameAvailability(currentNickname) {
|
|
|
22889
22889
|
}, [nicknameValue, currentNickname, debouncedCheckAvailability]);
|
|
22890
22890
|
return { isCheckingAvailability };
|
|
22891
22891
|
}
|
|
22892
|
-
var import_react_query39,
|
|
22892
|
+
var import_react_query39, import_lodash_es14, import_react69, DEBOUNCE_MS;
|
|
22893
22893
|
var init_useNicknameAvailability = __esm({
|
|
22894
22894
|
"src/internal/components/NicknameMenu/useNicknameAvailability.ts"() {
|
|
22895
22895
|
init_i18n();
|
|
22896
22896
|
import_react_query39 = require("@tanstack/react-query");
|
|
22897
|
-
|
|
22897
|
+
import_lodash_es14 = require("lodash-es");
|
|
22898
22898
|
import_react69 = require("react");
|
|
22899
22899
|
init_nickname();
|
|
22900
22900
|
init_nickname_errors();
|
|
@@ -24685,7 +24685,7 @@ var init_UserPolicies2 = __esm({
|
|
|
24685
24685
|
function useSecurityMenuParams() {
|
|
24686
24686
|
(0, import_react77.useEffect)(() => {
|
|
24687
24687
|
const { pageParams, setPageParams } = useLayoutDataStore.getState();
|
|
24688
|
-
if (!pageParams || !(0,
|
|
24688
|
+
if (!pageParams || !(0, import_lodash_es15.keys)(pageParams).length) return;
|
|
24689
24689
|
const { submenu } = pageParams;
|
|
24690
24690
|
setTimeout(() => {
|
|
24691
24691
|
switch (submenu) {
|
|
@@ -24707,10 +24707,10 @@ function useSecurityMenuParams() {
|
|
|
24707
24707
|
setPageParams(null);
|
|
24708
24708
|
}, []);
|
|
24709
24709
|
}
|
|
24710
|
-
var
|
|
24710
|
+
var import_lodash_es15, import_react77;
|
|
24711
24711
|
var init_useSecurityMenuParams = __esm({
|
|
24712
24712
|
"src/internal/components/SecurityMenu/useSecurityMenuParams.ts"() {
|
|
24713
|
-
|
|
24713
|
+
import_lodash_es15 = require("lodash-es");
|
|
24714
24714
|
import_react77 = require("react");
|
|
24715
24715
|
init_useLayoutDataStore();
|
|
24716
24716
|
init_UserPolicies2();
|
|
@@ -28501,7 +28501,7 @@ function useSendMenuParams() {
|
|
|
28501
28501
|
const { config } = useProviderConfig();
|
|
28502
28502
|
(0, import_react95.useEffect)(() => {
|
|
28503
28503
|
const { pageParams, setPageParams } = useLayoutDataStore.getState();
|
|
28504
|
-
if (!pageParams || !(0,
|
|
28504
|
+
if (!pageParams || !(0, import_lodash_es16.keys)(pageParams).length) return;
|
|
28505
28505
|
const { sendFlow, send, bridge } = pageParams || {};
|
|
28506
28506
|
if (sendFlow === "bridge" && !config?.current?.features?.showAssetBridge) {
|
|
28507
28507
|
setPageParams(null);
|
|
@@ -28552,11 +28552,11 @@ function useSendMenuParams() {
|
|
|
28552
28552
|
setPageParams(null);
|
|
28553
28553
|
}, []);
|
|
28554
28554
|
}
|
|
28555
|
-
var
|
|
28555
|
+
var import_lodash_es16, import_react95;
|
|
28556
28556
|
var init_useSendMenuParams = __esm({
|
|
28557
28557
|
"src/internal/components/SendMenu/useSendMenuParams.ts"() {
|
|
28558
28558
|
init_ProviderContext();
|
|
28559
|
-
|
|
28559
|
+
import_lodash_es16 = require("lodash-es");
|
|
28560
28560
|
import_react95 = require("react");
|
|
28561
28561
|
init_useLayoutDataStore();
|
|
28562
28562
|
init_useBridgeStore();
|
|
@@ -30068,7 +30068,7 @@ var init_package = __esm({
|
|
|
30068
30068
|
"package.json"() {
|
|
30069
30069
|
package_default = {
|
|
30070
30070
|
name: "@embarkai/ui-kit",
|
|
30071
|
-
version: "0.4.
|
|
30071
|
+
version: "0.4.112",
|
|
30072
30072
|
description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
|
|
30073
30073
|
type: "module",
|
|
30074
30074
|
main: "./dist/index.cjs",
|
|
@@ -30553,17 +30553,17 @@ function useDecideContentStyles() {
|
|
|
30553
30553
|
return {
|
|
30554
30554
|
isClosing,
|
|
30555
30555
|
isMobileView,
|
|
30556
|
-
style: (0,
|
|
30556
|
+
style: (0, import_lodash_es17.merge)({}, mobileStyles)
|
|
30557
30557
|
};
|
|
30558
30558
|
}
|
|
30559
|
-
var DialogPrimitive,
|
|
30559
|
+
var DialogPrimitive, import_lodash_es17, import_lucide_react85, import_react102, import_jsx_runtime133, Dialog, DialogPortal, DialogOverlay, CONTENT_BG_SETUP, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription;
|
|
30560
30560
|
var init_dialog = __esm({
|
|
30561
30561
|
"src/internal/components/ui/dialog.tsx"() {
|
|
30562
30562
|
init_utils();
|
|
30563
30563
|
init_SessionContext();
|
|
30564
30564
|
init_i18n();
|
|
30565
30565
|
DialogPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
30566
|
-
|
|
30566
|
+
import_lodash_es17 = require("lodash-es");
|
|
30567
30567
|
import_lucide_react85 = require("lucide-react");
|
|
30568
30568
|
import_react102 = require("react");
|
|
30569
30569
|
init_useLayoutDataStore();
|
|
@@ -33420,7 +33420,7 @@ function Provider(props) {
|
|
|
33420
33420
|
const { children, projectId, initialConfig = {}, callbacks } = props;
|
|
33421
33421
|
const callbacksRef = (0, import_react108.useRef)(callbacks);
|
|
33422
33422
|
(0, import_react108.useEffect)(() => notifyNoProjetctId(projectId), [projectId]);
|
|
33423
|
-
const config = (0, import_react108.useRef)((0,
|
|
33423
|
+
const config = (0, import_react108.useRef)((0, import_lodash_es18.merge)({}, DEFAULT_PROVIDER_CONFIG, { projectId }, initialConfig));
|
|
33424
33424
|
const wagmiConfig3 = (0, import_react108.useRef)((0, import_core9.getWagmiConfig)(config.current?.wallet?.walletConnectId || null));
|
|
33425
33425
|
const updateConfig = (0, import_react108.useCallback)((updates) => {
|
|
33426
33426
|
const prev = config.current;
|
|
@@ -33463,7 +33463,7 @@ function Provider(props) {
|
|
|
33463
33463
|
}, []);
|
|
33464
33464
|
(0, import_react108.useEffect)(() => {
|
|
33465
33465
|
if (typeof window === "undefined" || !projectId) return;
|
|
33466
|
-
const mergedConfig = (0,
|
|
33466
|
+
const mergedConfig = (0, import_lodash_es18.merge)(DEFAULT_PROVIDER_CONFIG, initialConfig);
|
|
33467
33467
|
updateConfig(mergedConfig);
|
|
33468
33468
|
if (mergedConfig.wallet?.enabled) {
|
|
33469
33469
|
clearLegacyWagmiStorage();
|
|
@@ -33523,12 +33523,12 @@ function Provider(props) {
|
|
|
33523
33523
|
);
|
|
33524
33524
|
return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(UIContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_wagmi11.WagmiProvider, { config: wagmiConfig3.current, children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(SessionProvider, { children }) }) });
|
|
33525
33525
|
}
|
|
33526
|
-
var import_core9, import_error_tracking4,
|
|
33526
|
+
var import_core9, import_error_tracking4, import_lodash_es18, import_react108, import_wagmi11, import_jsx_runtime137, UIContext, useProviderConfig;
|
|
33527
33527
|
var init_ProviderContext = __esm({
|
|
33528
33528
|
"src/context/ProviderContext.tsx"() {
|
|
33529
33529
|
import_core9 = require("@embarkai/core");
|
|
33530
33530
|
import_error_tracking4 = require("@embarkai/core/internal/error-tracking");
|
|
33531
|
-
|
|
33531
|
+
import_lodash_es18 = require("lodash-es");
|
|
33532
33532
|
import_react108 = require("react");
|
|
33533
33533
|
import_wagmi11 = require("wagmi");
|
|
33534
33534
|
init_initial();
|
package/dist/index.js
CHANGED
|
@@ -17624,14 +17624,7 @@ function ConnectExternalWalletMenu() {
|
|
|
17624
17624
|
} finally {
|
|
17625
17625
|
setIsPreparingConnect(false);
|
|
17626
17626
|
}
|
|
17627
|
-
|
|
17628
|
-
case (connector.id === "metaMaskSDK" && !hasInjectedWallet2):
|
|
17629
|
-
closeEmbarkAI();
|
|
17630
|
-
break;
|
|
17631
|
-
default:
|
|
17632
|
-
useLayoutStore.getState().setIsDialogForced(true);
|
|
17633
|
-
break;
|
|
17634
|
-
}
|
|
17627
|
+
useLayoutStore.getState().setIsDialogForced(true);
|
|
17635
17628
|
try {
|
|
17636
17629
|
await connect({ connector });
|
|
17637
17630
|
} catch {
|
|
@@ -17701,68 +17694,81 @@ var init_ConnectExternalWalletMenu = __esm({
|
|
|
17701
17694
|
});
|
|
17702
17695
|
|
|
17703
17696
|
// src/internal/components/ConnectExternalWalletMenu/useExternalWalletConnect.ts
|
|
17697
|
+
import { omit as omit2 } from "lodash-es";
|
|
17704
17698
|
import { useCallback as useCallback18 } from "react";
|
|
17705
|
-
import {
|
|
17699
|
+
import {
|
|
17700
|
+
useConfig as useConfig2,
|
|
17701
|
+
useConnect as useConnect2,
|
|
17702
|
+
useConnections as useConnections3,
|
|
17703
|
+
useConnectors as useConnectors2,
|
|
17704
|
+
useDisconnect as useDisconnect3
|
|
17705
|
+
} from "wagmi";
|
|
17706
17706
|
function useExternalWalletConnnect(options) {
|
|
17707
17707
|
const { onSuccess, onError } = options || {};
|
|
17708
17708
|
const { config } = useProviderConfig();
|
|
17709
17709
|
const walletMode = config.current?.wallet?.mode;
|
|
17710
17710
|
const wagmiConfig3 = useConfig2();
|
|
17711
17711
|
const connectors = useConnectors2();
|
|
17712
|
-
const
|
|
17713
|
-
const { mutate: connect, ...restUseConnect } = useConnect2(
|
|
17714
|
-
|
|
17715
|
-
|
|
17716
|
-
|
|
17717
|
-
|
|
17718
|
-
|
|
17719
|
-
|
|
17720
|
-
chainId,
|
|
17721
|
-
connectorName: connector.name || "Unknown Wallet"
|
|
17722
|
-
});
|
|
17723
|
-
onSuccess?.({ connected: true, address: signingWalletAddress });
|
|
17724
|
-
useLayoutStore.getState().setIsDialogForced(false);
|
|
17725
|
-
},
|
|
17726
|
-
onError: async (error, { connector }) => {
|
|
17727
|
-
await dropFailedConnectorSession(error, connector, wagmiConfig3);
|
|
17728
|
-
onError?.({
|
|
17729
|
-
connected: false,
|
|
17730
|
-
connector: connector?.name || "Unknown Wallet",
|
|
17731
|
-
error
|
|
17732
|
-
});
|
|
17733
|
-
useLayoutStore.getState().setIsDialogForced(false);
|
|
17734
|
-
}
|
|
17735
|
-
}
|
|
17736
|
-
});
|
|
17737
|
-
const disconnectExternalWallet = useCallback18(() => {
|
|
17738
|
-
try {
|
|
17739
|
-
disconnect();
|
|
17740
|
-
} catch {
|
|
17741
|
-
return;
|
|
17742
|
-
}
|
|
17743
|
-
useExternalWalletStore.getState().clearExternalWallet();
|
|
17744
|
-
}, [disconnect]);
|
|
17712
|
+
const connections = useConnections3();
|
|
17713
|
+
const { mutate: connect, mutateAsync: connectAsync, ...restUseConnect } = useConnect2();
|
|
17714
|
+
const { mutateAsync: disconnectAsync } = useDisconnect3();
|
|
17715
|
+
const disconnectExternalWallet = useCallback18(async () => {
|
|
17716
|
+
await disconnectAsync();
|
|
17717
|
+
const { externalAddress, clearExternalWallet } = useExternalWalletStore.getState();
|
|
17718
|
+
if (!!externalAddress) clearExternalWallet();
|
|
17719
|
+
}, [disconnectAsync]);
|
|
17745
17720
|
const connectExternalWallet = useCallback18(
|
|
17746
17721
|
async (walletConnectorType) => {
|
|
17747
|
-
disconnectExternalWallet();
|
|
17748
17722
|
const connector = connectors.find((c) => c.id === walletConnectorType);
|
|
17749
17723
|
if (!connector) {
|
|
17750
|
-
console.
|
|
17724
|
+
console.warn("[useExternalWalletConnect] Connector not found for:", walletConnectorType);
|
|
17751
17725
|
return;
|
|
17752
17726
|
}
|
|
17727
|
+
const existingConnection = connections.find((c) => c.connector.uid === connector.uid);
|
|
17728
|
+
if (!!existingConnection?.connector) {
|
|
17729
|
+
console.warn("[useExternalWalletConnect] Disconnecting existing connection");
|
|
17730
|
+
await disconnectExternalWallet();
|
|
17731
|
+
}
|
|
17753
17732
|
useLayoutStore.getState().setIsDialogForced(true);
|
|
17754
17733
|
try {
|
|
17755
|
-
|
|
17756
|
-
|
|
17734
|
+
connect(
|
|
17735
|
+
{ connector },
|
|
17736
|
+
{
|
|
17737
|
+
onSuccess: (connectionData, { connector: connector2 }) => {
|
|
17738
|
+
const { chainId, accounts } = connectionData;
|
|
17739
|
+
const signingWalletAddress = accounts[0];
|
|
17740
|
+
useExternalWalletStore.getState().setExternalWallet({
|
|
17741
|
+
address: signingWalletAddress,
|
|
17742
|
+
chainId,
|
|
17743
|
+
connectorName: connector2.name || "Unknown Wallet"
|
|
17744
|
+
});
|
|
17745
|
+
onSuccess?.({ connected: true, address: signingWalletAddress });
|
|
17746
|
+
setTimeout(() => useLayoutStore.getState().setIsDialogForced(false), 100);
|
|
17747
|
+
},
|
|
17748
|
+
onError: async (error, { connector: connector2 }) => {
|
|
17749
|
+
await dropFailedConnectorSession(error, connector2, wagmiConfig3);
|
|
17750
|
+
onError?.({
|
|
17751
|
+
connected: false,
|
|
17752
|
+
connector: connector2?.name || "Unknown Wallet",
|
|
17753
|
+
error
|
|
17754
|
+
});
|
|
17755
|
+
setTimeout(() => useLayoutStore.getState().setIsDialogForced(false), 100);
|
|
17756
|
+
}
|
|
17757
|
+
}
|
|
17758
|
+
);
|
|
17759
|
+
} catch (connectionError) {
|
|
17760
|
+
console.warn("[useExternalWalletConnect] Error:", connectionError);
|
|
17761
|
+
return;
|
|
17757
17762
|
}
|
|
17758
17763
|
},
|
|
17759
|
-
[connectors]
|
|
17764
|
+
[connections, connectors, onSuccess, onError]
|
|
17760
17765
|
);
|
|
17761
17766
|
return {
|
|
17762
17767
|
isAvailable: walletMode === "direct" || walletMode === "both",
|
|
17763
17768
|
mutate: connectExternalWallet,
|
|
17769
|
+
mutateAsync: connectExternalWallet,
|
|
17764
17770
|
disconnect: disconnectExternalWallet,
|
|
17765
|
-
...restUseConnect
|
|
17771
|
+
...omit2(restUseConnect, ["mutate", "mutateAsync"])
|
|
17766
17772
|
};
|
|
17767
17773
|
}
|
|
17768
17774
|
var init_useExternalWalletConnect = __esm({
|
|
@@ -29969,7 +29975,7 @@ var init_package = __esm({
|
|
|
29969
29975
|
"package.json"() {
|
|
29970
29976
|
package_default = {
|
|
29971
29977
|
name: "@embarkai/ui-kit",
|
|
29972
|
-
version: "0.4.
|
|
29978
|
+
version: "0.4.112",
|
|
29973
29979
|
description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
|
|
29974
29980
|
type: "module",
|
|
29975
29981
|
main: "./dist/index.cjs",
|