@embarkai/ui-kit 0.4.71 → 0.4.72
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 +48 -40
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +153 -145
- 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.72</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.72";
|
|
6418
6418
|
var IframeWallet = class {
|
|
6419
6419
|
constructor() {
|
|
6420
6420
|
__publicField(this, "messenger");
|
package/dist/index.cjs
CHANGED
|
@@ -875,31 +875,31 @@ var init_useLayoutDataStore = __esm({
|
|
|
875
875
|
"src/internal/hooks/useLayoutDataStore.ts"() {
|
|
876
876
|
import_zustand = require("zustand");
|
|
877
877
|
init_constants();
|
|
878
|
-
PageKey = /* @__PURE__ */ ((
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
return
|
|
878
|
+
PageKey = /* @__PURE__ */ ((PageKey3) => {
|
|
879
|
+
PageKey3["AUTH"] = "auth";
|
|
880
|
+
PageKey3["LANGUAGES"] = "languages";
|
|
881
|
+
PageKey3["TERMS_OF_SERVICE"] = "terms-of-service";
|
|
882
|
+
PageKey3["MAIN_MENU"] = "main-menu";
|
|
883
|
+
PageKey3["SETTINGS"] = "settings";
|
|
884
|
+
PageKey3["SEND"] = "send";
|
|
885
|
+
PageKey3["RECEIVE"] = "receive";
|
|
886
|
+
PageKey3["BUY"] = "buy";
|
|
887
|
+
PageKey3["KYC"] = "kyc";
|
|
888
|
+
PageKey3["TRANSACTIONS"] = "transactions";
|
|
889
|
+
PageKey3["ASSETS"] = "assets";
|
|
890
|
+
PageKey3["MANAGE_WALLET"] = "manage-wallet";
|
|
891
|
+
PageKey3["UNLINK_PROVIDER"] = "unlink-provider";
|
|
892
|
+
PageKey3["SECURITY"] = "security";
|
|
893
|
+
PageKey3["KEYSARE_BACKUP"] = "keysare-backup";
|
|
894
|
+
PageKey3["KEYSHARE_RESTORE"] = "keyshare-restore";
|
|
895
|
+
PageKey3["CHAIN"] = "chain";
|
|
896
|
+
PageKey3["CHAIN_SWITCH_REQUEST"] = "chain-switch-request";
|
|
897
|
+
PageKey3["NICKNAME_SETTINGS"] = "nickname-settings";
|
|
898
|
+
PageKey3["DEVICES"] = "devices";
|
|
899
|
+
PageKey3["DEVICE_LINK"] = "device-link";
|
|
900
|
+
PageKey3["DEVICE_MANAGE"] = "device-manage";
|
|
901
|
+
PageKey3["DEVICE_RESTORE"] = "device-restore";
|
|
902
|
+
return PageKey3;
|
|
903
903
|
})(PageKey || {});
|
|
904
904
|
useLayoutDataStore = (0, import_zustand.create)((set) => ({
|
|
905
905
|
page: null,
|
|
@@ -8488,7 +8488,9 @@ var init_onboarder = __esm({
|
|
|
8488
8488
|
useOnboardingStore = (0, import_zustand4.create)((set) => ({
|
|
8489
8489
|
elRect: { x: window.innerWidth / 2, y: window.innerHeight / 2, width: 0, height: 0 },
|
|
8490
8490
|
tooltip: { title: "", description: "" },
|
|
8491
|
-
setStore: (tooltipStore) => set(tooltipStore)
|
|
8491
|
+
setStore: (tooltipStore) => set(tooltipStore),
|
|
8492
|
+
mountIntoNode: document.body,
|
|
8493
|
+
setMountIntoNode: (mountIntoNode) => set({ mountIntoNode })
|
|
8492
8494
|
}));
|
|
8493
8495
|
Onboarder = class {
|
|
8494
8496
|
tour = null;
|
|
@@ -8561,22 +8563,26 @@ function OnboardingOverlay() {
|
|
|
8561
8563
|
const isOnboarding = useLayoutDataStore((st) => st.isOnboarding);
|
|
8562
8564
|
const isMobileView = useLayoutStore((st) => st.isMobileView);
|
|
8563
8565
|
const colorMode = useLayoutStore((st) => st.colorMode);
|
|
8564
|
-
const {
|
|
8565
|
-
|
|
8566
|
-
|
|
8566
|
+
const {
|
|
8567
|
+
elRect,
|
|
8568
|
+
tooltip,
|
|
8569
|
+
/** if embark is opened, onboard overlay has to be portaled into embark's dialog node to keep layers & pointer-events normal structure */
|
|
8570
|
+
mountIntoNode,
|
|
8571
|
+
setMountIntoNode
|
|
8572
|
+
} = useOnboardingStore();
|
|
8567
8573
|
(0, import_react20.useEffect)(() => {
|
|
8568
|
-
if (lastPageRef.current === page) return;
|
|
8569
8574
|
setTimeout(() => {
|
|
8570
|
-
if (lastPageRef.current === page) return;
|
|
8571
8575
|
if (!page) {
|
|
8572
|
-
|
|
8573
|
-
return
|
|
8576
|
+
setMountIntoNode(document.body);
|
|
8577
|
+
return;
|
|
8578
|
+
}
|
|
8579
|
+
const lastMountIntoNode = useOnboardingStore.getState().mountIntoNode;
|
|
8580
|
+
if (lastMountIntoNode?.dataset?.purpose === "embarkai-ui-container") {
|
|
8581
|
+
return;
|
|
8574
8582
|
}
|
|
8575
|
-
const
|
|
8576
|
-
setMountIntoNode(
|
|
8577
|
-
lastPageRef.current = page;
|
|
8583
|
+
const embarkUIContainer = document.querySelector('[data-purpose="embarkai-ui-container"]');
|
|
8584
|
+
setMountIntoNode(embarkUIContainer);
|
|
8578
8585
|
}, 0);
|
|
8579
|
-
return () => setMountIntoNode(null);
|
|
8580
8586
|
}, [page]);
|
|
8581
8587
|
if (!mountIntoNode) return null;
|
|
8582
8588
|
const frame = {
|
|
@@ -8634,7 +8640,7 @@ function OnboardingOverlay() {
|
|
|
8634
8640
|
}
|
|
8635
8641
|
)
|
|
8636
8642
|
] }) }),
|
|
8637
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("rect", { width: "100%", height: "100%", fill: "
|
|
8643
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("rect", { width: "100%", height: "100%", fill: "rgba(0,0,0,0.8)", mask: "url(#onboradng-overlay-mask)" })
|
|
8638
8644
|
]
|
|
8639
8645
|
}
|
|
8640
8646
|
),
|
|
@@ -9753,6 +9759,7 @@ var init_components = __esm({
|
|
|
9753
9759
|
var BUY_MENU_BINANCE_TOUR;
|
|
9754
9760
|
var init_onboarding_setup = __esm({
|
|
9755
9761
|
"src/internal/components/BuyMenu/onboarding.setup.ts"() {
|
|
9762
|
+
init_useLayoutDataStore();
|
|
9756
9763
|
init_useBinanceStore();
|
|
9757
9764
|
init_useBuyMenuStore();
|
|
9758
9765
|
BUY_MENU_BINANCE_TOUR = [
|
|
@@ -9794,8 +9801,9 @@ var init_onboarding_setup = __esm({
|
|
|
9794
9801
|
title: "Confirm your purchase",
|
|
9795
9802
|
description: "Review the details of your purchase before confirming.",
|
|
9796
9803
|
onNext: () => {
|
|
9797
|
-
useBinanceStore.getState().setQuoteData(null);
|
|
9798
9804
|
useBuyMenuStore.getState().setIsProviderSummary(false);
|
|
9805
|
+
useLayoutDataStore.getState().setPage("buy" /* BUY */);
|
|
9806
|
+
useBinanceStore.getState().setQuoteData(null);
|
|
9799
9807
|
}
|
|
9800
9808
|
}
|
|
9801
9809
|
];
|
|
@@ -24984,7 +24992,7 @@ var init_package = __esm({
|
|
|
24984
24992
|
"package.json"() {
|
|
24985
24993
|
package_default = {
|
|
24986
24994
|
name: "@embarkai/ui-kit",
|
|
24987
|
-
version: "0.4.
|
|
24995
|
+
version: "0.4.72",
|
|
24988
24996
|
description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
|
|
24989
24997
|
type: "module",
|
|
24990
24998
|
main: "./dist/index.cjs",
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -864,31 +864,31 @@ var PageKey, useLayoutDataStore;
|
|
|
864
864
|
var init_useLayoutDataStore = __esm({
|
|
865
865
|
"src/internal/hooks/useLayoutDataStore.ts"() {
|
|
866
866
|
init_constants();
|
|
867
|
-
PageKey = /* @__PURE__ */ ((
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
return
|
|
867
|
+
PageKey = /* @__PURE__ */ ((PageKey3) => {
|
|
868
|
+
PageKey3["AUTH"] = "auth";
|
|
869
|
+
PageKey3["LANGUAGES"] = "languages";
|
|
870
|
+
PageKey3["TERMS_OF_SERVICE"] = "terms-of-service";
|
|
871
|
+
PageKey3["MAIN_MENU"] = "main-menu";
|
|
872
|
+
PageKey3["SETTINGS"] = "settings";
|
|
873
|
+
PageKey3["SEND"] = "send";
|
|
874
|
+
PageKey3["RECEIVE"] = "receive";
|
|
875
|
+
PageKey3["BUY"] = "buy";
|
|
876
|
+
PageKey3["KYC"] = "kyc";
|
|
877
|
+
PageKey3["TRANSACTIONS"] = "transactions";
|
|
878
|
+
PageKey3["ASSETS"] = "assets";
|
|
879
|
+
PageKey3["MANAGE_WALLET"] = "manage-wallet";
|
|
880
|
+
PageKey3["UNLINK_PROVIDER"] = "unlink-provider";
|
|
881
|
+
PageKey3["SECURITY"] = "security";
|
|
882
|
+
PageKey3["KEYSARE_BACKUP"] = "keysare-backup";
|
|
883
|
+
PageKey3["KEYSHARE_RESTORE"] = "keyshare-restore";
|
|
884
|
+
PageKey3["CHAIN"] = "chain";
|
|
885
|
+
PageKey3["CHAIN_SWITCH_REQUEST"] = "chain-switch-request";
|
|
886
|
+
PageKey3["NICKNAME_SETTINGS"] = "nickname-settings";
|
|
887
|
+
PageKey3["DEVICES"] = "devices";
|
|
888
|
+
PageKey3["DEVICE_LINK"] = "device-link";
|
|
889
|
+
PageKey3["DEVICE_MANAGE"] = "device-manage";
|
|
890
|
+
PageKey3["DEVICE_RESTORE"] = "device-restore";
|
|
891
|
+
return PageKey3;
|
|
892
892
|
})(PageKey || {});
|
|
893
893
|
useLayoutDataStore = create((set) => ({
|
|
894
894
|
page: null,
|
|
@@ -8459,7 +8459,9 @@ var init_onboarder = __esm({
|
|
|
8459
8459
|
useOnboardingStore = create4((set) => ({
|
|
8460
8460
|
elRect: { x: window.innerWidth / 2, y: window.innerHeight / 2, width: 0, height: 0 },
|
|
8461
8461
|
tooltip: { title: "", description: "" },
|
|
8462
|
-
setStore: (tooltipStore) => set(tooltipStore)
|
|
8462
|
+
setStore: (tooltipStore) => set(tooltipStore),
|
|
8463
|
+
mountIntoNode: document.body,
|
|
8464
|
+
setMountIntoNode: (mountIntoNode) => set({ mountIntoNode })
|
|
8463
8465
|
}));
|
|
8464
8466
|
Onboarder = class {
|
|
8465
8467
|
tour = null;
|
|
@@ -8527,7 +8529,7 @@ var init_onboarder = __esm({
|
|
|
8527
8529
|
|
|
8528
8530
|
// src/internal/components/Onboarding/OnboardingOverlay.tsx
|
|
8529
8531
|
import { ChevronRightIcon } from "lucide-react";
|
|
8530
|
-
import { useEffect as useEffect12
|
|
8532
|
+
import { useEffect as useEffect12 } from "react";
|
|
8531
8533
|
import { createPortal } from "react-dom";
|
|
8532
8534
|
import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
8533
8535
|
function OnboardingOverlay() {
|
|
@@ -8536,22 +8538,26 @@ function OnboardingOverlay() {
|
|
|
8536
8538
|
const isOnboarding = useLayoutDataStore((st) => st.isOnboarding);
|
|
8537
8539
|
const isMobileView = useLayoutStore((st) => st.isMobileView);
|
|
8538
8540
|
const colorMode = useLayoutStore((st) => st.colorMode);
|
|
8539
|
-
const {
|
|
8540
|
-
|
|
8541
|
-
|
|
8541
|
+
const {
|
|
8542
|
+
elRect,
|
|
8543
|
+
tooltip,
|
|
8544
|
+
/** if embark is opened, onboard overlay has to be portaled into embark's dialog node to keep layers & pointer-events normal structure */
|
|
8545
|
+
mountIntoNode,
|
|
8546
|
+
setMountIntoNode
|
|
8547
|
+
} = useOnboardingStore();
|
|
8542
8548
|
useEffect12(() => {
|
|
8543
|
-
if (lastPageRef.current === page) return;
|
|
8544
8549
|
setTimeout(() => {
|
|
8545
|
-
if (lastPageRef.current === page) return;
|
|
8546
8550
|
if (!page) {
|
|
8547
|
-
|
|
8548
|
-
return
|
|
8551
|
+
setMountIntoNode(document.body);
|
|
8552
|
+
return;
|
|
8553
|
+
}
|
|
8554
|
+
const lastMountIntoNode = useOnboardingStore.getState().mountIntoNode;
|
|
8555
|
+
if (lastMountIntoNode?.dataset?.purpose === "embarkai-ui-container") {
|
|
8556
|
+
return;
|
|
8549
8557
|
}
|
|
8550
|
-
const
|
|
8551
|
-
setMountIntoNode(
|
|
8552
|
-
lastPageRef.current = page;
|
|
8558
|
+
const embarkUIContainer = document.querySelector('[data-purpose="embarkai-ui-container"]');
|
|
8559
|
+
setMountIntoNode(embarkUIContainer);
|
|
8553
8560
|
}, 0);
|
|
8554
|
-
return () => setMountIntoNode(null);
|
|
8555
8561
|
}, [page]);
|
|
8556
8562
|
if (!mountIntoNode) return null;
|
|
8557
8563
|
const frame = {
|
|
@@ -8609,7 +8615,7 @@ function OnboardingOverlay() {
|
|
|
8609
8615
|
}
|
|
8610
8616
|
)
|
|
8611
8617
|
] }) }),
|
|
8612
|
-
/* @__PURE__ */ jsx21("rect", { width: "100%", height: "100%", fill: "
|
|
8618
|
+
/* @__PURE__ */ jsx21("rect", { width: "100%", height: "100%", fill: "rgba(0,0,0,0.8)", mask: "url(#onboradng-overlay-mask)" })
|
|
8613
8619
|
]
|
|
8614
8620
|
}
|
|
8615
8621
|
),
|
|
@@ -8678,7 +8684,7 @@ var init_Onboarding = __esm({
|
|
|
8678
8684
|
});
|
|
8679
8685
|
|
|
8680
8686
|
// src/internal/components/ui/switch.tsx
|
|
8681
|
-
import { forwardRef as forwardRef3, useState as
|
|
8687
|
+
import { forwardRef as forwardRef3, useState as useState5 } from "react";
|
|
8682
8688
|
import { jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
8683
8689
|
var Switch;
|
|
8684
8690
|
var init_switch = __esm({
|
|
@@ -8688,7 +8694,7 @@ var init_switch = __esm({
|
|
|
8688
8694
|
Switch = forwardRef3((props, ref) => {
|
|
8689
8695
|
const { className, labels, ...inputProps } = props;
|
|
8690
8696
|
const colorMode = useLayoutStore((st) => st.colorMode);
|
|
8691
|
-
const [labelW, setLabelW] =
|
|
8697
|
+
const [labelW, setLabelW] = useState5(0);
|
|
8692
8698
|
return /* @__PURE__ */ jsx22(
|
|
8693
8699
|
"div",
|
|
8694
8700
|
{
|
|
@@ -9266,7 +9272,7 @@ var init_useBuyMenuStore = __esm({
|
|
|
9266
9272
|
// src/internal/components/BuyMenu/components/CryptoSelector.tsx
|
|
9267
9273
|
import { debounce as debounce2, toPairs } from "lodash-es";
|
|
9268
9274
|
import { InfoIcon, PointerIcon, SearchIcon } from "lucide-react";
|
|
9269
|
-
import { useCallback as useCallback10, useMemo as useMemo2, useState as
|
|
9275
|
+
import { useCallback as useCallback10, useMemo as useMemo2, useState as useState6 } from "react";
|
|
9270
9276
|
import { jsx as jsx34, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
9271
9277
|
function CryptoItem(props) {
|
|
9272
9278
|
const { symbol, network } = props;
|
|
@@ -9304,8 +9310,8 @@ function CryptoSelector(props) {
|
|
|
9304
9310
|
const { coins } = props;
|
|
9305
9311
|
const { t } = useT();
|
|
9306
9312
|
const chainConfig = useSession((st) => st.chainConfig);
|
|
9307
|
-
const [searchValue, setSearchValue] =
|
|
9308
|
-
const [target, setTarget] =
|
|
9313
|
+
const [searchValue, setSearchValue] = useState6("");
|
|
9314
|
+
const [target, setTarget] = useState6("");
|
|
9309
9315
|
const setSearchDebounced = useCallback10(
|
|
9310
9316
|
debounce2((value) => {
|
|
9311
9317
|
setTarget(value);
|
|
@@ -9491,7 +9497,7 @@ var init_ResolvedFiatIcon = __esm({
|
|
|
9491
9497
|
// src/internal/components/BuyMenu/components/FiatSelector.tsx
|
|
9492
9498
|
import { debounce as debounce3 } from "lodash-es";
|
|
9493
9499
|
import { PointerIcon as PointerIcon2, SearchIcon as SearchIcon2 } from "lucide-react";
|
|
9494
|
-
import { useCallback as useCallback11, useMemo as useMemo3, useState as
|
|
9500
|
+
import { useCallback as useCallback11, useMemo as useMemo3, useState as useState7 } from "react";
|
|
9495
9501
|
import { Fragment as Fragment9, jsx as jsx36, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
9496
9502
|
function getCurrencyName(ticker, locale = "en") {
|
|
9497
9503
|
try {
|
|
@@ -9529,8 +9535,8 @@ function FiatSelector(props) {
|
|
|
9529
9535
|
const { fiats } = props;
|
|
9530
9536
|
const { t, i18n } = useT();
|
|
9531
9537
|
const locale = i18n.resolvedLanguage || "en";
|
|
9532
|
-
const [searchValue, setSearchValue] =
|
|
9533
|
-
const [target, setTarget] =
|
|
9538
|
+
const [searchValue, setSearchValue] = useState7("");
|
|
9539
|
+
const [target, setTarget] = useState7("");
|
|
9534
9540
|
const setSearchDebounced = useCallback11(
|
|
9535
9541
|
debounce3((value) => {
|
|
9536
9542
|
setTarget(value);
|
|
@@ -9719,6 +9725,7 @@ var init_components = __esm({
|
|
|
9719
9725
|
var BUY_MENU_BINANCE_TOUR;
|
|
9720
9726
|
var init_onboarding_setup = __esm({
|
|
9721
9727
|
"src/internal/components/BuyMenu/onboarding.setup.ts"() {
|
|
9728
|
+
init_useLayoutDataStore();
|
|
9722
9729
|
init_useBinanceStore();
|
|
9723
9730
|
init_useBuyMenuStore();
|
|
9724
9731
|
BUY_MENU_BINANCE_TOUR = [
|
|
@@ -9760,8 +9767,9 @@ var init_onboarding_setup = __esm({
|
|
|
9760
9767
|
title: "Confirm your purchase",
|
|
9761
9768
|
description: "Review the details of your purchase before confirming.",
|
|
9762
9769
|
onNext: () => {
|
|
9763
|
-
useBinanceStore.getState().setQuoteData(null);
|
|
9764
9770
|
useBuyMenuStore.getState().setIsProviderSummary(false);
|
|
9771
|
+
useLayoutDataStore.getState().setPage("buy" /* BUY */);
|
|
9772
|
+
useBinanceStore.getState().setQuoteData(null);
|
|
9765
9773
|
}
|
|
9766
9774
|
}
|
|
9767
9775
|
];
|
|
@@ -10411,10 +10419,10 @@ var init_BinanceTxHistory = __esm({
|
|
|
10411
10419
|
|
|
10412
10420
|
// src/internal/components/BuyMenu/binance/useBinanceSseTracing.ts
|
|
10413
10421
|
import { useQueryClient as useQueryClient4 } from "@tanstack/react-query";
|
|
10414
|
-
import { useEffect as useEffect15, useRef as
|
|
10422
|
+
import { useEffect as useEffect15, useRef as useRef9 } from "react";
|
|
10415
10423
|
function useBinanceSseTxTracing(walletAddress) {
|
|
10416
10424
|
const qc = useQueryClient4();
|
|
10417
|
-
const debounceRef =
|
|
10425
|
+
const debounceRef = useRef9(null);
|
|
10418
10426
|
useEffect15(() => {
|
|
10419
10427
|
if (!walletAddress) return;
|
|
10420
10428
|
const iframeManager = getIframeManager();
|
|
@@ -10889,7 +10897,7 @@ var init_FinchPaySummary = __esm({
|
|
|
10889
10897
|
import { useInfiniteQuery as useInfiniteQuery2 } from "@tanstack/react-query";
|
|
10890
10898
|
import dayjs2 from "dayjs";
|
|
10891
10899
|
import { LoaderIcon as LoaderIcon4 } from "lucide-react";
|
|
10892
|
-
import { useCallback as useCallback13, useState as
|
|
10900
|
+
import { useCallback as useCallback13, useState as useState8 } from "react";
|
|
10893
10901
|
import { jsx as jsx43, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
10894
10902
|
function getStatusVariant2(status) {
|
|
10895
10903
|
switch (status) {
|
|
@@ -10969,7 +10977,7 @@ function FinchPayTxHistoryItem(props) {
|
|
|
10969
10977
|
function FinchPayTxHistory() {
|
|
10970
10978
|
const { t } = useT();
|
|
10971
10979
|
const walletAddress = useSession((st) => st.address);
|
|
10972
|
-
const [cursor, setCursor] =
|
|
10980
|
+
const [cursor, setCursor] = useState8(1);
|
|
10973
10981
|
const {
|
|
10974
10982
|
data: txData,
|
|
10975
10983
|
isLoading: isTxDataLoading,
|
|
@@ -11076,10 +11084,10 @@ var init_networks = __esm({
|
|
|
11076
11084
|
|
|
11077
11085
|
// src/internal/components/BuyMenu/finchpay/useFinchpaySseTxTracing.ts
|
|
11078
11086
|
import { useQueryClient as useQueryClient6 } from "@tanstack/react-query";
|
|
11079
|
-
import { useEffect as useEffect17, useRef as
|
|
11087
|
+
import { useEffect as useEffect17, useRef as useRef10 } from "react";
|
|
11080
11088
|
function useFinchpaySseTxTracing(walletAddress) {
|
|
11081
11089
|
const qc = useQueryClient6();
|
|
11082
|
-
const debounceRef =
|
|
11090
|
+
const debounceRef = useRef10(null);
|
|
11083
11091
|
useEffect17(() => {
|
|
11084
11092
|
if (!walletAddress) return;
|
|
11085
11093
|
const iframeManager = getIframeManager();
|
|
@@ -11507,7 +11515,7 @@ var init_ProviderSelector = __esm({
|
|
|
11507
11515
|
});
|
|
11508
11516
|
|
|
11509
11517
|
// src/internal/components/BuyMenu/useHandleInputAmount.ts
|
|
11510
|
-
import { useEffect as useEffect19, useRef as
|
|
11518
|
+
import { useEffect as useEffect19, useRef as useRef11 } from "react";
|
|
11511
11519
|
var ON_INPUT_QUERY_DELAY, useHandleInputAmount;
|
|
11512
11520
|
var init_useHandleInputAmount = __esm({
|
|
11513
11521
|
"src/internal/components/BuyMenu/useHandleInputAmount.ts"() {
|
|
@@ -11515,11 +11523,11 @@ var init_useHandleInputAmount = __esm({
|
|
|
11515
11523
|
init_useBuyMenuStore();
|
|
11516
11524
|
ON_INPUT_QUERY_DELAY = 1500;
|
|
11517
11525
|
useHandleInputAmount = () => {
|
|
11518
|
-
const lastRampProviderRef =
|
|
11526
|
+
const lastRampProviderRef = useRef11(DEFAULT_PROVIDER2);
|
|
11519
11527
|
const rampProvider = useBuyMenuStore((st) => st.rampProvider);
|
|
11520
11528
|
const srcInputAmount = useBuyMenuStore((st) => st.srcInputAmount);
|
|
11521
11529
|
const minAmount = useBuyMenuStore((st) => st.minAmount);
|
|
11522
|
-
const queryAmountTimer =
|
|
11530
|
+
const queryAmountTimer = useRef11(null);
|
|
11523
11531
|
useEffect19(() => {
|
|
11524
11532
|
if (queryAmountTimer.current) clearTimeout(queryAmountTimer.current);
|
|
11525
11533
|
queryAmountTimer.current = setTimeout(() => {
|
|
@@ -12056,13 +12064,13 @@ import { PAYMASTER_CACHE_TTL_MS } from "@embarkai/core";
|
|
|
12056
12064
|
import { getChainConfig as getChainConfig8, SUPPORTED_MAINNETS as SUPPORTED_MAINNETS2 } from "@embarkai/core/read";
|
|
12057
12065
|
import { useQuery as useQuery5 } from "@tanstack/react-query";
|
|
12058
12066
|
import { ArrowLeft as ArrowLeft4 } from "lucide-react";
|
|
12059
|
-
import { useMemo as useMemo5, useState as
|
|
12067
|
+
import { useMemo as useMemo5, useState as useState9 } from "react";
|
|
12060
12068
|
import { jsx as jsx54, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
12061
12069
|
function ChainsMenu() {
|
|
12062
12070
|
const config = useProviderConfig().config;
|
|
12063
12071
|
const activeChainId = useSession((st) => st.activeChainId);
|
|
12064
|
-
const [isTestnets, setIsTestnets] =
|
|
12065
|
-
const [nextChainId, setNextChainId] =
|
|
12072
|
+
const [isTestnets, setIsTestnets] = useState9(false);
|
|
12073
|
+
const [nextChainId, setNextChainId] = useState9(null);
|
|
12066
12074
|
const { t } = useT();
|
|
12067
12075
|
const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
|
|
12068
12076
|
const visibleNetworks = useMemo5(() => {
|
|
@@ -12311,7 +12319,7 @@ var init_devices = __esm({
|
|
|
12311
12319
|
});
|
|
12312
12320
|
|
|
12313
12321
|
// src/internal/components/DevicesMenu/DeviceLinkScreen.tsx
|
|
12314
|
-
import { useState as
|
|
12322
|
+
import { useState as useState10 } from "react";
|
|
12315
12323
|
import { ArrowLeft as ArrowLeft6, Loader2 as Loader22 } from "lucide-react";
|
|
12316
12324
|
import { jsx as jsx56, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
12317
12325
|
function getErrorMessage(err) {
|
|
@@ -12333,8 +12341,8 @@ function DeviceLinkScreen() {
|
|
|
12333
12341
|
const setPage = useLayoutDataStore((s) => s.setPage);
|
|
12334
12342
|
const maxScrollHeight = useLayoutStore((s) => s.maxScrollHeight);
|
|
12335
12343
|
const { mutate: link, isPending } = useLinkDevice();
|
|
12336
|
-
const [code, setCode] =
|
|
12337
|
-
const [error, setError] =
|
|
12344
|
+
const [code, setCode] = useState10("");
|
|
12345
|
+
const [error, setError] = useState10(null);
|
|
12338
12346
|
const isValid = code.length === 6 && VALID_CHARS.test(code);
|
|
12339
12347
|
function handleCodeChange(value) {
|
|
12340
12348
|
const upper = value.toUpperCase().slice(0, 6);
|
|
@@ -12923,7 +12931,7 @@ var init_guardian_backup = __esm({
|
|
|
12923
12931
|
});
|
|
12924
12932
|
|
|
12925
12933
|
// src/internal/components/DevicesMenu/DeviceManageScreen.tsx
|
|
12926
|
-
import { useCallback as useCallback14, useEffect as useEffect20, useRef as
|
|
12934
|
+
import { useCallback as useCallback14, useEffect as useEffect20, useRef as useRef12, useState as useState11 } from "react";
|
|
12927
12935
|
import { ArrowLeft as ArrowLeft7, Cpu, Download, HardDrive, Loader2 as Loader23, Trash2, Upload } from "lucide-react";
|
|
12928
12936
|
import { Fragment as Fragment15, jsx as jsx57, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
12929
12937
|
function formatSize(bytes) {
|
|
@@ -12938,13 +12946,13 @@ function DeviceManageScreen() {
|
|
|
12938
12946
|
const userId = session?.mpcUserId || "";
|
|
12939
12947
|
const deviceId = pageParams?.deviceId;
|
|
12940
12948
|
const deviceName = pageParams?.deviceName;
|
|
12941
|
-
const guardianRef =
|
|
12942
|
-
const [screen, setScreen] =
|
|
12943
|
-
const [actionState, setActionState] =
|
|
12944
|
-
const [password, setPassword] =
|
|
12945
|
-
const [statusMessage, setStatusMessage] =
|
|
12946
|
-
const [errorMessage, setErrorMessage] =
|
|
12947
|
-
const [waitingConfirm, setWaitingConfirm] =
|
|
12949
|
+
const guardianRef = useRef12(null);
|
|
12950
|
+
const [screen, setScreen] = useState11({ step: "connecting" });
|
|
12951
|
+
const [actionState, setActionState] = useState11(null);
|
|
12952
|
+
const [password, setPassword] = useState11("");
|
|
12953
|
+
const [statusMessage, setStatusMessage] = useState11(null);
|
|
12954
|
+
const [errorMessage, setErrorMessage] = useState11(null);
|
|
12955
|
+
const [waitingConfirm, setWaitingConfirm] = useState11(false);
|
|
12948
12956
|
useEffect20(() => {
|
|
12949
12957
|
if (!statusMessage) return;
|
|
12950
12958
|
const t = setTimeout(() => setStatusMessage(null), 3e3);
|
|
@@ -13215,7 +13223,7 @@ var init_DeviceManageScreen = __esm({
|
|
|
13215
13223
|
});
|
|
13216
13224
|
|
|
13217
13225
|
// src/internal/components/DevicesMenu/DeviceRestoreScreen.tsx
|
|
13218
|
-
import { useCallback as useCallback15, useState as
|
|
13226
|
+
import { useCallback as useCallback15, useState as useState12 } from "react";
|
|
13219
13227
|
import { AlertTriangle as AlertTriangle3, ArrowLeft as ArrowLeft8, Download as Download2, Loader2 as Loader24 } from "lucide-react";
|
|
13220
13228
|
import { Fragment as Fragment16, jsx as jsx58, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
13221
13229
|
function DeviceRestoreScreen() {
|
|
@@ -13227,10 +13235,10 @@ function DeviceRestoreScreen() {
|
|
|
13227
13235
|
const keyshareId = pageParams?.keyshareId;
|
|
13228
13236
|
const deviceId = pageParams?.deviceId;
|
|
13229
13237
|
const deviceName = pageParams?.deviceName;
|
|
13230
|
-
const [password, setPassword] =
|
|
13231
|
-
const [isWorking, setIsWorking] =
|
|
13232
|
-
const [statusMessage, setStatusMessage] =
|
|
13233
|
-
const [errorMessage, setErrorMessage] =
|
|
13238
|
+
const [password, setPassword] = useState12("");
|
|
13239
|
+
const [isWorking, setIsWorking] = useState12(false);
|
|
13240
|
+
const [statusMessage, setStatusMessage] = useState12(null);
|
|
13241
|
+
const [errorMessage, setErrorMessage] = useState12(null);
|
|
13234
13242
|
const handleRestore = useCallback15(async () => {
|
|
13235
13243
|
if (!password || !keyshareId || !userId) return;
|
|
13236
13244
|
const iframe4 = getIframeManager();
|
|
@@ -13331,7 +13339,7 @@ var init_DeviceRestoreScreen = __esm({
|
|
|
13331
13339
|
});
|
|
13332
13340
|
|
|
13333
13341
|
// src/internal/components/DevicesMenu/DevicesMenu.tsx
|
|
13334
|
-
import { useState as
|
|
13342
|
+
import { useState as useState13 } from "react";
|
|
13335
13343
|
import { ArrowLeft as ArrowLeft9, Cpu as Cpu2, Monitor, CheckCircle, Trash2 as Trash22, Loader2 as Loader25, RefreshCw, HardDrive as HardDrive2 } from "lucide-react";
|
|
13336
13344
|
import { jsx as jsx59, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
13337
13345
|
function DeviceIcon({ deviceType }) {
|
|
@@ -13343,8 +13351,8 @@ function truncateAddress(address) {
|
|
|
13343
13351
|
return `${address.slice(0, 6)}...${address.slice(-4)}`;
|
|
13344
13352
|
}
|
|
13345
13353
|
function DeviceRow({ device }) {
|
|
13346
|
-
const [confirmingUnlink, setConfirmingUnlink] =
|
|
13347
|
-
const [unlinkError, setUnlinkError] =
|
|
13354
|
+
const [confirmingUnlink, setConfirmingUnlink] = useState13(false);
|
|
13355
|
+
const [unlinkError, setUnlinkError] = useState13(null);
|
|
13348
13356
|
const { mutate: unlink, isPending } = useUnlinkDevice();
|
|
13349
13357
|
if (confirmingUnlink) {
|
|
13350
13358
|
return /* @__PURE__ */ jsxs53("div", { className: "flex flex-col gap-2 p-3 rounded-lg bg-[var(--ui-kit-bg)]", children: [
|
|
@@ -14518,7 +14526,7 @@ var init_MethodSelector = __esm({
|
|
|
14518
14526
|
|
|
14519
14527
|
// src/internal/components/KeyshareRestoreMenu/components/PasswordPasskey.tsx
|
|
14520
14528
|
import { ChevronRight as ChevronRight2, Eye, EyeOff, Info as Info3, Key as Key4, Loader as Loader8, Plus } from "lucide-react";
|
|
14521
|
-
import { useEffect as useEffect23, useRef as
|
|
14529
|
+
import { useEffect as useEffect23, useRef as useRef13 } from "react";
|
|
14522
14530
|
import { Fragment as Fragment18, jsx as jsx61, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
14523
14531
|
function PasswordPasskey(props) {
|
|
14524
14532
|
const { t } = useT();
|
|
@@ -14533,7 +14541,7 @@ function PasswordPasskey(props) {
|
|
|
14533
14541
|
onCreatePasskey
|
|
14534
14542
|
} = props;
|
|
14535
14543
|
const hasServerVault = useSession((st) => st.hasServerVault);
|
|
14536
|
-
const actionRef =
|
|
14544
|
+
const actionRef = useRef13(null);
|
|
14537
14545
|
const {
|
|
14538
14546
|
showPassword,
|
|
14539
14547
|
restorePassword,
|
|
@@ -15165,7 +15173,7 @@ var init_Cloud = __esm({
|
|
|
15165
15173
|
});
|
|
15166
15174
|
|
|
15167
15175
|
// src/internal/components/KeyshareRestoreMenu/methods/Guardian.tsx
|
|
15168
|
-
import { useState as
|
|
15176
|
+
import { useState as useState15 } from "react";
|
|
15169
15177
|
import { Cpu as Cpu4, Loader2 as Loader26 } from "lucide-react";
|
|
15170
15178
|
import { Fragment as Fragment23, jsx as jsx67, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
15171
15179
|
function Guardian(props) {
|
|
@@ -15174,8 +15182,8 @@ function Guardian(props) {
|
|
|
15174
15182
|
const session = useSession((st) => st.session);
|
|
15175
15183
|
const recoveryUserId = useSession((st) => st.recoveryUserId);
|
|
15176
15184
|
const { onRestoreSuccess } = useOnRestoreSuccess();
|
|
15177
|
-
const [isWorking, setIsWorking] =
|
|
15178
|
-
const [step, setStep] =
|
|
15185
|
+
const [isWorking, setIsWorking] = useState15(false);
|
|
15186
|
+
const [step, setStep] = useState15("idle");
|
|
15179
15187
|
const handleGuardianBackup = async () => {
|
|
15180
15188
|
if (!restorePassword) {
|
|
15181
15189
|
setError("Please enter a password");
|
|
@@ -15868,15 +15876,15 @@ var init_SumsubIframeManager = __esm({
|
|
|
15868
15876
|
});
|
|
15869
15877
|
|
|
15870
15878
|
// src/internal/components/KYC/useSumsubIframe.ts
|
|
15871
|
-
import { useEffect as useEffect29, useRef as
|
|
15879
|
+
import { useEffect as useEffect29, useRef as useRef14, useState as useState16 } from "react";
|
|
15872
15880
|
function useSumsubIframe({ iframeUrl }) {
|
|
15873
15881
|
const config = useProviderConfig().config;
|
|
15874
15882
|
const { colorMode } = useColorMode();
|
|
15875
|
-
const iframeRef =
|
|
15876
|
-
const [isLoading, setIsLoading] =
|
|
15877
|
-
const [error, setError] =
|
|
15878
|
-
const [height, setHeight] =
|
|
15879
|
-
const [status, setStatus] =
|
|
15883
|
+
const iframeRef = useRef14(null);
|
|
15884
|
+
const [isLoading, setIsLoading] = useState16(true);
|
|
15885
|
+
const [error, setError] = useState16(null);
|
|
15886
|
+
const [height, setHeight] = useState16(0);
|
|
15887
|
+
const [status, setStatus] = useState16("");
|
|
15880
15888
|
const levelName = config.current?.kyc?.options?.levelName;
|
|
15881
15889
|
useEffect29(() => {
|
|
15882
15890
|
setError(null);
|
|
@@ -16911,7 +16919,7 @@ var init_telegram2 = __esm({
|
|
|
16911
16919
|
|
|
16912
16920
|
// src/internal/components/ManageWalletMenu/hooks/useLinkTelegram.ts
|
|
16913
16921
|
import { useQueryClient as useQueryClient16 } from "@tanstack/react-query";
|
|
16914
|
-
import { useCallback as useCallback20, useEffect as useEffect32, useState as
|
|
16922
|
+
import { useCallback as useCallback20, useEffect as useEffect32, useState as useState17 } from "react";
|
|
16915
16923
|
function useLinkTelegram() {
|
|
16916
16924
|
const {
|
|
16917
16925
|
config: { current: config },
|
|
@@ -16969,7 +16977,7 @@ function useLinkTelegram() {
|
|
|
16969
16977
|
setLinkIsLoading(false);
|
|
16970
16978
|
}
|
|
16971
16979
|
}, [config.social?.providers]);
|
|
16972
|
-
const [telegramLinkStarted, setTelegramLinkStarted] =
|
|
16980
|
+
const [telegramLinkStarted, setTelegramLinkStarted] = useState17(false);
|
|
16973
16981
|
useEffect32(() => {
|
|
16974
16982
|
console.log("[useLinkTelegram] Effect triggered:", {
|
|
16975
16983
|
providerType,
|
|
@@ -17290,7 +17298,7 @@ var init_ManageWallet = __esm({
|
|
|
17290
17298
|
// src/internal/components/ManageWalletMenu/UnlinkProviderMenu.tsx
|
|
17291
17299
|
import { useMutation as useMutation15, useQueryClient as useQueryClient17 } from "@tanstack/react-query";
|
|
17292
17300
|
import { Key as Key6, Loader as Loader14 } from "lucide-react";
|
|
17293
|
-
import { useState as
|
|
17301
|
+
import { useState as useState18 } from "react";
|
|
17294
17302
|
import { useDisconnect as useDisconnect2 } from "wagmi";
|
|
17295
17303
|
import { jsx as jsx80, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
17296
17304
|
function UnlinkProviderMenu() {
|
|
@@ -17302,7 +17310,7 @@ function UnlinkProviderMenu() {
|
|
|
17302
17310
|
const { t } = useT();
|
|
17303
17311
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
17304
17312
|
const { confirmUnlink, setConfirmUnlink, setAlert } = useManageWalletStore();
|
|
17305
|
-
const [confirmInput, setConfirmInput] =
|
|
17313
|
+
const [confirmInput, setConfirmInput] = useState18("");
|
|
17306
17314
|
const { mutate: handleUnlinkProvider, isPending: isProviderUnlinking } = useMutation15({
|
|
17307
17315
|
mutationFn: async () => {
|
|
17308
17316
|
if (!confirmUnlink) {
|
|
@@ -17563,7 +17571,7 @@ var init_useNicknameAvailability = __esm({
|
|
|
17563
17571
|
// src/internal/components/NicknameMenu/NicknameEditForm.tsx
|
|
17564
17572
|
import { useMutation as useMutation17, useQueryClient as useQueryClient18 } from "@tanstack/react-query";
|
|
17565
17573
|
import { AtSignIcon, CheckIcon as CheckIcon2, CopyIcon, LoaderIcon as LoaderIcon7, SaveIcon } from "lucide-react";
|
|
17566
|
-
import { useCallback as useCallback22, useState as
|
|
17574
|
+
import { useCallback as useCallback22, useState as useState19 } from "react";
|
|
17567
17575
|
import { Fragment as Fragment29, jsx as jsx81, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
17568
17576
|
function NicknameEditForm(props) {
|
|
17569
17577
|
const { isInitialUser, nicknameInfo } = props;
|
|
@@ -17576,7 +17584,7 @@ function NicknameEditForm(props) {
|
|
|
17576
17584
|
const nicknameValue = useNicknameStore((st) => st.nicknameValue);
|
|
17577
17585
|
const nicknameAvailability = useNicknameStore((st) => st.availability);
|
|
17578
17586
|
const { isCheckingAvailability } = useNicknameAvailability(nicknameInfo ? nicknameInfo.handle : "");
|
|
17579
|
-
const [isNicknameCopied, setIsNicknameCopied] =
|
|
17587
|
+
const [isNicknameCopied, setIsNicknameCopied] = useState19(false);
|
|
17580
17588
|
const {
|
|
17581
17589
|
mutate: changeNickname2,
|
|
17582
17590
|
isError: isNicknameChangeError,
|
|
@@ -18160,7 +18168,7 @@ var init_utils8 = __esm({
|
|
|
18160
18168
|
// src/internal/hooks/useBlockscoutAssets/useBlockscoutAssets.ts
|
|
18161
18169
|
import { createBlockscoutClient as createBlockscoutClient2, nonBlockscoutClient } from "@embarkai/core";
|
|
18162
18170
|
import { useQuery as useQuery16, useQueryClient as useQueryClient19 } from "@tanstack/react-query";
|
|
18163
|
-
import { useCallback as useCallback23, useMemo as useMemo10, useRef as
|
|
18171
|
+
import { useCallback as useCallback23, useMemo as useMemo10, useRef as useRef15 } from "react";
|
|
18164
18172
|
function useBlockscoutAssets(options) {
|
|
18165
18173
|
const { address, chainId, enabled = true, detectSecurityTokens = true } = options;
|
|
18166
18174
|
const qc = useQueryClient19();
|
|
@@ -18175,7 +18183,7 @@ function useBlockscoutAssets(options) {
|
|
|
18175
18183
|
() => blockscoutApiUrl ? createBlockscoutClient2({ baseUrl: blockscoutApiUrl }) : null,
|
|
18176
18184
|
[blockscoutApiUrl]
|
|
18177
18185
|
);
|
|
18178
|
-
const lastRefreshRef =
|
|
18186
|
+
const lastRefreshRef = useRef15(0);
|
|
18179
18187
|
const {
|
|
18180
18188
|
data: watchTokenAssets = [],
|
|
18181
18189
|
isLoading: watchTokensLoading,
|
|
@@ -18891,7 +18899,7 @@ var init_nickname_fingerprint = __esm({
|
|
|
18891
18899
|
// src/internal/components/ReceiveMenu/ReceiveMenu.tsx
|
|
18892
18900
|
import { ArrowLeft as ArrowLeft17, CheckCircle2 as CheckCircle23, Copy as Copy2, Info as Info5, Loader as Loader17, Shield } from "lucide-react";
|
|
18893
18901
|
import QRCode from "qrcode";
|
|
18894
|
-
import { useCallback as useCallback25, useEffect as useEffect34, useMemo as useMemo11, useState as
|
|
18902
|
+
import { useCallback as useCallback25, useEffect as useEffect34, useMemo as useMemo11, useState as useState20 } from "react";
|
|
18895
18903
|
import { Fragment as Fragment31, jsx as jsx86, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
18896
18904
|
function ReceiveMenu() {
|
|
18897
18905
|
const session = useSession((st) => st.session);
|
|
@@ -18902,9 +18910,9 @@ function ReceiveMenu() {
|
|
|
18902
18910
|
const { t } = useT();
|
|
18903
18911
|
const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
|
|
18904
18912
|
const open = page === "receive";
|
|
18905
|
-
const [qrCodeUrl, setQrCodeUrl] =
|
|
18906
|
-
const [copied, setCopied] =
|
|
18907
|
-
const [fingerprintCopied, setFingerprintCopied] =
|
|
18913
|
+
const [qrCodeUrl, setQrCodeUrl] = useState20("");
|
|
18914
|
+
const [copied, setCopied] = useState20(false);
|
|
18915
|
+
const [fingerprintCopied, setFingerprintCopied] = useState20(false);
|
|
18908
18916
|
const fingerprint = useMemo11(() => {
|
|
18909
18917
|
if (!session?.ownerAddress) return null;
|
|
18910
18918
|
try {
|
|
@@ -19849,7 +19857,7 @@ var init_useBridgeStore = __esm({
|
|
|
19849
19857
|
// src/internal/components/SendMenu/hyperbridge/components/SenderSelector.tsx
|
|
19850
19858
|
import { useConnectModal } from "@rainbow-me/rainbowkit";
|
|
19851
19859
|
import { useMutation as useMutation19 } from "@tanstack/react-query";
|
|
19852
|
-
import { useEffect as useEffect37, useRef as
|
|
19860
|
+
import { useEffect as useEffect37, useRef as useRef16, useState as useState21 } from "react";
|
|
19853
19861
|
import { useSignMessage } from "wagmi";
|
|
19854
19862
|
import { jsx as jsx93, jsxs as jsxs87 } from "react/jsx-runtime";
|
|
19855
19863
|
function SenderSelector(props) {
|
|
@@ -19860,11 +19868,11 @@ function SenderSelector(props) {
|
|
|
19860
19868
|
const { openConnectModal } = useConnectModal();
|
|
19861
19869
|
const directWalletAddress = useExternalWalletStore((st) => st.externalAddress);
|
|
19862
19870
|
const directWalletIsConnected = useExternalWalletStore((st) => st.isExternalConnected);
|
|
19863
|
-
const pendingWalletRef =
|
|
19871
|
+
const pendingWalletRef = useRef16(null);
|
|
19864
19872
|
const originChain = useBridgeStore((st) => st.originChain);
|
|
19865
19873
|
const bridgeSender = useBridgeStore((st) => st.bridgeSender);
|
|
19866
19874
|
const bridgeSenders = useBridgeStore((st) => st.bridgeSenders);
|
|
19867
|
-
const [walletMessage, setWalletMessage] =
|
|
19875
|
+
const [walletMessage, setWalletMessage] = useState21(null);
|
|
19868
19876
|
useEffect37(() => {
|
|
19869
19877
|
useFlowSelectorStore.getState().setRenderKey(`sender-selected-${Date.now()}`);
|
|
19870
19878
|
}, [walletMessage]);
|
|
@@ -20094,11 +20102,11 @@ var init_wallets = __esm({
|
|
|
20094
20102
|
});
|
|
20095
20103
|
|
|
20096
20104
|
// src/internal/components/SendMenu/hyperbridge/hooks/useAvailableSenders.ts
|
|
20097
|
-
import { useEffect as useEffect38, useRef as
|
|
20105
|
+
import { useEffect as useEffect38, useRef as useRef17 } from "react";
|
|
20098
20106
|
function useAvailableSenders() {
|
|
20099
20107
|
const address = useSession((st) => st.address);
|
|
20100
20108
|
const { profiles } = useLinkedProfiles();
|
|
20101
|
-
const lastCalcedSenders =
|
|
20109
|
+
const lastCalcedSenders = useRef17([]);
|
|
20102
20110
|
useEffect38(() => {
|
|
20103
20111
|
const sendersAccumulator = [
|
|
20104
20112
|
{
|
|
@@ -21294,11 +21302,11 @@ var init_checkbox = __esm({
|
|
|
21294
21302
|
|
|
21295
21303
|
// src/internal/components/SendMenu/hyperbridge/steps/ConfirmStep.tsx
|
|
21296
21304
|
import { LoaderIcon as LoaderIcon12 } from "lucide-react";
|
|
21297
|
-
import { useState as
|
|
21305
|
+
import { useState as useState22 } from "react";
|
|
21298
21306
|
import { jsx as jsx99, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
21299
21307
|
function ConfirmStep(props) {
|
|
21300
21308
|
const { isAssetBridging, bridgeAsset, hyperlaneWarpRoutes } = props;
|
|
21301
|
-
const [userConsent, setUserConsent] =
|
|
21309
|
+
const [userConsent, setUserConsent] = useState22(false);
|
|
21302
21310
|
const { t } = useT();
|
|
21303
21311
|
const address = useSession((st) => st.address);
|
|
21304
21312
|
const bridgeSender = useBridgeStore((st) => st.bridgeSenders.find((s) => s.type === st.bridgeSender));
|
|
@@ -21783,12 +21791,12 @@ var init_HistoryStep = __esm({
|
|
|
21783
21791
|
|
|
21784
21792
|
// src/internal/components/SendMenu/hyperbridge/steps/SelectAssetRoute.tsx
|
|
21785
21793
|
import { ArrowLeftRightIcon as ArrowLeftRightIcon2 } from "lucide-react";
|
|
21786
|
-
import { useMemo as useMemo13, useState as
|
|
21794
|
+
import { useMemo as useMemo13, useState as useState23 } from "react";
|
|
21787
21795
|
import { Fragment as Fragment38, jsx as jsx102, jsxs as jsxs94 } from "react/jsx-runtime";
|
|
21788
21796
|
function SelectAssetRoute(props) {
|
|
21789
21797
|
const { hyperlaneWarpRoutes } = props;
|
|
21790
21798
|
const { t } = useT();
|
|
21791
|
-
const [isTokenSymbolSelector, setIsTokenSymbolSelector] =
|
|
21799
|
+
const [isTokenSymbolSelector, setIsTokenSymbolSelector] = useState23(false);
|
|
21792
21800
|
const selectedAssetSymbol = useBridgeStore((st) => st.bridgeAssetSymbol);
|
|
21793
21801
|
const tokenList = useMemo13(() => {
|
|
21794
21802
|
const tokens = hyperlaneWarpRoutes.map((route) => route.symbol);
|
|
@@ -21965,14 +21973,14 @@ var init_HyperlaneBridge = __esm({
|
|
|
21965
21973
|
});
|
|
21966
21974
|
|
|
21967
21975
|
// src/internal/components/SendMenu/hyperbridge/components/HistorySwitch.tsx
|
|
21968
|
-
import { useRef as
|
|
21976
|
+
import { useRef as useRef18 } from "react";
|
|
21969
21977
|
import { jsx as jsx104 } from "react/jsx-runtime";
|
|
21970
21978
|
function BridgeHistorySwitch(props) {
|
|
21971
21979
|
const { disabled } = props;
|
|
21972
21980
|
const selectorFlow = useFlowSelectorStore((st) => st.flow);
|
|
21973
21981
|
const isUiLocked = useFlowSelectorStore((st) => st.isUiLocked);
|
|
21974
21982
|
const bridgeStep = useBridgeStore((st) => st.bridgeStep);
|
|
21975
|
-
const lastBridgeStepRef =
|
|
21983
|
+
const lastBridgeStepRef = useRef18(null);
|
|
21976
21984
|
if (selectorFlow !== "bridge" || bridgeStep === "confirm" || bridgeStep === "success" || bridgeStep === "sender-selector" || bridgeStep === "select-token" || bridgeStep === "tx-history-details") {
|
|
21977
21985
|
return null;
|
|
21978
21986
|
}
|
|
@@ -22074,7 +22082,7 @@ var init_useErc3643Compliance = __esm({
|
|
|
22074
22082
|
|
|
22075
22083
|
// src/hooks/useNicknameResolve.ts
|
|
22076
22084
|
import { useQuery as useQuery22 } from "@tanstack/react-query";
|
|
22077
|
-
import { useEffect as useEffect44, useMemo as useMemo14, useState as
|
|
22085
|
+
import { useEffect as useEffect44, useMemo as useMemo14, useState as useState24 } from "react";
|
|
22078
22086
|
function looksLikeNickname(input) {
|
|
22079
22087
|
if (!input) return false;
|
|
22080
22088
|
if (input.startsWith("0x")) return false;
|
|
@@ -22084,8 +22092,8 @@ function looksLikeNickname(input) {
|
|
|
22084
22092
|
}
|
|
22085
22093
|
function useNicknameResolve(input, options) {
|
|
22086
22094
|
const { enabled = true, chainId } = options;
|
|
22087
|
-
const [debouncedInput, setDebouncedInput] =
|
|
22088
|
-
const [isDebouncing, setIsDebouncing] =
|
|
22095
|
+
const [debouncedInput, setDebouncedInput] = useState24("");
|
|
22096
|
+
const [isDebouncing, setIsDebouncing] = useState24(false);
|
|
22089
22097
|
const normalized = normalizeNickname(input);
|
|
22090
22098
|
const isNicknameInput = looksLikeNickname(input) && normalized.length >= 3;
|
|
22091
22099
|
useEffect44(() => {
|
|
@@ -22148,14 +22156,14 @@ var init_useNicknameResolve = __esm({
|
|
|
22148
22156
|
});
|
|
22149
22157
|
|
|
22150
22158
|
// src/hooks/useSendTransaction.ts
|
|
22151
|
-
import { useCallback as useCallback29, useState as
|
|
22159
|
+
import { useCallback as useCallback29, useState as useState25 } from "react";
|
|
22152
22160
|
import { encodeFunctionData as encodeFunctionData2, isAddress, parseEther as parseEther2, parseUnits } from "viem";
|
|
22153
22161
|
function useSendTransaction() {
|
|
22154
22162
|
const session = useSession((st) => st.session);
|
|
22155
22163
|
const address = useSession((st) => st.address);
|
|
22156
|
-
const [isLoading, setIsLoading] =
|
|
22157
|
-
const [error, setError] =
|
|
22158
|
-
const [userOpHash, setUserOpHash] =
|
|
22164
|
+
const [isLoading, setIsLoading] = useState25(false);
|
|
22165
|
+
const [error, setError] = useState25(null);
|
|
22166
|
+
const [userOpHash, setUserOpHash] = useState25(null);
|
|
22159
22167
|
const sendTransaction = useCallback29(
|
|
22160
22168
|
async (params) => {
|
|
22161
22169
|
if (!session || !address) {
|
|
@@ -22408,10 +22416,10 @@ var init_AssetInputIcon = __esm({
|
|
|
22408
22416
|
|
|
22409
22417
|
// src/internal/components/SendMenu/send/components/NftDisplayCard.tsx
|
|
22410
22418
|
import { Image as ImageIcon2, Sparkles as Sparkles2 } from "lucide-react";
|
|
22411
|
-
import { useState as
|
|
22419
|
+
import { useState as useState26 } from "react";
|
|
22412
22420
|
import { jsx as jsx106, jsxs as jsxs97 } from "react/jsx-runtime";
|
|
22413
22421
|
function NftDisplayCard({ asset }) {
|
|
22414
|
-
const [imageError, setImageError] =
|
|
22422
|
+
const [imageError, setImageError] = useState26(false);
|
|
22415
22423
|
const nftImage = asset.image || asset.nftMetadata?.image;
|
|
22416
22424
|
return /* @__PURE__ */ jsxs97("div", { className: "flex items-center gap-3 p-3 rounded-[var(--ui-kit-el-bdrs)] bg-[var(--ui-kit-bg-secondary)]", children: [
|
|
22417
22425
|
nftImage && !imageError ? /* @__PURE__ */ jsx106(
|
|
@@ -24529,7 +24537,7 @@ var init_TransactionsGroup = __esm({
|
|
|
24529
24537
|
// src/internal/components/TransactionsMenu/TransactionsMenu.tsx
|
|
24530
24538
|
import { useQuery as useQuery25, useQueryClient as useQueryClient25 } from "@tanstack/react-query";
|
|
24531
24539
|
import { ArrowLeft as ArrowLeft22, Loader as Loader28, RefreshCw as RefreshCw3, XCircle } from "lucide-react";
|
|
24532
|
-
import { useCallback as useCallback30, useState as
|
|
24540
|
+
import { useCallback as useCallback30, useState as useState27 } from "react";
|
|
24533
24541
|
import { jsx as jsx116, jsxs as jsxs107 } from "react/jsx-runtime";
|
|
24534
24542
|
function TransactionsMenu() {
|
|
24535
24543
|
const qc = useQueryClient25();
|
|
@@ -24538,7 +24546,7 @@ function TransactionsMenu() {
|
|
|
24538
24546
|
const { t } = useT();
|
|
24539
24547
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
24540
24548
|
const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
|
|
24541
|
-
const [expandedGroups, setExpandedGroups] =
|
|
24549
|
+
const [expandedGroups, setExpandedGroups] = useState27({});
|
|
24542
24550
|
const historySupported = isTransactionHistorySupported(chainConfig?.id);
|
|
24543
24551
|
const {
|
|
24544
24552
|
data: txHistoryGroups = [],
|
|
@@ -24891,7 +24899,7 @@ var init_package = __esm({
|
|
|
24891
24899
|
"package.json"() {
|
|
24892
24900
|
package_default = {
|
|
24893
24901
|
name: "@embarkai/ui-kit",
|
|
24894
|
-
version: "0.4.
|
|
24902
|
+
version: "0.4.72",
|
|
24895
24903
|
description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
|
|
24896
24904
|
type: "module",
|
|
24897
24905
|
main: "./dist/index.cjs",
|
|
@@ -25134,7 +25142,7 @@ var init_Footer2 = __esm({
|
|
|
25134
25142
|
|
|
25135
25143
|
// src/internal/components/Header/Header.tsx
|
|
25136
25144
|
import { Copy as Copy4, Loader as Loader30 } from "lucide-react";
|
|
25137
|
-
import { useCallback as useCallback32, useRef as
|
|
25145
|
+
import { useCallback as useCallback32, useRef as useRef19, useState as useState28 } from "react";
|
|
25138
25146
|
import { Fragment as Fragment45, jsx as jsx119, jsxs as jsxs109 } from "react/jsx-runtime";
|
|
25139
25147
|
function formatAddress2(addr) {
|
|
25140
25148
|
if (!addr) return "";
|
|
@@ -25146,10 +25154,10 @@ function Header() {
|
|
|
25146
25154
|
const chainConfig = useSession((st) => st.chainConfig);
|
|
25147
25155
|
const { t } = useT();
|
|
25148
25156
|
const proMode = useProMode();
|
|
25149
|
-
const [proToast, setProToast] =
|
|
25150
|
-
const [copied, setCopied] =
|
|
25151
|
-
const clickCountRef =
|
|
25152
|
-
const clickTimerRef =
|
|
25157
|
+
const [proToast, setProToast] = useState28(false);
|
|
25158
|
+
const [copied, setCopied] = useState28(false);
|
|
25159
|
+
const clickCountRef = useRef19(0);
|
|
25160
|
+
const clickTimerRef = useRef19(null);
|
|
25153
25161
|
const handleAvatarClick = useCallback32(() => {
|
|
25154
25162
|
clickCountRef.current += 1;
|
|
25155
25163
|
if (clickTimerRef.current) {
|
|
@@ -28750,7 +28758,7 @@ import {
|
|
|
28750
28758
|
useContext,
|
|
28751
28759
|
useEffect as useEffect54,
|
|
28752
28760
|
useMemo as useMemo17,
|
|
28753
|
-
useRef as
|
|
28761
|
+
useRef as useRef20
|
|
28754
28762
|
} from "react";
|
|
28755
28763
|
import { jsx as jsx126 } from "react/jsx-runtime";
|
|
28756
28764
|
function clearLegacyWagmiStorage() {
|
|
@@ -28770,9 +28778,9 @@ function clearLegacyWagmiStorage() {
|
|
|
28770
28778
|
}
|
|
28771
28779
|
function Provider(props) {
|
|
28772
28780
|
const { children, projectId, initialConfig = {}, callbacks } = props;
|
|
28773
|
-
const callbacksRef =
|
|
28781
|
+
const callbacksRef = useRef20(callbacks);
|
|
28774
28782
|
useEffect54(() => notifyNoProjetctId(projectId), [projectId]);
|
|
28775
|
-
const config =
|
|
28783
|
+
const config = useRef20(merge3({}, DEFAULT_PROVIDER_CONFIG, { projectId }, initialConfig));
|
|
28776
28784
|
const updateConfig = useCallback35((updates) => {
|
|
28777
28785
|
const prev = config.current;
|
|
28778
28786
|
const next = { ...prev };
|
|
@@ -29587,12 +29595,12 @@ var Hash = ({
|
|
|
29587
29595
|
|
|
29588
29596
|
// src/internal/components/TransactionsMenu/TransactionsList.tsx
|
|
29589
29597
|
init_base2();
|
|
29590
|
-
import { useEffect as useEffect57, useState as
|
|
29598
|
+
import { useEffect as useEffect57, useState as useState32 } from "react";
|
|
29591
29599
|
import { jsx as jsx133, jsxs as jsxs117 } from "react/jsx-runtime";
|
|
29592
29600
|
var TransactionsList = ({ address, itemsCount = 10 }) => {
|
|
29593
|
-
const [transactions, setTransactions] =
|
|
29594
|
-
const [loading, setLoading] =
|
|
29595
|
-
const [error, setError] =
|
|
29601
|
+
const [transactions, setTransactions] = useState32([]);
|
|
29602
|
+
const [loading, setLoading] = useState32(true);
|
|
29603
|
+
const [error, setError] = useState32(null);
|
|
29596
29604
|
useEffect57(() => {
|
|
29597
29605
|
const fetchTransactions2 = async () => {
|
|
29598
29606
|
try {
|
|
@@ -29943,7 +29951,7 @@ function useDirectWallet() {
|
|
|
29943
29951
|
|
|
29944
29952
|
// src/hooks/useSendDirectTransaction.ts
|
|
29945
29953
|
init_useExternalWalletStore();
|
|
29946
|
-
import { useCallback as useCallback40, useState as
|
|
29954
|
+
import { useCallback as useCallback40, useState as useState34 } from "react";
|
|
29947
29955
|
import { isAddress as isAddress3, parseEther as parseEther3 } from "viem";
|
|
29948
29956
|
import { useSendTransaction as useWagmiSendTransaction, useSwitchChain as useSwitchChain3 } from "wagmi";
|
|
29949
29957
|
function useSendDirectTransaction() {
|
|
@@ -29951,9 +29959,9 @@ function useSendDirectTransaction() {
|
|
|
29951
29959
|
const externalChainId = useExternalWalletStore((st) => st.externalChainId);
|
|
29952
29960
|
const { sendTransactionAsync } = useWagmiSendTransaction();
|
|
29953
29961
|
const { switchChainAsync } = useSwitchChain3();
|
|
29954
|
-
const [isPending, setIsPending] =
|
|
29955
|
-
const [error, setError] =
|
|
29956
|
-
const [txHash, setTxHash] =
|
|
29962
|
+
const [isPending, setIsPending] = useState34(false);
|
|
29963
|
+
const [error, setError] = useState34(null);
|
|
29964
|
+
const [txHash, setTxHash] = useState34(null);
|
|
29957
29965
|
const sendTransaction = useCallback40(
|
|
29958
29966
|
async (params) => {
|
|
29959
29967
|
if (!isConnected) {
|
|
@@ -30000,7 +30008,7 @@ function useSendDirectTransaction() {
|
|
|
30000
30008
|
init_SessionContext();
|
|
30001
30009
|
init_account2();
|
|
30002
30010
|
init_linkedProfiles();
|
|
30003
|
-
import { useCallback as useCallback41, useMemo as useMemo19, useState as
|
|
30011
|
+
import { useCallback as useCallback41, useMemo as useMemo19, useState as useState35 } from "react";
|
|
30004
30012
|
import { encodeFunctionData as encodeFunctionData3, isAddress as isAddress4, parseEther as parseEther4, parseUnits as parseUnits3 } from "viem";
|
|
30005
30013
|
var ERC20_TRANSFER_ABI2 = [
|
|
30006
30014
|
{
|
|
@@ -30016,9 +30024,9 @@ var ERC20_TRANSFER_ABI2 = [
|
|
|
30016
30024
|
function useTransferToLinkedWallet() {
|
|
30017
30025
|
const session = useSession((st) => st.session);
|
|
30018
30026
|
const { profiles } = useLinkedProfiles();
|
|
30019
|
-
const [isPending, setIsPending] =
|
|
30020
|
-
const [error, setError] =
|
|
30021
|
-
const [userOpHash, setUserOpHash] =
|
|
30027
|
+
const [isPending, setIsPending] = useState35(false);
|
|
30028
|
+
const [error, setError] = useState35(null);
|
|
30029
|
+
const [userOpHash, setUserOpHash] = useState35(null);
|
|
30022
30030
|
const linkedWallets = useMemo19(
|
|
30023
30031
|
() => (profiles || []).filter((p) => p.provider === "wallet" && p.externalId).map((p) => p.externalId),
|
|
30024
30032
|
[profiles]
|