@nexus-cross/crossx-sdk-core 2.2.3-beta.1 → 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/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 ?? "(없음)",
|
|
@@ -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,
|
|
@@ -3174,7 +3174,7 @@ const Te = class Te extends ys {
|
|
|
3174
3174
|
n.address
|
|
3175
3175
|
)
|
|
3176
3176
|
});
|
|
3177
|
-
return
|
|
3177
|
+
return Cs(i.signature), {
|
|
3178
3178
|
chainId: e,
|
|
3179
3179
|
signature: i.signature,
|
|
3180
3180
|
address: n.address
|
|
@@ -3252,7 +3252,7 @@ const Te = class Te extends ys {
|
|
|
3252
3252
|
a
|
|
3253
3253
|
)
|
|
3254
3254
|
});
|
|
3255
|
-
return
|
|
3255
|
+
return Os(o.signature), {
|
|
3256
3256
|
chainId: e,
|
|
3257
3257
|
signedTx: o.signature,
|
|
3258
3258
|
txHash: o.txHash ?? ""
|
|
@@ -3391,7 +3391,7 @@ const Te = class Te extends ys {
|
|
|
3391
3391
|
let g, _;
|
|
3392
3392
|
const x = this.waitForTxAndGetReceipt(a, e, { intervalMs: c, timeoutMs: l }).then((I) => {
|
|
3393
3393
|
g = I;
|
|
3394
|
-
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);
|
|
3395
3395
|
return {
|
|
3396
3396
|
chainId: e,
|
|
3397
3397
|
txHash: a,
|
|
@@ -4480,17 +4480,17 @@ function bn(s, e, r) {
|
|
|
4480
4480
|
const I = [];
|
|
4481
4481
|
for (; S < e; ) {
|
|
4482
4482
|
c = g();
|
|
4483
|
-
const
|
|
4484
|
-
I.push(
|
|
4483
|
+
const C = c.slice();
|
|
4484
|
+
I.push(C), S += c.length;
|
|
4485
4485
|
}
|
|
4486
4486
|
return Se(...I);
|
|
4487
4487
|
};
|
|
4488
4488
|
return (S, I) => {
|
|
4489
4489
|
p(), _(S);
|
|
4490
|
-
let
|
|
4491
|
-
for (; !(
|
|
4490
|
+
let C;
|
|
4491
|
+
for (; !(C = I(x())); )
|
|
4492
4492
|
_();
|
|
4493
|
-
return p(),
|
|
4493
|
+
return p(), C;
|
|
4494
4494
|
};
|
|
4495
4495
|
}
|
|
4496
4496
|
function Rt(s, e = {}, r = {}) {
|
|
@@ -4547,7 +4547,7 @@ function Nt(s, e, r) {
|
|
|
4547
4547
|
if (!s.eql(s.sqr(e), r))
|
|
4548
4548
|
throw new Error("Cannot find square root");
|
|
4549
4549
|
}
|
|
4550
|
-
function
|
|
4550
|
+
function Cr(s, e) {
|
|
4551
4551
|
const r = (s.ORDER + te) / Tr, t = s.pow(e, r);
|
|
4552
4552
|
return Nt(s, t, e), t;
|
|
4553
4553
|
}
|
|
@@ -4556,7 +4556,7 @@ function En(s, e) {
|
|
|
4556
4556
|
return Nt(s, a, e), a;
|
|
4557
4557
|
}
|
|
4558
4558
|
function An(s) {
|
|
4559
|
-
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;
|
|
4560
4560
|
return (a, c) => {
|
|
4561
4561
|
let l = a.pow(c, o), u = a.mul(l, t);
|
|
4562
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);
|
|
@@ -4565,7 +4565,7 @@ function An(s) {
|
|
|
4565
4565
|
return Nt(a, S, c), S;
|
|
4566
4566
|
};
|
|
4567
4567
|
}
|
|
4568
|
-
function
|
|
4568
|
+
function Or(s) {
|
|
4569
4569
|
if (s < Ir)
|
|
4570
4570
|
throw new Error("sqrt is not defined for small field");
|
|
4571
4571
|
let e = s - te, r = 0;
|
|
@@ -4577,7 +4577,7 @@ function Cr(s) {
|
|
|
4577
4577
|
if (t++ > 1e3)
|
|
4578
4578
|
throw new Error("Cannot find square root: probably non-prime P");
|
|
4579
4579
|
if (r === 1)
|
|
4580
|
-
return
|
|
4580
|
+
return Cr;
|
|
4581
4581
|
let i = n.pow(t, e);
|
|
4582
4582
|
const o = (e + te) / ke;
|
|
4583
4583
|
return function(c, l) {
|
|
@@ -4600,7 +4600,7 @@ function Cr(s) {
|
|
|
4600
4600
|
};
|
|
4601
4601
|
}
|
|
4602
4602
|
function In(s) {
|
|
4603
|
-
return s % Tr === Ir ?
|
|
4603
|
+
return s % Tr === Ir ? Cr : s % Rr === kr ? En : s % Nr === Sn ? An(s) : Or(s);
|
|
4604
4604
|
}
|
|
4605
4605
|
const Tn = [
|
|
4606
4606
|
"create",
|
|
@@ -4656,7 +4656,7 @@ function Nn(s, e) {
|
|
|
4656
4656
|
const r = e !== void 0 ? e : s.toString(2).length, t = Math.ceil(r / 8);
|
|
4657
4657
|
return { nBitLength: r, nByteLength: t };
|
|
4658
4658
|
}
|
|
4659
|
-
class
|
|
4659
|
+
class Cn {
|
|
4660
4660
|
constructor(e, r = {}) {
|
|
4661
4661
|
P(this, "ORDER");
|
|
4662
4662
|
P(this, "BITS");
|
|
@@ -4769,7 +4769,7 @@ class On {
|
|
|
4769
4769
|
}
|
|
4770
4770
|
}
|
|
4771
4771
|
function rt(s, e = {}) {
|
|
4772
|
-
return new
|
|
4772
|
+
return new Cn(s, e);
|
|
4773
4773
|
}
|
|
4774
4774
|
function Lr(s) {
|
|
4775
4775
|
if (typeof s != "bigint")
|
|
@@ -4781,7 +4781,7 @@ function Dr(s) {
|
|
|
4781
4781
|
const e = Lr(s);
|
|
4782
4782
|
return e + Math.ceil(e / 2);
|
|
4783
4783
|
}
|
|
4784
|
-
function
|
|
4784
|
+
function On(s, e, r = !1) {
|
|
4785
4785
|
V(s);
|
|
4786
4786
|
const t = s.length, n = Lr(e), i = Dr(e);
|
|
4787
4787
|
if (t < 16 || t < i || t > 1024)
|
|
@@ -5132,18 +5132,18 @@ function Un(s, e = {}) {
|
|
|
5132
5132
|
throw new Error("compression is not supported: Field does not have .isOdd()");
|
|
5133
5133
|
}
|
|
5134
5134
|
function p(F, m, y) {
|
|
5135
|
-
const { x: k, y:
|
|
5135
|
+
const { x: k, y: O } = m.toAffine(), B = t.toBytes(k);
|
|
5136
5136
|
if (Xe(y, "isCompressed"), y) {
|
|
5137
5137
|
u();
|
|
5138
|
-
const b = !t.isOdd(
|
|
5138
|
+
const b = !t.isOdd(O);
|
|
5139
5139
|
return Se(Hr(b), B);
|
|
5140
5140
|
} else
|
|
5141
|
-
return Se(Uint8Array.of(4), B, t.toBytes(
|
|
5141
|
+
return Se(Uint8Array.of(4), B, t.toBytes(O));
|
|
5142
5142
|
}
|
|
5143
5143
|
function g(F) {
|
|
5144
5144
|
V(F, void 0, "Point");
|
|
5145
|
-
const { publicKey: m, publicKeyUncompressed: y } = l, k = F.length,
|
|
5146
|
-
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)) {
|
|
5147
5147
|
const b = t.fromBytes(B);
|
|
5148
5148
|
if (!t.isValid(b))
|
|
5149
5149
|
throw new Error("bad point: is not on curve, wrong x");
|
|
@@ -5157,8 +5157,8 @@ function Un(s, e = {}) {
|
|
|
5157
5157
|
}
|
|
5158
5158
|
u();
|
|
5159
5159
|
const T = t.isOdd(E);
|
|
5160
|
-
return (
|
|
5161
|
-
} 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) {
|
|
5162
5162
|
const b = t.BYTES, v = t.fromBytes(B.subarray(0, b)), E = t.fromBytes(B.subarray(b, b * 2));
|
|
5163
5163
|
if (!S(v, E))
|
|
5164
5164
|
throw new Error("bad point: is not on curve");
|
|
@@ -5177,8 +5177,8 @@ function Un(s, e = {}) {
|
|
|
5177
5177
|
}
|
|
5178
5178
|
if (!S(i.Gx, i.Gy))
|
|
5179
5179
|
throw new Error("bad curve params: generator point");
|
|
5180
|
-
const I = t.mul(t.pow(i.a, ze), Fn),
|
|
5181
|
-
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)))
|
|
5182
5182
|
throw new Error("bad curve params: a or b");
|
|
5183
5183
|
function R(F, m, y = !1) {
|
|
5184
5184
|
if (!t.isValid(m) || y && t.is0(m))
|
|
@@ -5195,12 +5195,12 @@ function Un(s, e = {}) {
|
|
|
5195
5195
|
return Bn(F, c.basises, n.ORDER);
|
|
5196
5196
|
}
|
|
5197
5197
|
const q = Xt((F, m) => {
|
|
5198
|
-
const { X: y, Y: k, Z:
|
|
5199
|
-
if (t.eql(
|
|
5198
|
+
const { X: y, Y: k, Z: O } = F;
|
|
5199
|
+
if (t.eql(O, t.ONE))
|
|
5200
5200
|
return { x: y, y: k };
|
|
5201
5201
|
const B = F.is0();
|
|
5202
|
-
m == null && (m = B ? t.ONE : t.inv(
|
|
5203
|
-
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);
|
|
5204
5204
|
if (B)
|
|
5205
5205
|
return { x: t.ZERO, y: t.ZERO };
|
|
5206
5206
|
if (!t.eql(E, t.ONE))
|
|
@@ -5221,8 +5221,8 @@ function Un(s, e = {}) {
|
|
|
5221
5221
|
throw new Error("bad point: not in prime-order subgroup");
|
|
5222
5222
|
return !0;
|
|
5223
5223
|
});
|
|
5224
|
-
function G(F, m, y, k,
|
|
5225
|
-
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);
|
|
5226
5226
|
}
|
|
5227
5227
|
const D = class D {
|
|
5228
5228
|
/** Does NOT validate if the point is valid. Use `.assertValidity()`. */
|
|
@@ -5280,7 +5280,7 @@ function Un(s, e = {}) {
|
|
|
5280
5280
|
/** Compare one point to another. */
|
|
5281
5281
|
equals(m) {
|
|
5282
5282
|
L(m);
|
|
5283
|
-
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));
|
|
5284
5284
|
return E && T;
|
|
5285
5285
|
}
|
|
5286
5286
|
/** Flips point to one corresponding to (x, -y) in Affine coordinates. */
|
|
@@ -5292,9 +5292,9 @@ function Un(s, e = {}) {
|
|
|
5292
5292
|
// https://eprint.iacr.org/2015/1060, algorithm 3
|
|
5293
5293
|
// Cost: 8M + 3S + 3*a + 2*b3 + 15add.
|
|
5294
5294
|
double() {
|
|
5295
|
-
const { a: m, b: y } = i, k = t.mul(y, ze), { X:
|
|
5296
|
-
let v = t.ZERO, E = t.ZERO, T = t.ZERO, N = t.mul(
|
|
5297
|
-
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);
|
|
5298
5298
|
}
|
|
5299
5299
|
// Renes-Costello-Batina exception-free addition formula.
|
|
5300
5300
|
// There is 30% faster Jacobian formula, but it is not complete.
|
|
@@ -5302,13 +5302,13 @@ function Un(s, e = {}) {
|
|
|
5302
5302
|
// Cost: 12M + 0S + 3*a + 3*b3 + 23add.
|
|
5303
5303
|
add(m) {
|
|
5304
5304
|
L(m);
|
|
5305
|
-
const { X: y, Y: k, Z:
|
|
5305
|
+
const { X: y, Y: k, Z: O } = this, { X: B, Y: b, Z: v } = m;
|
|
5306
5306
|
let E = t.ZERO, T = t.ZERO, N = t.ZERO;
|
|
5307
5307
|
const W = i.a, U = t.mul(i.b, ze);
|
|
5308
|
-
let $ = t.mul(y, B), K = t.mul(k, b), Y = t.mul(
|
|
5309
|
-
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);
|
|
5310
5310
|
let ee = t.add(B, v);
|
|
5311
|
-
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);
|
|
5312
5312
|
}
|
|
5313
5313
|
subtract(m) {
|
|
5314
5314
|
return this.add(m.negate());
|
|
@@ -5329,16 +5329,16 @@ function Un(s, e = {}) {
|
|
|
5329
5329
|
const { endo: y } = e;
|
|
5330
5330
|
if (!n.isValidNot0(m))
|
|
5331
5331
|
throw new Error("invalid scalar: out of range");
|
|
5332
|
-
let k,
|
|
5332
|
+
let k, O;
|
|
5333
5333
|
const B = (b) => H.cached(this, b, (v) => Qt(D, v));
|
|
5334
5334
|
if (y) {
|
|
5335
5335
|
const { k1neg: b, k1: v, k2neg: E, k2: T } = M(m), { p: N, f: W } = B(v), { p: U, f: $ } = B(T);
|
|
5336
|
-
|
|
5336
|
+
O = W.add($), k = G(y.beta, N, U, b, E);
|
|
5337
5337
|
} else {
|
|
5338
5338
|
const { p: b, f: v } = B(m);
|
|
5339
|
-
k = b,
|
|
5339
|
+
k = b, O = v;
|
|
5340
5340
|
}
|
|
5341
|
-
return Qt(D, [k,
|
|
5341
|
+
return Qt(D, [k, O])[0];
|
|
5342
5342
|
}
|
|
5343
5343
|
/**
|
|
5344
5344
|
* Non-constant-time multiplication. Uses double-and-add algorithm.
|
|
@@ -5356,8 +5356,8 @@ function Un(s, e = {}) {
|
|
|
5356
5356
|
if (H.hasCache(this))
|
|
5357
5357
|
return this.multiply(m);
|
|
5358
5358
|
if (y) {
|
|
5359
|
-
const { k1neg:
|
|
5360
|
-
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);
|
|
5361
5361
|
} else
|
|
5362
5362
|
return H.unsafe(k, m);
|
|
5363
5363
|
}
|
|
@@ -5435,7 +5435,7 @@ function Hn(s, e = {}) {
|
|
|
5435
5435
|
}
|
|
5436
5436
|
}
|
|
5437
5437
|
function a(_ = t(n.seed)) {
|
|
5438
|
-
return
|
|
5438
|
+
return On(V(_, n.seed, "seed"), r.ORDER);
|
|
5439
5439
|
}
|
|
5440
5440
|
function c(_, x = !0) {
|
|
5441
5441
|
return s.BASE.multiply(r.fromBytes(_)).toBytes(x);
|
|
@@ -5485,37 +5485,37 @@ function Wn(s, e, r = {}) {
|
|
|
5485
5485
|
throw new Error(`invalid signature ${m}: out of range 1..Point.Fn.ORDER`);
|
|
5486
5486
|
return y;
|
|
5487
5487
|
}
|
|
5488
|
-
function
|
|
5488
|
+
function C() {
|
|
5489
5489
|
if (w)
|
|
5490
5490
|
throw new Error('"recovered" sig type is not supported for cofactor >2 curves');
|
|
5491
5491
|
}
|
|
5492
5492
|
function R(m, y) {
|
|
5493
5493
|
mt(y);
|
|
5494
|
-
const k = _.signature,
|
|
5495
|
-
return V(m,
|
|
5494
|
+
const k = _.signature, O = y === "compact" ? k : y === "recovered" ? k + 1 : void 0;
|
|
5495
|
+
return V(m, O);
|
|
5496
5496
|
}
|
|
5497
5497
|
class L {
|
|
5498
|
-
constructor(y, k,
|
|
5498
|
+
constructor(y, k, O) {
|
|
5499
5499
|
P(this, "r");
|
|
5500
5500
|
P(this, "s");
|
|
5501
5501
|
P(this, "recovery");
|
|
5502
|
-
if (this.r = I("r", y), this.s = I("s", k),
|
|
5503
|
-
if (
|
|
5502
|
+
if (this.r = I("r", y), this.s = I("s", k), O != null) {
|
|
5503
|
+
if (C(), ![0, 1, 2, 3].includes(O))
|
|
5504
5504
|
throw new Error("invalid recovery id");
|
|
5505
|
-
this.recovery =
|
|
5505
|
+
this.recovery = O;
|
|
5506
5506
|
}
|
|
5507
5507
|
Object.freeze(this);
|
|
5508
5508
|
}
|
|
5509
5509
|
static fromBytes(y, k = x.format) {
|
|
5510
5510
|
R(y, k);
|
|
5511
|
-
let
|
|
5511
|
+
let O;
|
|
5512
5512
|
if (k === "der") {
|
|
5513
5513
|
const { r: E, s: T } = ve.toSig(V(y));
|
|
5514
5514
|
return new L(E, T);
|
|
5515
5515
|
}
|
|
5516
|
-
k === "recovered" && (
|
|
5516
|
+
k === "recovered" && (O = y[0], k = "compact", y = y.subarray(1));
|
|
5517
5517
|
const B = _.signature / 2, b = y.subarray(0, B), v = y.subarray(B, B * 2);
|
|
5518
|
-
return new L(o.fromBytes(b), o.fromBytes(v),
|
|
5518
|
+
return new L(o.fromBytes(b), o.fromBytes(v), O);
|
|
5519
5519
|
}
|
|
5520
5520
|
static fromHex(y, k) {
|
|
5521
5521
|
return this.fromBytes(Ye(y), k);
|
|
@@ -5530,10 +5530,10 @@ function Wn(s, e, r = {}) {
|
|
|
5530
5530
|
return new L(this.r, this.s, y);
|
|
5531
5531
|
}
|
|
5532
5532
|
recoverPublicKey(y) {
|
|
5533
|
-
const { r: k, s:
|
|
5533
|
+
const { r: k, s: O } = this, B = this.assertRecovery(), b = B === 2 || B === 3 ? k + a : k;
|
|
5534
5534
|
if (!i.isValid(b))
|
|
5535
5535
|
throw new Error("invalid recovery id: sig.r+curve.n != R.x");
|
|
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(
|
|
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));
|
|
5537
5537
|
if ($.is0())
|
|
5538
5538
|
throw new Error("invalid recovery: point at infinify");
|
|
5539
5539
|
return $.assertValidity(), $;
|
|
@@ -5545,8 +5545,8 @@ function Wn(s, e, r = {}) {
|
|
|
5545
5545
|
toBytes(y = x.format) {
|
|
5546
5546
|
if (mt(y), y === "der")
|
|
5547
5547
|
return Ye(ve.hexFromSig(this));
|
|
5548
|
-
const { r: k, s:
|
|
5549
|
-
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);
|
|
5550
5550
|
}
|
|
5551
5551
|
toHex(y) {
|
|
5552
5552
|
return We(this.toBytes(y));
|
|
@@ -5555,8 +5555,8 @@ function Wn(s, e, r = {}) {
|
|
|
5555
5555
|
const M = r.bits2int || function(y) {
|
|
5556
5556
|
if (y.length > 8192)
|
|
5557
5557
|
throw new Error("input is too large");
|
|
5558
|
-
const k = tt(y),
|
|
5559
|
-
return
|
|
5558
|
+
const k = tt(y), O = y.length * 8 - c;
|
|
5559
|
+
return O > 0 ? k >> BigInt(O) : k;
|
|
5560
5560
|
}, q = r.bits2int_modN || function(y) {
|
|
5561
5561
|
return o.create(M(y));
|
|
5562
5562
|
}, J = kt(c);
|
|
@@ -5567,7 +5567,7 @@ function Wn(s, e, r = {}) {
|
|
|
5567
5567
|
return V(m, void 0, "message"), y ? V(e(m), void 0, "prehashed message") : m;
|
|
5568
5568
|
}
|
|
5569
5569
|
function Q(m, y, k) {
|
|
5570
|
-
const { lowS:
|
|
5570
|
+
const { lowS: O, prehash: B, extraEntropy: b } = ut(k, x);
|
|
5571
5571
|
m = X(m, B);
|
|
5572
5572
|
const v = q(m), E = o.fromBytes(y);
|
|
5573
5573
|
if (!o.isValidNot0(E))
|
|
@@ -5589,16 +5589,16 @@ function Wn(s, e, r = {}) {
|
|
|
5589
5589
|
if (ee === ge)
|
|
5590
5590
|
return;
|
|
5591
5591
|
let Lt = (ne.x === z ? 0 : 2) | Number(ne.y & Le), Dt = ee;
|
|
5592
|
-
return
|
|
5592
|
+
return O && S(ee) && (Dt = o.neg(ee), Lt ^= 1), new L(z, Dt, w ? void 0 : Lt);
|
|
5593
5593
|
}
|
|
5594
5594
|
return { seed: N, k2sig: U };
|
|
5595
5595
|
}
|
|
5596
5596
|
function H(m, y, k = {}) {
|
|
5597
|
-
const { seed:
|
|
5598
|
-
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);
|
|
5599
5599
|
}
|
|
5600
|
-
function D(m, y, k,
|
|
5601
|
-
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);
|
|
5602
5602
|
if (k = V(k, void 0, "publicKey"), y = X(y, b), !At(m)) {
|
|
5603
5603
|
const E = m instanceof L ? ", use sig.toBytes()" : "";
|
|
5604
5604
|
throw new Error("verify expects Uint8Array signature" + E);
|
|
@@ -5615,8 +5615,8 @@ function Wn(s, e, r = {}) {
|
|
|
5615
5615
|
}
|
|
5616
5616
|
}
|
|
5617
5617
|
function F(m, y, k = {}) {
|
|
5618
|
-
const { prehash:
|
|
5619
|
-
return y = X(y,
|
|
5618
|
+
const { prehash: O } = ut(k, x);
|
|
5619
|
+
return y = X(y, O), L.fromBytes(m, "recovered").recoverPublicKey(y).toBytes();
|
|
5620
5620
|
}
|
|
5621
5621
|
return Object.freeze({
|
|
5622
5622
|
keygen: l,
|
|
@@ -5633,7 +5633,7 @@ function Wn(s, e, r = {}) {
|
|
|
5633
5633
|
});
|
|
5634
5634
|
}
|
|
5635
5635
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
5636
|
-
const
|
|
5636
|
+
const Ct = {
|
|
5637
5637
|
p: BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),
|
|
5638
5638
|
n: BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),
|
|
5639
5639
|
h: BigInt(1),
|
|
@@ -5649,12 +5649,12 @@ const Ot = {
|
|
|
5649
5649
|
]
|
|
5650
5650
|
}, nr = /* @__PURE__ */ BigInt(2);
|
|
5651
5651
|
function qn(s) {
|
|
5652
|
-
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);
|
|
5653
5653
|
if (!yt.eql(yt.sqr(q), s))
|
|
5654
5654
|
throw new Error("Cannot find square root");
|
|
5655
5655
|
return q;
|
|
5656
5656
|
}
|
|
5657
|
-
const yt = rt(
|
|
5657
|
+
const yt = rt(Ct.p, { sqrt: qn }), Kn = /* @__PURE__ */ Un(Ct, {
|
|
5658
5658
|
Fp: yt,
|
|
5659
5659
|
endo: Gn
|
|
5660
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 = [];
|
|
@@ -5691,7 +5691,7 @@ function ei(s, e = 24) {
|
|
|
5691
5691
|
}
|
|
5692
5692
|
$e(r);
|
|
5693
5693
|
}
|
|
5694
|
-
class
|
|
5694
|
+
class Ot {
|
|
5695
5695
|
// NOTE: we accept arguments in bytes instead of bits here.
|
|
5696
5696
|
constructor(e, r, t, n = !1, i = 24) {
|
|
5697
5697
|
P(this, "state");
|
|
@@ -5764,10 +5764,10 @@ class Ct {
|
|
|
5764
5764
|
}
|
|
5765
5765
|
_cloneInto(e) {
|
|
5766
5766
|
const { blockLen: r, suffix: t, outputLen: n, rounds: i, enableXOF: o } = this;
|
|
5767
|
-
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;
|
|
5768
5768
|
}
|
|
5769
5769
|
}
|
|
5770
|
-
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;
|
|
5771
5771
|
class si {
|
|
5772
5772
|
constructor() {
|
|
5773
5773
|
this.jwks = null;
|
|
@@ -5987,7 +5987,7 @@ class Ae {
|
|
|
5987
5987
|
d.warn("[CROSSx] OAuth 타임아웃 (5분) — postMessage를 수신하지 못했습니다"), L(), t(new Error("Authentication timeout"));
|
|
5988
5988
|
}, 5 * 60 * 1e3), x = 10, w = 30;
|
|
5989
5989
|
let S = 0, I = null;
|
|
5990
|
-
const
|
|
5990
|
+
const C = () => {
|
|
5991
5991
|
clearInterval(R), d.warn("[CROSSx] COOP 감지 — OAuth 서버 응답을 " + w + "초간 대기합니다"), I = setTimeout(() => {
|
|
5992
5992
|
L(), t(new Error(
|
|
5993
5993
|
"OAuth 서버로부터 응답을 받지 못했습니다. 브라우저 보안 정책(COOP)으로 인해 팝업 통신이 차단되었을 수 있습니다. 다시 시도해 주세요."
|
|
@@ -5996,9 +5996,9 @@ class Ae {
|
|
|
5996
5996
|
}, R = setInterval(() => {
|
|
5997
5997
|
S++;
|
|
5998
5998
|
try {
|
|
5999
|
-
g.closed && (S <= x ?
|
|
5999
|
+
g.closed && (S <= x ? C() : (L(), t(new Error("로그인이 취소되었습니다"))));
|
|
6000
6000
|
} catch {
|
|
6001
|
-
|
|
6001
|
+
C();
|
|
6002
6002
|
}
|
|
6003
6003
|
}, 1e3), L = () => {
|
|
6004
6004
|
clearTimeout(_), clearInterval(R), I && clearTimeout(I), window.removeEventListener("message", M);
|
|
@@ -6037,8 +6037,8 @@ class Ae {
|
|
|
6037
6037
|
return;
|
|
6038
6038
|
}
|
|
6039
6039
|
const m = { token: D, email: F }, y = (k) => {
|
|
6040
|
-
Ae.verifyIdTokenNonce(k, l).then(() => r(m)).catch((
|
|
6041
|
-
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"));
|
|
6042
6042
|
});
|
|
6043
6043
|
};
|
|
6044
6044
|
H ? H.split(".").length === 3 ? y(H) : Q ? y(Q) : (d.warn(
|
|
@@ -6284,9 +6284,9 @@ class Ie {
|
|
|
6284
6284
|
h.USER_NOT_FOUND,
|
|
6285
6285
|
Ie.getGatewayErrorMessage(_.code, x)
|
|
6286
6286
|
);
|
|
6287
|
-
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;
|
|
6288
6288
|
let R;
|
|
6289
|
-
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);
|
|
6290
6290
|
}
|
|
6291
6291
|
return d.log("[CROSSx] Wallet Gateway API 성공:", { code: _.code, url: o, method: e }), _.data ?? _;
|
|
6292
6292
|
}
|
|
@@ -9173,7 +9173,7 @@ function _i(s) {
|
|
|
9173
9173
|
}, { passive: !0 });
|
|
9174
9174
|
}
|
|
9175
9175
|
const fi = () => /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
|
|
9176
|
-
function
|
|
9176
|
+
function Ce() {
|
|
9177
9177
|
if (fi()) {
|
|
9178
9178
|
const e = window.scrollY;
|
|
9179
9179
|
return document.body.style.position = "fixed", document.body.style.top = `-${e}px`, document.body.style.left = "0", document.body.style.right = "0", () => {
|
|
@@ -9451,7 +9451,7 @@ function Ri(s) {
|
|
|
9451
9451
|
function Ni(s) {
|
|
9452
9452
|
return `https://www.crossscan.io/address/${s}?tab=txs`;
|
|
9453
9453
|
}
|
|
9454
|
-
function
|
|
9454
|
+
function Ci(s, e) {
|
|
9455
9455
|
return `https://explorer.crosstoken.io/${Ri(s)}/tx/${e}`;
|
|
9456
9456
|
}
|
|
9457
9457
|
function Jr(s, e) {
|
|
@@ -9461,9 +9461,9 @@ function Ze(s) {
|
|
|
9461
9461
|
return Jr(de(s), Ni(s));
|
|
9462
9462
|
}
|
|
9463
9463
|
function Zr(s, e) {
|
|
9464
|
-
return Jr(de(e),
|
|
9464
|
+
return Jr(de(e), Ci(s, e));
|
|
9465
9465
|
}
|
|
9466
|
-
function
|
|
9466
|
+
function Oi(s, e, r) {
|
|
9467
9467
|
const t = j(
|
|
9468
9468
|
(r == null ? void 0 : r.label_from) ?? "From",
|
|
9469
9469
|
`${Ze(s.from)}
|
|
@@ -9543,10 +9543,10 @@ function Li(s, e, r, t) {
|
|
|
9543
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>
|
|
9544
9544
|
`, c.querySelectorAll(".__crossx-copy-btn").forEach((w) => {
|
|
9545
9545
|
w.addEventListener("click", (S) => {
|
|
9546
|
-
var
|
|
9546
|
+
var C;
|
|
9547
9547
|
S.stopPropagation();
|
|
9548
9548
|
const I = w.dataset.copy;
|
|
9549
|
-
I && ((
|
|
9549
|
+
I && ((C = navigator.clipboard) == null || C.writeText(I).catch(() => {
|
|
9550
9550
|
}));
|
|
9551
9551
|
});
|
|
9552
9552
|
});
|
|
@@ -9985,7 +9985,7 @@ function to(s) {
|
|
|
9985
9985
|
return r > 0 ? `${r}h ${String(t).padStart(2, "0")}m` : `${String(t).padStart(2, "0")}:${String(n).padStart(2, "0")}`;
|
|
9986
9986
|
}
|
|
9987
9987
|
function _t(s, e, r, t, n, i, o) {
|
|
9988
|
-
var
|
|
9988
|
+
var O, B;
|
|
9989
9989
|
let a = !!(i && i > Date.now()), c = !1;
|
|
9990
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 = () => {
|
|
9991
9991
|
var E;
|
|
@@ -9997,7 +9997,7 @@ function _t(s, e, r, t, n, i, o) {
|
|
|
9997
9997
|
const T = b.findIndex((W) => !W.value);
|
|
9998
9998
|
(E = v[T === -1 ? 5 : T]) == null || E.classList.add("--active");
|
|
9999
9999
|
}
|
|
10000
|
-
},
|
|
10000
|
+
}, C = () => {
|
|
10001
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();
|
|
10002
10002
|
}, R = (b) => {
|
|
10003
10003
|
a = b, l().forEach((v) => {
|
|
@@ -10044,7 +10044,7 @@ function _t(s, e, r, t, n, i, o) {
|
|
|
10044
10044
|
var W;
|
|
10045
10045
|
R(!0), l().forEach((U) => {
|
|
10046
10046
|
U.value = "";
|
|
10047
|
-
}),
|
|
10047
|
+
}), C();
|
|
10048
10048
|
const v = p();
|
|
10049
10049
|
if (v && (v.textContent = "Too many failed attempts. Please wait."), !g()) {
|
|
10050
10050
|
const U = document.createElement("p");
|
|
@@ -10055,7 +10055,7 @@ function _t(s, e, r, t, n, i, o) {
|
|
|
10055
10055
|
const E = () => {
|
|
10056
10056
|
var K;
|
|
10057
10057
|
const U = b - Date.now(), $ = _();
|
|
10058
|
-
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(() => {
|
|
10059
10059
|
var Y;
|
|
10060
10060
|
return (Y = l()[0]) == null ? void 0 : Y.focus();
|
|
10061
10061
|
}, 50)) : $ && ($.textContent = ` ${to(U)}`);
|
|
@@ -10096,7 +10096,7 @@ function _t(s, e, r, t, n, i, o) {
|
|
|
10096
10096
|
const b = l(), v = b.find((E) => !E.value) ?? b[b.length - 1];
|
|
10097
10097
|
v == null || v.focus();
|
|
10098
10098
|
};
|
|
10099
|
-
(
|
|
10099
|
+
(O = u()) == null || O.addEventListener("click", (b) => {
|
|
10100
10100
|
b.target.classList.contains("__crossx-pin6-box") || y();
|
|
10101
10101
|
}), (B = x()) == null || B.addEventListener("click", (b) => {
|
|
10102
10102
|
const v = b.target;
|
|
@@ -10156,7 +10156,7 @@ function _t(s, e, r, t, n, i, o) {
|
|
|
10156
10156
|
v();
|
|
10157
10157
|
const W = N.getBoundingClientRect();
|
|
10158
10158
|
T.clientX >= W.left && T.clientX <= W.right && T.clientY >= W.top && T.clientY <= W.bottom && !a && !c && E(N);
|
|
10159
|
-
}), 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();
|
|
10160
10160
|
}
|
|
10161
10161
|
}
|
|
10162
10162
|
const ro = `<svg width="22" height="17" viewBox="0 0 22 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -10246,9 +10246,9 @@ class oo {
|
|
|
10246
10246
|
*/
|
|
10247
10247
|
showWalletSelector(e, r, t) {
|
|
10248
10248
|
return new Promise((n, i) => {
|
|
10249
|
-
var
|
|
10249
|
+
var C;
|
|
10250
10250
|
ae();
|
|
10251
|
-
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();
|
|
10252
10252
|
ce(a);
|
|
10253
10253
|
let l = !1;
|
|
10254
10254
|
const u = () => {
|
|
@@ -10288,7 +10288,7 @@ class oo {
|
|
|
10288
10288
|
const L = R instanceof f && R.code === h.ADDRESS_LIMIT_EXCEEDED, M = this.resolveAddWalletErrorMessage(R);
|
|
10289
10289
|
w && (w.textContent = M, w.hidden = !1), L ? (S.disabled = !0, S.setAttribute("aria-disabled", "true")) : S.disabled = !1, p = R;
|
|
10290
10290
|
}
|
|
10291
|
-
}), (
|
|
10291
|
+
}), (C = a.querySelector("#__crossx-close-btn")) == null || C.addEventListener("click", _), a.addEventListener("click", (R) => {
|
|
10292
10292
|
R.target === a && _();
|
|
10293
10293
|
});
|
|
10294
10294
|
const I = (R) => {
|
|
@@ -10325,7 +10325,7 @@ class oo {
|
|
|
10325
10325
|
return new Promise((n) => {
|
|
10326
10326
|
var g, _, x, w;
|
|
10327
10327
|
ae();
|
|
10328
|
-
const i = zi(this.tokens, r, this.messages), o =
|
|
10328
|
+
const i = zi(this.tokens, r, this.messages), o = Ce();
|
|
10329
10329
|
ce(i);
|
|
10330
10330
|
const a = () => {
|
|
10331
10331
|
i.remove(), o();
|
|
@@ -10337,8 +10337,8 @@ class oo {
|
|
|
10337
10337
|
a(), n(null);
|
|
10338
10338
|
};
|
|
10339
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) => {
|
|
10340
|
-
const
|
|
10341
|
-
|
|
10340
|
+
const C = S.currentTarget.dataset.walletId ?? "";
|
|
10341
|
+
C && l(C);
|
|
10342
10342
|
}), (w = i.querySelector("#__crossx-close-btn")) == null || w.addEventListener("click", u), i.addEventListener("click", (S) => {
|
|
10343
10343
|
S.target === i && u();
|
|
10344
10344
|
}), i.querySelectorAll(".__crossx-login-terms-link").forEach((S) => {
|
|
@@ -10361,7 +10361,7 @@ class oo {
|
|
|
10361
10361
|
accountLabel: (t == null ? void 0 : t.session_alert_account_label) ?? "Account",
|
|
10362
10362
|
signOutLabel: (t == null ? void 0 : t.session_alert_sign_out_button) ?? "Sign out",
|
|
10363
10363
|
signInAgainLabel: (t == null ? void 0 : t.session_alert_sign_in_again_button) ?? "Sign in again"
|
|
10364
|
-
}), i =
|
|
10364
|
+
}), i = Ce();
|
|
10365
10365
|
ce(n);
|
|
10366
10366
|
let o = !1;
|
|
10367
10367
|
const a = () => {
|
|
@@ -10430,13 +10430,13 @@ class oo {
|
|
|
10430
10430
|
}, o = {
|
|
10431
10431
|
title: (t == null ? void 0 : t.pin_setup_confirm_title) ?? "Confirm PIN",
|
|
10432
10432
|
headerSubtitle: (t == null ? void 0 : t.pin_setup_confirm_subtitle) ?? "Enter your PIN again to confirm."
|
|
10433
|
-
}, a = hr(this.tokens, Qi(n)), c =
|
|
10433
|
+
}, a = hr(this.tokens, Qi(n)), c = Ce();
|
|
10434
10434
|
ce(a);
|
|
10435
10435
|
let l = !1;
|
|
10436
10436
|
const u = () => {
|
|
10437
10437
|
l || (l = !0, a.remove(), c());
|
|
10438
|
-
}, p = (
|
|
10439
|
-
u(), r(
|
|
10438
|
+
}, p = (C) => {
|
|
10439
|
+
u(), r(C);
|
|
10440
10440
|
}, g = () => {
|
|
10441
10441
|
u(), r(null);
|
|
10442
10442
|
}, _ = a.querySelector(".__crossx-card"), x = {
|
|
@@ -10445,21 +10445,21 @@ class oo {
|
|
|
10445
10445
|
repeatingDigit: (t == null ? void 0 : t.pin_validation_repeating_digit) ?? "Cannot use the same number 3+ times in a row.",
|
|
10446
10446
|
sequential: (t == null ? void 0 : t.pin_validation_sequential) ?? "Sequential numbers (e.g., 123456) are not allowed.",
|
|
10447
10447
|
alternatingPattern: (t == null ? void 0 : t.pin_validation_alternating_pattern) ?? "Repeating patterns (e.g., 121212) are not allowed."
|
|
10448
|
-
}, w = (
|
|
10448
|
+
}, w = (C) => {
|
|
10449
10449
|
var R;
|
|
10450
10450
|
_.innerHTML = pt({
|
|
10451
10451
|
title: o.title,
|
|
10452
10452
|
headerSubtitle: o.headerSubtitle
|
|
10453
10453
|
}), this.applyPinKeyboardMode(_), (R = _.querySelector("#__crossx-close-btn")) == null || R.addEventListener("click", g), _t(_, (L) => {
|
|
10454
|
-
L ===
|
|
10454
|
+
L === C ? p(C) : S(i.mismatchError);
|
|
10455
10455
|
}, g);
|
|
10456
|
-
}, S = (
|
|
10456
|
+
}, S = (C) => {
|
|
10457
10457
|
var R;
|
|
10458
10458
|
_.innerHTML = pt({
|
|
10459
10459
|
title: i.title,
|
|
10460
10460
|
headerSubtitle: i.headerSubtitle,
|
|
10461
10461
|
subtitle: i.subtitle,
|
|
10462
|
-
errorMessage:
|
|
10462
|
+
errorMessage: C
|
|
10463
10463
|
}), this.applyPinKeyboardMode(_), (R = _.querySelector("#__crossx-close-btn")) == null || R.addEventListener("click", g), _t(_, (L) => {
|
|
10464
10464
|
const M = eo(L, x);
|
|
10465
10465
|
M ? S(M) : w(L);
|
|
@@ -10467,10 +10467,10 @@ class oo {
|
|
|
10467
10467
|
};
|
|
10468
10468
|
(() => {
|
|
10469
10469
|
var Q;
|
|
10470
|
-
const
|
|
10470
|
+
const C = Array.from(_.querySelectorAll(".__crossx-pw-notice-item")), R = _.querySelector("#__crossx-pin-notice-next"), L = /* @__PURE__ */ new Set();
|
|
10471
10471
|
R.removeAttribute("disabled");
|
|
10472
10472
|
const M = R.dataset.nextLabel ?? "Next", q = R.dataset.submitLabel ?? "I Understand", J = () => {
|
|
10473
|
-
const H = L.size ===
|
|
10473
|
+
const H = L.size === C.length;
|
|
10474
10474
|
R.classList.toggle("--disabled", !H), R.textContent = H ? q : M;
|
|
10475
10475
|
}, G = (H, D) => {
|
|
10476
10476
|
if (L.has(D)) return;
|
|
@@ -10481,7 +10481,7 @@ class oo {
|
|
|
10481
10481
|
const F = H.querySelector(`#__crossx-notice-check-${D}`);
|
|
10482
10482
|
L.delete(D), F.classList.remove("--checked"), H.setAttribute("aria-checked", "false"), J();
|
|
10483
10483
|
};
|
|
10484
|
-
|
|
10484
|
+
C.forEach((H) => {
|
|
10485
10485
|
const D = parseInt(H.dataset.checkIndex ?? "0", 10);
|
|
10486
10486
|
H.addEventListener("click", () => {
|
|
10487
10487
|
L.has(D) ? X(H, D) : G(H, D);
|
|
@@ -10489,11 +10489,11 @@ class oo {
|
|
|
10489
10489
|
(F.key === " " || F.key === "Enter") && (F.preventDefault(), L.has(D) ? X(H, D) : G(H, D));
|
|
10490
10490
|
});
|
|
10491
10491
|
}), R.addEventListener("click", () => {
|
|
10492
|
-
if (L.size ===
|
|
10492
|
+
if (L.size === C.length) {
|
|
10493
10493
|
S(e == null ? void 0 : e.errorMessage);
|
|
10494
10494
|
return;
|
|
10495
10495
|
}
|
|
10496
|
-
const H =
|
|
10496
|
+
const H = C.find((F) => {
|
|
10497
10497
|
const m = parseInt(F.dataset.checkIndex ?? "0", 10);
|
|
10498
10498
|
return !L.has(m);
|
|
10499
10499
|
});
|
|
@@ -10503,8 +10503,8 @@ class oo {
|
|
|
10503
10503
|
H.classList.remove("--highlight"), G(H, D);
|
|
10504
10504
|
}, 400);
|
|
10505
10505
|
}), (Q = _.querySelector("#__crossx-close-btn")) == null || Q.addEventListener("click", g);
|
|
10506
|
-
})(), a.addEventListener("click", (
|
|
10507
|
-
|
|
10506
|
+
})(), a.addEventListener("click", (C) => {
|
|
10507
|
+
C.target === a && g();
|
|
10508
10508
|
});
|
|
10509
10509
|
});
|
|
10510
10510
|
}
|
|
@@ -10528,20 +10528,20 @@ class oo {
|
|
|
10528
10528
|
attemptCount: e == null ? void 0 : e.attemptCount,
|
|
10529
10529
|
maxAttempts: e == null ? void 0 : e.maxAttempts
|
|
10530
10530
|
})
|
|
10531
|
-
), u =
|
|
10531
|
+
), u = Ce();
|
|
10532
10532
|
ce(l);
|
|
10533
10533
|
let p = !1;
|
|
10534
10534
|
const g = () => {
|
|
10535
10535
|
p || (p = !0, l.remove(), u());
|
|
10536
|
-
}, _ = (
|
|
10537
|
-
g(), r(
|
|
10536
|
+
}, _ = (C) => {
|
|
10537
|
+
g(), r(C);
|
|
10538
10538
|
}, x = () => {
|
|
10539
10539
|
g(), r(null);
|
|
10540
|
-
}, w = (
|
|
10541
|
-
g(), t(
|
|
10540
|
+
}, w = (C) => {
|
|
10541
|
+
g(), t(C);
|
|
10542
10542
|
}, S = l.querySelector(".__crossx-card");
|
|
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", (
|
|
10544
|
-
|
|
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();
|
|
10545
10545
|
});
|
|
10546
10546
|
});
|
|
10547
10547
|
}
|
|
@@ -10598,7 +10598,7 @@ class oo {
|
|
|
10598
10598
|
return new Promise((r) => {
|
|
10599
10599
|
var a, c;
|
|
10600
10600
|
ae();
|
|
10601
|
-
const t =
|
|
10601
|
+
const t = Oi(e, this.tokens, this.messages);
|
|
10602
10602
|
ce(t);
|
|
10603
10603
|
const n = () => t.remove(), i = () => {
|
|
10604
10604
|
n(), r();
|
|
@@ -10654,7 +10654,7 @@ class oo {
|
|
|
10654
10654
|
ae();
|
|
10655
10655
|
let t;
|
|
10656
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);
|
|
10657
|
-
const n =
|
|
10657
|
+
const n = Ce();
|
|
10658
10658
|
ce(t);
|
|
10659
10659
|
const i = () => {
|
|
10660
10660
|
t.remove(), n();
|
|
@@ -10841,6 +10841,10 @@ class ao {
|
|
|
10841
10841
|
setMessages(e) {
|
|
10842
10842
|
return this.browserConfirmation.setMessages(e);
|
|
10843
10843
|
}
|
|
10844
|
+
setPinKeyboard(e) {
|
|
10845
|
+
var r, t;
|
|
10846
|
+
(t = (r = this.browserConfirmation).setPinKeyboard) == null || t.call(r, e);
|
|
10847
|
+
}
|
|
10844
10848
|
}
|
|
10845
10849
|
class co {
|
|
10846
10850
|
constructor() {
|
|
@@ -10931,7 +10935,7 @@ Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
|
|
|
10931
10935
|
},
|
|
10932
10936
|
() => typeof window < "u" ? window.location.origin : "http://localhost",
|
|
10933
10937
|
x
|
|
10934
|
-
),
|
|
10938
|
+
), C = e != null && e.wrapConfirmation ? e.wrapConfirmation(I) : I, R = new xt(
|
|
10935
10939
|
t,
|
|
10936
10940
|
n,
|
|
10937
10941
|
o,
|
|
@@ -10940,7 +10944,7 @@ Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
|
|
|
10940
10944
|
l,
|
|
10941
10945
|
g,
|
|
10942
10946
|
u,
|
|
10943
|
-
|
|
10947
|
+
C,
|
|
10944
10948
|
w,
|
|
10945
10949
|
p
|
|
10946
10950
|
);
|