@nexus-cross/crossx-sdk-core 2.2.0-beta.8 → 2.2.0
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 +240 -229
- 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/dist/sdk/services/WalletLifecycleService.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -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,
|
|
@@ -1751,13 +1751,20 @@ class Ms {
|
|
|
1751
1751
|
if (d.log("[CROSSx] loadWalletAfterAuth 지갑 상태:", n), n !== "exists") return;
|
|
1752
1752
|
const i = await this.deps.walletProvider.getAddresses(t);
|
|
1753
1753
|
if (i.length > 0) {
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1754
|
+
let a, c = !1;
|
|
1755
|
+
if (r) {
|
|
1756
|
+
const l = i.find(
|
|
1757
|
+
(u) => u.address.toLowerCase() === r.toLowerCase()
|
|
1758
|
+
);
|
|
1759
|
+
l ? a = l : (a = { address: r, index: 0 }, c = !0);
|
|
1760
|
+
} else e !== void 0 ? a = i.find((l) => l.index === e) ?? i[0] : a = i[0];
|
|
1761
|
+
c ? d.log(
|
|
1762
|
+
"[CROSSx] preferredWalletAddress 가 서버 캐시에 없음 — raw address 채택:",
|
|
1763
|
+
a.address
|
|
1764
|
+
) : d.log(
|
|
1758
1765
|
"[CROSSx] 캐시된 주소 로드 완료 (비밀번호 불필요):",
|
|
1759
|
-
|
|
1760
|
-
), this.deps.setActiveWallet(
|
|
1766
|
+
a.address
|
|
1767
|
+
), this.deps.setActiveWallet(a.address, a.index);
|
|
1761
1768
|
return;
|
|
1762
1769
|
}
|
|
1763
1770
|
d.log("[CROSSx] 주소 캐시 없음 — 비밀번호 확인 후 address(0) 조회"), await this.deps.pinOrchestrator.ensureVerifiedPin();
|
|
@@ -1996,11 +2003,13 @@ class Gs {
|
|
|
1996
2003
|
constructor(e) {
|
|
1997
2004
|
this.deps = e;
|
|
1998
2005
|
}
|
|
1999
|
-
setActiveWallet(e, r) {
|
|
2006
|
+
setActiveWallet(e, r, t) {
|
|
2000
2007
|
this.deps.setState({
|
|
2001
2008
|
address: e,
|
|
2002
2009
|
activeWalletIndex: r
|
|
2003
|
-
})
|
|
2010
|
+
});
|
|
2011
|
+
const n = { address: e, index: r };
|
|
2012
|
+
(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
2013
|
});
|
|
2005
2014
|
}
|
|
2006
2015
|
applyAuthResult(e) {
|
|
@@ -2294,11 +2303,12 @@ const Te = class Te extends ys {
|
|
|
2294
2303
|
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
2304
|
},
|
|
2296
2305
|
getIsRecoveringSession: () => this._isRecoveringSession,
|
|
2297
|
-
emitAddressChanged: ({ address: x, index: w }) => {
|
|
2298
|
-
|
|
2306
|
+
emitAddressChanged: ({ address: x, index: w, walletName: S }) => {
|
|
2307
|
+
const I = { address: x, index: w };
|
|
2308
|
+
S !== void 0 && (I.walletName = S), this.emit("addressChanged", I);
|
|
2299
2309
|
},
|
|
2300
|
-
emitAuthChanged: ({ isAuthenticated: x, address: w, userId:
|
|
2301
|
-
this.emit("authChanged", { isAuthenticated: x, address: w, userId:
|
|
2310
|
+
emitAuthChanged: ({ isAuthenticated: x, address: w, userId: S }) => {
|
|
2311
|
+
this.emit("authChanged", { isAuthenticated: x, address: w, userId: S });
|
|
2302
2312
|
},
|
|
2303
2313
|
shouldPersistWalletPreference: () => this._config.persistWalletPreference !== !1,
|
|
2304
2314
|
walletPreferenceKey: Te.WALLET_PREF_KEY,
|
|
@@ -2342,7 +2352,7 @@ const Te = class Te extends ys {
|
|
|
2342
2352
|
getActiveAddress: () => this.address,
|
|
2343
2353
|
estimateGas: (x, w) => this.estimateGas(x, w),
|
|
2344
2354
|
getBaseFeePerGas: (x) => this.getBaseFeePerGas(x),
|
|
2345
|
-
jsonRpcCall: (x, w,
|
|
2355
|
+
jsonRpcCall: (x, w, S) => this.jsonRpc.call(x, w, S)
|
|
2346
2356
|
}), this.signatureVerifier = new Hs(this.crypto), this.addressResolverService = new qs({
|
|
2347
2357
|
walletProvider: this.walletProvider,
|
|
2348
2358
|
pinOrchestrator: this.pinOrchestrator,
|
|
@@ -2437,7 +2447,7 @@ const Te = class Te extends ys {
|
|
|
2437
2447
|
Te.WALLET_PREF_KEY
|
|
2438
2448
|
).catch(() => null) : null, o = (e == null ? void 0 : e.preferredWalletIndex) ?? (i == null ? void 0 : i.index);
|
|
2439
2449
|
let a = (e == null ? void 0 : e.preferredWalletAddress) ?? (i == null ? void 0 : i.address), c = await this.tryRNBridgeBootstrap();
|
|
2440
|
-
if (
|
|
2450
|
+
if (this._rnBridgeWalletAddress && ((a == null ? void 0 : a.toLowerCase()) !== this._rnBridgeWalletAddress.toLowerCase() && d.log("[CROSSx] RN Bridge active wallet으로 preferredWalletAddress 갱신:", this._rnBridgeWalletAddress), a = this._rnBridgeWalletAddress), c || (c = await this.signInUseCase.restoreSession()), c != null && c.success)
|
|
2441
2451
|
if (this.applyAuthResult(c), this.address && (!a || this.address.toLowerCase() === a.toLowerCase()))
|
|
2442
2452
|
this.address && this.setActiveWallet(this.address, o ?? this.activeWalletIndex);
|
|
2443
2453
|
else try {
|
|
@@ -2664,7 +2674,7 @@ const Te = class Te extends ys {
|
|
|
2664
2674
|
} catch (r) {
|
|
2665
2675
|
d.warn("[CROSSx] RN Bridge signOut 통보 실패 (로그아웃 자체는 정상)", r);
|
|
2666
2676
|
}
|
|
2667
|
-
this._rnBridgeService = null, this._rnBridgeWalletAddress = void 0;
|
|
2677
|
+
this._rnBridgeService = null, this._rnBridgeWalletAddress = void 0, this._rnBridgeWalletName = void 0;
|
|
2668
2678
|
} catch (e) {
|
|
2669
2679
|
throw new f(h.UNKNOWN_ERROR, "로그아웃에 실패했습니다", e);
|
|
2670
2680
|
}
|
|
@@ -3297,13 +3307,13 @@ const Te = class Te extends ys {
|
|
|
3297
3307
|
* logger.log(receipt.status); // '0x1' | '0x0'
|
|
3298
3308
|
*/
|
|
3299
3309
|
async sendTransactionWithWaitForReceipt(e, r, t = {}) {
|
|
3300
|
-
var w,
|
|
3310
|
+
var w, S;
|
|
3301
3311
|
if (this._isAuthenticatedViaRNBridge) {
|
|
3302
3312
|
const I = fe.getBridge();
|
|
3303
3313
|
if (I != null && I.sendTransactionWithWaitForReceipt)
|
|
3304
3314
|
return this.bridgeSendTransactionWithWaitForReceipt(I, e, r, t);
|
|
3305
3315
|
}
|
|
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 ?? ((
|
|
3316
|
+
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
3317
|
let g, _;
|
|
3308
3318
|
const x = this.waitForTxAndGetReceipt(a, e, { intervalMs: c, timeoutMs: l }).then((I) => {
|
|
3309
3319
|
g = I;
|
|
@@ -3618,9 +3628,9 @@ const Te = class Te extends ys {
|
|
|
3618
3628
|
* EIP-1193 `accountsChanged` 는 **이전 active address 가 존재하고 새 address 와 다른 경우에만** emit.
|
|
3619
3629
|
* 첫 로그인 시점에는 emit 하지 않는다 (dapp 이 `eth_accounts` / `eth_requestAccounts` 로 받음).
|
|
3620
3630
|
*/
|
|
3621
|
-
setActiveWallet(e, r) {
|
|
3622
|
-
const
|
|
3623
|
-
this.stateManager.setActiveWallet(e, r
|
|
3631
|
+
setActiveWallet(e, r, t) {
|
|
3632
|
+
const n = this.address;
|
|
3633
|
+
this.stateManager.setActiveWallet(e, r, t), n && e && n.toLowerCase() !== e.toLowerCase() && this.emitAccountsChanged(e);
|
|
3624
3634
|
}
|
|
3625
3635
|
/**
|
|
3626
3636
|
* §13.6.4 [v0.5.7] Native-initiated wallet change push event subscription.
|
|
@@ -3655,7 +3665,8 @@ const Te = class Te extends ys {
|
|
|
3655
3665
|
d.warn("[walletChanged] invalid source — 이벤트 무시", t);
|
|
3656
3666
|
return;
|
|
3657
3667
|
}
|
|
3658
|
-
|
|
3668
|
+
const i = typeof t.walletName == "string" ? t.walletName.trim() : "", o = i.length > 0 && i.length <= 64 ? i : void 0;
|
|
3669
|
+
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
3670
|
}), d.log("[CROSSx] bridge.onEvent walletChanged 구독 완료");
|
|
3660
3671
|
}
|
|
3661
3672
|
/** AuthResult를 내부 상태에 반영합니다. */
|
|
@@ -4377,26 +4388,26 @@ const kt = (s) => (wt << BigInt(s)) - wt;
|
|
|
4377
4388
|
function bn(s, e, r) {
|
|
4378
4389
|
if (me(s, "hashLen"), me(e, "qByteLen"), typeof r != "function")
|
|
4379
4390
|
throw new Error("hmacFn must be a function");
|
|
4380
|
-
const t = (
|
|
4391
|
+
const t = (S) => new Uint8Array(S), n = Uint8Array.of(), i = Uint8Array.of(0), o = Uint8Array.of(1), a = 1e3;
|
|
4381
4392
|
let c = t(s), l = t(s), u = 0;
|
|
4382
4393
|
const p = () => {
|
|
4383
4394
|
c.fill(1), l.fill(0), u = 0;
|
|
4384
|
-
}, g = (...
|
|
4385
|
-
l = g(i,
|
|
4395
|
+
}, g = (...S) => r(l, Se(c, ...S)), _ = (S = n) => {
|
|
4396
|
+
l = g(i, S), c = g(), S.length !== 0 && (l = g(o, S), c = g());
|
|
4386
4397
|
}, x = () => {
|
|
4387
4398
|
if (u++ >= a)
|
|
4388
4399
|
throw new Error("drbg: tried max amount of iterations");
|
|
4389
|
-
let
|
|
4400
|
+
let S = 0;
|
|
4390
4401
|
const I = [];
|
|
4391
|
-
for (;
|
|
4402
|
+
for (; S < e; ) {
|
|
4392
4403
|
c = g();
|
|
4393
4404
|
const C = c.slice();
|
|
4394
|
-
I.push(C),
|
|
4405
|
+
I.push(C), S += c.length;
|
|
4395
4406
|
}
|
|
4396
4407
|
return Se(...I);
|
|
4397
4408
|
};
|
|
4398
|
-
return (
|
|
4399
|
-
p(), _(
|
|
4409
|
+
return (S, I) => {
|
|
4410
|
+
p(), _(S);
|
|
4400
4411
|
let C;
|
|
4401
4412
|
for (; !(C = I(x())); )
|
|
4402
4413
|
_();
|
|
@@ -4471,8 +4482,8 @@ function An(s) {
|
|
|
4471
4482
|
let l = a.pow(c, o), u = a.mul(l, t);
|
|
4472
4483
|
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
4484
|
l = a.cmov(l, u, _), u = a.cmov(g, p, x);
|
|
4474
|
-
const w = a.eql(a.sqr(u), c),
|
|
4475
|
-
return Ot(a,
|
|
4485
|
+
const w = a.eql(a.sqr(u), c), S = a.cmov(l, u, w);
|
|
4486
|
+
return Ot(a, S, c), S;
|
|
4476
4487
|
};
|
|
4477
4488
|
}
|
|
4478
4489
|
function Nr(s) {
|
|
@@ -4503,7 +4514,7 @@ function Nr(s) {
|
|
|
4503
4514
|
for (; !c.eql(w, c.ONE); )
|
|
4504
4515
|
if (x++, w = c.sqr(w), x === u)
|
|
4505
4516
|
throw new Error("Cannot find square root");
|
|
4506
|
-
const
|
|
4517
|
+
const S = te << BigInt(u - x - 1), I = c.pow(p, S);
|
|
4507
4518
|
u = x, p = c.sqr(I), g = c.mul(g, p), _ = c.mul(_, I);
|
|
4508
4519
|
}
|
|
4509
4520
|
return _;
|
|
@@ -5058,21 +5069,21 @@ function Un(s, e = {}) {
|
|
|
5058
5069
|
if (!t.isValid(b))
|
|
5059
5070
|
throw new Error("bad point: is not on curve, wrong x");
|
|
5060
5071
|
const v = w(b);
|
|
5061
|
-
let
|
|
5072
|
+
let E;
|
|
5062
5073
|
try {
|
|
5063
|
-
|
|
5074
|
+
E = t.sqrt(v);
|
|
5064
5075
|
} catch (W) {
|
|
5065
5076
|
const U = W instanceof Error ? ": " + W.message : "";
|
|
5066
5077
|
throw new Error("bad point: is not on curve, sqrt error" + U);
|
|
5067
5078
|
}
|
|
5068
5079
|
u();
|
|
5069
|
-
const T = t.isOdd(
|
|
5070
|
-
return (N & 1) === 1 !== T && (
|
|
5080
|
+
const T = t.isOdd(E);
|
|
5081
|
+
return (N & 1) === 1 !== T && (E = t.neg(E)), { x: b, y: E };
|
|
5071
5082
|
} else if (k === y && N === 4) {
|
|
5072
|
-
const b = t.BYTES, v = t.fromBytes(B.subarray(0, b)),
|
|
5073
|
-
if (!
|
|
5083
|
+
const b = t.BYTES, v = t.fromBytes(B.subarray(0, b)), E = t.fromBytes(B.subarray(b, b * 2));
|
|
5084
|
+
if (!S(v, E))
|
|
5074
5085
|
throw new Error("bad point: is not on curve");
|
|
5075
|
-
return { x: v, y:
|
|
5086
|
+
return { x: v, y: E };
|
|
5076
5087
|
} else
|
|
5077
5088
|
throw new Error(`bad point: got length ${k}, expected compressed=${m} or uncompressed=${y}`);
|
|
5078
5089
|
}
|
|
@@ -5081,11 +5092,11 @@ function Un(s, e = {}) {
|
|
|
5081
5092
|
const m = t.sqr(F), y = t.mul(m, F);
|
|
5082
5093
|
return t.add(t.add(y, t.mul(F, i.a)), i.b);
|
|
5083
5094
|
}
|
|
5084
|
-
function
|
|
5095
|
+
function S(F, m) {
|
|
5085
5096
|
const y = t.sqr(m), k = w(F);
|
|
5086
5097
|
return t.eql(y, k);
|
|
5087
5098
|
}
|
|
5088
|
-
if (!
|
|
5099
|
+
if (!S(i.Gx, i.Gy))
|
|
5089
5100
|
throw new Error("bad curve params: generator point");
|
|
5090
5101
|
const I = t.mul(t.pow(i.a, ze), Fn), C = t.mul(t.sqr(i.b), BigInt(27));
|
|
5091
5102
|
if (t.is0(t.add(I, C)))
|
|
@@ -5110,10 +5121,10 @@ function Un(s, e = {}) {
|
|
|
5110
5121
|
return { x: y, y: k };
|
|
5111
5122
|
const B = F.is0();
|
|
5112
5123
|
m == null && (m = B ? t.ONE : t.inv(N));
|
|
5113
|
-
const b = t.mul(y, m), v = t.mul(k, m),
|
|
5124
|
+
const b = t.mul(y, m), v = t.mul(k, m), E = t.mul(N, m);
|
|
5114
5125
|
if (B)
|
|
5115
5126
|
return { x: t.ZERO, y: t.ZERO };
|
|
5116
|
-
if (!t.eql(
|
|
5127
|
+
if (!t.eql(E, t.ONE))
|
|
5117
5128
|
throw new Error("invZ was invalid");
|
|
5118
5129
|
return { x: b, y: v };
|
|
5119
5130
|
}), J = Xt((F) => {
|
|
@@ -5125,7 +5136,7 @@ function Un(s, e = {}) {
|
|
|
5125
5136
|
const { x: m, y } = F.toAffine();
|
|
5126
5137
|
if (!t.isValid(m) || !t.isValid(y))
|
|
5127
5138
|
throw new Error("bad point: x or y not field elements");
|
|
5128
|
-
if (!
|
|
5139
|
+
if (!S(m, y))
|
|
5129
5140
|
throw new Error("bad point: equation left != right");
|
|
5130
5141
|
if (!F.isTorsionFree())
|
|
5131
5142
|
throw new Error("bad point: not in prime-order subgroup");
|
|
@@ -5190,8 +5201,8 @@ function Un(s, e = {}) {
|
|
|
5190
5201
|
/** Compare one point to another. */
|
|
5191
5202
|
equals(m) {
|
|
5192
5203
|
L(m);
|
|
5193
|
-
const { X: y, Y: k, Z: N } = this, { X: B, Y: b, Z: v } = m,
|
|
5194
|
-
return
|
|
5204
|
+
const { X: y, Y: k, Z: N } = this, { X: B, Y: b, Z: v } = m, E = t.eql(t.mul(y, v), t.mul(B, N)), T = t.eql(t.mul(k, v), t.mul(b, N));
|
|
5205
|
+
return E && T;
|
|
5195
5206
|
}
|
|
5196
5207
|
/** Flips point to one corresponding to (x, -y) in Affine coordinates. */
|
|
5197
5208
|
negate() {
|
|
@@ -5203,8 +5214,8 @@ function Un(s, e = {}) {
|
|
|
5203
5214
|
// Cost: 8M + 3S + 3*a + 2*b3 + 15add.
|
|
5204
5215
|
double() {
|
|
5205
5216
|
const { a: m, b: y } = i, k = t.mul(y, ze), { X: N, Y: B, Z: b } = this;
|
|
5206
|
-
let v = t.ZERO,
|
|
5207
|
-
return $ = t.add($, $), T = t.mul(N, b), T = t.add(T, T), v = t.mul(m, T),
|
|
5217
|
+
let v = t.ZERO, E = t.ZERO, T = t.ZERO, O = t.mul(N, N), W = t.mul(B, B), U = t.mul(b, b), $ = t.mul(N, B);
|
|
5218
|
+
return $ = t.add($, $), T = t.mul(N, b), T = t.add(T, T), v = t.mul(m, T), E = t.mul(k, U), E = t.add(v, E), v = t.sub(W, E), E = t.add(W, E), E = t.mul(v, E), v = t.mul($, v), T = t.mul(k, T), U = t.mul(m, U), $ = t.sub(O, U), $ = t.mul(m, $), $ = t.add($, T), T = t.add(O, O), O = t.add(T, O), O = t.add(O, U), O = t.mul(O, $), E = t.add(E, O), U = t.mul(B, b), U = t.add(U, U), O = t.mul(U, $), v = t.sub(v, O), T = t.mul(U, W), T = t.add(T, T), T = t.add(T, T), new D(v, E, T);
|
|
5208
5219
|
}
|
|
5209
5220
|
// Renes-Costello-Batina exception-free addition formula.
|
|
5210
5221
|
// There is 30% faster Jacobian formula, but it is not complete.
|
|
@@ -5213,12 +5224,12 @@ function Un(s, e = {}) {
|
|
|
5213
5224
|
add(m) {
|
|
5214
5225
|
L(m);
|
|
5215
5226
|
const { X: y, Y: k, Z: N } = this, { X: B, Y: b, Z: v } = m;
|
|
5216
|
-
let
|
|
5227
|
+
let E = t.ZERO, T = t.ZERO, O = t.ZERO;
|
|
5217
5228
|
const W = i.a, U = t.mul(i.b, ze);
|
|
5218
5229
|
let $ = t.mul(y, B), K = t.mul(k, b), Y = t.mul(N, v), ne = t.add(y, k), z = t.add(B, b);
|
|
5219
5230
|
ne = t.mul(ne, z), z = t.add($, K), ne = t.sub(ne, z), z = t.add(y, N);
|
|
5220
5231
|
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, N),
|
|
5232
|
+
return z = t.mul(z, ee), ee = t.add($, Y), z = t.sub(z, ee), ee = t.add(k, N), E = t.add(b, v), ee = t.mul(ee, E), E = t.add(K, Y), ee = t.sub(ee, E), O = t.mul(W, z), E = t.mul(U, Y), O = t.add(E, O), E = t.sub(K, O), O = t.add(K, O), T = t.mul(E, O), K = t.add($, $), K = t.add(K, $), Y = t.mul(W, Y), z = t.mul(U, z), K = t.add(K, Y), Y = t.sub($, Y), Y = t.mul(W, Y), z = t.add(z, Y), $ = t.mul(K, z), T = t.add(T, $), $ = t.mul(ee, z), E = t.mul(ne, E), E = t.sub(E, $), $ = t.mul(ne, K), O = t.mul(ee, O), O = t.add(O, $), new D(E, T, O);
|
|
5222
5233
|
}
|
|
5223
5234
|
subtract(m) {
|
|
5224
5235
|
return this.add(m.negate());
|
|
@@ -5242,8 +5253,8 @@ function Un(s, e = {}) {
|
|
|
5242
5253
|
let k, N;
|
|
5243
5254
|
const B = (b) => H.cached(this, b, (v) => Qt(D, v));
|
|
5244
5255
|
if (y) {
|
|
5245
|
-
const { k1neg: b, k1: v, k2neg:
|
|
5246
|
-
N = W.add($), k = G(y.beta, O, U, b,
|
|
5256
|
+
const { k1neg: b, k1: v, k2neg: E, k2: T } = M(m), { p: O, f: W } = B(v), { p: U, f: $ } = B(T);
|
|
5257
|
+
N = W.add($), k = G(y.beta, O, U, b, E);
|
|
5247
5258
|
} else {
|
|
5248
5259
|
const { p: b, f: v } = B(m);
|
|
5249
5260
|
k = b, N = v;
|
|
@@ -5266,8 +5277,8 @@ function Un(s, e = {}) {
|
|
|
5266
5277
|
if (H.hasCache(this))
|
|
5267
5278
|
return this.multiply(m);
|
|
5268
5279
|
if (y) {
|
|
5269
|
-
const { k1neg: N, k1: B, k2neg: b, k2: v } = M(m), { p1:
|
|
5270
|
-
return G(y.beta,
|
|
5280
|
+
const { k1neg: N, k1: B, k2neg: b, k2: v } = M(m), { p1: E, p2: T } = Ln(D, k, B, v);
|
|
5281
|
+
return G(y.beta, E, T, N, b);
|
|
5271
5282
|
} else
|
|
5272
5283
|
return H.unsafe(k, m);
|
|
5273
5284
|
}
|
|
@@ -5336,10 +5347,10 @@ function Hn(s, e = {}) {
|
|
|
5336
5347
|
}
|
|
5337
5348
|
}
|
|
5338
5349
|
function o(_, x) {
|
|
5339
|
-
const { publicKey: w, publicKeyUncompressed:
|
|
5350
|
+
const { publicKey: w, publicKeyUncompressed: S } = n;
|
|
5340
5351
|
try {
|
|
5341
5352
|
const I = _.length;
|
|
5342
|
-
return x === !0 && I !== w || x === !1 && I !==
|
|
5353
|
+
return x === !0 && I !== w || x === !1 && I !== S ? !1 : !!s.fromBytes(_);
|
|
5343
5354
|
} catch {
|
|
5344
5355
|
return !1;
|
|
5345
5356
|
}
|
|
@@ -5351,19 +5362,19 @@ function Hn(s, e = {}) {
|
|
|
5351
5362
|
return s.BASE.multiply(r.fromBytes(_)).toBytes(x);
|
|
5352
5363
|
}
|
|
5353
5364
|
function l(_) {
|
|
5354
|
-
const { secretKey: x, publicKey: w, publicKeyUncompressed:
|
|
5365
|
+
const { secretKey: x, publicKey: w, publicKeyUncompressed: S } = n;
|
|
5355
5366
|
if (!At(_) || "_lengths" in r && r._lengths || x === w)
|
|
5356
5367
|
return;
|
|
5357
5368
|
const I = V(_, void 0, "key").length;
|
|
5358
|
-
return I === w || I ===
|
|
5369
|
+
return I === w || I === S;
|
|
5359
5370
|
}
|
|
5360
5371
|
function u(_, x, w = !0) {
|
|
5361
5372
|
if (l(_) === !0)
|
|
5362
5373
|
throw new Error("first arg must be private key");
|
|
5363
5374
|
if (l(x) === !1)
|
|
5364
5375
|
throw new Error("second arg must be public key");
|
|
5365
|
-
const
|
|
5366
|
-
return s.fromBytes(x).multiply(
|
|
5376
|
+
const S = r.fromBytes(_);
|
|
5377
|
+
return s.fromBytes(x).multiply(S).toBytes(w);
|
|
5367
5378
|
}
|
|
5368
5379
|
const p = {
|
|
5369
5380
|
isValidSecretKey: i,
|
|
@@ -5386,7 +5397,7 @@ function Wn(s, e, r = {}) {
|
|
|
5386
5397
|
format: "compact",
|
|
5387
5398
|
extraEntropy: !1
|
|
5388
5399
|
}, w = a * Ur < i.ORDER;
|
|
5389
|
-
function
|
|
5400
|
+
function S(m) {
|
|
5390
5401
|
const y = a >> Le;
|
|
5391
5402
|
return m > y;
|
|
5392
5403
|
}
|
|
@@ -5420,8 +5431,8 @@ function Wn(s, e, r = {}) {
|
|
|
5420
5431
|
R(y, k);
|
|
5421
5432
|
let N;
|
|
5422
5433
|
if (k === "der") {
|
|
5423
|
-
const { r:
|
|
5424
|
-
return new L(
|
|
5434
|
+
const { r: E, s: T } = ve.toSig(V(y));
|
|
5435
|
+
return new L(E, T);
|
|
5425
5436
|
}
|
|
5426
5437
|
k === "recovered" && (N = y[0], k = "compact", y = y.subarray(1));
|
|
5427
5438
|
const B = _.signature / 2, b = y.subarray(0, B), v = y.subarray(B, B * 2);
|
|
@@ -5443,14 +5454,14 @@ function Wn(s, e, r = {}) {
|
|
|
5443
5454
|
const { r: k, s: N } = this, B = this.assertRecovery(), b = B === 2 || B === 3 ? k + a : k;
|
|
5444
5455
|
if (!i.isValid(b))
|
|
5445
5456
|
throw new Error("invalid recovery id: sig.r+curve.n != R.x");
|
|
5446
|
-
const v = i.toBytes(b),
|
|
5457
|
+
const v = i.toBytes(b), E = s.fromBytes(Se(Hr((B & 1) === 0), v)), T = o.inv(b), O = q(V(y, void 0, "msgHash")), W = o.create(-O * T), U = o.create(N * T), $ = s.BASE.multiplyUnsafe(W).add(E.multiplyUnsafe(U));
|
|
5447
5458
|
if ($.is0())
|
|
5448
5459
|
throw new Error("invalid recovery: point at infinify");
|
|
5449
5460
|
return $.assertValidity(), $;
|
|
5450
5461
|
}
|
|
5451
5462
|
// Signatures should be low-s, to prevent malleability.
|
|
5452
5463
|
hasHighS() {
|
|
5453
|
-
return
|
|
5464
|
+
return S(this.s);
|
|
5454
5465
|
}
|
|
5455
5466
|
toBytes(y = x.format) {
|
|
5456
5467
|
if (mt(y), y === "der")
|
|
@@ -5479,10 +5490,10 @@ function Wn(s, e, r = {}) {
|
|
|
5479
5490
|
function Q(m, y, k) {
|
|
5480
5491
|
const { lowS: N, prehash: B, extraEntropy: b } = ut(k, x);
|
|
5481
5492
|
m = X(m, B);
|
|
5482
|
-
const v = q(m),
|
|
5483
|
-
if (!o.isValidNot0(
|
|
5493
|
+
const v = q(m), E = o.fromBytes(y);
|
|
5494
|
+
if (!o.isValidNot0(E))
|
|
5484
5495
|
throw new Error("invalid private key");
|
|
5485
|
-
const T = [G(
|
|
5496
|
+
const T = [G(E), G(v)];
|
|
5486
5497
|
if (b != null && b !== !1) {
|
|
5487
5498
|
const $ = b === !0 ? t(_.secretKey) : b;
|
|
5488
5499
|
T.push(V($, void 0, "extraEntropy"));
|
|
@@ -5495,11 +5506,11 @@ function Wn(s, e, r = {}) {
|
|
|
5495
5506
|
const Y = o.inv(K), ne = s.BASE.multiply(K).toAffine(), z = o.create(ne.x);
|
|
5496
5507
|
if (z === ge)
|
|
5497
5508
|
return;
|
|
5498
|
-
const ee = o.create(Y * o.create(W + z *
|
|
5509
|
+
const ee = o.create(Y * o.create(W + z * E));
|
|
5499
5510
|
if (ee === ge)
|
|
5500
5511
|
return;
|
|
5501
5512
|
let Lt = (ne.x === z ? 0 : 2) | Number(ne.y & Le), Dt = ee;
|
|
5502
|
-
return N &&
|
|
5513
|
+
return N && S(ee) && (Dt = o.neg(ee), Lt ^= 1), new L(z, Dt, w ? void 0 : Lt);
|
|
5503
5514
|
}
|
|
5504
5515
|
return { seed: O, k2sig: U };
|
|
5505
5516
|
}
|
|
@@ -5510,15 +5521,15 @@ function Wn(s, e, r = {}) {
|
|
|
5510
5521
|
function D(m, y, k, N = {}) {
|
|
5511
5522
|
const { lowS: B, prehash: b, format: v } = ut(N, x);
|
|
5512
5523
|
if (k = V(k, void 0, "publicKey"), y = X(y, b), !At(m)) {
|
|
5513
|
-
const
|
|
5514
|
-
throw new Error("verify expects Uint8Array signature" +
|
|
5524
|
+
const E = m instanceof L ? ", use sig.toBytes()" : "";
|
|
5525
|
+
throw new Error("verify expects Uint8Array signature" + E);
|
|
5515
5526
|
}
|
|
5516
5527
|
R(m, v);
|
|
5517
5528
|
try {
|
|
5518
|
-
const
|
|
5519
|
-
if (B &&
|
|
5529
|
+
const E = L.fromBytes(m, v), T = s.fromBytes(k);
|
|
5530
|
+
if (B && E.hasHighS())
|
|
5520
5531
|
return !1;
|
|
5521
|
-
const { r: O, s: W } =
|
|
5532
|
+
const { r: O, s: W } = E, U = q(y), $ = o.inv(W), K = o.create(U * $), Y = o.create(O * $), ne = s.BASE.multiplyUnsafe(K).add(T.multiplyUnsafe(Y));
|
|
5522
5533
|
return ne.is0() ? !1 : o.create(ne.x) === O;
|
|
5523
5534
|
} catch {
|
|
5524
5535
|
return !1;
|
|
@@ -5559,7 +5570,7 @@ const Ct = {
|
|
|
5559
5570
|
]
|
|
5560
5571
|
}, nr = /* @__PURE__ */ BigInt(2);
|
|
5561
5572
|
function qn(s) {
|
|
5562
|
-
const e = Ct.p, r = BigInt(3), t = BigInt(6), n = BigInt(11), i = BigInt(22), o = BigInt(23), a = BigInt(44), c = BigInt(88), l = s * s * s % e, u = l * l * s % e, p = oe(u, r, e) * u % e, g = oe(p, r, e) * u % e, _ = oe(g, nr, e) * l % e, x = oe(_, n, e) * _ % e, w = oe(x, i, e) * x % e,
|
|
5573
|
+
const e = Ct.p, r = BigInt(3), t = BigInt(6), n = BigInt(11), i = BigInt(22), o = BigInt(23), a = BigInt(44), c = BigInt(88), l = s * s * s % e, u = l * l * s % e, p = oe(u, r, e) * u % e, g = oe(p, r, e) * u % e, _ = oe(g, nr, e) * l % e, x = oe(_, n, e) * _ % e, w = oe(x, i, e) * x % e, S = oe(w, a, e) * w % e, I = oe(S, c, e) * S % e, C = oe(I, a, e) * w % e, R = oe(C, r, e) * u % e, L = oe(R, o, e) * x % e, M = oe(L, t, e) * l % e, q = oe(M, nr, e);
|
|
5563
5574
|
if (!yt.eql(yt.sqr(q), s))
|
|
5564
5575
|
throw new Error("Cannot find square root");
|
|
5565
5576
|
return q;
|
|
@@ -5748,8 +5759,8 @@ ${t.length}`
|
|
|
5748
5759
|
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
5760
|
cr(l),
|
|
5750
5761
|
cr(u)
|
|
5751
|
-
).addRecoveryBit(g).recoverPublicKey(o).toBytes(!1).slice(1),
|
|
5752
|
-
return "0x" + We(
|
|
5762
|
+
).addRecoveryBit(g).recoverPublicKey(o).toBytes(!1).slice(1), S = ar(w);
|
|
5763
|
+
return "0x" + We(S.slice(12));
|
|
5753
5764
|
}
|
|
5754
5765
|
}
|
|
5755
5766
|
function ni(s) {
|
|
@@ -5896,7 +5907,7 @@ class Ae {
|
|
|
5896
5907
|
const _ = setTimeout(() => {
|
|
5897
5908
|
d.warn("[CROSSx] OAuth 타임아웃 (5분) — postMessage를 수신하지 못했습니다"), L(), t(new Error("Authentication timeout"));
|
|
5898
5909
|
}, 5 * 60 * 1e3), x = 10, w = 30;
|
|
5899
|
-
let
|
|
5910
|
+
let S = 0, I = null;
|
|
5900
5911
|
const C = () => {
|
|
5901
5912
|
clearInterval(R), d.warn("[CROSSx] COOP 감지 — OAuth 서버 응답을 " + w + "초간 대기합니다"), I = setTimeout(() => {
|
|
5902
5913
|
L(), t(new Error(
|
|
@@ -5904,9 +5915,9 @@ class Ae {
|
|
|
5904
5915
|
));
|
|
5905
5916
|
}, w * 1e3);
|
|
5906
5917
|
}, R = setInterval(() => {
|
|
5907
|
-
|
|
5918
|
+
S++;
|
|
5908
5919
|
try {
|
|
5909
|
-
g.closed && (
|
|
5920
|
+
g.closed && (S <= x ? C() : (L(), t(new Error("로그인이 취소되었습니다"))));
|
|
5910
5921
|
} catch {
|
|
5911
5922
|
C();
|
|
5912
5923
|
}
|
|
@@ -6194,9 +6205,9 @@ class Ie {
|
|
|
6194
6205
|
h.USER_NOT_FOUND,
|
|
6195
6206
|
Ie.getGatewayErrorMessage(_.code, x)
|
|
6196
6207
|
);
|
|
6197
|
-
const
|
|
6208
|
+
const S = w === h.AUTH_NOT_AUTHENTICATED ? h.SESSION_EXPIRED : w, I = S === h.SESSION_EXPIRED ? "인증 세션이 만료되었습니다. 다시 로그인해 주세요." : Ie.getGatewayErrorMessage(_.code, x), C = _.data;
|
|
6198
6209
|
let R;
|
|
6199
|
-
throw w === h.PIN_LOCKED ? R = Ie.extractLockDetails(C) : w === h.ADDRESS_LIMIT_EXCEEDED ? R = { limit: gt, raw: C } : R = C ?? void 0, new f(
|
|
6210
|
+
throw w === h.PIN_LOCKED ? R = Ie.extractLockDetails(C) : w === h.ADDRESS_LIMIT_EXCEEDED ? R = { limit: gt, raw: C } : R = C ?? void 0, new f(S, I, R);
|
|
6200
6211
|
}
|
|
6201
6212
|
return d.log("[CROSSx] Wallet Gateway API 성공:", { code: _.code, url: o, method: e }), _.data ?? _;
|
|
6202
6213
|
}
|
|
@@ -6213,16 +6224,16 @@ class Ie {
|
|
|
6213
6224
|
);
|
|
6214
6225
|
}
|
|
6215
6226
|
if ((u = g.response) != null && u.data) {
|
|
6216
|
-
const x = g.response.data, w = x.message || x.data || "API 요청에 실패했습니다",
|
|
6227
|
+
const x = g.response.data, w = x.message || x.data || "API 요청에 실패했습니다", S = x.code || "UNKNOWN";
|
|
6217
6228
|
throw d.error("[CROSSx] Wallet Gateway API 에러 (HTTP 에러):", {
|
|
6218
|
-
code:
|
|
6229
|
+
code: S,
|
|
6219
6230
|
message: w,
|
|
6220
6231
|
url: o,
|
|
6221
6232
|
method: e,
|
|
6222
6233
|
status: (p = g.response) == null ? void 0 : p.status
|
|
6223
6234
|
}), new f(
|
|
6224
6235
|
h.UNKNOWN_ERROR,
|
|
6225
|
-
`Wallet Gateway 오류 (${
|
|
6236
|
+
`Wallet Gateway 오류 (${S}): ${w}`
|
|
6226
6237
|
);
|
|
6227
6238
|
}
|
|
6228
6239
|
throw g;
|
|
@@ -9140,7 +9151,7 @@ function bt(s, e) {
|
|
|
9140
9151
|
return i ? `${t}.${i}` : `${t}`;
|
|
9141
9152
|
}
|
|
9142
9153
|
function vt(s, e) {
|
|
9143
|
-
return s === e ?
|
|
9154
|
+
return s === e ? A(s) : `<span class="__crossx-amount-tip" data-full="${A(e)}">${A(s)}</span>`;
|
|
9144
9155
|
}
|
|
9145
9156
|
function St(s, e, r) {
|
|
9146
9157
|
if (s === 0n) return "0";
|
|
@@ -9258,11 +9269,11 @@ function j(s, e) {
|
|
|
9258
9269
|
}
|
|
9259
9270
|
function Ai(s, e, r, t) {
|
|
9260
9271
|
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="${
|
|
9272
|
+
<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
9273
|
return _.id = Z, _.innerHTML = `
|
|
9263
9274
|
<div class="__crossx-card __crossx-card--migration __crossx-card--sign-tx" style="${ie(n)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
9264
9275
|
<div class="__crossx-header">
|
|
9265
|
-
<p class="__crossx-title" id="__crossx-ttl">${
|
|
9276
|
+
<p class="__crossx-title" id="__crossx-ttl">${A((t == null ? void 0 : t.sign_transaction_title) ?? "Signature Request")}</p>
|
|
9266
9277
|
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${se}</button>
|
|
9267
9278
|
</div>
|
|
9268
9279
|
<hr class="__crossx-divider">
|
|
@@ -9270,13 +9281,13 @@ function Ai(s, e, r, t) {
|
|
|
9270
9281
|
<div class="__crossx-body-cols">
|
|
9271
9282
|
<div class="__crossx-col-left">
|
|
9272
9283
|
<p class="__crossx-sig-subtitle">
|
|
9273
|
-
<span class="__crossx-sig-origin">${
|
|
9284
|
+
<span class="__crossx-sig-origin">${A(a)}</span>${A((t == null ? void 0 : t.signature_requesting) ?? " is requesting a Signature")}
|
|
9274
9285
|
</p>
|
|
9275
9286
|
<div class="__crossx-addr-pill">
|
|
9276
9287
|
${Pt}
|
|
9277
9288
|
<span class="__crossx-addr-pill-text">${de(s.from)}</span>
|
|
9278
9289
|
</div>
|
|
9279
|
-
<p class="__crossx-warning">${
|
|
9290
|
+
<p class="__crossx-warning">${A((t == null ? void 0 : t.signature_warning) ?? "After you sign, changes or cancellations are not possible.")}</p>
|
|
9280
9291
|
</div>
|
|
9281
9292
|
<hr class="__crossx-divider __crossx-divider--cols">
|
|
9282
9293
|
<div class="__crossx-col-right-sign">
|
|
@@ -9286,12 +9297,12 @@ function Ai(s, e, r, t) {
|
|
|
9286
9297
|
${p}
|
|
9287
9298
|
${l}
|
|
9288
9299
|
</div>
|
|
9289
|
-
<pre class="__crossx-raw-tx">${
|
|
9300
|
+
<pre class="__crossx-raw-tx">${A(g)}</pre>
|
|
9290
9301
|
</div>
|
|
9291
9302
|
</div>
|
|
9292
9303
|
<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">${
|
|
9304
|
+
<button class="__crossx-cancel-btn" id="__crossx-cancel-btn">${A((t == null ? void 0 : t.cancel) ?? "Cancel")}</button>
|
|
9305
|
+
<button class="__crossx-confirm-btn" id="__crossx-confirm-btn">${A((t == null ? void 0 : t.signature_sign_button) ?? "Sign")}</button>
|
|
9295
9306
|
</div>
|
|
9296
9307
|
</div>
|
|
9297
9308
|
</div>
|
|
@@ -9299,17 +9310,17 @@ function Ai(s, e, r, t) {
|
|
|
9299
9310
|
}
|
|
9300
9311
|
function Ii(s, e, r, t) {
|
|
9301
9312
|
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="${
|
|
9313
|
+
<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
9314
|
return g.id = Z, g.innerHTML = `
|
|
9304
9315
|
<div class="__crossx-card __crossx-card--migration __crossx-card--send-tx" style="${ie(n)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
9305
9316
|
<div class="__crossx-header">
|
|
9306
|
-
<p class="__crossx-title" id="__crossx-ttl">${
|
|
9317
|
+
<p class="__crossx-title" id="__crossx-ttl">${A((t == null ? void 0 : t.send_transaction_title) ?? "Approve transaction")}</p>
|
|
9307
9318
|
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${se}</button>
|
|
9308
9319
|
</div>
|
|
9309
9320
|
<hr class="__crossx-divider">
|
|
9310
9321
|
<div class="__crossx-body">
|
|
9311
9322
|
<p class="__crossx-tx-subtitle">
|
|
9312
|
-
<span class="__crossx-sig-origin">${
|
|
9323
|
+
<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
9324
|
</p>
|
|
9314
9325
|
<div class="__crossx-body-cols">
|
|
9315
9326
|
<div class="__crossx-rows">
|
|
@@ -9322,7 +9333,7 @@ function Ii(s, e, r, t) {
|
|
|
9322
9333
|
<span class="__crossx-pill-amount">${p}</span>
|
|
9323
9334
|
</div>
|
|
9324
9335
|
</div>
|
|
9325
|
-
<button class="__crossx-approve-btn" id="__crossx-confirm-btn">${
|
|
9336
|
+
<button class="__crossx-approve-btn" id="__crossx-confirm-btn">${A((t == null ? void 0 : t.send_tx_approve_button) ?? "Approve")}</button>
|
|
9326
9337
|
</div>
|
|
9327
9338
|
</div>
|
|
9328
9339
|
`, g;
|
|
@@ -9336,17 +9347,17 @@ function st(s) {
|
|
|
9336
9347
|
return "This site";
|
|
9337
9348
|
}
|
|
9338
9349
|
}
|
|
9339
|
-
function
|
|
9350
|
+
function A(s) {
|
|
9340
9351
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
9341
9352
|
}
|
|
9342
9353
|
function Ti(s) {
|
|
9343
9354
|
return typeof s == "string" && /^0x[0-9a-fA-F]{40}$/i.test(s);
|
|
9344
9355
|
}
|
|
9345
9356
|
function ki(s) {
|
|
9346
|
-
if (typeof s == "string") return
|
|
9357
|
+
if (typeof s == "string") return A(s);
|
|
9347
9358
|
if (typeof s == "number" || typeof s == "bigint" || typeof s == "boolean") return String(s);
|
|
9348
9359
|
try {
|
|
9349
|
-
return
|
|
9360
|
+
return A(JSON.stringify(s));
|
|
9350
9361
|
} catch {
|
|
9351
9362
|
return String(s);
|
|
9352
9363
|
}
|
|
@@ -9361,7 +9372,7 @@ function Ci(s, e) {
|
|
|
9361
9372
|
return `https://explorer.crosstoken.io/${Ri(s)}/tx/${e}`;
|
|
9362
9373
|
}
|
|
9363
9374
|
function Jr(s, e) {
|
|
9364
|
-
return `<a class="__crossx-addr-text __crossx-row-link" href="${
|
|
9375
|
+
return `<a class="__crossx-addr-text __crossx-row-link" href="${A(e)}" target="_blank" rel="noopener noreferrer">${A(s)}</a>`;
|
|
9365
9376
|
}
|
|
9366
9377
|
function Ze(s) {
|
|
9367
9378
|
return Jr(de(s), Oi(s));
|
|
@@ -9373,17 +9384,17 @@ function Ni(s, e, r) {
|
|
|
9373
9384
|
const t = j(
|
|
9374
9385
|
(r == null ? void 0 : r.label_from) ?? "From",
|
|
9375
9386
|
`${Ze(s.from)}
|
|
9376
|
-
<button class="__crossx-copy-btn" data-copy="${
|
|
9387
|
+
<button class="__crossx-copy-btn" data-copy="${A(s.from)}" title="Copy address">${we}</button>`
|
|
9377
9388
|
), 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">${
|
|
9389
|
+
<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)}
|
|
9390
|
+
<button class="__crossx-copy-btn" data-copy="${A(s.txHash)}" title="Copy hash">${we}</button>`) : "", c = s.total ? `<div class="__crossx-total-pill">
|
|
9391
|
+
<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>
|
|
9392
|
+
<span class="__crossx-total-amount">${A(s.total)}</span>
|
|
9382
9393
|
</div>` : "", l = document.createElement("div");
|
|
9383
9394
|
return l.id = Z, l.innerHTML = `
|
|
9384
9395
|
<div class="__crossx-card __crossx-card--migration" style="${ie(e)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
9385
9396
|
<div class="__crossx-header">
|
|
9386
|
-
<p class="__crossx-title" id="__crossx-ttl">${
|
|
9397
|
+
<p class="__crossx-title" id="__crossx-ttl">${A((r == null ? void 0 : r.tx_success) ?? "Transaction complete")}</p>
|
|
9387
9398
|
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${se}</button>
|
|
9388
9399
|
</div>
|
|
9389
9400
|
<hr class="__crossx-divider">
|
|
@@ -9396,7 +9407,7 @@ function Ni(s, e, r) {
|
|
|
9396
9407
|
${a}
|
|
9397
9408
|
</div>
|
|
9398
9409
|
${c}
|
|
9399
|
-
<button class="__crossx-approve-btn" id="__crossx-done-btn">${
|
|
9410
|
+
<button class="__crossx-approve-btn" id="__crossx-done-btn">${A((r == null ? void 0 : r.tx_complete_done_button) ?? "All Done")}</button>
|
|
9400
9411
|
</div>
|
|
9401
9412
|
</div>
|
|
9402
9413
|
`, l;
|
|
@@ -9406,13 +9417,13 @@ function Pi(s, e, r) {
|
|
|
9406
9417
|
return t.id = Z, t.innerHTML = `
|
|
9407
9418
|
<div class="__crossx-card __crossx-card--migration" style="${ie(e)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
9408
9419
|
<div class="__crossx-header">
|
|
9409
|
-
<p class="__crossx-title" id="__crossx-ttl">${
|
|
9420
|
+
<p class="__crossx-title" id="__crossx-ttl">${A((r == null ? void 0 : r.tx_progress_waiting_title) ?? "Waiting for confirmation")}</p>
|
|
9410
9421
|
</div>
|
|
9411
9422
|
<hr class="__crossx-divider">
|
|
9412
9423
|
<div class="__crossx-body" id="__crossx-progress-body">
|
|
9413
9424
|
<div class="__crossx-progress-center">
|
|
9414
9425
|
<div class="__crossx-spinner"></div>
|
|
9415
|
-
<p class="__crossx-progress-text">${
|
|
9426
|
+
<p class="__crossx-progress-text">${A((r == null ? void 0 : r.tx_progress_waiting_text) ?? "Waiting for transaction receipt...")}</p>
|
|
9416
9427
|
</div>
|
|
9417
9428
|
</div>
|
|
9418
9429
|
</div>
|
|
@@ -9421,8 +9432,8 @@ function Pi(s, e, r) {
|
|
|
9421
9432
|
function Li(s, e, r, t) {
|
|
9422
9433
|
const n = e.status !== "reverted" && e.status !== "timeout", i = e.status === "timeout", o = s.querySelector("#__crossx-ttl"), a = s.querySelector(".__crossx-header");
|
|
9423
9434
|
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>${
|
|
9435
|
+
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";
|
|
9436
|
+
w ? (o.style.display = "flex", o.style.alignItems = "center", o.style.gap = "8px", o.innerHTML = `${w}<span>${A(S)}</span>`) : o.textContent = S;
|
|
9426
9437
|
}
|
|
9427
9438
|
if (a && !s.querySelector("#__crossx-close-btn")) {
|
|
9428
9439
|
const w = document.createElement("button");
|
|
@@ -9431,11 +9442,11 @@ function Li(s, e, r, t) {
|
|
|
9431
9442
|
const c = s.querySelector("#__crossx-progress-body");
|
|
9432
9443
|
if (!c) return;
|
|
9433
9444
|
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">${
|
|
9445
|
+
<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)}
|
|
9446
|
+
<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)}
|
|
9447
|
+
<button class="__crossx-copy-btn" data-copy="${A(e.txHash)}" title="Copy hash">${we}</button>`) : "", x = e.total ? `<div class="__crossx-total-pill">
|
|
9448
|
+
<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>
|
|
9449
|
+
<span class="__crossx-total-amount">${A(e.total)}</span>
|
|
9439
9450
|
</div>` : "";
|
|
9440
9451
|
c.innerHTML = `
|
|
9441
9452
|
<div class="__crossx-rows">
|
|
@@ -9446,11 +9457,11 @@ function Li(s, e, r, t) {
|
|
|
9446
9457
|
${_}
|
|
9447
9458
|
</div>
|
|
9448
9459
|
${x}
|
|
9449
|
-
<button class="__crossx-approve-btn" id="__crossx-done-btn">${
|
|
9460
|
+
<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
9461
|
`, c.querySelectorAll(".__crossx-copy-btn").forEach((w) => {
|
|
9451
|
-
w.addEventListener("click", (
|
|
9462
|
+
w.addEventListener("click", (S) => {
|
|
9452
9463
|
var C;
|
|
9453
|
-
|
|
9464
|
+
S.stopPropagation();
|
|
9454
9465
|
const I = w.dataset.copy;
|
|
9455
9466
|
I && ((C = navigator.clipboard) == null || C.writeText(I).catch(() => {
|
|
9456
9467
|
}));
|
|
@@ -9458,11 +9469,11 @@ function Li(s, e, r, t) {
|
|
|
9458
9469
|
});
|
|
9459
9470
|
}
|
|
9460
9471
|
function Di(s, e, r) {
|
|
9461
|
-
const t = e, n = st(s.dappName), i =
|
|
9472
|
+
const t = e, n = st(s.dappName), i = A(s.message), o = document.createElement("div");
|
|
9462
9473
|
return o.id = Z, o.innerHTML = `
|
|
9463
9474
|
<div class="__crossx-card __crossx-card--migration __crossx-card--sign-msg" style="${ie(t)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
9464
9475
|
<div class="__crossx-header">
|
|
9465
|
-
<p class="__crossx-title" id="__crossx-ttl">${
|
|
9476
|
+
<p class="__crossx-title" id="__crossx-ttl">${A((r == null ? void 0 : r.sign_message_title) ?? "Signature Request")}</p>
|
|
9466
9477
|
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${se}</button>
|
|
9467
9478
|
</div>
|
|
9468
9479
|
<hr class="__crossx-divider">
|
|
@@ -9470,20 +9481,20 @@ function Di(s, e, r) {
|
|
|
9470
9481
|
<div class="__crossx-body-cols">
|
|
9471
9482
|
<div class="__crossx-col-left">
|
|
9472
9483
|
<p class="__crossx-sig-subtitle">
|
|
9473
|
-
<span class="__crossx-sig-origin">${
|
|
9484
|
+
<span class="__crossx-sig-origin">${A(n)}</span>${A((r == null ? void 0 : r.signature_requesting) ?? " is requesting a Signature")}
|
|
9474
9485
|
</p>
|
|
9475
9486
|
<div class="__crossx-addr-pill">
|
|
9476
9487
|
${Pt}
|
|
9477
9488
|
<span class="__crossx-addr-pill-text">${de(s.from)}</span>
|
|
9478
9489
|
</div>
|
|
9479
|
-
<p class="__crossx-warning">${
|
|
9490
|
+
<p class="__crossx-warning">${A((r == null ? void 0 : r.signature_warning) ?? "After you sign, changes or cancellations are not possible.")}</p>
|
|
9480
9491
|
</div>
|
|
9481
9492
|
<hr class="__crossx-divider __crossx-divider--cols">
|
|
9482
9493
|
<div class="__crossx-msg-raw">${i}</div>
|
|
9483
9494
|
</div>
|
|
9484
9495
|
<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">${
|
|
9496
|
+
<button class="__crossx-cancel-btn" id="__crossx-cancel-btn">${A((r == null ? void 0 : r.cancel) ?? "Cancel")}</button>
|
|
9497
|
+
<button class="__crossx-confirm-btn" id="__crossx-confirm-btn">${A((r == null ? void 0 : r.confirm) ?? "Confirm")}</button>
|
|
9487
9498
|
</div>
|
|
9488
9499
|
</div>
|
|
9489
9500
|
</div>
|
|
@@ -9501,15 +9512,15 @@ function $i(s, e, r) {
|
|
|
9501
9512
|
const o = i.primaryType ?? "—", a = i.message ?? {};
|
|
9502
9513
|
let c = `
|
|
9503
9514
|
<div class="__crossx-td-row">
|
|
9504
|
-
<span class="__crossx-td-label">${
|
|
9505
|
-
<span class="__crossx-td-value">${
|
|
9515
|
+
<span class="__crossx-td-label">${A((r == null ? void 0 : r.label_primary_type) ?? "Primary Type")}</span>
|
|
9516
|
+
<span class="__crossx-td-value">${A(o)}</span>
|
|
9506
9517
|
</div>`;
|
|
9507
9518
|
for (const [u, p] of Object.entries(a)) {
|
|
9508
9519
|
const g = ki(p), x = Ti(p) ? `<span class="__crossx-addr-text">${de(p)}</span>
|
|
9509
|
-
<button class="__crossx-copy-btn" data-copy="${
|
|
9520
|
+
<button class="__crossx-copy-btn" data-copy="${A(String(p))}" title="Copy">${we}</button>` : `<span>${g}</span>`;
|
|
9510
9521
|
c += `
|
|
9511
9522
|
<div class="__crossx-td-row">
|
|
9512
|
-
<span class="__crossx-td-label">${
|
|
9523
|
+
<span class="__crossx-td-label">${A(u)}</span>
|
|
9513
9524
|
<div class="__crossx-td-value">${x}</div>
|
|
9514
9525
|
</div>`;
|
|
9515
9526
|
}
|
|
@@ -9517,7 +9528,7 @@ function $i(s, e, r) {
|
|
|
9517
9528
|
return l.id = Z, l.innerHTML = `
|
|
9518
9529
|
<div class="__crossx-card __crossx-card--migration __crossx-card--sign-typed" style="${ie(t)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
9519
9530
|
<div class="__crossx-header">
|
|
9520
|
-
<p class="__crossx-title" id="__crossx-ttl">${
|
|
9531
|
+
<p class="__crossx-title" id="__crossx-ttl">${A((r == null ? void 0 : r.sign_typed_data_title) ?? "Signature Request")}</p>
|
|
9521
9532
|
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${se}</button>
|
|
9522
9533
|
</div>
|
|
9523
9534
|
<hr class="__crossx-divider">
|
|
@@ -9525,20 +9536,20 @@ function $i(s, e, r) {
|
|
|
9525
9536
|
<div class="__crossx-body-cols">
|
|
9526
9537
|
<div class="__crossx-col-left">
|
|
9527
9538
|
<p class="__crossx-sig-subtitle">
|
|
9528
|
-
<span class="__crossx-sig-origin">${
|
|
9539
|
+
<span class="__crossx-sig-origin">${A(n)}</span>${A((r == null ? void 0 : r.signature_requesting) ?? " is requesting a Signature")}
|
|
9529
9540
|
</p>
|
|
9530
9541
|
<div class="__crossx-addr-pill">
|
|
9531
9542
|
${Pt}
|
|
9532
9543
|
<span class="__crossx-addr-pill-text">${de(s.from)}</span>
|
|
9533
9544
|
</div>
|
|
9534
|
-
<p class="__crossx-warning">${
|
|
9545
|
+
<p class="__crossx-warning">${A((r == null ? void 0 : r.signature_warning) ?? "After you sign, changes or cancellations are not possible.")}</p>
|
|
9535
9546
|
</div>
|
|
9536
9547
|
<hr class="__crossx-divider __crossx-divider--cols">
|
|
9537
9548
|
<div class="__crossx-td-rows">${c}</div>
|
|
9538
9549
|
</div>
|
|
9539
9550
|
<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">${
|
|
9551
|
+
<button class="__crossx-cancel-btn" id="__crossx-cancel-btn">${A((r == null ? void 0 : r.cancel) ?? "Cancel")}</button>
|
|
9552
|
+
<button class="__crossx-confirm-btn" id="__crossx-confirm-btn">${A((r == null ? void 0 : r.confirm) ?? "Confirm")}</button>
|
|
9542
9553
|
</div>
|
|
9543
9554
|
</div>
|
|
9544
9555
|
</div>
|
|
@@ -9565,17 +9576,17 @@ function es(s, e, r) {
|
|
|
9565
9576
|
}
|
|
9566
9577
|
function Wi(s, e, r, t) {
|
|
9567
9578
|
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">${
|
|
9579
|
+
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>` : "";
|
|
9580
|
+
return `<button class="__crossx-wallet-item${l}" data-wallet-index="${a.index}" data-wallet-address="${A(a.address)}">
|
|
9581
|
+
${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
9582
|
</button>`;
|
|
9572
9583
|
}).join(""), o = document.createElement("div");
|
|
9573
9584
|
return o.id = Z, o.innerHTML = `
|
|
9574
9585
|
<div class="__crossx-card __crossx-card--migration __crossx-card--wallet-selector" style="${ie(e)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
9575
9586
|
<div class="__crossx-header">
|
|
9576
9587
|
<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">${
|
|
9588
|
+
<p class="__crossx-title" id="__crossx-ttl" style="padding-right:0;">${A((t == null ? void 0 : t.wallet_selector_title) ?? "Select Connected Wallet")}</p>
|
|
9589
|
+
<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
9590
|
</div>
|
|
9580
9591
|
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${se}</button>
|
|
9581
9592
|
</div>
|
|
@@ -9584,8 +9595,8 @@ function Wi(s, e, r, t) {
|
|
|
9584
9595
|
<div class="__crossx-body-cols">
|
|
9585
9596
|
<div class="__crossx-col-left">
|
|
9586
9597
|
<div class="__crossx-mig-info">
|
|
9587
|
-
<p class="__crossx-mig-info-title">${
|
|
9588
|
-
<p class="__crossx-mig-info-desc">${
|
|
9598
|
+
<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>
|
|
9599
|
+
<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
9600
|
</div>
|
|
9590
9601
|
</div>
|
|
9591
9602
|
<hr class="__crossx-divider __crossx-divider--cols">
|
|
@@ -9595,7 +9606,7 @@ function Wi(s, e, r, t) {
|
|
|
9595
9606
|
</div>
|
|
9596
9607
|
<button class="__crossx-wallet-add" id="__crossx-add-wallet-btn" type="button">
|
|
9597
9608
|
<span class="__crossx-wallet-add-icon">${Bi}</span>
|
|
9598
|
-
<span class="__crossx-wallet-add-label">${
|
|
9609
|
+
<span class="__crossx-wallet-add-label">${A((t == null ? void 0 : t.wallet_selector_add_button) ?? "add a wallet")}</span>
|
|
9599
9610
|
</button>
|
|
9600
9611
|
<p class="__crossx-wallet-add-error" id="__crossx-add-wallet-error" role="alert" aria-live="polite" hidden></p>
|
|
9601
9612
|
</div>
|
|
@@ -9615,7 +9626,7 @@ const Gi = `<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="h
|
|
|
9615
9626
|
</svg>`;
|
|
9616
9627
|
function Ki(s) {
|
|
9617
9628
|
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">${
|
|
9629
|
+
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
9630
|
}
|
|
9620
9631
|
function Vi(s) {
|
|
9621
9632
|
if (s.length === 0) return "";
|
|
@@ -9630,13 +9641,13 @@ function Vi(s) {
|
|
|
9630
9641
|
return `${r}${e(0)}, ${e(1)}, ${e(2)}, and ${t} more.`;
|
|
9631
9642
|
}
|
|
9632
9643
|
function zi(s, e = [], r) {
|
|
9633
|
-
const t = s, n =
|
|
9644
|
+
const t = s, n = A(String(e[0])), i = A((r == null ? void 0 : r.login_selector_or) ?? "or"), o = e.length > 0 ? `
|
|
9634
9645
|
<div class="__crossx-login-or-divider">
|
|
9635
9646
|
<hr><span>${i}</span><hr>
|
|
9636
9647
|
</div>
|
|
9637
9648
|
<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
9649
|
<span class="__crossx-connect-other-text">
|
|
9639
|
-
<span class="__crossx-connect-other-title" id="__crossx-connect-other-heading">${
|
|
9650
|
+
<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
9651
|
<span class="__crossx-connect-other-desc __crossx-connect-other-summary">${Vi(e)}</span>
|
|
9641
9652
|
</span>
|
|
9642
9653
|
</button>` : "", a = document.createElement("div");
|
|
@@ -9644,8 +9655,8 @@ function zi(s, e = [], r) {
|
|
|
9644
9655
|
<div class="__crossx-card __crossx-card--migration" style="${ie(t)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
9645
9656
|
<div class="__crossx-header">
|
|
9646
9657
|
<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">${
|
|
9658
|
+
<p class="__crossx-title" id="__crossx-ttl" style="padding-right:0;">${A((r == null ? void 0 : r.login_selector_title) ?? "CROSS Wallet")}</p>
|
|
9659
|
+
<p class="__crossx-subtitle">${A((r == null ? void 0 : r.login_selector_subtitle) ?? "Sign in instantly with your social account")}</p>
|
|
9649
9660
|
</div>
|
|
9650
9661
|
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${se}</button>
|
|
9651
9662
|
</div>
|
|
@@ -9654,15 +9665,15 @@ function zi(s, e = [], r) {
|
|
|
9654
9665
|
<div class="__crossx-login-btn-row">
|
|
9655
9666
|
<button class="__crossx-login-btn" id="__crossx-apple-btn" type="button">
|
|
9656
9667
|
<span class="__crossx-login-icon" style="color:var(--cx-value);">${Gi}</span>
|
|
9657
|
-
<span class="__crossx-login-btn-label">${
|
|
9668
|
+
<span class="__crossx-login-btn-label">${A((r == null ? void 0 : r.login_selector_apple) ?? "Sign in with Apple")}</span>
|
|
9658
9669
|
</button>
|
|
9659
9670
|
<button class="__crossx-login-btn" id="__crossx-google-btn" type="button">
|
|
9660
9671
|
<span class="__crossx-login-icon">${qi}</span>
|
|
9661
|
-
<span class="__crossx-login-btn-label">${
|
|
9672
|
+
<span class="__crossx-login-btn-label">${A((r == null ? void 0 : r.login_selector_google) ?? "Sign in with Google")}</span>
|
|
9662
9673
|
</button>
|
|
9663
9674
|
</div>${o}
|
|
9664
9675
|
<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">${
|
|
9676
|
+
${((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
9677
|
</p>
|
|
9667
9678
|
</div>
|
|
9668
9679
|
</div>
|
|
@@ -9671,26 +9682,26 @@ function zi(s, e = [], r) {
|
|
|
9671
9682
|
function ji(s, e) {
|
|
9672
9683
|
const r = s, t = document.createElement("div");
|
|
9673
9684
|
t.id = Z;
|
|
9674
|
-
const n =
|
|
9675
|
-
<p class="__crossx-session-account-label">${
|
|
9676
|
-
<p class="__crossx-session-account-email">${
|
|
9685
|
+
const n = A(e.message).replace(/\n/g, "<br>"), i = e.email ? `<div class="__crossx-session-account-card">
|
|
9686
|
+
<p class="__crossx-session-account-label">${A(e.accountLabel)}</p>
|
|
9687
|
+
<p class="__crossx-session-account-email">${A(e.email)}</p>
|
|
9677
9688
|
</div>` : "";
|
|
9678
9689
|
return t.innerHTML = `
|
|
9679
9690
|
<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
9691
|
<div class="__crossx-header">
|
|
9681
|
-
<p class="__crossx-title" id="__crossx-session-header-title">${
|
|
9692
|
+
<p class="__crossx-title" id="__crossx-session-header-title">${A(e.title)}</p>
|
|
9682
9693
|
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${se}</button>
|
|
9683
9694
|
</div>
|
|
9684
9695
|
<hr class="__crossx-divider">
|
|
9685
9696
|
<div class="__crossx-body" style="padding:20px 24px 24px;display:flex;flex-direction:column;gap:16px;">
|
|
9686
9697
|
<div class="__crossx-session-hero">
|
|
9687
|
-
<p class="__crossx-session-hero-title">${
|
|
9698
|
+
<p class="__crossx-session-hero-title">${A(e.title)}</p>
|
|
9688
9699
|
<p class="__crossx-session-hero-message" id="__crossx-session-msg">${n}</p>
|
|
9689
9700
|
</div>
|
|
9690
9701
|
${i}
|
|
9691
9702
|
<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">${
|
|
9703
|
+
<button class="__crossx-cancel-btn" id="__crossx-session-signout">${A(e.signOutLabel)}</button>
|
|
9704
|
+
<button class="__crossx-confirm-btn" id="__crossx-session-signin">${A(e.signInAgainLabel)}</button>
|
|
9694
9705
|
</div>
|
|
9695
9706
|
</div>
|
|
9696
9707
|
</div>
|
|
@@ -9783,13 +9794,13 @@ function Qi(s) {
|
|
|
9783
9794
|
const r = [s.check1, s.check2].map((t, n) => `
|
|
9784
9795
|
<div class="__crossx-pw-notice-item" data-check-index="${n}" role="checkbox" aria-checked="false" tabindex="0">
|
|
9785
9796
|
<div class="__crossx-pw-notice-check" id="__crossx-notice-check-${n}">${so}</div>
|
|
9786
|
-
<span class="__crossx-pw-notice-item-text">${
|
|
9797
|
+
<span class="__crossx-pw-notice-item-text">${A(t)}</span>
|
|
9787
9798
|
</div>
|
|
9788
9799
|
`).join("");
|
|
9789
9800
|
return `
|
|
9790
9801
|
<div class="__crossx-header">
|
|
9791
|
-
<p class="__crossx-title" id="__crossx-ttl" style="padding-right:48px;">${
|
|
9792
|
-
<p class="__crossx-pw-subtitle">${
|
|
9802
|
+
<p class="__crossx-title" id="__crossx-ttl" style="padding-right:48px;">${A(s.title)}</p>
|
|
9803
|
+
<p class="__crossx-pw-subtitle">${A(s.headerSubtitle)}</p>
|
|
9793
9804
|
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${se}</button>
|
|
9794
9805
|
</div>
|
|
9795
9806
|
<hr class="__crossx-divider">
|
|
@@ -9798,33 +9809,33 @@ function Qi(s) {
|
|
|
9798
9809
|
<div class="__crossx-pw-notice-header">
|
|
9799
9810
|
<div class="__crossx-pw-notice-title-row">
|
|
9800
9811
|
<span class="__crossx-pw-notice-icon">${no}</span>
|
|
9801
|
-
<p class="__crossx-pw-notice-title">${
|
|
9812
|
+
<p class="__crossx-pw-notice-title">${A(s.noticeTitle)}</p>
|
|
9802
9813
|
</div>
|
|
9803
|
-
<p class="__crossx-pw-notice-desc">${
|
|
9814
|
+
<p class="__crossx-pw-notice-desc">${A(s.noticeDesc)}</p>
|
|
9804
9815
|
</div>
|
|
9805
9816
|
<div class="__crossx-pw-notice-checks" id="__crossx-notice-checks">
|
|
9806
9817
|
${r}
|
|
9807
9818
|
</div>
|
|
9808
9819
|
</div>
|
|
9809
9820
|
<button class="__crossx-pw-btn --disabled" id="__crossx-pin-notice-next"
|
|
9810
|
-
data-next-label="${
|
|
9811
|
-
data-submit-label="${
|
|
9812
|
-
${
|
|
9821
|
+
data-next-label="${A(s.nextButton)}"
|
|
9822
|
+
data-submit-label="${A(s.submitButton)}">
|
|
9823
|
+
${A(s.nextButton)}
|
|
9813
9824
|
</button>
|
|
9814
9825
|
</div>
|
|
9815
9826
|
<div class="__crossx-home-indicator"></div>
|
|
9816
9827
|
`;
|
|
9817
9828
|
}
|
|
9818
9829
|
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">${
|
|
9830
|
+
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
9831
|
${ts}
|
|
9821
9832
|
<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">${
|
|
9833
|
+
</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
9834
|
{ length: 6 },
|
|
9824
|
-
(w,
|
|
9835
|
+
(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
9836
|
).join(""), p = e ? " --locked" : "", g = Array.from(
|
|
9826
9837
|
{ length: 6 },
|
|
9827
|
-
(w,
|
|
9838
|
+
(w, S) => `<div class="__crossx-pin6-dot${p}" data-dot-index="${S}" aria-label="PIN digit ${S + 1}"></div>`
|
|
9828
9839
|
).join(""), _ = e ? " --disabled" : "", x = `
|
|
9829
9840
|
<div class="__crossx-pin6-numpad" id="__crossx-pin6-numpad">
|
|
9830
9841
|
<div class="__crossx-pin6-numpad-row">
|
|
@@ -9850,7 +9861,7 @@ function pt(s) {
|
|
|
9850
9861
|
</div>`;
|
|
9851
9862
|
return `
|
|
9852
9863
|
<div class="__crossx-header">
|
|
9853
|
-
<p class="__crossx-title" id="__crossx-ttl" style="padding-right:48px;">${
|
|
9864
|
+
<p class="__crossx-title" id="__crossx-ttl" style="padding-right:48px;">${A(s.title)}</p>
|
|
9854
9865
|
${t}
|
|
9855
9866
|
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${se}</button>
|
|
9856
9867
|
</div>
|
|
@@ -9893,18 +9904,18 @@ function to(s) {
|
|
|
9893
9904
|
function _t(s, e, r, t, n, i, o) {
|
|
9894
9905
|
var N, B;
|
|
9895
9906
|
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 =
|
|
9907
|
+
const l = () => Array.from(s.querySelectorAll(".__crossx-pin6-box")), u = () => s.querySelector("#__crossx-pin6-boxes"), p = () => s.querySelector("#__crossx-pin6-error"), g = () => s.querySelector("#__crossx-pin6-lock-msg"), _ = () => s.querySelector("#__crossx-pin6-lock-countdown"), x = () => s.querySelector(".__crossx-pin6-body"), w = () => l().map((b) => b.value).join(""), S = () => Array.from(s.querySelectorAll(".__crossx-pin6-dot")), I = () => {
|
|
9908
|
+
var E;
|
|
9909
|
+
const b = l(), v = S();
|
|
9899
9910
|
if (v.length && (v.forEach((T, O) => {
|
|
9900
9911
|
const W = !!(b[O] && b[O].value);
|
|
9901
9912
|
T.classList.toggle("--filled", W), T.classList.toggle("--active", !1);
|
|
9902
9913
|
}), !a && !c)) {
|
|
9903
9914
|
const T = b.findIndex((W) => !W.value);
|
|
9904
|
-
(
|
|
9915
|
+
(E = v[T === -1 ? 5 : T]) == null || E.classList.add("--active");
|
|
9905
9916
|
}
|
|
9906
9917
|
}, C = () => {
|
|
9907
|
-
s.querySelectorAll(".__crossx-pin6-numpad-key[data-key]").forEach((v) => v.classList.toggle("--disabled", a)),
|
|
9918
|
+
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
9919
|
}, R = (b) => {
|
|
9909
9920
|
a = b, l().forEach((v) => {
|
|
9910
9921
|
v.disabled = b, v.classList.toggle("--locked", b);
|
|
@@ -9913,12 +9924,12 @@ function _t(s, e, r, t, n, i, o) {
|
|
|
9913
9924
|
const b = p();
|
|
9914
9925
|
b && (b.textContent = "");
|
|
9915
9926
|
}, q = () => o ?? "Your account will be locked after further failures.", J = () => s.querySelector("#__crossx-pin6-warning"), G = (b) => {
|
|
9916
|
-
var
|
|
9927
|
+
var E;
|
|
9917
9928
|
let v = J();
|
|
9918
9929
|
if (!v) {
|
|
9919
9930
|
v = document.createElement("p"), v.className = "__crossx-pin6-warning", v.id = "__crossx-pin6-warning";
|
|
9920
9931
|
const T = p();
|
|
9921
|
-
T ? T.insertAdjacentElement("afterend", v) : (
|
|
9932
|
+
T ? T.insertAdjacentElement("afterend", v) : (E = x()) == null || E.appendChild(v);
|
|
9922
9933
|
}
|
|
9923
9934
|
v.textContent = b;
|
|
9924
9935
|
}, X = () => {
|
|
@@ -9926,21 +9937,21 @@ function _t(s, e, r, t, n, i, o) {
|
|
|
9926
9937
|
b && (b.textContent = "");
|
|
9927
9938
|
}, Q = (b, v) => {
|
|
9928
9939
|
var T;
|
|
9929
|
-
let
|
|
9930
|
-
if (!
|
|
9931
|
-
|
|
9940
|
+
let E = L();
|
|
9941
|
+
if (!E) {
|
|
9942
|
+
E = document.createElement("p"), E.className = "__crossx-pin6-attempt", E.id = "__crossx-pin6-attempt";
|
|
9932
9943
|
const O = J() ?? p();
|
|
9933
|
-
O ? O.insertAdjacentElement("afterend",
|
|
9944
|
+
O ? O.insertAdjacentElement("afterend", E) : (T = x()) == null || T.appendChild(E);
|
|
9934
9945
|
}
|
|
9935
|
-
|
|
9946
|
+
E.textContent = `${b}/${v}`;
|
|
9936
9947
|
}, H = () => {
|
|
9937
9948
|
const b = L();
|
|
9938
9949
|
b && (b.textContent = "");
|
|
9939
9950
|
}, D = (b) => {
|
|
9940
9951
|
const v = p();
|
|
9941
9952
|
v && (v.textContent = b);
|
|
9942
|
-
const
|
|
9943
|
-
|
|
9953
|
+
const E = u();
|
|
9954
|
+
E == null || E.classList.add("--shake"), setTimeout(() => E == null ? void 0 : E.classList.remove("--shake"), 500), l().forEach((T) => {
|
|
9944
9955
|
T.value = "";
|
|
9945
9956
|
}), setTimeout(() => {
|
|
9946
9957
|
var T;
|
|
@@ -9958,15 +9969,15 @@ function _t(s, e, r, t, n, i, o) {
|
|
|
9958
9969
|
const $ = p();
|
|
9959
9970
|
$ ? $.insertAdjacentElement("afterend", U) : (W = x()) == null || W.appendChild(U);
|
|
9960
9971
|
}
|
|
9961
|
-
const
|
|
9972
|
+
const E = () => {
|
|
9962
9973
|
var K;
|
|
9963
9974
|
const U = b - Date.now(), $ = _();
|
|
9964
9975
|
U <= 0 ? (clearInterval(T), R(!1), (K = g()) == null || K.remove(), v && (v.textContent = ""), C(), setTimeout(() => {
|
|
9965
9976
|
var Y;
|
|
9966
9977
|
return (Y = l()[0]) == null ? void 0 : Y.focus();
|
|
9967
9978
|
}, 50)) : $ && ($.textContent = ` ${to(U)}`);
|
|
9968
|
-
}, T = setInterval(
|
|
9969
|
-
|
|
9979
|
+
}, T = setInterval(E, 1e3);
|
|
9980
|
+
E();
|
|
9970
9981
|
const O = new MutationObserver(() => {
|
|
9971
9982
|
document.contains(s) || (clearInterval(T), O.disconnect());
|
|
9972
9983
|
});
|
|
@@ -9999,7 +10010,7 @@ function _t(s, e, r, t, n, i, o) {
|
|
|
9999
10010
|
}, 100);
|
|
10000
10011
|
const y = () => {
|
|
10001
10012
|
if (a || c) return;
|
|
10002
|
-
const b = l(), v = b.find((
|
|
10013
|
+
const b = l(), v = b.find((E) => !E.value) ?? b[b.length - 1];
|
|
10003
10014
|
v == null || v.focus();
|
|
10004
10015
|
};
|
|
10005
10016
|
(N = u()) == null || N.addEventListener("click", (b) => {
|
|
@@ -10010,23 +10021,23 @@ function _t(s, e, r, t, n, i, o) {
|
|
|
10010
10021
|
}), l().forEach((b, v) => {
|
|
10011
10022
|
b.addEventListener("input", () => {
|
|
10012
10023
|
var T;
|
|
10013
|
-
const
|
|
10014
|
-
b.value =
|
|
10015
|
-
}), b.addEventListener("keydown", (
|
|
10024
|
+
const E = b.value.replace(/\D/g, "").slice(-1);
|
|
10025
|
+
b.value = E, M(), E && v < 5 && ((T = l()[v + 1]) == null || T.focus()), I(), w().length === 6 && setTimeout(m, 80);
|
|
10026
|
+
}), b.addEventListener("keydown", (E) => {
|
|
10016
10027
|
var T, O;
|
|
10017
|
-
if (
|
|
10018
|
-
if (
|
|
10028
|
+
if (E.key === "Backspace") {
|
|
10029
|
+
if (E.preventDefault(), b.value)
|
|
10019
10030
|
b.value = "";
|
|
10020
10031
|
else if (v > 0) {
|
|
10021
10032
|
const W = l()[v - 1];
|
|
10022
10033
|
W.value = "", W.focus();
|
|
10023
10034
|
}
|
|
10024
10035
|
I();
|
|
10025
|
-
} else
|
|
10026
|
-
}), b.addEventListener("paste", (
|
|
10036
|
+
} else E.key === "ArrowLeft" && v > 0 ? (E.preventDefault(), (T = l()[v - 1]) == null || T.focus()) : E.key === "ArrowRight" && v < 5 ? (E.preventDefault(), (O = l()[v + 1]) == null || O.focus()) : E.key === "Escape" && r();
|
|
10037
|
+
}), b.addEventListener("paste", (E) => {
|
|
10027
10038
|
var W, U;
|
|
10028
|
-
|
|
10029
|
-
const T = (((W =
|
|
10039
|
+
E.preventDefault();
|
|
10040
|
+
const T = (((W = E.clipboardData) == null ? void 0 : W.getData("text")) ?? "").replace(/\D/g, "").slice(0, 6);
|
|
10030
10041
|
if (!T) return;
|
|
10031
10042
|
const O = l();
|
|
10032
10043
|
T.split("").forEach(($, K) => {
|
|
@@ -10044,7 +10055,7 @@ function _t(s, e, r, t, n, i, o) {
|
|
|
10044
10055
|
const O = T.target.closest(".__crossx-pin6-numpad-key");
|
|
10045
10056
|
!O || a || c || (v(), b = O, O.classList.add("--pressed"), O.setPointerCapture(T.pointerId));
|
|
10046
10057
|
});
|
|
10047
|
-
const
|
|
10058
|
+
const E = (T) => {
|
|
10048
10059
|
const O = T.dataset.key;
|
|
10049
10060
|
if (!O) return;
|
|
10050
10061
|
if (O === "backspace") {
|
|
@@ -10061,7 +10072,7 @@ function _t(s, e, r, t, n, i, o) {
|
|
|
10061
10072
|
const O = b;
|
|
10062
10073
|
v();
|
|
10063
10074
|
const W = O.getBoundingClientRect();
|
|
10064
|
-
T.clientX >= W.left && T.clientX <= W.right && T.clientY >= W.top && T.clientY <= W.bottom && !a && !c &&
|
|
10075
|
+
T.clientX >= W.left && T.clientX <= W.right && T.clientY >= W.top && T.clientY <= W.bottom && !a && !c && E(O);
|
|
10065
10076
|
}), k.addEventListener("pointercancel", v), k.addEventListener("pointerleave", v, !0), I(), i && i > Date.now() && C();
|
|
10066
10077
|
}
|
|
10067
10078
|
}
|
|
@@ -10157,25 +10168,25 @@ class oo {
|
|
|
10157
10168
|
});
|
|
10158
10169
|
});
|
|
10159
10170
|
})();
|
|
10160
|
-
const w = a.querySelector("#__crossx-add-wallet-error"),
|
|
10161
|
-
|
|
10162
|
-
|
|
10171
|
+
const w = a.querySelector("#__crossx-add-wallet-error"), S = a.querySelector("#__crossx-add-wallet-btn");
|
|
10172
|
+
S && S.addEventListener("click", async () => {
|
|
10173
|
+
S.disabled = !0, w && (w.hidden = !0, w.textContent = "");
|
|
10163
10174
|
try {
|
|
10164
10175
|
const R = await r();
|
|
10165
10176
|
o.push(R);
|
|
10166
10177
|
const L = a.querySelector("#__crossx-wallet-list");
|
|
10167
10178
|
if (L) {
|
|
10168
10179
|
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">${
|
|
10180
|
+
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
10181
|
try {
|
|
10171
10182
|
M.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
10172
10183
|
} catch {
|
|
10173
10184
|
}
|
|
10174
10185
|
}
|
|
10175
|
-
|
|
10186
|
+
S.disabled = !1;
|
|
10176
10187
|
} catch (R) {
|
|
10177
10188
|
const L = R instanceof f && R.code === h.ADDRESS_LIMIT_EXCEEDED, M = this.resolveAddWalletErrorMessage(R);
|
|
10178
|
-
w && (w.textContent = M, w.hidden = !1), L ? (
|
|
10189
|
+
w && (w.textContent = M, w.hidden = !1), L ? (S.disabled = !0, S.setAttribute("aria-disabled", "true")) : S.disabled = !1, p = R;
|
|
10179
10190
|
}
|
|
10180
10191
|
}), (C = a.querySelector("#__crossx-close-btn")) == null || C.addEventListener("click", _), a.addEventListener("click", (R) => {
|
|
10181
10192
|
R.target === a && _();
|
|
@@ -10218,23 +10229,23 @@ class oo {
|
|
|
10218
10229
|
ce(i);
|
|
10219
10230
|
const a = () => {
|
|
10220
10231
|
i.remove(), o();
|
|
10221
|
-
}, c = (
|
|
10222
|
-
a(), n({ type: "oauth", provider:
|
|
10223
|
-
}, l = (
|
|
10224
|
-
a(), n({ type: "external", walletId:
|
|
10232
|
+
}, c = (S) => {
|
|
10233
|
+
a(), n({ type: "oauth", provider: S });
|
|
10234
|
+
}, l = (S) => {
|
|
10235
|
+
a(), n({ type: "external", walletId: S });
|
|
10225
10236
|
}, u = () => {
|
|
10226
10237
|
a(), n(null);
|
|
10227
10238
|
};
|
|
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 C =
|
|
10239
|
+
(g = i.querySelector("#__crossx-apple-btn")) == null || g.addEventListener("click", () => c("apple")), (_ = i.querySelector("#__crossx-google-btn")) == null || _.addEventListener("click", () => c("google")), (x = i.querySelector("#__crossx-connect-other-wallet-btn")) == null || x.addEventListener("click", (S) => {
|
|
10240
|
+
const C = S.currentTarget.dataset.walletId ?? "";
|
|
10230
10241
|
C && l(C);
|
|
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
|
-
|
|
10242
|
+
}), (w = i.querySelector("#__crossx-close-btn")) == null || w.addEventListener("click", u), i.addEventListener("click", (S) => {
|
|
10243
|
+
S.target === i && u();
|
|
10244
|
+
}), i.querySelectorAll(".__crossx-login-terms-link").forEach((S) => {
|
|
10245
|
+
S.addEventListener("click", (I) => I.stopPropagation());
|
|
10235
10246
|
});
|
|
10236
|
-
const p = (
|
|
10237
|
-
|
|
10247
|
+
const p = (S) => {
|
|
10248
|
+
S.key === "Escape" && (document.removeEventListener("keydown", p), u());
|
|
10238
10249
|
};
|
|
10239
10250
|
document.addEventListener("keydown", p);
|
|
10240
10251
|
});
|
|
@@ -10340,9 +10351,9 @@ class oo {
|
|
|
10340
10351
|
title: o.title,
|
|
10341
10352
|
headerSubtitle: o.headerSubtitle
|
|
10342
10353
|
}), (R = _.querySelector("#__crossx-close-btn")) == null || R.addEventListener("click", g), _t(_, (L) => {
|
|
10343
|
-
L === C ? p(C) :
|
|
10354
|
+
L === C ? p(C) : S(i.mismatchError);
|
|
10344
10355
|
}, g);
|
|
10345
|
-
},
|
|
10356
|
+
}, S = (C) => {
|
|
10346
10357
|
var R;
|
|
10347
10358
|
_.innerHTML = pt({
|
|
10348
10359
|
title: i.title,
|
|
@@ -10351,7 +10362,7 @@ class oo {
|
|
|
10351
10362
|
errorMessage: C
|
|
10352
10363
|
}), (R = _.querySelector("#__crossx-close-btn")) == null || R.addEventListener("click", g), _t(_, (L) => {
|
|
10353
10364
|
const M = eo(L, x);
|
|
10354
|
-
M ?
|
|
10365
|
+
M ? S(M) : w(L);
|
|
10355
10366
|
}, g);
|
|
10356
10367
|
};
|
|
10357
10368
|
(() => {
|
|
@@ -10379,7 +10390,7 @@ class oo {
|
|
|
10379
10390
|
});
|
|
10380
10391
|
}), R.addEventListener("click", () => {
|
|
10381
10392
|
if (L.size === C.length) {
|
|
10382
|
-
|
|
10393
|
+
S(e == null ? void 0 : e.errorMessage);
|
|
10383
10394
|
return;
|
|
10384
10395
|
}
|
|
10385
10396
|
const H = C.find((F) => {
|
|
@@ -10428,8 +10439,8 @@ class oo {
|
|
|
10428
10439
|
g(), r(null);
|
|
10429
10440
|
}, w = (C) => {
|
|
10430
10441
|
g(), t(C);
|
|
10431
|
-
},
|
|
10432
|
-
(I =
|
|
10442
|
+
}, S = l.querySelector(".__crossx-card");
|
|
10443
|
+
(I = S.querySelector("#__crossx-close-btn")) == null || I.addEventListener("click", x), _t(S, _, x, w, e == null ? void 0 : e.onSubmit, e == null ? void 0 : e.lockExpiresAt, c), l.addEventListener("click", (C) => {
|
|
10433
10444
|
C.target === l && x();
|
|
10434
10445
|
});
|
|
10435
10446
|
});
|
|
@@ -10807,8 +10818,8 @@ Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
|
|
|
10807
10818
|
},
|
|
10808
10819
|
x
|
|
10809
10820
|
);
|
|
10810
|
-
const w = new He(n, c),
|
|
10811
|
-
|
|
10821
|
+
const w = new He(n, c), S = new oo(s.theme ?? "light", s.themeTokens, s.displayDecimals), I = new ao(
|
|
10822
|
+
S,
|
|
10812
10823
|
() => {
|
|
10813
10824
|
var M;
|
|
10814
10825
|
return (M = _ == null ? void 0 : _.getRNBridge) == null ? void 0 : M.call(_);
|