@embarkai/ui-kit 0.4.82 → 0.4.84
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 +281 -312
- package/dist/index.d.cts +51 -2
- package/dist/index.d.ts +51 -2
- package/dist/index.js +170 -202
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -7176,13 +7176,13 @@ var init_useAuthStore = __esm({
|
|
|
7176
7176
|
step: "signin",
|
|
7177
7177
|
alert: null,
|
|
7178
7178
|
email: "",
|
|
7179
|
-
|
|
7179
|
+
emailChallenge: null,
|
|
7180
7180
|
codeSendError: null,
|
|
7181
7181
|
passkeyStatus: "idle",
|
|
7182
7182
|
failedType: "general",
|
|
7183
7183
|
setStep: (step) => set({ step }),
|
|
7184
7184
|
setEmail: (email) => set({ email }),
|
|
7185
|
-
|
|
7185
|
+
setEmailChallenge: (emailChallenge) => set({ emailChallenge }),
|
|
7186
7186
|
setPasskeyStatus: (status) => set({ passkeyStatus: status }),
|
|
7187
7187
|
setAlert: (alert2) => set({ alert: alert2 }),
|
|
7188
7188
|
setFailedType: (type) => set({ failedType: type })
|
|
@@ -7746,6 +7746,23 @@ var init_input = __esm({
|
|
|
7746
7746
|
}
|
|
7747
7747
|
});
|
|
7748
7748
|
|
|
7749
|
+
// src/internal/components/AuthMenu/emailChallenge.ts
|
|
7750
|
+
var normalizeChallengeEmail, createEmailChallenge, isEmailChallengeActive, shouldDiscardEmailChallengeForError;
|
|
7751
|
+
var init_emailChallenge = __esm({
|
|
7752
|
+
"src/internal/components/AuthMenu/emailChallenge.ts"() {
|
|
7753
|
+
normalizeChallengeEmail = (email) => email.trim().toLowerCase();
|
|
7754
|
+
createEmailChallenge = (email, expiresIn, now = Date.now()) => ({
|
|
7755
|
+
email: normalizeChallengeEmail(email),
|
|
7756
|
+
expiresAt: now + Math.max(0, expiresIn) * 1e3
|
|
7757
|
+
});
|
|
7758
|
+
isEmailChallengeActive = (challenge, email, now = Date.now()) => challenge !== null && challenge.email === normalizeChallengeEmail(email) && challenge.expiresAt > now;
|
|
7759
|
+
shouldDiscardEmailChallengeForError = (message) => {
|
|
7760
|
+
const normalizedMessage = message.toLowerCase();
|
|
7761
|
+
return normalizedMessage.includes("expired") || normalizedMessage.includes("429") || normalizedMessage.includes("too many") || normalizedMessage.includes("code_not_found") || normalizedMessage.includes("no verification code");
|
|
7762
|
+
};
|
|
7763
|
+
}
|
|
7764
|
+
});
|
|
7765
|
+
|
|
7749
7766
|
// src/internal/components/AuthMenu/SignInStep/Email.tsx
|
|
7750
7767
|
function Email() {
|
|
7751
7768
|
const { callbacksRef } = useProviderConfig();
|
|
@@ -7756,7 +7773,7 @@ function Email() {
|
|
|
7756
7773
|
const isLoading = useSession((st) => st.isLoading);
|
|
7757
7774
|
const setIsLoading = useSession((st) => st.setIsLoading);
|
|
7758
7775
|
const isMobileView = useLayoutStore((st) => st.isMobileView);
|
|
7759
|
-
const { email, alert: alert2, setEmail,
|
|
7776
|
+
const { email, emailChallenge, alert: alert2, setEmail, setEmailChallenge, setStep, setAlert } = useAuthStore();
|
|
7760
7777
|
const { mutate: onSendVerificationCode } = (0, import_react_query5.useMutation)({
|
|
7761
7778
|
mutationFn: async (mail) => {
|
|
7762
7779
|
const isEmailValid = mail.length !== 0 && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(mail);
|
|
@@ -7773,10 +7790,10 @@ function Email() {
|
|
|
7773
7790
|
body: JSON.stringify({ email: mail, purpose: "login" })
|
|
7774
7791
|
});
|
|
7775
7792
|
},
|
|
7776
|
-
onSuccess: async (response) => {
|
|
7793
|
+
onSuccess: async (response, requestedEmail) => {
|
|
7777
7794
|
const data = await response.json();
|
|
7778
7795
|
if (response.ok) {
|
|
7779
|
-
|
|
7796
|
+
setEmailChallenge(createEmailChallenge(requestedEmail, data.expiresIn ?? 600));
|
|
7780
7797
|
setStep("verify");
|
|
7781
7798
|
} else {
|
|
7782
7799
|
if (response.status === 429) {
|
|
@@ -7808,6 +7825,14 @@ function Email() {
|
|
|
7808
7825
|
setIsLoading(false);
|
|
7809
7826
|
}
|
|
7810
7827
|
});
|
|
7828
|
+
const continueWithEmail = () => {
|
|
7829
|
+
if (isEmailChallengeActive(emailChallenge, email)) {
|
|
7830
|
+
setAlert(null);
|
|
7831
|
+
setStep("verify");
|
|
7832
|
+
return;
|
|
7833
|
+
}
|
|
7834
|
+
onSendVerificationCode(email);
|
|
7835
|
+
};
|
|
7811
7836
|
(0, import_react14.useEffect)(() => {
|
|
7812
7837
|
if (!focusRef.current || !isMobileView) return;
|
|
7813
7838
|
focusRef.current?.focus();
|
|
@@ -7861,7 +7886,7 @@ function Email() {
|
|
|
7861
7886
|
variant: "default",
|
|
7862
7887
|
size: "large",
|
|
7863
7888
|
disabled: !email || isLoading,
|
|
7864
|
-
onClick:
|
|
7889
|
+
onClick: continueWithEmail,
|
|
7865
7890
|
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react5.Loader, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react5.ChevronRight, { className: "w-4 h-4" })
|
|
7866
7891
|
}
|
|
7867
7892
|
)
|
|
@@ -7884,6 +7909,7 @@ var init_Email = __esm({
|
|
|
7884
7909
|
init_projectId();
|
|
7885
7910
|
init_button();
|
|
7886
7911
|
init_input();
|
|
7912
|
+
init_emailChallenge();
|
|
7887
7913
|
init_useAuthStore();
|
|
7888
7914
|
import_jsx_runtime14 = require("react/jsx-runtime");
|
|
7889
7915
|
}
|
|
@@ -8723,16 +8749,10 @@ var init_VerificationCodeInput = __esm({
|
|
|
8723
8749
|
import_jsx_runtime18 = require("react/jsx-runtime");
|
|
8724
8750
|
getRemainingSeconds = (expiresAt) => Math.max(0, Math.ceil((expiresAt - Date.now()) / 1e3));
|
|
8725
8751
|
VerificationCodeInput = (props) => {
|
|
8726
|
-
const { onVerifyCode, onResendCode, isLoading,
|
|
8752
|
+
const { onVerifyCode, onResendCode, isLoading, expiresAt } = props;
|
|
8727
8753
|
const { t } = useT();
|
|
8728
8754
|
const setAlert = useAuthStore((st) => st.setAlert);
|
|
8729
|
-
const [expiresAt, setExpiresAt] = (0, import_react18.useState)(() => Date.now() + Math.max(0, expiresIn) * 1e3);
|
|
8730
8755
|
const [timeLeft, setTimeLeft] = (0, import_react18.useState)(() => getRemainingSeconds(expiresAt));
|
|
8731
|
-
(0, import_react18.useEffect)(() => {
|
|
8732
|
-
const nextExpiresAt = Date.now() + Math.max(0, expiresIn) * 1e3;
|
|
8733
|
-
setExpiresAt(nextExpiresAt);
|
|
8734
|
-
setTimeLeft(getRemainingSeconds(nextExpiresAt));
|
|
8735
|
-
}, [expiresIn]);
|
|
8736
8756
|
(0, import_react18.useEffect)(() => {
|
|
8737
8757
|
let intervalId;
|
|
8738
8758
|
const syncTimeLeft = () => {
|
|
@@ -8822,7 +8842,9 @@ var init_VerificationCodeInput = __esm({
|
|
|
8822
8842
|
"input",
|
|
8823
8843
|
{
|
|
8824
8844
|
name: `verification-code-symbol-${i}`,
|
|
8825
|
-
ref: (el) =>
|
|
8845
|
+
ref: (el) => {
|
|
8846
|
+
inputsRef.current[i] = el;
|
|
8847
|
+
},
|
|
8826
8848
|
type: "text",
|
|
8827
8849
|
autoComplete: "off",
|
|
8828
8850
|
disabled: isLoading,
|
|
@@ -8880,11 +8902,11 @@ function VerifyStep(props) {
|
|
|
8880
8902
|
const setIsLoading = useSession((st) => st.setIsLoading);
|
|
8881
8903
|
const {
|
|
8882
8904
|
email,
|
|
8883
|
-
|
|
8905
|
+
emailChallenge,
|
|
8884
8906
|
setFailedType,
|
|
8885
8907
|
setStep,
|
|
8886
8908
|
setEmail,
|
|
8887
|
-
|
|
8909
|
+
setEmailChallenge,
|
|
8888
8910
|
setAlert
|
|
8889
8911
|
} = useAuthStore();
|
|
8890
8912
|
const [resendCount, setResendCount] = (0, import_react19.useState)(0);
|
|
@@ -8925,6 +8947,7 @@ function VerifyStep(props) {
|
|
|
8925
8947
|
const needsRecovery = loginResponse.hasKeyshare && !loginResponse.isNewUser && !localKeyshare;
|
|
8926
8948
|
if (!recoveryUserId && !needsRecovery) {
|
|
8927
8949
|
setEmail("");
|
|
8950
|
+
setEmailChallenge(null);
|
|
8928
8951
|
setAlert(null);
|
|
8929
8952
|
}
|
|
8930
8953
|
await onAuthSuccess?.();
|
|
@@ -8936,11 +8959,13 @@ function VerifyStep(props) {
|
|
|
8936
8959
|
let errorMessage = "";
|
|
8937
8960
|
const rawErrorMessage = error.message || "";
|
|
8938
8961
|
const normalizedErrorMessage = rawErrorMessage.toLowerCase();
|
|
8962
|
+
if (shouldDiscardEmailChallengeForError(rawErrorMessage)) {
|
|
8963
|
+
setEmailChallenge(null);
|
|
8964
|
+
}
|
|
8939
8965
|
if (normalizedErrorMessage.includes("invalid")) {
|
|
8940
8966
|
errorMessage = "Invalid verification code. Please try again.";
|
|
8941
8967
|
} else if (normalizedErrorMessage.includes("expired")) {
|
|
8942
8968
|
errorMessage = "Verification code expired. Please request a new one.";
|
|
8943
|
-
setExpiresIn(0);
|
|
8944
8969
|
} else if (normalizedErrorMessage.includes("429") || normalizedErrorMessage.includes("too many")) {
|
|
8945
8970
|
errorMessage = "Too many attempts. Please try again later.";
|
|
8946
8971
|
} else {
|
|
@@ -8972,7 +8997,7 @@ function VerifyStep(props) {
|
|
|
8972
8997
|
onSuccess: async (response) => {
|
|
8973
8998
|
const data = await response.json();
|
|
8974
8999
|
if (response.ok) {
|
|
8975
|
-
|
|
9000
|
+
setEmailChallenge(createEmailChallenge(email, data.expiresIn ?? 600));
|
|
8976
9001
|
setResendCount((c) => c + 1);
|
|
8977
9002
|
}
|
|
8978
9003
|
if (!response.ok && response.status === 429) {
|
|
@@ -9030,7 +9055,7 @@ function VerifyStep(props) {
|
|
|
9030
9055
|
onVerifyCode,
|
|
9031
9056
|
onResendCode,
|
|
9032
9057
|
isLoading,
|
|
9033
|
-
|
|
9058
|
+
expiresAt: emailChallenge?.expiresAt ?? Date.now()
|
|
9034
9059
|
},
|
|
9035
9060
|
resendCount
|
|
9036
9061
|
)
|
|
@@ -9049,6 +9074,7 @@ var init_VerifyStep = __esm({
|
|
|
9049
9074
|
init_icons();
|
|
9050
9075
|
init_projectId();
|
|
9051
9076
|
init_button();
|
|
9077
|
+
init_emailChallenge();
|
|
9052
9078
|
init_useAuthStore();
|
|
9053
9079
|
init_VerificationCodeInput();
|
|
9054
9080
|
import_jsx_runtime19 = require("react/jsx-runtime");
|
|
@@ -9092,7 +9118,7 @@ var init_AuthMenu = __esm({
|
|
|
9092
9118
|
const setTransitionPageHeight = useLayoutDataStore((st) => st.setTransitionPageHeight);
|
|
9093
9119
|
const pendingWalletLogin = useLayoutDataStore((st) => st.pendingWalletLogin);
|
|
9094
9120
|
const setPendingWalletLogin = useLayoutDataStore((st) => st.setPendingWalletLogin);
|
|
9095
|
-
const { step, alert: alert2, setStep, setPasskeyStatus, setEmail, setAlert } = useAuthStore();
|
|
9121
|
+
const { step, alert: alert2, setStep, setPasskeyStatus, setEmail, setEmailChallenge, setAlert } = useAuthStore();
|
|
9096
9122
|
const { pendingLoginResponseRef, onAuthSuccess, goBackToSignIn } = useAuthMenuHandlers();
|
|
9097
9123
|
(0, import_react20.useEffect)(() => {
|
|
9098
9124
|
if (!pendingWalletLogin) return;
|
|
@@ -9109,6 +9135,7 @@ var init_AuthMenu = __esm({
|
|
|
9109
9135
|
return () => {
|
|
9110
9136
|
setStep("signin");
|
|
9111
9137
|
setEmail("");
|
|
9138
|
+
setEmailChallenge(null);
|
|
9112
9139
|
setPasskeyStatus("idle");
|
|
9113
9140
|
setAlert(null);
|
|
9114
9141
|
};
|
|
@@ -13635,6 +13662,41 @@ var init_passkey2 = __esm({
|
|
|
13635
13662
|
}
|
|
13636
13663
|
});
|
|
13637
13664
|
|
|
13665
|
+
// src/internal/auth/providers/email.ts
|
|
13666
|
+
async function sendEmailLinkCode(email) {
|
|
13667
|
+
const hasValidToken = await (0, import_auth23.ensureValidToken)();
|
|
13668
|
+
if (!hasValidToken) throw new Error("No authentication token available");
|
|
13669
|
+
const response = await (0, import_auth23.authenticatedFetch)(`${getTssUrl3()}/api/auth/link/email/send-code`, {
|
|
13670
|
+
method: "POST",
|
|
13671
|
+
body: JSON.stringify({ email })
|
|
13672
|
+
});
|
|
13673
|
+
if (!response.ok) {
|
|
13674
|
+
const errorData = await response.json().catch(() => ({}));
|
|
13675
|
+
throw new Error(errorData.message || `Failed to send email verification code: ${response.statusText}`);
|
|
13676
|
+
}
|
|
13677
|
+
const data = await response.json().catch(() => ({}));
|
|
13678
|
+
return data.expiresIn ?? 600;
|
|
13679
|
+
}
|
|
13680
|
+
async function verifyEmailLinkCode(email, code) {
|
|
13681
|
+
const hasValidToken = await (0, import_auth23.ensureValidToken)();
|
|
13682
|
+
if (!hasValidToken) throw new Error("No authentication token available");
|
|
13683
|
+
const response = await (0, import_auth23.authenticatedFetch)(`${getTssUrl3()}/api/auth/link/email/verify-code`, {
|
|
13684
|
+
method: "POST",
|
|
13685
|
+
credentials: "include",
|
|
13686
|
+
body: JSON.stringify({ email, code })
|
|
13687
|
+
});
|
|
13688
|
+
if (!response.ok) {
|
|
13689
|
+
const errorData = await response.json().catch(() => ({}));
|
|
13690
|
+
throw new Error(errorData.message || `Failed to verify email and link provider: ${response.statusText}`);
|
|
13691
|
+
}
|
|
13692
|
+
}
|
|
13693
|
+
var init_email = __esm({
|
|
13694
|
+
"src/internal/auth/providers/email.ts"() {
|
|
13695
|
+
init_auth();
|
|
13696
|
+
init_types();
|
|
13697
|
+
}
|
|
13698
|
+
});
|
|
13699
|
+
|
|
13638
13700
|
// src/internal/components/ManageWalletMenu/hooks/useStore.ts
|
|
13639
13701
|
var import_zustand8, useManageWalletStore;
|
|
13640
13702
|
var init_useStore = __esm({
|
|
@@ -13646,7 +13708,7 @@ var init_useStore = __esm({
|
|
|
13646
13708
|
emailStep: "input",
|
|
13647
13709
|
email: "",
|
|
13648
13710
|
emailCode: "",
|
|
13649
|
-
|
|
13711
|
+
emailCodeExpiresAt: 0,
|
|
13650
13712
|
linkIsLoading: false,
|
|
13651
13713
|
// linkError: null,
|
|
13652
13714
|
providerType: null,
|
|
@@ -13655,7 +13717,7 @@ var init_useStore = __esm({
|
|
|
13655
13717
|
setEmailStep: (emailStep) => set({ emailStep }),
|
|
13656
13718
|
setEmail: (email) => set({ email }),
|
|
13657
13719
|
setEmailCode: (emailCode) => set({ emailCode }),
|
|
13658
|
-
|
|
13720
|
+
setEmailCodeExpiresAt: (emailCodeExpiresAt) => set({ emailCodeExpiresAt }),
|
|
13659
13721
|
setLinkIsLoading: (linkIsLoading) => {
|
|
13660
13722
|
useLayoutStore.setState({ isDialogForced: linkIsLoading });
|
|
13661
13723
|
set({ linkIsLoading });
|
|
@@ -13667,71 +13729,46 @@ var init_useStore = __esm({
|
|
|
13667
13729
|
}
|
|
13668
13730
|
});
|
|
13669
13731
|
|
|
13670
|
-
// src/internal/components/ManageWalletMenu/
|
|
13671
|
-
function
|
|
13672
|
-
const
|
|
13673
|
-
const
|
|
13674
|
-
const
|
|
13675
|
-
|
|
13676
|
-
|
|
13677
|
-
|
|
13678
|
-
|
|
13679
|
-
if (!email) return;
|
|
13680
|
-
setIsLoading(true);
|
|
13681
|
-
setAlert(null);
|
|
13682
|
-
try {
|
|
13683
|
-
const response = await fetch(addProjectIdToUrl(`${getServiceUrls().tssUrl}/api/auth/email/send-code`), {
|
|
13684
|
-
method: "POST",
|
|
13685
|
-
headers: {
|
|
13686
|
-
"Content-Type": "application/json"
|
|
13687
|
-
},
|
|
13688
|
-
credentials: "include",
|
|
13689
|
-
body: JSON.stringify({
|
|
13690
|
-
email,
|
|
13691
|
-
purpose: "login"
|
|
13692
|
-
})
|
|
13693
|
-
});
|
|
13694
|
-
const data = await response.json();
|
|
13695
|
-
if (response.ok) {
|
|
13696
|
-
setEmailCodeExpiresIn(data?.expiresIn || 300);
|
|
13697
|
-
setEmailStep("verify");
|
|
13698
|
-
} else {
|
|
13699
|
-
if (response.status === 429) {
|
|
13700
|
-
const retryAfter = data.retryAfter || 60;
|
|
13701
|
-
setAlert({
|
|
13702
|
-
title: "Too Many Requests",
|
|
13703
|
-
message: `Code already sent recently. Please wait ${retryAfter} seconds before requesting another.`
|
|
13704
|
-
});
|
|
13705
|
-
} else if (response.status === 400) {
|
|
13706
|
-
setAlert({
|
|
13707
|
-
title: "Invalid Email",
|
|
13708
|
-
message: data.message || "Invalid email address"
|
|
13709
|
-
});
|
|
13710
|
-
} else {
|
|
13711
|
-
setAlert({
|
|
13712
|
-
title: "Error",
|
|
13713
|
-
message: data.message || "Failed to send verification code"
|
|
13714
|
-
});
|
|
13715
|
-
}
|
|
13716
|
-
}
|
|
13717
|
-
} catch (error) {
|
|
13718
|
-
const errorMessage = "Network error. Please check your connection.";
|
|
13719
|
-
setAlert({
|
|
13720
|
-
title: "Network Error",
|
|
13721
|
-
message: errorMessage
|
|
13722
|
-
});
|
|
13723
|
-
try {
|
|
13724
|
-
callbacksRef.current?.onError?.({
|
|
13725
|
-
error: error instanceof Error ? error : new Error(errorMessage),
|
|
13726
|
-
message: errorMessage
|
|
13727
|
-
});
|
|
13728
|
-
} catch {
|
|
13729
|
-
}
|
|
13730
|
-
} finally {
|
|
13731
|
-
setIsLoading(false);
|
|
13732
|
+
// src/internal/components/ManageWalletMenu/hooks/useSendVerificationCode.ts
|
|
13733
|
+
function useSendVerificationCode() {
|
|
13734
|
+
const setAlert = useManageWalletStore((st) => st.setAlert);
|
|
13735
|
+
const setLinkIsLoading = useManageWalletStore((st) => st.setLinkIsLoading);
|
|
13736
|
+
const setEmailCodeExpiresAt = useManageWalletStore((st) => st.setEmailCodeExpiresAt);
|
|
13737
|
+
return (0, import_react_query18.useMutation)({
|
|
13738
|
+
mutationFn: async (email) => {
|
|
13739
|
+
if (!email) {
|
|
13740
|
+
throw new Error("Email is required");
|
|
13732
13741
|
}
|
|
13742
|
+
setAlert(null);
|
|
13743
|
+
setLinkIsLoading(true);
|
|
13744
|
+
return await sendEmailLinkCode(email);
|
|
13745
|
+
},
|
|
13746
|
+
onError: (error) => {
|
|
13747
|
+
console.error("Failed to send verification code", error.message);
|
|
13748
|
+
setAlert({ title: "Error", message: error?.message || "Failed to send verification code" });
|
|
13749
|
+
setLinkIsLoading(false);
|
|
13750
|
+
},
|
|
13751
|
+
onSuccess: (expiresIn) => {
|
|
13752
|
+
setEmailCodeExpiresAt(Date.now() + expiresIn * 1e3);
|
|
13753
|
+
console.log("Verification code sent");
|
|
13754
|
+
setLinkIsLoading(false);
|
|
13733
13755
|
}
|
|
13734
13756
|
});
|
|
13757
|
+
}
|
|
13758
|
+
var import_react_query18;
|
|
13759
|
+
var init_useSendVerificationCode = __esm({
|
|
13760
|
+
"src/internal/components/ManageWalletMenu/hooks/useSendVerificationCode.ts"() {
|
|
13761
|
+
import_react_query18 = require("@tanstack/react-query");
|
|
13762
|
+
init_email();
|
|
13763
|
+
init_useStore();
|
|
13764
|
+
}
|
|
13765
|
+
});
|
|
13766
|
+
|
|
13767
|
+
// src/internal/components/ManageWalletMenu/EmailForm.tsx
|
|
13768
|
+
function EmailForm() {
|
|
13769
|
+
const { t } = useT();
|
|
13770
|
+
const { email, linkIsLoading, setEmail, setEmailStep } = useManageWalletStore();
|
|
13771
|
+
const { mutate: onSendVerificationCode } = useSendVerificationCode();
|
|
13735
13772
|
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "w-full flex gap-[10px] items-center", children: [
|
|
13736
13773
|
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
13737
13774
|
Input,
|
|
@@ -13752,25 +13789,21 @@ function EmailForm() {
|
|
|
13752
13789
|
className: "w-12 h-12 flex-none",
|
|
13753
13790
|
variant: "default",
|
|
13754
13791
|
size: "large",
|
|
13755
|
-
disabled: !email ||
|
|
13756
|
-
onClick: () => onSendVerificationCode(),
|
|
13757
|
-
children:
|
|
13792
|
+
disabled: !email || linkIsLoading,
|
|
13793
|
+
onClick: () => onSendVerificationCode(email, { onSuccess: () => setEmailStep("verify") }),
|
|
13794
|
+
children: linkIsLoading ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react25.Loader, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react25.ChevronRight, { className: "w-4 h-4" })
|
|
13758
13795
|
}
|
|
13759
13796
|
)
|
|
13760
13797
|
] });
|
|
13761
13798
|
}
|
|
13762
|
-
var
|
|
13799
|
+
var import_lucide_react25, import_jsx_runtime61;
|
|
13763
13800
|
var init_EmailForm = __esm({
|
|
13764
13801
|
"src/internal/components/ManageWalletMenu/EmailForm.tsx"() {
|
|
13765
|
-
init_initial();
|
|
13766
|
-
init_ProviderContext();
|
|
13767
|
-
init_SessionContext();
|
|
13768
13802
|
init_i18n();
|
|
13769
|
-
import_react_query18 = require("@tanstack/react-query");
|
|
13770
13803
|
import_lucide_react25 = require("lucide-react");
|
|
13771
|
-
init_projectId();
|
|
13772
13804
|
init_button();
|
|
13773
13805
|
init_input();
|
|
13806
|
+
init_useSendVerificationCode();
|
|
13774
13807
|
init_useStore();
|
|
13775
13808
|
import_jsx_runtime61 = require("react/jsx-runtime");
|
|
13776
13809
|
}
|
|
@@ -13798,78 +13831,10 @@ var init_useProvidersList = __esm({
|
|
|
13798
13831
|
}
|
|
13799
13832
|
});
|
|
13800
13833
|
|
|
13801
|
-
// src/internal/auth/providers/email.ts
|
|
13802
|
-
async function sendEmailLinkCode(email) {
|
|
13803
|
-
const hasValidToken = await (0, import_auth23.ensureValidToken)();
|
|
13804
|
-
if (!hasValidToken) throw new Error("No authentication token available");
|
|
13805
|
-
const response = await (0, import_auth23.authenticatedFetch)(`${getTssUrl3()}/api/auth/link/email/send-code`, {
|
|
13806
|
-
method: "POST",
|
|
13807
|
-
body: JSON.stringify({ email })
|
|
13808
|
-
});
|
|
13809
|
-
if (!response.ok) {
|
|
13810
|
-
const errorData = await response.json().catch(() => ({}));
|
|
13811
|
-
throw new Error(errorData.message || `Failed to send email verification code: ${response.statusText}`);
|
|
13812
|
-
}
|
|
13813
|
-
}
|
|
13814
|
-
async function verifyEmailLinkCode(email, code) {
|
|
13815
|
-
const hasValidToken = await (0, import_auth23.ensureValidToken)();
|
|
13816
|
-
if (!hasValidToken) throw new Error("No authentication token available");
|
|
13817
|
-
const response = await (0, import_auth23.authenticatedFetch)(`${getTssUrl3()}/api/auth/link/email/verify-code`, {
|
|
13818
|
-
method: "POST",
|
|
13819
|
-
credentials: "include",
|
|
13820
|
-
body: JSON.stringify({ email, code })
|
|
13821
|
-
});
|
|
13822
|
-
if (!response.ok) {
|
|
13823
|
-
const errorData = await response.json().catch(() => ({}));
|
|
13824
|
-
throw new Error(errorData.message || `Failed to verify email and link provider: ${response.statusText}`);
|
|
13825
|
-
}
|
|
13826
|
-
}
|
|
13827
|
-
var init_email = __esm({
|
|
13828
|
-
"src/internal/auth/providers/email.ts"() {
|
|
13829
|
-
init_auth();
|
|
13830
|
-
init_types();
|
|
13831
|
-
}
|
|
13832
|
-
});
|
|
13833
|
-
|
|
13834
|
-
// src/internal/components/ManageWalletMenu/hooks/useSendVerificationCode.ts
|
|
13835
|
-
function useSendVerificationCode() {
|
|
13836
|
-
const setAlert = useManageWalletStore((st) => st.setAlert);
|
|
13837
|
-
const setLinkIsLoading = useManageWalletStore((st) => st.setLinkIsLoading);
|
|
13838
|
-
const setEmailCodeExpiresIn = useManageWalletStore((st) => st.setEmailCodeExpiresIn);
|
|
13839
|
-
return (0, import_react_query20.useMutation)({
|
|
13840
|
-
mutationFn: async (email) => {
|
|
13841
|
-
if (!email) {
|
|
13842
|
-
throw new Error("Email is required");
|
|
13843
|
-
}
|
|
13844
|
-
setAlert(null);
|
|
13845
|
-
setLinkIsLoading(true);
|
|
13846
|
-
await sendEmailLinkCode(email);
|
|
13847
|
-
},
|
|
13848
|
-
onError: (error) => {
|
|
13849
|
-
console.error("Failed to send verification code", error.message);
|
|
13850
|
-
setAlert({ title: "Error", message: error?.message || "Failed to send verification code" });
|
|
13851
|
-
setLinkIsLoading(false);
|
|
13852
|
-
},
|
|
13853
|
-
onSuccess: () => {
|
|
13854
|
-
setEmailCodeExpiresIn(300);
|
|
13855
|
-
console.log("Verification code sent");
|
|
13856
|
-
setLinkIsLoading(false);
|
|
13857
|
-
}
|
|
13858
|
-
});
|
|
13859
|
-
}
|
|
13860
|
-
var import_react_query20;
|
|
13861
|
-
var init_useSendVerificationCode = __esm({
|
|
13862
|
-
"src/internal/components/ManageWalletMenu/hooks/useSendVerificationCode.ts"() {
|
|
13863
|
-
import_react_query20 = require("@tanstack/react-query");
|
|
13864
|
-
init_email();
|
|
13865
|
-
init_useStore();
|
|
13866
|
-
}
|
|
13867
|
-
});
|
|
13868
|
-
|
|
13869
13834
|
// src/internal/components/ManageWalletMenu/hooks/useVerifyCode.ts
|
|
13870
13835
|
function useVerifyCode() {
|
|
13871
13836
|
const { callbacksRef } = useProviderConfig();
|
|
13872
|
-
const qc = (0,
|
|
13837
|
+
const qc = (0, import_react_query20.useQueryClient)();
|
|
13873
13838
|
const address = useSession((st) => st.address);
|
|
13874
13839
|
const setIsLoading = useSession((st) => st.setIsLoading);
|
|
13875
13840
|
const {
|
|
@@ -13878,12 +13843,12 @@ function useVerifyCode() {
|
|
|
13878
13843
|
setEmail,
|
|
13879
13844
|
setEmailStep,
|
|
13880
13845
|
setEmailCode,
|
|
13881
|
-
|
|
13846
|
+
setEmailCodeExpiresAt,
|
|
13882
13847
|
setProviderType,
|
|
13883
13848
|
setLinkIsLoading,
|
|
13884
13849
|
setAlert
|
|
13885
13850
|
} = useManageWalletStore();
|
|
13886
|
-
return (0,
|
|
13851
|
+
return (0, import_react_query20.useMutation)({
|
|
13887
13852
|
mutationFn: async (codeToVerify) => {
|
|
13888
13853
|
const code = codeToVerify ?? emailCode;
|
|
13889
13854
|
if (!code) {
|
|
@@ -13912,8 +13877,8 @@ function useVerifyCode() {
|
|
|
13912
13877
|
},
|
|
13913
13878
|
onError: (error) => {
|
|
13914
13879
|
const message = error?.message || "Failed to verify and link email";
|
|
13915
|
-
if (message
|
|
13916
|
-
|
|
13880
|
+
if (shouldDiscardEmailChallengeForError(message)) {
|
|
13881
|
+
setEmailCodeExpiresAt(0);
|
|
13917
13882
|
}
|
|
13918
13883
|
setAlert({ title: "Error", message });
|
|
13919
13884
|
setIsLoading(false);
|
|
@@ -13921,14 +13886,15 @@ function useVerifyCode() {
|
|
|
13921
13886
|
}
|
|
13922
13887
|
});
|
|
13923
13888
|
}
|
|
13924
|
-
var
|
|
13889
|
+
var import_react_query20;
|
|
13925
13890
|
var init_useVerifyCode = __esm({
|
|
13926
13891
|
"src/internal/components/ManageWalletMenu/hooks/useVerifyCode.ts"() {
|
|
13927
13892
|
init_ProviderContext();
|
|
13928
13893
|
init_SessionContext();
|
|
13929
13894
|
init_linkedProfiles();
|
|
13930
|
-
|
|
13895
|
+
import_react_query20 = require("@tanstack/react-query");
|
|
13931
13896
|
init_email();
|
|
13897
|
+
init_emailChallenge();
|
|
13932
13898
|
init_useProvidersList();
|
|
13933
13899
|
init_useStore();
|
|
13934
13900
|
}
|
|
@@ -13946,7 +13912,7 @@ function normalizePasskeyLinkError(msg) {
|
|
|
13946
13912
|
return msg;
|
|
13947
13913
|
}
|
|
13948
13914
|
function AddProvider() {
|
|
13949
|
-
const qc = (0,
|
|
13915
|
+
const qc = (0, import_react_query21.useQueryClient)();
|
|
13950
13916
|
const { callbacksRef } = useProviderConfig();
|
|
13951
13917
|
const address = useSession((st) => st.address);
|
|
13952
13918
|
const { t } = useT();
|
|
@@ -13955,7 +13921,7 @@ function AddProvider() {
|
|
|
13955
13921
|
providerType,
|
|
13956
13922
|
email,
|
|
13957
13923
|
emailStep,
|
|
13958
|
-
|
|
13924
|
+
emailCodeExpiresAt,
|
|
13959
13925
|
setAlert,
|
|
13960
13926
|
setProviderType,
|
|
13961
13927
|
setLinkIsLoading
|
|
@@ -13982,7 +13948,7 @@ function AddProvider() {
|
|
|
13982
13948
|
onVerifyCode,
|
|
13983
13949
|
onResendCode: () => onResendCode(email),
|
|
13984
13950
|
isLoading,
|
|
13985
|
-
|
|
13951
|
+
expiresAt: emailCodeExpiresAt
|
|
13986
13952
|
}
|
|
13987
13953
|
)
|
|
13988
13954
|
] }),
|
|
@@ -14075,14 +14041,14 @@ function AddProvider() {
|
|
|
14075
14041
|
] })
|
|
14076
14042
|
] });
|
|
14077
14043
|
}
|
|
14078
|
-
var
|
|
14044
|
+
var import_react_query21, import_jsx_runtime62;
|
|
14079
14045
|
var init_AddProvider = __esm({
|
|
14080
14046
|
"src/internal/components/ManageWalletMenu/AddProvider.tsx"() {
|
|
14081
14047
|
init_ProviderContext();
|
|
14082
14048
|
init_SessionContext();
|
|
14083
14049
|
init_i18n();
|
|
14084
14050
|
init_linkedProfiles();
|
|
14085
|
-
|
|
14051
|
+
import_react_query21 = require("@tanstack/react-query");
|
|
14086
14052
|
init_icons();
|
|
14087
14053
|
init_passkey2();
|
|
14088
14054
|
init_useLayoutDataStore();
|
|
@@ -14134,7 +14100,7 @@ function normalizeSocialLinkError(message) {
|
|
|
14134
14100
|
return message;
|
|
14135
14101
|
}
|
|
14136
14102
|
function useLinkSocial() {
|
|
14137
|
-
const qc = (0,
|
|
14103
|
+
const qc = (0, import_react_query22.useQueryClient)();
|
|
14138
14104
|
const address = useSession((st) => st.address);
|
|
14139
14105
|
const {
|
|
14140
14106
|
config: { current: config },
|
|
@@ -14215,14 +14181,14 @@ function useLinkSocial() {
|
|
|
14215
14181
|
}
|
|
14216
14182
|
}, [providerType, linkIsLoading, socialLinkStarted, handleLinkSocialProvider]);
|
|
14217
14183
|
}
|
|
14218
|
-
var
|
|
14184
|
+
var import_react_query22, import_react36;
|
|
14219
14185
|
var init_useLinkSocial = __esm({
|
|
14220
14186
|
"src/internal/components/ManageWalletMenu/hooks/useLinkSocial.ts"() {
|
|
14221
14187
|
init_useLayoutDataStore();
|
|
14222
14188
|
init_ProviderContext();
|
|
14223
14189
|
init_SessionContext();
|
|
14224
14190
|
init_linkedProfiles();
|
|
14225
|
-
|
|
14191
|
+
import_react_query22 = require("@tanstack/react-query");
|
|
14226
14192
|
import_react36 = __toESM(require("react"), 1);
|
|
14227
14193
|
init_auth();
|
|
14228
14194
|
init_telegramBrowser();
|
|
@@ -14287,7 +14253,7 @@ function useLinkTelegram() {
|
|
|
14287
14253
|
config: { current: config },
|
|
14288
14254
|
callbacksRef
|
|
14289
14255
|
} = useProviderConfig();
|
|
14290
|
-
const qc = (0,
|
|
14256
|
+
const qc = (0, import_react_query23.useQueryClient)();
|
|
14291
14257
|
const address = useSession((st) => st.address);
|
|
14292
14258
|
const { providerType, linkIsLoading, setLinkIsLoading, setProviderType, setAlert } = useManageWalletStore();
|
|
14293
14259
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
@@ -14353,13 +14319,13 @@ function useLinkTelegram() {
|
|
|
14353
14319
|
}
|
|
14354
14320
|
}, [providerType]);
|
|
14355
14321
|
}
|
|
14356
|
-
var
|
|
14322
|
+
var import_react_query23, import_react37;
|
|
14357
14323
|
var init_useLinkTelegram = __esm({
|
|
14358
14324
|
"src/internal/components/ManageWalletMenu/hooks/useLinkTelegram.ts"() {
|
|
14359
14325
|
init_ProviderContext();
|
|
14360
14326
|
init_SessionContext();
|
|
14361
14327
|
init_linkedProfiles();
|
|
14362
|
-
|
|
14328
|
+
import_react_query23 = require("@tanstack/react-query");
|
|
14363
14329
|
import_react37 = require("react");
|
|
14364
14330
|
init_telegram2();
|
|
14365
14331
|
init_useLayoutDataStore();
|
|
@@ -14566,7 +14532,7 @@ function ManageWalletMenu() {
|
|
|
14566
14532
|
setProviderType,
|
|
14567
14533
|
setEmail,
|
|
14568
14534
|
setEmailStep,
|
|
14569
|
-
|
|
14535
|
+
setEmailCodeExpiresAt,
|
|
14570
14536
|
setEmailCode
|
|
14571
14537
|
} = useManageWalletStore();
|
|
14572
14538
|
const configuredProviders = getConfiguredProviders(config.current);
|
|
@@ -14614,7 +14580,7 @@ function ManageWalletMenu() {
|
|
|
14614
14580
|
case "email":
|
|
14615
14581
|
setEmail("");
|
|
14616
14582
|
setEmailCode("");
|
|
14617
|
-
|
|
14583
|
+
setEmailCodeExpiresAt(0);
|
|
14618
14584
|
setEmailStep("input");
|
|
14619
14585
|
setProviderType(provider);
|
|
14620
14586
|
break;
|
|
@@ -14677,7 +14643,7 @@ function ManageWalletMenu() {
|
|
|
14677
14643
|
setEmail("");
|
|
14678
14644
|
setEmailCode("");
|
|
14679
14645
|
setEmailStep("input");
|
|
14680
|
-
|
|
14646
|
+
setEmailCodeExpiresAt(0);
|
|
14681
14647
|
}
|
|
14682
14648
|
if (!providerType) useLayoutDataStore.getState().setPage("settings" /* SETTINGS */);
|
|
14683
14649
|
setProviderType(null);
|
|
@@ -14747,7 +14713,7 @@ var init_ManageWallet = __esm({
|
|
|
14747
14713
|
|
|
14748
14714
|
// src/internal/components/ManageWalletMenu/UnlinkProviderMenu.tsx
|
|
14749
14715
|
function UnlinkProviderMenu() {
|
|
14750
|
-
const qc = (0,
|
|
14716
|
+
const qc = (0, import_react_query24.useQueryClient)();
|
|
14751
14717
|
const address = useSession((st) => st.address);
|
|
14752
14718
|
const { callbacksRef } = useProviderConfig();
|
|
14753
14719
|
const { disconnect: disconnectExternalWallet } = (0, import_wagmi.useDisconnect)();
|
|
@@ -14756,7 +14722,7 @@ function UnlinkProviderMenu() {
|
|
|
14756
14722
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
14757
14723
|
const { confirmUnlink, setConfirmUnlink, setAlert } = useManageWalletStore();
|
|
14758
14724
|
const [confirmInput, setConfirmInput] = (0, import_react39.useState)("");
|
|
14759
|
-
const { mutate: handleUnlinkProvider, isPending: isProviderUnlinking } = (0,
|
|
14725
|
+
const { mutate: handleUnlinkProvider, isPending: isProviderUnlinking } = (0, import_react_query24.useMutation)({
|
|
14760
14726
|
mutationFn: async () => {
|
|
14761
14727
|
if (!confirmUnlink) {
|
|
14762
14728
|
throw new Error("No provider to unlink");
|
|
@@ -14837,7 +14803,7 @@ function UnlinkProviderMenu() {
|
|
|
14837
14803
|
] })
|
|
14838
14804
|
] });
|
|
14839
14805
|
}
|
|
14840
|
-
var
|
|
14806
|
+
var import_react_query24, import_lucide_react29, import_react39, import_wagmi, import_jsx_runtime66;
|
|
14841
14807
|
var init_UnlinkProviderMenu = __esm({
|
|
14842
14808
|
"src/internal/components/ManageWalletMenu/UnlinkProviderMenu.tsx"() {
|
|
14843
14809
|
init_useLayoutDataStore();
|
|
@@ -14845,7 +14811,7 @@ var init_UnlinkProviderMenu = __esm({
|
|
|
14845
14811
|
init_SessionContext();
|
|
14846
14812
|
init_useT();
|
|
14847
14813
|
init_linkedProfiles();
|
|
14848
|
-
|
|
14814
|
+
import_react_query24 = require("@tanstack/react-query");
|
|
14849
14815
|
import_lucide_react29 = require("lucide-react");
|
|
14850
14816
|
import_react39 = require("react");
|
|
14851
14817
|
import_wagmi = require("wagmi");
|
|
@@ -14900,7 +14866,7 @@ function ConnectExternalWalletMenu() {
|
|
|
14900
14866
|
const { config, callbacksRef } = useProviderConfig();
|
|
14901
14867
|
const allowedWallets = config.current?.wallet?.allowedWallets;
|
|
14902
14868
|
const walletMode = config.current?.wallet?.mode || "both";
|
|
14903
|
-
const qc = (0,
|
|
14869
|
+
const qc = (0, import_react_query25.useQueryClient)();
|
|
14904
14870
|
const { t } = useT();
|
|
14905
14871
|
const { address: embarkAiAddress } = useSession();
|
|
14906
14872
|
const { open: openEmbarkAI } = useOpenPage();
|
|
@@ -14911,13 +14877,13 @@ function ConnectExternalWalletMenu() {
|
|
|
14911
14877
|
const { mutateAsync: signMessageAsync } = (0, import_wagmi2.useSignMessage)();
|
|
14912
14878
|
const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
|
|
14913
14879
|
const walletMenuOpenedFrom = useLayoutDataStore((st) => st.walletMenuOpenedFrom);
|
|
14914
|
-
const { data: providers = [] } = (0,
|
|
14880
|
+
const { data: providers = [] } = (0, import_react_query25.useQuery)({
|
|
14915
14881
|
retry: false,
|
|
14916
14882
|
enabled: !!embarkAiAddress,
|
|
14917
14883
|
queryKey: [PROVIDERS_QUERY_KEY, embarkAiAddress],
|
|
14918
14884
|
queryFn: async () => getLinkedProviders()
|
|
14919
14885
|
});
|
|
14920
|
-
const { mutateAsync: onLinkingComplete } = (0,
|
|
14886
|
+
const { mutateAsync: onLinkingComplete } = (0, import_react_query25.useMutation)({
|
|
14921
14887
|
mutationFn: async (success) => {
|
|
14922
14888
|
useManageWalletStore.getState().setProviderType(null);
|
|
14923
14889
|
useLayoutDataStore.getState().setPage(walletMenuOpenedFrom || "manage-wallet" /* MANAGE_WALLET */);
|
|
@@ -14928,7 +14894,7 @@ function ConnectExternalWalletMenu() {
|
|
|
14928
14894
|
callbacksRef.current?.onAccountUpdate?.({ providers: providers2 });
|
|
14929
14895
|
}
|
|
14930
14896
|
});
|
|
14931
|
-
const { mutateAsync: loginOrLinkOrConnectWallet, isPending: isLoginOrLinkOrConnectWallet } = (0,
|
|
14897
|
+
const { mutateAsync: loginOrLinkOrConnectWallet, isPending: isLoginOrLinkOrConnectWallet } = (0, import_react_query25.useMutation)({
|
|
14932
14898
|
mutationFn: async (payload) => {
|
|
14933
14899
|
const { walletData, connectFlowType } = payload;
|
|
14934
14900
|
const { walletMenuOpenedFrom: walletMenuOpenedFrom2, setPage, setPendingWalletLogin } = useLayoutDataStore.getState();
|
|
@@ -15189,7 +15155,7 @@ function ConnectExternalWalletMenu() {
|
|
|
15189
15155
|
}
|
|
15190
15156
|
);
|
|
15191
15157
|
}
|
|
15192
|
-
var
|
|
15158
|
+
var import_react_query25, import_lucide_react30, import_react41, import_wagmi2, import_jsx_runtime67;
|
|
15193
15159
|
var init_ConnectExternalWalletMenu = __esm({
|
|
15194
15160
|
"src/internal/components/ConnectExternalWalletMenu/ConnectExternalWalletMenu.tsx"() {
|
|
15195
15161
|
init_ProviderContext();
|
|
@@ -15198,7 +15164,7 @@ var init_ConnectExternalWalletMenu = __esm({
|
|
|
15198
15164
|
init_i18n();
|
|
15199
15165
|
init_wallets();
|
|
15200
15166
|
init_linkedProfiles();
|
|
15201
|
-
|
|
15167
|
+
import_react_query25 = require("@tanstack/react-query");
|
|
15202
15168
|
import_lucide_react30 = require("lucide-react");
|
|
15203
15169
|
import_react41 = require("react");
|
|
15204
15170
|
import_wagmi2 = require("wagmi");
|
|
@@ -15317,14 +15283,14 @@ async function unlinkDevice(deviceId) {
|
|
|
15317
15283
|
}
|
|
15318
15284
|
}
|
|
15319
15285
|
function useDevices() {
|
|
15320
|
-
return (0,
|
|
15286
|
+
return (0, import_react_query26.useQuery)({
|
|
15321
15287
|
queryKey: [DEVICES_QUERY_KEY],
|
|
15322
15288
|
queryFn: getDevices
|
|
15323
15289
|
});
|
|
15324
15290
|
}
|
|
15325
15291
|
function useLinkDevice() {
|
|
15326
|
-
const qc = (0,
|
|
15327
|
-
return (0,
|
|
15292
|
+
const qc = (0, import_react_query26.useQueryClient)();
|
|
15293
|
+
return (0, import_react_query26.useMutation)({
|
|
15328
15294
|
mutationFn: (code) => linkDevice(code),
|
|
15329
15295
|
onSuccess: () => {
|
|
15330
15296
|
qc.invalidateQueries({ queryKey: [DEVICES_QUERY_KEY] });
|
|
@@ -15332,18 +15298,18 @@ function useLinkDevice() {
|
|
|
15332
15298
|
});
|
|
15333
15299
|
}
|
|
15334
15300
|
function useUnlinkDevice() {
|
|
15335
|
-
const qc = (0,
|
|
15336
|
-
return (0,
|
|
15301
|
+
const qc = (0, import_react_query26.useQueryClient)();
|
|
15302
|
+
return (0, import_react_query26.useMutation)({
|
|
15337
15303
|
mutationFn: (deviceId) => unlinkDevice(deviceId),
|
|
15338
15304
|
onSuccess: () => {
|
|
15339
15305
|
qc.invalidateQueries({ queryKey: [DEVICES_QUERY_KEY] });
|
|
15340
15306
|
}
|
|
15341
15307
|
});
|
|
15342
15308
|
}
|
|
15343
|
-
var
|
|
15309
|
+
var import_react_query26, DEVICES_QUERY_KEY;
|
|
15344
15310
|
var init_devices = __esm({
|
|
15345
15311
|
"src/internal/clients/devices.ts"() {
|
|
15346
|
-
|
|
15312
|
+
import_react_query26 = require("@tanstack/react-query");
|
|
15347
15313
|
init_httpClient();
|
|
15348
15314
|
DEVICES_QUERY_KEY = "devices";
|
|
15349
15315
|
}
|
|
@@ -16892,7 +16858,7 @@ var init_cloudStorage = __esm({
|
|
|
16892
16858
|
|
|
16893
16859
|
// src/internal/components/KeyshareRestoreMenu/hooks/useCreateBackup.ts
|
|
16894
16860
|
function useCreateBackup() {
|
|
16895
|
-
const qc = (0,
|
|
16861
|
+
const qc = (0, import_react_query27.useQueryClient)();
|
|
16896
16862
|
const session = useSession((st) => st.session);
|
|
16897
16863
|
const address = useSession((st) => st.address);
|
|
16898
16864
|
const hasServerVault = useSession((st) => st.hasServerVault);
|
|
@@ -16910,7 +16876,7 @@ function useCreateBackup() {
|
|
|
16910
16876
|
const onBackupSuccess = (0, import_react48.useCallback)(() => {
|
|
16911
16877
|
console.log("[EMBARKAI BACKUP] Backup created successfully");
|
|
16912
16878
|
}, [hasServerVault]);
|
|
16913
|
-
const { mutate: createPasswordBackup, isPending: isPasswordBackupCreating } = (0,
|
|
16879
|
+
const { mutate: createPasswordBackup, isPending: isPasswordBackupCreating } = (0, import_react_query27.useMutation)({
|
|
16914
16880
|
mutationFn: async () => {
|
|
16915
16881
|
const iframeManager = getIframeManager();
|
|
16916
16882
|
if (!iframeManager) {
|
|
@@ -16955,7 +16921,7 @@ function useCreateBackup() {
|
|
|
16955
16921
|
qc.invalidateQueries({ queryKey: [CHECK_BACKUP_QUERY_KEY, address] });
|
|
16956
16922
|
}
|
|
16957
16923
|
});
|
|
16958
|
-
const { mutate: createLocalBackup, isPending: isLocalBackupCreating } = (0,
|
|
16924
|
+
const { mutate: createLocalBackup, isPending: isLocalBackupCreating } = (0, import_react_query27.useMutation)({
|
|
16959
16925
|
mutationFn: async () => {
|
|
16960
16926
|
const iframeManager = getIframeManager();
|
|
16961
16927
|
if (!usePasskey && !restorePassword) {
|
|
@@ -16989,7 +16955,7 @@ function useCreateBackup() {
|
|
|
16989
16955
|
qc.invalidateQueries({ queryKey: [CHECK_BACKUP_QUERY_KEY, address] });
|
|
16990
16956
|
}
|
|
16991
16957
|
});
|
|
16992
|
-
const { mutate: createPasskey, isPending: isPasskeyCreating } = (0,
|
|
16958
|
+
const { mutate: createPasskey, isPending: isPasskeyCreating } = (0, import_react_query27.useMutation)({
|
|
16993
16959
|
mutationFn: async () => {
|
|
16994
16960
|
useRestoreStore.getState().setIsCreatingPasskey(true);
|
|
16995
16961
|
const { linkPasskeyWithWebAuthn: linkPasskeyWithWebAuthn2 } = await Promise.resolve().then(() => (init_passkey2(), passkey_exports2));
|
|
@@ -17016,7 +16982,7 @@ function useCreateBackup() {
|
|
|
17016
16982
|
}
|
|
17017
16983
|
}
|
|
17018
16984
|
});
|
|
17019
|
-
const { mutate: createCloudBackup, isPending: isCloudBackupCreating } = (0,
|
|
16985
|
+
const { mutate: createCloudBackup, isPending: isCloudBackupCreating } = (0, import_react_query27.useMutation)({
|
|
17020
16986
|
mutationFn: async () => {
|
|
17021
16987
|
const iframeManager = getIframeManager();
|
|
17022
16988
|
const encryptedData = await iframeManager.encryptBackupData(passportUserId);
|
|
@@ -17067,11 +17033,11 @@ function useCreateBackup() {
|
|
|
17067
17033
|
createPasskey
|
|
17068
17034
|
};
|
|
17069
17035
|
}
|
|
17070
|
-
var
|
|
17036
|
+
var import_react_query27, import_react48;
|
|
17071
17037
|
var init_useCreateBackup = __esm({
|
|
17072
17038
|
"src/internal/components/KeyshareRestoreMenu/hooks/useCreateBackup.ts"() {
|
|
17073
17039
|
init_SessionContext();
|
|
17074
|
-
|
|
17040
|
+
import_react_query27 = require("@tanstack/react-query");
|
|
17075
17041
|
import_react48 = require("react");
|
|
17076
17042
|
init_auth();
|
|
17077
17043
|
init_useLayoutStore();
|
|
@@ -17095,7 +17061,7 @@ function useRestoreAccount() {
|
|
|
17095
17061
|
setRestoreFile
|
|
17096
17062
|
} = useRestoreStore();
|
|
17097
17063
|
const { onRestoreSuccess } = useOnRestoreSuccess();
|
|
17098
|
-
const { mutate: restoreFromServer2, isPending: isRestoringFromServer } = (0,
|
|
17064
|
+
const { mutate: restoreFromServer2, isPending: isRestoringFromServer } = (0, import_react_query28.useMutation)({
|
|
17099
17065
|
mutationFn: async () => {
|
|
17100
17066
|
setError(null);
|
|
17101
17067
|
setSuccess(null);
|
|
@@ -17134,7 +17100,7 @@ function useRestoreAccount() {
|
|
|
17134
17100
|
setError(errorMsg);
|
|
17135
17101
|
}
|
|
17136
17102
|
});
|
|
17137
|
-
const { mutate: restoreFromFile, isPending: isRestoringFromFile } = (0,
|
|
17103
|
+
const { mutate: restoreFromFile, isPending: isRestoringFromFile } = (0, import_react_query28.useMutation)({
|
|
17138
17104
|
mutationFn: async () => {
|
|
17139
17105
|
if (!restoreFile) {
|
|
17140
17106
|
throw new Error("Please select a backup file");
|
|
@@ -17168,7 +17134,7 @@ function useRestoreAccount() {
|
|
|
17168
17134
|
setError(errorMsg);
|
|
17169
17135
|
}
|
|
17170
17136
|
});
|
|
17171
|
-
const { mutate: restoreFromCloud, isPending: isRestoringFromCloud } = (0,
|
|
17137
|
+
const { mutate: restoreFromCloud, isPending: isRestoringFromCloud } = (0, import_react_query28.useMutation)({
|
|
17172
17138
|
mutationFn: async () => {
|
|
17173
17139
|
alert("Cloud restore not implemented yet");
|
|
17174
17140
|
return null;
|
|
@@ -17187,11 +17153,11 @@ function useRestoreAccount() {
|
|
|
17187
17153
|
isRestoringFromCloud
|
|
17188
17154
|
};
|
|
17189
17155
|
}
|
|
17190
|
-
var
|
|
17156
|
+
var import_react_query28;
|
|
17191
17157
|
var init_useRestoreAccount = __esm({
|
|
17192
17158
|
"src/internal/components/KeyshareRestoreMenu/hooks/useRestoreAccount.ts"() {
|
|
17193
17159
|
init_SessionContext();
|
|
17194
|
-
|
|
17160
|
+
import_react_query28 = require("@tanstack/react-query");
|
|
17195
17161
|
init_useOnRestoreSuccess();
|
|
17196
17162
|
init_useRestoreStore();
|
|
17197
17163
|
}
|
|
@@ -17806,7 +17772,7 @@ var init_File = __esm({
|
|
|
17806
17772
|
function Server(props) {
|
|
17807
17773
|
const { isLoading, mode = "restore", serverHandler, createPasskeyHandler } = props;
|
|
17808
17774
|
const address = useSession((st) => st.address);
|
|
17809
|
-
const qc = (0,
|
|
17775
|
+
const qc = (0, import_react_query29.useQueryClient)();
|
|
17810
17776
|
const { t } = useT();
|
|
17811
17777
|
const usePasskey = useRestoreStore((st) => st.usePasskey);
|
|
17812
17778
|
const setUsePasskey = useRestoreStore((st) => st.setUsePasskey);
|
|
@@ -17854,13 +17820,13 @@ function Server(props) {
|
|
|
17854
17820
|
)
|
|
17855
17821
|
] });
|
|
17856
17822
|
}
|
|
17857
|
-
var
|
|
17823
|
+
var import_react_query29, import_dayjs3, import_lucide_react39, import_react52, import_jsx_runtime76;
|
|
17858
17824
|
var init_Server = __esm({
|
|
17859
17825
|
"src/internal/components/KeyshareRestoreMenu/methods/Server.tsx"() {
|
|
17860
17826
|
init_SessionContext();
|
|
17861
17827
|
init_useT();
|
|
17862
17828
|
init_icons();
|
|
17863
|
-
|
|
17829
|
+
import_react_query29 = require("@tanstack/react-query");
|
|
17864
17830
|
import_dayjs3 = __toESM(require("dayjs"), 1);
|
|
17865
17831
|
import_lucide_react39 = require("lucide-react");
|
|
17866
17832
|
import_react52 = require("react");
|
|
@@ -18017,7 +17983,7 @@ function Cloud2(props) {
|
|
|
18017
17983
|
data: cloudProviders = [],
|
|
18018
17984
|
isLoading: isCloudProvidersLoading,
|
|
18019
17985
|
error: cloudProvidersError
|
|
18020
|
-
} = (0,
|
|
17986
|
+
} = (0, import_react_query30.useQuery)({
|
|
18021
17987
|
retry: false,
|
|
18022
17988
|
enabled: !!passportUserId,
|
|
18023
17989
|
queryKey: [AVAILABLE_CLOUD_PROVIDERS_QUERY_KEY, passportUserId],
|
|
@@ -18091,11 +18057,11 @@ function Cloud2(props) {
|
|
|
18091
18057
|
)
|
|
18092
18058
|
] });
|
|
18093
18059
|
}
|
|
18094
|
-
var
|
|
18060
|
+
var import_react_query30, import_lucide_react41, import_react53, import_jsx_runtime78;
|
|
18095
18061
|
var init_Cloud = __esm({
|
|
18096
18062
|
"src/internal/components/KeyshareRestoreMenu/methods/Cloud.tsx"() {
|
|
18097
18063
|
init_SessionContext();
|
|
18098
|
-
|
|
18064
|
+
import_react_query30 = require("@tanstack/react-query");
|
|
18099
18065
|
import_lucide_react41 = require("lucide-react");
|
|
18100
18066
|
import_react53 = require("react");
|
|
18101
18067
|
init_button();
|
|
@@ -18271,13 +18237,13 @@ var init_methods = __esm({
|
|
|
18271
18237
|
});
|
|
18272
18238
|
|
|
18273
18239
|
// src/internal/components/KeyshareRestoreMenu/KeyshareRestoreMenu.tsx
|
|
18274
|
-
var
|
|
18240
|
+
var import_react_query31, import_lucide_react43, import_react55, import_wagmi4, import_jsx_runtime80, RESTORE_COMPONENTS, KeyshareRestoreMenu;
|
|
18275
18241
|
var init_KeyshareRestoreMenu = __esm({
|
|
18276
18242
|
"src/internal/components/KeyshareRestoreMenu/KeyshareRestoreMenu.tsx"() {
|
|
18277
18243
|
init_ProviderContext();
|
|
18278
18244
|
init_SessionContext();
|
|
18279
18245
|
init_i18n();
|
|
18280
|
-
|
|
18246
|
+
import_react_query31 = require("@tanstack/react-query");
|
|
18281
18247
|
import_lucide_react43 = require("lucide-react");
|
|
18282
18248
|
import_react55 = require("react");
|
|
18283
18249
|
import_wagmi4 = require("wagmi");
|
|
@@ -18302,7 +18268,7 @@ var init_KeyshareRestoreMenu = __esm({
|
|
|
18302
18268
|
guardian: Guardian
|
|
18303
18269
|
};
|
|
18304
18270
|
KeyshareRestoreMenu = () => {
|
|
18305
|
-
const qc = (0,
|
|
18271
|
+
const qc = (0, import_react_query31.useQueryClient)();
|
|
18306
18272
|
const { callbacksRef } = useProviderConfig();
|
|
18307
18273
|
const { t } = useT();
|
|
18308
18274
|
const address = useSession((st) => st.address);
|
|
@@ -18343,7 +18309,7 @@ var init_KeyshareRestoreMenu = __esm({
|
|
|
18343
18309
|
restoreFromCloud,
|
|
18344
18310
|
isRestoringFromCloud
|
|
18345
18311
|
} = useRestoreAccount();
|
|
18346
|
-
const { data: serverRecoveryStatus, isLoading: isBackupStatusLoading } = (0,
|
|
18312
|
+
const { data: serverRecoveryStatus, isLoading: isBackupStatusLoading } = (0, import_react_query31.useQuery)({
|
|
18347
18313
|
retry: false,
|
|
18348
18314
|
queryKey: [CHECK_BACKUP_QUERY_KEY, address],
|
|
18349
18315
|
queryFn: async () => await getShareRecoveryStats()
|
|
@@ -18352,7 +18318,7 @@ var init_KeyshareRestoreMenu = __esm({
|
|
|
18352
18318
|
(0, import_react55.useEffect)(() => {
|
|
18353
18319
|
if (!!hasServerBackup) useRestoreStore.getState().setMethod("server");
|
|
18354
18320
|
}, [hasServerBackup]);
|
|
18355
|
-
const { mutate: disconnect, isPending: isDisconnecting } = (0,
|
|
18321
|
+
const { mutate: disconnect, isPending: isDisconnecting } = (0, import_react_query31.useMutation)({
|
|
18356
18322
|
mutationFn: async () => {
|
|
18357
18323
|
const { setStatus, setIsLoading } = useSession.getState();
|
|
18358
18324
|
const { setError, setMethod } = useRestoreStore.getState();
|
|
@@ -18516,7 +18482,7 @@ function KeyshareBackupMenu() {
|
|
|
18516
18482
|
setMethod(null);
|
|
18517
18483
|
};
|
|
18518
18484
|
}, []);
|
|
18519
|
-
const { data: serverRecoveryStatus, isLoading: isRecoveryLoading } = (0,
|
|
18485
|
+
const { data: serverRecoveryStatus, isLoading: isRecoveryLoading } = (0, import_react_query32.useQuery)({
|
|
18520
18486
|
retry: false,
|
|
18521
18487
|
enabled: !!address,
|
|
18522
18488
|
queryKey: [CHECK_BACKUP_QUERY_KEY, address],
|
|
@@ -18651,12 +18617,12 @@ function KeyshareBackupMenu() {
|
|
|
18651
18617
|
}
|
|
18652
18618
|
);
|
|
18653
18619
|
}
|
|
18654
|
-
var
|
|
18620
|
+
var import_react_query32, import_lucide_react44, import_react56, import_jsx_runtime81, COMPONENTS;
|
|
18655
18621
|
var init_KeyshareBackupMenu = __esm({
|
|
18656
18622
|
"src/internal/components/KeyshareRestoreMenu/KeyshareBackupMenu.tsx"() {
|
|
18657
18623
|
init_SessionContext();
|
|
18658
18624
|
init_i18n();
|
|
18659
|
-
|
|
18625
|
+
import_react_query32 = require("@tanstack/react-query");
|
|
18660
18626
|
import_lucide_react44 = require("lucide-react");
|
|
18661
18627
|
import_react56 = require("react");
|
|
18662
18628
|
init_useLayoutDataStore();
|
|
@@ -18971,18 +18937,18 @@ var init_KycMenu = __esm({
|
|
|
18971
18937
|
// src/internal/hooks/useUserProfile.ts
|
|
18972
18938
|
function useUserProfile() {
|
|
18973
18939
|
const address = useSession((st) => st.address);
|
|
18974
|
-
return (0,
|
|
18940
|
+
return (0, import_react_query33.useQuery)({
|
|
18975
18941
|
queryKey: [QUERY_KEYS.userProfile, address],
|
|
18976
18942
|
queryFn: getUserProfile,
|
|
18977
18943
|
enabled: !!address,
|
|
18978
18944
|
retry: false
|
|
18979
18945
|
});
|
|
18980
18946
|
}
|
|
18981
|
-
var
|
|
18947
|
+
var import_react_query33;
|
|
18982
18948
|
var init_useUserProfile = __esm({
|
|
18983
18949
|
"src/internal/hooks/useUserProfile.ts"() {
|
|
18984
18950
|
init_SessionContext();
|
|
18985
|
-
|
|
18951
|
+
import_react_query33 = require("@tanstack/react-query");
|
|
18986
18952
|
init_profile();
|
|
18987
18953
|
}
|
|
18988
18954
|
});
|
|
@@ -19300,7 +19266,7 @@ function useNicknameAvailability(currentNickname) {
|
|
|
19300
19266
|
if (!currentNickname) return;
|
|
19301
19267
|
useNicknameStore.getState().setNicknameValue(currentNickname);
|
|
19302
19268
|
}, [currentNickname]);
|
|
19303
|
-
const { mutate: checkAvailability, isPending: isCheckingAvailability } = (0,
|
|
19269
|
+
const { mutate: checkAvailability, isPending: isCheckingAvailability } = (0, import_react_query34.useMutation)({
|
|
19304
19270
|
mutationFn: async (newNickname) => {
|
|
19305
19271
|
useNicknameStore.getState().setError(null);
|
|
19306
19272
|
useNicknameStore.getState().setAvailability(null);
|
|
@@ -19332,11 +19298,11 @@ function useNicknameAvailability(currentNickname) {
|
|
|
19332
19298
|
}, [nicknameValue, currentNickname, debouncedCheckAvailability]);
|
|
19333
19299
|
return { isCheckingAvailability };
|
|
19334
19300
|
}
|
|
19335
|
-
var
|
|
19301
|
+
var import_react_query34, import_lodash_es10, import_react60, DEBOUNCE_MS;
|
|
19336
19302
|
var init_useNicknameAvailability = __esm({
|
|
19337
19303
|
"src/internal/components/NicknameMenu/useNicknameAvailability.ts"() {
|
|
19338
19304
|
init_i18n();
|
|
19339
|
-
|
|
19305
|
+
import_react_query34 = require("@tanstack/react-query");
|
|
19340
19306
|
import_lodash_es10 = require("lodash-es");
|
|
19341
19307
|
import_react60 = require("react");
|
|
19342
19308
|
init_nickname();
|
|
@@ -19351,7 +19317,7 @@ var init_useNicknameAvailability = __esm({
|
|
|
19351
19317
|
function NicknameEditForm(props) {
|
|
19352
19318
|
const { isInitialUser, nicknameInfo } = props;
|
|
19353
19319
|
const { handle: currentNickname, canChange } = nicknameInfo || { handle: "", canChange: false };
|
|
19354
|
-
const qc = (0,
|
|
19320
|
+
const qc = (0, import_react_query35.useQueryClient)();
|
|
19355
19321
|
const { t } = useT();
|
|
19356
19322
|
const address = useSession((st) => st.address);
|
|
19357
19323
|
const { callbacksRef } = useProviderConfig();
|
|
@@ -19360,7 +19326,7 @@ function NicknameEditForm(props) {
|
|
|
19360
19326
|
const nicknameAvailability = useNicknameStore((st) => st.availability);
|
|
19361
19327
|
const { isCheckingAvailability } = useNicknameAvailability(nicknameInfo ? nicknameInfo.handle : "");
|
|
19362
19328
|
const [isNicknameCopied, setIsNicknameCopied] = (0, import_react61.useState)(false);
|
|
19363
|
-
const { mutate: changeNickname2, isPending: isNicknameChanging } = (0,
|
|
19329
|
+
const { mutate: changeNickname2, isPending: isNicknameChanging } = (0, import_react_query35.useMutation)({
|
|
19364
19330
|
mutationFn: (handle) => changeNickname(handle),
|
|
19365
19331
|
onSuccess: () => {
|
|
19366
19332
|
qc.invalidateQueries({ queryKey: [QUERY_KEYS.nicknameInfo] });
|
|
@@ -19493,13 +19459,13 @@ function NicknameEditForm(props) {
|
|
|
19493
19459
|
!!canChange && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "w-full flex items-center leadding-4 text-[10px] text-[var(--ui-kit-fg-muted)]", children: t("passport:nicknameMenu.hint") })
|
|
19494
19460
|
] });
|
|
19495
19461
|
}
|
|
19496
|
-
var
|
|
19462
|
+
var import_react_query35, import_lucide_react49, import_react61, import_jsx_runtime87;
|
|
19497
19463
|
var init_NicknameEditForm = __esm({
|
|
19498
19464
|
"src/internal/components/NicknameMenu/NicknameEditForm.tsx"() {
|
|
19499
19465
|
init_ProviderContext();
|
|
19500
19466
|
init_SessionContext();
|
|
19501
19467
|
init_i18n();
|
|
19502
|
-
|
|
19468
|
+
import_react_query35 = require("@tanstack/react-query");
|
|
19503
19469
|
import_lucide_react49 = require("lucide-react");
|
|
19504
19470
|
import_react61 = require("react");
|
|
19505
19471
|
init_icons();
|
|
@@ -19545,7 +19511,7 @@ function NicknameMenu() {
|
|
|
19545
19511
|
data: nicknameInfo,
|
|
19546
19512
|
isLoading: isNicknameInfoLoading,
|
|
19547
19513
|
error: nicknameInfoError
|
|
19548
|
-
} = (0,
|
|
19514
|
+
} = (0, import_react_query36.useQuery)({
|
|
19549
19515
|
retry: 1,
|
|
19550
19516
|
enabled: !!address,
|
|
19551
19517
|
queryKey: [QUERY_KEYS.nicknameInfo, address],
|
|
@@ -19624,13 +19590,13 @@ function NicknameMenu() {
|
|
|
19624
19590
|
}
|
|
19625
19591
|
);
|
|
19626
19592
|
}
|
|
19627
|
-
var
|
|
19593
|
+
var import_react_query36, import_dayjs4, import_lucide_react50, import_react62, import_jsx_runtime88;
|
|
19628
19594
|
var init_NicknameMenu = __esm({
|
|
19629
19595
|
"src/internal/components/NicknameMenu/NicknameMenu.tsx"() {
|
|
19630
19596
|
init_SessionContext();
|
|
19631
19597
|
init_useOpenPage();
|
|
19632
19598
|
init_i18n();
|
|
19633
|
-
|
|
19599
|
+
import_react_query36 = require("@tanstack/react-query");
|
|
19634
19600
|
import_dayjs4 = __toESM(require("dayjs"), 1);
|
|
19635
19601
|
import_lucide_react50 = require("lucide-react");
|
|
19636
19602
|
import_react62 = require("react");
|
|
@@ -19733,7 +19699,7 @@ var init_constants6 = __esm({
|
|
|
19733
19699
|
// src/internal/hooks/useBlockscoutAssets/useNativeBalance.ts
|
|
19734
19700
|
function useNativeBalance(options) {
|
|
19735
19701
|
const { enabled, address, chainId, publicClient, nativeCurrency } = options;
|
|
19736
|
-
return (0,
|
|
19702
|
+
return (0, import_react_query37.useQuery)({
|
|
19737
19703
|
enabled: enabled && !!address && !!publicClient && !!nativeCurrency?.symbol,
|
|
19738
19704
|
...BALANCE_DEFAULT_QUERY_CFG,
|
|
19739
19705
|
queryKey: [NATIVE_BALANCE_QUERY_KEY2, chainId, address],
|
|
@@ -19748,10 +19714,10 @@ function useNativeBalance(options) {
|
|
|
19748
19714
|
}
|
|
19749
19715
|
});
|
|
19750
19716
|
}
|
|
19751
|
-
var
|
|
19717
|
+
var import_react_query37, import_viem6;
|
|
19752
19718
|
var init_useNativeBalance = __esm({
|
|
19753
19719
|
"src/internal/hooks/useBlockscoutAssets/useNativeBalance.ts"() {
|
|
19754
|
-
|
|
19720
|
+
import_react_query37 = require("@tanstack/react-query");
|
|
19755
19721
|
import_viem6 = require("viem");
|
|
19756
19722
|
init_constants6();
|
|
19757
19723
|
}
|
|
@@ -19766,7 +19732,7 @@ function useWatchTokens(options) {
|
|
|
19766
19732
|
const tokensForChain = chainId ? allWatchTokens?.[chainId] || [] : [];
|
|
19767
19733
|
return tokensForChain;
|
|
19768
19734
|
}, [config, chainId]);
|
|
19769
|
-
return (0,
|
|
19735
|
+
return (0, import_react_query38.useQuery)({
|
|
19770
19736
|
enabled: !!publicClient && !!address && enabled && watchTokens.length > 0,
|
|
19771
19737
|
...BALANCE_DEFAULT_QUERY_CFG,
|
|
19772
19738
|
queryKey: [WATCH_TOKENS_QUERY_KEY, chainId, address, watchTokens.map((t) => t.address).join(",")],
|
|
@@ -19829,11 +19795,11 @@ function useWatchTokens(options) {
|
|
|
19829
19795
|
}
|
|
19830
19796
|
});
|
|
19831
19797
|
}
|
|
19832
|
-
var
|
|
19798
|
+
var import_react_query38, import_react64, import_viem7;
|
|
19833
19799
|
var init_useWatchTokens = __esm({
|
|
19834
19800
|
"src/internal/hooks/useBlockscoutAssets/useWatchTokens.ts"() {
|
|
19835
19801
|
init_ProviderContext();
|
|
19836
|
-
|
|
19802
|
+
import_react_query38 = require("@tanstack/react-query");
|
|
19837
19803
|
import_react64 = require("react");
|
|
19838
19804
|
import_viem7 = require("viem");
|
|
19839
19805
|
init_constants6();
|
|
@@ -19975,7 +19941,7 @@ var init_utils8 = __esm({
|
|
|
19975
19941
|
// src/internal/hooks/useBlockscoutAssets/useBlockscoutAssets.ts
|
|
19976
19942
|
function useBlockscoutAssets(options) {
|
|
19977
19943
|
const { address, chainId, enabled = true, detectSecurityTokens = true } = options;
|
|
19978
|
-
const qc = (0,
|
|
19944
|
+
const qc = (0, import_react_query39.useQueryClient)();
|
|
19979
19945
|
const { chainConfig, publicClient, resolvedChainId } = useResolvedPublicClient(chainId, "useBlockscoutAssets");
|
|
19980
19946
|
const {
|
|
19981
19947
|
//
|
|
@@ -20013,7 +19979,7 @@ function useBlockscoutAssets(options) {
|
|
|
20013
19979
|
data: coreTokenBalances = [],
|
|
20014
19980
|
isLoading: coreTokensLoading,
|
|
20015
19981
|
isFetching: coreTokensFetching
|
|
20016
|
-
} = (0,
|
|
19982
|
+
} = (0, import_react_query39.useQuery)({
|
|
20017
19983
|
enabled: !!address && enabled && !blockscoutClient && !customTokenBalancesQuery && !customTokenBalancesQueryKey,
|
|
20018
19984
|
...BALANCE_DEFAULT_QUERY_CFG,
|
|
20019
19985
|
queryKey: [`NON-${BLOCKSCOUT_QUERY_KEY}`, resolvedChainId, address],
|
|
@@ -20029,7 +19995,7 @@ function useBlockscoutAssets(options) {
|
|
|
20029
19995
|
data: customItems = [],
|
|
20030
19996
|
isLoading: customLoading,
|
|
20031
19997
|
isFetching: customFetching
|
|
20032
|
-
} = (0,
|
|
19998
|
+
} = (0, import_react_query39.useQuery)({
|
|
20033
19999
|
enabled: !!address && enabled && !blockscoutClient && !!customTokenBalancesQuery && !!customTokenBalancesQueryKey,
|
|
20034
20000
|
...BALANCE_DEFAULT_QUERY_CFG,
|
|
20035
20001
|
queryKey: customTokenBalancesQueryKey,
|
|
@@ -20042,7 +20008,7 @@ function useBlockscoutAssets(options) {
|
|
|
20042
20008
|
isFetching: blockscoutFetching,
|
|
20043
20009
|
error: blockscoutError,
|
|
20044
20010
|
dataUpdatedAt
|
|
20045
|
-
} = (0,
|
|
20011
|
+
} = (0, import_react_query39.useQuery)({
|
|
20046
20012
|
enabled: !!address && enabled && !!blockscoutClient && !customTokenBalancesQuery && !customTokenBalancesQueryKey,
|
|
20047
20013
|
...BALANCE_DEFAULT_QUERY_CFG,
|
|
20048
20014
|
queryKey: [BLOCKSCOUT_QUERY_KEY, resolvedChainId, blockscoutApiUrl, address],
|
|
@@ -20053,7 +20019,7 @@ function useBlockscoutAssets(options) {
|
|
|
20053
20019
|
data: nftItems,
|
|
20054
20020
|
isLoading: nftsLoading,
|
|
20055
20021
|
isFetching: nftsFetching
|
|
20056
|
-
} = (0,
|
|
20022
|
+
} = (0, import_react_query39.useQuery)({
|
|
20057
20023
|
enabled: !!address && enabled && !!blockscoutClient,
|
|
20058
20024
|
...BALANCE_DEFAULT_QUERY_CFG,
|
|
20059
20025
|
queryKey: [BLOCKSCOUT_QUERY_KEY, "nfts", resolvedChainId, blockscoutApiUrl, address],
|
|
@@ -20063,7 +20029,7 @@ function useBlockscoutAssets(options) {
|
|
|
20063
20029
|
if (!blockscoutItems) return [];
|
|
20064
20030
|
return blockscoutItems.filter((tb) => tb.token.type === "ERC-20").map((tb) => tb.token.address_hash);
|
|
20065
20031
|
}, [blockscoutItems]);
|
|
20066
|
-
const { data: erc3643Results } = (0,
|
|
20032
|
+
const { data: erc3643Results } = (0, import_react_query39.useQuery)({
|
|
20067
20033
|
queryKey: [ERC3643_DETECTION_QUERY_KEY, resolvedChainId, address, erc20TokenAddresses],
|
|
20068
20034
|
queryFn: async () => {
|
|
20069
20035
|
if (!publicClient || erc20TokenAddresses.length === 0) {
|
|
@@ -20245,12 +20211,12 @@ function useBlockscoutAssets(options) {
|
|
|
20245
20211
|
lastUpdated: dataUpdatedAt || null
|
|
20246
20212
|
};
|
|
20247
20213
|
}
|
|
20248
|
-
var import_core4,
|
|
20214
|
+
var import_core4, import_react_query39, import_react65;
|
|
20249
20215
|
var init_useBlockscoutAssets = __esm({
|
|
20250
20216
|
"src/internal/hooks/useBlockscoutAssets/useBlockscoutAssets.ts"() {
|
|
20251
20217
|
init_ProviderContext();
|
|
20252
20218
|
import_core4 = require("@embarkai/core");
|
|
20253
|
-
|
|
20219
|
+
import_react_query39 = require("@tanstack/react-query");
|
|
20254
20220
|
import_react65 = require("react");
|
|
20255
20221
|
init_initial();
|
|
20256
20222
|
init_constants();
|
|
@@ -20420,7 +20386,7 @@ function PortfolioItem(props) {
|
|
|
20420
20386
|
queryKey: asset.balanceQueryKey,
|
|
20421
20387
|
queryFn: asset.balanceQuery
|
|
20422
20388
|
} : void 0;
|
|
20423
|
-
const { data: projectAssetBalance } = (0,
|
|
20389
|
+
const { data: projectAssetBalance } = (0, import_react_query40.useQuery)({
|
|
20424
20390
|
enabled: !!projectAssetQuery,
|
|
20425
20391
|
retry: false,
|
|
20426
20392
|
queryKey: projectAssetQuery?.queryKey ?? ["project-asset-balance-disabled", asset.symbol],
|
|
@@ -20430,7 +20396,7 @@ function PortfolioItem(props) {
|
|
|
20430
20396
|
const isSecurity = isSecurityToken(asset);
|
|
20431
20397
|
const embeddedRate = Number(asset.exchangeRateUsd || 0);
|
|
20432
20398
|
const hasEmbeddedRate = Number.isFinite(embeddedRate) && embeddedRate > 0;
|
|
20433
|
-
const { data: assetRate, isLoading: isRateLoading } = (0,
|
|
20399
|
+
const { data: assetRate, isLoading: isRateLoading } = (0, import_react_query40.useQuery)({
|
|
20434
20400
|
enabled: !!address && !hasEmbeddedRate && !isProjectAsset && !isNft && !isSecurity,
|
|
20435
20401
|
// (!!customAssetRateQuery || !!isAssetRateAvailable(asset.symbol)),
|
|
20436
20402
|
retry: false,
|
|
@@ -20503,11 +20469,11 @@ function PortfolioItem(props) {
|
|
|
20503
20469
|
}
|
|
20504
20470
|
);
|
|
20505
20471
|
}
|
|
20506
|
-
var
|
|
20472
|
+
var import_react_query40, import_lucide_react51, import_viem10, import_jsx_runtime90, PORTFOLIO_ASSET_RATE_QUERY_KEY;
|
|
20507
20473
|
var init_PortfolioItem = __esm({
|
|
20508
20474
|
"src/internal/components/PortfolioMenu/PortfolioItem.tsx"() {
|
|
20509
20475
|
init_ProviderContext();
|
|
20510
|
-
|
|
20476
|
+
import_react_query40 = require("@tanstack/react-query");
|
|
20511
20477
|
import_lucide_react51 = require("lucide-react");
|
|
20512
20478
|
import_viem10 = require("viem");
|
|
20513
20479
|
init_no_image();
|
|
@@ -20527,7 +20493,7 @@ var init_PortfolioItem = __esm({
|
|
|
20527
20493
|
function PortfolioMenu() {
|
|
20528
20494
|
const { assets: projectAssets = [] } = useProviderConfig().config.current?.projectAssets || {};
|
|
20529
20495
|
const { t } = useT();
|
|
20530
|
-
const qc = (0,
|
|
20496
|
+
const qc = (0, import_react_query41.useQueryClient)();
|
|
20531
20497
|
const address = useSession((st) => st.address);
|
|
20532
20498
|
const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
|
|
20533
20499
|
const {
|
|
@@ -20598,13 +20564,13 @@ function PortfolioMenu() {
|
|
|
20598
20564
|
}
|
|
20599
20565
|
);
|
|
20600
20566
|
}
|
|
20601
|
-
var
|
|
20567
|
+
var import_react_query41, import_lucide_react52, import_react66, import_jsx_runtime91;
|
|
20602
20568
|
var init_PortfolioMenu = __esm({
|
|
20603
20569
|
"src/internal/components/PortfolioMenu/PortfolioMenu.tsx"() {
|
|
20604
20570
|
init_ProviderContext();
|
|
20605
20571
|
init_SessionContext();
|
|
20606
20572
|
init_i18n();
|
|
20607
|
-
|
|
20573
|
+
import_react_query41 = require("@tanstack/react-query");
|
|
20608
20574
|
import_lucide_react52 = require("lucide-react");
|
|
20609
20575
|
import_react66 = require("react");
|
|
20610
20576
|
init_useBlockscoutAssets2();
|
|
@@ -20726,7 +20692,7 @@ function ReceiveMenu() {
|
|
|
20726
20692
|
const session = useSession((st) => st.session);
|
|
20727
20693
|
const chainConfig = useSession((st) => st.chainConfig);
|
|
20728
20694
|
const address = session?.smartAccountAddress ?? null;
|
|
20729
|
-
const { data: nicknameInfo, isLoading: isNicknameInfoLoading } = (0,
|
|
20695
|
+
const { data: nicknameInfo, isLoading: isNicknameInfoLoading } = (0, import_react_query42.useQuery)({
|
|
20730
20696
|
retry: 1,
|
|
20731
20697
|
enabled: !!address,
|
|
20732
20698
|
queryKey: [QUERY_KEYS.nicknameInfo, address],
|
|
@@ -20856,12 +20822,12 @@ function ReceiveMenu() {
|
|
|
20856
20822
|
}
|
|
20857
20823
|
);
|
|
20858
20824
|
}
|
|
20859
|
-
var
|
|
20825
|
+
var import_react_query42, import_lucide_react53, import_qrcode, import_react67, import_jsx_runtime92;
|
|
20860
20826
|
var init_ReceiveMenu = __esm({
|
|
20861
20827
|
"src/internal/components/ReceiveMenu/ReceiveMenu.tsx"() {
|
|
20862
20828
|
init_SessionContext();
|
|
20863
20829
|
init_i18n();
|
|
20864
|
-
|
|
20830
|
+
import_react_query42 = require("@tanstack/react-query");
|
|
20865
20831
|
import_lucide_react53 = require("lucide-react");
|
|
20866
20832
|
import_qrcode = __toESM(require("qrcode"), 1);
|
|
20867
20833
|
import_react67 = require("react");
|
|
@@ -20962,7 +20928,7 @@ var init_constants7 = __esm({
|
|
|
20962
20928
|
function useConnectedApps() {
|
|
20963
20929
|
const session = useSession((st) => st.session);
|
|
20964
20930
|
const userId = session?.mpcUserId || null;
|
|
20965
|
-
return (0,
|
|
20931
|
+
return (0, import_react_query43.useQuery)({
|
|
20966
20932
|
retry: false,
|
|
20967
20933
|
enabled: !!userId,
|
|
20968
20934
|
queryKey: [CONNECTED_TRUSTED_APPS_QUERY, userId],
|
|
@@ -20975,11 +20941,11 @@ function useConnectedApps() {
|
|
|
20975
20941
|
}
|
|
20976
20942
|
});
|
|
20977
20943
|
}
|
|
20978
|
-
var
|
|
20944
|
+
var import_react_query43;
|
|
20979
20945
|
var init_useConnectedApps = __esm({
|
|
20980
20946
|
"src/internal/components/SecurityMenu/ConnectedApps/useConnectedApps.ts"() {
|
|
20981
20947
|
init_SessionContext();
|
|
20982
|
-
|
|
20948
|
+
import_react_query43 = require("@tanstack/react-query");
|
|
20983
20949
|
init_httpClient();
|
|
20984
20950
|
init_constants7();
|
|
20985
20951
|
}
|
|
@@ -21131,10 +21097,10 @@ var init_ConnectedApps = __esm({
|
|
|
21131
21097
|
// src/internal/components/SecurityMenu/ConnectedApps/UntrustApplication.tsx
|
|
21132
21098
|
function UntrustApplication() {
|
|
21133
21099
|
const { t } = useT();
|
|
21134
|
-
const qc = (0,
|
|
21100
|
+
const qc = (0, import_react_query44.useQueryClient)();
|
|
21135
21101
|
const userId = useSession((st) => st?.session?.mpcUserId);
|
|
21136
21102
|
const appToUntrust = useSecurityStore((st) => st.appToUntrust);
|
|
21137
|
-
const { mutate: handleUntrustApp, isPending: isUntrustingApp } = (0,
|
|
21103
|
+
const { mutate: handleUntrustApp, isPending: isUntrustingApp } = (0, import_react_query44.useMutation)({
|
|
21138
21104
|
mutationFn: async () => {
|
|
21139
21105
|
if (!userId || !appToUntrust) return;
|
|
21140
21106
|
const iframeManager = getIframeManager();
|
|
@@ -21210,12 +21176,12 @@ function UntrustApplication() {
|
|
|
21210
21176
|
] })
|
|
21211
21177
|
] });
|
|
21212
21178
|
}
|
|
21213
|
-
var
|
|
21179
|
+
var import_react_query44, import_lucide_react55, import_jsx_runtime94;
|
|
21214
21180
|
var init_UntrustApplication = __esm({
|
|
21215
21181
|
"src/internal/components/SecurityMenu/ConnectedApps/UntrustApplication.tsx"() {
|
|
21216
21182
|
init_SessionContext();
|
|
21217
21183
|
init_i18n();
|
|
21218
|
-
|
|
21184
|
+
import_react_query44 = require("@tanstack/react-query");
|
|
21219
21185
|
import_lucide_react55 = require("lucide-react");
|
|
21220
21186
|
init_iframe_manager();
|
|
21221
21187
|
init_button();
|
|
@@ -21347,7 +21313,7 @@ var init_LastBackup = __esm({
|
|
|
21347
21313
|
function useKeyshareRecoveryStats() {
|
|
21348
21314
|
const session = useSession((st) => st.session);
|
|
21349
21315
|
const userId = session?.mpcUserId || null;
|
|
21350
|
-
return (0,
|
|
21316
|
+
return (0, import_react_query45.useQuery)({
|
|
21351
21317
|
enabled: !!userId,
|
|
21352
21318
|
queryKey: [KEYSHARE_RECOVERY_STATS_QUERY, userId],
|
|
21353
21319
|
queryFn: async () => {
|
|
@@ -21364,11 +21330,11 @@ function useKeyshareRecoveryStats() {
|
|
|
21364
21330
|
}
|
|
21365
21331
|
});
|
|
21366
21332
|
}
|
|
21367
|
-
var
|
|
21333
|
+
var import_react_query45;
|
|
21368
21334
|
var init_useKeyshareRecoveryStats = __esm({
|
|
21369
21335
|
"src/internal/components/SecurityMenu/Keyshare/useKeyshareRecoveryStats.ts"() {
|
|
21370
21336
|
init_SessionContext();
|
|
21371
|
-
|
|
21337
|
+
import_react_query45 = require("@tanstack/react-query");
|
|
21372
21338
|
init_keyshare();
|
|
21373
21339
|
init_iframe_manager();
|
|
21374
21340
|
init_vaultClient();
|
|
@@ -22204,7 +22170,7 @@ function useHyperlaneHistory() {
|
|
|
22204
22170
|
const page = useLayoutDataStore((st) => st.page);
|
|
22205
22171
|
const flow = useFlowSelectorStore((st) => st.flow);
|
|
22206
22172
|
const bridgeStep = useBridgeStore((st) => st.bridgeStep);
|
|
22207
|
-
const query = (0,
|
|
22173
|
+
const query = (0, import_react_query46.useInfiniteQuery)({
|
|
22208
22174
|
retry: false,
|
|
22209
22175
|
initialPageParam: 1,
|
|
22210
22176
|
refetchInterval: TX_HISTORY_POLLING_INTERVAL,
|
|
@@ -22219,11 +22185,11 @@ function useHyperlaneHistory() {
|
|
|
22219
22185
|
);
|
|
22220
22186
|
return { query, txList };
|
|
22221
22187
|
}
|
|
22222
|
-
var
|
|
22188
|
+
var import_react_query46, import_react70, HYPERLANE_HISTORY_QUERY_KEY, TX_HISTORY_PAGE_SIZE, TX_HISTORY_POLLING_INTERVAL;
|
|
22223
22189
|
var init_useHyperlaneHistory = __esm({
|
|
22224
22190
|
"src/internal/components/SendMenu/hyperbridge/hooks/useHyperlaneHistory.ts"() {
|
|
22225
22191
|
init_SessionContext();
|
|
22226
|
-
|
|
22192
|
+
import_react_query46 = require("@tanstack/react-query");
|
|
22227
22193
|
import_react70 = require("react");
|
|
22228
22194
|
init_useLayoutDataStore();
|
|
22229
22195
|
init_useFlowSelector();
|
|
@@ -22251,7 +22217,7 @@ var init_useOperationHashesStore = __esm({
|
|
|
22251
22217
|
|
|
22252
22218
|
// src/internal/components/SendMenu/hyperbridge/hooks/useBridge.ts
|
|
22253
22219
|
function useBridge() {
|
|
22254
|
-
const qc = (0,
|
|
22220
|
+
const qc = (0, import_react_query47.useQueryClient)();
|
|
22255
22221
|
const { t } = useT();
|
|
22256
22222
|
const address = useSession((st) => st.address);
|
|
22257
22223
|
const { data: walletClient } = (0, import_wagmi5.useWalletClient)();
|
|
@@ -22269,7 +22235,7 @@ function useBridge() {
|
|
|
22269
22235
|
setOriginChain(destinationChain);
|
|
22270
22236
|
setDestinationChain(originChain);
|
|
22271
22237
|
}, []);
|
|
22272
|
-
const { mutate: estimateQuote } = (0,
|
|
22238
|
+
const { mutate: estimateQuote } = (0, import_react_query47.useMutation)({
|
|
22273
22239
|
mutationFn: async (amountToBridge) => {
|
|
22274
22240
|
useFlowSelectorStore.getState().setError(null);
|
|
22275
22241
|
useFlowSelectorStore.getState().setIsUiLocked(true);
|
|
@@ -22336,7 +22302,7 @@ function useBridge() {
|
|
|
22336
22302
|
})
|
|
22337
22303
|
);
|
|
22338
22304
|
}, []);
|
|
22339
|
-
const { mutate: bridgeAsset, isPending: isAssetBridging } = (0,
|
|
22305
|
+
const { mutate: bridgeAsset, isPending: isAssetBridging } = (0, import_react_query47.useMutation)({
|
|
22340
22306
|
mutationFn: async () => {
|
|
22341
22307
|
const directWalletAddress = useExternalWalletStore.getState().externalAddress;
|
|
22342
22308
|
const directWalletChainId = useExternalWalletStore.getState().externalChainId;
|
|
@@ -22442,12 +22408,12 @@ function useBridge() {
|
|
|
22442
22408
|
isAssetBridging
|
|
22443
22409
|
};
|
|
22444
22410
|
}
|
|
22445
|
-
var
|
|
22411
|
+
var import_react_query47, import_react71, import_wagmi5;
|
|
22446
22412
|
var init_useBridge = __esm({
|
|
22447
22413
|
"src/internal/components/SendMenu/hyperbridge/hooks/useBridge.ts"() {
|
|
22448
22414
|
init_SessionContext();
|
|
22449
22415
|
init_i18n();
|
|
22450
|
-
|
|
22416
|
+
import_react_query47 = require("@tanstack/react-query");
|
|
22451
22417
|
import_react71 = require("react");
|
|
22452
22418
|
import_wagmi5 = require("wagmi");
|
|
22453
22419
|
init_useLayoutStore();
|
|
@@ -22473,7 +22439,7 @@ function useHyperlaneRoutes() {
|
|
|
22473
22439
|
data: hyperlaneWarpRoutes = [],
|
|
22474
22440
|
isLoading: isLoadingWarpRoutes,
|
|
22475
22441
|
error: errorWarpRoutes
|
|
22476
|
-
} = (0,
|
|
22442
|
+
} = (0, import_react_query48.useQuery)({
|
|
22477
22443
|
retry: false,
|
|
22478
22444
|
enabled: !!address && page === "send" /* SEND */ && flow === "bridge",
|
|
22479
22445
|
queryKey: [HYPERLANE_WARP_ROUTES_QUERY_KEY, address],
|
|
@@ -22513,11 +22479,11 @@ function useHyperlaneRoutes() {
|
|
|
22513
22479
|
}, [hyperRoute, hyperlaneWarpRoutes]);
|
|
22514
22480
|
return { hyperlaneWarpRoutes, isLoadingWarpRoutes };
|
|
22515
22481
|
}
|
|
22516
|
-
var
|
|
22482
|
+
var import_react_query48, import_react72, HYPERLANE_WARP_ROUTES_QUERY_KEY;
|
|
22517
22483
|
var init_useHyperlaneRoutes = __esm({
|
|
22518
22484
|
"src/internal/components/SendMenu/hyperbridge/hooks/useHyperlaneRoutes.ts"() {
|
|
22519
22485
|
init_SessionContext();
|
|
22520
|
-
|
|
22486
|
+
import_react_query48 = require("@tanstack/react-query");
|
|
22521
22487
|
import_react72 = require("react");
|
|
22522
22488
|
init_useLayoutDataStore();
|
|
22523
22489
|
init_useFlowSelector();
|
|
@@ -22729,7 +22695,7 @@ var init_ResolveChainIcon = __esm({
|
|
|
22729
22695
|
|
|
22730
22696
|
// src/internal/components/SendMenu/hyperbridge/hooks/useBridgeBalance.ts
|
|
22731
22697
|
function useBridgeBalance(isLoadingWarpRoutes, hyperlaneWarpRoutes) {
|
|
22732
|
-
const qc = (0,
|
|
22698
|
+
const qc = (0, import_react_query49.useQueryClient)();
|
|
22733
22699
|
const { t } = useT();
|
|
22734
22700
|
const address = useSession((st) => st.address);
|
|
22735
22701
|
const activeChainId = useSession((st) => st.activeChainId);
|
|
@@ -22757,7 +22723,7 @@ function useBridgeBalance(isLoadingWarpRoutes, hyperlaneWarpRoutes) {
|
|
|
22757
22723
|
const embarkTokenBalanace = assets.find((a) => selectedWarpRoute?.symbol === checkWrapedTokenSymbol(a.symbol));
|
|
22758
22724
|
const originChainMeta = CHAINS_UI_META[originChain];
|
|
22759
22725
|
const isSelectedTokenNative = selectedWarpRoute?.symbol?.toUpperCase() === originChainMeta?.chain?.nativeCurrency?.symbol?.toUpperCase();
|
|
22760
|
-
const { data: externalBalanceData, isLoading: isExternalBalanceLoading } = (0,
|
|
22726
|
+
const { data: externalBalanceData, isLoading: isExternalBalanceLoading } = (0, import_react_query49.useQuery)({
|
|
22761
22727
|
retry: false,
|
|
22762
22728
|
enabled: bridgeSender === "direct-wallet" && !isSelectedTokenNative && !!directWalletAddress && !!routeTokenAddress && !!originChain,
|
|
22763
22729
|
queryKey: [EXTERNAL_WALLET_BRIDGING_BALANCE_QUERY, originChain, directWalletAddress, routeTokenAddress],
|
|
@@ -22800,7 +22766,7 @@ function useBridgeBalance(isLoadingWarpRoutes, hyperlaneWarpRoutes) {
|
|
|
22800
22766
|
return { value, decimals, symbol, formatted };
|
|
22801
22767
|
}
|
|
22802
22768
|
});
|
|
22803
|
-
const { data: externalNativeBalanceData, isLoading: isExternalNativeBalanceLoading } = (0,
|
|
22769
|
+
const { data: externalNativeBalanceData, isLoading: isExternalNativeBalanceLoading } = (0, import_react_query49.useQuery)({
|
|
22804
22770
|
retry: false,
|
|
22805
22771
|
enabled: bridgeSender === "direct-wallet" && isSelectedTokenNative && !!directWalletAddress && !!originChain,
|
|
22806
22772
|
queryKey: [EXTERNAL_WALLET_BRIDGING_NATIVE_BALANCE_QUERY, originChain, directWalletAddress],
|
|
@@ -22862,13 +22828,13 @@ function useBridgeBalance(isLoadingWarpRoutes, hyperlaneWarpRoutes) {
|
|
|
22862
22828
|
isRouteTokenBalanceLoading: isAssetsLoading || isExternalBalanceLoading || isExternalNativeBalanceLoading
|
|
22863
22829
|
};
|
|
22864
22830
|
}
|
|
22865
|
-
var import_core8,
|
|
22831
|
+
var import_core8, import_react_query49, import_react74, import_viem14, import_wagmi6, EXTERNAL_WALLET_BRIDGING_BALANCE_QUERY, EXTERNAL_WALLET_BRIDGING_NATIVE_BALANCE_QUERY;
|
|
22866
22832
|
var init_useBridgeBalance = __esm({
|
|
22867
22833
|
"src/internal/components/SendMenu/hyperbridge/hooks/useBridgeBalance.ts"() {
|
|
22868
22834
|
init_SessionContext();
|
|
22869
22835
|
init_i18n();
|
|
22870
22836
|
import_core8 = require("@embarkai/core");
|
|
22871
|
-
|
|
22837
|
+
import_react_query49 = require("@tanstack/react-query");
|
|
22872
22838
|
import_react74 = require("react");
|
|
22873
22839
|
import_viem14 = require("viem");
|
|
22874
22840
|
import_wagmi6 = require("wagmi");
|
|
@@ -23543,7 +23509,7 @@ function HistoryItem(props) {
|
|
|
23543
23509
|
txStatus
|
|
23544
23510
|
} = props;
|
|
23545
23511
|
const { t } = useT();
|
|
23546
|
-
const qc = (0,
|
|
23512
|
+
const qc = (0, import_react_query50.useQueryClient)();
|
|
23547
23513
|
const address = useSession((st) => st.address);
|
|
23548
23514
|
const warpRoutes = qc.getQueryData([HYPERLANE_WARP_ROUTES_QUERY_KEY, address]);
|
|
23549
23515
|
const assetWarpRoute = warpRoutes?.find((route) => {
|
|
@@ -23669,12 +23635,12 @@ function HistoryStep() {
|
|
|
23669
23635
|
)
|
|
23670
23636
|
] });
|
|
23671
23637
|
}
|
|
23672
|
-
var
|
|
23638
|
+
var import_react_query50, import_dayjs7, import_lucide_react64, import_jsx_runtime105, P_CN3;
|
|
23673
23639
|
var init_HistoryStep = __esm({
|
|
23674
23640
|
"src/internal/components/SendMenu/hyperbridge/steps/HistoryStep.tsx"() {
|
|
23675
23641
|
init_SessionContext();
|
|
23676
23642
|
init_i18n();
|
|
23677
|
-
|
|
23643
|
+
import_react_query50 = require("@tanstack/react-query");
|
|
23678
23644
|
import_dayjs7 = __toESM(require("dayjs"), 1);
|
|
23679
23645
|
import_lucide_react64 = require("lucide-react");
|
|
23680
23646
|
init_tokens();
|
|
@@ -23994,7 +23960,7 @@ function useNicknameResolve(input, options) {
|
|
|
23994
23960
|
clearTimeout(timer);
|
|
23995
23961
|
};
|
|
23996
23962
|
}, [normalized, isNicknameInput, enabled]);
|
|
23997
|
-
const query = (0,
|
|
23963
|
+
const query = (0, import_react_query51.useQuery)({
|
|
23998
23964
|
queryKey: [...QUERY_KEYS.nicknameResolve(debouncedInput), chainId],
|
|
23999
23965
|
queryFn: async () => await resolveNickname(debouncedInput, chainId),
|
|
24000
23966
|
enabled: enabled && isNicknameInput && debouncedInput.length > 0,
|
|
@@ -24027,10 +23993,10 @@ function useNicknameResolve(input, options) {
|
|
|
24027
23993
|
resolvedAddress
|
|
24028
23994
|
};
|
|
24029
23995
|
}
|
|
24030
|
-
var
|
|
23996
|
+
var import_react_query51, import_react80, DEBOUNCE_MS2;
|
|
24031
23997
|
var init_useNicknameResolve = __esm({
|
|
24032
23998
|
"src/hooks/useNicknameResolve.ts"() {
|
|
24033
|
-
|
|
23999
|
+
import_react_query51 = require("@tanstack/react-query");
|
|
24034
24000
|
import_react80 = require("react");
|
|
24035
24001
|
init_nickname();
|
|
24036
24002
|
init_profile();
|
|
@@ -24540,7 +24506,7 @@ function isNftAsset4(asset) {
|
|
|
24540
24506
|
function useTokenBalance(asset) {
|
|
24541
24507
|
const address = useSession((st) => st.address);
|
|
24542
24508
|
const chainConfig = useSession((st) => st.chainConfig);
|
|
24543
|
-
return (0,
|
|
24509
|
+
return (0, import_react_query52.useQuery)({
|
|
24544
24510
|
retry: false,
|
|
24545
24511
|
enabled: !!address && !!chainConfig?.id && !!asset?.symbol,
|
|
24546
24512
|
refetchInterval: 5e3,
|
|
@@ -24604,11 +24570,11 @@ function useTokenBalance(asset) {
|
|
|
24604
24570
|
}
|
|
24605
24571
|
});
|
|
24606
24572
|
}
|
|
24607
|
-
var
|
|
24573
|
+
var import_react_query52, import_viem18, SEND_TOKEN_BALANCE_QUERY_KEY;
|
|
24608
24574
|
var init_useTokenBalance = __esm({
|
|
24609
24575
|
"src/internal/components/SendMenu/send/useTokenBalance.ts"() {
|
|
24610
24576
|
init_SessionContext();
|
|
24611
|
-
|
|
24577
|
+
import_react_query52 = require("@tanstack/react-query");
|
|
24612
24578
|
import_viem18 = require("viem");
|
|
24613
24579
|
SEND_TOKEN_BALANCE_QUERY_KEY = "current-chain-send-token-balance-query";
|
|
24614
24580
|
}
|
|
@@ -24840,7 +24806,7 @@ function ConfirmSendStep(props) {
|
|
|
24840
24806
|
const isNft = isNftAsset3(selectedAsset);
|
|
24841
24807
|
const isSecurity = isSecurityToken2(selectedAsset);
|
|
24842
24808
|
const effectiveAddress = isNicknameInput ? resolvedAddress : recipient;
|
|
24843
|
-
const { mutate: handleConfirm, isPending: isTransactionPending } = (0,
|
|
24809
|
+
const { mutate: handleConfirm, isPending: isTransactionPending } = (0, import_react_query53.useMutation)({
|
|
24844
24810
|
mutationFn: async () => {
|
|
24845
24811
|
if (!effectiveAddress || !selectedAsset) return;
|
|
24846
24812
|
setTxStep("pending");
|
|
@@ -25001,12 +24967,12 @@ function ConfirmSendStep(props) {
|
|
|
25001
24967
|
}
|
|
25002
24968
|
);
|
|
25003
24969
|
}
|
|
25004
|
-
var
|
|
24970
|
+
var import_react_query53, import_lucide_react70, import_jsx_runtime114;
|
|
25005
24971
|
var init_ConfirmSendStep = __esm({
|
|
25006
24972
|
"src/internal/components/SendMenu/send/sendSteps/ConfirmSendStep.tsx"() {
|
|
25007
24973
|
init_SessionContext();
|
|
25008
24974
|
init_i18n();
|
|
25009
|
-
|
|
24975
|
+
import_react_query53 = require("@tanstack/react-query");
|
|
25010
24976
|
import_lucide_react70 = require("lucide-react");
|
|
25011
24977
|
init_priceFormatter();
|
|
25012
24978
|
init_utils2();
|
|
@@ -25564,7 +25530,7 @@ function SettingsMenu() {
|
|
|
25564
25530
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
25565
25531
|
const settingsButtons = useSettingsButtons();
|
|
25566
25532
|
useProvidersList();
|
|
25567
|
-
(0,
|
|
25533
|
+
(0, import_react_query54.useQuery)({
|
|
25568
25534
|
retry: 1,
|
|
25569
25535
|
enabled: !!address,
|
|
25570
25536
|
queryKey: [QUERY_KEYS.nicknameInfo, address],
|
|
@@ -25607,13 +25573,13 @@ function SettingsMenu() {
|
|
|
25607
25573
|
}
|
|
25608
25574
|
);
|
|
25609
25575
|
}
|
|
25610
|
-
var
|
|
25576
|
+
var import_react_query54, import_lucide_react74, import_react88, import_jsx_runtime117;
|
|
25611
25577
|
var init_SettingsMenu = __esm({
|
|
25612
25578
|
"src/internal/components/SettingsMenu/SettingsMenu.tsx"() {
|
|
25613
25579
|
init_ProviderContext();
|
|
25614
25580
|
init_SessionContext();
|
|
25615
25581
|
init_i18n();
|
|
25616
|
-
|
|
25582
|
+
import_react_query54 = require("@tanstack/react-query");
|
|
25617
25583
|
import_lucide_react74 = require("lucide-react");
|
|
25618
25584
|
import_react88 = require("react");
|
|
25619
25585
|
init_nickname();
|
|
@@ -26498,7 +26464,7 @@ var init_TransactionsGroup = __esm({
|
|
|
26498
26464
|
|
|
26499
26465
|
// src/internal/components/TransactionsMenu/TransactionsMenu.tsx
|
|
26500
26466
|
function TransactionsMenu() {
|
|
26501
|
-
const qc = (0,
|
|
26467
|
+
const qc = (0, import_react_query55.useQueryClient)();
|
|
26502
26468
|
const address = useSession((st) => st.address);
|
|
26503
26469
|
const chainConfig = useSession((st) => st.chainConfig);
|
|
26504
26470
|
const { t } = useT();
|
|
@@ -26512,7 +26478,7 @@ function TransactionsMenu() {
|
|
|
26512
26478
|
isLoading: isTxHistoryLoading,
|
|
26513
26479
|
isFetching: isTxHistoryFetching,
|
|
26514
26480
|
error: txHistoryError
|
|
26515
|
-
} = (0,
|
|
26481
|
+
} = (0, import_react_query55.useQuery)({
|
|
26516
26482
|
retry: false,
|
|
26517
26483
|
enabled: !!address && !!chainConfig?.id && historySupported,
|
|
26518
26484
|
queryKey: [TRANSACTIONS_HISTORY_QUERY_KEY, chainConfig.id, address],
|
|
@@ -26568,12 +26534,12 @@ function TransactionsMenu() {
|
|
|
26568
26534
|
}
|
|
26569
26535
|
);
|
|
26570
26536
|
}
|
|
26571
|
-
var
|
|
26537
|
+
var import_react_query55, import_lucide_react77, import_react89, import_jsx_runtime120;
|
|
26572
26538
|
var init_TransactionsMenu = __esm({
|
|
26573
26539
|
"src/internal/components/TransactionsMenu/TransactionsMenu.tsx"() {
|
|
26574
26540
|
init_SessionContext();
|
|
26575
26541
|
init_i18n();
|
|
26576
|
-
|
|
26542
|
+
import_react_query55 = require("@tanstack/react-query");
|
|
26577
26543
|
import_lucide_react77 = require("lucide-react");
|
|
26578
26544
|
import_react89 = require("react");
|
|
26579
26545
|
init_useLayoutDataStore();
|
|
@@ -26873,7 +26839,7 @@ var init_package = __esm({
|
|
|
26873
26839
|
"package.json"() {
|
|
26874
26840
|
package_default = {
|
|
26875
26841
|
name: "@embarkai/ui-kit",
|
|
26876
|
-
version: "0.4.
|
|
26842
|
+
version: "0.4.84",
|
|
26877
26843
|
description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
|
|
26878
26844
|
type: "module",
|
|
26879
26845
|
main: "./dist/index.cjs",
|
|
@@ -26974,7 +26940,7 @@ var init_package = __esm({
|
|
|
26974
26940
|
|
|
26975
26941
|
// src/internal/components/Footer/Footer.tsx
|
|
26976
26942
|
function Footer() {
|
|
26977
|
-
const qc = (0,
|
|
26943
|
+
const qc = (0, import_react_query56.useQueryClient)();
|
|
26978
26944
|
const { callbacksRef, config } = useProviderConfig();
|
|
26979
26945
|
const { t } = useT();
|
|
26980
26946
|
const address = useSession((st) => st.address);
|
|
@@ -26991,7 +26957,7 @@ function Footer() {
|
|
|
26991
26957
|
}
|
|
26992
26958
|
}
|
|
26993
26959
|
});
|
|
26994
|
-
const { mutate: disconnect, isPending: isDisconnecting } = (0,
|
|
26960
|
+
const { mutate: disconnect, isPending: isDisconnecting } = (0, import_react_query56.useMutation)({
|
|
26995
26961
|
mutationFn: async (disconnectAddress) => {
|
|
26996
26962
|
if (!disconnectAddress) throw new Error("No address to disconnect");
|
|
26997
26963
|
const { setError, setStatus, setIsLoading } = useSession.getState();
|
|
@@ -27086,7 +27052,7 @@ function Footer() {
|
|
|
27086
27052
|
}
|
|
27087
27053
|
);
|
|
27088
27054
|
}
|
|
27089
|
-
var
|
|
27055
|
+
var import_react_query56, import_lucide_react78, import_wagmi8, import_jsx_runtime122, FOOTER_ONBOARDING_CHAIN_BUTTON, FOOTER_ONBOARDING_LOGOUT_BUTTON, FOOTER_TOUR;
|
|
27090
27056
|
var init_Footer = __esm({
|
|
27091
27057
|
"src/internal/components/Footer/Footer.tsx"() {
|
|
27092
27058
|
init_package();
|
|
@@ -27094,7 +27060,7 @@ var init_Footer = __esm({
|
|
|
27094
27060
|
init_ProviderContext();
|
|
27095
27061
|
init_SessionContext();
|
|
27096
27062
|
init_i18n();
|
|
27097
|
-
|
|
27063
|
+
import_react_query56 = require("@tanstack/react-query");
|
|
27098
27064
|
import_lucide_react78 = require("lucide-react");
|
|
27099
27065
|
import_wagmi8 = require("wagmi");
|
|
27100
27066
|
init_auth();
|
|
@@ -30334,6 +30300,7 @@ __export(index_exports, {
|
|
|
30334
30300
|
Address: () => Address,
|
|
30335
30301
|
ConnectWalletButton: () => ConnectWalletButton,
|
|
30336
30302
|
ErrorCodes: () => ErrorCodes,
|
|
30303
|
+
Expandable: () => Expandable,
|
|
30337
30304
|
Hash: () => Hash,
|
|
30338
30305
|
KeyshareBackup: () => KeyshareBackupMenu,
|
|
30339
30306
|
LOCAL_STORAGE_I18N_KEY: () => LOCAL_STORAGE_I18N_KEY,
|
|
@@ -31984,6 +31951,7 @@ init_tokens();
|
|
|
31984
31951
|
init_wallets();
|
|
31985
31952
|
|
|
31986
31953
|
// src/index.ts
|
|
31954
|
+
init_Expandable2();
|
|
31987
31955
|
init_i18n();
|
|
31988
31956
|
|
|
31989
31957
|
// src/internal/exportedQueryKeys.ts
|
|
@@ -32011,6 +31979,7 @@ autorun();
|
|
|
32011
31979
|
Address,
|
|
32012
31980
|
ConnectWalletButton,
|
|
32013
31981
|
ErrorCodes,
|
|
31982
|
+
Expandable,
|
|
32014
31983
|
Hash,
|
|
32015
31984
|
KeyshareBackup,
|
|
32016
31985
|
LOCAL_STORAGE_I18N_KEY,
|