@nexus-cross/crossx-sdk-core 2.2.0 → 2.2.1-beta.2

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/index.js CHANGED
@@ -657,18 +657,18 @@ const Bt = "crossx_access_token", Mt = "crossx_refresh_token", Ft = "crossx_user
657
657
  try {
658
658
  const I = this.crypto.decodeJWT(e);
659
659
  d.log("[CROSSx] Firebase JWT 필드:", Object.keys(I).join(", ")), x = (i = I.firebase) == null ? void 0 : i.sign_in_provider;
660
- const C = ((o = I.firebase) == null ? void 0 : o.identities) ?? {};
661
- w = I.email ?? ((a = C.email) == null ? void 0 : a[0]), x === "google.com" ? _ = (c = C["google.com"]) == null ? void 0 : c[0] : x === "apple.com" && (_ = (l = C["apple.com"]) == null ? void 0 : l[0]), d.log("[CROSSx] OAuth provider sub 추출 — provider:", x, "hasProviderSub:", !!_, "email:", w ?? "(없음)");
660
+ const O = ((o = I.firebase) == null ? void 0 : o.identities) ?? {};
661
+ w = I.email ?? ((a = O.email) == null ? void 0 : a[0]), x === "google.com" ? _ = (c = O["google.com"]) == null ? void 0 : c[0] : x === "apple.com" && (_ = (l = O["apple.com"]) == null ? void 0 : l[0]), d.log("[CROSSx] OAuth provider sub 추출 — provider:", x, "hasProviderSub:", !!_, "email:", w ?? "(없음)");
662
662
  } catch {
663
663
  d.warn("[CROSSx] firebaseToken에서 providerSub 추출 실패");
664
664
  }
