@nexus-cross/crossx-sdk-core 2.2.0-beta.8 → 2.2.0-beta.9
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/core/types/events.d.ts +2 -0
- package/dist/core/types/events.d.ts.map +1 -1
- package/dist/core/types/rn-bridge.d.ts +2 -0
- package/dist/core/types/rn-bridge.d.ts.map +1 -1
- package/dist/crossx.global +8 -8
- package/dist/index.cjs +81 -81
- package/dist/index.js +346 -342
- package/dist/sdk/CROSSxSDK.d.ts +2 -0
- package/dist/sdk/CROSSxSDK.d.ts.map +1 -1
- package/dist/sdk/services/StateManager.d.ts +4 -1
- package/dist/sdk/services/StateManager.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 N = ((o = I.firebase) == null ? void 0 : o.identities) ?? {};
|
|
661
|
+
w = I.email ?? ((a = N.email) == null ? void 0 : a[0]), x === "google.com" ? _ = (c = N["google.com"]) == null ? void 0 : c[0] : x === "apple.com" && (_ = (l = N["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 N = await this.crypto.verifyJWT(p);
|
|
669
|
+
if (n = N.signatureVerified ?? !1, !N.valid)
|
|
670
670
|
throw d.error("[CROSSx] access_token 검증 실패"), new Error("유효하지 않은 access token");
|
|
671
|
-
const R =
|
|
671
|
+
const R = N.payload, L = R.email ?? w ?? r;
|
|
672
672
|
d.log(
|
|
673
673
|
"[CROSSx] email 소스 — CROSSx JWT:",
|
|
674
674
|
R.email ?? "(없음)",
|
|
@@ -694,8 +694,8 @@ const Bt = "crossx_access_token", Mt = "crossx_refresh_token", Ft = "crossx_user
|
|
|
694
694
|
}, d.log("[CROSSx] Cookie 모드 — Firebase 토큰에서 사용자 정보 추출 — id:", t.id);
|
|
695
695
|
}
|
|
696
696
|
d.log("[CROSSx] 사용자 정보 — id:", t.id, "email:", t.email ?? "(없음)");
|
|
697
|
-
const
|
|
698
|
-
await this.storage.set(this.STORAGE_KEY_USER,
|
|
697
|
+
const S = this.useCookieAuth ? { id: t.id, email: t.email, signInProvider: t.signInProvider, providerSub: t.providerSub } : t;
|
|
698
|
+
await this.storage.set(this.STORAGE_KEY_USER, S), d.log("[CROSSx] 사용자 정보 저장 완료 (authMode:", this.useCookieAuth ? "cookie" : "token", ")");
|
|
699
699
|
} catch (u) {
|
|
700
700
|
return d.error("[CROSSx] SignIn 에러 (토큰 교환 단계):", u), {
|
|
701
701
|
success: !1,
|
|
@@ -1404,7 +1404,7 @@ function Ge(s, e, r, t = Et) {
|
|
|
1404
1404
|
return;
|
|
1405
1405
|
}
|
|
1406
1406
|
}
|
|
1407
|
-
function
|
|
1407
|
+
function Ns(s) {
|
|
1408
1408
|
const e = s.startsWith("0x") ? s.slice(2) : s;
|
|
1409
1409
|
if (!/^[0-9a-fA-F]+$/.test(e))
|
|
1410
1410
|
throw new f(
|
|
@@ -1417,7 +1417,7 @@ function Cs(s) {
|
|
|
1417
1417
|
`서명 길이가 유효하지 않습니다: ${Wt} hex 문자(65 바이트) 예상, 현재 ${e.length}`
|
|
1418
1418
|
);
|
|
1419
1419
|
}
|
|
1420
|
-
function
|
|
1420
|
+
function Cs(s) {
|
|
1421
1421
|
const e = s.startsWith("0x") ? s.slice(2) : s;
|
|
1422
1422
|
if (!/^[0-9a-fA-F]+$/.test(e))
|
|
1423
1423
|
throw new f(
|
|
@@ -1464,7 +1464,7 @@ function Ls(s) {
|
|
|
1464
1464
|
const t = Number(r);
|
|
1465
1465
|
return Number.isFinite(t) ? t : void 0;
|
|
1466
1466
|
}
|
|
1467
|
-
class
|
|
1467
|
+
class Ce {
|
|
1468
1468
|
constructor(e) {
|
|
1469
1469
|
this.deps = e, this.verifyPinMutex = null;
|
|
1470
1470
|
}
|
|
@@ -1537,7 +1537,7 @@ class Ne {
|
|
|
1537
1537
|
if (u.code === h.PIN_INVALID)
|
|
1538
1538
|
return { ok: !1, error: u.message };
|
|
1539
1539
|
if (u.code === h.PIN_LOCKED)
|
|
1540
|
-
return
|
|
1540
|
+
return Ce.buildPinLockedResult(u, a);
|
|
1541
1541
|
}
|
|
1542
1542
|
throw u;
|
|
1543
1543
|
}
|
|
@@ -1571,7 +1571,7 @@ class Ne {
|
|
|
1571
1571
|
return await e();
|
|
1572
1572
|
} catch (n) {
|
|
1573
1573
|
if (n instanceof f) {
|
|
1574
|
-
if (t =
|
|
1574
|
+
if (t = Ce.parsePinError(n, r), !t) throw n;
|
|
1575
1575
|
} else
|
|
1576
1576
|
throw n;
|
|
1577
1577
|
}
|
|
@@ -1585,7 +1585,7 @@ class Ne {
|
|
|
1585
1585
|
try {
|
|
1586
1586
|
return await e();
|
|
1587
1587
|
} catch (n) {
|
|
1588
|
-
if (n instanceof f && (t =
|
|
1588
|
+
if (n instanceof f && (t = Ce.parsePinError(n, r), t))
|
|
1589
1589
|
continue;
|
|
1590
1590
|
throw n;
|
|
1591
1591
|
}
|
|
@@ -1610,7 +1610,7 @@ class Ne {
|
|
|
1610
1610
|
return null;
|
|
1611
1611
|
}
|
|
1612
1612
|
static buildPinLockedResult(e, r) {
|
|
1613
|
-
const t =
|
|
1613
|
+
const t = Ce.parsePinError(e, r);
|
|
1614
1614
|
if (!t) return { ok: !1, error: e.message };
|
|
1615
1615
|
const { errorMessage: n, ...i } = t;
|
|
1616
1616
|
return { ok: !1, error: n, ...i };
|
|
@@ -1996,11 +1996,13 @@ class Gs {
|
|
|
1996
1996
|
constructor(e) {
|
|
1997
1997
|
this.deps = e;
|
|
1998
1998
|
}
|
|
1999
|
-
setActiveWallet(e, r) {
|
|
1999
|
+
setActiveWallet(e, r, t) {
|
|
2000
2000
|
this.deps.setState({
|
|
2001
2001
|
address: e,
|
|
2002
2002
|
activeWalletIndex: r
|
|
2003
|
-
})
|
|
2003
|
+
});
|
|
2004
|
+
const n = { address: e, index: r };
|
|
2005
|
+
(t == null ? void 0 : t.walletName) !== void 0 && (n.walletName = t.walletName), this.deps.emitAddressChanged(n), this.deps.shouldPersistWalletPreference() && this.deps.storage.set(this.deps.walletPreferenceKey, { index: r, address: e }).catch(() => {
|
|
2004
2006
|
});
|
|
2005
2007
|
}
|
|
2006
2008
|
applyAuthResult(e) {
|
|
@@ -2294,17 +2296,18 @@ const Te = class Te extends ys {
|
|
|
2294
2296
|
x.authenticated !== void 0 && (this.authenticated = x.authenticated), x.userId !== void 0 && (this.userId = x.userId), x.address !== void 0 && (this.address = x.address), x.activeWalletIndex !== void 0 && (this.activeWalletIndex = x.activeWalletIndex), x.userEmail !== void 0 && (this.userEmail = x.userEmail), x.providerSub !== void 0 && (this.providerSub = x.providerSub), x.loginType !== void 0 && (this.loginType = x.loginType), x.tokenSignatureVerified !== void 0 && (this.tokenSignatureVerified = x.tokenSignatureVerified);
|
|
2295
2297
|
},
|
|
2296
2298
|
getIsRecoveringSession: () => this._isRecoveringSession,
|
|
2297
|
-
emitAddressChanged: ({ address: x, index: w }) => {
|
|
2298
|
-
|
|
2299
|
+
emitAddressChanged: ({ address: x, index: w, walletName: S }) => {
|
|
2300
|
+
const I = { address: x, index: w };
|
|
2301
|
+
S !== void 0 && (I.walletName = S), this.emit("addressChanged", I);
|
|
2299
2302
|
},
|
|
2300
|
-
emitAuthChanged: ({ isAuthenticated: x, address: w, userId:
|
|
2301
|
-
this.emit("authChanged", { isAuthenticated: x, address: w, userId:
|
|
2303
|
+
emitAuthChanged: ({ isAuthenticated: x, address: w, userId: S }) => {
|
|
2304
|
+
this.emit("authChanged", { isAuthenticated: x, address: w, userId: S });
|
|
2302
2305
|
},
|
|
2303
2306
|
shouldPersistWalletPreference: () => this._config.persistWalletPreference !== !1,
|
|
2304
2307
|
walletPreferenceKey: Te.WALLET_PREF_KEY,
|
|
2305
2308
|
storage: this.storage,
|
|
2306
2309
|
pinStore: this.pinStore
|
|
2307
|
-
}), this.pinOrchestrator = new
|
|
2310
|
+
}), this.pinOrchestrator = new Ce({
|
|
2308
2311
|
confirmation: this.confirmation,
|
|
2309
2312
|
walletProvider: this.walletProvider,
|
|
2310
2313
|
pinStore: this.pinStore,
|
|
@@ -2342,7 +2345,7 @@ const Te = class Te extends ys {
|
|
|
2342
2345
|
getActiveAddress: () => this.address,
|
|
2343
2346
|
estimateGas: (x, w) => this.estimateGas(x, w),
|
|
2344
2347
|
getBaseFeePerGas: (x) => this.getBaseFeePerGas(x),
|
|
2345
|
-
jsonRpcCall: (x, w,
|
|
2348
|
+
jsonRpcCall: (x, w, S) => this.jsonRpc.call(x, w, S)
|
|
2346
2349
|
}), this.signatureVerifier = new Hs(this.crypto), this.addressResolverService = new qs({
|
|
2347
2350
|
walletProvider: this.walletProvider,
|
|
2348
2351
|
pinOrchestrator: this.pinOrchestrator,
|
|
@@ -2664,7 +2667,7 @@ const Te = class Te extends ys {
|
|
|
2664
2667
|
} catch (r) {
|
|
2665
2668
|
d.warn("[CROSSx] RN Bridge signOut 통보 실패 (로그아웃 자체는 정상)", r);
|
|
2666
2669
|
}
|
|
2667
|
-
this._rnBridgeService = null, this._rnBridgeWalletAddress = void 0;
|
|
2670
|
+
this._rnBridgeService = null, this._rnBridgeWalletAddress = void 0, this._rnBridgeWalletName = void 0;
|
|
2668
2671
|
} catch (e) {
|
|
2669
2672
|
throw new f(h.UNKNOWN_ERROR, "로그아웃에 실패했습니다", e);
|
|
2670
2673
|
}
|
|
@@ -3090,7 +3093,7 @@ const Te = class Te extends ys {
|
|
|
3090
3093
|
n.address
|
|
3091
3094
|
)
|
|
3092
3095
|
});
|
|
3093
|
-
return
|
|
3096
|
+
return Ns(i.signature), {
|
|
3094
3097
|
chainId: e,
|
|
3095
3098
|
signature: i.signature,
|
|
3096
3099
|
address: n.address
|
|
@@ -3168,7 +3171,7 @@ const Te = class Te extends ys {
|
|
|
3168
3171
|
a
|
|
3169
3172
|
)
|
|
3170
3173
|
});
|
|
3171
|
-
return
|
|
3174
|
+
return Cs(o.signature), {
|
|
3172
3175
|
chainId: e,
|
|
3173
3176
|
signedTx: o.signature,
|
|
3174
3177
|
txHash: o.txHash ?? ""
|
|
@@ -3297,17 +3300,17 @@ const Te = class Te extends ys {
|
|
|
3297
3300
|
* logger.log(receipt.status); // '0x1' | '0x0'
|
|
3298
3301
|
*/
|
|
3299
3302
|
async sendTransactionWithWaitForReceipt(e, r, t = {}) {
|
|
3300
|
-
var w,
|
|
3303
|
+
var w, S;
|
|
3301
3304
|
if (this._isAuthenticatedViaRNBridge) {
|
|
3302
3305
|
const I = fe.getBridge();
|
|
3303
3306
|
if (I != null && I.sendTransactionWithWaitForReceipt)
|
|
3304
3307
|
return this.bridgeSendTransactionWithWaitForReceipt(I, e, r, t);
|
|
3305
3308
|
}
|
|
3306
|
-
const { intervalMs: n, timeoutMs: i, ...o } = t, { txHash: a } = await this.sendTransaction(e, r, o), c = n ?? ((w = this._config.receiptPolling) == null ? void 0 : w.intervalMs) ?? Ss, l = i ?? ((
|
|
3309
|
+
const { intervalMs: n, timeoutMs: i, ...o } = t, { txHash: a } = await this.sendTransaction(e, r, o), c = n ?? ((w = this._config.receiptPolling) == null ? void 0 : w.intervalMs) ?? Ss, l = i ?? ((S = this._config.receiptPolling) == null ? void 0 : S.timeoutMs) ?? Ut, u = nt(e), p = r.from ?? "";
|
|
3307
3310
|
let g, _;
|
|
3308
3311
|
const x = this.waitForTxAndGetReceipt(a, e, { intervalMs: c, timeoutMs: l }).then((I) => {
|
|
3309
3312
|
g = I;
|
|
3310
|
-
const
|
|
3313
|
+
const N = 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" + N.toString(16), u.symbol, u.decimals, this._config.displayDecimals), q = Ge("0x" + (R + N).toString(16), u.symbol, u.decimals, this._config.displayDecimals);
|
|
3311
3314
|
return {
|
|
3312
3315
|
chainId: e,
|
|
3313
3316
|
txHash: a,
|
|
@@ -3618,9 +3621,9 @@ const Te = class Te extends ys {
|
|
|
3618
3621
|
* EIP-1193 `accountsChanged` 는 **이전 active address 가 존재하고 새 address 와 다른 경우에만** emit.
|
|
3619
3622
|
* 첫 로그인 시점에는 emit 하지 않는다 (dapp 이 `eth_accounts` / `eth_requestAccounts` 로 받음).
|
|
3620
3623
|
*/
|
|
3621
|
-
setActiveWallet(e, r) {
|
|
3622
|
-
const
|
|
3623
|
-
this.stateManager.setActiveWallet(e, r
|
|
3624
|
+
setActiveWallet(e, r, t) {
|
|
3625
|
+
const n = this.address;
|
|
3626
|
+
this.stateManager.setActiveWallet(e, r, t), n && e && n.toLowerCase() !== e.toLowerCase() && this.emitAccountsChanged(e);
|
|
3624
3627
|
}
|
|
3625
3628
|
/**
|
|
3626
3629
|
* §13.6.4 [v0.5.7] Native-initiated wallet change push event subscription.
|
|
@@ -3655,7 +3658,8 @@ const Te = class Te extends ys {
|
|
|
3655
3658
|
d.warn("[walletChanged] invalid source — 이벤트 무시", t);
|
|
3656
3659
|
return;
|
|
3657
3660
|
}
|
|
3658
|
-
|
|
3661
|
+
const i = typeof t.walletName == "string" ? t.walletName.trim() : "", o = i.length > 0 && i.length <= 64 ? i : void 0;
|
|
3662
|
+
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);
|
|
3659
3663
|
}), d.log("[CROSSx] bridge.onEvent walletChanged 구독 완료");
|
|
3660
3664
|
}
|
|
3661
3665
|
/** AuthResult를 내부 상태에 반영합니다. */
|
|
@@ -4377,30 +4381,30 @@ const kt = (s) => (wt << BigInt(s)) - wt;
|
|
|
4377
4381
|
function bn(s, e, r) {
|
|
4378
4382
|
if (me(s, "hashLen"), me(e, "qByteLen"), typeof r != "function")
|
|
4379
4383
|
throw new Error("hmacFn must be a function");
|
|
4380
|
-
const t = (
|
|
4384
|
+
const t = (S) => new Uint8Array(S), n = Uint8Array.of(), i = Uint8Array.of(0), o = Uint8Array.of(1), a = 1e3;
|
|
4381
4385
|
let c = t(s), l = t(s), u = 0;
|
|
4382
4386
|
const p = () => {
|
|
4383
4387
|
c.fill(1), l.fill(0), u = 0;
|
|
4384
|
-
}, g = (...
|
|
4385
|
-
l = g(i,
|
|
4388
|
+
}, g = (...S) => r(l, Se(c, ...S)), _ = (S = n) => {
|
|
4389
|
+
l = g(i, S), c = g(), S.length !== 0 && (l = g(o, S), c = g());
|
|
4386
4390
|
}, x = () => {
|
|
4387
4391
|
if (u++ >= a)
|
|
4388
4392
|
throw new Error("drbg: tried max amount of iterations");
|
|
4389
|
-
let
|
|
4393
|
+
let S = 0;
|
|
4390
4394
|
const I = [];
|
|
4391
|
-
for (;
|
|
4395
|
+
for (; S < e; ) {
|
|
4392
4396
|
c = g();
|
|
4393
|
-
const
|
|
4394
|
-
I.push(
|
|
4397
|
+
const N = c.slice();
|
|
4398
|
+
I.push(N), S += c.length;
|
|
4395
4399
|
}
|
|
4396
4400
|
return Se(...I);
|
|
4397
4401
|
};
|
|
4398
|
-
return (
|
|
4399
|
-
p(), _(
|
|
4400
|
-
let
|
|
4401
|
-
for (; !(
|
|
4402
|
+
return (S, I) => {
|
|
4403
|
+
p(), _(S);
|
|
4404
|
+
let N;
|
|
4405
|
+
for (; !(N = I(x())); )
|
|
4402
4406
|
_();
|
|
4403
|
-
return p(),
|
|
4407
|
+
return p(), N;
|
|
4404
4408
|
};
|
|
4405
4409
|
}
|
|
4406
4410
|
function Rt(s, e = {}, r = {}) {
|
|
@@ -4457,7 +4461,7 @@ function Ot(s, e, r) {
|
|
|
4457
4461
|
if (!s.eql(s.sqr(e), r))
|
|
4458
4462
|
throw new Error("Cannot find square root");
|
|
4459
4463
|
}
|
|
4460
|
-
function
|
|
4464
|
+
function Nr(s, e) {
|
|
4461
4465
|
const r = (s.ORDER + te) / Tr, t = s.pow(e, r);
|
|
4462
4466
|
return Ot(s, t, e), t;
|
|
4463
4467
|
}
|
|
@@ -4466,16 +4470,16 @@ function En(s, e) {
|
|
|
4466
4470
|
return Ot(s, a, e), a;
|
|
4467
4471
|
}
|
|
4468
4472
|
function An(s) {
|
|
4469
|
-
const e = rt(s), r =
|
|
4473
|
+
const e = rt(s), r = Cr(s), t = r(e, e.neg(e.ONE)), n = r(e, t), i = r(e, e.neg(t)), o = (s + vn) / Or;
|
|
4470
4474
|
return (a, c) => {
|
|
4471
4475
|
let l = a.pow(c, o), u = a.mul(l, t);
|
|
4472
4476
|
const p = a.mul(l, n), g = a.mul(l, i), _ = a.eql(a.sqr(u), c), x = a.eql(a.sqr(p), c);
|
|
4473
4477
|
l = a.cmov(l, u, _), u = a.cmov(g, p, x);
|
|
4474
|
-
const w = a.eql(a.sqr(u), c),
|
|
4475
|
-
return Ot(a,
|
|
4478
|
+
const w = a.eql(a.sqr(u), c), S = a.cmov(l, u, w);
|
|
4479
|
+
return Ot(a, S, c), S;
|
|
4476
4480
|
};
|
|
4477
4481
|
}
|
|
4478
|
-
function
|
|
4482
|
+
function Cr(s) {
|
|
4479
4483
|
if (s < Ir)
|
|
4480
4484
|
throw new Error("sqrt is not defined for small field");
|
|
4481
4485
|
let e = s - te, r = 0;
|
|
@@ -4487,7 +4491,7 @@ function Nr(s) {
|
|
|
4487
4491
|
if (t++ > 1e3)
|
|
4488
4492
|
throw new Error("Cannot find square root: probably non-prime P");
|
|
4489
4493
|
if (r === 1)
|
|
4490
|
-
return
|
|
4494
|
+
return Nr;
|
|
4491
4495
|
let i = n.pow(t, e);
|
|
4492
4496
|
const o = (e + te) / ke;
|
|
4493
4497
|
return function(c, l) {
|
|
@@ -4503,14 +4507,14 @@ function Nr(s) {
|
|
|
4503
4507
|
for (; !c.eql(w, c.ONE); )
|
|
4504
4508
|
if (x++, w = c.sqr(w), x === u)
|
|
4505
4509
|
throw new Error("Cannot find square root");
|
|
4506
|
-
const
|
|
4510
|
+
const S = te << BigInt(u - x - 1), I = c.pow(p, S);
|
|
4507
4511
|
u = x, p = c.sqr(I), g = c.mul(g, p), _ = c.mul(_, I);
|
|
4508
4512
|
}
|
|
4509
4513
|
return _;
|
|
4510
4514
|
};
|
|
4511
4515
|
}
|
|
4512
4516
|
function In(s) {
|
|
4513
|
-
return s % Tr === Ir ?
|
|
4517
|
+
return s % Tr === Ir ? Nr : s % Rr === kr ? En : s % Or === Sn ? An(s) : Cr(s);
|
|
4514
4518
|
}
|
|
4515
4519
|
const Tn = [
|
|
4516
4520
|
"create",
|
|
@@ -4566,7 +4570,7 @@ function On(s, e) {
|
|
|
4566
4570
|
const r = e !== void 0 ? e : s.toString(2).length, t = Math.ceil(r / 8);
|
|
4567
4571
|
return { nBitLength: r, nByteLength: t };
|
|
4568
4572
|
}
|
|
4569
|
-
class
|
|
4573
|
+
class Nn {
|
|
4570
4574
|
constructor(e, r = {}) {
|
|
4571
4575
|
P(this, "ORDER");
|
|
4572
4576
|
P(this, "BITS");
|
|
@@ -4679,7 +4683,7 @@ class Cn {
|
|
|
4679
4683
|
}
|
|
4680
4684
|
}
|
|
4681
4685
|
function rt(s, e = {}) {
|
|
4682
|
-
return new
|
|
4686
|
+
return new Nn(s, e);
|
|
4683
4687
|
}
|
|
4684
4688
|
function Lr(s) {
|
|
4685
4689
|
if (typeof s != "bigint")
|
|
@@ -4691,7 +4695,7 @@ function Dr(s) {
|
|
|
4691
4695
|
const e = Lr(s);
|
|
4692
4696
|
return e + Math.ceil(e / 2);
|
|
4693
4697
|
}
|
|
4694
|
-
function
|
|
4698
|
+
function Cn(s, e, r = !1) {
|
|
4695
4699
|
V(s);
|
|
4696
4700
|
const t = s.length, n = Lr(e), i = Dr(e);
|
|
4697
4701
|
if (t < 16 || t < i || t > 1024)
|
|
@@ -5042,37 +5046,37 @@ function Un(s, e = {}) {
|
|
|
5042
5046
|
throw new Error("compression is not supported: Field does not have .isOdd()");
|
|
5043
5047
|
}
|
|
5044
5048
|
function p(F, m, y) {
|
|
5045
|
-
const { x: k, y:
|
|
5049
|
+
const { x: k, y: C } = m.toAffine(), B = t.toBytes(k);
|
|
5046
5050
|
if (Xe(y, "isCompressed"), y) {
|
|
5047
5051
|
u();
|
|
5048
|
-
const b = !t.isOdd(
|
|
5052
|
+
const b = !t.isOdd(C);
|
|
5049
5053
|
return Se(Hr(b), B);
|
|
5050
5054
|
} else
|
|
5051
|
-
return Se(Uint8Array.of(4), B, t.toBytes(
|
|
5055
|
+
return Se(Uint8Array.of(4), B, t.toBytes(C));
|
|
5052
5056
|
}
|
|
5053
5057
|
function g(F) {
|
|
5054
5058
|
V(F, void 0, "Point");
|
|
5055
|
-
const { publicKey: m, publicKeyUncompressed: y } = l, k = F.length,
|
|
5056
|
-
if (k === m && (
|
|
5059
|
+
const { publicKey: m, publicKeyUncompressed: y } = l, k = F.length, C = F[0], B = F.subarray(1);
|
|
5060
|
+
if (k === m && (C === 2 || C === 3)) {
|
|
5057
5061
|
const b = t.fromBytes(B);
|
|
5058
5062
|
if (!t.isValid(b))
|
|
5059
5063
|
throw new Error("bad point: is not on curve, wrong x");
|
|
5060
5064
|
const v = w(b);
|
|
5061
|
-
let
|
|
5065
|
+
let E;
|
|
5062
5066
|
try {
|
|
5063
|
-
|
|
5067
|
+
E = t.sqrt(v);
|
|
5064
5068
|
} catch (W) {
|
|
5065
5069
|
const U = W instanceof Error ? ": " + W.message : "";
|
|
5066
5070
|
throw new Error("bad point: is not on curve, sqrt error" + U);
|
|
5067
5071
|
}
|
|
5068
5072
|
u();
|
|
5069
|
-
const T = t.isOdd(
|
|
5070
|
-
return (
|
|
5071
|
-
} else if (k === y &&
|
|
5072
|
-
const b = t.BYTES, v = t.fromBytes(B.subarray(0, b)),
|
|
5073
|
-
if (!
|
|
5073
|
+
const T = t.isOdd(E);
|
|
5074
|
+
return (C & 1) === 1 !== T && (E = t.neg(E)), { x: b, y: E };
|
|
5075
|
+
} else if (k === y && C === 4) {
|
|
5076
|
+
const b = t.BYTES, v = t.fromBytes(B.subarray(0, b)), E = t.fromBytes(B.subarray(b, b * 2));
|
|
5077
|
+
if (!S(v, E))
|
|
5074
5078
|
throw new Error("bad point: is not on curve");
|
|
5075
|
-
return { x: v, y:
|
|
5079
|
+
return { x: v, y: E };
|
|
5076
5080
|
} else
|
|
5077
5081
|
throw new Error(`bad point: got length ${k}, expected compressed=${m} or uncompressed=${y}`);
|
|
5078
5082
|
}
|
|
@@ -5081,14 +5085,14 @@ function Un(s, e = {}) {
|
|
|
5081
5085
|
const m = t.sqr(F), y = t.mul(m, F);
|
|
5082
5086
|
return t.add(t.add(y, t.mul(F, i.a)), i.b);
|
|
5083
5087
|
}
|
|
5084
|
-
function
|
|
5088
|
+
function S(F, m) {
|
|
5085
5089
|
const y = t.sqr(m), k = w(F);
|
|
5086
5090
|
return t.eql(y, k);
|
|
5087
5091
|
}
|
|
5088
|
-
if (!
|
|
5092
|
+
if (!S(i.Gx, i.Gy))
|
|
5089
5093
|
throw new Error("bad curve params: generator point");
|
|
5090
|
-
const I = t.mul(t.pow(i.a, ze), Fn),
|
|
5091
|
-
if (t.is0(t.add(I,
|
|
5094
|
+
const I = t.mul(t.pow(i.a, ze), Fn), N = t.mul(t.sqr(i.b), BigInt(27));
|
|
5095
|
+
if (t.is0(t.add(I, N)))
|
|
5092
5096
|
throw new Error("bad curve params: a or b");
|
|
5093
5097
|
function R(F, m, y = !1) {
|
|
5094
5098
|
if (!t.isValid(m) || y && t.is0(m))
|
|
@@ -5105,15 +5109,15 @@ function Un(s, e = {}) {
|
|
|
5105
5109
|
return Bn(F, c.basises, n.ORDER);
|
|
5106
5110
|
}
|
|
5107
5111
|
const q = Xt((F, m) => {
|
|
5108
|
-
const { X: y, Y: k, Z:
|
|
5109
|
-
if (t.eql(
|
|
5112
|
+
const { X: y, Y: k, Z: C } = F;
|
|
5113
|
+
if (t.eql(C, t.ONE))
|
|
5110
5114
|
return { x: y, y: k };
|
|
5111
5115
|
const B = F.is0();
|
|
5112
|
-
m == null && (m = B ? t.ONE : t.inv(
|
|
5113
|
-
const b = t.mul(y, m), v = t.mul(k, m),
|
|
5116
|
+
m == null && (m = B ? t.ONE : t.inv(C));
|
|
5117
|
+
const b = t.mul(y, m), v = t.mul(k, m), E = t.mul(C, m);
|
|
5114
5118
|
if (B)
|
|
5115
5119
|
return { x: t.ZERO, y: t.ZERO };
|
|
5116
|
-
if (!t.eql(
|
|
5120
|
+
if (!t.eql(E, t.ONE))
|
|
5117
5121
|
throw new Error("invZ was invalid");
|
|
5118
5122
|
return { x: b, y: v };
|
|
5119
5123
|
}), J = Xt((F) => {
|
|
@@ -5125,14 +5129,14 @@ function Un(s, e = {}) {
|
|
|
5125
5129
|
const { x: m, y } = F.toAffine();
|
|
5126
5130
|
if (!t.isValid(m) || !t.isValid(y))
|
|
5127
5131
|
throw new Error("bad point: x or y not field elements");
|
|
5128
|
-
if (!
|
|
5132
|
+
if (!S(m, y))
|
|
5129
5133
|
throw new Error("bad point: equation left != right");
|
|
5130
5134
|
if (!F.isTorsionFree())
|
|
5131
5135
|
throw new Error("bad point: not in prime-order subgroup");
|
|
5132
5136
|
return !0;
|
|
5133
5137
|
});
|
|
5134
|
-
function G(F, m, y, k,
|
|
5135
|
-
return y = new X(t.mul(y.X, F), y.Y, y.Z), m = Je(k, m), y = Je(
|
|
5138
|
+
function G(F, m, y, k, C) {
|
|
5139
|
+
return y = new X(t.mul(y.X, F), y.Y, y.Z), m = Je(k, m), y = Je(C, y), m.add(y);
|
|
5136
5140
|
}
|
|
5137
5141
|
const D = class D {
|
|
5138
5142
|
/** Does NOT validate if the point is valid. Use `.assertValidity()`. */
|
|
@@ -5190,8 +5194,8 @@ function Un(s, e = {}) {
|
|
|
5190
5194
|
/** Compare one point to another. */
|
|
5191
5195
|
equals(m) {
|
|
5192
5196
|
L(m);
|
|
5193
|
-
const { X: y, Y: k, Z:
|
|
5194
|
-
return
|
|
5197
|
+
const { X: y, Y: k, Z: C } = this, { X: B, Y: b, Z: v } = m, E = t.eql(t.mul(y, v), t.mul(B, C)), T = t.eql(t.mul(k, v), t.mul(b, C));
|
|
5198
|
+
return E && T;
|
|
5195
5199
|
}
|
|
5196
5200
|
/** Flips point to one corresponding to (x, -y) in Affine coordinates. */
|
|
5197
5201
|
negate() {
|
|
@@ -5202,9 +5206,9 @@ function Un(s, e = {}) {
|
|
|
5202
5206
|
// https://eprint.iacr.org/2015/1060, algorithm 3
|
|
5203
5207
|
// Cost: 8M + 3S + 3*a + 2*b3 + 15add.
|
|
5204
5208
|
double() {
|
|
5205
|
-
const { a: m, b: y } = i, k = t.mul(y, ze), { X:
|
|
5206
|
-
let v = t.ZERO,
|
|
5207
|
-
return $ = t.add($, $), T = t.mul(
|
|
5209
|
+
const { a: m, b: y } = i, k = t.mul(y, ze), { X: C, Y: B, Z: b } = this;
|
|
5210
|
+
let v = t.ZERO, E = t.ZERO, T = t.ZERO, O = t.mul(C, C), W = t.mul(B, B), U = t.mul(b, b), $ = t.mul(C, B);
|
|
5211
|
+
return $ = t.add($, $), T = t.mul(C, b), T = t.add(T, T), v = t.mul(m, T), E = t.mul(k, U), E = t.add(v, E), v = t.sub(W, E), E = t.add(W, E), E = t.mul(v, E), v = t.mul($, v), T = t.mul(k, T), U = t.mul(m, U), $ = t.sub(O, U), $ = t.mul(m, $), $ = t.add($, T), T = t.add(O, O), O = t.add(T, O), O = t.add(O, U), O = t.mul(O, $), E = t.add(E, O), U = t.mul(B, b), U = t.add(U, U), O = t.mul(U, $), v = t.sub(v, O), T = t.mul(U, W), T = t.add(T, T), T = t.add(T, T), new D(v, E, T);
|
|
5208
5212
|
}
|
|
5209
5213
|
// Renes-Costello-Batina exception-free addition formula.
|
|
5210
5214
|
// There is 30% faster Jacobian formula, but it is not complete.
|
|
@@ -5212,13 +5216,13 @@ function Un(s, e = {}) {
|
|
|
5212
5216
|
// Cost: 12M + 0S + 3*a + 3*b3 + 23add.
|
|
5213
5217
|
add(m) {
|
|
5214
5218
|
L(m);
|
|
5215
|
-
const { X: y, Y: k, Z:
|
|
5216
|
-
let
|
|
5219
|
+
const { X: y, Y: k, Z: C } = this, { X: B, Y: b, Z: v } = m;
|
|
5220
|
+
let E = t.ZERO, T = t.ZERO, O = t.ZERO;
|
|
5217
5221
|
const W = i.a, U = t.mul(i.b, ze);
|
|
5218
|
-
let $ = t.mul(y, B), K = t.mul(k, b), Y = t.mul(
|
|
5219
|
-
ne = t.mul(ne, z), z = t.add($, K), ne = t.sub(ne, z), z = t.add(y,
|
|
5222
|
+
let $ = t.mul(y, B), K = t.mul(k, b), Y = t.mul(C, v), ne = t.add(y, k), z = t.add(B, b);
|
|
5223
|
+
ne = t.mul(ne, z), z = t.add($, K), ne = t.sub(ne, z), z = t.add(y, C);
|
|
5220
5224
|
let ee = t.add(B, v);
|
|
5221
|
-
return z = t.mul(z, ee), ee = t.add($, Y), z = t.sub(z, ee), ee = t.add(k,
|
|
5225
|
+
return z = t.mul(z, ee), ee = t.add($, Y), z = t.sub(z, ee), ee = t.add(k, C), E = t.add(b, v), ee = t.mul(ee, E), E = t.add(K, Y), ee = t.sub(ee, E), O = t.mul(W, z), E = t.mul(U, Y), O = t.add(E, O), E = t.sub(K, O), O = t.add(K, O), T = t.mul(E, O), K = t.add($, $), K = t.add(K, $), Y = t.mul(W, Y), z = t.mul(U, z), K = t.add(K, Y), Y = t.sub($, Y), Y = t.mul(W, Y), z = t.add(z, Y), $ = t.mul(K, z), T = t.add(T, $), $ = t.mul(ee, z), E = t.mul(ne, E), E = t.sub(E, $), $ = t.mul(ne, K), O = t.mul(ee, O), O = t.add(O, $), new D(E, T, O);
|
|
5222
5226
|
}
|
|
5223
5227
|
subtract(m) {
|
|
5224
5228
|
return this.add(m.negate());
|
|
@@ -5239,16 +5243,16 @@ function Un(s, e = {}) {
|
|
|
5239
5243
|
const { endo: y } = e;
|
|
5240
5244
|
if (!n.isValidNot0(m))
|
|
5241
5245
|
throw new Error("invalid scalar: out of range");
|
|
5242
|
-
let k,
|
|
5246
|
+
let k, C;
|
|
5243
5247
|
const B = (b) => H.cached(this, b, (v) => Qt(D, v));
|
|
5244
5248
|
if (y) {
|
|
5245
|
-
const { k1neg: b, k1: v, k2neg:
|
|
5246
|
-
|
|
5249
|
+
const { k1neg: b, k1: v, k2neg: E, k2: T } = M(m), { p: O, f: W } = B(v), { p: U, f: $ } = B(T);
|
|
5250
|
+
C = W.add($), k = G(y.beta, O, U, b, E);
|
|
5247
5251
|
} else {
|
|
5248
5252
|
const { p: b, f: v } = B(m);
|
|
5249
|
-
k = b,
|
|
5253
|
+
k = b, C = v;
|
|
5250
5254
|
}
|
|
5251
|
-
return Qt(D, [k,
|
|
5255
|
+
return Qt(D, [k, C])[0];
|
|
5252
5256
|
}
|
|
5253
5257
|
/**
|
|
5254
5258
|
* Non-constant-time multiplication. Uses double-and-add algorithm.
|
|
@@ -5266,8 +5270,8 @@ function Un(s, e = {}) {
|
|
|
5266
5270
|
if (H.hasCache(this))
|
|
5267
5271
|
return this.multiply(m);
|
|
5268
5272
|
if (y) {
|
|
5269
|
-
const { k1neg:
|
|
5270
|
-
return G(y.beta,
|
|
5273
|
+
const { k1neg: C, k1: B, k2neg: b, k2: v } = M(m), { p1: E, p2: T } = Ln(D, k, B, v);
|
|
5274
|
+
return G(y.beta, E, T, C, b);
|
|
5271
5275
|
} else
|
|
5272
5276
|
return H.unsafe(k, m);
|
|
5273
5277
|
}
|
|
@@ -5336,34 +5340,34 @@ function Hn(s, e = {}) {
|
|
|
5336
5340
|
}
|
|
5337
5341
|
}
|
|
5338
5342
|
function o(_, x) {
|
|
5339
|
-
const { publicKey: w, publicKeyUncompressed:
|
|
5343
|
+
const { publicKey: w, publicKeyUncompressed: S } = n;
|
|
5340
5344
|
try {
|
|
5341
5345
|
const I = _.length;
|
|
5342
|
-
return x === !0 && I !== w || x === !1 && I !==
|
|
5346
|
+
return x === !0 && I !== w || x === !1 && I !== S ? !1 : !!s.fromBytes(_);
|
|
5343
5347
|
} catch {
|
|
5344
5348
|
return !1;
|
|
5345
5349
|
}
|
|
5346
5350
|
}
|
|
5347
5351
|
function a(_ = t(n.seed)) {
|
|
5348
|
-
return
|
|
5352
|
+
return Cn(V(_, n.seed, "seed"), r.ORDER);
|
|
5349
5353
|
}
|
|
5350
5354
|
function c(_, x = !0) {
|
|
5351
5355
|
return s.BASE.multiply(r.fromBytes(_)).toBytes(x);
|
|
5352
5356
|
}
|
|
5353
5357
|
function l(_) {
|
|
5354
|
-
const { secretKey: x, publicKey: w, publicKeyUncompressed:
|
|
5358
|
+
const { secretKey: x, publicKey: w, publicKeyUncompressed: S } = n;
|
|
5355
5359
|
if (!At(_) || "_lengths" in r && r._lengths || x === w)
|
|
5356
5360
|
return;
|
|
5357
5361
|
const I = V(_, void 0, "key").length;
|
|
5358
|
-
return I === w || I ===
|
|
5362
|
+
return I === w || I === S;
|
|
5359
5363
|
}
|
|
5360
5364
|
function u(_, x, w = !0) {
|
|
5361
5365
|
if (l(_) === !0)
|
|
5362
5366
|
throw new Error("first arg must be private key");
|
|
5363
5367
|
if (l(x) === !1)
|
|
5364
5368
|
throw new Error("second arg must be public key");
|
|
5365
|
-
const
|
|
5366
|
-
return s.fromBytes(x).multiply(
|
|
5369
|
+
const S = r.fromBytes(_);
|
|
5370
|
+
return s.fromBytes(x).multiply(S).toBytes(w);
|
|
5367
5371
|
}
|
|
5368
5372
|
const p = {
|
|
5369
5373
|
isValidSecretKey: i,
|
|
@@ -5386,7 +5390,7 @@ function Wn(s, e, r = {}) {
|
|
|
5386
5390
|
format: "compact",
|
|
5387
5391
|
extraEntropy: !1
|
|
5388
5392
|
}, w = a * Ur < i.ORDER;
|
|
5389
|
-
function
|
|
5393
|
+
function S(m) {
|
|
5390
5394
|
const y = a >> Le;
|
|
5391
5395
|
return m > y;
|
|
5392
5396
|
}
|
|
@@ -5395,37 +5399,37 @@ function Wn(s, e, r = {}) {
|
|
|
5395
5399
|
throw new Error(`invalid signature ${m}: out of range 1..Point.Fn.ORDER`);
|
|
5396
5400
|
return y;
|
|
5397
5401
|
}
|
|
5398
|
-
function
|
|
5402
|
+
function N() {
|
|
5399
5403
|
if (w)
|
|
5400
5404
|
throw new Error('"recovered" sig type is not supported for cofactor >2 curves');
|
|
5401
5405
|
}
|
|
5402
5406
|
function R(m, y) {
|
|
5403
5407
|
mt(y);
|
|
5404
|
-
const k = _.signature,
|
|
5405
|
-
return V(m,
|
|
5408
|
+
const k = _.signature, C = y === "compact" ? k : y === "recovered" ? k + 1 : void 0;
|
|
5409
|
+
return V(m, C);
|
|
5406
5410
|
}
|
|
5407
5411
|
class L {
|
|
5408
|
-
constructor(y, k,
|
|
5412
|
+
constructor(y, k, C) {
|
|
5409
5413
|
P(this, "r");
|
|
5410
5414
|
P(this, "s");
|
|
5411
5415
|
P(this, "recovery");
|
|
5412
|
-
if (this.r = I("r", y), this.s = I("s", k),
|
|
5413
|
-
if (
|
|
5416
|
+
if (this.r = I("r", y), this.s = I("s", k), C != null) {
|
|
5417
|
+
if (N(), ![0, 1, 2, 3].includes(C))
|
|
5414
5418
|
throw new Error("invalid recovery id");
|
|
5415
|
-
this.recovery =
|
|
5419
|
+
this.recovery = C;
|
|
5416
5420
|
}
|
|
5417
5421
|
Object.freeze(this);
|
|
5418
5422
|
}
|
|
5419
5423
|
static fromBytes(y, k = x.format) {
|
|
5420
5424
|
R(y, k);
|
|
5421
|
-
let
|
|
5425
|
+
let C;
|
|
5422
5426
|
if (k === "der") {
|
|
5423
|
-
const { r:
|
|
5424
|
-
return new L(
|
|
5427
|
+
const { r: E, s: T } = ve.toSig(V(y));
|
|
5428
|
+
return new L(E, T);
|
|
5425
5429
|
}
|
|
5426
|
-
k === "recovered" && (
|
|
5430
|
+
k === "recovered" && (C = y[0], k = "compact", y = y.subarray(1));
|
|
5427
5431
|
const B = _.signature / 2, b = y.subarray(0, B), v = y.subarray(B, B * 2);
|
|
5428
|
-
return new L(o.fromBytes(b), o.fromBytes(v),
|
|
5432
|
+
return new L(o.fromBytes(b), o.fromBytes(v), C);
|
|
5429
5433
|
}
|
|
5430
5434
|
static fromHex(y, k) {
|
|
5431
5435
|
return this.fromBytes(Ye(y), k);
|
|
@@ -5440,23 +5444,23 @@ function Wn(s, e, r = {}) {
|
|
|
5440
5444
|
return new L(this.r, this.s, y);
|
|
5441
5445
|
}
|
|
5442
5446
|
recoverPublicKey(y) {
|
|
5443
|
-
const { r: k, s:
|
|
5447
|
+
const { r: k, s: C } = this, B = this.assertRecovery(), b = B === 2 || B === 3 ? k + a : k;
|
|
5444
5448
|
if (!i.isValid(b))
|
|
5445
5449
|
throw new Error("invalid recovery id: sig.r+curve.n != R.x");
|
|
5446
|
-
const v = i.toBytes(b),
|
|
5450
|
+
const v = i.toBytes(b), E = s.fromBytes(Se(Hr((B & 1) === 0), v)), T = o.inv(b), O = q(V(y, void 0, "msgHash")), W = o.create(-O * T), U = o.create(C * T), $ = s.BASE.multiplyUnsafe(W).add(E.multiplyUnsafe(U));
|
|
5447
5451
|
if ($.is0())
|
|
5448
5452
|
throw new Error("invalid recovery: point at infinify");
|
|
5449
5453
|
return $.assertValidity(), $;
|
|
5450
5454
|
}
|
|
5451
5455
|
// Signatures should be low-s, to prevent malleability.
|
|
5452
5456
|
hasHighS() {
|
|
5453
|
-
return
|
|
5457
|
+
return S(this.s);
|
|
5454
5458
|
}
|
|
5455
5459
|
toBytes(y = x.format) {
|
|
5456
5460
|
if (mt(y), y === "der")
|
|
5457
5461
|
return Ye(ve.hexFromSig(this));
|
|
5458
|
-
const { r: k, s:
|
|
5459
|
-
return y === "recovered" ? (
|
|
5462
|
+
const { r: k, s: C } = this, B = o.toBytes(k), b = o.toBytes(C);
|
|
5463
|
+
return y === "recovered" ? (N(), Se(Uint8Array.of(this.assertRecovery()), B, b)) : Se(B, b);
|
|
5460
5464
|
}
|
|
5461
5465
|
toHex(y) {
|
|
5462
5466
|
return We(this.toBytes(y));
|
|
@@ -5465,8 +5469,8 @@ function Wn(s, e, r = {}) {
|
|
|
5465
5469
|
const M = r.bits2int || function(y) {
|
|
5466
5470
|
if (y.length > 8192)
|
|
5467
5471
|
throw new Error("input is too large");
|
|
5468
|
-
const k = tt(y),
|
|
5469
|
-
return
|
|
5472
|
+
const k = tt(y), C = y.length * 8 - c;
|
|
5473
|
+
return C > 0 ? k >> BigInt(C) : k;
|
|
5470
5474
|
}, q = r.bits2int_modN || function(y) {
|
|
5471
5475
|
return o.create(M(y));
|
|
5472
5476
|
}, J = kt(c);
|
|
@@ -5477,12 +5481,12 @@ function Wn(s, e, r = {}) {
|
|
|
5477
5481
|
return V(m, void 0, "message"), y ? V(e(m), void 0, "prehashed message") : m;
|
|
5478
5482
|
}
|
|
5479
5483
|
function Q(m, y, k) {
|
|
5480
|
-
const { lowS:
|
|
5484
|
+
const { lowS: C, prehash: B, extraEntropy: b } = ut(k, x);
|
|
5481
5485
|
m = X(m, B);
|
|
5482
|
-
const v = q(m),
|
|
5483
|
-
if (!o.isValidNot0(
|
|
5486
|
+
const v = q(m), E = o.fromBytes(y);
|
|
5487
|
+
if (!o.isValidNot0(E))
|
|
5484
5488
|
throw new Error("invalid private key");
|
|
5485
|
-
const T = [G(
|
|
5489
|
+
const T = [G(E), G(v)];
|
|
5486
5490
|
if (b != null && b !== !1) {
|
|
5487
5491
|
const $ = b === !0 ? t(_.secretKey) : b;
|
|
5488
5492
|
T.push(V($, void 0, "extraEntropy"));
|
|
@@ -5495,38 +5499,38 @@ function Wn(s, e, r = {}) {
|
|
|
5495
5499
|
const Y = o.inv(K), ne = s.BASE.multiply(K).toAffine(), z = o.create(ne.x);
|
|
5496
5500
|
if (z === ge)
|
|
5497
5501
|
return;
|
|
5498
|
-
const ee = o.create(Y * o.create(W + z *
|
|
5502
|
+
const ee = o.create(Y * o.create(W + z * E));
|
|
5499
5503
|
if (ee === ge)
|
|
5500
5504
|
return;
|
|
5501
5505
|
let Lt = (ne.x === z ? 0 : 2) | Number(ne.y & Le), Dt = ee;
|
|
5502
|
-
return
|
|
5506
|
+
return C && S(ee) && (Dt = o.neg(ee), Lt ^= 1), new L(z, Dt, w ? void 0 : Lt);
|
|
5503
5507
|
}
|
|
5504
5508
|
return { seed: O, k2sig: U };
|
|
5505
5509
|
}
|
|
5506
5510
|
function H(m, y, k = {}) {
|
|
5507
|
-
const { seed:
|
|
5508
|
-
return bn(e.outputLen, o.BYTES, n)(
|
|
5511
|
+
const { seed: C, k2sig: B } = Q(m, y, k);
|
|
5512
|
+
return bn(e.outputLen, o.BYTES, n)(C, B).toBytes(k.format);
|
|
5509
5513
|
}
|
|
5510
|
-
function D(m, y, k,
|
|
5511
|
-
const { lowS: B, prehash: b, format: v } = ut(
|
|
5514
|
+
function D(m, y, k, C = {}) {
|
|
5515
|
+
const { lowS: B, prehash: b, format: v } = ut(C, x);
|
|
5512
5516
|
if (k = V(k, void 0, "publicKey"), y = X(y, b), !At(m)) {
|
|
5513
|
-
const
|
|
5514
|
-
throw new Error("verify expects Uint8Array signature" +
|
|
5517
|
+
const E = m instanceof L ? ", use sig.toBytes()" : "";
|
|
5518
|
+
throw new Error("verify expects Uint8Array signature" + E);
|
|
5515
5519
|
}
|
|
5516
5520
|
R(m, v);
|
|
5517
5521
|
try {
|
|
5518
|
-
const
|
|
5519
|
-
if (B &&
|
|
5522
|
+
const E = L.fromBytes(m, v), T = s.fromBytes(k);
|
|
5523
|
+
if (B && E.hasHighS())
|
|
5520
5524
|
return !1;
|
|
5521
|
-
const { r: O, s: W } =
|
|
5525
|
+
const { r: O, s: W } = E, U = q(y), $ = o.inv(W), K = o.create(U * $), Y = o.create(O * $), ne = s.BASE.multiplyUnsafe(K).add(T.multiplyUnsafe(Y));
|
|
5522
5526
|
return ne.is0() ? !1 : o.create(ne.x) === O;
|
|
5523
5527
|
} catch {
|
|
5524
5528
|
return !1;
|
|
5525
5529
|
}
|
|
5526
5530
|
}
|
|
5527
5531
|
function F(m, y, k = {}) {
|
|
5528
|
-
const { prehash:
|
|
5529
|
-
return y = X(y,
|
|
5532
|
+
const { prehash: C } = ut(k, x);
|
|
5533
|
+
return y = X(y, C), L.fromBytes(m, "recovered").recoverPublicKey(y).toBytes();
|
|
5530
5534
|
}
|
|
5531
5535
|
return Object.freeze({
|
|
5532
5536
|
keygen: l,
|
|
@@ -5543,7 +5547,7 @@ function Wn(s, e, r = {}) {
|
|
|
5543
5547
|
});
|
|
5544
5548
|
}
|
|
5545
5549
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
5546
|
-
const
|
|
5550
|
+
const Nt = {
|
|
5547
5551
|
p: BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),
|
|
5548
5552
|
n: BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),
|
|
5549
5553
|
h: BigInt(1),
|
|
@@ -5559,12 +5563,12 @@ const Ct = {
|
|
|
5559
5563
|
]
|
|
5560
5564
|
}, nr = /* @__PURE__ */ BigInt(2);
|
|
5561
5565
|
function qn(s) {
|
|
5562
|
-
const e =
|
|
5566
|
+
const e = Nt.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, N = oe(I, a, e) * w % e, R = oe(N, r, e) * u % e, L = oe(R, o, e) * x % e, M = oe(L, t, e) * l % e, q = oe(M, nr, e);
|
|
5563
5567
|
if (!yt.eql(yt.sqr(q), s))
|
|
5564
5568
|
throw new Error("Cannot find square root");
|
|
5565
5569
|
return q;
|
|
5566
5570
|
}
|
|
5567
|
-
const yt = rt(
|
|
5571
|
+
const yt = rt(Nt.p, { sqrt: qn }), Kn = /* @__PURE__ */ Un(Nt, {
|
|
5568
5572
|
Fp: yt,
|
|
5569
5573
|
endo: Gn
|
|
5570
5574
|
}), 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 = [];
|
|
@@ -5601,7 +5605,7 @@ function ei(s, e = 24) {
|
|
|
5601
5605
|
}
|
|
5602
5606
|
$e(r);
|
|
5603
5607
|
}
|
|
5604
|
-
class
|
|
5608
|
+
class Ct {
|
|
5605
5609
|
// NOTE: we accept arguments in bytes instead of bits here.
|
|
5606
5610
|
constructor(e, r, t, n = !1, i = 24) {
|
|
5607
5611
|
P(this, "state");
|
|
@@ -5674,10 +5678,10 @@ class Nt {
|
|
|
5674
5678
|
}
|
|
5675
5679
|
_cloneInto(e) {
|
|
5676
5680
|
const { blockLen: r, suffix: t, outputLen: n, rounds: i, enableXOF: o } = this;
|
|
5677
|
-
return e || (e = new
|
|
5681
|
+
return e || (e = new Ct(r, t, n, o, i)), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = i, e.suffix = t, e.outputLen = n, e.enableXOF = o, e.destroyed = this.destroyed, e;
|
|
5678
5682
|
}
|
|
5679
5683
|
}
|
|
5680
|
-
const ti = (s, e, r, t = {}) => yr(() => new
|
|
5684
|
+
const ti = (s, e, r, t = {}) => yr(() => new Ct(e, s, r), t), ar = /* @__PURE__ */ ti(1, 136, 32), ri = 60;
|
|
5681
5685
|
class si {
|
|
5682
5686
|
constructor() {
|
|
5683
5687
|
this.jwks = null;
|
|
@@ -5748,8 +5752,8 @@ ${t.length}`
|
|
|
5748
5752
|
const c = ni(a), l = c.slice(0, 32), u = c.slice(32, 64), p = c[64], g = p >= 27 ? p - 27 : p, w = new Vn.Signature(
|
|
5749
5753
|
cr(l),
|
|
5750
5754
|
cr(u)
|
|
5751
|
-
).addRecoveryBit(g).recoverPublicKey(o).toBytes(!1).slice(1),
|
|
5752
|
-
return "0x" + We(
|
|
5755
|
+
).addRecoveryBit(g).recoverPublicKey(o).toBytes(!1).slice(1), S = ar(w);
|
|
5756
|
+
return "0x" + We(S.slice(12));
|
|
5753
5757
|
}
|
|
5754
5758
|
}
|
|
5755
5759
|
function ni(s) {
|
|
@@ -5896,19 +5900,19 @@ class Ae {
|
|
|
5896
5900
|
const _ = setTimeout(() => {
|
|
5897
5901
|
d.warn("[CROSSx] OAuth 타임아웃 (5분) — postMessage를 수신하지 못했습니다"), L(), t(new Error("Authentication timeout"));
|
|
5898
5902
|
}, 5 * 60 * 1e3), x = 10, w = 30;
|
|
5899
|
-
let
|
|
5900
|
-
const
|
|
5903
|
+
let S = 0, I = null;
|
|
5904
|
+
const N = () => {
|
|
5901
5905
|
clearInterval(R), d.warn("[CROSSx] COOP 감지 — OAuth 서버 응답을 " + w + "초간 대기합니다"), I = setTimeout(() => {
|
|
5902
5906
|
L(), t(new Error(
|
|
5903
5907
|
"OAuth 서버로부터 응답을 받지 못했습니다. 브라우저 보안 정책(COOP)으로 인해 팝업 통신이 차단되었을 수 있습니다. 다시 시도해 주세요."
|
|
5904
5908
|
));
|
|
5905
5909
|
}, w * 1e3);
|
|
5906
5910
|
}, R = setInterval(() => {
|
|
5907
|
-
|
|
5911
|
+
S++;
|
|
5908
5912
|
try {
|
|
5909
|
-
g.closed && (
|
|
5913
|
+
g.closed && (S <= x ? N() : (L(), t(new Error("로그인이 취소되었습니다"))));
|
|
5910
5914
|
} catch {
|
|
5911
|
-
|
|
5915
|
+
N();
|
|
5912
5916
|
}
|
|
5913
5917
|
}, 1e3), L = () => {
|
|
5914
5918
|
clearTimeout(_), clearInterval(R), I && clearTimeout(I), window.removeEventListener("message", M);
|
|
@@ -5947,8 +5951,8 @@ class Ae {
|
|
|
5947
5951
|
return;
|
|
5948
5952
|
}
|
|
5949
5953
|
const m = { token: D, email: F }, y = (k) => {
|
|
5950
|
-
Ae.verifyIdTokenNonce(k, l).then(() => r(m)).catch((
|
|
5951
|
-
d.error("[CROSSx] nonce 검증 실패:",
|
|
5954
|
+
Ae.verifyIdTokenNonce(k, l).then(() => r(m)).catch((C) => {
|
|
5955
|
+
d.error("[CROSSx] nonce 검증 실패:", C), t(C instanceof Error ? C : new Error("nonce verification failed"));
|
|
5952
5956
|
});
|
|
5953
5957
|
};
|
|
5954
5958
|
H ? H.split(".").length === 3 ? y(H) : Q ? y(Q) : (d.warn(
|
|
@@ -6194,9 +6198,9 @@ class Ie {
|
|
|
6194
6198
|
h.USER_NOT_FOUND,
|
|
6195
6199
|
Ie.getGatewayErrorMessage(_.code, x)
|
|
6196
6200
|
);
|
|
6197
|
-
const
|
|
6201
|
+
const S = w === h.AUTH_NOT_AUTHENTICATED ? h.SESSION_EXPIRED : w, I = S === h.SESSION_EXPIRED ? "인증 세션이 만료되었습니다. 다시 로그인해 주세요." : Ie.getGatewayErrorMessage(_.code, x), N = _.data;
|
|
6198
6202
|
let R;
|
|
6199
|
-
throw w === h.PIN_LOCKED ? R = Ie.extractLockDetails(
|
|
6203
|
+
throw w === h.PIN_LOCKED ? R = Ie.extractLockDetails(N) : w === h.ADDRESS_LIMIT_EXCEEDED ? R = { limit: gt, raw: N } : R = N ?? void 0, new f(S, I, R);
|
|
6200
6204
|
}
|
|
6201
6205
|
return d.log("[CROSSx] Wallet Gateway API 성공:", { code: _.code, url: o, method: e }), _.data ?? _;
|
|
6202
6206
|
}
|
|
@@ -6213,16 +6217,16 @@ class Ie {
|
|
|
6213
6217
|
);
|
|
6214
6218
|
}
|
|
6215
6219
|
if ((u = g.response) != null && u.data) {
|
|
6216
|
-
const x = g.response.data, w = x.message || x.data || "API 요청에 실패했습니다",
|
|
6220
|
+
const x = g.response.data, w = x.message || x.data || "API 요청에 실패했습니다", S = x.code || "UNKNOWN";
|
|
6217
6221
|
throw d.error("[CROSSx] Wallet Gateway API 에러 (HTTP 에러):", {
|
|
6218
|
-
code:
|
|
6222
|
+
code: S,
|
|
6219
6223
|
message: w,
|
|
6220
6224
|
url: o,
|
|
6221
6225
|
method: e,
|
|
6222
6226
|
status: (p = g.response) == null ? void 0 : p.status
|
|
6223
6227
|
}), new f(
|
|
6224
6228
|
h.UNKNOWN_ERROR,
|
|
6225
|
-
`Wallet Gateway 오류 (${
|
|
6229
|
+
`Wallet Gateway 오류 (${S}): ${w}`
|
|
6226
6230
|
);
|
|
6227
6231
|
}
|
|
6228
6232
|
throw g;
|
|
@@ -9079,7 +9083,7 @@ function _i(s) {
|
|
|
9079
9083
|
}, { passive: !0 });
|
|
9080
9084
|
}
|
|
9081
9085
|
const fi = () => /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
|
|
9082
|
-
function
|
|
9086
|
+
function Ne() {
|
|
9083
9087
|
if (fi()) {
|
|
9084
9088
|
const e = window.scrollY;
|
|
9085
9089
|
return document.body.style.position = "fixed", document.body.style.top = `-${e}px`, document.body.style.left = "0", document.body.style.right = "0", () => {
|
|
@@ -9140,7 +9144,7 @@ function bt(s, e) {
|
|
|
9140
9144
|
return i ? `${t}.${i}` : `${t}`;
|
|
9141
9145
|
}
|
|
9142
9146
|
function vt(s, e) {
|
|
9143
|
-
return s === e ?
|
|
9147
|
+
return s === e ? A(s) : `<span class="__crossx-amount-tip" data-full="${A(e)}">${A(s)}</span>`;
|
|
9144
9148
|
}
|
|
9145
9149
|
function St(s, e, r) {
|
|
9146
9150
|
if (s === 0n) return "0";
|
|
@@ -9258,11 +9262,11 @@ function j(s, e) {
|
|
|
9258
9262
|
}
|
|
9259
9263
|
function Ai(s, e, r, t) {
|
|
9260
9264
|
const n = e, i = s.nativeSymbol ?? "ETH", o = s.nativeDecimals ?? 18, a = st(s.dappName), c = s.to ? `<span class="__crossx-addr-text">${de(s.to)}</span>
|
|
9261
|
-
<button class="__crossx-copy-btn" data-copy="${
|
|
9265
|
+
<button class="__crossx-copy-btn" data-copy="${A(s.to)}" title="Copy address">${we}</button>` : "<span>—</span>", l = Yr(s, r, t), u = zr(s.value, i, o, r), p = u ? j((t == null ? void 0 : t.label_value) ?? "Value", `<span>${u}</span>`) : "", g = s.data ?? "0x", _ = document.createElement("div");
|
|
9262
9266
|
return _.id = Z, _.innerHTML = `
|
|
9263
9267
|
<div class="__crossx-card __crossx-card--migration __crossx-card--sign-tx" style="${ie(n)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
9264
9268
|
<div class="__crossx-header">
|
|
9265
|
-
<p class="__crossx-title" id="__crossx-ttl">${
|
|
9269
|
+
<p class="__crossx-title" id="__crossx-ttl">${A((t == null ? void 0 : t.sign_transaction_title) ?? "Signature Request")}</p>
|
|
9266
9270
|
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${se}</button>
|
|
9267
9271
|
</div>
|
|
9268
9272
|
<hr class="__crossx-divider">
|
|
@@ -9270,13 +9274,13 @@ function Ai(s, e, r, t) {
|
|
|
9270
9274
|
<div class="__crossx-body-cols">
|
|
9271
9275
|
<div class="__crossx-col-left">
|
|
9272
9276
|
<p class="__crossx-sig-subtitle">
|
|
9273
|
-
<span class="__crossx-sig-origin">${
|
|
9277
|
+
<span class="__crossx-sig-origin">${A(a)}</span>${A((t == null ? void 0 : t.signature_requesting) ?? " is requesting a Signature")}
|
|
9274
9278
|
</p>
|
|
9275
9279
|
<div class="__crossx-addr-pill">
|
|
9276
9280
|
${Pt}
|
|
9277
9281
|
<span class="__crossx-addr-pill-text">${de(s.from)}</span>
|
|
9278
9282
|
</div>
|
|
9279
|
-
<p class="__crossx-warning">${
|
|
9283
|
+
<p class="__crossx-warning">${A((t == null ? void 0 : t.signature_warning) ?? "After you sign, changes or cancellations are not possible.")}</p>
|
|
9280
9284
|
</div>
|
|
9281
9285
|
<hr class="__crossx-divider __crossx-divider--cols">
|
|
9282
9286
|
<div class="__crossx-col-right-sign">
|
|
@@ -9286,12 +9290,12 @@ function Ai(s, e, r, t) {
|
|
|
9286
9290
|
${p}
|
|
9287
9291
|
${l}
|
|
9288
9292
|
</div>
|
|
9289
|
-
<pre class="__crossx-raw-tx">${
|
|
9293
|
+
<pre class="__crossx-raw-tx">${A(g)}</pre>
|
|
9290
9294
|
</div>
|
|
9291
9295
|
</div>
|
|
9292
9296
|
<div class="__crossx-btn-row">
|
|
9293
|
-
<button class="__crossx-cancel-btn" id="__crossx-cancel-btn">${
|
|
9294
|
-
<button class="__crossx-confirm-btn" id="__crossx-confirm-btn">${
|
|
9297
|
+
<button class="__crossx-cancel-btn" id="__crossx-cancel-btn">${A((t == null ? void 0 : t.cancel) ?? "Cancel")}</button>
|
|
9298
|
+
<button class="__crossx-confirm-btn" id="__crossx-confirm-btn">${A((t == null ? void 0 : t.signature_sign_button) ?? "Sign")}</button>
|
|
9295
9299
|
</div>
|
|
9296
9300
|
</div>
|
|
9297
9301
|
</div>
|
|
@@ -9299,17 +9303,17 @@ function Ai(s, e, r, t) {
|
|
|
9299
9303
|
}
|
|
9300
9304
|
function Ii(s, e, r, t) {
|
|
9301
9305
|
const n = e, i = s.nativeSymbol ?? "ETH", o = s.nativeDecimals ?? 18, a = st(s.dappName), c = s.to ? `<span class="__crossx-addr-text">${de(s.to)}</span>
|
|
9302
|
-
<button class="__crossx-copy-btn" data-copy="${
|
|
9306
|
+
<button class="__crossx-copy-btn" data-copy="${A(s.to)}" title="Copy address">${we}</button>` : "<span>—</span>", l = Yr(s, r, t), p = zr(s.value, i, o, r) ?? "—", g = document.createElement("div");
|
|
9303
9307
|
return g.id = Z, g.innerHTML = `
|
|
9304
9308
|
<div class="__crossx-card __crossx-card--migration __crossx-card--send-tx" style="${ie(n)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
9305
9309
|
<div class="__crossx-header">
|
|
9306
|
-
<p class="__crossx-title" id="__crossx-ttl">${
|
|
9310
|
+
<p class="__crossx-title" id="__crossx-ttl">${A((t == null ? void 0 : t.send_transaction_title) ?? "Approve transaction")}</p>
|
|
9307
9311
|
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${se}</button>
|
|
9308
9312
|
</div>
|
|
9309
9313
|
<hr class="__crossx-divider">
|
|
9310
9314
|
<div class="__crossx-body">
|
|
9311
9315
|
<p class="__crossx-tx-subtitle">
|
|
9312
|
-
<span class="__crossx-sig-origin">${
|
|
9316
|
+
<span class="__crossx-sig-origin">${A(a)}</span>${A((t == null ? void 0 : t.send_tx_permission_text) ?? " wants your permission to approve the following transaction.")}
|
|
9313
9317
|
</p>
|
|
9314
9318
|
<div class="__crossx-body-cols">
|
|
9315
9319
|
<div class="__crossx-rows">
|
|
@@ -9322,7 +9326,7 @@ function Ii(s, e, r, t) {
|
|
|
9322
9326
|
<span class="__crossx-pill-amount">${p}</span>
|
|
9323
9327
|
</div>
|
|
9324
9328
|
</div>
|
|
9325
|
-
<button class="__crossx-approve-btn" id="__crossx-confirm-btn">${
|
|
9329
|
+
<button class="__crossx-approve-btn" id="__crossx-confirm-btn">${A((t == null ? void 0 : t.send_tx_approve_button) ?? "Approve")}</button>
|
|
9326
9330
|
</div>
|
|
9327
9331
|
</div>
|
|
9328
9332
|
`, g;
|
|
@@ -9336,17 +9340,17 @@ function st(s) {
|
|
|
9336
9340
|
return "This site";
|
|
9337
9341
|
}
|
|
9338
9342
|
}
|
|
9339
|
-
function
|
|
9343
|
+
function A(s) {
|
|
9340
9344
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
9341
9345
|
}
|
|
9342
9346
|
function Ti(s) {
|
|
9343
9347
|
return typeof s == "string" && /^0x[0-9a-fA-F]{40}$/i.test(s);
|
|
9344
9348
|
}
|
|
9345
9349
|
function ki(s) {
|
|
9346
|
-
if (typeof s == "string") return
|
|
9350
|
+
if (typeof s == "string") return A(s);
|
|
9347
9351
|
if (typeof s == "number" || typeof s == "bigint" || typeof s == "boolean") return String(s);
|
|
9348
9352
|
try {
|
|
9349
|
-
return
|
|
9353
|
+
return A(JSON.stringify(s));
|
|
9350
9354
|
} catch {
|
|
9351
9355
|
return String(s);
|
|
9352
9356
|
}
|
|
@@ -9357,33 +9361,33 @@ function Ri(s) {
|
|
|
9357
9361
|
function Oi(s) {
|
|
9358
9362
|
return `https://www.crossscan.io/address/${s}?tab=txs`;
|
|
9359
9363
|
}
|
|
9360
|
-
function
|
|
9364
|
+
function Ni(s, e) {
|
|
9361
9365
|
return `https://explorer.crosstoken.io/${Ri(s)}/tx/${e}`;
|
|
9362
9366
|
}
|
|
9363
9367
|
function Jr(s, e) {
|
|
9364
|
-
return `<a class="__crossx-addr-text __crossx-row-link" href="${
|
|
9368
|
+
return `<a class="__crossx-addr-text __crossx-row-link" href="${A(e)}" target="_blank" rel="noopener noreferrer">${A(s)}</a>`;
|
|
9365
9369
|
}
|
|
9366
9370
|
function Ze(s) {
|
|
9367
9371
|
return Jr(de(s), Oi(s));
|
|
9368
9372
|
}
|
|
9369
9373
|
function Zr(s, e) {
|
|
9370
|
-
return Jr(de(e),
|
|
9374
|
+
return Jr(de(e), Ni(s, e));
|
|
9371
9375
|
}
|
|
9372
|
-
function
|
|
9376
|
+
function Ci(s, e, r) {
|
|
9373
9377
|
const t = j(
|
|
9374
9378
|
(r == null ? void 0 : r.label_from) ?? "From",
|
|
9375
9379
|
`${Ze(s.from)}
|
|
9376
|
-
<button class="__crossx-copy-btn" data-copy="${
|
|
9380
|
+
<button class="__crossx-copy-btn" data-copy="${A(s.from)}" title="Copy address">${we}</button>`
|
|
9377
9381
|
), n = s.to ? j((r == null ? void 0 : r.label_to) ?? "To", `${Ze(s.to)}
|
|
9378
|
-
<button class="__crossx-copy-btn" data-copy="${
|
|
9379
|
-
<button class="__crossx-copy-btn" data-copy="${
|
|
9380
|
-
<span class="__crossx-total-label">${
|
|
9381
|
-
<span class="__crossx-total-amount">${
|
|
9382
|
+
<button class="__crossx-copy-btn" data-copy="${A(s.to)}" title="Copy address">${we}</button>`) : "", i = s.amount ? j((r == null ? void 0 : r.label_transfer) ?? "Transfer", `<span>${A(s.amount)}</span>`) : "", o = s.fees ? j((r == null ? void 0 : r.label_tx_fee) ?? "Tx Fee", `<span>${A(s.fees)}</span>`) : "", a = s.txHash ? j((r == null ? void 0 : r.label_tx_hash) ?? "Tx Hash", `${Zr(s.chainId, s.txHash)}
|
|
9383
|
+
<button class="__crossx-copy-btn" data-copy="${A(s.txHash)}" title="Copy hash">${we}</button>`) : "", c = s.total ? `<div class="__crossx-total-pill">
|
|
9384
|
+
<span class="__crossx-total-label">${A((r == null ? void 0 : r.label_total) ?? "Total")}<br>${A((r == null ? void 0 : r.label_including_fees) ?? "(including fees)")}</span>
|
|
9385
|
+
<span class="__crossx-total-amount">${A(s.total)}</span>
|
|
9382
9386
|
</div>` : "", l = document.createElement("div");
|
|
9383
9387
|
return l.id = Z, l.innerHTML = `
|
|
9384
9388
|
<div class="__crossx-card __crossx-card--migration" style="${ie(e)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
9385
9389
|
<div class="__crossx-header">
|
|
9386
|
-
<p class="__crossx-title" id="__crossx-ttl">${
|
|
9390
|
+
<p class="__crossx-title" id="__crossx-ttl">${A((r == null ? void 0 : r.tx_success) ?? "Transaction complete")}</p>
|
|
9387
9391
|
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${se}</button>
|
|
9388
9392
|
</div>
|
|
9389
9393
|
<hr class="__crossx-divider">
|
|
@@ -9396,7 +9400,7 @@ function Ni(s, e, r) {
|
|
|
9396
9400
|
${a}
|
|
9397
9401
|
</div>
|
|
9398
9402
|
${c}
|
|
9399
|
-
<button class="__crossx-approve-btn" id="__crossx-done-btn">${
|
|
9403
|
+
<button class="__crossx-approve-btn" id="__crossx-done-btn">${A((r == null ? void 0 : r.tx_complete_done_button) ?? "All Done")}</button>
|
|
9400
9404
|
</div>
|
|
9401
9405
|
</div>
|
|
9402
9406
|
`, l;
|
|
@@ -9406,13 +9410,13 @@ function Pi(s, e, r) {
|
|
|
9406
9410
|
return t.id = Z, t.innerHTML = `
|
|
9407
9411
|
<div class="__crossx-card __crossx-card--migration" style="${ie(e)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
9408
9412
|
<div class="__crossx-header">
|
|
9409
|
-
<p class="__crossx-title" id="__crossx-ttl">${
|
|
9413
|
+
<p class="__crossx-title" id="__crossx-ttl">${A((r == null ? void 0 : r.tx_progress_waiting_title) ?? "Waiting for confirmation")}</p>
|
|
9410
9414
|
</div>
|
|
9411
9415
|
<hr class="__crossx-divider">
|
|
9412
9416
|
<div class="__crossx-body" id="__crossx-progress-body">
|
|
9413
9417
|
<div class="__crossx-progress-center">
|
|
9414
9418
|
<div class="__crossx-spinner"></div>
|
|
9415
|
-
<p class="__crossx-progress-text">${
|
|
9419
|
+
<p class="__crossx-progress-text">${A((r == null ? void 0 : r.tx_progress_waiting_text) ?? "Waiting for transaction receipt...")}</p>
|
|
9416
9420
|
</div>
|
|
9417
9421
|
</div>
|
|
9418
9422
|
</div>
|
|
@@ -9421,8 +9425,8 @@ function Pi(s, e, r) {
|
|
|
9421
9425
|
function Li(s, e, r, t) {
|
|
9422
9426
|
const n = e.status !== "reverted" && e.status !== "timeout", i = e.status === "timeout", o = s.querySelector("#__crossx-ttl"), a = s.querySelector(".__crossx-header");
|
|
9423
9427
|
if (o) {
|
|
9424
|
-
const w = i ? Ei : n ? "" : Si,
|
|
9425
|
-
w ? (o.style.display = "flex", o.style.alignItems = "center", o.style.gap = "8px", o.innerHTML = `${w}<span>${
|
|
9428
|
+
const w = i ? Ei : n ? "" : Si, S = i ? (t == null ? void 0 : t.tx_timeout) ?? "Transaction timeout" : n ? (t == null ? void 0 : t.tx_success) ?? "Transaction complete" : (t == null ? void 0 : t.tx_failed) ?? "Transaction failed";
|
|
9429
|
+
w ? (o.style.display = "flex", o.style.alignItems = "center", o.style.gap = "8px", o.innerHTML = `${w}<span>${A(S)}</span>`) : o.textContent = S;
|
|
9426
9430
|
}
|
|
9427
9431
|
if (a && !s.querySelector("#__crossx-close-btn")) {
|
|
9428
9432
|
const w = document.createElement("button");
|
|
@@ -9431,11 +9435,11 @@ function Li(s, e, r, t) {
|
|
|
9431
9435
|
const c = s.querySelector("#__crossx-progress-body");
|
|
9432
9436
|
if (!c) return;
|
|
9433
9437
|
const l = e.from ? j((t == null ? void 0 : t.label_from) ?? "From", `${Ze(e.from)}
|
|
9434
|
-
<button class="__crossx-copy-btn" data-copy="${
|
|
9435
|
-
<button class="__crossx-copy-btn" data-copy="${
|
|
9436
|
-
<button class="__crossx-copy-btn" data-copy="${
|
|
9437
|
-
<span class="__crossx-total-label">${
|
|
9438
|
-
<span class="__crossx-total-amount">${
|
|
9438
|
+
<button class="__crossx-copy-btn" data-copy="${A(e.from)}" title="Copy address">${we}</button>`) : "", u = e.to ? j((t == null ? void 0 : t.label_to) ?? "To", `${Ze(e.to)}
|
|
9439
|
+
<button class="__crossx-copy-btn" data-copy="${A(e.to)}" title="Copy address">${we}</button>`) : "", p = e.amount ? j((t == null ? void 0 : t.label_transfer) ?? "Transfer", `<span>${A(e.amount)}</span>`) : "", g = e.fees ? j((t == null ? void 0 : t.label_tx_fee) ?? "Tx Fee", `<span>${A(e.fees)}</span>`) : "", _ = e.txHash ? j((t == null ? void 0 : t.label_tx_hash) ?? "Tx Hash", `${Zr(e.chainId, e.txHash)}
|
|
9440
|
+
<button class="__crossx-copy-btn" data-copy="${A(e.txHash)}" title="Copy hash">${we}</button>`) : "", x = e.total ? `<div class="__crossx-total-pill">
|
|
9441
|
+
<span class="__crossx-total-label">${A((t == null ? void 0 : t.label_total) ?? "Total")}<br>${A((t == null ? void 0 : t.label_including_fees) ?? "(including fees)")}</span>
|
|
9442
|
+
<span class="__crossx-total-amount">${A(e.total)}</span>
|
|
9439
9443
|
</div>` : "";
|
|
9440
9444
|
c.innerHTML = `
|
|
9441
9445
|
<div class="__crossx-rows">
|
|
@@ -9446,23 +9450,23 @@ function Li(s, e, r, t) {
|
|
|
9446
9450
|
${_}
|
|
9447
9451
|
</div>
|
|
9448
9452
|
${x}
|
|
9449
|
-
<button class="__crossx-approve-btn" id="__crossx-done-btn">${
|
|
9453
|
+
<button class="__crossx-approve-btn" id="__crossx-done-btn">${A((t == null ? void 0 : t.tx_complete_done_button) ?? (n ? "All Done" : "Done"))}</button>
|
|
9450
9454
|
`, c.querySelectorAll(".__crossx-copy-btn").forEach((w) => {
|
|
9451
|
-
w.addEventListener("click", (
|
|
9452
|
-
var
|
|
9453
|
-
|
|
9455
|
+
w.addEventListener("click", (S) => {
|
|
9456
|
+
var N;
|
|
9457
|
+
S.stopPropagation();
|
|
9454
9458
|
const I = w.dataset.copy;
|
|
9455
|
-
I && ((
|
|
9459
|
+
I && ((N = navigator.clipboard) == null || N.writeText(I).catch(() => {
|
|
9456
9460
|
}));
|
|
9457
9461
|
});
|
|
9458
9462
|
});
|
|
9459
9463
|
}
|
|
9460
9464
|
function Di(s, e, r) {
|
|
9461
|
-
const t = e, n = st(s.dappName), i =
|
|
9465
|
+
const t = e, n = st(s.dappName), i = A(s.message), o = document.createElement("div");
|
|
9462
9466
|
return o.id = Z, o.innerHTML = `
|
|
9463
9467
|
<div class="__crossx-card __crossx-card--migration __crossx-card--sign-msg" style="${ie(t)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
9464
9468
|
<div class="__crossx-header">
|
|
9465
|
-
<p class="__crossx-title" id="__crossx-ttl">${
|
|
9469
|
+
<p class="__crossx-title" id="__crossx-ttl">${A((r == null ? void 0 : r.sign_message_title) ?? "Signature Request")}</p>
|
|
9466
9470
|
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${se}</button>
|
|
9467
9471
|
</div>
|
|
9468
9472
|
<hr class="__crossx-divider">
|
|
@@ -9470,20 +9474,20 @@ function Di(s, e, r) {
|
|
|
9470
9474
|
<div class="__crossx-body-cols">
|
|
9471
9475
|
<div class="__crossx-col-left">
|
|
9472
9476
|
<p class="__crossx-sig-subtitle">
|
|
9473
|
-
<span class="__crossx-sig-origin">${
|
|
9477
|
+
<span class="__crossx-sig-origin">${A(n)}</span>${A((r == null ? void 0 : r.signature_requesting) ?? " is requesting a Signature")}
|
|
9474
9478
|
</p>
|
|
9475
9479
|
<div class="__crossx-addr-pill">
|
|
9476
9480
|
${Pt}
|
|
9477
9481
|
<span class="__crossx-addr-pill-text">${de(s.from)}</span>
|
|
9478
9482
|
</div>
|
|
9479
|
-
<p class="__crossx-warning">${
|
|
9483
|
+
<p class="__crossx-warning">${A((r == null ? void 0 : r.signature_warning) ?? "After you sign, changes or cancellations are not possible.")}</p>
|
|
9480
9484
|
</div>
|
|
9481
9485
|
<hr class="__crossx-divider __crossx-divider--cols">
|
|
9482
9486
|
<div class="__crossx-msg-raw">${i}</div>
|
|
9483
9487
|
</div>
|
|
9484
9488
|
<div class="__crossx-btn-row">
|
|
9485
|
-
<button class="__crossx-cancel-btn" id="__crossx-cancel-btn">${
|
|
9486
|
-
<button class="__crossx-confirm-btn" id="__crossx-confirm-btn">${
|
|
9489
|
+
<button class="__crossx-cancel-btn" id="__crossx-cancel-btn">${A((r == null ? void 0 : r.cancel) ?? "Cancel")}</button>
|
|
9490
|
+
<button class="__crossx-confirm-btn" id="__crossx-confirm-btn">${A((r == null ? void 0 : r.confirm) ?? "Confirm")}</button>
|
|
9487
9491
|
</div>
|
|
9488
9492
|
</div>
|
|
9489
9493
|
</div>
|
|
@@ -9501,15 +9505,15 @@ function $i(s, e, r) {
|
|
|
9501
9505
|
const o = i.primaryType ?? "—", a = i.message ?? {};
|
|
9502
9506
|
let c = `
|
|
9503
9507
|
<div class="__crossx-td-row">
|
|
9504
|
-
<span class="__crossx-td-label">${
|
|
9505
|
-
<span class="__crossx-td-value">${
|
|
9508
|
+
<span class="__crossx-td-label">${A((r == null ? void 0 : r.label_primary_type) ?? "Primary Type")}</span>
|
|
9509
|
+
<span class="__crossx-td-value">${A(o)}</span>
|
|
9506
9510
|
</div>`;
|
|
9507
9511
|
for (const [u, p] of Object.entries(a)) {
|
|
9508
9512
|
const g = ki(p), x = Ti(p) ? `<span class="__crossx-addr-text">${de(p)}</span>
|
|
9509
|
-
<button class="__crossx-copy-btn" data-copy="${
|
|
9513
|
+
<button class="__crossx-copy-btn" data-copy="${A(String(p))}" title="Copy">${we}</button>` : `<span>${g}</span>`;
|
|
9510
9514
|
c += `
|
|
9511
9515
|
<div class="__crossx-td-row">
|
|
9512
|
-
<span class="__crossx-td-label">${
|
|
9516
|
+
<span class="__crossx-td-label">${A(u)}</span>
|
|
9513
9517
|
<div class="__crossx-td-value">${x}</div>
|
|
9514
9518
|
</div>`;
|
|
9515
9519
|
}
|
|
@@ -9517,7 +9521,7 @@ function $i(s, e, r) {
|
|
|
9517
9521
|
return l.id = Z, l.innerHTML = `
|
|
9518
9522
|
<div class="__crossx-card __crossx-card--migration __crossx-card--sign-typed" style="${ie(t)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
9519
9523
|
<div class="__crossx-header">
|
|
9520
|
-
<p class="__crossx-title" id="__crossx-ttl">${
|
|
9524
|
+
<p class="__crossx-title" id="__crossx-ttl">${A((r == null ? void 0 : r.sign_typed_data_title) ?? "Signature Request")}</p>
|
|
9521
9525
|
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${se}</button>
|
|
9522
9526
|
</div>
|
|
9523
9527
|
<hr class="__crossx-divider">
|
|
@@ -9525,20 +9529,20 @@ function $i(s, e, r) {
|
|
|
9525
9529
|
<div class="__crossx-body-cols">
|
|
9526
9530
|
<div class="__crossx-col-left">
|
|
9527
9531
|
<p class="__crossx-sig-subtitle">
|
|
9528
|
-
<span class="__crossx-sig-origin">${
|
|
9532
|
+
<span class="__crossx-sig-origin">${A(n)}</span>${A((r == null ? void 0 : r.signature_requesting) ?? " is requesting a Signature")}
|
|
9529
9533
|
</p>
|
|
9530
9534
|
<div class="__crossx-addr-pill">
|
|
9531
9535
|
${Pt}
|
|
9532
9536
|
<span class="__crossx-addr-pill-text">${de(s.from)}</span>
|
|
9533
9537
|
</div>
|
|
9534
|
-
<p class="__crossx-warning">${
|
|
9538
|
+
<p class="__crossx-warning">${A((r == null ? void 0 : r.signature_warning) ?? "After you sign, changes or cancellations are not possible.")}</p>
|
|
9535
9539
|
</div>
|
|
9536
9540
|
<hr class="__crossx-divider __crossx-divider--cols">
|
|
9537
9541
|
<div class="__crossx-td-rows">${c}</div>
|
|
9538
9542
|
</div>
|
|
9539
9543
|
<div class="__crossx-btn-row">
|
|
9540
|
-
<button class="__crossx-cancel-btn" id="__crossx-cancel-btn">${
|
|
9541
|
-
<button class="__crossx-confirm-btn" id="__crossx-confirm-btn">${
|
|
9544
|
+
<button class="__crossx-cancel-btn" id="__crossx-cancel-btn">${A((r == null ? void 0 : r.cancel) ?? "Cancel")}</button>
|
|
9545
|
+
<button class="__crossx-confirm-btn" id="__crossx-confirm-btn">${A((r == null ? void 0 : r.confirm) ?? "Confirm")}</button>
|
|
9542
9546
|
</div>
|
|
9543
9547
|
</div>
|
|
9544
9548
|
</div>
|
|
@@ -9565,17 +9569,17 @@ function es(s, e, r) {
|
|
|
9565
9569
|
}
|
|
9566
9570
|
function Wi(s, e, r, t) {
|
|
9567
9571
|
const n = r == null ? void 0 : r.toLowerCase(), i = s.map((a) => {
|
|
9568
|
-
const c = n && a.address.toLowerCase() === n, l = c ? " __crossx-wallet-item--selected" : "", u = c ? `<span class="__crossx-wallet-selected">${
|
|
9569
|
-
return `<button class="__crossx-wallet-item${l}" data-wallet-index="${a.index}" data-wallet-address="${
|
|
9570
|
-
${es(a.address, a.index, e.bg)}<span class="__crossx-wallet-info"><span class="__crossx-wallet-idx">${
|
|
9572
|
+
const c = n && a.address.toLowerCase() === n, l = c ? " __crossx-wallet-item--selected" : "", u = c ? `<span class="__crossx-wallet-selected">${A((t == null ? void 0 : t.wallet_selector_selected) ?? "Selected")}</span><span class="__crossx-wallet-check">${Mi}</span>` : "";
|
|
9573
|
+
return `<button class="__crossx-wallet-item${l}" data-wallet-index="${a.index}" data-wallet-address="${A(a.address)}">
|
|
9574
|
+
${es(a.address, a.index, e.bg)}<span class="__crossx-wallet-info"><span class="__crossx-wallet-idx">${A(Qr(a))}</span><span class="__crossx-wallet-addr">${de(a.address)}</span></span>${u}
|
|
9571
9575
|
</button>`;
|
|
9572
9576
|
}).join(""), o = document.createElement("div");
|
|
9573
9577
|
return o.id = Z, o.innerHTML = `
|
|
9574
9578
|
<div class="__crossx-card __crossx-card--migration __crossx-card--wallet-selector" style="${ie(e)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
9575
9579
|
<div class="__crossx-header">
|
|
9576
9580
|
<div style="display:flex;flex-direction:column;gap:4px;padding-right:36px;">
|
|
9577
|
-
<p class="__crossx-title" id="__crossx-ttl" style="padding-right:0;">${
|
|
9578
|
-
<p class="__crossx-subtitle--body">${
|
|
9581
|
+
<p class="__crossx-title" id="__crossx-ttl" style="padding-right:0;">${A((t == null ? void 0 : t.wallet_selector_title) ?? "Select Connected Wallet")}</p>
|
|
9582
|
+
<p class="__crossx-subtitle--body">${A((t == null ? void 0 : t.wallet_selector_description) ?? "Please select the wallet you previously used for this game to continue.")}</p>
|
|
9579
9583
|
</div>
|
|
9580
9584
|
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${se}</button>
|
|
9581
9585
|
</div>
|
|
@@ -9584,8 +9588,8 @@ function Wi(s, e, r, t) {
|
|
|
9584
9588
|
<div class="__crossx-body-cols">
|
|
9585
9589
|
<div class="__crossx-col-left">
|
|
9586
9590
|
<div class="__crossx-mig-info">
|
|
9587
|
-
<p class="__crossx-mig-info-title">${
|
|
9588
|
-
<p class="__crossx-mig-info-desc">${
|
|
9591
|
+
<p class="__crossx-mig-info-title">${A((t == null ? void 0 : t.wallet_selector_info_title) ?? "Why do I need to select a wallet?")}</p>
|
|
9592
|
+
<p class="__crossx-mig-info-desc">${A((t == null ? void 0 : t.wallet_selector_info_desc) ?? "Identifying your previously linked wallet ensures your game progress and assets are synced correctly.")}</p>
|
|
9589
9593
|
</div>
|
|
9590
9594
|
</div>
|
|
9591
9595
|
<hr class="__crossx-divider __crossx-divider--cols">
|
|
@@ -9595,7 +9599,7 @@ function Wi(s, e, r, t) {
|
|
|
9595
9599
|
</div>
|
|
9596
9600
|
<button class="__crossx-wallet-add" id="__crossx-add-wallet-btn" type="button">
|
|
9597
9601
|
<span class="__crossx-wallet-add-icon">${Bi}</span>
|
|
9598
|
-
<span class="__crossx-wallet-add-label">${
|
|
9602
|
+
<span class="__crossx-wallet-add-label">${A((t == null ? void 0 : t.wallet_selector_add_button) ?? "add a wallet")}</span>
|
|
9599
9603
|
</button>
|
|
9600
9604
|
<p class="__crossx-wallet-add-error" id="__crossx-add-wallet-error" role="alert" aria-live="polite" hidden></p>
|
|
9601
9605
|
</div>
|
|
@@ -9615,7 +9619,7 @@ const Gi = `<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="h
|
|
|
9615
9619
|
</svg>`;
|
|
9616
9620
|
function Ki(s) {
|
|
9617
9621
|
const e = ls(s);
|
|
9618
|
-
return `<span class="__crossx-connect-other-wallet-desc-part"><span class="__crossx-connect-other-wallet-icon" aria-hidden="true">${vi[s] ?? ""}</span><span class="__crossx-connect-other-wallet-name">${
|
|
9622
|
+
return `<span class="__crossx-connect-other-wallet-desc-part"><span class="__crossx-connect-other-wallet-icon" aria-hidden="true">${vi[s] ?? ""}</span><span class="__crossx-connect-other-wallet-name">${A(e)}</span></span>`;
|
|
9619
9623
|
}
|
|
9620
9624
|
function Vi(s) {
|
|
9621
9625
|
if (s.length === 0) return "";
|
|
@@ -9630,13 +9634,13 @@ function Vi(s) {
|
|
|
9630
9634
|
return `${r}${e(0)}, ${e(1)}, ${e(2)}, and ${t} more.`;
|
|
9631
9635
|
}
|
|
9632
9636
|
function zi(s, e = [], r) {
|
|
9633
|
-
const t = s, n =
|
|
9637
|
+
const t = s, n = A(String(e[0])), i = A((r == null ? void 0 : r.login_selector_or) ?? "or"), o = e.length > 0 ? `
|
|
9634
9638
|
<div class="__crossx-login-or-divider">
|
|
9635
9639
|
<hr><span>${i}</span><hr>
|
|
9636
9640
|
</div>
|
|
9637
9641
|
<button type="button" class="__crossx-connect-other-block" id="__crossx-connect-other-wallet-btn" data-wallet-id="${n}" aria-labelledby="__crossx-connect-other-heading">
|
|
9638
9642
|
<span class="__crossx-connect-other-text">
|
|
9639
|
-
<span class="__crossx-connect-other-title" id="__crossx-connect-other-heading">${
|
|
9643
|
+
<span class="__crossx-connect-other-title" id="__crossx-connect-other-heading">${A((r == null ? void 0 : r.login_selector_connect_other_wallets) ?? "Connect with Other Wallets")}</span>
|
|
9640
9644
|
<span class="__crossx-connect-other-desc __crossx-connect-other-summary">${Vi(e)}</span>
|
|
9641
9645
|
</span>
|
|
9642
9646
|
</button>` : "", a = document.createElement("div");
|
|
@@ -9644,8 +9648,8 @@ function zi(s, e = [], r) {
|
|
|
9644
9648
|
<div class="__crossx-card __crossx-card--migration" style="${ie(t)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
9645
9649
|
<div class="__crossx-header">
|
|
9646
9650
|
<div style="display:flex;flex-direction:column;gap:4px;padding-right:36px;">
|
|
9647
|
-
<p class="__crossx-title" id="__crossx-ttl" style="padding-right:0;">${
|
|
9648
|
-
<p class="__crossx-subtitle">${
|
|
9651
|
+
<p class="__crossx-title" id="__crossx-ttl" style="padding-right:0;">${A((r == null ? void 0 : r.login_selector_title) ?? "CROSS Wallet")}</p>
|
|
9652
|
+
<p class="__crossx-subtitle">${A((r == null ? void 0 : r.login_selector_subtitle) ?? "Sign in instantly with your social account")}</p>
|
|
9649
9653
|
</div>
|
|
9650
9654
|
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${se}</button>
|
|
9651
9655
|
</div>
|
|
@@ -9654,15 +9658,15 @@ function zi(s, e = [], r) {
|
|
|
9654
9658
|
<div class="__crossx-login-btn-row">
|
|
9655
9659
|
<button class="__crossx-login-btn" id="__crossx-apple-btn" type="button">
|
|
9656
9660
|
<span class="__crossx-login-icon" style="color:var(--cx-value);">${Gi}</span>
|
|
9657
|
-
<span class="__crossx-login-btn-label">${
|
|
9661
|
+
<span class="__crossx-login-btn-label">${A((r == null ? void 0 : r.login_selector_apple) ?? "Sign in with Apple")}</span>
|
|
9658
9662
|
</button>
|
|
9659
9663
|
<button class="__crossx-login-btn" id="__crossx-google-btn" type="button">
|
|
9660
9664
|
<span class="__crossx-login-icon">${qi}</span>
|
|
9661
|
-
<span class="__crossx-login-btn-label">${
|
|
9665
|
+
<span class="__crossx-login-btn-label">${A((r == null ? void 0 : r.login_selector_google) ?? "Sign in with Google")}</span>
|
|
9662
9666
|
</button>
|
|
9663
9667
|
</div>${o}
|
|
9664
9668
|
<p class="__crossx-login-terms">
|
|
9665
|
-
${((r == null ? void 0 : r.login_selector_terms_template) ?? "By continuing, you agree to NEXUS {tos} and consent to its {pp}").replace("{tos}", `<a class="__crossx-login-terms-link" href="https://terms.crosstoken.io/docs/cross-terms-of-use" target="_blank" rel="noopener noreferrer">${
|
|
9669
|
+
${((r == null ? void 0 : r.login_selector_terms_template) ?? "By continuing, you agree to NEXUS {tos} and consent to its {pp}").replace("{tos}", `<a class="__crossx-login-terms-link" href="https://terms.crosstoken.io/docs/cross-terms-of-use" target="_blank" rel="noopener noreferrer">${A((r == null ? void 0 : r.login_selector_terms_tos) ?? "Terms of Service")}</a>`).replace("{pp}", `<a class="__crossx-login-terms-link" href="https://terms.crosstoken.io/docs/nexus-privacy-policy" target="_blank" rel="noopener noreferrer">${A((r == null ? void 0 : r.login_selector_terms_pp) ?? "Privacy Policy.")}</a>`)}
|
|
9666
9670
|
</p>
|
|
9667
9671
|
</div>
|
|
9668
9672
|
</div>
|
|
@@ -9671,26 +9675,26 @@ function zi(s, e = [], r) {
|
|
|
9671
9675
|
function ji(s, e) {
|
|
9672
9676
|
const r = s, t = document.createElement("div");
|
|
9673
9677
|
t.id = Z;
|
|
9674
|
-
const n =
|
|
9675
|
-
<p class="__crossx-session-account-label">${
|
|
9676
|
-
<p class="__crossx-session-account-email">${
|
|
9678
|
+
const n = A(e.message).replace(/\n/g, "<br>"), i = e.email ? `<div class="__crossx-session-account-card">
|
|
9679
|
+
<p class="__crossx-session-account-label">${A(e.accountLabel)}</p>
|
|
9680
|
+
<p class="__crossx-session-account-email">${A(e.email)}</p>
|
|
9677
9681
|
</div>` : "";
|
|
9678
9682
|
return t.innerHTML = `
|
|
9679
9683
|
<div class="__crossx-card __crossx-card--migration" style="${ie(r)}" role="alertdialog" aria-modal="true" aria-labelledby="__crossx-session-header-title" aria-describedby="__crossx-session-msg">
|
|
9680
9684
|
<div class="__crossx-header">
|
|
9681
|
-
<p class="__crossx-title" id="__crossx-session-header-title">${
|
|
9685
|
+
<p class="__crossx-title" id="__crossx-session-header-title">${A(e.title)}</p>
|
|
9682
9686
|
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${se}</button>
|
|
9683
9687
|
</div>
|
|
9684
9688
|
<hr class="__crossx-divider">
|
|
9685
9689
|
<div class="__crossx-body" style="padding:20px 24px 24px;display:flex;flex-direction:column;gap:16px;">
|
|
9686
9690
|
<div class="__crossx-session-hero">
|
|
9687
|
-
<p class="__crossx-session-hero-title">${
|
|
9691
|
+
<p class="__crossx-session-hero-title">${A(e.title)}</p>
|
|
9688
9692
|
<p class="__crossx-session-hero-message" id="__crossx-session-msg">${n}</p>
|
|
9689
9693
|
</div>
|
|
9690
9694
|
${i}
|
|
9691
9695
|
<div class="__crossx-btn-row">
|
|
9692
|
-
<button class="__crossx-cancel-btn" id="__crossx-session-signout">${
|
|
9693
|
-
<button class="__crossx-confirm-btn" id="__crossx-session-signin">${
|
|
9696
|
+
<button class="__crossx-cancel-btn" id="__crossx-session-signout">${A(e.signOutLabel)}</button>
|
|
9697
|
+
<button class="__crossx-confirm-btn" id="__crossx-session-signin">${A(e.signInAgainLabel)}</button>
|
|
9694
9698
|
</div>
|
|
9695
9699
|
</div>
|
|
9696
9700
|
</div>
|
|
@@ -9783,13 +9787,13 @@ function Qi(s) {
|
|
|
9783
9787
|
const r = [s.check1, s.check2].map((t, n) => `
|
|
9784
9788
|
<div class="__crossx-pw-notice-item" data-check-index="${n}" role="checkbox" aria-checked="false" tabindex="0">
|
|
9785
9789
|
<div class="__crossx-pw-notice-check" id="__crossx-notice-check-${n}">${so}</div>
|
|
9786
|
-
<span class="__crossx-pw-notice-item-text">${
|
|
9790
|
+
<span class="__crossx-pw-notice-item-text">${A(t)}</span>
|
|
9787
9791
|
</div>
|
|
9788
9792
|
`).join("");
|
|
9789
9793
|
return `
|
|
9790
9794
|
<div class="__crossx-header">
|
|
9791
|
-
<p class="__crossx-title" id="__crossx-ttl" style="padding-right:48px;">${
|
|
9792
|
-
<p class="__crossx-pw-subtitle">${
|
|
9795
|
+
<p class="__crossx-title" id="__crossx-ttl" style="padding-right:48px;">${A(s.title)}</p>
|
|
9796
|
+
<p class="__crossx-pw-subtitle">${A(s.headerSubtitle)}</p>
|
|
9793
9797
|
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${se}</button>
|
|
9794
9798
|
</div>
|
|
9795
9799
|
<hr class="__crossx-divider">
|
|
@@ -9798,33 +9802,33 @@ function Qi(s) {
|
|
|
9798
9802
|
<div class="__crossx-pw-notice-header">
|
|
9799
9803
|
<div class="__crossx-pw-notice-title-row">
|
|
9800
9804
|
<span class="__crossx-pw-notice-icon">${no}</span>
|
|
9801
|
-
<p class="__crossx-pw-notice-title">${
|
|
9805
|
+
<p class="__crossx-pw-notice-title">${A(s.noticeTitle)}</p>
|
|
9802
9806
|
</div>
|
|
9803
|
-
<p class="__crossx-pw-notice-desc">${
|
|
9807
|
+
<p class="__crossx-pw-notice-desc">${A(s.noticeDesc)}</p>
|
|
9804
9808
|
</div>
|
|
9805
9809
|
<div class="__crossx-pw-notice-checks" id="__crossx-notice-checks">
|
|
9806
9810
|
${r}
|
|
9807
9811
|
</div>
|
|
9808
9812
|
</div>
|
|
9809
9813
|
<button class="__crossx-pw-btn --disabled" id="__crossx-pin-notice-next"
|
|
9810
|
-
data-next-label="${
|
|
9811
|
-
data-submit-label="${
|
|
9812
|
-
${
|
|
9814
|
+
data-next-label="${A(s.nextButton)}"
|
|
9815
|
+
data-submit-label="${A(s.submitButton)}">
|
|
9816
|
+
${A(s.nextButton)}
|
|
9813
9817
|
</button>
|
|
9814
9818
|
</div>
|
|
9815
9819
|
<div class="__crossx-home-indicator"></div>
|
|
9816
9820
|
`;
|
|
9817
9821
|
}
|
|
9818
9822
|
function pt(s) {
|
|
9819
|
-
const e = !!s.lockExpiresAt && s.lockExpiresAt > Date.now(), r = s.lockExpiresAt ? ` data-lock-expires="${s.lockExpiresAt}"` : "", t = s.headerSubtitle ? `<p class="__crossx-pin6-header-sub">${
|
|
9823
|
+
const e = !!s.lockExpiresAt && s.lockExpiresAt > Date.now(), r = s.lockExpiresAt ? ` data-lock-expires="${s.lockExpiresAt}"` : "", t = s.headerSubtitle ? `<p class="__crossx-pin6-header-sub">${A(s.headerSubtitle)}</p>` : "", n = s.subtitle ? `<p class="__crossx-pin6-subtitle">${A(s.subtitle)}</p>` : "", i = s.errorMessage ? `<p class="__crossx-pin6-error" id="__crossx-pin6-error">${A(s.errorMessage)}</p>` : '<p class="__crossx-pin6-error" id="__crossx-pin6-error"></p>', o = e ? `<p class="__crossx-pin6-lock-msg" id="__crossx-pin6-lock-msg">
|
|
9820
9824
|
${ts}
|
|
9821
9825
|
<span id="__crossx-pin6-lock-countdown"></span>
|
|
9822
|
-
</p>` : "", a = s.warningMessage && s.attemptCount != null && s.attemptCount > 0 ? `<p class="__crossx-pin6-warning" id="__crossx-pin6-warning">${
|
|
9826
|
+
</p>` : "", a = s.warningMessage && s.attemptCount != null && s.attemptCount > 0 ? `<p class="__crossx-pin6-warning" id="__crossx-pin6-warning">${A(s.warningMessage)}</p>` : '<p class="__crossx-pin6-warning" id="__crossx-pin6-warning"></p>', c = s.attemptCount != null && s.attemptCount > 0 ? `<p class="__crossx-pin6-attempt" id="__crossx-pin6-attempt">${s.attemptCount}/${s.maxAttempts ?? "?"}</p>` : '<p class="__crossx-pin6-attempt" id="__crossx-pin6-attempt"></p>', l = e ? " --locked" : "", u = Array.from(
|
|
9823
9827
|
{ length: 6 },
|
|
9824
|
-
(w,
|
|
9828
|
+
(w, S) => `<input class="__crossx-pin6-box${l}" type="password" maxlength="1" inputmode="numeric" pattern="[0-9]" autocomplete="off" aria-label="PIN digit ${S + 1}"${e ? " disabled" : ""}>`
|
|
9825
9829
|
).join(""), p = e ? " --locked" : "", g = Array.from(
|
|
9826
9830
|
{ length: 6 },
|
|
9827
|
-
(w,
|
|
9831
|
+
(w, S) => `<div class="__crossx-pin6-dot${p}" data-dot-index="${S}" aria-label="PIN digit ${S + 1}"></div>`
|
|
9828
9832
|
).join(""), _ = e ? " --disabled" : "", x = `
|
|
9829
9833
|
<div class="__crossx-pin6-numpad" id="__crossx-pin6-numpad">
|
|
9830
9834
|
<div class="__crossx-pin6-numpad-row">
|
|
@@ -9850,7 +9854,7 @@ function pt(s) {
|
|
|
9850
9854
|
</div>`;
|
|
9851
9855
|
return `
|
|
9852
9856
|
<div class="__crossx-header">
|
|
9853
|
-
<p class="__crossx-title" id="__crossx-ttl" style="padding-right:48px;">${
|
|
9857
|
+
<p class="__crossx-title" id="__crossx-ttl" style="padding-right:48px;">${A(s.title)}</p>
|
|
9854
9858
|
${t}
|
|
9855
9859
|
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${se}</button>
|
|
9856
9860
|
</div>
|
|
@@ -9891,20 +9895,20 @@ function to(s) {
|
|
|
9891
9895
|
return r > 0 ? `${r}h ${String(t).padStart(2, "0")}m` : `${String(t).padStart(2, "0")}:${String(n).padStart(2, "0")}`;
|
|
9892
9896
|
}
|
|
9893
9897
|
function _t(s, e, r, t, n, i, o) {
|
|
9894
|
-
var
|
|
9898
|
+
var C, B;
|
|
9895
9899
|
let a = !!(i && i > Date.now()), c = !1;
|
|
9896
|
-
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(""),
|
|
9897
|
-
var
|
|
9898
|
-
const b = l(), v =
|
|
9900
|
+
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 = () => {
|
|
9901
|
+
var E;
|
|
9902
|
+
const b = l(), v = S();
|
|
9899
9903
|
if (v.length && (v.forEach((T, O) => {
|
|
9900
9904
|
const W = !!(b[O] && b[O].value);
|
|
9901
9905
|
T.classList.toggle("--filled", W), T.classList.toggle("--active", !1);
|
|
9902
9906
|
}), !a && !c)) {
|
|
9903
9907
|
const T = b.findIndex((W) => !W.value);
|
|
9904
|
-
(
|
|
9908
|
+
(E = v[T === -1 ? 5 : T]) == null || E.classList.add("--active");
|
|
9905
9909
|
}
|
|
9906
|
-
},
|
|
9907
|
-
s.querySelectorAll(".__crossx-pin6-numpad-key[data-key]").forEach((v) => v.classList.toggle("--disabled", a)),
|
|
9910
|
+
}, N = () => {
|
|
9911
|
+
s.querySelectorAll(".__crossx-pin6-numpad-key[data-key]").forEach((v) => v.classList.toggle("--disabled", a)), S().forEach((v) => v.classList.toggle("--locked", a)), I();
|
|
9908
9912
|
}, R = (b) => {
|
|
9909
9913
|
a = b, l().forEach((v) => {
|
|
9910
9914
|
v.disabled = b, v.classList.toggle("--locked", b);
|
|
@@ -9913,12 +9917,12 @@ function _t(s, e, r, t, n, i, o) {
|
|
|
9913
9917
|
const b = p();
|
|
9914
9918
|
b && (b.textContent = "");
|
|
9915
9919
|
}, q = () => o ?? "Your account will be locked after further failures.", J = () => s.querySelector("#__crossx-pin6-warning"), G = (b) => {
|
|
9916
|
-
var
|
|
9920
|
+
var E;
|
|
9917
9921
|
let v = J();
|
|
9918
9922
|
if (!v) {
|
|
9919
9923
|
v = document.createElement("p"), v.className = "__crossx-pin6-warning", v.id = "__crossx-pin6-warning";
|
|
9920
9924
|
const T = p();
|
|
9921
|
-
T ? T.insertAdjacentElement("afterend", v) : (
|
|
9925
|
+
T ? T.insertAdjacentElement("afterend", v) : (E = x()) == null || E.appendChild(v);
|
|
9922
9926
|
}
|
|
9923
9927
|
v.textContent = b;
|
|
9924
9928
|
}, X = () => {
|
|
@@ -9926,21 +9930,21 @@ function _t(s, e, r, t, n, i, o) {
|
|
|
9926
9930
|
b && (b.textContent = "");
|
|
9927
9931
|
}, Q = (b, v) => {
|
|
9928
9932
|
var T;
|
|
9929
|
-
let
|
|
9930
|
-
if (!
|
|
9931
|
-
|
|
9933
|
+
let E = L();
|
|
9934
|
+
if (!E) {
|
|
9935
|
+
E = document.createElement("p"), E.className = "__crossx-pin6-attempt", E.id = "__crossx-pin6-attempt";
|
|
9932
9936
|
const O = J() ?? p();
|
|
9933
|
-
O ? O.insertAdjacentElement("afterend",
|
|
9937
|
+
O ? O.insertAdjacentElement("afterend", E) : (T = x()) == null || T.appendChild(E);
|
|
9934
9938
|
}
|
|
9935
|
-
|
|
9939
|
+
E.textContent = `${b}/${v}`;
|
|
9936
9940
|
}, H = () => {
|
|
9937
9941
|
const b = L();
|
|
9938
9942
|
b && (b.textContent = "");
|
|
9939
9943
|
}, D = (b) => {
|
|
9940
9944
|
const v = p();
|
|
9941
9945
|
v && (v.textContent = b);
|
|
9942
|
-
const
|
|
9943
|
-
|
|
9946
|
+
const E = u();
|
|
9947
|
+
E == null || E.classList.add("--shake"), setTimeout(() => E == null ? void 0 : E.classList.remove("--shake"), 500), l().forEach((T) => {
|
|
9944
9948
|
T.value = "";
|
|
9945
9949
|
}), setTimeout(() => {
|
|
9946
9950
|
var T;
|
|
@@ -9950,7 +9954,7 @@ function _t(s, e, r, t, n, i, o) {
|
|
|
9950
9954
|
var W;
|
|
9951
9955
|
R(!0), l().forEach((U) => {
|
|
9952
9956
|
U.value = "";
|
|
9953
|
-
}),
|
|
9957
|
+
}), N();
|
|
9954
9958
|
const v = p();
|
|
9955
9959
|
if (v && (v.textContent = "Too many failed attempts. Please wait."), !g()) {
|
|
9956
9960
|
const U = document.createElement("p");
|
|
@@ -9958,15 +9962,15 @@ function _t(s, e, r, t, n, i, o) {
|
|
|
9958
9962
|
const $ = p();
|
|
9959
9963
|
$ ? $.insertAdjacentElement("afterend", U) : (W = x()) == null || W.appendChild(U);
|
|
9960
9964
|
}
|
|
9961
|
-
const
|
|
9965
|
+
const E = () => {
|
|
9962
9966
|
var K;
|
|
9963
9967
|
const U = b - Date.now(), $ = _();
|
|
9964
|
-
U <= 0 ? (clearInterval(T), R(!1), (K = g()) == null || K.remove(), v && (v.textContent = ""),
|
|
9968
|
+
U <= 0 ? (clearInterval(T), R(!1), (K = g()) == null || K.remove(), v && (v.textContent = ""), N(), setTimeout(() => {
|
|
9965
9969
|
var Y;
|
|
9966
9970
|
return (Y = l()[0]) == null ? void 0 : Y.focus();
|
|
9967
9971
|
}, 50)) : $ && ($.textContent = ` ${to(U)}`);
|
|
9968
|
-
}, T = setInterval(
|
|
9969
|
-
|
|
9972
|
+
}, T = setInterval(E, 1e3);
|
|
9973
|
+
E();
|
|
9970
9974
|
const O = new MutationObserver(() => {
|
|
9971
9975
|
document.contains(s) || (clearInterval(T), O.disconnect());
|
|
9972
9976
|
});
|
|
@@ -9999,10 +10003,10 @@ function _t(s, e, r, t, n, i, o) {
|
|
|
9999
10003
|
}, 100);
|
|
10000
10004
|
const y = () => {
|
|
10001
10005
|
if (a || c) return;
|
|
10002
|
-
const b = l(), v = b.find((
|
|
10006
|
+
const b = l(), v = b.find((E) => !E.value) ?? b[b.length - 1];
|
|
10003
10007
|
v == null || v.focus();
|
|
10004
10008
|
};
|
|
10005
|
-
(
|
|
10009
|
+
(C = u()) == null || C.addEventListener("click", (b) => {
|
|
10006
10010
|
b.target.classList.contains("__crossx-pin6-box") || y();
|
|
10007
10011
|
}), (B = x()) == null || B.addEventListener("click", (b) => {
|
|
10008
10012
|
const v = b.target;
|
|
@@ -10010,23 +10014,23 @@ function _t(s, e, r, t, n, i, o) {
|
|
|
10010
10014
|
}), l().forEach((b, v) => {
|
|
10011
10015
|
b.addEventListener("input", () => {
|
|
10012
10016
|
var T;
|
|
10013
|
-
const
|
|
10014
|
-
b.value =
|
|
10015
|
-
}), b.addEventListener("keydown", (
|
|
10017
|
+
const E = b.value.replace(/\D/g, "").slice(-1);
|
|
10018
|
+
b.value = E, M(), E && v < 5 && ((T = l()[v + 1]) == null || T.focus()), I(), w().length === 6 && setTimeout(m, 80);
|
|
10019
|
+
}), b.addEventListener("keydown", (E) => {
|
|
10016
10020
|
var T, O;
|
|
10017
|
-
if (
|
|
10018
|
-
if (
|
|
10021
|
+
if (E.key === "Backspace") {
|
|
10022
|
+
if (E.preventDefault(), b.value)
|
|
10019
10023
|
b.value = "";
|
|
10020
10024
|
else if (v > 0) {
|
|
10021
10025
|
const W = l()[v - 1];
|
|
10022
10026
|
W.value = "", W.focus();
|
|
10023
10027
|
}
|
|
10024
10028
|
I();
|
|
10025
|
-
} else
|
|
10026
|
-
}), b.addEventListener("paste", (
|
|
10029
|
+
} else E.key === "ArrowLeft" && v > 0 ? (E.preventDefault(), (T = l()[v - 1]) == null || T.focus()) : E.key === "ArrowRight" && v < 5 ? (E.preventDefault(), (O = l()[v + 1]) == null || O.focus()) : E.key === "Escape" && r();
|
|
10030
|
+
}), b.addEventListener("paste", (E) => {
|
|
10027
10031
|
var W, U;
|
|
10028
|
-
|
|
10029
|
-
const T = (((W =
|
|
10032
|
+
E.preventDefault();
|
|
10033
|
+
const T = (((W = E.clipboardData) == null ? void 0 : W.getData("text")) ?? "").replace(/\D/g, "").slice(0, 6);
|
|
10030
10034
|
if (!T) return;
|
|
10031
10035
|
const O = l();
|
|
10032
10036
|
T.split("").forEach(($, K) => {
|
|
@@ -10044,7 +10048,7 @@ function _t(s, e, r, t, n, i, o) {
|
|
|
10044
10048
|
const O = T.target.closest(".__crossx-pin6-numpad-key");
|
|
10045
10049
|
!O || a || c || (v(), b = O, O.classList.add("--pressed"), O.setPointerCapture(T.pointerId));
|
|
10046
10050
|
});
|
|
10047
|
-
const
|
|
10051
|
+
const E = (T) => {
|
|
10048
10052
|
const O = T.dataset.key;
|
|
10049
10053
|
if (!O) return;
|
|
10050
10054
|
if (O === "backspace") {
|
|
@@ -10061,8 +10065,8 @@ function _t(s, e, r, t, n, i, o) {
|
|
|
10061
10065
|
const O = b;
|
|
10062
10066
|
v();
|
|
10063
10067
|
const W = O.getBoundingClientRect();
|
|
10064
|
-
T.clientX >= W.left && T.clientX <= W.right && T.clientY >= W.top && T.clientY <= W.bottom && !a && !c &&
|
|
10065
|
-
}), k.addEventListener("pointercancel", v), k.addEventListener("pointerleave", v, !0), I(), i && i > Date.now() &&
|
|
10068
|
+
T.clientX >= W.left && T.clientX <= W.right && T.clientY >= W.top && T.clientY <= W.bottom && !a && !c && E(O);
|
|
10069
|
+
}), k.addEventListener("pointercancel", v), k.addEventListener("pointerleave", v, !0), I(), i && i > Date.now() && N();
|
|
10066
10070
|
}
|
|
10067
10071
|
}
|
|
10068
10072
|
const ro = `<svg width="22" height="17" viewBox="0 0 22 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -10135,9 +10139,9 @@ class oo {
|
|
|
10135
10139
|
*/
|
|
10136
10140
|
showWalletSelector(e, r, t) {
|
|
10137
10141
|
return new Promise((n, i) => {
|
|
10138
|
-
var
|
|
10142
|
+
var N;
|
|
10139
10143
|
ae();
|
|
10140
|
-
const o = [...e], a = Wi(o, this.tokens, t, this.messages), c =
|
|
10144
|
+
const o = [...e], a = Wi(o, this.tokens, t, this.messages), c = Ne();
|
|
10141
10145
|
ce(a);
|
|
10142
10146
|
let l = !1;
|
|
10143
10147
|
const u = () => {
|
|
@@ -10157,27 +10161,27 @@ class oo {
|
|
|
10157
10161
|
});
|
|
10158
10162
|
});
|
|
10159
10163
|
})();
|
|
10160
|
-
const w = a.querySelector("#__crossx-add-wallet-error"),
|
|
10161
|
-
|
|
10162
|
-
|
|
10164
|
+
const w = a.querySelector("#__crossx-add-wallet-error"), S = a.querySelector("#__crossx-add-wallet-btn");
|
|
10165
|
+
S && S.addEventListener("click", async () => {
|
|
10166
|
+
S.disabled = !0, w && (w.hidden = !0, w.textContent = "");
|
|
10163
10167
|
try {
|
|
10164
10168
|
const R = await r();
|
|
10165
10169
|
o.push(R);
|
|
10166
10170
|
const L = a.querySelector("#__crossx-wallet-list");
|
|
10167
10171
|
if (L) {
|
|
10168
10172
|
const M = document.createElement("button");
|
|
10169
|
-
M.className = "__crossx-wallet-item", M.dataset.walletIndex = String(R.index), M.dataset.walletAddress = R.address, M.innerHTML = `${es(R.address, R.index, this.tokens.bg)}<span class="__crossx-wallet-info"><span class="__crossx-wallet-idx">${
|
|
10173
|
+
M.className = "__crossx-wallet-item", M.dataset.walletIndex = String(R.index), M.dataset.walletAddress = R.address, M.innerHTML = `${es(R.address, R.index, this.tokens.bg)}<span class="__crossx-wallet-info"><span class="__crossx-wallet-idx">${A(Qr(R))}</span><span class="__crossx-wallet-addr">${de(R.address)}</span></span>`, M.addEventListener("click", () => g(R)), L.appendChild(M);
|
|
10170
10174
|
try {
|
|
10171
10175
|
M.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
10172
10176
|
} catch {
|
|
10173
10177
|
}
|
|
10174
10178
|
}
|
|
10175
|
-
|
|
10179
|
+
S.disabled = !1;
|
|
10176
10180
|
} catch (R) {
|
|
10177
10181
|
const L = R instanceof f && R.code === h.ADDRESS_LIMIT_EXCEEDED, M = this.resolveAddWalletErrorMessage(R);
|
|
10178
|
-
w && (w.textContent = M, w.hidden = !1), L ? (
|
|
10182
|
+
w && (w.textContent = M, w.hidden = !1), L ? (S.disabled = !0, S.setAttribute("aria-disabled", "true")) : S.disabled = !1, p = R;
|
|
10179
10183
|
}
|
|
10180
|
-
}), (
|
|
10184
|
+
}), (N = a.querySelector("#__crossx-close-btn")) == null || N.addEventListener("click", _), a.addEventListener("click", (R) => {
|
|
10181
10185
|
R.target === a && _();
|
|
10182
10186
|
});
|
|
10183
10187
|
const I = (R) => {
|
|
@@ -10214,27 +10218,27 @@ class oo {
|
|
|
10214
10218
|
return new Promise((n) => {
|
|
10215
10219
|
var g, _, x, w;
|
|
10216
10220
|
ae();
|
|
10217
|
-
const i = zi(this.tokens, r, this.messages), o =
|
|
10221
|
+
const i = zi(this.tokens, r, this.messages), o = Ne();
|
|
10218
10222
|
ce(i);
|
|
10219
10223
|
const a = () => {
|
|
10220
10224
|
i.remove(), o();
|
|
10221
|
-
}, c = (
|
|
10222
|
-
a(), n({ type: "oauth", provider:
|
|
10223
|
-
}, l = (
|
|
10224
|
-
a(), n({ type: "external", walletId:
|
|
10225
|
+
}, c = (S) => {
|
|
10226
|
+
a(), n({ type: "oauth", provider: S });
|
|
10227
|
+
}, l = (S) => {
|
|
10228
|
+
a(), n({ type: "external", walletId: S });
|
|
10225
10229
|
}, u = () => {
|
|
10226
10230
|
a(), n(null);
|
|
10227
10231
|
};
|
|
10228
|
-
(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", (
|
|
10229
|
-
const
|
|
10230
|
-
|
|
10231
|
-
}), (w = i.querySelector("#__crossx-close-btn")) == null || w.addEventListener("click", u), i.addEventListener("click", (
|
|
10232
|
-
|
|
10233
|
-
}), i.querySelectorAll(".__crossx-login-terms-link").forEach((
|
|
10234
|
-
|
|
10232
|
+
(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) => {
|
|
10233
|
+
const N = S.currentTarget.dataset.walletId ?? "";
|
|
10234
|
+
N && l(N);
|
|
10235
|
+
}), (w = i.querySelector("#__crossx-close-btn")) == null || w.addEventListener("click", u), i.addEventListener("click", (S) => {
|
|
10236
|
+
S.target === i && u();
|
|
10237
|
+
}), i.querySelectorAll(".__crossx-login-terms-link").forEach((S) => {
|
|
10238
|
+
S.addEventListener("click", (I) => I.stopPropagation());
|
|
10235
10239
|
});
|
|
10236
|
-
const p = (
|
|
10237
|
-
|
|
10240
|
+
const p = (S) => {
|
|
10241
|
+
S.key === "Escape" && (document.removeEventListener("keydown", p), u());
|
|
10238
10242
|
};
|
|
10239
10243
|
document.addEventListener("keydown", p);
|
|
10240
10244
|
});
|
|
@@ -10250,7 +10254,7 @@ class oo {
|
|
|
10250
10254
|
accountLabel: (t == null ? void 0 : t.session_alert_account_label) ?? "Account",
|
|
10251
10255
|
signOutLabel: (t == null ? void 0 : t.session_alert_sign_out_button) ?? "Sign out",
|
|
10252
10256
|
signInAgainLabel: (t == null ? void 0 : t.session_alert_sign_in_again_button) ?? "Sign in again"
|
|
10253
|
-
}), i =
|
|
10257
|
+
}), i = Ne();
|
|
10254
10258
|
ce(n);
|
|
10255
10259
|
let o = !1;
|
|
10256
10260
|
const a = () => {
|
|
@@ -10319,13 +10323,13 @@ class oo {
|
|
|
10319
10323
|
}, o = {
|
|
10320
10324
|
title: (t == null ? void 0 : t.pin_setup_confirm_title) ?? "Confirm PIN",
|
|
10321
10325
|
headerSubtitle: (t == null ? void 0 : t.pin_setup_confirm_subtitle) ?? "Enter your PIN again to confirm."
|
|
10322
|
-
}, a = hr(this.tokens, Qi(n)), c =
|
|
10326
|
+
}, a = hr(this.tokens, Qi(n)), c = Ne();
|
|
10323
10327
|
ce(a);
|
|
10324
10328
|
let l = !1;
|
|
10325
10329
|
const u = () => {
|
|
10326
10330
|
l || (l = !0, a.remove(), c());
|
|
10327
|
-
}, p = (
|
|
10328
|
-
u(), r(
|
|
10331
|
+
}, p = (N) => {
|
|
10332
|
+
u(), r(N);
|
|
10329
10333
|
}, g = () => {
|
|
10330
10334
|
u(), r(null);
|
|
10331
10335
|
}, _ = a.querySelector(".__crossx-card"), x = {
|
|
@@ -10334,32 +10338,32 @@ class oo {
|
|
|
10334
10338
|
repeatingDigit: (t == null ? void 0 : t.pin_validation_repeating_digit) ?? "Cannot use the same number 3+ times in a row.",
|
|
10335
10339
|
sequential: (t == null ? void 0 : t.pin_validation_sequential) ?? "Sequential numbers (e.g., 123456) are not allowed.",
|
|
10336
10340
|
alternatingPattern: (t == null ? void 0 : t.pin_validation_alternating_pattern) ?? "Repeating patterns (e.g., 121212) are not allowed."
|
|
10337
|
-
}, w = (
|
|
10341
|
+
}, w = (N) => {
|
|
10338
10342
|
var R;
|
|
10339
10343
|
_.innerHTML = pt({
|
|
10340
10344
|
title: o.title,
|
|
10341
10345
|
headerSubtitle: o.headerSubtitle
|
|
10342
10346
|
}), (R = _.querySelector("#__crossx-close-btn")) == null || R.addEventListener("click", g), _t(_, (L) => {
|
|
10343
|
-
L ===
|
|
10347
|
+
L === N ? p(N) : S(i.mismatchError);
|
|
10344
10348
|
}, g);
|
|
10345
|
-
},
|
|
10349
|
+
}, S = (N) => {
|
|
10346
10350
|
var R;
|
|
10347
10351
|
_.innerHTML = pt({
|
|
10348
10352
|
title: i.title,
|
|
10349
10353
|
headerSubtitle: i.headerSubtitle,
|
|
10350
10354
|
subtitle: i.subtitle,
|
|
10351
|
-
errorMessage:
|
|
10355
|
+
errorMessage: N
|
|
10352
10356
|
}), (R = _.querySelector("#__crossx-close-btn")) == null || R.addEventListener("click", g), _t(_, (L) => {
|
|
10353
10357
|
const M = eo(L, x);
|
|
10354
|
-
M ?
|
|
10358
|
+
M ? S(M) : w(L);
|
|
10355
10359
|
}, g);
|
|
10356
10360
|
};
|
|
10357
10361
|
(() => {
|
|
10358
10362
|
var Q;
|
|
10359
|
-
const
|
|
10363
|
+
const N = Array.from(_.querySelectorAll(".__crossx-pw-notice-item")), R = _.querySelector("#__crossx-pin-notice-next"), L = /* @__PURE__ */ new Set();
|
|
10360
10364
|
R.removeAttribute("disabled");
|
|
10361
10365
|
const M = R.dataset.nextLabel ?? "Next", q = R.dataset.submitLabel ?? "I Understand", J = () => {
|
|
10362
|
-
const H = L.size ===
|
|
10366
|
+
const H = L.size === N.length;
|
|
10363
10367
|
R.classList.toggle("--disabled", !H), R.textContent = H ? q : M;
|
|
10364
10368
|
}, G = (H, D) => {
|
|
10365
10369
|
if (L.has(D)) return;
|
|
@@ -10370,7 +10374,7 @@ class oo {
|
|
|
10370
10374
|
const F = H.querySelector(`#__crossx-notice-check-${D}`);
|
|
10371
10375
|
L.delete(D), F.classList.remove("--checked"), H.setAttribute("aria-checked", "false"), J();
|
|
10372
10376
|
};
|
|
10373
|
-
|
|
10377
|
+
N.forEach((H) => {
|
|
10374
10378
|
const D = parseInt(H.dataset.checkIndex ?? "0", 10);
|
|
10375
10379
|
H.addEventListener("click", () => {
|
|
10376
10380
|
L.has(D) ? X(H, D) : G(H, D);
|
|
@@ -10378,11 +10382,11 @@ class oo {
|
|
|
10378
10382
|
(F.key === " " || F.key === "Enter") && (F.preventDefault(), L.has(D) ? X(H, D) : G(H, D));
|
|
10379
10383
|
});
|
|
10380
10384
|
}), R.addEventListener("click", () => {
|
|
10381
|
-
if (L.size ===
|
|
10382
|
-
|
|
10385
|
+
if (L.size === N.length) {
|
|
10386
|
+
S(e == null ? void 0 : e.errorMessage);
|
|
10383
10387
|
return;
|
|
10384
10388
|
}
|
|
10385
|
-
const H =
|
|
10389
|
+
const H = N.find((F) => {
|
|
10386
10390
|
const m = parseInt(F.dataset.checkIndex ?? "0", 10);
|
|
10387
10391
|
return !L.has(m);
|
|
10388
10392
|
});
|
|
@@ -10392,8 +10396,8 @@ class oo {
|
|
|
10392
10396
|
H.classList.remove("--highlight"), G(H, D);
|
|
10393
10397
|
}, 400);
|
|
10394
10398
|
}), (Q = _.querySelector("#__crossx-close-btn")) == null || Q.addEventListener("click", g);
|
|
10395
|
-
})(), a.addEventListener("click", (
|
|
10396
|
-
|
|
10399
|
+
})(), a.addEventListener("click", (N) => {
|
|
10400
|
+
N.target === a && g();
|
|
10397
10401
|
});
|
|
10398
10402
|
});
|
|
10399
10403
|
}
|
|
@@ -10417,20 +10421,20 @@ class oo {
|
|
|
10417
10421
|
attemptCount: e == null ? void 0 : e.attemptCount,
|
|
10418
10422
|
maxAttempts: e == null ? void 0 : e.maxAttempts
|
|
10419
10423
|
})
|
|
10420
|
-
), u =
|
|
10424
|
+
), u = Ne();
|
|
10421
10425
|
ce(l);
|
|
10422
10426
|
let p = !1;
|
|
10423
10427
|
const g = () => {
|
|
10424
10428
|
p || (p = !0, l.remove(), u());
|
|
10425
|
-
}, _ = (
|
|
10426
|
-
g(), r(
|
|
10429
|
+
}, _ = (N) => {
|
|
10430
|
+
g(), r(N);
|
|
10427
10431
|
}, x = () => {
|
|
10428
10432
|
g(), r(null);
|
|
10429
|
-
}, w = (
|
|
10430
|
-
g(), t(
|
|
10431
|
-
},
|
|
10432
|
-
(I =
|
|
10433
|
-
|
|
10433
|
+
}, w = (N) => {
|
|
10434
|
+
g(), t(N);
|
|
10435
|
+
}, S = l.querySelector(".__crossx-card");
|
|
10436
|
+
(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", (N) => {
|
|
10437
|
+
N.target === l && x();
|
|
10434
10438
|
});
|
|
10435
10439
|
});
|
|
10436
10440
|
}
|
|
@@ -10487,7 +10491,7 @@ class oo {
|
|
|
10487
10491
|
return new Promise((r) => {
|
|
10488
10492
|
var a, c;
|
|
10489
10493
|
ae();
|
|
10490
|
-
const t =
|
|
10494
|
+
const t = Ci(e, this.tokens, this.messages);
|
|
10491
10495
|
ce(t);
|
|
10492
10496
|
const n = () => t.remove(), i = () => {
|
|
10493
10497
|
n(), r();
|
|
@@ -10543,7 +10547,7 @@ class oo {
|
|
|
10543
10547
|
ae();
|
|
10544
10548
|
let t;
|
|
10545
10549
|
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);
|
|
10546
|
-
const n =
|
|
10550
|
+
const n = Ne();
|
|
10547
10551
|
ce(t);
|
|
10548
10552
|
const i = () => {
|
|
10549
10553
|
t.remove(), n();
|
|
@@ -10807,15 +10811,15 @@ Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
|
|
|
10807
10811
|
},
|
|
10808
10812
|
x
|
|
10809
10813
|
);
|
|
10810
|
-
const w = new He(n, c),
|
|
10811
|
-
|
|
10814
|
+
const w = new He(n, c), S = new oo(s.theme ?? "light", s.themeTokens, s.displayDecimals), I = new ao(
|
|
10815
|
+
S,
|
|
10812
10816
|
() => {
|
|
10813
10817
|
var M;
|
|
10814
10818
|
return (M = _ == null ? void 0 : _.getRNBridge) == null ? void 0 : M.call(_);
|
|
10815
10819
|
},
|
|
10816
10820
|
() => typeof window < "u" ? window.location.origin : "http://localhost",
|
|
10817
10821
|
x
|
|
10818
|
-
),
|
|
10822
|
+
), N = e != null && e.wrapConfirmation ? e.wrapConfirmation(I) : I, R = new xt(
|
|
10819
10823
|
t,
|
|
10820
10824
|
n,
|
|
10821
10825
|
o,
|
|
@@ -10824,7 +10828,7 @@ Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
|
|
|
10824
10828
|
l,
|
|
10825
10829
|
g,
|
|
10826
10830
|
u,
|
|
10827
|
-
|
|
10831
|
+
N,
|
|
10828
10832
|
w,
|
|
10829
10833
|
p
|
|
10830
10834
|
);
|