@embarkai/ui-kit 0.4.31 → 0.4.33
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/_headers +3 -3
- package/dist/iframe/index.html +2 -2
- package/dist/iframe/main.js +69 -64
- package/dist/index.cjs +708 -550
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +417 -259
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -80,19 +80,22 @@ function getServiceUrls() {
|
|
|
80
80
|
const config = DEFAULT_PROVIDER_CONFIG;
|
|
81
81
|
const globalOverride = typeof window !== "undefined" && window.__EMBARK_SERVICES__ || {};
|
|
82
82
|
const searchParams = typeof window !== "undefined" ? new URLSearchParams(window.location.search) : void 0;
|
|
83
|
+
const paramAssetApi = searchParams?.get("assetApiUrl") || void 0;
|
|
83
84
|
const paramTss = searchParams?.get("tssUrl") || void 0;
|
|
84
85
|
const paramVault = searchParams?.get("shareVaultUrl") || void 0;
|
|
85
86
|
const paramDashboard = searchParams?.get("dashboardApiUrl") || void 0;
|
|
86
|
-
const
|
|
87
|
-
const
|
|
87
|
+
const buildAssetApi = "https://api.embarkai.io/on-ramp/api";
|
|
88
|
+
const buildTss = "https://api.embarkai.io/tss";
|
|
89
|
+
const buildVault = "https://api.embarkai.io/vault";
|
|
88
90
|
const buildRequireWasm = false;
|
|
89
91
|
const buildWasmDebug = false;
|
|
90
92
|
const defaultTss = "/tss";
|
|
91
93
|
const defaultVault = "/vault";
|
|
92
94
|
const result = {
|
|
95
|
+
assetApiUrl: paramAssetApi || globalOverride.assetApiUrl || buildAssetApi || config.services.assetApiUrl,
|
|
93
96
|
tssUrl: paramTss || globalOverride.tssUrl || buildTss || config.services.tssUrl || defaultTss,
|
|
94
97
|
shareVaultUrl: paramVault || globalOverride.shareVaultUrl || buildVault || config.services.shareVaultUrl || defaultVault,
|
|
95
|
-
dashboardApiUrl: paramDashboard || globalOverride.dashboardApiUrl || config.services.dashboardApiUrl || "https://dashboard.
|
|
98
|
+
dashboardApiUrl: paramDashboard || globalOverride.dashboardApiUrl || config.services.dashboardApiUrl || "https://dashboard.embarkai.io/api",
|
|
96
99
|
tssRequireWasm: globalOverride.tssRequireWasm ?? buildRequireWasm ?? config.services.tssRequireWasm ?? false,
|
|
97
100
|
tssWasmDebug: globalOverride.tssWasmDebug ?? buildWasmDebug ?? config.services.tssWasmDebug ?? false
|
|
98
101
|
};
|
|
@@ -100,8 +103,8 @@ function getServiceUrls() {
|
|
|
100
103
|
}
|
|
101
104
|
function getIframeUrl() {
|
|
102
105
|
const config = DEFAULT_PROVIDER_CONFIG;
|
|
103
|
-
const buildIframeUrl = "https://auth.
|
|
104
|
-
const iframeUrl = buildIframeUrl || config.services.iframeUrl || "https://auth.
|
|
106
|
+
const buildIframeUrl = "https://auth.embarkai.io";
|
|
107
|
+
const iframeUrl = buildIframeUrl || config.services.iframeUrl || "https://auth.embarkai.io";
|
|
105
108
|
return iframeUrl;
|
|
106
109
|
}
|
|
107
110
|
function getBlockscoutApiUrl(chainConfig) {
|
|
@@ -134,7 +137,7 @@ var init_initial = __esm({
|
|
|
134
137
|
icon: TelegramIcon,
|
|
135
138
|
comingSoon: false,
|
|
136
139
|
meta: {
|
|
137
|
-
botUsername: "
|
|
140
|
+
botUsername: "embark_ai_bot",
|
|
138
141
|
salt: "demo"
|
|
139
142
|
}
|
|
140
143
|
}
|
|
@@ -168,8 +171,8 @@ var init_initial = __esm({
|
|
|
168
171
|
// Will fallback to build-time env vars
|
|
169
172
|
shareVaultUrl: "",
|
|
170
173
|
// Will fallback to build-time env vars
|
|
171
|
-
iframeUrl:
|
|
172
|
-
// Secure iframe for MPC operations
|
|
174
|
+
// iframeUrl: '',
|
|
175
|
+
// iframeUrl: 'https://auth.embarkai.io', // Secure iframe for MPC operations
|
|
173
176
|
tssRequireWasm: false,
|
|
174
177
|
tssWasmDebug: false
|
|
175
178
|
},
|
|
@@ -5153,7 +5156,7 @@ var init_button = __esm({
|
|
|
5153
5156
|
buttonVariants = cva(
|
|
5154
5157
|
cn(
|
|
5155
5158
|
"cursor-pointer py-0",
|
|
5156
|
-
"inline-flex items-center justify-center
|
|
5159
|
+
"inline-flex items-center justify-center",
|
|
5157
5160
|
"transition-all duration-200",
|
|
5158
5161
|
"disabled:cursor-default disabled:opacity-50",
|
|
5159
5162
|
"whitespace-nowrap text-sm font-semibold font-sans",
|
|
@@ -5181,9 +5184,9 @@ var init_button = __esm({
|
|
|
5181
5184
|
)
|
|
5182
5185
|
},
|
|
5183
5186
|
size: {
|
|
5184
|
-
small: "h-6 px-2",
|
|
5185
|
-
medium: "h-8 px-[var(--ui-kit-pd)] rounded-[var(--ui-kit-el-bdrs)]",
|
|
5186
|
-
large: "h-12 px-[var(--ui-kit-pd)] rounded-[var(--ui-kit-el-bdrs)]",
|
|
5187
|
+
small: "h-6 px-2 gap-2",
|
|
5188
|
+
medium: "h-8 px-[var(--ui-kit-pd)] rounded-[var(--ui-kit-el-bdrs)] gap-2",
|
|
5189
|
+
large: "h-12 px-[var(--ui-kit-pd)] rounded-[var(--ui-kit-el-bdrs)] gap-[var(--ui-kit-gap)]",
|
|
5187
5190
|
icon: "h-8 w-8 p-0"
|
|
5188
5191
|
}
|
|
5189
5192
|
},
|
|
@@ -5386,7 +5389,7 @@ var init_en = __esm({
|
|
|
5386
5389
|
sender: "Sender",
|
|
5387
5390
|
bridgeAsset: "Bridge {{asset}}",
|
|
5388
5391
|
selectTokenAndRoute: "Select Token & Route",
|
|
5389
|
-
selectToken: "Select
|
|
5392
|
+
selectToken: "Select Asset",
|
|
5390
5393
|
estimations: "Estimations",
|
|
5391
5394
|
estimatedFee: "Estimated Fee",
|
|
5392
5395
|
availableChainPairs: "Available Chain Pairs",
|
|
@@ -7106,7 +7109,7 @@ function Social(props) {
|
|
|
7106
7109
|
};
|
|
7107
7110
|
let authConfig = provider?.meta || {};
|
|
7108
7111
|
if (normalizedProviderId === "telegram" && !authConfig.botUsername) {
|
|
7109
|
-
const defaultBotUsername = "
|
|
7112
|
+
const defaultBotUsername = "embark_ai_bot";
|
|
7110
7113
|
if (defaultBotUsername) {
|
|
7111
7114
|
authConfig = { ...authConfig, botUsername: defaultBotUsername };
|
|
7112
7115
|
}
|
|
@@ -10212,11 +10215,8 @@ async function getEstimates(payload) {
|
|
|
10212
10215
|
}
|
|
10213
10216
|
async function createWidgetUrlMutation(payload) {
|
|
10214
10217
|
const { iframeManager, accessToken } = iframe2();
|
|
10215
|
-
const
|
|
10216
|
-
|
|
10217
|
-
accessToken
|
|
10218
|
-
});
|
|
10219
|
-
return widgetUrlData;
|
|
10218
|
+
const response = await iframeManager.sendMessage("FINCHPAY_GET_WIDGET_URL_QUERY", { accessToken, payload });
|
|
10219
|
+
return response;
|
|
10220
10220
|
}
|
|
10221
10221
|
async function getTransactionList2(payload) {
|
|
10222
10222
|
const { iframeManager, accessToken } = iframe2();
|
|
@@ -13511,13 +13511,26 @@ async function beginPasskeyLinking() {
|
|
|
13511
13511
|
const begin2 = await res.json();
|
|
13512
13512
|
const options2 = {
|
|
13513
13513
|
rp: begin2.rp,
|
|
13514
|
-
user: {
|
|
13514
|
+
user: {
|
|
13515
|
+
id: base64urlToUint8Array(begin2.user.id),
|
|
13516
|
+
name: begin2.user.name,
|
|
13517
|
+
displayName: begin2.user.displayName
|
|
13518
|
+
},
|
|
13515
13519
|
challenge: base64urlToUint8Array(begin2.challenge),
|
|
13516
13520
|
pubKeyCredParams: begin2.pubKeyCredParams,
|
|
13517
13521
|
timeout: begin2.timeout,
|
|
13518
13522
|
attestation: begin2.attestation,
|
|
13519
|
-
authenticatorSelection: {
|
|
13520
|
-
|
|
13523
|
+
authenticatorSelection: {
|
|
13524
|
+
...begin2.authenticatorSelection,
|
|
13525
|
+
residentKey: begin2.authenticatorSelection?.residentKey ?? "preferred",
|
|
13526
|
+
requireResidentKey: begin2.authenticatorSelection?.requireResidentKey ?? false,
|
|
13527
|
+
userVerification: begin2.authenticatorSelection?.userVerification ?? "preferred"
|
|
13528
|
+
},
|
|
13529
|
+
excludeCredentials: begin2.excludeCredentials?.map((cred) => ({
|
|
13530
|
+
type: cred.type,
|
|
13531
|
+
id: base64urlToUint8Array(cred.id),
|
|
13532
|
+
transports: cred.transports
|
|
13533
|
+
})) || void 0
|
|
13521
13534
|
};
|
|
13522
13535
|
return { challengeId: begin2.challengeId, options: options2 };
|
|
13523
13536
|
}
|
|
@@ -13526,13 +13539,26 @@ async function beginPasskeyLinking() {
|
|
|
13526
13539
|
const begin = await res.json();
|
|
13527
13540
|
const options = {
|
|
13528
13541
|
rp: begin.rp,
|
|
13529
|
-
user: {
|
|
13542
|
+
user: {
|
|
13543
|
+
id: base64urlToUint8Array(begin.user.id),
|
|
13544
|
+
name: begin.user.name,
|
|
13545
|
+
displayName: begin.user.displayName
|
|
13546
|
+
},
|
|
13530
13547
|
challenge: base64urlToUint8Array(begin.challenge),
|
|
13531
13548
|
pubKeyCredParams: begin.pubKeyCredParams,
|
|
13532
13549
|
timeout: begin.timeout,
|
|
13533
13550
|
attestation: begin.attestation,
|
|
13534
|
-
authenticatorSelection: {
|
|
13535
|
-
|
|
13551
|
+
authenticatorSelection: {
|
|
13552
|
+
...begin.authenticatorSelection,
|
|
13553
|
+
residentKey: "preferred",
|
|
13554
|
+
requireResidentKey: false,
|
|
13555
|
+
userVerification: "preferred"
|
|
13556
|
+
},
|
|
13557
|
+
excludeCredentials: begin.excludeCredentials?.map((cred) => ({
|
|
13558
|
+
type: cred.type,
|
|
13559
|
+
id: base64urlToUint8Array(cred.id),
|
|
13560
|
+
transports: cred.transports
|
|
13561
|
+
})) || void 0
|
|
13536
13562
|
};
|
|
13537
13563
|
return { challengeId: begin.challengeId, options };
|
|
13538
13564
|
}
|
|
@@ -13570,7 +13596,7 @@ async function linkPasskeyWithWebAuthn(optionsOverride) {
|
|
|
13570
13596
|
try {
|
|
13571
13597
|
const ts = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
13572
13598
|
const friendlyDisplay = `EmbarkAI Wallet (${ts})`;
|
|
13573
|
-
const friendlyName = `
|
|
13599
|
+
const friendlyName = `embarkai.${ts}`;
|
|
13574
13600
|
const originalUser = publicKeyOptions.user;
|
|
13575
13601
|
publicKeyOptions = {
|
|
13576
13602
|
...publicKeyOptions,
|
|
@@ -13600,7 +13626,9 @@ async function linkPasskeyWithWebAuthn(optionsOverride) {
|
|
|
13600
13626
|
timeout: publicKeyOptions.timeout,
|
|
13601
13627
|
attestation: publicKeyOptions.attestation
|
|
13602
13628
|
});
|
|
13603
|
-
const credential = await navigator.credentials.create({
|
|
13629
|
+
const credential = await navigator.credentials.create({
|
|
13630
|
+
publicKey: { ...publicKeyOptions, ...optionsOverride }
|
|
13631
|
+
});
|
|
13604
13632
|
if (!credential) throw new Error("Passkey creation was cancelled");
|
|
13605
13633
|
const attestationPayload = credentialToAttestationPayload(credential);
|
|
13606
13634
|
const cid = challengeId || "local-" + Date.now();
|
|
@@ -13610,8 +13638,8 @@ async function linkPasskeyWithWebAuthn(optionsOverride) {
|
|
|
13610
13638
|
}
|
|
13611
13639
|
var init_passkey2 = __esm({
|
|
13612
13640
|
"src/internal/auth/providers/passkey.ts"() {
|
|
13613
|
-
init_auth();
|
|
13614
13641
|
init_base64url();
|
|
13642
|
+
init_auth();
|
|
13615
13643
|
init_webauthn();
|
|
13616
13644
|
init_types();
|
|
13617
13645
|
}
|
|
@@ -15515,12 +15543,11 @@ async function fetchToken(params = {}) {
|
|
|
15515
15543
|
if (!token) throw new Error("Invalid Sumsub token response");
|
|
15516
15544
|
return token;
|
|
15517
15545
|
}
|
|
15518
|
-
var DEFAULT_TTL_SECONDS
|
|
15546
|
+
var DEFAULT_TTL_SECONDS;
|
|
15519
15547
|
var init_sumsub = __esm({
|
|
15520
15548
|
"src/internal/components/KYC/api/sumsub.ts"() {
|
|
15521
15549
|
init_httpClient();
|
|
15522
15550
|
DEFAULT_TTL_SECONDS = 600;
|
|
15523
|
-
QUERY_KEYS3 = { sumsubToken: "sumsub-token" };
|
|
15524
15551
|
}
|
|
15525
15552
|
});
|
|
15526
15553
|
|
|
@@ -15592,11 +15619,9 @@ var init_SumsubIframeManager = __esm({
|
|
|
15592
15619
|
});
|
|
15593
15620
|
|
|
15594
15621
|
// src/internal/components/KYC/useSumsubIframe.ts
|
|
15595
|
-
import { useQueryClient as useQueryClient12 } from "@tanstack/react-query";
|
|
15596
15622
|
import { useEffect as useEffect29, useRef as useRef15, useState as useState16 } from "react";
|
|
15597
15623
|
function useSumsubIframe({ iframeUrl }) {
|
|
15598
15624
|
const config = useProviderConfig().config;
|
|
15599
|
-
const qc = useQueryClient12();
|
|
15600
15625
|
const { colorMode } = useColorMode();
|
|
15601
15626
|
const iframeRef = useRef15(null);
|
|
15602
15627
|
const [isLoading, setIsLoading] = useState16(true);
|
|
@@ -15617,15 +15642,9 @@ function useSumsubIframe({ iframeUrl }) {
|
|
|
15617
15642
|
iframeOrigin,
|
|
15618
15643
|
getToken: () => {
|
|
15619
15644
|
setStatus("Authenticating...");
|
|
15620
|
-
return
|
|
15621
|
-
queryKey: [QUERY_KEYS3.sumsubToken, levelName],
|
|
15622
|
-
queryFn: () => fetchToken({ levelName })
|
|
15623
|
-
});
|
|
15624
|
-
},
|
|
15625
|
-
refreshToken: async () => {
|
|
15626
|
-
const queryKey = [QUERY_KEYS3.sumsubToken, levelName];
|
|
15627
|
-
return qc.fetchQuery({ queryKey, queryFn: () => fetchToken({ levelName }) });
|
|
15645
|
+
return fetchToken({ levelName });
|
|
15628
15646
|
},
|
|
15647
|
+
refreshToken: () => fetchToken({ levelName }),
|
|
15629
15648
|
onSdkBuilt: () => setStatus("Loading verification form..."),
|
|
15630
15649
|
sendMessage: (msg) => iframeRef.current?.contentWindow?.postMessage(msg, iframeOrigin),
|
|
15631
15650
|
onReady: () => {
|
|
@@ -15973,7 +15992,7 @@ var init_MainMenu2 = __esm({
|
|
|
15973
15992
|
});
|
|
15974
15993
|
|
|
15975
15994
|
// src/modules/linkedProfiles.ts
|
|
15976
|
-
import { useQuery as useQuery12, useQueryClient as
|
|
15995
|
+
import { useQuery as useQuery12, useQueryClient as useQueryClient12 } from "@tanstack/react-query";
|
|
15977
15996
|
import { useCallback as useCallback16 } from "react";
|
|
15978
15997
|
async function getLinkProfilesData() {
|
|
15979
15998
|
const list = await getLinkedProviders();
|
|
@@ -15990,7 +16009,7 @@ async function getLinkProfilesData() {
|
|
|
15990
16009
|
return { profiles: loadedProfiles, avatar };
|
|
15991
16010
|
}
|
|
15992
16011
|
function useLinkedProfiles() {
|
|
15993
|
-
const qc =
|
|
16012
|
+
const qc = useQueryClient12();
|
|
15994
16013
|
const address = useSession((st) => st.address);
|
|
15995
16014
|
const {
|
|
15996
16015
|
data,
|
|
@@ -16223,10 +16242,10 @@ var init_useSendVerificationCode = __esm({
|
|
|
16223
16242
|
});
|
|
16224
16243
|
|
|
16225
16244
|
// src/internal/components/ManageWalletMenu/hooks/useVerifyCode.ts
|
|
16226
|
-
import { useMutation as useMutation14, useQueryClient as
|
|
16245
|
+
import { useMutation as useMutation14, useQueryClient as useQueryClient13 } from "@tanstack/react-query";
|
|
16227
16246
|
function useVerifyCode() {
|
|
16228
16247
|
const { callbacksRef } = useProviderConfig();
|
|
16229
|
-
const qc =
|
|
16248
|
+
const qc = useQueryClient13();
|
|
16230
16249
|
const address = useSession((st) => st.address);
|
|
16231
16250
|
const setIsLoading = useSession((st) => st.setIsLoading);
|
|
16232
16251
|
const {
|
|
@@ -16290,7 +16309,7 @@ var init_useVerifyCode = __esm({
|
|
|
16290
16309
|
});
|
|
16291
16310
|
|
|
16292
16311
|
// src/internal/components/ManageWalletMenu/AddProvider.tsx
|
|
16293
|
-
import { useQueryClient as
|
|
16312
|
+
import { useQueryClient as useQueryClient14 } from "@tanstack/react-query";
|
|
16294
16313
|
import { Fragment as Fragment28, jsx as jsx72, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
16295
16314
|
function normalizePasskeyLinkError(msg) {
|
|
16296
16315
|
const lower = msg.toLowerCase();
|
|
@@ -16303,7 +16322,7 @@ function normalizePasskeyLinkError(msg) {
|
|
|
16303
16322
|
return msg;
|
|
16304
16323
|
}
|
|
16305
16324
|
function AddProvider() {
|
|
16306
|
-
const qc =
|
|
16325
|
+
const qc = useQueryClient14();
|
|
16307
16326
|
const { callbacksRef } = useProviderConfig();
|
|
16308
16327
|
const address = useSession((st) => st.address);
|
|
16309
16328
|
const { t } = useT();
|
|
@@ -16480,7 +16499,7 @@ var init_EmailNotConnectedWarning = __esm({
|
|
|
16480
16499
|
});
|
|
16481
16500
|
|
|
16482
16501
|
// src/internal/components/ManageWalletMenu/hooks/useLinkSocial.ts
|
|
16483
|
-
import { useQueryClient as
|
|
16502
|
+
import { useQueryClient as useQueryClient15 } from "@tanstack/react-query";
|
|
16484
16503
|
import React6, { useEffect as useEffect31 } from "react";
|
|
16485
16504
|
function normalizeSocialLinkError(message) {
|
|
16486
16505
|
if (message === "X_ALREADY_LINKED") {
|
|
@@ -16489,7 +16508,7 @@ function normalizeSocialLinkError(message) {
|
|
|
16489
16508
|
return message;
|
|
16490
16509
|
}
|
|
16491
16510
|
function useLinkSocial() {
|
|
16492
|
-
const qc =
|
|
16511
|
+
const qc = useQueryClient15();
|
|
16493
16512
|
const address = useSession((st) => st.address);
|
|
16494
16513
|
const {
|
|
16495
16514
|
config: { current: config },
|
|
@@ -16639,14 +16658,14 @@ var init_telegram2 = __esm({
|
|
|
16639
16658
|
});
|
|
16640
16659
|
|
|
16641
16660
|
// src/internal/components/ManageWalletMenu/hooks/useLinkTelegram.ts
|
|
16642
|
-
import { useQueryClient as
|
|
16661
|
+
import { useQueryClient as useQueryClient16 } from "@tanstack/react-query";
|
|
16643
16662
|
import { useCallback as useCallback17, useEffect as useEffect32, useState as useState17 } from "react";
|
|
16644
16663
|
function useLinkTelegram() {
|
|
16645
16664
|
const {
|
|
16646
16665
|
config: { current: config },
|
|
16647
16666
|
callbacksRef
|
|
16648
16667
|
} = useProviderConfig();
|
|
16649
|
-
const qc =
|
|
16668
|
+
const qc = useQueryClient16();
|
|
16650
16669
|
const address = useSession((st) => st.address);
|
|
16651
16670
|
const isWalletLinking = useLayoutDataStore((st) => st.isWalletLinking);
|
|
16652
16671
|
const { providerType, linkIsLoading, setLinkIsLoading, setProviderType, setAlert } = useManageWalletStore();
|
|
@@ -16665,7 +16684,7 @@ function useLinkTelegram() {
|
|
|
16665
16684
|
);
|
|
16666
16685
|
let botUsername = telegramProvider?.meta?.botUsername;
|
|
16667
16686
|
if (!botUsername) {
|
|
16668
|
-
botUsername = "
|
|
16687
|
+
botUsername = "embark_ai_bot";
|
|
16669
16688
|
}
|
|
16670
16689
|
if (!botUsername) {
|
|
16671
16690
|
throw new Error("Telegram bot username not configured");
|
|
@@ -17017,12 +17036,12 @@ var init_ManageWallet = __esm({
|
|
|
17017
17036
|
});
|
|
17018
17037
|
|
|
17019
17038
|
// src/internal/components/ManageWalletMenu/UnlinkProviderMenu.tsx
|
|
17020
|
-
import { useMutation as useMutation15, useQueryClient as
|
|
17039
|
+
import { useMutation as useMutation15, useQueryClient as useQueryClient17 } from "@tanstack/react-query";
|
|
17021
17040
|
import { Key as Key6, Loader as Loader17 } from "lucide-react";
|
|
17022
17041
|
import { useState as useState18 } from "react";
|
|
17023
17042
|
import { jsx as jsx76, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
17024
17043
|
function UnlinkProviderMenu() {
|
|
17025
|
-
const qc =
|
|
17044
|
+
const qc = useQueryClient17();
|
|
17026
17045
|
const address = useSession((st) => st.address);
|
|
17027
17046
|
const { callbacksRef } = useProviderConfig();
|
|
17028
17047
|
const { t } = useT();
|
|
@@ -17247,7 +17266,7 @@ var init_nickname_validation = __esm({
|
|
|
17247
17266
|
});
|
|
17248
17267
|
|
|
17249
17268
|
// src/internal/components/NicknameMenu/NicknameEditForm.tsx
|
|
17250
|
-
import { useMutation as useMutation16, useQueryClient as
|
|
17269
|
+
import { useMutation as useMutation16, useQueryClient as useQueryClient18 } from "@tanstack/react-query";
|
|
17251
17270
|
import { AtSign, Check as Check2, ChevronRight as ChevronRight5, Copy as Copy2, Loader as Loader19 } from "lucide-react";
|
|
17252
17271
|
import { useCallback as useCallback18, useState as useState19 } from "react";
|
|
17253
17272
|
import { Fragment as Fragment30, jsx as jsx78, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
@@ -17264,7 +17283,7 @@ function NicknameEditForm(props) {
|
|
|
17264
17283
|
info
|
|
17265
17284
|
} = props;
|
|
17266
17285
|
const { handle: currentNickname, canChange } = info || { handle: "", canChange: false };
|
|
17267
|
-
const qc =
|
|
17286
|
+
const qc = useQueryClient18();
|
|
17268
17287
|
const { t } = useT();
|
|
17269
17288
|
const passportWalletAddress = useSession((st) => st.address);
|
|
17270
17289
|
const { callbacksRef } = useProviderConfig();
|
|
@@ -17569,27 +17588,71 @@ var init_NicknameMenu2 = __esm({
|
|
|
17569
17588
|
}
|
|
17570
17589
|
});
|
|
17571
17590
|
|
|
17591
|
+
// src/internal/hooks/useResolvedPublicClient.ts
|
|
17592
|
+
import { createPublicClientForChain as createPublicClientForChain5, getChainConfig as getChainConfig8 } from "@embarkai/core/read";
|
|
17593
|
+
import { useMemo as useMemo4 } from "react";
|
|
17594
|
+
function getCachedPublicClient(chainId) {
|
|
17595
|
+
const cachedClient = publicClientByChainId.get(chainId);
|
|
17596
|
+
if (cachedClient) return cachedClient;
|
|
17597
|
+
const publicClient = createPublicClientForChain5(chainId);
|
|
17598
|
+
publicClientByChainId.set(chainId, publicClient);
|
|
17599
|
+
return publicClient;
|
|
17600
|
+
}
|
|
17601
|
+
function useResolvedPublicClient(chainId, logScope = "useResolvedPublicClient") {
|
|
17602
|
+
const activePublicClient = useSession((st) => st.publicClient);
|
|
17603
|
+
const activeChainId = useSession((st) => st.activeChainId);
|
|
17604
|
+
const activeChainConfig = useSession((st) => st.chainConfig);
|
|
17605
|
+
const resolvedChainId = chainId ?? activeChainId;
|
|
17606
|
+
const shouldUseActiveClient = !chainId || chainId === activeChainId;
|
|
17607
|
+
const chainConfig = useMemo4(() => {
|
|
17608
|
+
if (shouldUseActiveClient) return activeChainConfig;
|
|
17609
|
+
return getChainConfig8(chainId);
|
|
17610
|
+
}, [activeChainConfig, chainId, shouldUseActiveClient]);
|
|
17611
|
+
const publicClient = useMemo4(() => {
|
|
17612
|
+
if (shouldUseActiveClient) return activePublicClient;
|
|
17613
|
+
if (!chainId) return activePublicClient;
|
|
17614
|
+
try {
|
|
17615
|
+
return getCachedPublicClient(chainId);
|
|
17616
|
+
} catch (error) {
|
|
17617
|
+
console.warn(`[${logScope}] Chain ${chainId} is not supported:`, error);
|
|
17618
|
+
return null;
|
|
17619
|
+
}
|
|
17620
|
+
}, [activePublicClient, chainId, logScope, shouldUseActiveClient]);
|
|
17621
|
+
return {
|
|
17622
|
+
activeChainId,
|
|
17623
|
+
chainConfig,
|
|
17624
|
+
publicClient,
|
|
17625
|
+
resolvedChainId
|
|
17626
|
+
};
|
|
17627
|
+
}
|
|
17628
|
+
var publicClientByChainId;
|
|
17629
|
+
var init_useResolvedPublicClient = __esm({
|
|
17630
|
+
"src/internal/hooks/useResolvedPublicClient.ts"() {
|
|
17631
|
+
init_SessionContext();
|
|
17632
|
+
publicClientByChainId = /* @__PURE__ */ new Map();
|
|
17633
|
+
}
|
|
17634
|
+
});
|
|
17635
|
+
|
|
17572
17636
|
// src/internal/hooks/useWatchTokens.ts
|
|
17573
17637
|
import { useQuery as useQuery15 } from "@tanstack/react-query";
|
|
17574
|
-
import { useMemo as
|
|
17638
|
+
import { useMemo as useMemo5 } from "react";
|
|
17575
17639
|
import { erc20Abi, formatUnits as formatUnits2 } from "viem";
|
|
17576
17640
|
function useWatchTokens(options) {
|
|
17577
|
-
const { address, enabled = true } = options;
|
|
17641
|
+
const { address, chainId, enabled = true } = options;
|
|
17578
17642
|
const { config } = useProviderConfig();
|
|
17579
|
-
const publicClient =
|
|
17580
|
-
const
|
|
17581
|
-
const watchTokens = useMemo4(() => {
|
|
17643
|
+
const { publicClient, resolvedChainId } = useResolvedPublicClient(chainId, "useWatchTokens");
|
|
17644
|
+
const watchTokens = useMemo5(() => {
|
|
17582
17645
|
const allWatchTokens = config.current.watchTokens;
|
|
17583
|
-
const tokensForChain =
|
|
17646
|
+
const tokensForChain = resolvedChainId ? allWatchTokens?.[resolvedChainId] || [] : [];
|
|
17584
17647
|
return tokensForChain;
|
|
17585
|
-
}, [config,
|
|
17648
|
+
}, [config, resolvedChainId]);
|
|
17586
17649
|
const {
|
|
17587
17650
|
data: assets,
|
|
17588
17651
|
isLoading,
|
|
17589
17652
|
error,
|
|
17590
17653
|
refetch
|
|
17591
17654
|
} = useQuery15({
|
|
17592
|
-
queryKey: [WATCH_TOKENS_QUERY_KEY,
|
|
17655
|
+
queryKey: [WATCH_TOKENS_QUERY_KEY, resolvedChainId, address, watchTokens.map((t) => t.address).join(",")],
|
|
17593
17656
|
queryFn: async () => {
|
|
17594
17657
|
if (!publicClient || !address || watchTokens.length === 0) {
|
|
17595
17658
|
return [];
|
|
@@ -17664,7 +17727,7 @@ var WATCH_TOKENS_QUERY_KEY;
|
|
|
17664
17727
|
var init_useWatchTokens = __esm({
|
|
17665
17728
|
"src/internal/hooks/useWatchTokens.ts"() {
|
|
17666
17729
|
init_ProviderContext();
|
|
17667
|
-
|
|
17730
|
+
init_useResolvedPublicClient();
|
|
17668
17731
|
WATCH_TOKENS_QUERY_KEY = "watch-tokens";
|
|
17669
17732
|
}
|
|
17670
17733
|
});
|
|
@@ -17672,7 +17735,7 @@ var init_useWatchTokens = __esm({
|
|
|
17672
17735
|
// src/internal/hooks/useBlockscoutAssets.ts
|
|
17673
17736
|
import { createBlockscoutClient } from "@embarkai/core/clients";
|
|
17674
17737
|
import { useQuery as useQuery16 } from "@tanstack/react-query";
|
|
17675
|
-
import { useCallback as useCallback19, useMemo as
|
|
17738
|
+
import { useCallback as useCallback19, useMemo as useMemo6, useRef as useRef16 } from "react";
|
|
17676
17739
|
import { formatEther, formatUnits as formatUnits3 } from "viem";
|
|
17677
17740
|
function resolveIpfsUri(uri) {
|
|
17678
17741
|
if (!uri) return "";
|
|
@@ -17798,15 +17861,13 @@ function createError(error) {
|
|
|
17798
17861
|
};
|
|
17799
17862
|
}
|
|
17800
17863
|
function useBlockscoutAssets(options) {
|
|
17801
|
-
const { address, enabled = true, detectSecurityTokens = true } = options;
|
|
17802
|
-
const publicClient =
|
|
17803
|
-
const activeChainId = useSession((st) => st.activeChainId);
|
|
17804
|
-
const chainConfig = useSession((st) => st.chainConfig);
|
|
17864
|
+
const { address, chainId, enabled = true, detectSecurityTokens = true } = options;
|
|
17865
|
+
const { chainConfig, publicClient, resolvedChainId } = useResolvedPublicClient(chainId, "useBlockscoutAssets");
|
|
17805
17866
|
const portfolioConfig = useProviderConfig().config.current.portfolio;
|
|
17806
17867
|
const customTokenBalancesQuery = portfolioConfig?.tokenBalancesQuery;
|
|
17807
17868
|
const customTokenBalancesQueryKey = portfolioConfig?.tokenBalancesQueryKey;
|
|
17808
17869
|
const blockscoutApiUrl = getBlockscoutApiUrl(chainConfig);
|
|
17809
|
-
const blockscoutClient =
|
|
17870
|
+
const blockscoutClient = useMemo6(
|
|
17810
17871
|
() => blockscoutApiUrl ? createBlockscoutClient({ baseUrl: blockscoutApiUrl }) : null,
|
|
17811
17872
|
[blockscoutApiUrl]
|
|
17812
17873
|
);
|
|
@@ -17815,13 +17876,13 @@ function useBlockscoutAssets(options) {
|
|
|
17815
17876
|
assets: watchTokenAssets,
|
|
17816
17877
|
isLoading: watchTokensLoading,
|
|
17817
17878
|
refetch: refetchWatchTokens
|
|
17818
|
-
} = useWatchTokens({ address, enabled });
|
|
17879
|
+
} = useWatchTokens({ address, chainId: resolvedChainId, enabled });
|
|
17819
17880
|
const {
|
|
17820
17881
|
data: nativeBalanceData,
|
|
17821
17882
|
isLoading: nativeLoading,
|
|
17822
17883
|
refetch: refetchNative
|
|
17823
17884
|
} = useQuery16({
|
|
17824
|
-
queryKey: ["native-balance",
|
|
17885
|
+
queryKey: ["native-balance", resolvedChainId, address],
|
|
17825
17886
|
queryFn: async () => {
|
|
17826
17887
|
if (!publicClient || !address) return null;
|
|
17827
17888
|
const balance = await publicClient.getBalance({ address });
|
|
@@ -17846,7 +17907,7 @@ function useBlockscoutAssets(options) {
|
|
|
17846
17907
|
refetch: refetchTokens,
|
|
17847
17908
|
dataUpdatedAt
|
|
17848
17909
|
} = useQuery16({
|
|
17849
|
-
queryKey: [BLOCKSCOUT_QUERY_KEY, address, blockscoutApiUrl, customTokenBalancesQueryKey],
|
|
17910
|
+
queryKey: [BLOCKSCOUT_QUERY_KEY, resolvedChainId, address, blockscoutApiUrl, customTokenBalancesQueryKey],
|
|
17850
17911
|
queryFn: async () => {
|
|
17851
17912
|
if (customTokenBalancesQuery) {
|
|
17852
17913
|
try {
|
|
@@ -17870,7 +17931,7 @@ function useBlockscoutAssets(options) {
|
|
|
17870
17931
|
isLoading: nftsLoading,
|
|
17871
17932
|
refetch: refetchNfts
|
|
17872
17933
|
} = useQuery16({
|
|
17873
|
-
queryKey: [BLOCKSCOUT_QUERY_KEY, "nfts", address, blockscoutApiUrl],
|
|
17934
|
+
queryKey: [BLOCKSCOUT_QUERY_KEY, "nfts", resolvedChainId, address, blockscoutApiUrl],
|
|
17874
17935
|
queryFn: () => blockscoutClient.getNfts(address),
|
|
17875
17936
|
enabled: !!address && enabled && !!blockscoutClient,
|
|
17876
17937
|
staleTime: BLOCKSCOUT_QUERY_STALE_TIME,
|
|
@@ -17879,12 +17940,12 @@ function useBlockscoutAssets(options) {
|
|
|
17879
17940
|
retry: 2,
|
|
17880
17941
|
retryDelay: 1e3
|
|
17881
17942
|
});
|
|
17882
|
-
const erc20TokenAddresses =
|
|
17943
|
+
const erc20TokenAddresses = useMemo6(() => {
|
|
17883
17944
|
if (!tokenBalances) return [];
|
|
17884
17945
|
return tokenBalances.filter((tb) => tb.token.type === "ERC-20").map((tb) => tb.token.address_hash);
|
|
17885
17946
|
}, [tokenBalances]);
|
|
17886
17947
|
const { data: erc3643Results } = useQuery16({
|
|
17887
|
-
queryKey: [ERC3643_DETECTION_QUERY_KEY, address, erc20TokenAddresses],
|
|
17948
|
+
queryKey: [ERC3643_DETECTION_QUERY_KEY, resolvedChainId, address, erc20TokenAddresses],
|
|
17888
17949
|
queryFn: async () => {
|
|
17889
17950
|
if (!publicClient || erc20TokenAddresses.length === 0) {
|
|
17890
17951
|
return /* @__PURE__ */ new Map();
|
|
@@ -17923,7 +17984,7 @@ function useBlockscoutAssets(options) {
|
|
|
17923
17984
|
gcTime: BLOCKSCOUT_QUERY_GC_TIME,
|
|
17924
17985
|
retry: 1
|
|
17925
17986
|
});
|
|
17926
|
-
const assets =
|
|
17987
|
+
const assets = useMemo6(() => {
|
|
17927
17988
|
const result = [];
|
|
17928
17989
|
const addedAddresses = /* @__PURE__ */ new Set();
|
|
17929
17990
|
if (nativeBalanceData) {
|
|
@@ -17969,7 +18030,7 @@ function useBlockscoutAssets(options) {
|
|
|
17969
18030
|
}
|
|
17970
18031
|
return result;
|
|
17971
18032
|
}, [nativeBalanceData, tokenBalances, nftItems, erc3643Results, watchTokenAssets, chainConfig]);
|
|
17972
|
-
const nativeBalance =
|
|
18033
|
+
const nativeBalance = useMemo6(() => {
|
|
17973
18034
|
if (!nativeBalanceData) return null;
|
|
17974
18035
|
return {
|
|
17975
18036
|
value: nativeBalanceData.value,
|
|
@@ -17977,7 +18038,7 @@ function useBlockscoutAssets(options) {
|
|
|
17977
18038
|
symbol: nativeBalanceData.symbol
|
|
17978
18039
|
};
|
|
17979
18040
|
}, [nativeBalanceData]);
|
|
17980
|
-
const error =
|
|
18041
|
+
const error = useMemo6(() => {
|
|
17981
18042
|
if (!tokensError) return null;
|
|
17982
18043
|
return createError(tokensError);
|
|
17983
18044
|
}, [tokensError]);
|
|
@@ -18011,9 +18072,9 @@ var BLOCKSCOUT_QUERY_KEY, ERC3643_DETECTION_QUERY_KEY, ERC3643_ABI;
|
|
|
18011
18072
|
var init_useBlockscoutAssets = __esm({
|
|
18012
18073
|
"src/internal/hooks/useBlockscoutAssets.ts"() {
|
|
18013
18074
|
init_ProviderContext();
|
|
18014
|
-
init_SessionContext();
|
|
18015
18075
|
init_initial();
|
|
18016
18076
|
init_constants();
|
|
18077
|
+
init_useResolvedPublicClient();
|
|
18017
18078
|
init_useWatchTokens();
|
|
18018
18079
|
BLOCKSCOUT_QUERY_KEY = "blockscout-token-balances";
|
|
18019
18080
|
ERC3643_DETECTION_QUERY_KEY = "erc3643-detection";
|
|
@@ -18076,7 +18137,7 @@ var init_BalanceView2 = __esm({
|
|
|
18076
18137
|
});
|
|
18077
18138
|
|
|
18078
18139
|
// src/internal/components/PortfolioMenu/PortfolioItem.tsx
|
|
18079
|
-
import { useQuery as useQuery17, useQueryClient as
|
|
18140
|
+
import { useQuery as useQuery17, useQueryClient as useQueryClient19 } from "@tanstack/react-query";
|
|
18080
18141
|
import { Image as ImageIcon, Loader as Loader21, ShieldAlert, Sparkles } from "lucide-react";
|
|
18081
18142
|
import { useState as useState22 } from "react";
|
|
18082
18143
|
import { formatUnits as formatUnits5 } from "viem";
|
|
@@ -18173,7 +18234,7 @@ function PortfolioItem(props) {
|
|
|
18173
18234
|
const { assets: projectAssets, showBalanceAs: showBalanceAsSymbol } = providerConfig.projectAssets || {};
|
|
18174
18235
|
const customAssetRateQuery = providerConfig.portfolio?.assetRateQuery;
|
|
18175
18236
|
const customAssetRateQueryKey = providerConfig.portfolio?.assetRateQueryKey;
|
|
18176
|
-
const qc =
|
|
18237
|
+
const qc = useQueryClient19();
|
|
18177
18238
|
const { balanceQueryKey } = projectAssets?.find((a) => a.symbol === showBalanceAsSymbol) || {};
|
|
18178
18239
|
const projectAssetBalance = !!balanceQueryKey ? qc.getQueryData(balanceQueryKey) : null;
|
|
18179
18240
|
const isNft = isNftAsset(asset);
|
|
@@ -18267,14 +18328,14 @@ var init_PortfolioItem = __esm({
|
|
|
18267
18328
|
});
|
|
18268
18329
|
|
|
18269
18330
|
// src/internal/components/PortfolioMenu/PortfolioMenu.tsx
|
|
18270
|
-
import { useQueryClient as
|
|
18331
|
+
import { useQueryClient as useQueryClient20 } from "@tanstack/react-query";
|
|
18271
18332
|
import { AlertCircle as AlertCircle4, ArrowLeft as ArrowLeft16, Gem, Loader as Loader27, RefreshCw as RefreshCw2 } from "lucide-react";
|
|
18272
18333
|
import { useCallback as useCallback20 } from "react";
|
|
18273
18334
|
import { jsx as jsx82, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
18274
18335
|
function PortfolioMenu() {
|
|
18275
18336
|
const { assets: projectAssets = [] } = useProviderConfig().config.current?.projectAssets || {};
|
|
18276
18337
|
const { t } = useT();
|
|
18277
|
-
const qc =
|
|
18338
|
+
const qc = useQueryClient20();
|
|
18278
18339
|
const address = useSession((st) => st.address);
|
|
18279
18340
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
18280
18341
|
const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
|
|
@@ -18444,7 +18505,7 @@ var init_nickname_fingerprint = __esm({
|
|
|
18444
18505
|
// src/internal/components/ReceiveMenu/ReceiveMenu.tsx
|
|
18445
18506
|
import { ArrowLeft as ArrowLeft17, CheckCircle2 as CheckCircle23, Copy as Copy3, Info as Info5, Loader as Loader28, Shield } from "lucide-react";
|
|
18446
18507
|
import QRCode from "qrcode";
|
|
18447
|
-
import { useCallback as useCallback21, useEffect as useEffect34, useMemo as
|
|
18508
|
+
import { useCallback as useCallback21, useEffect as useEffect34, useMemo as useMemo7, useState as useState23 } from "react";
|
|
18448
18509
|
import { Fragment as Fragment32, jsx as jsx83, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
18449
18510
|
function ReceiveMenu() {
|
|
18450
18511
|
const session = useSession((st) => st.session);
|
|
@@ -18458,7 +18519,7 @@ function ReceiveMenu() {
|
|
|
18458
18519
|
const [qrCodeUrl, setQrCodeUrl] = useState23("");
|
|
18459
18520
|
const [copied, setCopied] = useState23(false);
|
|
18460
18521
|
const [fingerprintCopied, setFingerprintCopied] = useState23(false);
|
|
18461
|
-
const fingerprint =
|
|
18522
|
+
const fingerprint = useMemo7(() => {
|
|
18462
18523
|
if (!session?.ownerAddress) return null;
|
|
18463
18524
|
try {
|
|
18464
18525
|
return generateFingerprint(session.ownerAddress);
|
|
@@ -19012,12 +19073,12 @@ var init_UntrustApplication = __esm({
|
|
|
19012
19073
|
});
|
|
19013
19074
|
|
|
19014
19075
|
// src/internal/components/SecurityMenu/SecurityMenu.tsx
|
|
19015
|
-
import { useMutation as useMutation17, useQueryClient as
|
|
19076
|
+
import { useMutation as useMutation17, useQueryClient as useQueryClient21 } from "@tanstack/react-query";
|
|
19016
19077
|
import { ArrowLeft as ArrowLeft18 } from "lucide-react";
|
|
19017
19078
|
import { useState as useState24 } from "react";
|
|
19018
19079
|
import { jsx as jsx90, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
19019
19080
|
function SecurityMenu() {
|
|
19020
|
-
const qc =
|
|
19081
|
+
const qc = useQueryClient21();
|
|
19021
19082
|
const { t } = useT();
|
|
19022
19083
|
const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
|
|
19023
19084
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
@@ -19208,7 +19269,7 @@ var init_wallet = __esm({
|
|
|
19208
19269
|
init_projectId();
|
|
19209
19270
|
init_auth();
|
|
19210
19271
|
init_types();
|
|
19211
|
-
METADATA_API_URL = "https://dashboard.
|
|
19272
|
+
METADATA_API_URL = "https://dashboard.embarkai.io/api/public/project";
|
|
19212
19273
|
METADATA_CACHE_TTL = 36e5;
|
|
19213
19274
|
metadataCache = null;
|
|
19214
19275
|
}
|
|
@@ -20006,7 +20067,7 @@ function useMenuTitle(warpRoutes) {
|
|
|
20006
20067
|
updateMenuTitle(t("passport:bridgeMenu.labels.sender"));
|
|
20007
20068
|
break;
|
|
20008
20069
|
case bridgeStep === "select-token":
|
|
20009
|
-
updateMenuTitle(t("passport:bridgeMenu.labels.
|
|
20070
|
+
updateMenuTitle(t("passport:bridgeMenu.labels.selectToken"));
|
|
20010
20071
|
break;
|
|
20011
20072
|
case bridgeStep === "confirm":
|
|
20012
20073
|
updateMenuTitle(t("passport:bridgeMenu.labels.confirm"));
|
|
@@ -20064,6 +20125,10 @@ function MetaMaskIcon(props) {
|
|
|
20064
20125
|
x: "0px",
|
|
20065
20126
|
y: "0px",
|
|
20066
20127
|
viewBox: "0 0 142 136.878",
|
|
20128
|
+
style: {
|
|
20129
|
+
// enableBackground: 'new 0 0 142 136.878',
|
|
20130
|
+
flexShrink: 0
|
|
20131
|
+
},
|
|
20067
20132
|
xmlSpace: "preserve",
|
|
20068
20133
|
children: [
|
|
20069
20134
|
/* @__PURE__ */ jsx93(
|
|
@@ -20187,12 +20252,12 @@ var init_useAvailableSenders = __esm({
|
|
|
20187
20252
|
});
|
|
20188
20253
|
|
|
20189
20254
|
// src/internal/components/SendMenu/hyperbridge/hooks/useBridgeBalance.ts
|
|
20190
|
-
import { useQuery as useQuery21, useQueryClient as
|
|
20255
|
+
import { useQuery as useQuery21, useQueryClient as useQueryClient22 } from "@tanstack/react-query";
|
|
20191
20256
|
import { useCallback as useCallback23, useEffect as useEffect39 } from "react";
|
|
20192
20257
|
import { createPublicClient as createPublicClient2, erc20Abi as erc20Abi2, formatUnits as formatUnits7, http as http3 } from "viem";
|
|
20193
20258
|
import { useBalance, useSwitchChain as useSwitchChain2 } from "wagmi";
|
|
20194
20259
|
function useBridgeBalance(hyperlaneWarpRoutes) {
|
|
20195
|
-
const qc =
|
|
20260
|
+
const qc = useQueryClient22();
|
|
20196
20261
|
const { t } = useT();
|
|
20197
20262
|
const address = useSession((st) => st.address);
|
|
20198
20263
|
const directWalletAddress = useExternalWalletStore((st) => st.externalAddress);
|
|
@@ -20405,11 +20470,11 @@ function SelectStep(props) {
|
|
|
20405
20470
|
/* @__PURE__ */ jsx95("span", { className: "text-[var(--ui-kit-fg-muted)]", children: t("passport:bridgeMenu.labels.selectToken") }),
|
|
20406
20471
|
/* @__PURE__ */ jsx95("span", { className: "w-4 h-4" }),
|
|
20407
20472
|
/* @__PURE__ */ jsxs86("span", { className: "flex items-center gap-[var(--ui-kit-gap)] leading-4", children: [
|
|
20408
|
-
isRouteTokenBalanceLoading && /* @__PURE__ */ jsx95(LoaderIcon10, { className: "w-4 h-4 animate-spin" }),
|
|
20409
20473
|
/* @__PURE__ */ jsxs86("span", { className: "text-[var(--ui-kit-fg-muted)]", children: [
|
|
20410
20474
|
t("passport:common.balance"),
|
|
20411
20475
|
": "
|
|
20412
20476
|
] }),
|
|
20477
|
+
isRouteTokenBalanceLoading && /* @__PURE__ */ jsx95(LoaderIcon10, { className: "w-4 h-4 animate-spin text-[var(--ui-kit-fg-muted)]" }),
|
|
20413
20478
|
!isRouteTokenBalanceLoading && /* @__PURE__ */ jsxs86("span", { className: "font-semibold", children: [
|
|
20414
20479
|
formatPrice(Number(routeTokenBalance || 0)),
|
|
20415
20480
|
" ",
|
|
@@ -20885,7 +20950,7 @@ var init_useHyperlaneHistory = __esm({
|
|
|
20885
20950
|
});
|
|
20886
20951
|
|
|
20887
20952
|
// src/internal/components/SendMenu/hyperbridge/steps/HistoryStep.tsx
|
|
20888
|
-
import { useQueryClient as
|
|
20953
|
+
import { useQueryClient as useQueryClient23 } from "@tanstack/react-query";
|
|
20889
20954
|
import dayjs7 from "dayjs";
|
|
20890
20955
|
import { ArrowRightIcon, ExternalLinkIcon as ExternalLinkIcon2, LoaderIcon as LoaderIcon12 } from "lucide-react";
|
|
20891
20956
|
import { jsx as jsx99, jsxs as jsxs89 } from "react/jsx-runtime";
|
|
@@ -21002,7 +21067,7 @@ function HistoryItem(props) {
|
|
|
21002
21067
|
updatedAt,
|
|
21003
21068
|
txStatus
|
|
21004
21069
|
} = props;
|
|
21005
|
-
const qc =
|
|
21070
|
+
const qc = useQueryClient23();
|
|
21006
21071
|
const address = useSession((st) => st.address);
|
|
21007
21072
|
const warpRoutes = qc.getQueryData([HYPERLANE_WARP_ROUTES_QUERY_KEY, address]);
|
|
21008
21073
|
const assetWarpRoute = warpRoutes?.find((route) => {
|
|
@@ -21136,14 +21201,14 @@ var init_HistoryStep = __esm({
|
|
|
21136
21201
|
|
|
21137
21202
|
// src/internal/components/SendMenu/hyperbridge/steps/SelectAssetRoute.tsx
|
|
21138
21203
|
import { ArrowLeftRightIcon as ArrowLeftRightIcon2 } from "lucide-react";
|
|
21139
|
-
import { useMemo as
|
|
21204
|
+
import { useMemo as useMemo8, useState as useState28 } from "react";
|
|
21140
21205
|
import { Fragment as Fragment38, jsx as jsx100, jsxs as jsxs90 } from "react/jsx-runtime";
|
|
21141
21206
|
function SelectAssetRoute(props) {
|
|
21142
21207
|
const { hyperlaneWarpRoutes } = props;
|
|
21143
21208
|
const { t } = useT();
|
|
21144
21209
|
const [isTokenSymbolSelector, setIsTokenSymbolSelector] = useState28(false);
|
|
21145
21210
|
const selectedAssetSymbol = useBridgeStore((st) => st.bridgeAssetSymbol);
|
|
21146
|
-
const tokenList =
|
|
21211
|
+
const tokenList = useMemo8(() => {
|
|
21147
21212
|
const tokens = hyperlaneWarpRoutes.map((route) => route.symbol);
|
|
21148
21213
|
const uniqueTokens = Array.from(new Set(tokens));
|
|
21149
21214
|
return uniqueTokens.map((symbol) => ({
|
|
@@ -21152,11 +21217,11 @@ function SelectAssetRoute(props) {
|
|
|
21152
21217
|
}));
|
|
21153
21218
|
}, [hyperlaneWarpRoutes]);
|
|
21154
21219
|
if (isTokenSymbolSelector) {
|
|
21155
|
-
return /* @__PURE__ */ jsx100("div", { className: "w-full
|
|
21220
|
+
return /* @__PURE__ */ jsx100("div", { className: "w-full grid grid-cols-1 gap-[var(--ui-kit-gap)]", children: tokenList.map((asset, assetIdx) => /* @__PURE__ */ jsxs90(
|
|
21156
21221
|
Button,
|
|
21157
21222
|
{
|
|
21158
21223
|
variant: selectedAssetSymbol === asset.symbol ? "default" : "outline",
|
|
21159
|
-
className: "w-full",
|
|
21224
|
+
className: "w-full justify-start",
|
|
21160
21225
|
onClick: () => {
|
|
21161
21226
|
useBridgeStore.getState().setBridgeAssetSymbol(asset.symbol);
|
|
21162
21227
|
setIsTokenSymbolSelector(false);
|
|
@@ -21425,7 +21490,7 @@ var init_useErc3643Compliance = __esm({
|
|
|
21425
21490
|
|
|
21426
21491
|
// src/hooks/useNicknameResolve.ts
|
|
21427
21492
|
import { useQuery as useQuery23 } from "@tanstack/react-query";
|
|
21428
|
-
import { useState as useState29, useEffect as useEffect41, useMemo as
|
|
21493
|
+
import { useState as useState29, useEffect as useEffect41, useMemo as useMemo9 } from "react";
|
|
21429
21494
|
function looksLikeNickname(input) {
|
|
21430
21495
|
if (!input) return false;
|
|
21431
21496
|
if (input.startsWith("0x")) return false;
|
|
@@ -21465,7 +21530,7 @@ function useNicknameResolve(input, options) {
|
|
|
21465
21530
|
const isNotFound = query.isError && query.error?.code === "NICKNAME_NOT_FOUND";
|
|
21466
21531
|
const isWalletNotSetup = !!query.data && query.data.resolvedTarget === null;
|
|
21467
21532
|
const isFrozen = query.data?.isFrozen ?? false;
|
|
21468
|
-
const fingerprintVerification =
|
|
21533
|
+
const fingerprintVerification = useMemo9(() => {
|
|
21469
21534
|
if (!query.data?.owner || !query.data?.fingerprint) {
|
|
21470
21535
|
return null;
|
|
21471
21536
|
}
|
|
@@ -22427,7 +22492,7 @@ var init_sendSteps = __esm({
|
|
|
22427
22492
|
|
|
22428
22493
|
// src/internal/components/SendMenu/send/SendMenu.tsx
|
|
22429
22494
|
import { CheckCircle2 as CheckCircle26, Loader as Loader33 } from "lucide-react";
|
|
22430
|
-
import { useEffect as useEffect42, useMemo as
|
|
22495
|
+
import { useEffect as useEffect42, useMemo as useMemo10 } from "react";
|
|
22431
22496
|
import { parseUnits as parseUnits2 } from "viem";
|
|
22432
22497
|
import { Fragment as Fragment43, jsx as jsx109, jsxs as jsxs98 } from "react/jsx-runtime";
|
|
22433
22498
|
function SendMenu() {
|
|
@@ -22488,7 +22553,7 @@ function SendMenu() {
|
|
|
22488
22553
|
const isNicknameInput = looksLikeNickname(recipient);
|
|
22489
22554
|
const resolvedNicknameData = useNicknameResolve(recipient, { enabled: isNicknameInput, chainId: activeChainId });
|
|
22490
22555
|
const effectiveAddress = isNicknameInput ? resolvedNicknameData?.resolvedAddress : recipient;
|
|
22491
|
-
const complianceAmount =
|
|
22556
|
+
const complianceAmount = useMemo10(() => {
|
|
22492
22557
|
if (!isSecurity || !amount || !selectedAsset) return void 0;
|
|
22493
22558
|
try {
|
|
22494
22559
|
return parseUnits2(amount, selectedAsset.decimals || 18);
|
|
@@ -22618,7 +22683,7 @@ function SelectorFlowButtons() {
|
|
|
22618
22683
|
Button,
|
|
22619
22684
|
{
|
|
22620
22685
|
size: "medium",
|
|
22621
|
-
variant: selectorFlow === "send" ? "
|
|
22686
|
+
variant: selectorFlow === "send" ? "default" : "ghost",
|
|
22622
22687
|
className: "flex-1 uppercase",
|
|
22623
22688
|
onClick: () => {
|
|
22624
22689
|
useFlowSelectorStore.getState().setError(null);
|
|
@@ -22634,7 +22699,7 @@ function SelectorFlowButtons() {
|
|
|
22634
22699
|
Button,
|
|
22635
22700
|
{
|
|
22636
22701
|
size: "medium",
|
|
22637
|
-
variant: selectorFlow === "bridge" ? "
|
|
22702
|
+
variant: selectorFlow === "bridge" ? "default" : "ghost",
|
|
22638
22703
|
className: "flex-1 uppercase",
|
|
22639
22704
|
onClick: () => {
|
|
22640
22705
|
useFlowSelectorStore.getState().setError(null);
|
|
@@ -23867,12 +23932,12 @@ var init_TransactionsGroup = __esm({
|
|
|
23867
23932
|
});
|
|
23868
23933
|
|
|
23869
23934
|
// src/internal/components/TransactionsMenu/TransactionsMenu.tsx
|
|
23870
|
-
import { useQuery as useQuery25, useQueryClient as
|
|
23935
|
+
import { useQuery as useQuery25, useQueryClient as useQueryClient24 } from "@tanstack/react-query";
|
|
23871
23936
|
import { ArrowLeft as ArrowLeft22, Loader as Loader34, RefreshCw as RefreshCw3, XCircle } from "lucide-react";
|
|
23872
23937
|
import { useCallback as useCallback25, useState as useState32 } from "react";
|
|
23873
23938
|
import { jsx as jsx116, jsxs as jsxs104 } from "react/jsx-runtime";
|
|
23874
23939
|
function TransactionsMenu() {
|
|
23875
|
-
const qc =
|
|
23940
|
+
const qc = useQueryClient24();
|
|
23876
23941
|
const address = useSession((st) => st.address);
|
|
23877
23942
|
const chainConfig = useSession((st) => st.chainConfig);
|
|
23878
23943
|
const { t } = useT();
|
|
@@ -24239,7 +24304,7 @@ var init_package = __esm({
|
|
|
24239
24304
|
"package.json"() {
|
|
24240
24305
|
package_default = {
|
|
24241
24306
|
name: "@embarkai/ui-kit",
|
|
24242
|
-
version: "0.4.
|
|
24307
|
+
version: "0.4.33",
|
|
24243
24308
|
description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
|
|
24244
24309
|
type: "module",
|
|
24245
24310
|
main: "./dist/index.cjs",
|
|
@@ -24337,11 +24402,11 @@ var init_package = __esm({
|
|
|
24337
24402
|
});
|
|
24338
24403
|
|
|
24339
24404
|
// src/internal/components/Footer/Footer.tsx
|
|
24340
|
-
import { useMutation as useMutation20, useQueryClient as
|
|
24405
|
+
import { useMutation as useMutation20, useQueryClient as useQueryClient25 } from "@tanstack/react-query";
|
|
24341
24406
|
import { Loader as Loader35, LogOut } from "lucide-react";
|
|
24342
24407
|
import { jsx as jsx118, jsxs as jsxs105 } from "react/jsx-runtime";
|
|
24343
24408
|
function Footer() {
|
|
24344
|
-
const qc =
|
|
24409
|
+
const qc = useQueryClient25();
|
|
24345
24410
|
const { callbacksRef } = useProviderConfig();
|
|
24346
24411
|
const { address, setSession, setAddress, setStatus, setError, setIsLoading } = useSession();
|
|
24347
24412
|
const chainConfig = useSession((st) => st.chainConfig);
|
|
@@ -24908,11 +24973,11 @@ var init_TssManager = __esm({
|
|
|
24908
24973
|
|
|
24909
24974
|
// src/internal/components/WalletConnectHandler.tsx
|
|
24910
24975
|
import { useConnectModal as useConnectModal2 } from "@rainbow-me/rainbowkit";
|
|
24911
|
-
import { useMutation as useMutation21, useQueryClient as
|
|
24976
|
+
import { useMutation as useMutation21, useQueryClient as useQueryClient26 } from "@tanstack/react-query";
|
|
24912
24977
|
import React10, { useCallback as useCallback29, useEffect as useEffect48 } from "react";
|
|
24913
24978
|
import { useAccount, useDisconnect, useSignMessage as useSignMessage2 } from "wagmi";
|
|
24914
24979
|
function WalletConnectHandler() {
|
|
24915
|
-
const qc =
|
|
24980
|
+
const qc = useQueryClient26();
|
|
24916
24981
|
const { callbacksRef } = useProviderConfig();
|
|
24917
24982
|
const passportWalletAddress = useSession((st) => st.address);
|
|
24918
24983
|
const { address: walletAddress, isConnected, chain, connector } = useAccount();
|
|
@@ -25245,9 +25310,9 @@ var init_DirectWalletHandler = __esm({
|
|
|
25245
25310
|
// src/context/SessionContext.tsx
|
|
25246
25311
|
import {
|
|
25247
25312
|
createBundlerClientForChain,
|
|
25248
|
-
createPublicClientForChain as
|
|
25313
|
+
createPublicClientForChain as createPublicClientForChain6,
|
|
25249
25314
|
DEFAULT_CHAIN_ID as DEFAULT_CHAIN_ID2,
|
|
25250
|
-
getChainConfig as
|
|
25315
|
+
getChainConfig as getChainConfig9,
|
|
25251
25316
|
getViemChain as getViemChain2
|
|
25252
25317
|
} from "@embarkai/core/read";
|
|
25253
25318
|
import { Fragment as Fragment46 } from "react";
|
|
@@ -25258,7 +25323,7 @@ function getChainParams(chainCfg) {
|
|
|
25258
25323
|
return {
|
|
25259
25324
|
activeChainId: chainCfg.id,
|
|
25260
25325
|
chainConfig: chainCfg,
|
|
25261
|
-
publicClient:
|
|
25326
|
+
publicClient: createPublicClientForChain6(chainCfg.id),
|
|
25262
25327
|
bundlerClient: createBundlerClientForChain(chainCfg.id),
|
|
25263
25328
|
viemChain: getViemChain2(chainCfg.id)
|
|
25264
25329
|
};
|
|
@@ -25356,7 +25421,7 @@ var init_SessionContext = __esm({
|
|
|
25356
25421
|
// Set default chainId after hydration if not persisted
|
|
25357
25422
|
onRehydrateStorage: () => (state) => {
|
|
25358
25423
|
if (!state) return;
|
|
25359
|
-
const hydartedChain = getChainParams(
|
|
25424
|
+
const hydartedChain = getChainParams(getChainConfig9(state.activeChainId || DEFAULT_CHAIN_ID2));
|
|
25360
25425
|
state.activeChainId = hydartedChain.activeChainId;
|
|
25361
25426
|
state.publicClient = hydartedChain.publicClient;
|
|
25362
25427
|
state.bundlerClient = hydartedChain.bundlerClient;
|
|
@@ -25403,7 +25468,7 @@ var init_env = __esm({
|
|
|
25403
25468
|
});
|
|
25404
25469
|
|
|
25405
25470
|
// src/internal/clients/base.ts
|
|
25406
|
-
import { getChainConfig as
|
|
25471
|
+
import { getChainConfig as getChainConfig10, getViemChain as getViemChain3, lumiaMainnetChain, lumiaTestnetChain } from "@embarkai/core/read";
|
|
25407
25472
|
import { http as http4 } from "viem";
|
|
25408
25473
|
import { createBundlerClient } from "viem/account-abstraction";
|
|
25409
25474
|
function getTssUrl2() {
|
|
@@ -25422,7 +25487,7 @@ function getDashboardApiUrl() {
|
|
|
25422
25487
|
const serviceUrls = getServiceUrls();
|
|
25423
25488
|
const paramUrl = typeof window !== "undefined" ? new URLSearchParams(window.location.search).get("dashboardApiUrl") || void 0 : void 0;
|
|
25424
25489
|
const envUrl = getEnvVar("VITE_LUMIA_DASHBOARD_API_URL") || getEnvVar("LUMIA_DASHBOARD_API_URL");
|
|
25425
|
-
return paramUrl || serviceUrls.dashboardApiUrl || envUrl || "https://dashboard.
|
|
25490
|
+
return paramUrl || serviceUrls.dashboardApiUrl || envUrl || "https://dashboard.embarkai.io/api";
|
|
25426
25491
|
}
|
|
25427
25492
|
function getSelectedNetwork() {
|
|
25428
25493
|
const paramNet = typeof window !== "undefined" ? (new URLSearchParams(window.location.search).get("network") || "").toLowerCase() : "";
|
|
@@ -25434,13 +25499,13 @@ function getExplorerUrl() {
|
|
|
25434
25499
|
const paramUrl = typeof window !== "undefined" ? new URLSearchParams(window.location.search).get("explorerUrl") || void 0 : void 0;
|
|
25435
25500
|
const net = getSelectedNetwork();
|
|
25436
25501
|
const chainId = requireActiveChainId();
|
|
25437
|
-
const chainConfig =
|
|
25502
|
+
const chainConfig = getChainConfig10(chainId);
|
|
25438
25503
|
console.log("[getExplorerUrl] ", paramUrl, chainConfig.blockExplorerUrl);
|
|
25439
25504
|
return paramUrl || chainConfig.blockExplorerUrl;
|
|
25440
25505
|
}
|
|
25441
25506
|
function getBundlerClient() {
|
|
25442
25507
|
const chainId = requireActiveChainId();
|
|
25443
|
-
const chainConfig =
|
|
25508
|
+
const chainConfig = getChainConfig10(chainId);
|
|
25444
25509
|
const viemChain = getViemChain3(chainId);
|
|
25445
25510
|
return createBundlerClient({
|
|
25446
25511
|
chain: viemChain,
|
|
@@ -27964,14 +28029,14 @@ var init_rainbowkit = __esm({
|
|
|
27964
28029
|
|
|
27965
28030
|
// src/context/RainbowKitContext.tsx
|
|
27966
28031
|
import { darkTheme, lightTheme, RainbowKitProvider as NativeRainbowKitProvider } from "@rainbow-me/rainbowkit";
|
|
27967
|
-
import { useMemo as
|
|
28032
|
+
import { useMemo as useMemo11 } from "react";
|
|
27968
28033
|
import { WagmiProvider } from "wagmi";
|
|
27969
28034
|
import "@rainbow-me/rainbowkit/styles.css";
|
|
27970
28035
|
import { Fragment as Fragment47, jsx as jsx124 } from "react/jsx-runtime";
|
|
27971
28036
|
function RainbowKitProvider({ children }) {
|
|
27972
28037
|
const config = useProviderConfig().config;
|
|
27973
28038
|
const colorMode = useLayoutStore((st) => st.colorMode);
|
|
27974
|
-
const rainbowConfig =
|
|
28039
|
+
const rainbowConfig = useMemo11(
|
|
27975
28040
|
() => createRainbowConfig({
|
|
27976
28041
|
projectId: config.current?.wallet?.walletConnectProjectId,
|
|
27977
28042
|
allowedWallets: config.current?.wallet?.allowedWallets,
|
|
@@ -27985,7 +28050,7 @@ function RainbowKitProvider({ children }) {
|
|
|
27985
28050
|
config.current?.wallet?.walletConnectProjectId
|
|
27986
28051
|
]
|
|
27987
28052
|
);
|
|
27988
|
-
const customTheme =
|
|
28053
|
+
const customTheme = useMemo11(() => {
|
|
27989
28054
|
if (!config.current?.wallet?.enabled) return {};
|
|
27990
28055
|
return colorMode === "dark" ? {
|
|
27991
28056
|
...darkTheme(),
|
|
@@ -28085,7 +28150,7 @@ import {
|
|
|
28085
28150
|
useCallback as useCallback30,
|
|
28086
28151
|
useContext,
|
|
28087
28152
|
useEffect as useEffect50,
|
|
28088
|
-
useMemo as
|
|
28153
|
+
useMemo as useMemo12,
|
|
28089
28154
|
useRef as useRef21
|
|
28090
28155
|
} from "react";
|
|
28091
28156
|
import { jsx as jsx126 } from "react/jsx-runtime";
|
|
@@ -28198,7 +28263,7 @@ function Provider(props) {
|
|
|
28198
28263
|
console.error("[PROVIDER] Error setting up iframe manager:", error);
|
|
28199
28264
|
}
|
|
28200
28265
|
}, [projectId]);
|
|
28201
|
-
const contextValue =
|
|
28266
|
+
const contextValue = useMemo12(
|
|
28202
28267
|
() => ({
|
|
28203
28268
|
config,
|
|
28204
28269
|
updateConfig,
|
|
@@ -28239,6 +28304,99 @@ init_ProviderContext();
|
|
|
28239
28304
|
|
|
28240
28305
|
// src/components/ConnectWalletButton.tsx
|
|
28241
28306
|
init_LumiaIcon3();
|
|
28307
|
+
|
|
28308
|
+
// src/internal/assets/wallets/EmbarkAiIcon.tsx
|
|
28309
|
+
import { jsx as jsx127, jsxs as jsxs110 } from "react/jsx-runtime";
|
|
28310
|
+
function EmbarkAiIcon(props) {
|
|
28311
|
+
const { width = "24", height = "24", ...svgProps } = props;
|
|
28312
|
+
return /* @__PURE__ */ jsxs110(
|
|
28313
|
+
"svg",
|
|
28314
|
+
{
|
|
28315
|
+
...svgProps,
|
|
28316
|
+
width,
|
|
28317
|
+
height,
|
|
28318
|
+
viewBox: "0 0 26 25",
|
|
28319
|
+
fill: "none",
|
|
28320
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
28321
|
+
style: { flexShrink: 0 },
|
|
28322
|
+
children: [
|
|
28323
|
+
/* @__PURE__ */ jsx127(
|
|
28324
|
+
"path",
|
|
28325
|
+
{
|
|
28326
|
+
d: "M12.7045 5.8037H25.6717C25.6717 2.60055 23.1024 0 19.9298 0H6.96264C6.96264 3.20316 9.53194 5.8037 12.7045 5.8037Z",
|
|
28327
|
+
fill: "url(#paint0_radial_877_49)"
|
|
28328
|
+
}
|
|
28329
|
+
),
|
|
28330
|
+
/* @__PURE__ */ jsx127(
|
|
28331
|
+
"path",
|
|
28332
|
+
{
|
|
28333
|
+
d: "M19.9333 9.59513H7.06557C7.06557 6.39197 4.49627 3.79143 1.32368 3.79143H0V9.59513H6.96265C6.96265 12.7983 9.53195 15.3988 12.7045 15.3988H25.6717C25.6717 12.1957 23.1024 9.59513 19.9298 9.59513H19.9333Z",
|
|
28334
|
+
fill: "url(#paint1_radial_877_49)"
|
|
28335
|
+
}
|
|
28336
|
+
),
|
|
28337
|
+
/* @__PURE__ */ jsx127(
|
|
28338
|
+
"path",
|
|
28339
|
+
{
|
|
28340
|
+
d: "M19.9333 19.1938H7.06202C7.03008 16.0193 4.47498 13.4547 1.32368 13.4547H0V19.2584H6.9662C6.99814 22.4328 9.55324 24.9975 12.7045 24.9975H25.6717C25.6717 21.7943 23.1024 19.1938 19.9298 19.1938H19.9333Z",
|
|
28341
|
+
fill: "url(#paint2_radial_877_49)"
|
|
28342
|
+
}
|
|
28343
|
+
),
|
|
28344
|
+
/* @__PURE__ */ jsxs110("defs", { children: [
|
|
28345
|
+
/* @__PURE__ */ jsxs110(
|
|
28346
|
+
"radialGradient",
|
|
28347
|
+
{
|
|
28348
|
+
id: "paint0_radial_877_49",
|
|
28349
|
+
cx: "0",
|
|
28350
|
+
cy: "0",
|
|
28351
|
+
r: "1",
|
|
28352
|
+
gradientUnits: "userSpaceOnUse",
|
|
28353
|
+
gradientTransform: "translate(25.2529 -0.939785) scale(26.7789 27.0672)",
|
|
28354
|
+
children: [
|
|
28355
|
+
/* @__PURE__ */ jsx127("stop", { stopColor: "#CCFFF8" }),
|
|
28356
|
+
/* @__PURE__ */ jsx127("stop", { offset: "0.36", stopColor: "#0DE4B3" }),
|
|
28357
|
+
/* @__PURE__ */ jsx127("stop", { offset: "1", stopColor: "#D13AFF" })
|
|
28358
|
+
]
|
|
28359
|
+
}
|
|
28360
|
+
),
|
|
28361
|
+
/* @__PURE__ */ jsxs110(
|
|
28362
|
+
"radialGradient",
|
|
28363
|
+
{
|
|
28364
|
+
id: "paint1_radial_877_49",
|
|
28365
|
+
cx: "0",
|
|
28366
|
+
cy: "0",
|
|
28367
|
+
r: "1",
|
|
28368
|
+
gradientUnits: "userSpaceOnUse",
|
|
28369
|
+
gradientTransform: "translate(23.6134 -2.08401) scale(30.1644 30.4892)",
|
|
28370
|
+
children: [
|
|
28371
|
+
/* @__PURE__ */ jsx127("stop", { stopColor: "#CCFFF8" }),
|
|
28372
|
+
/* @__PURE__ */ jsx127("stop", { offset: "0.36", stopColor: "#0DE4B3" }),
|
|
28373
|
+
/* @__PURE__ */ jsx127("stop", { offset: "1", stopColor: "#D13AFF" })
|
|
28374
|
+
]
|
|
28375
|
+
}
|
|
28376
|
+
),
|
|
28377
|
+
/* @__PURE__ */ jsxs110(
|
|
28378
|
+
"radialGradient",
|
|
28379
|
+
{
|
|
28380
|
+
id: "paint2_radial_877_49",
|
|
28381
|
+
cx: "0",
|
|
28382
|
+
cy: "0",
|
|
28383
|
+
r: "1",
|
|
28384
|
+
gradientUnits: "userSpaceOnUse",
|
|
28385
|
+
gradientTransform: "translate(16.0794 5.81084) scale(22.4849 22.727)",
|
|
28386
|
+
children: [
|
|
28387
|
+
/* @__PURE__ */ jsx127("stop", { stopColor: "#CCFFF8" }),
|
|
28388
|
+
/* @__PURE__ */ jsx127("stop", { offset: "0.36", stopColor: "#0DE4B3" }),
|
|
28389
|
+
/* @__PURE__ */ jsx127("stop", { offset: "1", stopColor: "#D13AFF" })
|
|
28390
|
+
]
|
|
28391
|
+
}
|
|
28392
|
+
)
|
|
28393
|
+
] })
|
|
28394
|
+
]
|
|
28395
|
+
}
|
|
28396
|
+
);
|
|
28397
|
+
}
|
|
28398
|
+
|
|
28399
|
+
// src/components/ConnectWalletButton.tsx
|
|
28242
28400
|
init_SessionContext();
|
|
28243
28401
|
init_auth();
|
|
28244
28402
|
init_profile();
|
|
@@ -28251,8 +28409,8 @@ init_pro_mode();
|
|
|
28251
28409
|
init_utils2();
|
|
28252
28410
|
import { useQuery as useQuery28 } from "@tanstack/react-query";
|
|
28253
28411
|
import { Cloud as Cloud4, Laptop as Laptop2, Loader as Loader37, Shield as Shield3 } from "lucide-react";
|
|
28254
|
-
import { useEffect as useEffect51, useMemo as
|
|
28255
|
-
import { Fragment as Fragment48, jsx as
|
|
28412
|
+
import { useEffect as useEffect51, useMemo as useMemo13 } from "react";
|
|
28413
|
+
import { Fragment as Fragment48, jsx as jsx128, jsxs as jsxs111 } from "react/jsx-runtime";
|
|
28256
28414
|
function getFormattedStatus(label, status, showStatus) {
|
|
28257
28415
|
const isStatus = showStatus && status && status !== "idle" && status !== "ready";
|
|
28258
28416
|
if (!isStatus) return label;
|
|
@@ -28279,7 +28437,7 @@ function ConnectWalletButton(props) {
|
|
|
28279
28437
|
queryFn: getUserProfile
|
|
28280
28438
|
});
|
|
28281
28439
|
const displayName = profile?.nicknameDisplay || profile?.displayName || jwtTokenManager2.getDisplayName();
|
|
28282
|
-
const indicators =
|
|
28440
|
+
const indicators = useMemo13(() => {
|
|
28283
28441
|
const userId = session?.mpcUserId;
|
|
28284
28442
|
if (!userId) return { server: false, local: false, backup: false };
|
|
28285
28443
|
const server = jwtTokenManager2.getHasKeyshare() ?? false;
|
|
@@ -28288,20 +28446,20 @@ function ConnectWalletButton(props) {
|
|
|
28288
28446
|
}, [session, address, hasServerVault]);
|
|
28289
28447
|
const proMode = useProMode();
|
|
28290
28448
|
const isConnecting = connectButtonLabel !== label || isLoading;
|
|
28291
|
-
return /* @__PURE__ */
|
|
28449
|
+
return /* @__PURE__ */ jsx128("div", { "data-current-theme-mode": colorMode, className: cn("embarkai-ui-scope w-fit h-fit", className), children: !address ? (
|
|
28292
28450
|
/** external Buttons can be provided */
|
|
28293
|
-
/* @__PURE__ */
|
|
28451
|
+
/* @__PURE__ */ jsx128(Fragment48, { children: ConnectButton ? /* @__PURE__ */ jsxs111(
|
|
28294
28452
|
ConnectButton,
|
|
28295
28453
|
{
|
|
28296
28454
|
type: "button",
|
|
28297
28455
|
disabled: isConnecting,
|
|
28298
28456
|
onClick: () => setPage("auth" /* AUTH */),
|
|
28299
28457
|
children: [
|
|
28300
|
-
isConnecting
|
|
28458
|
+
isConnecting ? /* @__PURE__ */ jsx128("span", { className: "w-6 h-6 flex items-center justify-center", children: /* @__PURE__ */ jsx128(Loader37, { className: "w-4 h-4 animate-spin" }) }) : /* @__PURE__ */ jsx128(EmbarkAiIcon, { className: "w-6 h-6" }),
|
|
28301
28459
|
connectButtonLabel
|
|
28302
28460
|
]
|
|
28303
28461
|
}
|
|
28304
|
-
) : /* @__PURE__ */
|
|
28462
|
+
) : /* @__PURE__ */ jsxs111(
|
|
28305
28463
|
Button,
|
|
28306
28464
|
{
|
|
28307
28465
|
type: "button",
|
|
@@ -28311,19 +28469,19 @@ function ConnectWalletButton(props) {
|
|
|
28311
28469
|
onClick: () => setPage("auth" /* AUTH */),
|
|
28312
28470
|
className: cn(
|
|
28313
28471
|
"account-connect-button w-fit h-16 px-8",
|
|
28314
|
-
|
|
28472
|
+
"rounded-[var(--ui-kit-bdrs)]",
|
|
28315
28473
|
"border-0 border-transparent",
|
|
28316
28474
|
// to override button appearance bd, which case to case might drop black border
|
|
28317
28475
|
"bg-[var(--ui-kit-bg)] hover:bg-[var(--ui-kit-bg)] active:bg-[var(--ui-kit-bg)] text-[var(--ui-kit-fg)]",
|
|
28318
28476
|
"disabled:hover:bg-[var(--ui-kit-bg)] disabled:active:bg-[var(--ui-kit-bg)]"
|
|
28319
28477
|
),
|
|
28320
28478
|
children: [
|
|
28321
|
-
isConnecting
|
|
28479
|
+
isConnecting ? /* @__PURE__ */ jsx128("span", { className: "w-6 h-6 flex items-center justify-center", children: /* @__PURE__ */ jsx128(Loader37, { className: "w-4 h-4 animate-spin" }) }) : /* @__PURE__ */ jsx128(EmbarkAiIcon, { className: "w-6 h-6" }),
|
|
28322
28480
|
connectButtonLabel.toUpperCase()
|
|
28323
28481
|
]
|
|
28324
28482
|
}
|
|
28325
28483
|
) })
|
|
28326
|
-
) : /* @__PURE__ */
|
|
28484
|
+
) : /* @__PURE__ */ jsxs111(
|
|
28327
28485
|
"button",
|
|
28328
28486
|
{
|
|
28329
28487
|
type: "button",
|
|
@@ -28336,26 +28494,26 @@ function ConnectWalletButton(props) {
|
|
|
28336
28494
|
"rounded-[var(--ui-kit-bdrs)] p-4 max-w-sm min-w-[256px]"
|
|
28337
28495
|
),
|
|
28338
28496
|
children: [
|
|
28339
|
-
/* @__PURE__ */
|
|
28340
|
-
proMode && /* @__PURE__ */
|
|
28341
|
-
profile?.avatar ? /* @__PURE__ */
|
|
28497
|
+
/* @__PURE__ */ jsxs111("div", { className: "relative w-12 h-12 rounded-full bg-[var(--ui-kit-fg)] flex items-center justify-center flex-shrink-0", children: [
|
|
28498
|
+
proMode && /* @__PURE__ */ jsx128("span", { className: "absolute -top-1 -right-1 text-[8px] font-bold px-1 rounded bg-[var(--ui-kit-primary)] text-[var(--ui-kit-fg-inverted)] leading-3 z-10", children: "PRO" }),
|
|
28499
|
+
profile?.avatar ? /* @__PURE__ */ jsx128("img", { src: profile.avatar, alt: "User avatar", className: "w-full h-full object-cover" }) : /* @__PURE__ */ jsx128(LumiaIcon3, { width: 48, height: 48 })
|
|
28342
28500
|
] }),
|
|
28343
|
-
/* @__PURE__ */
|
|
28344
|
-
/* @__PURE__ */
|
|
28345
|
-
isProfileLoading ? /* @__PURE__ */
|
|
28346
|
-
!isProfileLoading && /* @__PURE__ */
|
|
28501
|
+
/* @__PURE__ */ jsxs111("div", { className: "text-left flex-1 min-w-0 text-[var(--ui-kit-fg)]", children: [
|
|
28502
|
+
/* @__PURE__ */ jsxs111("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
|
|
28503
|
+
isProfileLoading ? /* @__PURE__ */ jsx128(Loader37, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ jsx128("span", { className: "w-fit text-[14px] leading-4 truncate max-w-[144px] text-[var(--ui-kit-fg)]", children: displayName }),
|
|
28504
|
+
!isProfileLoading && /* @__PURE__ */ jsx128(KYCStatus, {})
|
|
28347
28505
|
] }),
|
|
28348
|
-
/* @__PURE__ */
|
|
28506
|
+
/* @__PURE__ */ jsx128(BalanceView, {})
|
|
28349
28507
|
] }),
|
|
28350
|
-
/* @__PURE__ */
|
|
28351
|
-
/* @__PURE__ */
|
|
28352
|
-
/* @__PURE__ */
|
|
28508
|
+
/* @__PURE__ */ jsxs111("div", { className: "flex items-center space-x-1", children: [
|
|
28509
|
+
/* @__PURE__ */ jsxs111("div", { className: "group relative", children: [
|
|
28510
|
+
/* @__PURE__ */ jsx128(
|
|
28353
28511
|
Cloud4,
|
|
28354
28512
|
{
|
|
28355
28513
|
className: `w-3 h-3 ${indicators.server ? "text-[var(--ui-kit-bg-success)]" : "text-[var(--ui-kit-bg-warning)]"}`
|
|
28356
28514
|
}
|
|
28357
28515
|
),
|
|
28358
|
-
/* @__PURE__ */
|
|
28516
|
+
/* @__PURE__ */ jsxs111(
|
|
28359
28517
|
"div",
|
|
28360
28518
|
{
|
|
28361
28519
|
className: cn(
|
|
@@ -28370,14 +28528,14 @@ function ConnectWalletButton(props) {
|
|
|
28370
28528
|
}
|
|
28371
28529
|
)
|
|
28372
28530
|
] }),
|
|
28373
|
-
/* @__PURE__ */
|
|
28374
|
-
/* @__PURE__ */
|
|
28531
|
+
/* @__PURE__ */ jsxs111("div", { className: "group relative", children: [
|
|
28532
|
+
/* @__PURE__ */ jsx128(
|
|
28375
28533
|
Laptop2,
|
|
28376
28534
|
{
|
|
28377
28535
|
className: `w-3 h-3 ${indicators.local ? "text-[var(--ui-kit-bg-success)]" : "text-[var(--ui-kit-bg-warning)]"}`
|
|
28378
28536
|
}
|
|
28379
28537
|
),
|
|
28380
|
-
/* @__PURE__ */
|
|
28538
|
+
/* @__PURE__ */ jsxs111(
|
|
28381
28539
|
"div",
|
|
28382
28540
|
{
|
|
28383
28541
|
className: cn(
|
|
@@ -28392,14 +28550,14 @@ function ConnectWalletButton(props) {
|
|
|
28392
28550
|
}
|
|
28393
28551
|
)
|
|
28394
28552
|
] }),
|
|
28395
|
-
/* @__PURE__ */
|
|
28396
|
-
/* @__PURE__ */
|
|
28553
|
+
/* @__PURE__ */ jsxs111("div", { className: "group relative", children: [
|
|
28554
|
+
/* @__PURE__ */ jsx128(
|
|
28397
28555
|
Shield3,
|
|
28398
28556
|
{
|
|
28399
28557
|
className: `w-3 h-3 ${indicators.backup ? "text-[var(--ui-kit-bg-success)]" : "text-[var(--ui-kit-bg-warning)]"}`
|
|
28400
28558
|
}
|
|
28401
28559
|
),
|
|
28402
|
-
/* @__PURE__ */
|
|
28560
|
+
/* @__PURE__ */ jsxs111(
|
|
28403
28561
|
"div",
|
|
28404
28562
|
{
|
|
28405
28563
|
className: cn(
|
|
@@ -28415,7 +28573,7 @@ function ConnectWalletButton(props) {
|
|
|
28415
28573
|
)
|
|
28416
28574
|
] })
|
|
28417
28575
|
] }),
|
|
28418
|
-
!!settingsNotifications.length && /* @__PURE__ */
|
|
28576
|
+
!!settingsNotifications.length && /* @__PURE__ */ jsx128(
|
|
28419
28577
|
"div",
|
|
28420
28578
|
{
|
|
28421
28579
|
className: cn(
|
|
@@ -28493,24 +28651,24 @@ init_useColorMode();
|
|
|
28493
28651
|
init_button();
|
|
28494
28652
|
init_utils2();
|
|
28495
28653
|
import { Moon, Sun } from "lucide-react";
|
|
28496
|
-
import { jsx as
|
|
28654
|
+
import { jsx as jsx129 } from "react/jsx-runtime";
|
|
28497
28655
|
function ThemeToggle(props) {
|
|
28498
28656
|
const { className, ...btnProps } = props;
|
|
28499
28657
|
const { colorMode, setColorMode } = useColorMode();
|
|
28500
|
-
return /* @__PURE__ */
|
|
28658
|
+
return /* @__PURE__ */ jsx129(
|
|
28501
28659
|
"div",
|
|
28502
28660
|
{
|
|
28503
28661
|
className: cn("embarkai-ui-scope", className),
|
|
28504
28662
|
"data-current-theme-mode": colorMode,
|
|
28505
28663
|
style: { width: "fit-content", height: "fit-content" },
|
|
28506
|
-
children: /* @__PURE__ */
|
|
28664
|
+
children: /* @__PURE__ */ jsx129(
|
|
28507
28665
|
Button,
|
|
28508
28666
|
{
|
|
28509
28667
|
...btnProps,
|
|
28510
28668
|
variant: "ghost",
|
|
28511
28669
|
onClick: () => setColorMode(colorMode === "light" ? "dark" : "light"),
|
|
28512
28670
|
title: `Current theme: ${colorMode}. Click to switch.`,
|
|
28513
|
-
children: colorMode === "dark" ? /* @__PURE__ */
|
|
28671
|
+
children: colorMode === "dark" ? /* @__PURE__ */ jsx129(Sun, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx129(Moon, { className: "w-4 h-4" })
|
|
28514
28672
|
}
|
|
28515
28673
|
)
|
|
28516
28674
|
}
|
|
@@ -28522,18 +28680,18 @@ init_i18n();
|
|
|
28522
28680
|
init_button();
|
|
28523
28681
|
init_useLayoutDataStore();
|
|
28524
28682
|
init_utils2();
|
|
28525
|
-
import { jsx as
|
|
28683
|
+
import { jsx as jsx130 } from "react/jsx-runtime";
|
|
28526
28684
|
function LangToggle(props) {
|
|
28527
28685
|
const { className, ...btnProps } = props;
|
|
28528
28686
|
const { i18n } = useT();
|
|
28529
28687
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
28530
|
-
return /* @__PURE__ */
|
|
28688
|
+
return /* @__PURE__ */ jsx130(
|
|
28531
28689
|
"div",
|
|
28532
28690
|
{
|
|
28533
28691
|
className: cn("embarkai-ui-scope", className),
|
|
28534
28692
|
"data-mbark-language": i18n.resolvedLanguage || "en",
|
|
28535
28693
|
style: { width: "fit-content", height: "fit-content" },
|
|
28536
|
-
children: /* @__PURE__ */
|
|
28694
|
+
children: /* @__PURE__ */ jsx130(
|
|
28537
28695
|
Button,
|
|
28538
28696
|
{
|
|
28539
28697
|
...btnProps,
|
|
@@ -28557,10 +28715,10 @@ import * as React12 from "react";
|
|
|
28557
28715
|
// src/clients/bundler/getUserOperationByHash.ts
|
|
28558
28716
|
init_SessionContext();
|
|
28559
28717
|
import { bundlerRpc } from "@embarkai/core";
|
|
28560
|
-
import { getChainConfig as
|
|
28718
|
+
import { getChainConfig as getChainConfig11 } from "@embarkai/core/read";
|
|
28561
28719
|
async function getUserOperationByHash(userOpHash, chainId) {
|
|
28562
28720
|
const targetChainId = chainId ?? requireActiveChainId();
|
|
28563
|
-
const chainConfig =
|
|
28721
|
+
const chainConfig = getChainConfig11(targetChainId);
|
|
28564
28722
|
if (!chainConfig) {
|
|
28565
28723
|
throw new Error(`Chain ${targetChainId} is not supported`);
|
|
28566
28724
|
}
|
|
@@ -28592,10 +28750,10 @@ async function getUserOperationByHash(userOpHash, chainId) {
|
|
|
28592
28750
|
// src/clients/bundler/getUserOperationReceipt.ts
|
|
28593
28751
|
init_SessionContext();
|
|
28594
28752
|
import { bundlerRpc as bundlerRpc2 } from "@embarkai/core";
|
|
28595
|
-
import { getChainConfig as
|
|
28753
|
+
import { getChainConfig as getChainConfig12 } from "@embarkai/core/read";
|
|
28596
28754
|
async function getUserOperationReceipt(userOpHash, chainId) {
|
|
28597
28755
|
const targetChainId = chainId ?? requireActiveChainId();
|
|
28598
|
-
const chainConfig =
|
|
28756
|
+
const chainConfig = getChainConfig12(targetChainId);
|
|
28599
28757
|
if (!chainConfig) {
|
|
28600
28758
|
throw new Error(`Chain ${targetChainId} is not supported`);
|
|
28601
28759
|
}
|
|
@@ -28638,7 +28796,7 @@ init_cn();
|
|
|
28638
28796
|
init_button();
|
|
28639
28797
|
import { Copy as Copy6, ExternalLink as ExternalLink2 } from "lucide-react";
|
|
28640
28798
|
import * as React11 from "react";
|
|
28641
|
-
import { jsx as
|
|
28799
|
+
import { jsx as jsx131, jsxs as jsxs112 } from "react/jsx-runtime";
|
|
28642
28800
|
function toExplorerAddressUrl(address, chain) {
|
|
28643
28801
|
const base2 = chain?.blockExplorers?.default?.url;
|
|
28644
28802
|
if (!base2) return null;
|
|
@@ -28660,11 +28818,11 @@ var Address = ({
|
|
|
28660
28818
|
const addr = address || "";
|
|
28661
28819
|
const explorer = toExplorerAddressUrl(addr, chain || void 0);
|
|
28662
28820
|
const [copied, setCopied] = React11.useState(false);
|
|
28663
|
-
if (!addr) return /* @__PURE__ */
|
|
28664
|
-
return /* @__PURE__ */
|
|
28665
|
-
label && /* @__PURE__ */
|
|
28666
|
-
/* @__PURE__ */
|
|
28667
|
-
showCopy && /* @__PURE__ */
|
|
28821
|
+
if (!addr) return /* @__PURE__ */ jsx131("span", { className: cn2("text-muted-foreground", className), children: "\u2014" });
|
|
28822
|
+
return /* @__PURE__ */ jsxs112("div", { className: cn2("flex items-center gap-2", className), style: { listStyle: "none" }, children: [
|
|
28823
|
+
label && /* @__PURE__ */ jsx131("span", { className: "text-sm font-medium", children: label }),
|
|
28824
|
+
/* @__PURE__ */ jsx131("code", { className: "text-xs bg-background px-2 py-1 rounded select-all", children: truncate ? short(addr) : addr }),
|
|
28825
|
+
showCopy && /* @__PURE__ */ jsx131(
|
|
28668
28826
|
Button,
|
|
28669
28827
|
{
|
|
28670
28828
|
variant: "ghost",
|
|
@@ -28678,10 +28836,10 @@ var Address = ({
|
|
|
28678
28836
|
} catch {
|
|
28679
28837
|
}
|
|
28680
28838
|
},
|
|
28681
|
-
children: /* @__PURE__ */
|
|
28839
|
+
children: /* @__PURE__ */ jsx131(Copy6, { className: "h-4 w-4" })
|
|
28682
28840
|
}
|
|
28683
28841
|
),
|
|
28684
|
-
showExplorer && explorer && /* @__PURE__ */
|
|
28842
|
+
showExplorer && explorer && /* @__PURE__ */ jsx131(
|
|
28685
28843
|
"a",
|
|
28686
28844
|
{
|
|
28687
28845
|
href: explorer,
|
|
@@ -28689,7 +28847,7 @@ var Address = ({
|
|
|
28689
28847
|
rel: "noreferrer noopener",
|
|
28690
28848
|
className: "inline-flex items-center justify-center h-10 w-10 rounded-md hover:bg-accent text-foreground",
|
|
28691
28849
|
title: "Open in explorer",
|
|
28692
|
-
children: /* @__PURE__ */
|
|
28850
|
+
children: /* @__PURE__ */ jsx131(ExternalLink2, { className: "h-4 w-4" })
|
|
28693
28851
|
}
|
|
28694
28852
|
)
|
|
28695
28853
|
] });
|
|
@@ -28698,7 +28856,7 @@ var Address = ({
|
|
|
28698
28856
|
// src/internal/components/UserOpStatus.tsx
|
|
28699
28857
|
init_badge();
|
|
28700
28858
|
init_button();
|
|
28701
|
-
import { jsx as
|
|
28859
|
+
import { jsx as jsx132, jsxs as jsxs113 } from "react/jsx-runtime";
|
|
28702
28860
|
var UserOpStatus = ({
|
|
28703
28861
|
userOpHash,
|
|
28704
28862
|
chain,
|
|
@@ -28813,35 +28971,35 @@ var UserOpStatus = ({
|
|
|
28813
28971
|
const stateBadge = () => {
|
|
28814
28972
|
if (receipt) {
|
|
28815
28973
|
const ok = !!receipt.success;
|
|
28816
|
-
return /* @__PURE__ */
|
|
28817
|
-
ok ? /* @__PURE__ */
|
|
28974
|
+
return /* @__PURE__ */ jsxs113(Badge, { variant: ok ? "success" : "destructive", children: [
|
|
28975
|
+
ok ? /* @__PURE__ */ jsx132(CheckCircle27, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx132(AlertCircle8, { className: "h-3 w-3" }),
|
|
28818
28976
|
ok ? "Included" : "Failed"
|
|
28819
28977
|
] });
|
|
28820
28978
|
}
|
|
28821
28979
|
if (rejected) {
|
|
28822
|
-
return /* @__PURE__ */
|
|
28823
|
-
/* @__PURE__ */
|
|
28980
|
+
return /* @__PURE__ */ jsxs113(Badge, { variant: "destructive", children: [
|
|
28981
|
+
/* @__PURE__ */ jsx132(AlertCircle8, { className: "h-3 w-3" }),
|
|
28824
28982
|
" Rejected by bundler"
|
|
28825
28983
|
] });
|
|
28826
28984
|
}
|
|
28827
28985
|
if (timedOut) {
|
|
28828
|
-
return /* @__PURE__ */
|
|
28829
|
-
/* @__PURE__ */
|
|
28986
|
+
return /* @__PURE__ */ jsxs113(Badge, { variant: "warning", children: [
|
|
28987
|
+
/* @__PURE__ */ jsx132(AlertCircle8, { className: "h-3 w-3" }),
|
|
28830
28988
|
" Timeout - may be rejected"
|
|
28831
28989
|
] });
|
|
28832
28990
|
}
|
|
28833
28991
|
if (mempool) {
|
|
28834
|
-
return /* @__PURE__ */
|
|
28835
|
-
/* @__PURE__ */
|
|
28992
|
+
return /* @__PURE__ */ jsxs113(Badge, { variant: "outline", children: [
|
|
28993
|
+
/* @__PURE__ */ jsx132(Clock2, { className: "h-3 w-3" }),
|
|
28836
28994
|
" Pending in bundler"
|
|
28837
28995
|
] });
|
|
28838
28996
|
}
|
|
28839
|
-
return /* @__PURE__ */
|
|
28840
|
-
/* @__PURE__ */
|
|
28997
|
+
return /* @__PURE__ */ jsxs113(Badge, { variant: "secondary", children: [
|
|
28998
|
+
/* @__PURE__ */ jsx132(Clock2, { className: "h-3 w-3" }),
|
|
28841
28999
|
" Waiting"
|
|
28842
29000
|
] });
|
|
28843
29001
|
};
|
|
28844
|
-
return /* @__PURE__ */
|
|
29002
|
+
return /* @__PURE__ */ jsxs113(
|
|
28845
29003
|
"div",
|
|
28846
29004
|
{
|
|
28847
29005
|
className: cn2(
|
|
@@ -28850,20 +29008,20 @@ var UserOpStatus = ({
|
|
|
28850
29008
|
),
|
|
28851
29009
|
style: { textAlign: "left", listStyle: "none" },
|
|
28852
29010
|
children: [
|
|
28853
|
-
/* @__PURE__ */
|
|
28854
|
-
/* @__PURE__ */
|
|
29011
|
+
/* @__PURE__ */ jsxs113("div", { className: "flex items-center justify-between mb-3", children: [
|
|
29012
|
+
/* @__PURE__ */ jsxs113("div", { className: "flex items-center gap-2", children: [
|
|
28855
29013
|
stateBadge(),
|
|
28856
|
-
/* @__PURE__ */
|
|
29014
|
+
/* @__PURE__ */ jsx132("span", { className: "text-xs text-muted-foreground", children: "This is a UserOperation hash (EIP-4337), not a L2 tx hash." })
|
|
28857
29015
|
] }),
|
|
28858
|
-
/* @__PURE__ */
|
|
28859
|
-
/* @__PURE__ */
|
|
28860
|
-
/* @__PURE__ */
|
|
29016
|
+
/* @__PURE__ */ jsxs113(Button, { variant: "ghost", size: "small", onClick: () => tick(), disabled: refreshing, className: "h-8", children: [
|
|
29017
|
+
/* @__PURE__ */ jsx132(RefreshCw4, { className: cn2("h-3.5 w-3.5 mr-1", refreshing && "animate-spin") }),
|
|
29018
|
+
/* @__PURE__ */ jsx132("span", { className: "text-xs", children: "Refresh" })
|
|
28861
29019
|
] })
|
|
28862
29020
|
] }),
|
|
28863
|
-
/* @__PURE__ */
|
|
28864
|
-
/* @__PURE__ */
|
|
28865
|
-
/* @__PURE__ */
|
|
28866
|
-
/* @__PURE__ */
|
|
29021
|
+
/* @__PURE__ */ jsxs113("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
29022
|
+
/* @__PURE__ */ jsx132("span", { className: "text-sm font-medium min-w-16 shrink-0", children: "UO Hash" }),
|
|
29023
|
+
/* @__PURE__ */ jsx132("code", { className: "text-xs font-mono flex-1 select-all", children: userOpHash }),
|
|
29024
|
+
/* @__PURE__ */ jsx132(
|
|
28867
29025
|
Button,
|
|
28868
29026
|
{
|
|
28869
29027
|
variant: "ghost",
|
|
@@ -28875,14 +29033,14 @@ var UserOpStatus = ({
|
|
|
28875
29033
|
} catch {
|
|
28876
29034
|
}
|
|
28877
29035
|
},
|
|
28878
|
-
children: /* @__PURE__ */
|
|
29036
|
+
children: /* @__PURE__ */ jsx132(Copy7, { className: "h-3.5 w-3.5" })
|
|
28879
29037
|
}
|
|
28880
29038
|
)
|
|
28881
29039
|
] }),
|
|
28882
|
-
receipt && receipt.receipt?.transactionHash && /* @__PURE__ */
|
|
28883
|
-
/* @__PURE__ */
|
|
28884
|
-
/* @__PURE__ */
|
|
28885
|
-
/* @__PURE__ */
|
|
29040
|
+
receipt && receipt.receipt?.transactionHash && /* @__PURE__ */ jsxs113("div", { className: "flex items-center gap-2 mb-3", children: [
|
|
29041
|
+
/* @__PURE__ */ jsx132("span", { className: "text-sm font-medium min-w-16 shrink-0", children: "Tx Hash" }),
|
|
29042
|
+
/* @__PURE__ */ jsx132("code", { className: "text-xs font-mono flex-1 select-all", children: receipt.receipt.transactionHash }),
|
|
29043
|
+
/* @__PURE__ */ jsx132(
|
|
28886
29044
|
Button,
|
|
28887
29045
|
{
|
|
28888
29046
|
variant: "ghost",
|
|
@@ -28894,10 +29052,10 @@ var UserOpStatus = ({
|
|
|
28894
29052
|
} catch {
|
|
28895
29053
|
}
|
|
28896
29054
|
},
|
|
28897
|
-
children: /* @__PURE__ */
|
|
29055
|
+
children: /* @__PURE__ */ jsx132(Copy7, { className: "h-3.5 w-3.5" })
|
|
28898
29056
|
}
|
|
28899
29057
|
),
|
|
28900
|
-
chain?.blockExplorers?.default?.url && /* @__PURE__ */
|
|
29058
|
+
chain?.blockExplorers?.default?.url && /* @__PURE__ */ jsx132(
|
|
28901
29059
|
"a",
|
|
28902
29060
|
{
|
|
28903
29061
|
href: `${chain.blockExplorers.default.url}/tx/${receipt.receipt.transactionHash}`,
|
|
@@ -28905,11 +29063,11 @@ var UserOpStatus = ({
|
|
|
28905
29063
|
rel: "noreferrer noopener",
|
|
28906
29064
|
className: "inline-flex items-center justify-center h-8 w-8 rounded-md hover:bg-accent text-foreground",
|
|
28907
29065
|
title: "Open in explorer",
|
|
28908
|
-
children: /* @__PURE__ */
|
|
29066
|
+
children: /* @__PURE__ */ jsx132(ExternalLink3, { className: "h-3.5 w-3.5" })
|
|
28909
29067
|
}
|
|
28910
29068
|
)
|
|
28911
29069
|
] }),
|
|
28912
|
-
receipt && /* @__PURE__ */
|
|
29070
|
+
receipt && /* @__PURE__ */ jsxs113("div", { className: "text-xs text-muted-foreground mb-3", children: [
|
|
28913
29071
|
"Block ",
|
|
28914
29072
|
parseInt(receipt.receipt?.blockNumber || "0x0", 16),
|
|
28915
29073
|
" \u2022 Gas Used",
|
|
@@ -28918,32 +29076,32 @@ var UserOpStatus = ({
|
|
|
28918
29076
|
" \u2022 Success ",
|
|
28919
29077
|
String(!!receipt.success)
|
|
28920
29078
|
] }),
|
|
28921
|
-
/* @__PURE__ */
|
|
29079
|
+
/* @__PURE__ */ jsx132("div", { className: "text-xs text-muted-foreground", children: !receipt && !timedOut && !rejected && /* @__PURE__ */ jsxs113("span", { className: "ml-2", children: [
|
|
28922
29080
|
"\u2022 Polling for ",
|
|
28923
29081
|
Math.round((Date.now() - startTimeRef.current) / 1e3),
|
|
28924
29082
|
"s"
|
|
28925
29083
|
] }) }),
|
|
28926
|
-
mempool && /* @__PURE__ */
|
|
28927
|
-
/* @__PURE__ */
|
|
29084
|
+
mempool && /* @__PURE__ */ jsxs113("div", { className: "text-sm text-muted-foreground mt-2", style: { listStyle: "none" }, children: [
|
|
29085
|
+
/* @__PURE__ */ jsxs113("div", { children: [
|
|
28928
29086
|
"Seen by bundler at ",
|
|
28929
|
-
/* @__PURE__ */
|
|
29087
|
+
/* @__PURE__ */ jsx132(Address, { address: mempool.entryPoint, chain, showExplorer: true, truncate: false })
|
|
28930
29088
|
] }),
|
|
28931
|
-
/* @__PURE__ */
|
|
29089
|
+
/* @__PURE__ */ jsxs113("div", { children: [
|
|
28932
29090
|
"sender ",
|
|
28933
|
-
/* @__PURE__ */
|
|
29091
|
+
/* @__PURE__ */ jsx132(Address, { address: mempool.sender, chain, truncate: false })
|
|
28934
29092
|
] })
|
|
28935
29093
|
] }),
|
|
28936
|
-
error && /* @__PURE__ */
|
|
28937
|
-
/* @__PURE__ */
|
|
29094
|
+
error && /* @__PURE__ */ jsxs113("div", { className: "text-sm text-destructive flex items-center gap-1 mt-4", children: [
|
|
29095
|
+
/* @__PURE__ */ jsx132(AlertCircle8, { className: "h-4 w-4" }),
|
|
28938
29096
|
" ",
|
|
28939
29097
|
error
|
|
28940
29098
|
] }),
|
|
28941
|
-
rejected && /* @__PURE__ */
|
|
28942
|
-
/* @__PURE__ */
|
|
29099
|
+
rejected && /* @__PURE__ */ jsxs113("div", { className: "text-sm text-destructive flex items-center gap-1 mt-4", children: [
|
|
29100
|
+
/* @__PURE__ */ jsx132(AlertCircle8, { className: "h-4 w-4" }),
|
|
28943
29101
|
"UserOperation was dropped from bundler mempool. This usually means it was invalid or replaced."
|
|
28944
29102
|
] }),
|
|
28945
|
-
timedOut && /* @__PURE__ */
|
|
28946
|
-
/* @__PURE__ */
|
|
29103
|
+
timedOut && /* @__PURE__ */ jsxs113("div", { className: "text-sm text-destructive flex items-center gap-1 mt-4", children: [
|
|
29104
|
+
/* @__PURE__ */ jsx132(AlertCircle8, { className: "h-4 w-4" }),
|
|
28947
29105
|
"Stopped polling after ",
|
|
28948
29106
|
Math.round(maxPollTimeMs / 1e3),
|
|
28949
29107
|
"s. UserOperation may have been rejected by the bundler."
|
|
@@ -28958,7 +29116,7 @@ init_cn();
|
|
|
28958
29116
|
init_button();
|
|
28959
29117
|
import { Copy as Copy8, ExternalLink as ExternalLink4 } from "lucide-react";
|
|
28960
29118
|
import * as React13 from "react";
|
|
28961
|
-
import { jsx as
|
|
29119
|
+
import { jsx as jsx133, jsxs as jsxs114 } from "react/jsx-runtime";
|
|
28962
29120
|
function toExplorerUrl(kind, value, chain) {
|
|
28963
29121
|
const base2 = chain?.blockExplorers?.default?.url;
|
|
28964
29122
|
if (!base2) return null;
|
|
@@ -28982,11 +29140,11 @@ var Hash = ({
|
|
|
28982
29140
|
const value = hash || "";
|
|
28983
29141
|
const explorer = toExplorerUrl(kind, value, chain || void 0);
|
|
28984
29142
|
const [copied, setCopied] = React13.useState(false);
|
|
28985
|
-
if (!value) return /* @__PURE__ */
|
|
28986
|
-
return /* @__PURE__ */
|
|
28987
|
-
label && /* @__PURE__ */
|
|
28988
|
-
/* @__PURE__ */
|
|
28989
|
-
showCopy && /* @__PURE__ */
|
|
29143
|
+
if (!value) return /* @__PURE__ */ jsx133("span", { className: cn2("text-muted-foreground", className), children: "\u2014" });
|
|
29144
|
+
return /* @__PURE__ */ jsxs114("div", { className: cn2("flex items-center gap-2", className), children: [
|
|
29145
|
+
label && /* @__PURE__ */ jsx133("span", { className: "text-sm font-medium", children: label }),
|
|
29146
|
+
/* @__PURE__ */ jsx133("code", { className: "text-xs bg-background px-2 py-1 rounded break-all", children: truncate ? short2(value) : value }),
|
|
29147
|
+
showCopy && /* @__PURE__ */ jsx133(
|
|
28990
29148
|
Button,
|
|
28991
29149
|
{
|
|
28992
29150
|
variant: "ghost",
|
|
@@ -29000,10 +29158,10 @@ var Hash = ({
|
|
|
29000
29158
|
} catch {
|
|
29001
29159
|
}
|
|
29002
29160
|
},
|
|
29003
|
-
children: /* @__PURE__ */
|
|
29161
|
+
children: /* @__PURE__ */ jsx133(Copy8, { className: "h-4 w-4" })
|
|
29004
29162
|
}
|
|
29005
29163
|
),
|
|
29006
|
-
showExplorer && explorer && /* @__PURE__ */
|
|
29164
|
+
showExplorer && explorer && /* @__PURE__ */ jsx133(
|
|
29007
29165
|
"a",
|
|
29008
29166
|
{
|
|
29009
29167
|
href: explorer,
|
|
@@ -29011,7 +29169,7 @@ var Hash = ({
|
|
|
29011
29169
|
rel: "noreferrer noopener",
|
|
29012
29170
|
className: "inline-flex items-center justify-center h-10 w-10 rounded-md hover:bg-accent text-foreground",
|
|
29013
29171
|
title: "Open in explorer",
|
|
29014
|
-
children: /* @__PURE__ */
|
|
29172
|
+
children: /* @__PURE__ */ jsx133(ExternalLink4, { className: "h-4 w-4" })
|
|
29015
29173
|
}
|
|
29016
29174
|
)
|
|
29017
29175
|
] });
|
|
@@ -29020,7 +29178,7 @@ var Hash = ({
|
|
|
29020
29178
|
// src/internal/components/TransactionsMenu/TransactionsList.tsx
|
|
29021
29179
|
init_base();
|
|
29022
29180
|
import { useEffect as useEffect53, useState as useState37 } from "react";
|
|
29023
|
-
import { jsx as
|
|
29181
|
+
import { jsx as jsx134, jsxs as jsxs115 } from "react/jsx-runtime";
|
|
29024
29182
|
var TransactionsList = ({ address, itemsCount = 10 }) => {
|
|
29025
29183
|
const [transactions, setTransactions] = useState37([]);
|
|
29026
29184
|
const [loading, setLoading] = useState37(true);
|
|
@@ -29071,31 +29229,31 @@ var TransactionsList = ({ address, itemsCount = 10 }) => {
|
|
|
29071
29229
|
window.open(`${explorerUrl}/tx/${txHash}`, "_blank");
|
|
29072
29230
|
};
|
|
29073
29231
|
if (loading) {
|
|
29074
|
-
return /* @__PURE__ */
|
|
29075
|
-
/* @__PURE__ */
|
|
29076
|
-
/* @__PURE__ */
|
|
29232
|
+
return /* @__PURE__ */ jsxs115("div", { className: "p-4 text-center", children: [
|
|
29233
|
+
/* @__PURE__ */ jsx134("div", { className: "animate-spin inline-block w-6 h-6 border-2 border-current border-t-transparent rounded-full" }),
|
|
29234
|
+
/* @__PURE__ */ jsx134("p", { className: "mt-2 text-sm text-gray-600", children: "Loading transactions..." })
|
|
29077
29235
|
] });
|
|
29078
29236
|
}
|
|
29079
29237
|
if (error) {
|
|
29080
|
-
return /* @__PURE__ */
|
|
29081
|
-
/* @__PURE__ */
|
|
29082
|
-
/* @__PURE__ */
|
|
29238
|
+
return /* @__PURE__ */ jsxs115("div", { className: "p-4 text-center", children: [
|
|
29239
|
+
/* @__PURE__ */ jsx134("p", { className: "text-red-600 text-sm", children: error }),
|
|
29240
|
+
/* @__PURE__ */ jsx134("button", { onClick: () => window.location.reload(), className: "mt-2 text-blue-600 text-sm hover:underline", children: "Retry" })
|
|
29083
29241
|
] });
|
|
29084
29242
|
}
|
|
29085
29243
|
if (transactions.length === 0) {
|
|
29086
|
-
return /* @__PURE__ */
|
|
29244
|
+
return /* @__PURE__ */ jsx134("div", { className: "p-4 text-center", children: /* @__PURE__ */ jsx134("p", { className: "text-gray-600 text-sm", children: "No transactions found" }) });
|
|
29087
29245
|
}
|
|
29088
|
-
return /* @__PURE__ */
|
|
29246
|
+
return /* @__PURE__ */ jsx134("div", { className: "max-h-96 overflow-y-auto", children: /* @__PURE__ */ jsx134("div", { className: "space-y-2 p-2", children: transactions.map((tx) => /* @__PURE__ */ jsxs115(
|
|
29089
29247
|
"div",
|
|
29090
29248
|
{
|
|
29091
29249
|
className: "border rounded-lg p-3 hover:bg-gray-50 cursor-pointer transition-colors",
|
|
29092
29250
|
onClick: () => openTransaction(tx.hash),
|
|
29093
29251
|
children: [
|
|
29094
|
-
/* @__PURE__ */
|
|
29095
|
-
/* @__PURE__ */
|
|
29096
|
-
/* @__PURE__ */
|
|
29097
|
-
/* @__PURE__ */
|
|
29098
|
-
/* @__PURE__ */
|
|
29252
|
+
/* @__PURE__ */ jsxs115("div", { className: "flex justify-between items-start mb-2", children: [
|
|
29253
|
+
/* @__PURE__ */ jsxs115("div", { className: "flex-1", children: [
|
|
29254
|
+
/* @__PURE__ */ jsxs115("div", { className: "flex items-center space-x-2 mb-1", children: [
|
|
29255
|
+
/* @__PURE__ */ jsx134("span", { className: "text-xs font-mono bg-gray-100 px-2 py-1 rounded", children: formatAddress3(tx.hash) }),
|
|
29256
|
+
/* @__PURE__ */ jsx134(
|
|
29099
29257
|
"span",
|
|
29100
29258
|
{
|
|
29101
29259
|
className: `text-xs px-2 py-1 rounded ${tx.status === "ok" ? "bg-green-100 text-green-800" : "bg-red-100 text-red-800"}`,
|
|
@@ -29103,40 +29261,40 @@ var TransactionsList = ({ address, itemsCount = 10 }) => {
|
|
|
29103
29261
|
}
|
|
29104
29262
|
)
|
|
29105
29263
|
] }),
|
|
29106
|
-
/* @__PURE__ */
|
|
29107
|
-
/* @__PURE__ */
|
|
29108
|
-
/* @__PURE__ */
|
|
29109
|
-
/* @__PURE__ */
|
|
29264
|
+
/* @__PURE__ */ jsxs115("div", { className: "text-sm space-y-1", children: [
|
|
29265
|
+
/* @__PURE__ */ jsxs115("div", { children: [
|
|
29266
|
+
/* @__PURE__ */ jsx134("span", { className: "text-gray-600", children: "From:" }),
|
|
29267
|
+
/* @__PURE__ */ jsxs115("span", { className: "font-mono ml-1", children: [
|
|
29110
29268
|
formatAddress3(tx.from.hash),
|
|
29111
|
-
tx.from.is_contract && /* @__PURE__ */
|
|
29269
|
+
tx.from.is_contract && /* @__PURE__ */ jsx134("span", { className: "text-xs text-blue-600 ml-1", children: "(Contract)" })
|
|
29112
29270
|
] })
|
|
29113
29271
|
] }),
|
|
29114
|
-
/* @__PURE__ */
|
|
29115
|
-
/* @__PURE__ */
|
|
29116
|
-
/* @__PURE__ */
|
|
29272
|
+
/* @__PURE__ */ jsxs115("div", { children: [
|
|
29273
|
+
/* @__PURE__ */ jsx134("span", { className: "text-gray-600", children: "To:" }),
|
|
29274
|
+
/* @__PURE__ */ jsxs115("span", { className: "font-mono ml-1", children: [
|
|
29117
29275
|
formatAddress3(tx.to.hash),
|
|
29118
|
-
tx.to.is_contract && /* @__PURE__ */
|
|
29276
|
+
tx.to.is_contract && /* @__PURE__ */ jsx134("span", { className: "text-xs text-blue-600 ml-1", children: "(Contract)" })
|
|
29119
29277
|
] })
|
|
29120
29278
|
] }),
|
|
29121
|
-
/* @__PURE__ */
|
|
29122
|
-
/* @__PURE__ */
|
|
29123
|
-
/* @__PURE__ */
|
|
29279
|
+
/* @__PURE__ */ jsxs115("div", { children: [
|
|
29280
|
+
/* @__PURE__ */ jsx134("span", { className: "text-gray-600", children: "Value:" }),
|
|
29281
|
+
/* @__PURE__ */ jsxs115("span", { className: "font-semibold ml-1", children: [
|
|
29124
29282
|
formatValue3(tx.value),
|
|
29125
29283
|
" LUMIA"
|
|
29126
29284
|
] })
|
|
29127
29285
|
] })
|
|
29128
29286
|
] })
|
|
29129
29287
|
] }),
|
|
29130
|
-
/* @__PURE__ */
|
|
29131
|
-
/* @__PURE__ */
|
|
29132
|
-
/* @__PURE__ */
|
|
29288
|
+
/* @__PURE__ */ jsxs115("div", { className: "text-right text-xs text-gray-500", children: [
|
|
29289
|
+
/* @__PURE__ */ jsx134("div", { children: formatDate2(tx.timestamp) }),
|
|
29290
|
+
/* @__PURE__ */ jsxs115("div", { className: "mt-1", children: [
|
|
29133
29291
|
"Gas: ",
|
|
29134
29292
|
parseInt(tx.gas_used).toLocaleString()
|
|
29135
29293
|
] }),
|
|
29136
|
-
tx.method && /* @__PURE__ */
|
|
29294
|
+
tx.method && /* @__PURE__ */ jsx134("div", { className: "mt-1 text-blue-600", children: tx.method })
|
|
29137
29295
|
] })
|
|
29138
29296
|
] }),
|
|
29139
|
-
tx.transaction_types.length > 0 && /* @__PURE__ */
|
|
29297
|
+
tx.transaction_types.length > 0 && /* @__PURE__ */ jsx134("div", { className: "flex flex-wrap gap-1 mt-2", children: tx.transaction_types.map((type, idx) => /* @__PURE__ */ jsx134("span", { className: "text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded-full", children: type.replace("_", " ") }, idx)) })
|
|
29140
29298
|
]
|
|
29141
29299
|
},
|
|
29142
29300
|
tx.hash
|
|
@@ -29462,7 +29620,7 @@ function useSendDirectTransaction() {
|
|
|
29462
29620
|
init_SessionContext();
|
|
29463
29621
|
init_account2();
|
|
29464
29622
|
init_linkedProfiles();
|
|
29465
|
-
import { useCallback as useCallback37, useMemo as
|
|
29623
|
+
import { useCallback as useCallback37, useMemo as useMemo14, useState as useState40 } from "react";
|
|
29466
29624
|
import { encodeFunctionData as encodeFunctionData3, isAddress as isAddress4, parseEther as parseEther4, parseUnits as parseUnits3 } from "viem";
|
|
29467
29625
|
var ERC20_TRANSFER_ABI2 = [
|
|
29468
29626
|
{
|
|
@@ -29481,7 +29639,7 @@ function useTransferToLinkedWallet() {
|
|
|
29481
29639
|
const [isPending, setIsPending] = useState40(false);
|
|
29482
29640
|
const [error, setError] = useState40(null);
|
|
29483
29641
|
const [userOpHash, setUserOpHash] = useState40(null);
|
|
29484
|
-
const linkedWallets =
|
|
29642
|
+
const linkedWallets = useMemo14(
|
|
29485
29643
|
() => (profiles || []).filter((p) => p.provider === "wallet" && p.externalId).map((p) => p.externalId),
|
|
29486
29644
|
[profiles]
|
|
29487
29645
|
);
|