665
665
  if (p) {
666
666
  const I = this.crypto.decodeJWT(p);
667
667
  d.log("[CROSSx] access_token 디코딩 — sub:", I.sub, "exp:", I.exp, "필드:", Object.keys(I).join(", "));
668
- const C = await this.crypto.verifyJWT(p);
669
- if (n = C.signatureVerified ?? !1, !C.valid)
668
+ const O = await this.crypto.verifyJWT(p);
669
+ if (n = O.signatureVerified ?? !1, !O.valid)
670
670
  throw d.error("[CROSSx] access_token 검증 실패"), new Error("유효하지 않은 access token");
671
- const R = C.payload, L = R.email ?? w ?? r;
671
+ const R = O.payload, L = R.email ?? w ?? r;
672
672
  d.log(
673
673
  "[CROSSx] email 소스 — CROSSx JWT:",
674
674
  R.email ?? "(없음)",
@@ -1243,13 +1243,15 @@ class fe {
1243
1243
  h.AUTH_FAILED,
1244
1244
  "Bridge handshake rejected by native"
1245
1245
  );
1246
+ const i = typeof n.walletName == "string" ? n.walletName.trim() : "", o = i.length > 0 && i.length <= 64 ? i : void 0;
1246
1247
  return {
1247
1248
  isActivated: !0,
1248
1249
  absoluteTtlMs: n.absoluteTtlMs,
1249
1250
  idleTtlMs: n.idleTtlMs,
1250
1251
  protocolVersion: n.protocolVersion,
1251
1252
  activatedAt: Date.now(),
1252
- walletAddress: n.walletAddress
1253
+ walletAddress: n.walletAddress,
1254
+ walletName: o
1253
1255
  };
1254
1256
  } catch (n) {
1255
1257
  throw d.error("[RNBridge] Handshake failed", n), new f(
@@ -1376,13 +1378,13 @@ function fr() {
1376
1378
  }
1377
1379
  return Pe.production;
1378
1380
  }
1379
- const Ss = 2e3, Ut = 6e4, Es = 1e3, As = 1e4, Is = "0x77359400", Ht = "0x3B9ACA00", Wt = 130, Et = 6, Gt = 18, qt = 3e4, Ts = 5 * 60 * 1e3, ks = 30 * 1e3, gt = 100, Rs = "crossx-sdk-js/2.2.0";
1381
+ const Ss = 2e3, Ut = 6e4, Es = 1e3, As = 1e4, Is = "0x77359400", Ht = "0x3B9ACA00", Wt = 130, Et = 6, Gt = 18, qt = 3e4, Ts = 5 * 60 * 1e3, ks = 30 * 1e3, gt = 100, Rs = "crossx-sdk-js/2.2.1";
1380
1382
  function gr(s) {
1381
1383
  let e = s.length;
1382
1384
  for (; e > 0 && s.charCodeAt(e - 1) === 48; ) e--;
1383
1385
  return s.slice(0, e);
1384
1386
  }
1385
- function Os(s, e = Et) {
1387
+ function Ns(s, e = Et) {
1386
1388
  if (!s || s === "0x0" || s === "0x") return "0";
1387
1389
  try {
1388
1390
  const r = BigInt(s);
@@ -1404,7 +1406,7 @@ function Ge(s, e, r, t = Et) {
1404
1406
  return;
1405
1407
  }
1406
1408
  }
1407
- function Cs(s) {
1409
+ function Os(s) {
1408
1410
  const e = s.startsWith("0x") ? s.slice(2) : s;
1409
1411
  if (!/^[0-9a-fA-F]+$/.test(e))
1410
1412
  throw new f(
@@ -1417,7 +1419,7 @@ function Cs(s) {
1417
1419
  `서명 길이가 유효하지 않습니다: ${Wt} hex 문자(65 바이트) 예상, 현재 ${e.length}`
1418
1420
  );
1419
1421
  }
1420
- function Ns(s) {
1422
+ function Cs(s) {
1421
1423
  const e = s.startsWith("0x") ? s.slice(2) : s;
1422
1424
  if (!/^[0-9a-fA-F]+$/.test(e))
1423
1425
  throw new f(
@@ -1464,7 +1466,7 @@ function Ls(s) {
1464
1466
  const t = Number(r);
1465
1467
  return Number.isFinite(t) ? t : void 0;
1466
1468
  }
1467
- class Ne {
1469
+ class Ce {
1468
1470
  constructor(e) {
1469
1471
  this.deps = e, this.verifyPinMutex = null;
1470
1472
  }
@@ -1537,7 +1539,7 @@ class Ne {
1537
1539
  if (u.code === h.PIN_INVALID)
1538
1540
  return { ok: !1, error: u.message };
1539
1541
  if (u.code === h.PIN_LOCKED)
1540
- return Ne.buildPinLockedResult(u, a);
1542
+ return Ce.buildPinLockedResult(u, a);
1541
1543
  }
1542
1544
  throw u;
1543
1545
  }
@@ -1571,7 +1573,7 @@ class Ne {
1571
1573
  return await e();
1572
1574
  } catch (n) {
1573
1575
  if (n instanceof f) {
1574
- if (t = Ne.parsePinError(n, r), !t) throw n;
1576
+ if (t = Ce.parsePinError(n, r), !t) throw n;
1575
1577
  } else
1576
1578
  throw n;
1577
1579
  }
@@ -1585,7 +1587,7 @@ class Ne {
1585
1587
  try {
1586
1588
  return await e();
1587
1589
  } catch (n) {
1588
- if (n instanceof f && (t = Ne.parsePinError(n, r), t))
1590
+ if (n instanceof f && (t = Ce.parsePinError(n, r), t))
1589
1591
  continue;
1590
1592
  throw n;
1591
1593
  }
@@ -1610,7 +1612,7 @@ class Ne {
1610
1612
  return null;
1611
1613
  }
1612
1614
  static buildPinLockedResult(e, r) {
1613
- const t = Ne.parsePinError(e, r);
1615
+ const t = Ce.parsePinError(e, r);
1614
1616
  if (!t) return { ok: !1, error: e.message };
1615
1617
  const { errorMessage: n, ...i } = t;
1616
1618
  return { ok: !1, error: n, ...i };
@@ -1744,32 +1746,38 @@ class Ms {
1744
1746
  }
1745
1747
  return null;
1746
1748
  }
1747
- async loadWalletAfterAuth(e, r) {
1748
- const t = this.deps.getUserId();
1749
- if (!t) return;
1750
- const n = await this.fetchWalletStatus();
1751
- if (d.log("[CROSSx] loadWalletAfterAuth 지갑 상태:", n), n !== "exists") return;
1752
- const i = await this.deps.walletProvider.getAddresses(t);
1753
- if (i.length > 0) {
1754
- let a, c = !1;
1749
+ async loadWalletAfterAuth(e, r, t) {
1750
+ const n = this.deps.getUserId();
1751
+ if (!n) return;
1752
+ const i = await this.fetchWalletStatus();
1753
+ if (d.log("[CROSSx] loadWalletAfterAuth 지갑 상태:", i), i !== "exists") return;
1754
+ const o = await this.deps.walletProvider.getAddresses(n);
1755
+ if (o.length > 0) {
1756
+ let c, l = !1;
1755
1757
  if (r) {
1756
- const l = i.find(
1757
- (u) => u.address.toLowerCase() === r.toLowerCase()
1758
+ const p = o.find(
1759
+ (g) => g.address.toLowerCase() === r.toLowerCase()
1758
1760
  );
1759
- l ? a = l : (a = { address: r, index: 0 }, c = !0);
1760
- } else e !== void 0 ? a = i.find((l) => l.index === e) ?? i[0] : a = i[0];
1761
- c ? d.log(
1761
+ p ? c = p : (c = { address: r, index: 0 }, l = !0);
1762
+ } else e !== void 0 ? c = o.find((p) => p.index === e) ?? o[0] : c = o[0];
1763
+ l ? d.log(
1762
1764
  "[CROSSx] preferredWalletAddress 가 서버 캐시에 없음 — raw address 채택:",
1763
- a.address
1765
+ c.address
1764
1766
  ) : d.log(
1765
1767
  "[CROSSx] 캐시된 주소 로드 완료 (비밀번호 불필요):",
1766
- a.address
1767
- ), this.deps.setActiveWallet(a.address, a.index);
1768
+ c.address
1769
+ );
1770
+ const u = !!r && !!t && c.address.toLowerCase() === r.toLowerCase();
1771
+ this.deps.setActiveWallet(
1772
+ c.address,
1773
+ c.index,
1774
+ u ? { walletName: t } : void 0
1775
+ );
1768
1776
  return;
1769
1777
  }
1770
1778
  d.log("[CROSSx] 주소 캐시 없음 — 비밀번호 확인 후 address(0) 조회"), await this.deps.pinOrchestrator.ensureVerifiedPin();
1771
- const o = await this.deps.walletProvider.getAddress(t, 0);
1772
- d.log("[CROSSx] 세션 복원 후 지갑 주소 로드 완료:", o.address), this.deps.setActiveWallet(o.address, 0);
1779
+ const a = await this.deps.walletProvider.getAddress(n, 0);
1780
+ d.log("[CROSSx] 세션 복원 후 지갑 주소 로드 완료:", a.address), this.deps.setActiveWallet(a.address, 0);
1773
1781
  }
1774
1782
  }
1775
1783
  class Fs {
@@ -2314,7 +2322,7 @@ const Te = class Te extends ys {
2314
2322
  walletPreferenceKey: Te.WALLET_PREF_KEY,
2315
2323
  storage: this.storage,
2316
2324
  pinStore: this.pinStore
2317
- }), this.pinOrchestrator = new Ne({
2325
+ }), this.pinOrchestrator = new Ce({
2318
2326
  confirmation: this.confirmation,
2319
2327
  walletProvider: this.walletProvider,
2320
2328
  pinStore: this.pinStore,
@@ -2333,7 +2341,7 @@ const Te = class Te extends ys {
2333
2341
  walletProvider: this.walletProvider,
2334
2342
  pinOrchestrator: this.pinOrchestrator,
2335
2343
  getUserId: () => this.userId,
2336
- setActiveWallet: (x, w) => this.setActiveWallet(x, w)
2344
+ setActiveWallet: (x, w, S) => this.setActiveWallet(x, w, S)
2337
2345
  }), this.migrationOrchestrator = new Fs({
2338
2346
  confirmation: this.confirmation,
2339
2347
  walletProvider: this.walletProvider,
@@ -2439,7 +2447,7 @@ const Te = class Te extends ys {
2439
2447
  }
2440
2448
  async _doInitialize(e) {
2441
2449
  var r, t;
2442
- d.log("[CROSSx SDK] v2.2.0 초기화 중..."), this.confirmation.setMessages(xe(this._config.locale));
2450
+ d.log("[CROSSx SDK] v2.2.1 초기화 중..."), this.confirmation.setMessages(xe(this._config.locale));
2443
2451
  try {
2444
2452
  const n = fr();
2445
2453
  this.internalConfig.oauthServiceUrl = n.oauthServiceUrl, this.internalConfig.authApiUrl = n.authApiUrl, this.internalConfig.walletGatewayUrl = n.walletGatewayUrl, this.adapterConfig.gatewayUrl = n.walletGatewayUrl, (t = (r = this.crypto).setJWKSEndpoint) == null || t.call(r, `${n.authApiUrl}/.well-known/jwks.json`);
@@ -2447,17 +2455,28 @@ const Te = class Te extends ys {
2447
2455
  Te.WALLET_PREF_KEY
2448
2456
  ).catch(() => null) : null, o = (e == null ? void 0 : e.preferredWalletIndex) ?? (i == null ? void 0 : i.index);
2449
2457
  let a = (e == null ? void 0 : e.preferredWalletAddress) ?? (i == null ? void 0 : i.address), c = await this.tryRNBridgeBootstrap();
2450
- if (this._rnBridgeWalletAddress && ((a == null ? void 0 : a.toLowerCase()) !== this._rnBridgeWalletAddress.toLowerCase() && d.log("[CROSSx] RN Bridge active wallet으로 preferredWalletAddress 갱신:", this._rnBridgeWalletAddress), a = this._rnBridgeWalletAddress), c || (c = await this.signInUseCase.restoreSession()), c != null && c.success)
2451
- if (this.applyAuthResult(c), this.address && (!a || this.address.toLowerCase() === a.toLowerCase()))
2452
- this.address && this.setActiveWallet(this.address, o ?? this.activeWalletIndex);
2458
+ if (this._rnBridgeWalletAddress && ((a == null ? void 0 : a.toLowerCase()) !== this._rnBridgeWalletAddress.toLowerCase() && d.log("[CROSSx] RN Bridge active wallet으로 preferredWalletAddress 갱신:", this._rnBridgeWalletAddress), a = this._rnBridgeWalletAddress), c || (c = await this.signInUseCase.restoreSession()), c != null && c.success) {
2459
+ this.applyAuthResult(c);
2460
+ const l = this.address && (!a || this.address.toLowerCase() === a.toLowerCase()), u = this._rnBridgeWalletName && a && this._rnBridgeWalletAddress && a.toLowerCase() === this._rnBridgeWalletAddress.toLowerCase() ? this._rnBridgeWalletName : void 0;
2461
+ if (l)
2462
+ this.address && this.setActiveWallet(
2463
+ this.address,
2464
+ o ?? this.activeWalletIndex,
2465
+ u ? { walletName: u } : void 0
2466
+ );
2453
2467
  else try {
2454
- await this.loadWalletAfterAuth(o, a);
2455
- } catch (u) {
2456
- if (!(u instanceof f && u.code === h.PIN_CANCELLED))
2457
- throw u;
2468
+ await this.loadWalletAfterAuth(
2469
+ o,
2470
+ a,
2471
+ u
2472
+ );
2473
+ } catch (p) {
2474
+ if (!(p instanceof f && p.code === h.PIN_CANCELLED))
2475
+ throw p;
2458
2476
  d.log("[CROSSx] initialize: 비밀번호 입력 취소 — 지갑 미로드 상태로 계속");
2459
2477
  }
2460
- return this.initialized = !0, d.info("[CROSSx SDK] v2.2.0 초기화 완료"), this.emit("initialized", { restored: !!(c != null && c.success) }), c ?? null;
2478
+ }
2479
+ return this.initialized = !0, d.info("[CROSSx SDK] v2.2.1 초기화 완료"), this.emit("initialized", { restored: !!(c != null && c.success) }), c ?? null;
2461
2480
  } catch (n) {
2462
2481
  throw new f(h.AUTH_NOT_INITIALIZED, "SDK 초기화에 실패했습니다", n);
2463
2482
  }
@@ -2478,13 +2497,14 @@ const Te = class Te extends ys {
2478
2497
  const e = new fe({
2479
2498
  appId: this._config.projectId,
2480
2499
  appVersion: "1.0.0",
2481
- sdkVersion: "2.2.0",
2500
+ sdkVersion: "2.2.1",
2482
2501
  keyId: "key-id-1",
2483
2502
  userIdHash: "user-hash-placeholder",
2484
2503
  projectId: this._config.projectId
2485
2504
  }), r = await e.initialize();
2486
- return this._rnBridgeService = e, this._rnBridgeWalletAddress = r.walletAddress, this.subscribeBridgeWalletChanged(), d.log("[CROSSx] RN Bridge Handshake 성공", {
2487
- walletAddress: r.walletAddress ?? "(없음)"
2505
+ return this._rnBridgeService = e, this._rnBridgeWalletAddress = r.walletAddress, this._rnBridgeWalletName = r.walletName, this.subscribeBridgeWalletChanged(), d.info("[CROSSx] RN Bridge Handshake 성공", {
2506
+ walletAddress: r.walletAddress ?? "(없음)",
2507
+ walletName: r.walletName ?? "(없음)"
2488
2508
  }), await this.signInUseCase.hasValidStoredAccessToken() ? (await this.signInUseCase.hasStoredRNBridgeSession() && (this._isAuthenticatedViaRNBridge = !0, d.log("[CROSSx] 저장된 RN Bridge 세션 — native sign delegation 활성")), null) : (d.log("[CROSSx] RN Bridge 준비 완료 — 사용자 로그인 대기"), null);
2489
2509
  } catch (e) {
2490
2510
  return d.warn("[CROSSx] RN Bridge handshake 실패", e), null;
@@ -2507,7 +2527,11 @@ const Te = class Te extends ys {
2507
2527
  const r = await this._rnBridgeService.requestFirebaseIdToken();
2508
2528
  d.log("[CROSSx] Bridge 로그인 — Firebase token 수신");
2509
2529
  const t = await this.signInUseCase.executeWithNativeFirebaseIdToken(r);
2510
- return t.success ? (this._isAuthenticatedViaRNBridge = !0, this.applyAuthResult(t), await this.loadWalletAfterAuth(void 0, this._rnBridgeWalletAddress), d.log("[CROSSx] Bridge 로그인 성공", { userId: (e = t.user) == null ? void 0 : e.id }), t) : null;
2530
+ return t.success ? (this._isAuthenticatedViaRNBridge = !0, this.applyAuthResult(t), await this.loadWalletAfterAuth(
2531
+ void 0,
2532
+ this._rnBridgeWalletAddress,
2533
+ this._rnBridgeWalletName
2534
+ ), d.log("[CROSSx] Bridge 로그인 성공", { userId: (e = t.user) == null ? void 0 : e.id }), t) : null;
2511
2535
  } catch (r) {
2512
2536
  return r instanceof f && r.code === h.USER_REJECTED ? (d.log("[CROSSx] Bridge 로그인 거부 — bridge 비활성화, OAuth fallback"), this._rnBridgeService = null, null) : (d.warn("[CROSSx] Bridge 로그인 타임아웃/실패 — OAuth fallback 차단", r), !1);
2513
2537
  }
@@ -2606,20 +2630,29 @@ const Te = class Te extends ys {
2606
2630
  }
2607
2631
  }
2608
2632
  /**
2609
- * OAuth deeplink로 수신한 Firebase 토큰을 직접 주입하여 로그인합니다.
2633
+ * OAuth deeplink로 수신한 Firebase 토큰을 직접 주입하여 로그인 + 지갑 준비까지 수행합니다.
2610
2634
  *
2611
2635
  * RN WebView 등 팝업이 불가능한 환경에서, 네이티브 앱이 OAuth deeplink로
2612
2636
  * 수신한 Firebase 토큰을 JS injection으로 SDK에 전달할 때 사용합니다.
2613
2637
  *
2614
- * 내부적으로 Firebase 토큰 → CROSSx 인증 교환 → 지갑 로드를 수행합니다.
2638
+ * 내부 흐름:
2639
+ * 1. Firebase 토큰 → CROSSx 인증 교환
2640
+ * 2. 지갑 상태 확인 → 필요 시 createWallet 자동 호출
2641
+ * - `migration_required`: 마이그레이션 UI 자동 트리거
2642
+ * - `not_found`: PIN 설정 UI 자동 트리거
2643
+ * - `exists`: PIN 검증 UI 자동 트리거
2644
+ * 3. 다중 지갑이면 selectWallet 모달로 활성 지갑 선택
2615
2645
  *
2616
2646
  * @param firebaseToken OAuth 서비스에서 발급받은 Firebase JWT
2647
+ * @returns `AuthResult` + `addresses` (지갑 주소 목록)
2648
+ * @throws 마이그레이션/PIN 설정을 사용자가 취소하면 `CROSSxError(MIGRATION_FAILED | PIN_CANCELLED)`
2617
2649
  *
2618
2650
  * @example
2619
2651
  * // RN WebView에서 JS injection으로 호출
2620
2652
  * const result = await sdk.signInWithOAuthToken(firebaseTokenFromDeeplink);
2621
2653
  * if (result.success) {
2622
- * console.log(result.address); // '0x...'
2654
+ * console.log(result.address); // '0x...'
2655
+ * console.log(result.addresses); // [{ address: '0x...', index: 0 }]
2623
2656
  * }
2624
2657
  */
2625
2658
  async signInWithOAuthToken(e) {
@@ -2628,11 +2661,24 @@ const Te = class Te extends ys {
2628
2661
  h.ALREADY_AUTHENTICATED,
2629
2662
  "이미 로그인된 상태입니다. signOut()을 먼저 호출하세요."
2630
2663
  );
2664
+ let r;
2631
2665
  try {
2632
- const r = await this.signInUseCase.executeWithOAuthToken(e);
2633
- return r.success && this.applyAuthResult(r), r;
2634
- } catch (r) {
2635
- throw r instanceof f ? r : new f(h.AUTH_FAILED, "OAuth 토큰 로그인에 실패했습니다", r);
2666
+ r = await this.signInUseCase.executeWithOAuthToken(e), r.success && this.applyAuthResult(r);
2667
+ } catch (t) {
2668
+ throw t instanceof f ? t : new f(h.AUTH_FAILED, "OAuth 토큰 로그인에 실패했습니다", t);
2669
+ }
2670
+ if (!r.success) return { ...r, addresses: [] };
2671
+ try {
2672
+ if (r.needsMigration || !r.address) {
2673
+ const { address: i } = await this.createWallet(), o = await this.getAddresses(), a = await this.selectWalletIfMultiple(o);
2674
+ return { ...r, address: (a == null ? void 0 : a.address) ?? i, needsMigration: !1, addresses: o };
2675
+ }
2676
+ const t = await this.getAddresses(), n = await this.selectWalletIfMultiple(t);
2677
+ return { ...r, address: (n == null ? void 0 : n.address) ?? r.address, addresses: t };
2678
+ } catch (t) {
2679
+ throw t instanceof f && t.code === h.PIN_CANCELLED && (d.log("[CROSSx] signInWithOAuthToken: 비밀번호 설정 취소 — 자동 로그아웃 진행"), await this.signOut().catch(
2680
+ (n) => d.warn("[CROSSx] signInWithOAuthToken: 자동 로그아웃 실패", n)
2681
+ )), t;
2636
2682
  }
2637
2683
  }
2638
2684
  /**
@@ -2710,6 +2756,20 @@ const Te = class Te extends ys {
2710
2756
  get currentUserId() {
2711
2757
  return this.userId;
2712
2758
  }
2759
+ /**
2760
+ * RN Native Bridge 가 handshake 또는 walletChanged push 로 알린 현재 active wallet
2761
+ * 정보(주소 + 사용자 라벨)를 동기적으로 반환한다.
2762
+ *
2763
+ * - dapp 측 hook 이 `addressChanged` 이벤트 구독 전에 SDK 가 이미 emit 을 끝낸
2764
+ * 경우에도 walletName 을 놓치지 않도록 polling/seed 용으로 노출한다.
2765
+ * - bridge 미사용 또는 미수신 시 `null`.
2766
+ */
2767
+ getRNBridgeActiveWallet() {
2768
+ return this._rnBridgeWalletAddress ? {
2769
+ address: this._rnBridgeWalletAddress,
2770
+ walletName: this._rnBridgeWalletName
2771
+ } : null;
2772
+ }
2713
2773
  /**
2714
2774
  * 현재 로그인 상태 확인 (isAuthenticated() 별칭)
2715
2775
  * Android SDK의 isLoggedIn()과 동일합니다.
@@ -3100,7 +3160,7 @@ const Te = class Te extends ys {
3100
3160
  n.address
3101
3161
  )
3102
3162
  });
3103
- return Cs(i.signature), {
3163
+ return Os(i.signature), {
3104
3164
  chainId: e,
3105
3165
  signature: i.signature,
3106
3166
  address: n.address
@@ -3178,7 +3238,7 @@ const Te = class Te extends ys {
3178
3238
  a
3179
3239
  )
3180
3240
  });
3181
- return Ns(o.signature), {
3241
+ return Cs(o.signature), {
3182
3242
  chainId: e,
3183
3243
  signedTx: o.signature,
3184
3244
  txHash: o.txHash ?? ""
@@ -3317,7 +3377,7 @@ const Te = class Te extends ys {
3317
3377
  let g, _;
3318
3378
  const x = this.waitForTxAndGetReceipt(a, e, { intervalMs: c, timeoutMs: l }).then((I) => {
3319
3379
  g = I;
3320
- const C = BigInt(I.gasUsed) * BigInt(I.effectiveGasPrice), R = r.value ? BigInt(r.value) : 0n, L = Ge(r.value, u.symbol, u.decimals, this._config.displayDecimals), M = Ge("0x" + C.toString(16), u.symbol, u.decimals, this._config.displayDecimals), q = Ge("0x" + (R + C).toString(16), u.symbol, u.decimals, this._config.displayDecimals);
3380
+ const O = BigInt(I.gasUsed) * BigInt(I.effectiveGasPrice), R = r.value ? BigInt(r.value) : 0n, L = Ge(r.value, u.symbol, u.decimals, this._config.displayDecimals), M = Ge("0x" + O.toString(16), u.symbol, u.decimals, this._config.displayDecimals), q = Ge("0x" + (R + O).toString(16), u.symbol, u.decimals, this._config.displayDecimals);
3321
3381
  return {
3322
3382
  chainId: e,
3323
3383
  txHash: a,
@@ -3554,7 +3614,7 @@ const Te = class Te extends ys {
3554
3614
  return { wei: "0x0", formatted: "0", chainId: e };
3555
3615
  try {
3556
3616
  const n = await this.jsonRpc.call("eth_getBalance", [r, "latest"], e) ?? "0x0";
3557
- return { wei: n, formatted: Os(n, this._config.displayDecimals), chainId: e };
3617
+ return { wei: n, formatted: Ns(n, this._config.displayDecimals), chainId: e };
3558
3618
  } catch (t) {
3559
3619
  if (t instanceof f) throw t;
3560
3620
  const n = t instanceof Error ? t.message : String(t);
@@ -3717,10 +3777,11 @@ const Te = class Te extends ys {
3717
3777
  * 2. GET /mnemonic/addresses (비밀번호 불필요) → 캐시된 주소가 있으면 바로 사용
3718
3778
  * 3. 빈 배열인 경우 → 비밀번호 확인(메모리 없으면 모달) → POST /mnemonic/address(0)
3719
3779
  */
3720
- async loadWalletAfterAuth(e, r) {
3780
+ async loadWalletAfterAuth(e, r, t) {
3721
3781
  return this.walletLifecycleService.loadWalletAfterAuth(
3722
3782
  e,
3723
- r
3783
+ r,
3784
+ t
3724
3785
  );
3725
3786
  }
3726
3787
  /**
@@ -4401,17 +4462,17 @@ function bn(s, e, r) {
4401
4462
  const I = [];
4402
4463
  for (; S < e; ) {
4403
4464
  c = g();
4404
- const C = c.slice();
4405
- I.push(C), S += c.length;
4465
+ const O = c.slice();
4466
+ I.push(O), S += c.length;
4406
4467
  }
4407
4468
  return Se(...I);
4408
4469
  };
4409
4470
  return (S, I) => {
4410
4471
  p(), _(S);
4411
- let C;
4412
- for (; !(C = I(x())); )
4472
+ let O;
4473
+ for (; !(O = I(x())); )
4413
4474
  _();
4414
- return p(), C;
4475
+ return p(), O;
4415
4476
  };
4416
4477
  }
4417
4478
  function Rt(s, e = {}, r = {}) {
@@ -4439,7 +4500,7 @@ function Xt(s) {
4439
4500
  };
4440
4501
  }
4441
4502
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
4442
- const re = /* @__PURE__ */ BigInt(0), te = /* @__PURE__ */ BigInt(1), ke = /* @__PURE__ */ BigInt(2), Ir = /* @__PURE__ */ BigInt(3), Tr = /* @__PURE__ */ BigInt(4), kr = /* @__PURE__ */ BigInt(5), vn = /* @__PURE__ */ BigInt(7), Rr = /* @__PURE__ */ BigInt(8), Sn = /* @__PURE__ */ BigInt(9), Or = /* @__PURE__ */ BigInt(16);
4503
+ const re = /* @__PURE__ */ BigInt(0), te = /* @__PURE__ */ BigInt(1), ke = /* @__PURE__ */ BigInt(2), Ir = /* @__PURE__ */ BigInt(3), Tr = /* @__PURE__ */ BigInt(4), kr = /* @__PURE__ */ BigInt(5), vn = /* @__PURE__ */ BigInt(7), Rr = /* @__PURE__ */ BigInt(8), Sn = /* @__PURE__ */ BigInt(9), Nr = /* @__PURE__ */ BigInt(16);
4443
4504
  function le(s, e) {
4444
4505
  const r = s % e;
4445
4506
  return r >= re ? r : e + r;
@@ -4464,29 +4525,29 @@ function Jt(s, e) {
4464
4525
  throw new Error("invert: does not exist");
4465
4526
  return le(n, e);
4466
4527
  }
4467
- function Ot(s, e, r) {
4528
+ function Nt(s, e, r) {
4468
4529
  if (!s.eql(s.sqr(e), r))
4469
4530
  throw new Error("Cannot find square root");
4470
4531
  }
4471
- function Cr(s, e) {
4532
+ function Or(s, e) {
4472
4533
  const r = (s.ORDER + te) / Tr, t = s.pow(e, r);
4473
- return Ot(s, t, e), t;
4534
+ return Nt(s, t, e), t;
4474
4535
  }
4475
4536
  function En(s, e) {
4476
4537
  const r = (s.ORDER - kr) / Rr, t = s.mul(e, ke), n = s.pow(t, r), i = s.mul(e, n), o = s.mul(s.mul(i, ke), n), a = s.mul(i, s.sub(o, s.ONE));
4477
- return Ot(s, a, e), a;
4538
+ return Nt(s, a, e), a;
4478
4539
  }
4479
4540
  function An(s) {
4480
- const e = rt(s), r = Nr(s), t = r(e, e.neg(e.ONE)), n = r(e, t), i = r(e, e.neg(t)), o = (s + vn) / Or;
4541
+ const e = rt(s), r = Cr(s), t = r(e, e.neg(e.ONE)), n = r(e, t), i = r(e, e.neg(t)), o = (s + vn) / Nr;
4481
4542
  return (a, c) => {
4482
4543
  let l = a.pow(c, o), u = a.mul(l, t);
4483
4544
  const p = a.mul(l, n), g = a.mul(l, i), _ = a.eql(a.sqr(u), c), x = a.eql(a.sqr(p), c);
4484
4545
  l = a.cmov(l, u, _), u = a.cmov(g, p, x);
4485
4546
  const w = a.eql(a.sqr(u), c), S = a.cmov(l, u, w);
4486
- return Ot(a, S, c), S;
4547
+ return Nt(a, S, c), S;
4487
4548
  };
4488
4549
  }
4489
- function Nr(s) {
4550
+ function Cr(s) {
4490
4551
  if (s < Ir)
4491
4552
  throw new Error("sqrt is not defined for small field");
4492
4553
  let e = s - te, r = 0;
@@ -4498,7 +4559,7 @@ function Nr(s) {
4498
4559
  if (t++ > 1e3)
4499
4560
  throw new Error("Cannot find square root: probably non-prime P");
4500
4561
  if (r === 1)
4501
- return Cr;
4562
+ return Or;
4502
4563
  let i = n.pow(t, e);
4503
4564
  const o = (e + te) / ke;
4504
4565
  return function(c, l) {
@@ -4521,7 +4582,7 @@ function Nr(s) {
4521
4582
  };
4522
4583
  }
4523
4584
  function In(s) {
4524
- return s % Tr === Ir ? Cr : s % Rr === kr ? En : s % Or === Sn ? An(s) : Nr(s);
4585
+ return s % Tr === Ir ? Or : s % Rr === kr ? En : s % Nr === Sn ? An(s) : Cr(s);
4525
4586
  }
4526
4587
  const Tn = [
4527
4588
  "create",
@@ -4572,12 +4633,12 @@ function Zt(s, e) {
4572
4633
  throw new Error("invalid Legendre symbol result");
4573
4634
  return n ? 1 : i ? 0 : -1;
4574
4635
  }
4575
- function On(s, e) {
4636
+ function Nn(s, e) {
4576
4637
  e !== void 0 && me(e);
4577
4638
  const r = e !== void 0 ? e : s.toString(2).length, t = Math.ceil(r / 8);
4578
4639
  return { nBitLength: r, nByteLength: t };
4579
4640
  }
4580
- class Cn {
4641
+ class On {
4581
4642
  constructor(e, r = {}) {
4582
4643
  P(this, "ORDER");
4583
4644
  P(this, "BITS");
@@ -4594,7 +4655,7 @@ class Cn {
4594
4655
  throw new Error("invalid field: expected ORDER > 0, got " + e);
4595
4656
  let t;
4596
4657
  this.isLE = !1, r != null && typeof r == "object" && (typeof r.BITS == "number" && (t = r.BITS), typeof r.sqrt == "function" && (this.sqrt = r.sqrt), typeof r.isLE == "boolean" && (this.isLE = r.isLE), r.allowedLengths && (this._lengths = (o = r.allowedLengths) == null ? void 0 : o.slice()), typeof r.modFromBytes == "boolean" && (this._mod = r.modFromBytes));
4597
- const { nBitLength: n, nByteLength: i } = On(e, t);
4658
+ const { nBitLength: n, nByteLength: i } = Nn(e, t);
4598
4659
  if (i > 2048)
4599
4660
  throw new Error("invalid field: expected ORDER of <= 2048 bytes");
4600
4661
  this.ORDER = e, this.BITS = n, this.BYTES = i, this._sqrt = void 0, Object.preventExtensions(this);
@@ -4690,7 +4751,7 @@ class Cn {
4690
4751
  }
4691
4752
  }
4692
4753
  function rt(s, e = {}) {
4693
- return new Cn(s, e);
4754
+ return new On(s, e);
4694
4755
  }
4695
4756
  function Lr(s) {
4696
4757
  if (typeof s != "bigint")
@@ -4702,7 +4763,7 @@ function Dr(s) {
4702
4763
  const e = Lr(s);
4703
4764
  return e + Math.ceil(e / 2);
4704
4765
  }
4705
- function Nn(s, e, r = !1) {
4766
+ function Cn(s, e, r = !1) {
4706
4767
  V(s);
4707
4768
  const t = s.length, n = Lr(e), i = Dr(e);
4708
4769
  if (t < 16 || t < i || t > 1024)
@@ -5053,18 +5114,18 @@ function Un(s, e = {}) {
5053
5114
  throw new Error("compression is not supported: Field does not have .isOdd()");
5054
5115
  }
5055
5116
  function p(F, m, y) {
5056
- const { x: k, y: N } = m.toAffine(), B = t.toBytes(k);
5117
+ const { x: k, y: C } = m.toAffine(), B = t.toBytes(k);
5057
5118
  if (Xe(y, "isCompressed"), y) {
5058
5119
  u();
5059
- const b = !t.isOdd(N);
5120
+ const b = !t.isOdd(C);
5060
5121
  return Se(Hr(b), B);
5061
5122
  } else
5062
- return Se(Uint8Array.of(4), B, t.toBytes(N));
5123
+ return Se(Uint8Array.of(4), B, t.toBytes(C));
5063
5124
  }
5064
5125
  function g(F) {
5065
5126
  V(F, void 0, "Point");
5066
- const { publicKey: m, publicKeyUncompressed: y } = l, k = F.length, N = F[0], B = F.subarray(1);
5067
- if (k === m && (N === 2 || N === 3)) {
5127
+ const { publicKey: m, publicKeyUncompressed: y } = l, k = F.length, C = F[0], B = F.subarray(1);
5128
+ if (k === m && (C === 2 || C === 3)) {
5068
5129
  const b = t.fromBytes(B);
5069
5130
  if (!t.isValid(b))
5070
5131
  throw new Error("bad point: is not on curve, wrong x");
@@ -5078,8 +5139,8 @@ function Un(s, e = {}) {
5078
5139
  }
5079
5140
  u();
5080
5141
  const T = t.isOdd(E);
5081
- return (N & 1) === 1 !== T && (E = t.neg(E)), { x: b, y: E };
5082
- } else if (k === y && N === 4) {
5142
+ return (C & 1) === 1 !== T && (E = t.neg(E)), { x: b, y: E };
5143
+ } else if (k === y && C === 4) {
5083
5144
  const b = t.BYTES, v = t.fromBytes(B.subarray(0, b)), E = t.fromBytes(B.subarray(b, b * 2));
5084
5145
  if (!S(v, E))
5085
5146
  throw new Error("bad point: is not on curve");
@@ -5098,8 +5159,8 @@ function Un(s, e = {}) {
5098
5159
  }
5099
5160
  if (!S(i.Gx, i.Gy))
5100
5161
  throw new Error("bad curve params: generator point");
5101
- const I = t.mul(t.pow(i.a, ze), Fn), C = t.mul(t.sqr(i.b), BigInt(27));
5102
- if (t.is0(t.add(I, C)))
5162
+ const I = t.mul(t.pow(i.a, ze), Fn), O = t.mul(t.sqr(i.b), BigInt(27));
5163
+ if (t.is0(t.add(I, O)))
5103
5164
  throw new Error("bad curve params: a or b");
5104
5165
  function R(F, m, y = !1) {
5105
5166
  if (!t.isValid(m) || y && t.is0(m))
@@ -5116,12 +5177,12 @@ function Un(s, e = {}) {
5116
5177
  return Bn(F, c.basises, n.ORDER);
5117
5178
  }
5118
5179
  const q = Xt((F, m) => {
5119
- const { X: y, Y: k, Z: N } = F;
5120
- if (t.eql(N, t.ONE))
5180
+ const { X: y, Y: k, Z: C } = F;
5181
+ if (t.eql(C, t.ONE))
5121
5182
  return { x: y, y: k };
5122
5183
  const B = F.is0();
5123
- m == null && (m = B ? t.ONE : t.inv(N));
5124
- const b = t.mul(y, m), v = t.mul(k, m), E = t.mul(N, m);
5184
+ m == null && (m = B ? t.ONE : t.inv(C));
5185
+ const b = t.mul(y, m), v = t.mul(k, m), E = t.mul(C, m);
5125
5186
  if (B)
5126
5187
  return { x: t.ZERO, y: t.ZERO };
5127
5188
  if (!t.eql(E, t.ONE))
@@ -5142,8 +5203,8 @@ function Un(s, e = {}) {
5142
5203
  throw new Error("bad point: not in prime-order subgroup");
5143
5204
  return !0;
5144
5205
  });
5145
- function G(F, m, y, k, N) {
5146
- return y = new X(t.mul(y.X, F), y.Y, y.Z), m = Je(k, m), y = Je(N, y), m.add(y);
5206
+ function G(F, m, y, k, C) {
5207
+ return y = new X(t.mul(y.X, F), y.Y, y.Z), m = Je(k, m), y = Je(C, y), m.add(y);
5147
5208
  }
5148
5209
  const D = class D {
5149
5210
  /** Does NOT validate if the point is valid. Use `.assertValidity()`. */
@@ -5201,7 +5262,7 @@ function Un(s, e = {}) {
5201
5262
  /** Compare one point to another. */
5202
5263
  equals(m) {
5203
5264
  L(m);
5204
- const { X: y, Y: k, Z: N } = this, { X: B, Y: b, Z: v } = m, E = t.eql(t.mul(y, v), t.mul(B, N)), T = t.eql(t.mul(k, v), t.mul(b, N));
5265
+ const { X: y, Y: k, Z: C } = this, { X: B, Y: b, Z: v } = m, E = t.eql(t.mul(y, v), t.mul(B, C)), T = t.eql(t.mul(k, v), t.mul(b, C));
5205
5266
  return E && T;
5206
5267
  }
5207
5268
  /** Flips point to one corresponding to (x, -y) in Affine coordinates. */
@@ -5213,9 +5274,9 @@ function Un(s, e = {}) {
5213
5274
  // https://eprint.iacr.org/2015/1060, algorithm 3
5214
5275
  // Cost: 8M + 3S + 3*a + 2*b3 + 15add.
5215
5276
  double() {
5216
- const { a: m, b: y } = i, k = t.mul(y, ze), { X: N, Y: B, Z: b } = this;
5217
- let v = t.ZERO, E = t.ZERO, T = t.ZERO, O = t.mul(N, N), W = t.mul(B, B), U = t.mul(b, b), $ = t.mul(N, B);
5218
- return $ = t.add($, $), T = t.mul(N, b), T = t.add(T, T), v = t.mul(m, T), E = t.mul(k, U), E = t.add(v, E), v = t.sub(W, E), E = t.add(W, E), E = t.mul(v, E), v = t.mul($, v), T = t.mul(k, T), U = t.mul(m, U), $ = t.sub(O, U), $ = t.mul(m, $), $ = t.add($, T), T = t.add(O, O), O = t.add(T, O), O = t.add(O, U), O = t.mul(O, $), E = t.add(E, O), U = t.mul(B, b), U = t.add(U, U), O = t.mul(U, $), v = t.sub(v, O), T = t.mul(U, W), T = t.add(T, T), T = t.add(T, T), new D(v, E, T);
5277
+ const { a: m, b: y } = i, k = t.mul(y, ze), { X: C, Y: B, Z: b } = this;
5278
+ let v = t.ZERO, E = t.ZERO, T = t.ZERO, N = t.mul(C, C), W = t.mul(B, B), U = t.mul(b, b), $ = t.mul(C, B);
5279
+ return $ = t.add($, $), T = t.mul(C, b), T = t.add(T, T), v = t.mul(m, T), E = t.mul(k, U), E = t.add(v, E), v = t.sub(W, E), E = t.add(W, E), E = t.mul(v, E), v = t.mul($, v), T = t.mul(k, T), U = t.mul(m, U), $ = t.sub(N, U), $ = t.mul(m, $), $ = t.add($, T), T = t.add(N, N), N = t.add(T, N), N = t.add(N, U), N = t.mul(N, $), E = t.add(E, N), U = t.mul(B, b), U = t.add(U, U), N = t.mul(U, $), v = t.sub(v, N), T = t.mul(U, W), T = t.add(T, T), T = t.add(T, T), new D(v, E, T);
5219
5280
  }
5220
5281
  // Renes-Costello-Batina exception-free addition formula.
5221
5282
  // There is 30% faster Jacobian formula, but it is not complete.
@@ -5223,13 +5284,13 @@ function Un(s, e = {}) {
5223
5284
  // Cost: 12M + 0S + 3*a + 3*b3 + 23add.
5224
5285
  add(m) {
5225
5286
  L(m);
5226
- const { X: y, Y: k, Z: N } = this, { X: B, Y: b, Z: v } = m;
5227
- let E = t.ZERO, T = t.ZERO, O = t.ZERO;
5287
+ const { X: y, Y: k, Z: C } = this, { X: B, Y: b, Z: v } = m;
5288
+ let E = t.ZERO, T = t.ZERO, N = t.ZERO;
5228
5289
  const W = i.a, U = t.mul(i.b, ze);
5229
- let $ = t.mul(y, B), K = t.mul(k, b), Y = t.mul(N, v), ne = t.add(y, k), z = t.add(B, b);
5230
- ne = t.mul(ne, z), z = t.add($, K), ne = t.sub(ne, z), z = t.add(y, N);
5290
+ let $ = t.mul(y, B), K = t.mul(k, b), Y = t.mul(C, v), ne = t.add(y, k), z = t.add(B, b);
5291
+ ne = t.mul(ne, z), z = t.add($, K), ne = t.sub(ne, z), z = t.add(y, C);
5231
5292
  let ee = t.add(B, v);
5232
- return z = t.mul(z, ee), ee = t.add($, Y), z = t.sub(z, ee), ee = t.add(k, N), E = t.add(b, v), ee = t.mul(ee, E), E = t.add(K, Y), ee = t.sub(ee, E), O = t.mul(W, z), E = t.mul(U, Y), O = t.add(E, O), E = t.sub(K, O), O = t.add(K, O), T = t.mul(E, O), K = t.add($, $), K = t.add(K, $), Y = t.mul(W, Y), z = t.mul(U, z), K = t.add(K, Y), Y = t.sub($, Y), Y = t.mul(W, Y), z = t.add(z, Y), $ = t.mul(K, z), T = t.add(T, $), $ = t.mul(ee, z), E = t.mul(ne, E), E = t.sub(E, $), $ = t.mul(ne, K), O = t.mul(ee, O), O = t.add(O, $), new D(E, T, O);
5293
+ return z = t.mul(z, ee), ee = t.add($, Y), z = t.sub(z, ee), ee = t.add(k, C), E = t.add(b, v), ee = t.mul(ee, E), E = t.add(K, Y), ee = t.sub(ee, E), N = t.mul(W, z), E = t.mul(U, Y), N = t.add(E, N), E = t.sub(K, N), N = t.add(K, N), T = t.mul(E, N), K = t.add($, $), K = t.add(K, $), Y = t.mul(W, Y), z = t.mul(U, z), K = t.add(K, Y), Y = t.sub($, Y), Y = t.mul(W, Y), z = t.add(z, Y), $ = t.mul(K, z), T = t.add(T, $), $ = t.mul(ee, z), E = t.mul(ne, E), E = t.sub(E, $), $ = t.mul(ne, K), N = t.mul(ee, N), N = t.add(N, $), new D(E, T, N);
5233
5294
  }
5234
5295
  subtract(m) {
5235
5296
  return this.add(m.negate());
@@ -5250,16 +5311,16 @@ function Un(s, e = {}) {
5250
5311
  const { endo: y } = e;
5251
5312
  if (!n.isValidNot0(m))
5252
5313
  throw new Error("invalid scalar: out of range");
5253
- let k, N;
5314
+ let k, C;
5254
5315
  const B = (b) => H.cached(this, b, (v) => Qt(D, v));
5255
5316
  if (y) {
5256
- const { k1neg: b, k1: v, k2neg: E, k2: T } = M(m), { p: O, f: W } = B(v), { p: U, f: $ } = B(T);
5257
- N = W.add($), k = G(y.beta, O, U, b, E);
5317
+ const { k1neg: b, k1: v, k2neg: E, k2: T } = M(m), { p: N, f: W } = B(v), { p: U, f: $ } = B(T);
5318
+ C = W.add($), k = G(y.beta, N, U, b, E);
5258
5319
  } else {
5259
5320
  const { p: b, f: v } = B(m);
5260
- k = b, N = v;
5321
+ k = b, C = v;
5261
5322
  }
5262
- return Qt(D, [k, N])[0];
5323
+ return Qt(D, [k, C])[0];
5263
5324
  }
5264
5325
  /**
5265
5326
  * Non-constant-time multiplication. Uses double-and-add algorithm.
@@ -5277,8 +5338,8 @@ function Un(s, e = {}) {
5277
5338
  if (H.hasCache(this))
5278
5339
  return this.multiply(m);
5279
5340
  if (y) {
5280
- const { k1neg: N, k1: B, k2neg: b, k2: v } = M(m), { p1: E, p2: T } = Ln(D, k, B, v);
5281
- return G(y.beta, E, T, N, b);
5341
+ const { k1neg: C, k1: B, k2neg: b, k2: v } = M(m), { p1: E, p2: T } = Ln(D, k, B, v);
5342
+ return G(y.beta, E, T, C, b);
5282
5343
  } else
5283
5344
  return H.unsafe(k, m);
5284
5345
  }
@@ -5356,7 +5417,7 @@ function Hn(s, e = {}) {
5356
5417
  }
5357
5418
  }
5358
5419
  function a(_ = t(n.seed)) {
5359
- return Nn(V(_, n.seed, "seed"), r.ORDER);
5420
+ return Cn(V(_, n.seed, "seed"), r.ORDER);
5360
5421
  }
5361
5422
  function c(_, x = !0) {
5362
5423
  return s.BASE.multiply(r.fromBytes(_)).toBytes(x);
@@ -5406,37 +5467,37 @@ function Wn(s, e, r = {}) {
5406
5467
  throw new Error(`invalid signature ${m}: out of range 1..Point.Fn.ORDER`);
5407
5468
  return y;
5408
5469
  }
5409
- function C() {
5470
+ function O() {
5410
5471
  if (w)
5411
5472
  throw new Error('"recovered" sig type is not supported for cofactor >2 curves');
5412
5473
  }
5413
5474
  function R(m, y) {
5414
5475
  mt(y);
5415
- const k = _.signature, N = y === "compact" ? k : y === "recovered" ? k + 1 : void 0;
5416
- return V(m, N);
5476
+ const k = _.signature, C = y === "compact" ? k : y === "recovered" ? k + 1 : void 0;
5477
+ return V(m, C);
5417
5478
  }
5418
5479
  class L {
5419
- constructor(y, k, N) {
5480
+ constructor(y, k, C) {
5420
5481
  P(this, "r");
5421
5482
  P(this, "s");
5422
5483
  P(this, "recovery");
5423
- if (this.r = I("r", y), this.s = I("s", k), N != null) {
5424
- if (C(), ![0, 1, 2, 3].includes(N))
5484
+ if (this.r = I("r", y), this.s = I("s", k), C != null) {
5485
+ if (O(), ![0, 1, 2, 3].includes(C))
5425
5486
  throw new Error("invalid recovery id");
5426
- this.recovery = N;
5487
+ this.recovery = C;
5427
5488
  }
5428
5489
  Object.freeze(this);
5429
5490
  }
5430
5491
  static fromBytes(y, k = x.format) {
5431
5492
  R(y, k);
5432
- let N;
5493
+ let C;
5433
5494
  if (k === "der") {
5434
5495
  const { r: E, s: T } = ve.toSig(V(y));
5435
5496
  return new L(E, T);
5436
5497
  }
5437
- k === "recovered" && (N = y[0], k = "compact", y = y.subarray(1));
5498
+ k === "recovered" && (C = y[0], k = "compact", y = y.subarray(1));
5438
5499
  const B = _.signature / 2, b = y.subarray(0, B), v = y.subarray(B, B * 2);
5439
- return new L(o.fromBytes(b), o.fromBytes(v), N);
5500
+ return new L(o.fromBytes(b), o.fromBytes(v), C);
5440
5501
  }
5441
5502
  static fromHex(y, k) {
5442
5503
  return this.fromBytes(Ye(y), k);
@@ -5451,10 +5512,10 @@ function Wn(s, e, r = {}) {
5451
5512
  return new L(this.r, this.s, y);
5452
5513
  }
5453
5514
  recoverPublicKey(y) {
5454
- const { r: k, s: N } = this, B = this.assertRecovery(), b = B === 2 || B === 3 ? k + a : k;
5515
+ const { r: k, s: C } = this, B = this.assertRecovery(), b = B === 2 || B === 3 ? k + a : k;
5455
5516
  if (!i.isValid(b))
5456
5517
  throw new Error("invalid recovery id: sig.r+curve.n != R.x");
5457
- const v = i.toBytes(b), E = s.fromBytes(Se(Hr((B & 1) === 0), v)), T = o.inv(b), O = q(V(y, void 0, "msgHash")), W = o.create(-O * T), U = o.create(N * T), $ = s.BASE.multiplyUnsafe(W).add(E.multiplyUnsafe(U));
5518
+ const v = i.toBytes(b), E = s.fromBytes(Se(Hr((B & 1) === 0), v)), T = o.inv(b), N = q(V(y, void 0, "msgHash")), W = o.create(-N * T), U = o.create(C * T), $ = s.BASE.multiplyUnsafe(W).add(E.multiplyUnsafe(U));
5458
5519
  if ($.is0())
5459
5520
  throw new Error("invalid recovery: point at infinify");
5460
5521
  return $.assertValidity(), $;
@@ -5466,8 +5527,8 @@ function Wn(s, e, r = {}) {
5466
5527
  toBytes(y = x.format) {
5467
5528
  if (mt(y), y === "der")
5468
5529
  return Ye(ve.hexFromSig(this));
5469
- const { r: k, s: N } = this, B = o.toBytes(k), b = o.toBytes(N);
5470
- return y === "recovered" ? (C(), Se(Uint8Array.of(this.assertRecovery()), B, b)) : Se(B, b);
5530
+ const { r: k, s: C } = this, B = o.toBytes(k), b = o.toBytes(C);
5531
+ return y === "recovered" ? (O(), Se(Uint8Array.of(this.assertRecovery()), B, b)) : Se(B, b);
5471
5532
  }
5472
5533
  toHex(y) {
5473
5534
  return We(this.toBytes(y));
@@ -5476,8 +5537,8 @@ function Wn(s, e, r = {}) {
5476
5537
  const M = r.bits2int || function(y) {
5477
5538
  if (y.length > 8192)
5478
5539
  throw new Error("input is too large");
5479
- const k = tt(y), N = y.length * 8 - c;
5480
- return N > 0 ? k >> BigInt(N) : k;
5540
+ const k = tt(y), C = y.length * 8 - c;
5541
+ return C > 0 ? k >> BigInt(C) : k;
5481
5542
  }, q = r.bits2int_modN || function(y) {
5482
5543
  return o.create(M(y));
5483
5544
  }, J = kt(c);
@@ -5488,7 +5549,7 @@ function Wn(s, e, r = {}) {
5488
5549
  return V(m, void 0, "message"), y ? V(e(m), void 0, "prehashed message") : m;
5489
5550
  }
5490
5551
  function Q(m, y, k) {
5491
- const { lowS: N, prehash: B, extraEntropy: b } = ut(k, x);
5552
+ const { lowS: C, prehash: B, extraEntropy: b } = ut(k, x);
5492
5553
  m = X(m, B);
5493
5554
  const v = q(m), E = o.fromBytes(y);
5494
5555
  if (!o.isValidNot0(E))
@@ -5498,7 +5559,7 @@ function Wn(s, e, r = {}) {
5498
5559
  const $ = b === !0 ? t(_.secretKey) : b;
5499
5560
  T.push(V($, void 0, "extraEntropy"));
5500
5561
  }
5501
- const O = Se(...T), W = v;
5562
+ const N = Se(...T), W = v;
5502
5563
  function U($) {
5503
5564
  const K = M($);
5504
5565
  if (!o.isValidNot0(K))
@@ -5510,16 +5571,16 @@ function Wn(s, e, r = {}) {
5510
5571
  if (ee === ge)
5511
5572
  return;
5512
5573
  let Lt = (ne.x === z ? 0 : 2) | Number(ne.y & Le), Dt = ee;
5513
- return N && S(ee) && (Dt = o.neg(ee), Lt ^= 1), new L(z, Dt, w ? void 0 : Lt);
5574
+ return C && S(ee) && (Dt = o.neg(ee), Lt ^= 1), new L(z, Dt, w ? void 0 : Lt);
5514
5575
  }
5515
- return { seed: O, k2sig: U };
5576
+ return { seed: N, k2sig: U };
5516
5577
  }
5517
5578
  function H(m, y, k = {}) {
5518
- const { seed: N, k2sig: B } = Q(m, y, k);
5519
- return bn(e.outputLen, o.BYTES, n)(N, B).toBytes(k.format);
5579
+ const { seed: C, k2sig: B } = Q(m, y, k);
5580
+ return bn(e.outputLen, o.BYTES, n)(C, B).toBytes(k.format);
5520
5581
  }
5521
- function D(m, y, k, N = {}) {
5522
- const { lowS: B, prehash: b, format: v } = ut(N, x);
5582
+ function D(m, y, k, C = {}) {
5583
+ const { lowS: B, prehash: b, format: v } = ut(C, x);
5523
5584
  if (k = V(k, void 0, "publicKey"), y = X(y, b), !At(m)) {
5524
5585
  const E = m instanceof L ? ", use sig.toBytes()" : "";
5525
5586
  throw new Error("verify expects Uint8Array signature" + E);
@@ -5529,15 +5590,15 @@ function Wn(s, e, r = {}) {
5529
5590
  const E = L.fromBytes(m, v), T = s.fromBytes(k);
5530
5591
  if (B && E.hasHighS())
5531
5592
  return !1;
5532
- const { r: O, s: W } = E, U = q(y), $ = o.inv(W), K = o.create(U * $), Y = o.create(O * $), ne = s.BASE.multiplyUnsafe(K).add(T.multiplyUnsafe(Y));
5533
- return ne.is0() ? !1 : o.create(ne.x) === O;
5593
+ const { r: N, s: W } = E, U = q(y), $ = o.inv(W), K = o.create(U * $), Y = o.create(N * $), ne = s.BASE.multiplyUnsafe(K).add(T.multiplyUnsafe(Y));
5594
+ return ne.is0() ? !1 : o.create(ne.x) === N;
5534
5595
  } catch {
5535
5596
  return !1;
5536
5597
  }
5537
5598
  }
5538
5599
  function F(m, y, k = {}) {
5539
- const { prehash: N } = ut(k, x);
5540
- return y = X(y, N), L.fromBytes(m, "recovered").recoverPublicKey(y).toBytes();
5600
+ const { prehash: C } = ut(k, x);
5601
+ return y = X(y, C), L.fromBytes(m, "recovered").recoverPublicKey(y).toBytes();
5541
5602
  }
5542
5603
  return Object.freeze({
5543
5604
  keygen: l,
@@ -5554,7 +5615,7 @@ function Wn(s, e, r = {}) {
5554
5615
  });
5555
5616
  }
5556
5617
  /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
5557
- const Ct = {
5618
+ const Ot = {
5558
5619
  p: BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),
5559
5620
  n: BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),
5560
5621
  h: BigInt(1),
@@ -5570,12 +5631,12 @@ const Ct = {
5570
5631
  ]
5571
5632
  }, nr = /* @__PURE__ */ BigInt(2);
5572
5633
  function qn(s) {
5573
- const e = Ct.p, r = BigInt(3), t = BigInt(6), n = BigInt(11), i = BigInt(22), o = BigInt(23), a = BigInt(44), c = BigInt(88), l = s * s * s % e, u = l * l * s % e, p = oe(u, r, e) * u % e, g = oe(p, r, e) * u % e, _ = oe(g, nr, e) * l % e, x = oe(_, n, e) * _ % e, w = oe(x, i, e) * x % e, S = oe(w, a, e) * w % e, I = oe(S, c, e) * S % e, C = oe(I, a, e) * w % e, R = oe(C, r, e) * u % e, L = oe(R, o, e) * x % e, M = oe(L, t, e) * l % e, q = oe(M, nr, e);
5634
+ const e = Ot.p, r = BigInt(3), t = BigInt(6), n = BigInt(11), i = BigInt(22), o = BigInt(23), a = BigInt(44), c = BigInt(88), l = s * s * s % e, u = l * l * s % e, p = oe(u, r, e) * u % e, g = oe(p, r, e) * u % e, _ = oe(g, nr, e) * l % e, x = oe(_, n, e) * _ % e, w = oe(x, i, e) * x % e, S = oe(w, a, e) * w % e, I = oe(S, c, e) * S % e, O = oe(I, a, e) * w % e, R = oe(O, r, e) * u % e, L = oe(R, o, e) * x % e, M = oe(L, t, e) * l % e, q = oe(M, nr, e);
5574
5635
  if (!yt.eql(yt.sqr(q), s))
5575
5636
  throw new Error("Cannot find square root");
5576
5637
  return q;
5577
5638
  }
5578
- const yt = rt(Ct.p, { sqrt: qn }), Kn = /* @__PURE__ */ Un(Ct, {
5639
+ const yt = rt(Ot.p, { sqrt: qn }), Kn = /* @__PURE__ */ Un(Ot, {
5579
5640
  Fp: yt,
5580
5641
  endo: Gn
5581
5642
  }), Vn = /* @__PURE__ */ Wn(Kn, gn), zn = BigInt(0), Me = BigInt(1), jn = BigInt(2), Yn = BigInt(7), Xn = BigInt(256), Jn = BigInt(113), Gr = [], qr = [], Kr = [];
@@ -5612,7 +5673,7 @@ function ei(s, e = 24) {
5612
5673
  }
5613
5674
  $e(r);
5614
5675
  }
5615
- class Nt {
5676
+ class Ct {
5616
5677
  // NOTE: we accept arguments in bytes instead of bits here.
5617
5678
  constructor(e, r, t, n = !1, i = 24) {
5618
5679
  P(this, "state");
@@ -5685,10 +5746,10 @@ class Nt {
5685
5746
  }
5686
5747
  _cloneInto(e) {
5687
5748
  const { blockLen: r, suffix: t, outputLen: n, rounds: i, enableXOF: o } = this;
5688
- return e || (e = new Nt(r, t, n, o, i)), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = i, e.suffix = t, e.outputLen = n, e.enableXOF = o, e.destroyed = this.destroyed, e;
5749
+ return e || (e = new Ct(r, t, n, o, i)), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = i, e.suffix = t, e.outputLen = n, e.enableXOF = o, e.destroyed = this.destroyed, e;
5689
5750
  }
5690
5751
  }
5691
- const ti = (s, e, r, t = {}) => yr(() => new Nt(e, s, r), t), ar = /* @__PURE__ */ ti(1, 136, 32), ri = 60;
5752
+ const ti = (s, e, r, t = {}) => yr(() => new Ct(e, s, r), t), ar = /* @__PURE__ */ ti(1, 136, 32), ri = 60;
5692
5753
  class si {
5693
5754
  constructor() {
5694
5755
  this.jwks = null;
@@ -5908,7 +5969,7 @@ class Ae {
5908
5969
  d.warn("[CROSSx] OAuth 타임아웃 (5분) — postMessage를 수신하지 못했습니다"), L(), t(new Error("Authentication timeout"));
5909
5970
  }, 5 * 60 * 1e3), x = 10, w = 30;
5910
5971
  let S = 0, I = null;
5911
- const C = () => {
5972
+ const O = () => {
5912
5973
  clearInterval(R), d.warn("[CROSSx] COOP 감지 — OAuth 서버 응답을 " + w + "초간 대기합니다"), I = setTimeout(() => {
5913
5974
  L(), t(new Error(
5914
5975
  "OAuth 서버로부터 응답을 받지 못했습니다. 브라우저 보안 정책(COOP)으로 인해 팝업 통신이 차단되었을 수 있습니다. 다시 시도해 주세요."
@@ -5917,9 +5978,9 @@ class Ae {
5917
5978
  }, R = setInterval(() => {
5918
5979
  S++;
5919
5980
  try {
5920
- g.closed && (S <= x ? C() : (L(), t(new Error("로그인이 취소되었습니다"))));
5981
+ g.closed && (S <= x ? O() : (L(), t(new Error("로그인이 취소되었습니다"))));
5921
5982
  } catch {
5922
- C();
5983
+ O();
5923
5984
  }
5924
5985
  }, 1e3), L = () => {
5925
5986
  clearTimeout(_), clearInterval(R), I && clearTimeout(I), window.removeEventListener("message", M);
@@ -5958,8 +6019,8 @@ class Ae {
5958
6019
  return;
5959
6020
  }
5960
6021
  const m = { token: D, email: F }, y = (k) => {
5961
- Ae.verifyIdTokenNonce(k, l).then(() => r(m)).catch((N) => {
5962
- d.error("[CROSSx] nonce 검증 실패:", N), t(N instanceof Error ? N : new Error("nonce verification failed"));
6022
+ Ae.verifyIdTokenNonce(k, l).then(() => r(m)).catch((C) => {
6023
+ d.error("[CROSSx] nonce 검증 실패:", C), t(C instanceof Error ? C : new Error("nonce verification failed"));
5963
6024
  });
5964
6025
  };
5965
6026
  H ? H.split(".").length === 3 ? y(H) : Q ? y(Q) : (d.warn(
@@ -5971,7 +6032,7 @@ class Ae {
5971
6032
  });
5972
6033
  }
5973
6034
  }
5974
- const Fe = "crossx_wallet_data", Oe = "crossx_mock_pin_hash";
6035
+ const Fe = "crossx_wallet_data", Ne = "crossx_mock_pin_hash";
5975
6036
  class li {
5976
6037
  constructor(e, r) {
5977
6038
  this.storage = e, this.pinStore = r ?? null;
@@ -6001,7 +6062,7 @@ class li {
6001
6062
  };
6002
6063
  await this.storage.set(Fe, n);
6003
6064
  const i = (r = this.pinStore) == null ? void 0 : r.get();
6004
- return i && (await this.storage.set(Oe, i), d.log("[Mock] 지갑 생성 — PIN 저장됨")), n;
6065
+ return i && (await this.storage.set(Ne, i), d.log("[Mock] 지갑 생성 — PIN 저장됨")), n;
6005
6066
  } catch (t) {
6006
6067
  throw new f(h.WALLET_CREATION_FAILED, "지갑 생성에 실패했습니다", t);
6007
6068
  }
@@ -6043,8 +6104,8 @@ class li {
6043
6104
  var t;
6044
6105
  if (d.log("[Mock] verifyPin"), this.pinScenario === "wrong")
6045
6106
  return !1;
6046
- const r = await this.storage.get(Oe);
6047
- return r && r !== e ? !1 : (r || await this.storage.set(Oe, e), (t = this.pinStore) == null || t.set(e), d.log("[Mock] verifyPin → 성공"), !0);
6107
+ const r = await this.storage.get(Ne);
6108
+ return r && r !== e ? !1 : (r || await this.storage.set(Ne, e), (t = this.pinStore) == null || t.set(e), d.log("[Mock] verifyPin → 성공"), !0);
6048
6109
  }
6049
6110
  /**
6050
6111
  * POST /mnemonic/change-password 모킹
@@ -6054,10 +6115,10 @@ class li {
6054
6115
  var i;
6055
6116
  if (d.log("[Mock] changePin"), this.pinScenario === "wrong")
6056
6117
  throw new f(h.PIN_WRONG, "Incorrect PIN.");
6057
- const t = (i = this.pinStore) == null ? void 0 : i.get(), n = await this.storage.get(Oe);
6118
+ const t = (i = this.pinStore) == null ? void 0 : i.get(), n = await this.storage.get(Ne);
6058
6119
  if (n && t && n !== t)
6059
6120
  throw new f(h.PIN_WRONG, "Incorrect PIN.");
6060
- await this.storage.set(Oe, r), d.log("[Mock] changePin 완료");
6121
+ await this.storage.set(Ne, r), d.log("[Mock] changePin 완료");
6061
6122
  }
6062
6123
  async migrateWallet(e, r) {
6063
6124
  var i;
@@ -6090,7 +6151,7 @@ class li {
6090
6151
  };
6091
6152
  await this.storage.set(Fe, t);
6092
6153
  const n = (i = this.pinStore) == null ? void 0 : i.get();
6093
- return n && (await this.storage.set(Oe, n), d.log("[Mock] 마이그레이션 — PIN 저장됨")), t;
6154
+ return n && (await this.storage.set(Ne, n), d.log("[Mock] 마이그레이션 — PIN 저장됨")), t;
6094
6155
  }
6095
6156
  /**
6096
6157
  * POST /mnemonic/share-c 모킹
@@ -6205,9 +6266,9 @@ class Ie {
6205
6266
  h.USER_NOT_FOUND,
6206
6267
  Ie.getGatewayErrorMessage(_.code, x)
6207
6268
  );
6208
- const S = w === h.AUTH_NOT_AUTHENTICATED ? h.SESSION_EXPIRED : w, I = S === h.SESSION_EXPIRED ? "인증 세션이 만료되었습니다. 다시 로그인해 주세요." : Ie.getGatewayErrorMessage(_.code, x), C = _.data;
6269
+ const S = w === h.AUTH_NOT_AUTHENTICATED ? h.SESSION_EXPIRED : w, I = S === h.SESSION_EXPIRED ? "인증 세션이 만료되었습니다. 다시 로그인해 주세요." : Ie.getGatewayErrorMessage(_.code, x), O = _.data;
6209
6270
  let R;
6210
- throw w === h.PIN_LOCKED ? R = Ie.extractLockDetails(C) : w === h.ADDRESS_LIMIT_EXCEEDED ? R = { limit: gt, raw: C } : R = C ?? void 0, new f(S, I, R);
6271
+ throw w === h.PIN_LOCKED ? R = Ie.extractLockDetails(O) : w === h.ADDRESS_LIMIT_EXCEEDED ? R = { limit: gt, raw: O } : R = O ?? void 0, new f(S, I, R);
6211
6272
  }
6212
6273
  return d.log("[CROSSx] Wallet Gateway API 성공:", { code: _.code, url: o, method: e }), _.data ?? _;
6213
6274
  }
@@ -9090,7 +9151,7 @@ function _i(s) {
9090
9151
  }, { passive: !0 });
9091
9152
  }
9092
9153
  const fi = () => /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
9093
- function Ce() {
9154
+ function Oe() {
9094
9155
  if (fi()) {
9095
9156
  const e = window.scrollY;
9096
9157
  return document.body.style.position = "fixed", document.body.style.top = `-${e}px`, document.body.style.left = "0", document.body.style.right = "0", () => {
@@ -9365,22 +9426,22 @@ function ki(s) {
9365
9426
  function Ri(s) {
9366
9427
  return s.includes(":") ? s.split(":")[1] ?? s : s;
9367
9428
  }
9368
- function Oi(s) {
9429
+ function Ni(s) {
9369
9430
  return `https://www.crossscan.io/address/${s}?tab=txs`;
9370
9431
  }
9371
- function Ci(s, e) {
9432
+ function Oi(s, e) {
9372
9433
  return `https://explorer.crosstoken.io/${Ri(s)}/tx/${e}`;
9373
9434
  }
9374
9435
  function Jr(s, e) {
9375
9436
  return `<a class="__crossx-addr-text __crossx-row-link" href="${A(e)}" target="_blank" rel="noopener noreferrer">${A(s)}</a>`;
9376
9437
  }
9377
9438
  function Ze(s) {
9378
- return Jr(de(s), Oi(s));
9439
+ return Jr(de(s), Ni(s));
9379
9440
  }
9380
9441
  function Zr(s, e) {
9381
- return Jr(de(e), Ci(s, e));
9442
+ return Jr(de(e), Oi(s, e));
9382
9443
  }
9383
- function Ni(s, e, r) {
9444
+ function Ci(s, e, r) {
9384
9445
  const t = j(
9385
9446
  (r == null ? void 0 : r.label_from) ?? "From",
9386
9447
  `${Ze(s.from)}
@@ -9460,10 +9521,10 @@ function Li(s, e, r, t) {
9460
9521
  <button class="__crossx-approve-btn" id="__crossx-done-btn">${A((t == null ? void 0 : t.tx_complete_done_button) ?? (n ? "All Done" : "Done"))}</button>
9461
9522
  `, c.querySelectorAll(".__crossx-copy-btn").forEach((w) => {
9462
9523
  w.addEventListener("click", (S) => {
9463
- var C;
9524
+ var O;
9464
9525
  S.stopPropagation();
9465
9526
  const I = w.dataset.copy;
9466
- I && ((C = navigator.clipboard) == null || C.writeText(I).catch(() => {
9527
+ I && ((O = navigator.clipboard) == null || O.writeText(I).catch(() => {
9467
9528
  }));
9468
9529
  });
9469
9530
  });
@@ -9902,19 +9963,19 @@ function to(s) {
9902
9963
  return r > 0 ? `${r}h ${String(t).padStart(2, "0")}m` : `${String(t).padStart(2, "0")}:${String(n).padStart(2, "0")}`;
9903
9964
  }
9904
9965
  function _t(s, e, r, t, n, i, o) {
9905
- var N, B;
9966
+ var C, B;
9906
9967
  let a = !!(i && i > Date.now()), c = !1;
9907
9968
  const l = () => Array.from(s.querySelectorAll(".__crossx-pin6-box")), u = () => s.querySelector("#__crossx-pin6-boxes"), p = () => s.querySelector("#__crossx-pin6-error"), g = () => s.querySelector("#__crossx-pin6-lock-msg"), _ = () => s.querySelector("#__crossx-pin6-lock-countdown"), x = () => s.querySelector(".__crossx-pin6-body"), w = () => l().map((b) => b.value).join(""), S = () => Array.from(s.querySelectorAll(".__crossx-pin6-dot")), I = () => {
9908
9969
  var E;
9909
9970
  const b = l(), v = S();
9910
- if (v.length && (v.forEach((T, O) => {
9911
- const W = !!(b[O] && b[O].value);
9971
+ if (v.length && (v.forEach((T, N) => {
9972
+ const W = !!(b[N] && b[N].value);
9912
9973
  T.classList.toggle("--filled", W), T.classList.toggle("--active", !1);
9913
9974
  }), !a && !c)) {
9914
9975
  const T = b.findIndex((W) => !W.value);
9915
9976
  (E = v[T === -1 ? 5 : T]) == null || E.classList.add("--active");
9916
9977
  }
9917
- }, C = () => {
9978
+ }, O = () => {
9918
9979
  s.querySelectorAll(".__crossx-pin6-numpad-key[data-key]").forEach((v) => v.classList.toggle("--disabled", a)), S().forEach((v) => v.classList.toggle("--locked", a)), I();
9919
9980
  }, R = (b) => {
9920
9981
  a = b, l().forEach((v) => {
@@ -9940,8 +10001,8 @@ function _t(s, e, r, t, n, i, o) {
9940
10001
  let E = L();
9941
10002
  if (!E) {
9942
10003
  E = document.createElement("p"), E.className = "__crossx-pin6-attempt", E.id = "__crossx-pin6-attempt";
9943
- const O = J() ?? p();
9944
- O ? O.insertAdjacentElement("afterend", E) : (T = x()) == null || T.appendChild(E);
10004
+ const N = J() ?? p();
10005
+ N ? N.insertAdjacentElement("afterend", E) : (T = x()) == null || T.appendChild(E);
9945
10006
  }
9946
10007
  E.textContent = `${b}/${v}`;
9947
10008
  }, H = () => {
@@ -9961,7 +10022,7 @@ function _t(s, e, r, t, n, i, o) {
9961
10022
  var W;
9962
10023
  R(!0), l().forEach((U) => {
9963
10024
  U.value = "";
9964
- }), C();
10025
+ }), O();
9965
10026
  const v = p();
9966
10027
  if (v && (v.textContent = "Too many failed attempts. Please wait."), !g()) {
9967
10028
  const U = document.createElement("p");
@@ -9972,16 +10033,16 @@ function _t(s, e, r, t, n, i, o) {
9972
10033
  const E = () => {
9973
10034
  var K;
9974
10035
  const U = b - Date.now(), $ = _();
9975
- U <= 0 ? (clearInterval(T), R(!1), (K = g()) == null || K.remove(), v && (v.textContent = ""), C(), setTimeout(() => {
10036
+ U <= 0 ? (clearInterval(T), R(!1), (K = g()) == null || K.remove(), v && (v.textContent = ""), O(), setTimeout(() => {
9976
10037
  var Y;
9977
10038
  return (Y = l()[0]) == null ? void 0 : Y.focus();
9978
10039
  }, 50)) : $ && ($.textContent = ` ${to(U)}`);
9979
10040
  }, T = setInterval(E, 1e3);
9980
10041
  E();
9981
- const O = new MutationObserver(() => {
9982
- document.contains(s) || (clearInterval(T), O.disconnect());
10042
+ const N = new MutationObserver(() => {
10043
+ document.contains(s) || (clearInterval(T), N.disconnect());
9983
10044
  });
9984
- O.observe(document.body, { childList: !0, subtree: !1 });
10045
+ N.observe(document.body, { childList: !0, subtree: !1 });
9985
10046
  }, m = async () => {
9986
10047
  if (a || c) return;
9987
10048
  const b = w();
@@ -10013,7 +10074,7 @@ function _t(s, e, r, t, n, i, o) {
10013
10074
  const b = l(), v = b.find((E) => !E.value) ?? b[b.length - 1];
10014
10075
  v == null || v.focus();
10015
10076
  };
10016
- (N = u()) == null || N.addEventListener("click", (b) => {
10077
+ (C = u()) == null || C.addEventListener("click", (b) => {
10017
10078
  b.target.classList.contains("__crossx-pin6-box") || y();
10018
10079
  }), (B = x()) == null || B.addEventListener("click", (b) => {
10019
10080
  const v = b.target;
@@ -10024,7 +10085,7 @@ function _t(s, e, r, t, n, i, o) {
10024
10085
  const E = b.value.replace(/\D/g, "").slice(-1);
10025
10086
  b.value = E, M(), E && v < 5 && ((T = l()[v + 1]) == null || T.focus()), I(), w().length === 6 && setTimeout(m, 80);
10026
10087
  }), b.addEventListener("keydown", (E) => {
10027
- var T, O;
10088
+ var T, N;
10028
10089
  if (E.key === "Backspace") {
10029
10090
  if (E.preventDefault(), b.value)
10030
10091
  b.value = "";
@@ -10033,16 +10094,16 @@ function _t(s, e, r, t, n, i, o) {
10033
10094
  W.value = "", W.focus();
10034
10095
  }
10035
10096
  I();
10036
- } else E.key === "ArrowLeft" && v > 0 ? (E.preventDefault(), (T = l()[v - 1]) == null || T.focus()) : E.key === "ArrowRight" && v < 5 ? (E.preventDefault(), (O = l()[v + 1]) == null || O.focus()) : E.key === "Escape" && r();
10097
+ } else E.key === "ArrowLeft" && v > 0 ? (E.preventDefault(), (T = l()[v - 1]) == null || T.focus()) : E.key === "ArrowRight" && v < 5 ? (E.preventDefault(), (N = l()[v + 1]) == null || N.focus()) : E.key === "Escape" && r();
10037
10098
  }), b.addEventListener("paste", (E) => {
10038
10099
  var W, U;
10039
10100
  E.preventDefault();
10040
10101
  const T = (((W = E.clipboardData) == null ? void 0 : W.getData("text")) ?? "").replace(/\D/g, "").slice(0, 6);
10041
10102
  if (!T) return;
10042
- const O = l();
10103
+ const N = l();
10043
10104
  T.split("").forEach(($, K) => {
10044
- O[K] && (O[K].value = $);
10045
- }), (U = O[Math.min(T.length - 1, 5)]) == null || U.focus(), M(), I(), w().length === 6 && setTimeout(m, 80);
10105
+ N[K] && (N[K].value = $);
10106
+ }), (U = N[Math.min(T.length - 1, 5)]) == null || U.focus(), M(), I(), w().length === 6 && setTimeout(m, 80);
10046
10107
  }), b.addEventListener("focus", () => b.select());
10047
10108
  });
10048
10109
  const k = s.querySelector("#__crossx-pin6-numpad");
@@ -10052,28 +10113,28 @@ function _t(s, e, r, t, n, i, o) {
10052
10113
  b && (b.classList.remove("--pressed"), b = null);
10053
10114
  };
10054
10115
  k.addEventListener("pointerdown", (T) => {
10055
- const O = T.target.closest(".__crossx-pin6-numpad-key");
10056
- !O || a || c || (v(), b = O, O.classList.add("--pressed"), O.setPointerCapture(T.pointerId));
10116
+ const N = T.target.closest(".__crossx-pin6-numpad-key");
10117
+ !N || a || c || (v(), b = N, N.classList.add("--pressed"), N.setPointerCapture(T.pointerId));
10057
10118
  });
10058
10119
  const E = (T) => {
10059
- const O = T.dataset.key;
10060
- if (!O) return;
10061
- if (O === "backspace") {
10120
+ const N = T.dataset.key;
10121
+ if (!N) return;
10122
+ if (N === "backspace") {
10062
10123
  const K = [...l()].reverse().find((Y) => Y.value);
10063
10124
  K && (K.value = "", M()), I();
10064
10125
  return;
10065
10126
  }
10066
- if (!/^\d$/.test(O)) return;
10127
+ if (!/^\d$/.test(N)) return;
10067
10128
  const U = l().find(($) => !$.value);
10068
- U && (U.value = O, M(), I(), w().length === 6 && setTimeout(m, 80));
10129
+ U && (U.value = N, M(), I(), w().length === 6 && setTimeout(m, 80));
10069
10130
  };
10070
10131
  k.addEventListener("pointerup", (T) => {
10071
10132
  if (!b) return;
10072
- const O = b;
10133
+ const N = b;
10073
10134
  v();
10074
- const W = O.getBoundingClientRect();
10075
- T.clientX >= W.left && T.clientX <= W.right && T.clientY >= W.top && T.clientY <= W.bottom && !a && !c && E(O);
10076
- }), k.addEventListener("pointercancel", v), k.addEventListener("pointerleave", v, !0), I(), i && i > Date.now() && C();
10135
+ const W = N.getBoundingClientRect();
10136
+ T.clientX >= W.left && T.clientX <= W.right && T.clientY >= W.top && T.clientY <= W.bottom && !a && !c && E(N);
10137
+ }), k.addEventListener("pointercancel", v), k.addEventListener("pointerleave", v, !0), I(), i && i > Date.now() && O();
10077
10138
  }
10078
10139
  }
10079
10140
  const ro = `<svg width="22" height="17" viewBox="0 0 22 17" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -10146,9 +10207,9 @@ class oo {
10146
10207
  */
10147
10208
  showWalletSelector(e, r, t) {
10148
10209
  return new Promise((n, i) => {
10149
- var C;
10210
+ var O;
10150
10211
  ae();
10151
- const o = [...e], a = Wi(o, this.tokens, t, this.messages), c = Ce();
10212
+ const o = [...e], a = Wi(o, this.tokens, t, this.messages), c = Oe();
10152
10213
  ce(a);
10153
10214
  let l = !1;
10154
10215
  const u = () => {
@@ -10188,7 +10249,7 @@ class oo {
10188
10249
  const L = R instanceof f && R.code === h.ADDRESS_LIMIT_EXCEEDED, M = this.resolveAddWalletErrorMessage(R);
10189
10250
  w && (w.textContent = M, w.hidden = !1), L ? (S.disabled = !0, S.setAttribute("aria-disabled", "true")) : S.disabled = !1, p = R;
10190
10251
  }
10191
- }), (C = a.querySelector("#__crossx-close-btn")) == null || C.addEventListener("click", _), a.addEventListener("click", (R) => {
10252
+ }), (O = a.querySelector("#__crossx-close-btn")) == null || O.addEventListener("click", _), a.addEventListener("click", (R) => {
10192
10253
  R.target === a && _();
10193
10254
  });
10194
10255
  const I = (R) => {
@@ -10225,7 +10286,7 @@ class oo {
10225
10286
  return new Promise((n) => {
10226
10287
  var g, _, x, w;
10227
10288
  ae();
10228
- const i = zi(this.tokens, r, this.messages), o = Ce();
10289
+ const i = zi(this.tokens, r, this.messages), o = Oe();
10229
10290
  ce(i);
10230
10291
  const a = () => {
10231
10292
  i.remove(), o();
@@ -10237,8 +10298,8 @@ class oo {
10237
10298
  a(), n(null);
10238
10299
  };
10239
10300
  (g = i.querySelector("#__crossx-apple-btn")) == null || g.addEventListener("click", () => c("apple")), (_ = i.querySelector("#__crossx-google-btn")) == null || _.addEventListener("click", () => c("google")), (x = i.querySelector("#__crossx-connect-other-wallet-btn")) == null || x.addEventListener("click", (S) => {
10240
- const C = S.currentTarget.dataset.walletId ?? "";
10241
- C && l(C);
10301
+ const O = S.currentTarget.dataset.walletId ?? "";
10302
+ O && l(O);
10242
10303
  }), (w = i.querySelector("#__crossx-close-btn")) == null || w.addEventListener("click", u), i.addEventListener("click", (S) => {
10243
10304
  S.target === i && u();
10244
10305
  }), i.querySelectorAll(".__crossx-login-terms-link").forEach((S) => {
@@ -10261,7 +10322,7 @@ class oo {
10261
10322
  accountLabel: (t == null ? void 0 : t.session_alert_account_label) ?? "Account",
10262
10323
  signOutLabel: (t == null ? void 0 : t.session_alert_sign_out_button) ?? "Sign out",
10263
10324
  signInAgainLabel: (t == null ? void 0 : t.session_alert_sign_in_again_button) ?? "Sign in again"
10264
- }), i = Ce();
10325
+ }), i = Oe();
10265
10326
  ce(n);
10266
10327
  let o = !1;
10267
10328
  const a = () => {
@@ -10330,13 +10391,13 @@ class oo {
10330
10391
  }, o = {
10331
10392
  title: (t == null ? void 0 : t.pin_setup_confirm_title) ?? "Confirm PIN",
10332
10393
  headerSubtitle: (t == null ? void 0 : t.pin_setup_confirm_subtitle) ?? "Enter your PIN again to confirm."
10333
- }, a = hr(this.tokens, Qi(n)), c = Ce();
10394
+ }, a = hr(this.tokens, Qi(n)), c = Oe();
10334
10395
  ce(a);
10335
10396
  let l = !1;
10336
10397
  const u = () => {
10337
10398
  l || (l = !0, a.remove(), c());
10338
- }, p = (C) => {
10339
- u(), r(C);
10399
+ }, p = (O) => {
10400
+ u(), r(O);
10340
10401
  }, g = () => {
10341
10402
  u(), r(null);
10342
10403
  }, _ = a.querySelector(".__crossx-card"), x = {
@@ -10345,21 +10406,21 @@ class oo {
10345
10406
  repeatingDigit: (t == null ? void 0 : t.pin_validation_repeating_digit) ?? "Cannot use the same number 3+ times in a row.",
10346
10407
  sequential: (t == null ? void 0 : t.pin_validation_sequential) ?? "Sequential numbers (e.g., 123456) are not allowed.",
10347
10408
  alternatingPattern: (t == null ? void 0 : t.pin_validation_alternating_pattern) ?? "Repeating patterns (e.g., 121212) are not allowed."
10348
- }, w = (C) => {
10409
+ }, w = (O) => {
10349
10410
  var R;
10350
10411
  _.innerHTML = pt({
10351
10412
  title: o.title,
10352
10413
  headerSubtitle: o.headerSubtitle
10353
10414
  }), (R = _.querySelector("#__crossx-close-btn")) == null || R.addEventListener("click", g), _t(_, (L) => {
10354
- L === C ? p(C) : S(i.mismatchError);
10415
+ L === O ? p(O) : S(i.mismatchError);
10355
10416
  }, g);
10356
- }, S = (C) => {
10417
+ }, S = (O) => {
10357
10418
  var R;
10358
10419
  _.innerHTML = pt({
10359
10420
  title: i.title,
10360
10421
  headerSubtitle: i.headerSubtitle,
10361
10422
  subtitle: i.subtitle,
10362
- errorMessage: C
10423
+ errorMessage: O
10363
10424
  }), (R = _.querySelector("#__crossx-close-btn")) == null || R.addEventListener("click", g), _t(_, (L) => {
10364
10425
  const M = eo(L, x);
10365
10426
  M ? S(M) : w(L);
@@ -10367,10 +10428,10 @@ class oo {
10367
10428
  };
10368
10429
  (() => {
10369
10430
  var Q;
10370
- const C = Array.from(_.querySelectorAll(".__crossx-pw-notice-item")), R = _.querySelector("#__crossx-pin-notice-next"), L = /* @__PURE__ */ new Set();
10431
+ const O = Array.from(_.querySelectorAll(".__crossx-pw-notice-item")), R = _.querySelector("#__crossx-pin-notice-next"), L = /* @__PURE__ */ new Set();
10371
10432
  R.removeAttribute("disabled");
10372
10433
  const M = R.dataset.nextLabel ?? "Next", q = R.dataset.submitLabel ?? "I Understand", J = () => {
10373
- const H = L.size === C.length;
10434
+ const H = L.size === O.length;
10374
10435
  R.classList.toggle("--disabled", !H), R.textContent = H ? q : M;
10375
10436
  }, G = (H, D) => {
10376
10437
  if (L.has(D)) return;
@@ -10381,7 +10442,7 @@ class oo {
10381
10442
  const F = H.querySelector(`#__crossx-notice-check-${D}`);
10382
10443
  L.delete(D), F.classList.remove("--checked"), H.setAttribute("aria-checked", "false"), J();
10383
10444
  };
10384
- C.forEach((H) => {
10445
+ O.forEach((H) => {
10385
10446
  const D = parseInt(H.dataset.checkIndex ?? "0", 10);
10386
10447
  H.addEventListener("click", () => {
10387
10448
  L.has(D) ? X(H, D) : G(H, D);
@@ -10389,11 +10450,11 @@ class oo {
10389
10450
  (F.key === " " || F.key === "Enter") && (F.preventDefault(), L.has(D) ? X(H, D) : G(H, D));
10390
10451
  });
10391
10452
  }), R.addEventListener("click", () => {
10392
- if (L.size === C.length) {
10453
+ if (L.size === O.length) {
10393
10454
  S(e == null ? void 0 : e.errorMessage);
10394
10455
  return;
10395
10456
  }
10396
- const H = C.find((F) => {
10457
+ const H = O.find((F) => {
10397
10458
  const m = parseInt(F.dataset.checkIndex ?? "0", 10);
10398
10459
  return !L.has(m);
10399
10460
  });
@@ -10403,8 +10464,8 @@ class oo {
10403
10464
  H.classList.remove("--highlight"), G(H, D);
10404
10465
  }, 400);
10405
10466
  }), (Q = _.querySelector("#__crossx-close-btn")) == null || Q.addEventListener("click", g);
10406
- })(), a.addEventListener("click", (C) => {
10407
- C.target === a && g();
10467
+ })(), a.addEventListener("click", (O) => {
10468
+ O.target === a && g();
10408
10469
  });
10409
10470
  });
10410
10471
  }
@@ -10428,20 +10489,20 @@ class oo {
10428
10489
  attemptCount: e == null ? void 0 : e.attemptCount,
10429
10490
  maxAttempts: e == null ? void 0 : e.maxAttempts
10430
10491
  })
10431
- ), u = Ce();
10492
+ ), u = Oe();
10432
10493
  ce(l);
10433
10494
  let p = !1;
10434
10495
  const g = () => {
10435
10496
  p || (p = !0, l.remove(), u());
10436
- }, _ = (C) => {
10437
- g(), r(C);
10497
+ }, _ = (O) => {
10498
+ g(), r(O);
10438
10499
  }, x = () => {
10439
10500
  g(), r(null);
10440
- }, w = (C) => {
10441
- g(), t(C);
10501
+ }, w = (O) => {
10502
+ g(), t(O);
10442
10503
  }, S = l.querySelector(".__crossx-card");
10443
- (I = S.querySelector("#__crossx-close-btn")) == null || I.addEventListener("click", x), _t(S, _, x, w, e == null ? void 0 : e.onSubmit, e == null ? void 0 : e.lockExpiresAt, c), l.addEventListener("click", (C) => {
10444
- C.target === l && x();
10504
+ (I = S.querySelector("#__crossx-close-btn")) == null || I.addEventListener("click", x), _t(S, _, x, w, e == null ? void 0 : e.onSubmit, e == null ? void 0 : e.lockExpiresAt, c), l.addEventListener("click", (O) => {
10505
+ O.target === l && x();
10445
10506
  });
10446
10507
  });
10447
10508
  }
@@ -10498,7 +10559,7 @@ class oo {
10498
10559
  return new Promise((r) => {
10499
10560
  var a, c;
10500
10561
  ae();
10501
- const t = Ni(e, this.tokens, this.messages);
10562
+ const t = Ci(e, this.tokens, this.messages);
10502
10563
  ce(t);
10503
10564
  const n = () => t.remove(), i = () => {
10504
10565
  n(), r();
@@ -10554,7 +10615,7 @@ class oo {
10554
10615
  ae();
10555
10616
  let t;
10556
10617
  e.type === "sign-message" ? t = Di(e, this.tokens, this.messages) : e.type === "sign-typed-data" ? t = $i(e, this.tokens, this.messages) : e.type === "sign" ? t = Ai(e, this.tokens, this.displayDecimals, this.messages) : t = Ii(e, this.tokens, this.displayDecimals, this.messages);
10557
- const n = Ce();
10618
+ const n = Oe();
10558
10619
  ce(t);
10559
10620
  const i = () => {
10560
10621
  t.remove(), n();
@@ -10826,7 +10887,7 @@ Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
10826
10887
  },
10827
10888
  () => typeof window < "u" ? window.location.origin : "http://localhost",
10828
10889
  x
10829
- ), C = e != null && e.wrapConfirmation ? e.wrapConfirmation(I) : I, R = new xt(
10890
+ ), O = e != null && e.wrapConfirmation ? e.wrapConfirmation(I) : I, R = new xt(
10830
10891
  t,
10831
10892
  n,
10832
10893
  o,
@@ -10835,7 +10896,7 @@ Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
10835
10896
  l,
10836
10897
  g,
10837
10898
  u,
10838
- C,
10899
+ O,
10839
10900
  w,
10840
10901
  p
10841
10902
  );