@nexus-cross/crossx-sdk-core 2.2.2 → 2.2.3-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/adapters/confirmation/BridgeConfirmationAdapter.d.ts +2 -1
- package/dist/adapters/confirmation/BridgeConfirmationAdapter.d.ts.map +1 -1
- package/dist/adapters/confirmation/BrowserConfirmationAdapter.d.ts +8 -2
- package/dist/adapters/confirmation/BrowserConfirmationAdapter.d.ts.map +1 -1
- package/dist/core/constants.d.ts +1 -1
- package/dist/core/types/index.d.ts +35 -0
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/crossx.global +15 -11
- package/dist/index.cjs +7 -3
- package/dist/index.js +205 -157
- package/dist/sdk/CROSSxSDK.d.ts +12 -0
- package/dist/sdk/CROSSxSDK.d.ts.map +1 -1
- package/dist/sdk/factory.d.ts.map +1 -1
- package/package.json +1 -1
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
|
|
661
|
-
w = I.email ?? ((a =
|
|
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 ?? "(없음)");
|
|
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
|
|
669
|
-
if (n =
|
|
668
|
+
const C = await this.crypto.verifyJWT(p);
|
|
669
|
+
if (n = C.signatureVerified ?? !1, !C.valid)
|
|
670
670
|
throw d.error("[CROSSx] access_token 검증 실패"), new Error("유효하지 않은 access token");
|
|
671
|
-
const R =
|
|
671
|
+
const R = C.payload, L = R.email ?? w ?? r;
|
|
672
672
|
d.log(
|
|
673
673
|
"[CROSSx] email 소스 — CROSSx JWT:",
|
|
674
674
|
R.email ?? "(없음)",
|
|
@@ -1378,7 +1378,7 @@ function fr() {
|
|
|
1378
1378
|
}
|
|
1379
1379
|
return Pe.production;
|
|
1380
1380
|
}
|
|
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.
|
|
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.3";
|
|
1382
1382
|
function gr(s) {
|
|
1383
1383
|
let e = s.length;
|
|
1384
1384
|
for (; e > 0 && s.charCodeAt(e - 1) === 48; ) e--;
|
|
@@ -1406,7 +1406,7 @@ function Ge(s, e, r, t = Et) {
|
|
|
1406
1406
|
return;
|
|
1407
1407
|
}
|
|
1408
1408
|
}
|
|
1409
|
-
function
|
|
1409
|
+
function Cs(s) {
|
|
1410
1410
|
const e = s.startsWith("0x") ? s.slice(2) : s;
|
|
1411
1411
|
if (!/^[0-9a-fA-F]+$/.test(e))
|
|
1412
1412
|
throw new f(
|
|
@@ -1419,7 +1419,7 @@ function Os(s) {
|
|
|
1419
1419
|
`서명 길이가 유효하지 않습니다: ${Wt} hex 문자(65 바이트) 예상, 현재 ${e.length}`
|
|
1420
1420
|
);
|
|
1421
1421
|
}
|
|
1422
|
-
function
|
|
1422
|
+
function Os(s) {
|
|
1423
1423
|
const e = s.startsWith("0x") ? s.slice(2) : s;
|
|
1424
1424
|
if (!/^[0-9a-fA-F]+$/.test(e))
|
|
1425
1425
|
throw new f(
|
|
@@ -1466,7 +1466,7 @@ function Ls(s) {
|
|
|
1466
1466
|
const t = Number(r);
|
|
1467
1467
|
return Number.isFinite(t) ? t : void 0;
|
|
1468
1468
|
}
|
|
1469
|
-
class
|
|
1469
|
+
class Oe {
|
|
1470
1470
|
constructor(e) {
|
|
1471
1471
|
this.deps = e, this.verifyPinMutex = null;
|
|
1472
1472
|
}
|
|
@@ -1539,7 +1539,7 @@ class Ce {
|
|
|
1539
1539
|
if (u.code === h.PIN_INVALID)
|
|
1540
1540
|
return { ok: !1, error: u.message };
|
|
1541
1541
|
if (u.code === h.PIN_LOCKED)
|
|
1542
|
-
return
|
|
1542
|
+
return Oe.buildPinLockedResult(u, a);
|
|
1543
1543
|
}
|
|
1544
1544
|
throw u;
|
|
1545
1545
|
}
|
|
@@ -1573,7 +1573,7 @@ class Ce {
|
|
|
1573
1573
|
return await e();
|
|
1574
1574
|
} catch (n) {
|
|
1575
1575
|
if (n instanceof f) {
|
|
1576
|
-
if (t =
|
|
1576
|
+
if (t = Oe.parsePinError(n, r), !t) throw n;
|
|
1577
1577
|
} else
|
|
1578
1578
|
throw n;
|
|
1579
1579
|
}
|
|
@@ -1587,7 +1587,7 @@ class Ce {
|
|
|
1587
1587
|
try {
|
|
1588
1588
|
return await e();
|
|
1589
1589
|
} catch (n) {
|
|
1590
|
-
if (n instanceof f && (t =
|
|
1590
|
+
if (n instanceof f && (t = Oe.parsePinError(n, r), t))
|
|
1591
1591
|
continue;
|
|
1592
1592
|
throw n;
|
|
1593
1593
|
}
|
|
@@ -1612,7 +1612,7 @@ class Ce {
|
|
|
1612
1612
|
return null;
|
|
1613
1613
|
}
|
|
1614
1614
|
static buildPinLockedResult(e, r) {
|
|
1615
|
-
const t =
|
|
1615
|
+
const t = Oe.parsePinError(e, r);
|
|
1616
1616
|
if (!t) return { ok: !1, error: e.message };
|
|
1617
1617
|
const { errorMessage: n, ...i } = t;
|
|
1618
1618
|
return { ok: !1, error: n, ...i };
|
|
@@ -2322,7 +2322,7 @@ const Te = class Te extends ys {
|
|
|
2322
2322
|
walletPreferenceKey: Te.WALLET_PREF_KEY,
|
|
2323
2323
|
storage: this.storage,
|
|
2324
2324
|
pinStore: this.pinStore
|
|
2325
|
-
}), this.pinOrchestrator = new
|
|
2325
|
+
}), this.pinOrchestrator = new Oe({
|
|
2326
2326
|
confirmation: this.confirmation,
|
|
2327
2327
|
walletProvider: this.walletProvider,
|
|
2328
2328
|
pinStore: this.pinStore,
|
|
@@ -2447,7 +2447,7 @@ const Te = class Te extends ys {
|
|
|
2447
2447
|
}
|
|
2448
2448
|
async _doInitialize(e) {
|
|
2449
2449
|
var r, t;
|
|
2450
|
-
d.log("[CROSSx SDK] v2.2.
|
|
2450
|
+
d.log("[CROSSx SDK] v2.2.3 초기화 중..."), this.confirmation.setMessages(xe(this._config.locale));
|
|
2451
2451
|
try {
|
|
2452
2452
|
const n = fr();
|
|
2453
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`);
|
|
@@ -2476,7 +2476,7 @@ const Te = class Te extends ys {
|
|
|
2476
2476
|
d.log("[CROSSx] initialize: 비밀번호 입력 취소 — 지갑 미로드 상태로 계속");
|
|
2477
2477
|
}
|
|
2478
2478
|
}
|
|
2479
|
-
return this.initialized = !0, d.info("[CROSSx SDK] v2.2.
|
|
2479
|
+
return this.initialized = !0, d.info("[CROSSx SDK] v2.2.3 초기화 완료"), this.emit("initialized", { restored: !!(c != null && c.success) }), c ?? null;
|
|
2480
2480
|
} catch (n) {
|
|
2481
2481
|
throw new f(h.AUTH_NOT_INITIALIZED, "SDK 초기화에 실패했습니다", n);
|
|
2482
2482
|
}
|
|
@@ -2497,7 +2497,7 @@ const Te = class Te extends ys {
|
|
|
2497
2497
|
const e = new fe({
|
|
2498
2498
|
appId: this._config.projectId,
|
|
2499
2499
|
appVersion: "1.0.0",
|
|
2500
|
-
sdkVersion: "2.2.
|
|
2500
|
+
sdkVersion: "2.2.3",
|
|
2501
2501
|
keyId: "key-id-1",
|
|
2502
2502
|
userIdHash: "user-hash-placeholder",
|
|
2503
2503
|
projectId: this._config.projectId
|
|
@@ -2533,7 +2533,7 @@ const Te = class Te extends ys {
|
|
|
2533
2533
|
this._rnBridgeWalletName
|
|
2534
2534
|
), d.log("[CROSSx] Bridge 로그인 성공", { userId: (e = t.user) == null ? void 0 : e.id }), t) : null;
|
|
2535
2535
|
} catch (r) {
|
|
2536
|
-
return r instanceof f && r.code === h.USER_REJECTED ? (d.log("[CROSSx] Bridge 로그인 거부 —
|
|
2536
|
+
return r instanceof f && r.code === h.USER_REJECTED ? (d.log("[CROSSx] Bridge 로그인 거부 — OAuth fallback 진행 (bridge 유지)"), null) : (d.warn("[CROSSx] Bridge 로그인 타임아웃/실패", r), !1);
|
|
2537
2537
|
}
|
|
2538
2538
|
}
|
|
2539
2539
|
/**
|
|
@@ -2720,7 +2720,6 @@ const Te = class Te extends ys {
|
|
|
2720
2720
|
} catch (r) {
|
|
2721
2721
|
d.warn("[CROSSx] RN Bridge signOut 통보 실패 (로그아웃 자체는 정상)", r);
|
|
2722
2722
|
}
|
|
2723
|
-
this._rnBridgeService = null, this._rnBridgeWalletAddress = void 0, this._rnBridgeWalletName = void 0;
|
|
2724
2723
|
} catch (e) {
|
|
2725
2724
|
throw new f(h.UNKNOWN_ERROR, "로그아웃에 실패했습니다", e);
|
|
2726
2725
|
}
|
|
@@ -3042,6 +3041,21 @@ const Te = class Te extends ys {
|
|
|
3042
3041
|
applyLocale(e = this._config.locale ?? "en") {
|
|
3043
3042
|
this._config = Object.freeze({ ...this._config, locale: e }), this.confirmation.setMessages(xe(e));
|
|
3044
3043
|
}
|
|
3044
|
+
/**
|
|
3045
|
+
* PIN 입력 모달의 키보드 방식을 런타임에 변경합니다.
|
|
3046
|
+
* 다음 PIN 모달이 열릴 때부터 적용됩니다.
|
|
3047
|
+
*
|
|
3048
|
+
* @param mode 키보드 방식: 'virtual' (커스텀 numpad) | 'native' (OS 기본 키보드) | 함수
|
|
3049
|
+
*
|
|
3050
|
+
* @example
|
|
3051
|
+
* sdk.setPinKeyboard('native');
|
|
3052
|
+
* sdk.setPinKeyboard('virtual');
|
|
3053
|
+
* sdk.setPinKeyboard(() => window.innerWidth < 768 ? 'native' : 'virtual');
|
|
3054
|
+
*/
|
|
3055
|
+
setPinKeyboard(e) {
|
|
3056
|
+
var r, t;
|
|
3057
|
+
this._config = Object.freeze({ ...this._config, pinKeyboard: e }), (t = (r = this.confirmation).setPinKeyboard) == null || t.call(r, e);
|
|
3058
|
+
}
|
|
3045
3059
|
/**
|
|
3046
3060
|
* 지갑 생성/로드 (로그인 후 address가 없는 경우)
|
|
3047
3061
|
* - exists: Enter Password → POST /mnemonic/addresses
|
|
@@ -3160,7 +3174,7 @@ const Te = class Te extends ys {
|
|
|
3160
3174
|
n.address
|
|
3161
3175
|
)
|
|
3162
3176
|
});
|
|
3163
|
-
return
|
|
3177
|
+
return Cs(i.signature), {
|
|
3164
3178
|
chainId: e,
|
|
3165
3179
|
signature: i.signature,
|
|
3166
3180
|
address: n.address
|
|
@@ -3238,7 +3252,7 @@ const Te = class Te extends ys {
|
|
|
3238
3252
|
a
|
|
3239
3253
|
)
|
|
3240
3254
|
});
|
|
3241
|
-
return
|
|
3255
|
+
return Os(o.signature), {
|
|
3242
3256
|
chainId: e,
|
|
3243
3257
|
signedTx: o.signature,
|
|
3244
3258
|
txHash: o.txHash ?? ""
|
|
@@ -3377,7 +3391,7 @@ const Te = class Te extends ys {
|
|
|
3377
3391
|
let g, _;
|
|
3378
3392
|
const x = this.waitForTxAndGetReceipt(a, e, { intervalMs: c, timeoutMs: l }).then((I) => {
|
|
3379
3393
|
g = I;
|
|
3380
|
-
const
|
|
3394
|
+
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);
|
|
3381
3395
|
return {
|
|
3382
3396
|
chainId: e,
|
|
3383
3397
|
txHash: a,
|
|
@@ -3725,6 +3739,10 @@ const Te = class Te extends ys {
|
|
|
3725
3739
|
d.warn("[walletChanged] invalid source — 이벤트 무시", t);
|
|
3726
3740
|
return;
|
|
3727
3741
|
}
|
|
3742
|
+
if (!this.authenticated) {
|
|
3743
|
+
d.warn("[walletChanged] not authenticated — 이벤트 무시", t);
|
|
3744
|
+
return;
|
|
3745
|
+
}
|
|
3728
3746
|
const i = typeof t.walletName == "string" ? t.walletName.trim() : "", o = i.length > 0 && i.length <= 64 ? i : void 0;
|
|
3729
3747
|
this.address && this.address.toLowerCase() === n.toLowerCase() || (d.log("[CROSSx] Native walletChanged 수신", { address: n, walletId: t.walletId, source: t.source, walletName: o }), this.setActiveWallet(n, 0, { walletName: o }), this._rnBridgeWalletAddress = n, this._rnBridgeWalletName = o);
|
|
3730
3748
|
}), d.log("[CROSSx] bridge.onEvent walletChanged 구독 완료");
|
|
@@ -4462,17 +4480,17 @@ function bn(s, e, r) {
|
|
|
4462
4480
|
const I = [];
|
|
4463
4481
|
for (; S < e; ) {
|
|
4464
4482
|
c = g();
|
|
4465
|
-
const
|
|
4466
|
-
I.push(
|
|
4483
|
+
const C = c.slice();
|
|
4484
|
+
I.push(C), S += c.length;
|
|
4467
4485
|
}
|
|
4468
4486
|
return Se(...I);
|
|
4469
4487
|
};
|
|
4470
4488
|
return (S, I) => {
|
|
4471
4489
|
p(), _(S);
|
|
4472
|
-
let
|
|
4473
|
-
for (; !(
|
|
4490
|
+
let C;
|
|
4491
|
+
for (; !(C = I(x())); )
|
|
4474
4492
|
_();
|
|
4475
|
-
return p(),
|
|
4493
|
+
return p(), C;
|
|
4476
4494
|
};
|
|
4477
4495
|
}
|
|
4478
4496
|
function Rt(s, e = {}, r = {}) {
|
|
@@ -4529,7 +4547,7 @@ function Nt(s, e, r) {
|
|
|
4529
4547
|
if (!s.eql(s.sqr(e), r))
|
|
4530
4548
|
throw new Error("Cannot find square root");
|
|
4531
4549
|
}
|
|
4532
|
-
function
|
|
4550
|
+
function Cr(s, e) {
|
|
4533
4551
|
const r = (s.ORDER + te) / Tr, t = s.pow(e, r);
|
|
4534
4552
|
return Nt(s, t, e), t;
|
|
4535
4553
|
}
|
|
@@ -4538,7 +4556,7 @@ function En(s, e) {
|
|
|
4538
4556
|
return Nt(s, a, e), a;
|
|
4539
4557
|
}
|
|
4540
4558
|
function An(s) {
|
|
4541
|
-
const e = rt(s), r =
|
|
4559
|
+
const e = rt(s), r = Or(s), t = r(e, e.neg(e.ONE)), n = r(e, t), i = r(e, e.neg(t)), o = (s + vn) / Nr;
|
|
4542
4560
|
return (a, c) => {
|
|
4543
4561
|
let l = a.pow(c, o), u = a.mul(l, t);
|
|
4544
4562
|
const p = a.mul(l, n), g = a.mul(l, i), _ = a.eql(a.sqr(u), c), x = a.eql(a.sqr(p), c);
|
|
@@ -4547,7 +4565,7 @@ function An(s) {
|
|
|
4547
4565
|
return Nt(a, S, c), S;
|
|
4548
4566
|
};
|
|
4549
4567
|
}
|
|
4550
|
-
function
|
|
4568
|
+
function Or(s) {
|
|
4551
4569
|
if (s < Ir)
|
|
4552
4570
|
throw new Error("sqrt is not defined for small field");
|
|
4553
4571
|
let e = s - te, r = 0;
|
|
@@ -4559,7 +4577,7 @@ function Cr(s) {
|
|
|
4559
4577
|
if (t++ > 1e3)
|
|
4560
4578
|
throw new Error("Cannot find square root: probably non-prime P");
|
|
4561
4579
|
if (r === 1)
|
|
4562
|
-
return
|
|
4580
|
+
return Cr;
|
|
4563
4581
|
let i = n.pow(t, e);
|
|
4564
4582
|
const o = (e + te) / ke;
|
|
4565
4583
|
return function(c, l) {
|
|
@@ -4582,7 +4600,7 @@ function Cr(s) {
|
|
|
4582
4600
|
};
|
|
4583
4601
|
}
|
|
4584
4602
|
function In(s) {
|
|
4585
|
-
return s % Tr === Ir ?
|
|
4603
|
+
return s % Tr === Ir ? Cr : s % Rr === kr ? En : s % Nr === Sn ? An(s) : Or(s);
|
|
4586
4604
|
}
|
|
4587
4605
|
const Tn = [
|
|
4588
4606
|
"create",
|
|
@@ -4638,7 +4656,7 @@ function Nn(s, e) {
|
|
|
4638
4656
|
const r = e !== void 0 ? e : s.toString(2).length, t = Math.ceil(r / 8);
|
|
4639
4657
|
return { nBitLength: r, nByteLength: t };
|
|
4640
4658
|
}
|
|
4641
|
-
class
|
|
4659
|
+
class Cn {
|
|
4642
4660
|
constructor(e, r = {}) {
|
|
4643
4661
|
P(this, "ORDER");
|
|
4644
4662
|
P(this, "BITS");
|
|
@@ -4751,7 +4769,7 @@ class On {
|
|
|
4751
4769
|
}
|
|
4752
4770
|
}
|
|
4753
4771
|
function rt(s, e = {}) {
|
|
4754
|
-
return new
|
|
4772
|
+
return new Cn(s, e);
|
|
4755
4773
|
}
|
|
4756
4774
|
function Lr(s) {
|
|
4757
4775
|
if (typeof s != "bigint")
|
|
@@ -4763,7 +4781,7 @@ function Dr(s) {
|
|
|
4763
4781
|
const e = Lr(s);
|
|
4764
4782
|
return e + Math.ceil(e / 2);
|
|
4765
4783
|
}
|
|
4766
|
-
function
|
|
4784
|
+
function On(s, e, r = !1) {
|
|
4767
4785
|
V(s);
|
|
4768
4786
|
const t = s.length, n = Lr(e), i = Dr(e);
|
|
4769
4787
|
if (t < 16 || t < i || t > 1024)
|
|
@@ -5114,18 +5132,18 @@ function Un(s, e = {}) {
|
|
|
5114
5132
|
throw new Error("compression is not supported: Field does not have .isOdd()");
|
|
5115
5133
|
}
|
|
5116
5134
|
function p(F, m, y) {
|
|
5117
|
-
const { x: k, y:
|
|
5135
|
+
const { x: k, y: O } = m.toAffine(), B = t.toBytes(k);
|
|
5118
5136
|
if (Xe(y, "isCompressed"), y) {
|
|
5119
5137
|
u();
|
|
5120
|
-
const b = !t.isOdd(
|
|
5138
|
+
const b = !t.isOdd(O);
|
|
5121
5139
|
return Se(Hr(b), B);
|
|
5122
5140
|
} else
|
|
5123
|
-
return Se(Uint8Array.of(4), B, t.toBytes(
|
|
5141
|
+
return Se(Uint8Array.of(4), B, t.toBytes(O));
|
|
5124
5142
|
}
|
|
5125
5143
|
function g(F) {
|
|
5126
5144
|
V(F, void 0, "Point");
|
|
5127
|
-
const { publicKey: m, publicKeyUncompressed: y } = l, k = F.length,
|
|
5128
|
-
if (k === m && (
|
|
5145
|
+
const { publicKey: m, publicKeyUncompressed: y } = l, k = F.length, O = F[0], B = F.subarray(1);
|
|
5146
|
+
if (k === m && (O === 2 || O === 3)) {
|
|
5129
5147
|
const b = t.fromBytes(B);
|
|
5130
5148
|
if (!t.isValid(b))
|
|
5131
5149
|
throw new Error("bad point: is not on curve, wrong x");
|
|
@@ -5139,8 +5157,8 @@ function Un(s, e = {}) {
|
|
|
5139
5157
|
}
|
|
5140
5158
|
u();
|
|
5141
5159
|
const T = t.isOdd(E);
|
|
5142
|
-
return (
|
|
5143
|
-
} else if (k === y &&
|
|
5160
|
+
return (O & 1) === 1 !== T && (E = t.neg(E)), { x: b, y: E };
|
|
5161
|
+
} else if (k === y && O === 4) {
|
|
5144
5162
|
const b = t.BYTES, v = t.fromBytes(B.subarray(0, b)), E = t.fromBytes(B.subarray(b, b * 2));
|
|
5145
5163
|
if (!S(v, E))
|
|
5146
5164
|
throw new Error("bad point: is not on curve");
|
|
@@ -5159,8 +5177,8 @@ function Un(s, e = {}) {
|
|
|
5159
5177
|
}
|
|
5160
5178
|
if (!S(i.Gx, i.Gy))
|
|
5161
5179
|
throw new Error("bad curve params: generator point");
|
|
5162
|
-
const I = t.mul(t.pow(i.a, ze), Fn),
|
|
5163
|
-
if (t.is0(t.add(I,
|
|
5180
|
+
const I = t.mul(t.pow(i.a, ze), Fn), C = t.mul(t.sqr(i.b), BigInt(27));
|
|
5181
|
+
if (t.is0(t.add(I, C)))
|
|
5164
5182
|
throw new Error("bad curve params: a or b");
|
|
5165
5183
|
function R(F, m, y = !1) {
|
|
5166
5184
|
if (!t.isValid(m) || y && t.is0(m))
|
|
@@ -5177,12 +5195,12 @@ function Un(s, e = {}) {
|
|
|
5177
5195
|
return Bn(F, c.basises, n.ORDER);
|
|
5178
5196
|
}
|
|
5179
5197
|
const q = Xt((F, m) => {
|
|
5180
|
-
const { X: y, Y: k, Z:
|
|
5181
|
-
if (t.eql(
|
|
5198
|
+
const { X: y, Y: k, Z: O } = F;
|
|
5199
|
+
if (t.eql(O, t.ONE))
|
|
5182
5200
|
return { x: y, y: k };
|
|
5183
5201
|
const B = F.is0();
|
|
5184
|
-
m == null && (m = B ? t.ONE : t.inv(
|
|
5185
|
-
const b = t.mul(y, m), v = t.mul(k, m), E = t.mul(
|
|
5202
|
+
m == null && (m = B ? t.ONE : t.inv(O));
|
|
5203
|
+
const b = t.mul(y, m), v = t.mul(k, m), E = t.mul(O, m);
|
|
5186
5204
|
if (B)
|
|
5187
5205
|
return { x: t.ZERO, y: t.ZERO };
|
|
5188
5206
|
if (!t.eql(E, t.ONE))
|
|
@@ -5203,8 +5221,8 @@ function Un(s, e = {}) {
|
|
|
5203
5221
|
throw new Error("bad point: not in prime-order subgroup");
|
|
5204
5222
|
return !0;
|
|
5205
5223
|
});
|
|
5206
|
-
function G(F, m, y, k,
|
|
5207
|
-
return y = new X(t.mul(y.X, F), y.Y, y.Z), m = Je(k, m), y = Je(
|
|
5224
|
+
function G(F, m, y, k, O) {
|
|
5225
|
+
return y = new X(t.mul(y.X, F), y.Y, y.Z), m = Je(k, m), y = Je(O, y), m.add(y);
|
|
5208
5226
|
}
|
|
5209
5227
|
const D = class D {
|
|
5210
5228
|
/** Does NOT validate if the point is valid. Use `.assertValidity()`. */
|
|
@@ -5262,7 +5280,7 @@ function Un(s, e = {}) {
|
|
|
5262
5280
|
/** Compare one point to another. */
|
|
5263
5281
|
equals(m) {
|
|
5264
5282
|
L(m);
|
|
5265
|
-
const { X: y, Y: k, Z:
|
|
5283
|
+
const { X: y, Y: k, Z: O } = this, { X: B, Y: b, Z: v } = m, E = t.eql(t.mul(y, v), t.mul(B, O)), T = t.eql(t.mul(k, v), t.mul(b, O));
|
|
5266
5284
|
return E && T;
|
|
5267
5285
|
}
|
|
5268
5286
|
/** Flips point to one corresponding to (x, -y) in Affine coordinates. */
|
|
@@ -5274,9 +5292,9 @@ function Un(s, e = {}) {
|
|
|
5274
5292
|
// https://eprint.iacr.org/2015/1060, algorithm 3
|
|
5275
5293
|
// Cost: 8M + 3S + 3*a + 2*b3 + 15add.
|
|
5276
5294
|
double() {
|
|
5277
|
-
const { a: m, b: y } = i, k = t.mul(y, ze), { X:
|
|
5278
|
-
let v = t.ZERO, E = t.ZERO, T = t.ZERO, N = t.mul(
|
|
5279
|
-
return $ = t.add($, $), T = t.mul(
|
|
5295
|
+
const { a: m, b: y } = i, k = t.mul(y, ze), { X: O, Y: B, Z: b } = this;
|
|
5296
|
+
let v = t.ZERO, E = t.ZERO, T = t.ZERO, N = t.mul(O, O), W = t.mul(B, B), U = t.mul(b, b), $ = t.mul(O, B);
|
|
5297
|
+
return $ = t.add($, $), T = t.mul(O, 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);
|
|
5280
5298
|
}
|
|
5281
5299
|
// Renes-Costello-Batina exception-free addition formula.
|
|
5282
5300
|
// There is 30% faster Jacobian formula, but it is not complete.
|
|
@@ -5284,13 +5302,13 @@ function Un(s, e = {}) {
|
|
|
5284
5302
|
// Cost: 12M + 0S + 3*a + 3*b3 + 23add.
|
|
5285
5303
|
add(m) {
|
|
5286
5304
|
L(m);
|
|
5287
|
-
const { X: y, Y: k, Z:
|
|
5305
|
+
const { X: y, Y: k, Z: O } = this, { X: B, Y: b, Z: v } = m;
|
|
5288
5306
|
let E = t.ZERO, T = t.ZERO, N = t.ZERO;
|
|
5289
5307
|
const W = i.a, U = t.mul(i.b, ze);
|
|
5290
|
-
let $ = t.mul(y, B), K = t.mul(k, b), Y = t.mul(
|
|
5291
|
-
ne = t.mul(ne, z), z = t.add($, K), ne = t.sub(ne, z), z = t.add(y,
|
|
5308
|
+
let $ = t.mul(y, B), K = t.mul(k, b), Y = t.mul(O, v), ne = t.add(y, k), z = t.add(B, b);
|
|
5309
|
+
ne = t.mul(ne, z), z = t.add($, K), ne = t.sub(ne, z), z = t.add(y, O);
|
|
5292
5310
|
let ee = t.add(B, v);
|
|
5293
|
-
return z = t.mul(z, ee), ee = t.add($, Y), z = t.sub(z, ee), ee = t.add(k,
|
|
5311
|
+
return z = t.mul(z, ee), ee = t.add($, Y), z = t.sub(z, ee), ee = t.add(k, O), 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);
|
|
5294
5312
|
}
|
|
5295
5313
|
subtract(m) {
|
|
5296
5314
|
return this.add(m.negate());
|
|
@@ -5311,16 +5329,16 @@ function Un(s, e = {}) {
|
|
|
5311
5329
|
const { endo: y } = e;
|
|
5312
5330
|
if (!n.isValidNot0(m))
|
|
5313
5331
|
throw new Error("invalid scalar: out of range");
|
|
5314
|
-
let k,
|
|
5332
|
+
let k, O;
|
|
5315
5333
|
const B = (b) => H.cached(this, b, (v) => Qt(D, v));
|
|
5316
5334
|
if (y) {
|
|
5317
5335
|
const { k1neg: b, k1: v, k2neg: E, k2: T } = M(m), { p: N, f: W } = B(v), { p: U, f: $ } = B(T);
|
|
5318
|
-
|
|
5336
|
+
O = W.add($), k = G(y.beta, N, U, b, E);
|
|
5319
5337
|
} else {
|
|
5320
5338
|
const { p: b, f: v } = B(m);
|
|
5321
|
-
k = b,
|
|
5339
|
+
k = b, O = v;
|
|
5322
5340
|
}
|
|
5323
|
-
return Qt(D, [k,
|
|
5341
|
+
return Qt(D, [k, O])[0];
|
|
5324
5342
|
}
|
|
5325
5343
|
/**
|
|
5326
5344
|
* Non-constant-time multiplication. Uses double-and-add algorithm.
|
|
@@ -5338,8 +5356,8 @@ function Un(s, e = {}) {
|
|
|
5338
5356
|
if (H.hasCache(this))
|
|
5339
5357
|
return this.multiply(m);
|
|
5340
5358
|
if (y) {
|
|
5341
|
-
const { k1neg:
|
|
5342
|
-
return G(y.beta, E, T,
|
|
5359
|
+
const { k1neg: O, k1: B, k2neg: b, k2: v } = M(m), { p1: E, p2: T } = Ln(D, k, B, v);
|
|
5360
|
+
return G(y.beta, E, T, O, b);
|
|
5343
5361
|
} else
|
|
5344
5362
|
return H.unsafe(k, m);
|
|
5345
5363
|
}
|
|
@@ -5417,7 +5435,7 @@ function Hn(s, e = {}) {
|
|
|
5417
5435
|
}
|
|
5418
5436
|
}
|
|
5419
5437
|
function a(_ = t(n.seed)) {
|
|
5420
|
-
return
|
|
5438
|
+
return On(V(_, n.seed, "seed"), r.ORDER);
|
|
5421
5439
|
}
|
|
5422
5440
|
function c(_, x = !0) {
|
|
5423
5441
|
return s.BASE.multiply(r.fromBytes(_)).toBytes(x);
|
|
@@ -5467,37 +5485,37 @@ function Wn(s, e, r = {}) {
|
|
|
5467
5485
|
throw new Error(`invalid signature ${m}: out of range 1..Point.Fn.ORDER`);
|
|
5468
5486
|
return y;
|
|
5469
5487
|
}
|
|
5470
|
-
function
|
|
5488
|
+
function C() {
|
|
5471
5489
|
if (w)
|
|
5472
5490
|
throw new Error('"recovered" sig type is not supported for cofactor >2 curves');
|
|
5473
5491
|
}
|
|
5474
5492
|
function R(m, y) {
|
|
5475
5493
|
mt(y);
|
|
5476
|
-
const k = _.signature,
|
|
5477
|
-
return V(m,
|
|
5494
|
+
const k = _.signature, O = y === "compact" ? k : y === "recovered" ? k + 1 : void 0;
|
|
5495
|
+
return V(m, O);
|
|
5478
5496
|
}
|
|
5479
5497
|
class L {
|
|
5480
|
-
constructor(y, k,
|
|
5498
|
+
constructor(y, k, O) {
|
|
5481
5499
|
P(this, "r");
|
|
5482
5500
|
P(this, "s");
|
|
5483
5501
|
P(this, "recovery");
|
|
5484
|
-
if (this.r = I("r", y), this.s = I("s", k),
|
|
5485
|
-
if (
|
|
5502
|
+
if (this.r = I("r", y), this.s = I("s", k), O != null) {
|
|
5503
|
+
if (C(), ![0, 1, 2, 3].includes(O))
|
|
5486
5504
|
throw new Error("invalid recovery id");
|
|
5487
|
-
this.recovery =
|
|
5505
|
+
this.recovery = O;
|
|
5488
5506
|
}
|
|
5489
5507
|
Object.freeze(this);
|
|
5490
5508
|
}
|
|
5491
5509
|
static fromBytes(y, k = x.format) {
|
|
5492
5510
|
R(y, k);
|
|
5493
|
-
let
|
|
5511
|
+
let O;
|
|
5494
5512
|
if (k === "der") {
|
|
5495
5513
|
const { r: E, s: T } = ve.toSig(V(y));
|
|
5496
5514
|
return new L(E, T);
|
|
5497
5515
|
}
|
|
5498
|
-
k === "recovered" && (
|
|
5516
|
+
k === "recovered" && (O = y[0], k = "compact", y = y.subarray(1));
|
|
5499
5517
|
const B = _.signature / 2, b = y.subarray(0, B), v = y.subarray(B, B * 2);
|
|
5500
|
-
return new L(o.fromBytes(b), o.fromBytes(v),
|
|
5518
|
+
return new L(o.fromBytes(b), o.fromBytes(v), O);
|
|
5501
5519
|
}
|
|
5502
5520
|
static fromHex(y, k) {
|
|
5503
5521
|
return this.fromBytes(Ye(y), k);
|
|
@@ -5512,10 +5530,10 @@ function Wn(s, e, r = {}) {
|
|
|
5512
5530
|
return new L(this.r, this.s, y);
|
|
5513
5531
|
}
|
|
5514
5532
|
recoverPublicKey(y) {
|
|
5515
|
-
const { r: k, s:
|
|
5533
|
+
const { r: k, s: O } = this, B = this.assertRecovery(), b = B === 2 || B === 3 ? k + a : k;
|
|
5516
5534
|
if (!i.isValid(b))
|
|
5517
5535
|
throw new Error("invalid recovery id: sig.r+curve.n != R.x");
|
|
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(
|
|
5536
|
+
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(O * T), $ = s.BASE.multiplyUnsafe(W).add(E.multiplyUnsafe(U));
|
|
5519
5537
|
if ($.is0())
|
|
5520
5538
|
throw new Error("invalid recovery: point at infinify");
|
|
5521
5539
|
return $.assertValidity(), $;
|
|
@@ -5527,8 +5545,8 @@ function Wn(s, e, r = {}) {
|
|
|
5527
5545
|
toBytes(y = x.format) {
|
|
5528
5546
|
if (mt(y), y === "der")
|
|
5529
5547
|
return Ye(ve.hexFromSig(this));
|
|
5530
|
-
const { r: k, s:
|
|
5531
|
-
return y === "recovered" ? (
|
|
5548
|
+
const { r: k, s: O } = this, B = o.toBytes(k), b = o.toBytes(O);
|
|
5549
|
+
return y === "recovered" ? (C(), Se(Uint8Array.of(this.assertRecovery()), B, b)) : Se(B, b);
|
|
5532
5550
|
}
|
|
5533
5551
|
toHex(y) {
|
|
5534
5552
|
return We(this.toBytes(y));
|
|
@@ -5537,8 +5555,8 @@ function Wn(s, e, r = {}) {
|
|
|
5537
5555
|
const M = r.bits2int || function(y) {
|
|
5538
5556
|
if (y.length > 8192)
|
|
5539
5557
|
throw new Error("input is too large");
|
|
5540
|
-
const k = tt(y),
|
|
5541
|
-
return
|
|
5558
|
+
const k = tt(y), O = y.length * 8 - c;
|
|
5559
|
+
return O > 0 ? k >> BigInt(O) : k;
|
|
5542
5560
|
}, q = r.bits2int_modN || function(y) {
|
|
5543
5561
|
return o.create(M(y));
|
|
5544
5562
|
}, J = kt(c);
|
|
@@ -5549,7 +5567,7 @@ function Wn(s, e, r = {}) {
|
|
|
5549
5567
|
return V(m, void 0, "message"), y ? V(e(m), void 0, "prehashed message") : m;
|
|
5550
5568
|
}
|
|
5551
5569
|
function Q(m, y, k) {
|
|
5552
|
-
const { lowS:
|
|
5570
|
+
const { lowS: O, prehash: B, extraEntropy: b } = ut(k, x);
|
|
5553
5571
|
m = X(m, B);
|
|
5554
5572
|
const v = q(m), E = o.fromBytes(y);
|
|
5555
5573
|
if (!o.isValidNot0(E))
|
|
@@ -5571,16 +5589,16 @@ function Wn(s, e, r = {}) {
|
|
|
5571
5589
|
if (ee === ge)
|
|
5572
5590
|
return;
|
|
5573
5591
|
let Lt = (ne.x === z ? 0 : 2) | Number(ne.y & Le), Dt = ee;
|
|
5574
|
-
return
|
|
5592
|
+
return O && S(ee) && (Dt = o.neg(ee), Lt ^= 1), new L(z, Dt, w ? void 0 : Lt);
|
|
5575
5593
|
}
|
|
5576
5594
|
return { seed: N, k2sig: U };
|
|
5577
5595
|
}
|
|
5578
5596
|
function H(m, y, k = {}) {
|
|
5579
|
-
const { seed:
|
|
5580
|
-
return bn(e.outputLen, o.BYTES, n)(
|
|
5597
|
+
const { seed: O, k2sig: B } = Q(m, y, k);
|
|
5598
|
+
return bn(e.outputLen, o.BYTES, n)(O, B).toBytes(k.format);
|
|
5581
5599
|
}
|
|
5582
|
-
function D(m, y, k,
|
|
5583
|
-
const { lowS: B, prehash: b, format: v } = ut(
|
|
5600
|
+
function D(m, y, k, O = {}) {
|
|
5601
|
+
const { lowS: B, prehash: b, format: v } = ut(O, x);
|
|
5584
5602
|
if (k = V(k, void 0, "publicKey"), y = X(y, b), !At(m)) {
|
|
5585
5603
|
const E = m instanceof L ? ", use sig.toBytes()" : "";
|
|
5586
5604
|
throw new Error("verify expects Uint8Array signature" + E);
|
|
@@ -5597,8 +5615,8 @@ function Wn(s, e, r = {}) {
|
|
|
5597
5615
|
}
|
|
5598
5616
|
}
|
|
5599
5617
|
function F(m, y, k = {}) {
|
|
5600
|
-
const { prehash:
|
|
5601
|
-
return y = X(y,
|
|
5618
|
+
const { prehash: O } = ut(k, x);
|
|
5619
|
+
return y = X(y, O), L.fromBytes(m, "recovered").recoverPublicKey(y).toBytes();
|
|
5602
5620
|
}
|
|
5603
5621
|
return Object.freeze({
|
|
5604
5622
|
keygen: l,
|
|
@@ -5615,7 +5633,7 @@ function Wn(s, e, r = {}) {
|
|
|
5615
5633
|
});
|
|
5616
5634
|
}
|
|
5617
5635
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
5618
|
-
const
|
|
5636
|
+
const Ct = {
|
|
5619
5637
|
p: BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),
|
|
5620
5638
|
n: BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),
|
|
5621
5639
|
h: BigInt(1),
|
|
@@ -5631,12 +5649,12 @@ const Ot = {
|
|
|
5631
5649
|
]
|
|
5632
5650
|
}, nr = /* @__PURE__ */ BigInt(2);
|
|
5633
5651
|
function qn(s) {
|
|
5634
|
-
const e =
|
|
5652
|
+
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);
|
|
5635
5653
|
if (!yt.eql(yt.sqr(q), s))
|
|
5636
5654
|
throw new Error("Cannot find square root");
|
|
5637
5655
|
return q;
|
|
5638
5656
|
}
|
|
5639
|
-
const yt = rt(
|
|
5657
|
+
const yt = rt(Ct.p, { sqrt: qn }), Kn = /* @__PURE__ */ Un(Ct, {
|
|
5640
5658
|
Fp: yt,
|
|
5641
5659
|
endo: Gn
|
|
5642
5660
|
}), 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 = [];
|
|
@@ -5673,7 +5691,7 @@ function ei(s, e = 24) {
|
|
|
5673
5691
|
}
|
|
5674
5692
|
$e(r);
|
|
5675
5693
|
}
|
|
5676
|
-
class
|
|
5694
|
+
class Ot {
|
|
5677
5695
|
// NOTE: we accept arguments in bytes instead of bits here.
|
|
5678
5696
|
constructor(e, r, t, n = !1, i = 24) {
|
|
5679
5697
|
P(this, "state");
|
|
@@ -5746,10 +5764,10 @@ class Ct {
|
|
|
5746
5764
|
}
|
|
5747
5765
|
_cloneInto(e) {
|
|
5748
5766
|
const { blockLen: r, suffix: t, outputLen: n, rounds: i, enableXOF: o } = this;
|
|
5749
|
-
return e || (e = new
|
|
5767
|
+
return e || (e = new Ot(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;
|
|
5750
5768
|
}
|
|
5751
5769
|
}
|
|
5752
|
-
const ti = (s, e, r, t = {}) => yr(() => new
|
|
5770
|
+
const ti = (s, e, r, t = {}) => yr(() => new Ot(e, s, r), t), ar = /* @__PURE__ */ ti(1, 136, 32), ri = 60;
|
|
5753
5771
|
class si {
|
|
5754
5772
|
constructor() {
|
|
5755
5773
|
this.jwks = null;
|
|
@@ -5969,7 +5987,7 @@ class Ae {
|
|
|
5969
5987
|
d.warn("[CROSSx] OAuth 타임아웃 (5분) — postMessage를 수신하지 못했습니다"), L(), t(new Error("Authentication timeout"));
|
|
5970
5988
|
}, 5 * 60 * 1e3), x = 10, w = 30;
|
|
5971
5989
|
let S = 0, I = null;
|
|
5972
|
-
const
|
|
5990
|
+
const C = () => {
|
|
5973
5991
|
clearInterval(R), d.warn("[CROSSx] COOP 감지 — OAuth 서버 응답을 " + w + "초간 대기합니다"), I = setTimeout(() => {
|
|
5974
5992
|
L(), t(new Error(
|
|
5975
5993
|
"OAuth 서버로부터 응답을 받지 못했습니다. 브라우저 보안 정책(COOP)으로 인해 팝업 통신이 차단되었을 수 있습니다. 다시 시도해 주세요."
|
|
@@ -5978,9 +5996,9 @@ class Ae {
|
|
|
5978
5996
|
}, R = setInterval(() => {
|
|
5979
5997
|
S++;
|
|
5980
5998
|
try {
|
|
5981
|
-
g.closed && (S <= x ?
|
|
5999
|
+
g.closed && (S <= x ? C() : (L(), t(new Error("로그인이 취소되었습니다"))));
|
|
5982
6000
|
} catch {
|
|
5983
|
-
|
|
6001
|
+
C();
|
|
5984
6002
|
}
|
|
5985
6003
|
}, 1e3), L = () => {
|
|
5986
6004
|
clearTimeout(_), clearInterval(R), I && clearTimeout(I), window.removeEventListener("message", M);
|
|
@@ -6019,8 +6037,8 @@ class Ae {
|
|
|
6019
6037
|
return;
|
|
6020
6038
|
}
|
|
6021
6039
|
const m = { token: D, email: F }, y = (k) => {
|
|
6022
|
-
Ae.verifyIdTokenNonce(k, l).then(() => r(m)).catch((
|
|
6023
|
-
d.error("[CROSSx] nonce 검증 실패:",
|
|
6040
|
+
Ae.verifyIdTokenNonce(k, l).then(() => r(m)).catch((O) => {
|
|
6041
|
+
d.error("[CROSSx] nonce 검증 실패:", O), t(O instanceof Error ? O : new Error("nonce verification failed"));
|
|
6024
6042
|
});
|
|
6025
6043
|
};
|
|
6026
6044
|
H ? H.split(".").length === 3 ? y(H) : Q ? y(Q) : (d.warn(
|
|
@@ -6266,9 +6284,9 @@ class Ie {
|
|
|
6266
6284
|
h.USER_NOT_FOUND,
|
|
6267
6285
|
Ie.getGatewayErrorMessage(_.code, x)
|
|
6268
6286
|
);
|
|
6269
|
-
const S = w === h.AUTH_NOT_AUTHENTICATED ? h.SESSION_EXPIRED : w, I = S === h.SESSION_EXPIRED ? "인증 세션이 만료되었습니다. 다시 로그인해 주세요." : Ie.getGatewayErrorMessage(_.code, x),
|
|
6287
|
+
const S = w === h.AUTH_NOT_AUTHENTICATED ? h.SESSION_EXPIRED : w, I = S === h.SESSION_EXPIRED ? "인증 세션이 만료되었습니다. 다시 로그인해 주세요." : Ie.getGatewayErrorMessage(_.code, x), C = _.data;
|
|
6270
6288
|
let R;
|
|
6271
|
-
throw w === h.PIN_LOCKED ? R = Ie.extractLockDetails(
|
|
6289
|
+
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);
|
|
6272
6290
|
}
|
|
6273
6291
|
return d.log("[CROSSx] Wallet Gateway API 성공:", { code: _.code, url: o, method: e }), _.data ?? _;
|
|
6274
6292
|
}
|
|
@@ -8525,6 +8543,10 @@ button.__crossx-connect-other-block:active {
|
|
|
8525
8543
|
.__crossx-pin6-numpad { display: flex !important; }
|
|
8526
8544
|
.__crossx-card--pin6 .__crossx-pin6-box { display: none !important; }
|
|
8527
8545
|
.__crossx-card--pin6 .__crossx-pin6-dots { display: flex !important; }
|
|
8546
|
+
/* PIN 키보드 모드: 'native' — OS 기본 숫자 키보드 사용 (numpad 숨기고 input box 노출) */
|
|
8547
|
+
.__crossx-card--pin6.--native-keypad .__crossx-pin6-numpad { display: none !important; }
|
|
8548
|
+
.__crossx-card--pin6.--native-keypad .__crossx-pin6-box { display: inline-block !important; }
|
|
8549
|
+
.__crossx-card--pin6.--native-keypad .__crossx-pin6-dots { display: none !important; }
|
|
8528
8550
|
.__crossx-home-indicator { display: flex; }
|
|
8529
8551
|
}
|
|
8530
8552
|
@keyframes __crossx-slide-up-mobile {
|
|
@@ -9151,7 +9173,7 @@ function _i(s) {
|
|
|
9151
9173
|
}, { passive: !0 });
|
|
9152
9174
|
}
|
|
9153
9175
|
const fi = () => /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
|
|
9154
|
-
function
|
|
9176
|
+
function Ce() {
|
|
9155
9177
|
if (fi()) {
|
|
9156
9178
|
const e = window.scrollY;
|
|
9157
9179
|
return document.body.style.position = "fixed", document.body.style.top = `-${e}px`, document.body.style.left = "0", document.body.style.right = "0", () => {
|
|
@@ -9429,7 +9451,7 @@ function Ri(s) {
|
|
|
9429
9451
|
function Ni(s) {
|
|
9430
9452
|
return `https://www.crossscan.io/address/${s}?tab=txs`;
|
|
9431
9453
|
}
|
|
9432
|
-
function
|
|
9454
|
+
function Ci(s, e) {
|
|
9433
9455
|
return `https://explorer.crosstoken.io/${Ri(s)}/tx/${e}`;
|
|
9434
9456
|
}
|
|
9435
9457
|
function Jr(s, e) {
|
|
@@ -9439,9 +9461,9 @@ function Ze(s) {
|
|
|
9439
9461
|
return Jr(de(s), Ni(s));
|
|
9440
9462
|
}
|
|
9441
9463
|
function Zr(s, e) {
|
|
9442
|
-
return Jr(de(e),
|
|
9464
|
+
return Jr(de(e), Ci(s, e));
|
|
9443
9465
|
}
|
|
9444
|
-
function
|
|
9466
|
+
function Oi(s, e, r) {
|
|
9445
9467
|
const t = j(
|
|
9446
9468
|
(r == null ? void 0 : r.label_from) ?? "From",
|
|
9447
9469
|
`${Ze(s.from)}
|
|
@@ -9521,10 +9543,10 @@ function Li(s, e, r, t) {
|
|
|
9521
9543
|
<button class="__crossx-approve-btn" id="__crossx-done-btn">${A((t == null ? void 0 : t.tx_complete_done_button) ?? (n ? "All Done" : "Done"))}</button>
|
|
9522
9544
|
`, c.querySelectorAll(".__crossx-copy-btn").forEach((w) => {
|
|
9523
9545
|
w.addEventListener("click", (S) => {
|
|
9524
|
-
var
|
|
9546
|
+
var C;
|
|
9525
9547
|
S.stopPropagation();
|
|
9526
9548
|
const I = w.dataset.copy;
|
|
9527
|
-
I && ((
|
|
9549
|
+
I && ((C = navigator.clipboard) == null || C.writeText(I).catch(() => {
|
|
9528
9550
|
}));
|
|
9529
9551
|
});
|
|
9530
9552
|
});
|
|
@@ -9963,7 +9985,7 @@ function to(s) {
|
|
|
9963
9985
|
return r > 0 ? `${r}h ${String(t).padStart(2, "0")}m` : `${String(t).padStart(2, "0")}:${String(n).padStart(2, "0")}`;
|
|
9964
9986
|
}
|
|
9965
9987
|
function _t(s, e, r, t, n, i, o) {
|
|
9966
|
-
var
|
|
9988
|
+
var O, B;
|
|
9967
9989
|
let a = !!(i && i > Date.now()), c = !1;
|
|
9968
9990
|
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 = () => {
|
|
9969
9991
|
var E;
|
|
@@ -9975,7 +9997,7 @@ function _t(s, e, r, t, n, i, o) {
|
|
|
9975
9997
|
const T = b.findIndex((W) => !W.value);
|
|
9976
9998
|
(E = v[T === -1 ? 5 : T]) == null || E.classList.add("--active");
|
|
9977
9999
|
}
|
|
9978
|
-
},
|
|
10000
|
+
}, C = () => {
|
|
9979
10001
|
s.querySelectorAll(".__crossx-pin6-numpad-key[data-key]").forEach((v) => v.classList.toggle("--disabled", a)), S().forEach((v) => v.classList.toggle("--locked", a)), I();
|
|
9980
10002
|
}, R = (b) => {
|
|
9981
10003
|
a = b, l().forEach((v) => {
|
|
@@ -10022,7 +10044,7 @@ function _t(s, e, r, t, n, i, o) {
|
|
|
10022
10044
|
var W;
|
|
10023
10045
|
R(!0), l().forEach((U) => {
|
|
10024
10046
|
U.value = "";
|
|
10025
|
-
}),
|
|
10047
|
+
}), C();
|
|
10026
10048
|
const v = p();
|
|
10027
10049
|
if (v && (v.textContent = "Too many failed attempts. Please wait."), !g()) {
|
|
10028
10050
|
const U = document.createElement("p");
|
|
@@ -10033,7 +10055,7 @@ function _t(s, e, r, t, n, i, o) {
|
|
|
10033
10055
|
const E = () => {
|
|
10034
10056
|
var K;
|
|
10035
10057
|
const U = b - Date.now(), $ = _();
|
|
10036
|
-
U <= 0 ? (clearInterval(T), R(!1), (K = g()) == null || K.remove(), v && (v.textContent = ""),
|
|
10058
|
+
U <= 0 ? (clearInterval(T), R(!1), (K = g()) == null || K.remove(), v && (v.textContent = ""), C(), setTimeout(() => {
|
|
10037
10059
|
var Y;
|
|
10038
10060
|
return (Y = l()[0]) == null ? void 0 : Y.focus();
|
|
10039
10061
|
}, 50)) : $ && ($.textContent = ` ${to(U)}`);
|
|
@@ -10074,7 +10096,7 @@ function _t(s, e, r, t, n, i, o) {
|
|
|
10074
10096
|
const b = l(), v = b.find((E) => !E.value) ?? b[b.length - 1];
|
|
10075
10097
|
v == null || v.focus();
|
|
10076
10098
|
};
|
|
10077
|
-
(
|
|
10099
|
+
(O = u()) == null || O.addEventListener("click", (b) => {
|
|
10078
10100
|
b.target.classList.contains("__crossx-pin6-box") || y();
|
|
10079
10101
|
}), (B = x()) == null || B.addEventListener("click", (b) => {
|
|
10080
10102
|
const v = b.target;
|
|
@@ -10134,7 +10156,7 @@ function _t(s, e, r, t, n, i, o) {
|
|
|
10134
10156
|
v();
|
|
10135
10157
|
const W = N.getBoundingClientRect();
|
|
10136
10158
|
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() &&
|
|
10159
|
+
}), k.addEventListener("pointercancel", v), k.addEventListener("pointerleave", v, !0), I(), i && i > Date.now() && C();
|
|
10138
10160
|
}
|
|
10139
10161
|
}
|
|
10140
10162
|
const ro = `<svg width="22" height="17" viewBox="0 0 22 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -10182,8 +10204,25 @@ function io(s, e, r) {
|
|
|
10182
10204
|
}), (i = t[0]) == null || i.focus();
|
|
10183
10205
|
}
|
|
10184
10206
|
class oo {
|
|
10185
|
-
constructor(e = "light", r, t = Et) {
|
|
10186
|
-
this.theme = e, this.overrides = r, this.tokens = dr(e, r), this.displayDecimals = t;
|
|
10207
|
+
constructor(e = "light", r, t = Et, n) {
|
|
10208
|
+
this.theme = e, this.overrides = r, this.tokens = dr(e, r), this.displayDecimals = t, this.pinKeyboard = n;
|
|
10209
|
+
}
|
|
10210
|
+
setPinKeyboard(e) {
|
|
10211
|
+
this.pinKeyboard = e;
|
|
10212
|
+
}
|
|
10213
|
+
resolvePinKeyboardMode() {
|
|
10214
|
+
const e = this.pinKeyboard;
|
|
10215
|
+
if (typeof e == "function")
|
|
10216
|
+
try {
|
|
10217
|
+
return e() === "native" ? "native" : "virtual";
|
|
10218
|
+
} catch {
|
|
10219
|
+
return "virtual";
|
|
10220
|
+
}
|
|
10221
|
+
return e === "native" ? "native" : "virtual";
|
|
10222
|
+
}
|
|
10223
|
+
/** 카드 element에 PIN 키보드 모드 클래스를 적용한다(`.--native-keypad`). */
|
|
10224
|
+
applyPinKeyboardMode(e) {
|
|
10225
|
+
e && e.classList.toggle("--native-keypad", this.resolvePinKeyboardMode() === "native");
|
|
10187
10226
|
}
|
|
10188
10227
|
setTheme(e, r) {
|
|
10189
10228
|
this.theme = e, r !== void 0 && (this.overrides = r), this.tokens = dr(e, this.overrides);
|
|
@@ -10207,9 +10246,9 @@ class oo {
|
|
|
10207
10246
|
*/
|
|
10208
10247
|
showWalletSelector(e, r, t) {
|
|
10209
10248
|
return new Promise((n, i) => {
|
|
10210
|
-
var
|
|
10249
|
+
var C;
|
|
10211
10250
|
ae();
|
|
10212
|
-
const o = [...e], a = Wi(o, this.tokens, t, this.messages), c =
|
|
10251
|
+
const o = [...e], a = Wi(o, this.tokens, t, this.messages), c = Ce();
|
|
10213
10252
|
ce(a);
|
|
10214
10253
|
let l = !1;
|
|
10215
10254
|
const u = () => {
|
|
@@ -10249,7 +10288,7 @@ class oo {
|
|
|
10249
10288
|
const L = R instanceof f && R.code === h.ADDRESS_LIMIT_EXCEEDED, M = this.resolveAddWalletErrorMessage(R);
|
|
10250
10289
|
w && (w.textContent = M, w.hidden = !1), L ? (S.disabled = !0, S.setAttribute("aria-disabled", "true")) : S.disabled = !1, p = R;
|
|
10251
10290
|
}
|
|
10252
|
-
}), (
|
|
10291
|
+
}), (C = a.querySelector("#__crossx-close-btn")) == null || C.addEventListener("click", _), a.addEventListener("click", (R) => {
|
|
10253
10292
|
R.target === a && _();
|
|
10254
10293
|
});
|
|
10255
10294
|
const I = (R) => {
|
|
@@ -10286,7 +10325,7 @@ class oo {
|
|
|
10286
10325
|
return new Promise((n) => {
|
|
10287
10326
|
var g, _, x, w;
|
|
10288
10327
|
ae();
|
|
10289
|
-
const i = zi(this.tokens, r, this.messages), o =
|
|
10328
|
+
const i = zi(this.tokens, r, this.messages), o = Ce();
|
|
10290
10329
|
ce(i);
|
|
10291
10330
|
const a = () => {
|
|
10292
10331
|
i.remove(), o();
|
|
@@ -10298,8 +10337,8 @@ class oo {
|
|
|
10298
10337
|
a(), n(null);
|
|
10299
10338
|
};
|
|
10300
10339
|
(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) => {
|
|
10301
|
-
const
|
|
10302
|
-
|
|
10340
|
+
const C = S.currentTarget.dataset.walletId ?? "";
|
|
10341
|
+
C && l(C);
|
|
10303
10342
|
}), (w = i.querySelector("#__crossx-close-btn")) == null || w.addEventListener("click", u), i.addEventListener("click", (S) => {
|
|
10304
10343
|
S.target === i && u();
|
|
10305
10344
|
}), i.querySelectorAll(".__crossx-login-terms-link").forEach((S) => {
|
|
@@ -10322,7 +10361,7 @@ class oo {
|
|
|
10322
10361
|
accountLabel: (t == null ? void 0 : t.session_alert_account_label) ?? "Account",
|
|
10323
10362
|
signOutLabel: (t == null ? void 0 : t.session_alert_sign_out_button) ?? "Sign out",
|
|
10324
10363
|
signInAgainLabel: (t == null ? void 0 : t.session_alert_sign_in_again_button) ?? "Sign in again"
|
|
10325
|
-
}), i =
|
|
10364
|
+
}), i = Ce();
|
|
10326
10365
|
ce(n);
|
|
10327
10366
|
let o = !1;
|
|
10328
10367
|
const a = () => {
|
|
@@ -10391,13 +10430,13 @@ class oo {
|
|
|
10391
10430
|
}, o = {
|
|
10392
10431
|
title: (t == null ? void 0 : t.pin_setup_confirm_title) ?? "Confirm PIN",
|
|
10393
10432
|
headerSubtitle: (t == null ? void 0 : t.pin_setup_confirm_subtitle) ?? "Enter your PIN again to confirm."
|
|
10394
|
-
}, a = hr(this.tokens, Qi(n)), c =
|
|
10433
|
+
}, a = hr(this.tokens, Qi(n)), c = Ce();
|
|
10395
10434
|
ce(a);
|
|
10396
10435
|
let l = !1;
|
|
10397
10436
|
const u = () => {
|
|
10398
10437
|
l || (l = !0, a.remove(), c());
|
|
10399
|
-
}, p = (
|
|
10400
|
-
u(), r(
|
|
10438
|
+
}, p = (C) => {
|
|
10439
|
+
u(), r(C);
|
|
10401
10440
|
}, g = () => {
|
|
10402
10441
|
u(), r(null);
|
|
10403
10442
|
}, _ = a.querySelector(".__crossx-card"), x = {
|
|
@@ -10406,32 +10445,32 @@ class oo {
|
|
|
10406
10445
|
repeatingDigit: (t == null ? void 0 : t.pin_validation_repeating_digit) ?? "Cannot use the same number 3+ times in a row.",
|
|
10407
10446
|
sequential: (t == null ? void 0 : t.pin_validation_sequential) ?? "Sequential numbers (e.g., 123456) are not allowed.",
|
|
10408
10447
|
alternatingPattern: (t == null ? void 0 : t.pin_validation_alternating_pattern) ?? "Repeating patterns (e.g., 121212) are not allowed."
|
|
10409
|
-
}, w = (
|
|
10448
|
+
}, w = (C) => {
|
|
10410
10449
|
var R;
|
|
10411
10450
|
_.innerHTML = pt({
|
|
10412
10451
|
title: o.title,
|
|
10413
10452
|
headerSubtitle: o.headerSubtitle
|
|
10414
|
-
}), (R = _.querySelector("#__crossx-close-btn")) == null || R.addEventListener("click", g), _t(_, (L) => {
|
|
10415
|
-
L ===
|
|
10453
|
+
}), this.applyPinKeyboardMode(_), (R = _.querySelector("#__crossx-close-btn")) == null || R.addEventListener("click", g), _t(_, (L) => {
|
|
10454
|
+
L === C ? p(C) : S(i.mismatchError);
|
|
10416
10455
|
}, g);
|
|
10417
|
-
}, S = (
|
|
10456
|
+
}, S = (C) => {
|
|
10418
10457
|
var R;
|
|
10419
10458
|
_.innerHTML = pt({
|
|
10420
10459
|
title: i.title,
|
|
10421
10460
|
headerSubtitle: i.headerSubtitle,
|
|
10422
10461
|
subtitle: i.subtitle,
|
|
10423
|
-
errorMessage:
|
|
10424
|
-
}), (R = _.querySelector("#__crossx-close-btn")) == null || R.addEventListener("click", g), _t(_, (L) => {
|
|
10462
|
+
errorMessage: C
|
|
10463
|
+
}), this.applyPinKeyboardMode(_), (R = _.querySelector("#__crossx-close-btn")) == null || R.addEventListener("click", g), _t(_, (L) => {
|
|
10425
10464
|
const M = eo(L, x);
|
|
10426
10465
|
M ? S(M) : w(L);
|
|
10427
10466
|
}, g);
|
|
10428
10467
|
};
|
|
10429
10468
|
(() => {
|
|
10430
10469
|
var Q;
|
|
10431
|
-
const
|
|
10470
|
+
const C = Array.from(_.querySelectorAll(".__crossx-pw-notice-item")), R = _.querySelector("#__crossx-pin-notice-next"), L = /* @__PURE__ */ new Set();
|
|
10432
10471
|
R.removeAttribute("disabled");
|
|
10433
10472
|
const M = R.dataset.nextLabel ?? "Next", q = R.dataset.submitLabel ?? "I Understand", J = () => {
|
|
10434
|
-
const H = L.size ===
|
|
10473
|
+
const H = L.size === C.length;
|
|
10435
10474
|
R.classList.toggle("--disabled", !H), R.textContent = H ? q : M;
|
|
10436
10475
|
}, G = (H, D) => {
|
|
10437
10476
|
if (L.has(D)) return;
|
|
@@ -10442,7 +10481,7 @@ class oo {
|
|
|
10442
10481
|
const F = H.querySelector(`#__crossx-notice-check-${D}`);
|
|
10443
10482
|
L.delete(D), F.classList.remove("--checked"), H.setAttribute("aria-checked", "false"), J();
|
|
10444
10483
|
};
|
|
10445
|
-
|
|
10484
|
+
C.forEach((H) => {
|
|
10446
10485
|
const D = parseInt(H.dataset.checkIndex ?? "0", 10);
|
|
10447
10486
|
H.addEventListener("click", () => {
|
|
10448
10487
|
L.has(D) ? X(H, D) : G(H, D);
|
|
@@ -10450,11 +10489,11 @@ class oo {
|
|
|
10450
10489
|
(F.key === " " || F.key === "Enter") && (F.preventDefault(), L.has(D) ? X(H, D) : G(H, D));
|
|
10451
10490
|
});
|
|
10452
10491
|
}), R.addEventListener("click", () => {
|
|
10453
|
-
if (L.size ===
|
|
10492
|
+
if (L.size === C.length) {
|
|
10454
10493
|
S(e == null ? void 0 : e.errorMessage);
|
|
10455
10494
|
return;
|
|
10456
10495
|
}
|
|
10457
|
-
const H =
|
|
10496
|
+
const H = C.find((F) => {
|
|
10458
10497
|
const m = parseInt(F.dataset.checkIndex ?? "0", 10);
|
|
10459
10498
|
return !L.has(m);
|
|
10460
10499
|
});
|
|
@@ -10464,8 +10503,8 @@ class oo {
|
|
|
10464
10503
|
H.classList.remove("--highlight"), G(H, D);
|
|
10465
10504
|
}, 400);
|
|
10466
10505
|
}), (Q = _.querySelector("#__crossx-close-btn")) == null || Q.addEventListener("click", g);
|
|
10467
|
-
})(), a.addEventListener("click", (
|
|
10468
|
-
|
|
10506
|
+
})(), a.addEventListener("click", (C) => {
|
|
10507
|
+
C.target === a && g();
|
|
10469
10508
|
});
|
|
10470
10509
|
});
|
|
10471
10510
|
}
|
|
@@ -10489,20 +10528,20 @@ class oo {
|
|
|
10489
10528
|
attemptCount: e == null ? void 0 : e.attemptCount,
|
|
10490
10529
|
maxAttempts: e == null ? void 0 : e.maxAttempts
|
|
10491
10530
|
})
|
|
10492
|
-
), u =
|
|
10531
|
+
), u = Ce();
|
|
10493
10532
|
ce(l);
|
|
10494
10533
|
let p = !1;
|
|
10495
10534
|
const g = () => {
|
|
10496
10535
|
p || (p = !0, l.remove(), u());
|
|
10497
|
-
}, _ = (
|
|
10498
|
-
g(), r(
|
|
10536
|
+
}, _ = (C) => {
|
|
10537
|
+
g(), r(C);
|
|
10499
10538
|
}, x = () => {
|
|
10500
10539
|
g(), r(null);
|
|
10501
|
-
}, w = (
|
|
10502
|
-
g(), t(
|
|
10540
|
+
}, w = (C) => {
|
|
10541
|
+
g(), t(C);
|
|
10503
10542
|
}, S = l.querySelector(".__crossx-card");
|
|
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", (
|
|
10505
|
-
|
|
10543
|
+
this.applyPinKeyboardMode(S), (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) => {
|
|
10544
|
+
C.target === l && x();
|
|
10506
10545
|
});
|
|
10507
10546
|
});
|
|
10508
10547
|
}
|
|
@@ -10515,17 +10554,17 @@ class oo {
|
|
|
10515
10554
|
*/
|
|
10516
10555
|
showRecoveryPinInputPrompt(e) {
|
|
10517
10556
|
return new Promise((r) => {
|
|
10518
|
-
var
|
|
10557
|
+
var c;
|
|
10519
10558
|
ae();
|
|
10520
10559
|
const t = Xi(this.tokens, e);
|
|
10521
10560
|
ce(t);
|
|
10522
|
-
const n = () => t.remove(), i = (
|
|
10523
|
-
n(), r(
|
|
10561
|
+
const n = () => t.remove(), i = (l) => {
|
|
10562
|
+
n(), r(l);
|
|
10524
10563
|
}, o = () => {
|
|
10525
10564
|
n(), r(null);
|
|
10526
|
-
};
|
|
10527
|
-
io(t, i, o), (
|
|
10528
|
-
|
|
10565
|
+
}, a = t.querySelector(".__crossx-card");
|
|
10566
|
+
a && this.applyPinKeyboardMode(a), io(t, i, o), (c = t.querySelector("#__crossx-close-btn")) == null || c.addEventListener("click", o), t.addEventListener("click", (l) => {
|
|
10567
|
+
l.target === t && o();
|
|
10529
10568
|
});
|
|
10530
10569
|
});
|
|
10531
10570
|
}
|
|
@@ -10559,7 +10598,7 @@ class oo {
|
|
|
10559
10598
|
return new Promise((r) => {
|
|
10560
10599
|
var a, c;
|
|
10561
10600
|
ae();
|
|
10562
|
-
const t =
|
|
10601
|
+
const t = Oi(e, this.tokens, this.messages);
|
|
10563
10602
|
ce(t);
|
|
10564
10603
|
const n = () => t.remove(), i = () => {
|
|
10565
10604
|
n(), r();
|
|
@@ -10615,7 +10654,7 @@ class oo {
|
|
|
10615
10654
|
ae();
|
|
10616
10655
|
let t;
|
|
10617
10656
|
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);
|
|
10618
|
-
const n =
|
|
10657
|
+
const n = Ce();
|
|
10619
10658
|
ce(t);
|
|
10620
10659
|
const i = () => {
|
|
10621
10660
|
t.remove(), n();
|
|
@@ -10802,6 +10841,10 @@ class ao {
|
|
|
10802
10841
|
setMessages(e) {
|
|
10803
10842
|
return this.browserConfirmation.setMessages(e);
|
|
10804
10843
|
}
|
|
10844
|
+
setPinKeyboard(e) {
|
|
10845
|
+
var r, t;
|
|
10846
|
+
(t = (r = this.browserConfirmation).setPinKeyboard) == null || t.call(r, e);
|
|
10847
|
+
}
|
|
10805
10848
|
}
|
|
10806
10849
|
class co {
|
|
10807
10850
|
constructor() {
|
|
@@ -10879,7 +10922,12 @@ Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
|
|
|
10879
10922
|
},
|
|
10880
10923
|
x
|
|
10881
10924
|
);
|
|
10882
|
-
const w = new He(n, c), S = new oo(
|
|
10925
|
+
const w = new He(n, c), S = new oo(
|
|
10926
|
+
s.theme ?? "light",
|
|
10927
|
+
s.themeTokens,
|
|
10928
|
+
s.displayDecimals,
|
|
10929
|
+
s.pinKeyboard
|
|
10930
|
+
), I = new ao(
|
|
10883
10931
|
S,
|
|
10884
10932
|
() => {
|
|
10885
10933
|
var M;
|
|
@@ -10887,7 +10935,7 @@ Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
|
|
|
10887
10935
|
},
|
|
10888
10936
|
() => typeof window < "u" ? window.location.origin : "http://localhost",
|
|
10889
10937
|
x
|
|
10890
|
-
),
|
|
10938
|
+
), C = e != null && e.wrapConfirmation ? e.wrapConfirmation(I) : I, R = new xt(
|
|
10891
10939
|
t,
|
|
10892
10940
|
n,
|
|
10893
10941
|
o,
|
|
@@ -10896,7 +10944,7 @@ Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
|
|
|
10896
10944
|
l,
|
|
10897
10945
|
g,
|
|
10898
10946
|
u,
|
|
10899
|
-
|
|
10947
|
+
C,
|
|
10900
10948
|
w,
|
|
10901
10949
|
p
|
|
10902
10950
|
);
|