@nexus-cross/crossx-sdk-core 2.3.12 → 2.4.0-beta.1
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/constants.d.ts +1 -1
- package/dist/crossx.global +34 -34
- package/dist/index.cjs +41 -41
- package/dist/index.js +180 -152
- package/dist/sdk/CROSSxSDK.d.ts +2 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@ class _ extends Error {
|
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
const
|
|
19
|
+
const Dt = 2e3, Je = 6e4, Lt = 1e3, Mt = 1e4, $t = "0x77359400", Ze = "0x3B9ACA00", Qe = 130, We = 6, et = 18, tt = 3e4, Ft = 5 * 60 * 1e3, Bt = 30 * 1e3, Le = 100, Ut = "crossx-sdk-js/2.4.0-beta.1", He = "ONEpocket";
|
|
20
20
|
var ge = /* @__PURE__ */ ((i) => (i.MetaMask = "io.metamask", i.Binance = "com.binance.wallet", i.CROSSx = "crossx", i))(ge || {});
|
|
21
21
|
const Wt = {
|
|
22
22
|
"io.metamask": "MetaMask",
|
|
@@ -85,16 +85,16 @@ const Ae = {
|
|
|
85
85
|
}
|
|
86
86
|
}, Zs = Object.fromEntries(
|
|
87
87
|
Object.entries(Ae).map(([i, e]) => [i, e.caipId])
|
|
88
|
-
),
|
|
88
|
+
), zt = new Map(
|
|
89
89
|
Object.values(Ae).map((i) => [i.caipId, i])
|
|
90
90
|
);
|
|
91
91
|
new Map(
|
|
92
92
|
Object.values(Ae).map((i) => [i.chainId, i])
|
|
93
93
|
);
|
|
94
|
-
const
|
|
94
|
+
const Vt = { symbol: "", decimals: 18 };
|
|
95
95
|
function ke(i) {
|
|
96
96
|
var e;
|
|
97
|
-
return ((e =
|
|
97
|
+
return ((e = zt.get(i)) == null ? void 0 : e.nativeCurrency) ?? Vt;
|
|
98
98
|
}
|
|
99
99
|
class qt {
|
|
100
100
|
constructor(e, r) {
|
|
@@ -580,7 +580,7 @@ const st = "crossx_access_token", it = "crossx_refresh_token", ot = "crossx_user
|
|
|
580
580
|
});
|
|
581
581
|
r = x.token, t = x.email, c.log("[CROSSx] OAuth Firebase 토큰 받음 (length:", r.length, ")"), t && c.log("[CROSSx] OAuth 콜백 email:", t);
|
|
582
582
|
} catch (s) {
|
|
583
|
-
c.error("[CROSSx] SignIn 에러 (OAuth 단계):", s);
|
|
583
|
+
if (c.error("[CROSSx] SignIn 에러 (OAuth 단계):", s), s instanceof _) throw s;
|
|
584
584
|
const o = s instanceof Error ? s.message : "Sign in failed";
|
|
585
585
|
throw /팝업|popup/i.test(o) ? new _(
|
|
586
586
|
d.OAUTH_POPUP_BLOCKED,
|
|
@@ -1056,7 +1056,7 @@ const st = "crossx_access_token", it = "crossx_refresh_token", ot = "crossx_user
|
|
|
1056
1056
|
}
|
|
1057
1057
|
};
|
|
1058
1058
|
Ee.REFRESH_RELOGIN_CODES = /* @__PURE__ */ new Set([1007, 1008]);
|
|
1059
|
-
let
|
|
1059
|
+
let Me = Ee;
|
|
1060
1060
|
class Jt {
|
|
1061
1061
|
constructor(e, r, t) {
|
|
1062
1062
|
this.config = e, this.storage = r, this.tokenStore = t;
|
|
@@ -2066,7 +2066,7 @@ class _r {
|
|
|
2066
2066
|
"maxPriorityFeePerGas: 1 Gwei"
|
|
2067
2067
|
);
|
|
2068
2068
|
} else
|
|
2069
|
-
l.gasPrice =
|
|
2069
|
+
l.gasPrice = $t, c.log("[CROSSx] Legacy 체인 감지 — gasPrice: 2 Gwei");
|
|
2070
2070
|
}
|
|
2071
2071
|
return !n && a && (l.maxPriorityFeePerGas = Ze, c.log("[CROSSx] maxPriorityFeePerGas 비어있음 → 1 Gwei 기본값 적용")), l;
|
|
2072
2072
|
}
|
|
@@ -2516,7 +2516,7 @@ const ce = class ce extends er {
|
|
|
2516
2516
|
loadWalletAfterAuth: () => this.walletLifecycleService.loadWalletAfterAuth(),
|
|
2517
2517
|
getLocale: () => this._config.locale,
|
|
2518
2518
|
maskEmail: Te
|
|
2519
|
-
}), this.chainRegistry = h, this.jsonRpc = new Qt(h, o), this.signInUseCase = new
|
|
2519
|
+
}), this.chainRegistry = h, this.jsonRpc = new Qt(h, o), this.signInUseCase = new Me(
|
|
2520
2520
|
this.internalConfig,
|
|
2521
2521
|
t,
|
|
2522
2522
|
s,
|
|
@@ -2568,7 +2568,7 @@ const ce = class ce extends er {
|
|
|
2568
2568
|
}
|
|
2569
2569
|
async _doInitialize(e) {
|
|
2570
2570
|
var r, t;
|
|
2571
|
-
c.log("[CROSSx SDK] v2.
|
|
2571
|
+
c.log("[CROSSx SDK] v2.4.0-beta.1 초기화 중..."), this.confirmation.setMessages(Q(this._config.locale));
|
|
2572
2572
|
try {
|
|
2573
2573
|
const s = Ge();
|
|
2574
2574
|
this.internalConfig.oauthServiceUrl = s.oauthServiceUrl, this.internalConfig.legacyOauthServiceUrl = s.legacyOauthServiceUrl, this.internalConfig.authApiUrl = s.authApiUrl, this.internalConfig.walletGatewayUrl = s.walletGatewayUrl, this.adapterConfig.gatewayUrl = s.walletGatewayUrl, (t = (r = this.crypto).setJWKSEndpoint) == null || t.call(r, `${s.authApiUrl}/.well-known/jwks.json`);
|
|
@@ -2604,7 +2604,7 @@ const ce = class ce extends er {
|
|
|
2604
2604
|
throw u;
|
|
2605
2605
|
}
|
|
2606
2606
|
}
|
|
2607
|
-
return this.initialized = !0, c.info("[CROSSx SDK] v2.
|
|
2607
|
+
return this.initialized = !0, c.info("[CROSSx SDK] v2.4.0-beta.1 초기화 완료"), this.emit("initialized", { restored: !!(l != null && l.success) }), l ?? null;
|
|
2608
2608
|
} catch (s) {
|
|
2609
2609
|
throw new _(d.AUTH_NOT_INITIALIZED, "SDK 초기화에 실패했습니다", s);
|
|
2610
2610
|
}
|
|
@@ -2624,7 +2624,7 @@ const ce = class ce extends er {
|
|
|
2624
2624
|
c.log("[CROSSx] RN Bridge 감지 — Handshake 시도"), c.info("[CROSSx][RNBridge trace] Bootstrap config", {
|
|
2625
2625
|
appId: this._config.projectId,
|
|
2626
2626
|
appVersion: "1.0.0",
|
|
2627
|
-
sdkVersion: "2.
|
|
2627
|
+
sdkVersion: "2.4.0-beta.1",
|
|
2628
2628
|
keyId: "key-id-1",
|
|
2629
2629
|
userIdHash: "user-hash-placeholder",
|
|
2630
2630
|
projectId: this._config.projectId
|
|
@@ -2632,7 +2632,7 @@ const ce = class ce extends er {
|
|
|
2632
2632
|
const e = new j({
|
|
2633
2633
|
appId: this._config.projectId,
|
|
2634
2634
|
appVersion: "1.0.0",
|
|
2635
|
-
sdkVersion: "2.
|
|
2635
|
+
sdkVersion: "2.4.0-beta.1",
|
|
2636
2636
|
keyId: "key-id-1",
|
|
2637
2637
|
userIdHash: "user-hash-placeholder",
|
|
2638
2638
|
projectId: this._config.projectId
|
|
@@ -2664,13 +2664,37 @@ const ce = class ce extends er {
|
|
|
2664
2664
|
* 거부 시 bridge 비활성화 후 null 반환 → signIn() 이 OAuth fallback 진행.
|
|
2665
2665
|
*/
|
|
2666
2666
|
/**
|
|
2667
|
-
* `null` —
|
|
2667
|
+
* `null` — 사용자 명시적 거부(USER_REJECTED), 세션 만료(SESSION_EXPIRED),
|
|
2668
|
+
* 또는 재핸드셰이크 실패. OAuth fallback 진행.
|
|
2668
2669
|
* `false` — 타임아웃 등 사용자 결정 없이 실패. OAuth fallback 차단.
|
|
2669
2670
|
* `AuthResult` — bridge 로그인 성공.
|
|
2670
2671
|
*/
|
|
2671
2672
|
async _tryBridgeSignIn() {
|
|
2672
2673
|
var e;
|
|
2673
2674
|
if (!this._rnBridgeService) return null;
|
|
2675
|
+
if (!this._rnBridgeService.isActive()) {
|
|
2676
|
+
const r = this._rnBridgeService.getContext(), t = Date.now();
|
|
2677
|
+
c.info("[CROSSx] Bridge 세션 만료 감지 — 재핸드셰이크 시도", {
|
|
2678
|
+
elapsedSinceActivatedMs: r ? t - r.activatedAt : "(context 없음)",
|
|
2679
|
+
idleMs: r ? t - r.lastActivityAt : "(context 없음)",
|
|
2680
|
+
absoluteTtlMs: (r == null ? void 0 : r.absoluteTtlMs) ?? "(context 없음)",
|
|
2681
|
+
idleTtlMs: (r == null ? void 0 : r.idleTtlMs) ?? "(context 없음)",
|
|
2682
|
+
absoluteExpired: r ? t - r.activatedAt > r.absoluteTtlMs : "(context 없음)",
|
|
2683
|
+
idleExpired: r ? t - r.lastActivityAt > r.idleTtlMs : "(context 없음)"
|
|
2684
|
+
});
|
|
2685
|
+
try {
|
|
2686
|
+
const s = Date.now(), o = await this._rnBridgeService.initialize();
|
|
2687
|
+
this._rnBridgeWalletAddress = o.walletAddress, this._rnBridgeWalletName = o.walletName, this._rnBridgeWalletProvider = o.walletProvider, c.info("[CROSSx] Bridge 재핸드셰이크 성공 — bridge 로그인 계속 진행", {
|
|
2688
|
+
tookMs: Date.now() - s,
|
|
2689
|
+
walletAddress: o.walletAddress ?? "(없음)",
|
|
2690
|
+
walletName: o.walletName ?? "(없음)",
|
|
2691
|
+
absoluteTtlMs: o.absoluteTtlMs,
|
|
2692
|
+
idleTtlMs: o.idleTtlMs
|
|
2693
|
+
});
|
|
2694
|
+
} catch (s) {
|
|
2695
|
+
return c.warn("[CROSSx] Bridge 재핸드셰이크 실패 — bridge 비활성화 후 OAuth fallback", s), this._rnBridgeService = null, null;
|
|
2696
|
+
}
|
|
2697
|
+
}
|
|
2674
2698
|
try {
|
|
2675
2699
|
const r = await this._rnBridgeService.requestFirebaseIdToken();
|
|
2676
2700
|
c.log("[CROSSx] Bridge 로그인 — Firebase token 수신");
|
|
@@ -2681,7 +2705,7 @@ const ce = class ce extends er {
|
|
|
2681
2705
|
this._rnBridgeWalletName
|
|
2682
2706
|
), c.log("[CROSSx] Bridge 로그인 성공", { userId: (e = t.user) == null ? void 0 : e.id }), t) : null;
|
|
2683
2707
|
} catch (r) {
|
|
2684
|
-
return r instanceof _ && r.code === d.USER_REJECTED ? (c.log("[CROSSx] Bridge 로그인 거부 — OAuth fallback 진행 (bridge 유지)"), null) : (c.warn("[CROSSx] Bridge 로그인 타임아웃/실패", r), !1);
|
|
2708
|
+
return r instanceof _ && r.code === d.USER_REJECTED ? (c.log("[CROSSx] Bridge 로그인 거부 — OAuth fallback 진행 (bridge 유지)"), null) : r instanceof _ && r.code === d.SESSION_EXPIRED ? (c.warn("[CROSSx] Bridge 세션 만료 — OAuth fallback 진행"), null) : (c.warn("[CROSSx] Bridge 로그인 타임아웃/실패", r), !1);
|
|
2685
2709
|
}
|
|
2686
2710
|
}
|
|
2687
2711
|
/**
|
|
@@ -3552,7 +3576,7 @@ const ce = class ce extends er {
|
|
|
3552
3576
|
* @param opts.timeoutMs 최대 대기 시간 (기본 60000ms)
|
|
3553
3577
|
*/
|
|
3554
3578
|
async waitForTxAndGetReceipt(e, r, t = {}) {
|
|
3555
|
-
const s = t.intervalMs ??
|
|
3579
|
+
const s = t.intervalMs ?? Lt, o = Mt, n = t.timeoutMs ?? Je, a = Date.now() + n;
|
|
3556
3580
|
let l = s;
|
|
3557
3581
|
for (; Date.now() < a; ) {
|
|
3558
3582
|
const p = await this.getTransactionReceipt(e, r);
|
|
@@ -3586,7 +3610,7 @@ const ce = class ce extends er {
|
|
|
3586
3610
|
if (S != null && S.sendTransactionWithWaitForReceipt)
|
|
3587
3611
|
return this.bridgeSendTransactionWithWaitForReceipt(S, e, r, t);
|
|
3588
3612
|
}
|
|
3589
|
-
const { intervalMs: s, timeoutMs: o, ...n } = t, { txHash: a } = await this.sendTransaction(e, r, n), l = s ?? ((m = this._config.receiptPolling) == null ? void 0 : m.intervalMs) ??
|
|
3613
|
+
const { intervalMs: s, timeoutMs: o, ...n } = t, { txHash: a } = await this.sendTransaction(e, r, n), l = s ?? ((m = this._config.receiptPolling) == null ? void 0 : m.intervalMs) ?? Dt, p = o ?? ((y = this._config.receiptPolling) == null ? void 0 : y.timeoutMs) ?? Je, h = ke(e), u = r.from ?? "";
|
|
3590
3614
|
let x, g;
|
|
3591
3615
|
const f = this.waitForTxAndGetReceipt(a, e, { intervalMs: l, timeoutMs: p }).then((S) => {
|
|
3592
3616
|
x = S;
|
|
@@ -4111,7 +4135,7 @@ const ce = class ce extends er {
|
|
|
4111
4135
|
}
|
|
4112
4136
|
};
|
|
4113
4137
|
ce.WALLET_PREF_KEY = "wallet_preference", ce.OFFCHAIN_CHAIN_ID = "0";
|
|
4114
|
-
let
|
|
4138
|
+
let $e = ce;
|
|
4115
4139
|
class br {
|
|
4116
4140
|
constructor() {
|
|
4117
4141
|
this.prefix = "crossx_";
|
|
@@ -4455,7 +4479,7 @@ function Or(i, e) {
|
|
|
4455
4479
|
}
|
|
4456
4480
|
return 0;
|
|
4457
4481
|
}
|
|
4458
|
-
function
|
|
4482
|
+
function Dr() {
|
|
4459
4483
|
const i = Ke();
|
|
4460
4484
|
if (!i) return !1;
|
|
4461
4485
|
const e = i.__crossxRNBridge;
|
|
@@ -4476,7 +4500,7 @@ function ve() {
|
|
|
4476
4500
|
platform: Nr(i.platform) ?? Ce(),
|
|
4477
4501
|
detectedBy: "marker"
|
|
4478
4502
|
};
|
|
4479
|
-
if (
|
|
4503
|
+
if (Dr())
|
|
4480
4504
|
return {
|
|
4481
4505
|
version: lt() ?? null,
|
|
4482
4506
|
platform: Ce(),
|
|
@@ -4501,16 +4525,16 @@ function ei(i = 3e3) {
|
|
|
4501
4525
|
}, 50);
|
|
4502
4526
|
}) : Promise.resolve(null);
|
|
4503
4527
|
}
|
|
4504
|
-
const
|
|
4528
|
+
const Lr = /* @__PURE__ */ new Set([
|
|
4505
4529
|
"https://cross-wallet-oauth.crosstoken.io",
|
|
4506
4530
|
"https://stg-cross-wallet-oauth.crosstoken.io",
|
|
4507
4531
|
"https://dev-cross-wallet-oauth.crosstoken.io",
|
|
4508
4532
|
"https://one-wallet-oauth.onechain.nexus",
|
|
4509
4533
|
"https://stg-one-wallet-oauth.onechain.nexus",
|
|
4510
4534
|
"https://dev-one-wallet-oauth.onechain.nexus"
|
|
4511
|
-
]),
|
|
4535
|
+
]), Mr = "crossx://oauth-callback", $r = "2.3.2";
|
|
4512
4536
|
function Fr(i) {
|
|
4513
|
-
return i.platform !== "ios" ? !1 : i.version ? Or(i.version,
|
|
4537
|
+
return i.platform !== "ios" ? !1 : i.version ? Or(i.version, $r) <= 0 : !0;
|
|
4514
4538
|
}
|
|
4515
4539
|
class ne {
|
|
4516
4540
|
constructor() {
|
|
@@ -4595,7 +4619,7 @@ class ne {
|
|
|
4595
4619
|
}));
|
|
4596
4620
|
const x = u.includes("?") ? "&" : "?", g = encodeURIComponent(window.location.origin);
|
|
4597
4621
|
let f = `${u}${x}state=${l}&nonce=${p}&origin=${g}`;
|
|
4598
|
-
h && !f.includes("redirectUrl=") && (f += `&redirectUrl=${encodeURIComponent(
|
|
4622
|
+
h && !f.includes("redirectUrl=") && (f += `&redirectUrl=${encodeURIComponent(Mr)}`, c.info("[CROSSx] 지갑 인앱 브라우저 감지 — redirectUrl 콜백 자동 부착", {
|
|
4599
4623
|
detectedBy: h.detectedBy,
|
|
4600
4624
|
appVersion: h.version ?? "(unknown)",
|
|
4601
4625
|
platform: h.platform ?? "(unknown)"
|
|
@@ -4606,7 +4630,7 @@ class ne {
|
|
|
4606
4630
|
});
|
|
4607
4631
|
const m = window.open(
|
|
4608
4632
|
f,
|
|
4609
|
-
"CROSSx OAuth",
|
|
4633
|
+
h ? "_blank" : "CROSSx OAuth",
|
|
4610
4634
|
`width=${s},height=${o},left=${n},top=${a}`
|
|
4611
4635
|
);
|
|
4612
4636
|
if (!m) {
|
|
@@ -4627,41 +4651,45 @@ class ne {
|
|
|
4627
4651
|
A++;
|
|
4628
4652
|
try {
|
|
4629
4653
|
if (!m.closed) return;
|
|
4630
|
-
|
|
4631
|
-
|
|
4654
|
+
if (!!h) {
|
|
4655
|
+
W(), t(new _(d.USER_REJECTED, "로그인이 취소되었습니다"));
|
|
4656
|
+
return;
|
|
4657
|
+
}
|
|
4658
|
+
const G = typeof document < "u" && document.hasFocus();
|
|
4659
|
+
A <= S && !G ? R() : (W(), t(new _(d.USER_REJECTED, "로그인이 취소되었습니다")));
|
|
4632
4660
|
} catch {
|
|
4633
4661
|
R();
|
|
4634
4662
|
}
|
|
4635
4663
|
}, 1e3), W = () => {
|
|
4636
4664
|
this.abortPending = null, clearTimeout(y), clearInterval(N), T && clearTimeout(T), window.removeEventListener("message", Y);
|
|
4637
|
-
}, Y = (
|
|
4638
|
-
if (!
|
|
4665
|
+
}, Y = (L) => {
|
|
4666
|
+
if (!Lr.has(L.origin)) return;
|
|
4639
4667
|
W();
|
|
4640
|
-
const
|
|
4668
|
+
const G = typeof L.data.status == "string", I = G ? L.data.data ?? {} : L.data;
|
|
4641
4669
|
c.log("[CROSSx] OAuth postMessage 수신 —", {
|
|
4642
|
-
format:
|
|
4643
|
-
status:
|
|
4670
|
+
format: G ? "wrapped" : "flat",
|
|
4671
|
+
status: G ? L.data.status : "(flat)"
|
|
4644
4672
|
});
|
|
4645
|
-
const O = (I == null ? void 0 : I.state) ??
|
|
4673
|
+
const O = (I == null ? void 0 : I.state) ?? L.data.state;
|
|
4646
4674
|
if (!O || O !== l) {
|
|
4647
4675
|
t(new Error("OAuth state mismatch — possible CSRF attack"));
|
|
4648
4676
|
return;
|
|
4649
4677
|
}
|
|
4650
|
-
if (
|
|
4678
|
+
if (G && L.data.status !== "success") {
|
|
4651
4679
|
c.error("[CROSSx] OAuth 실패:", I == null ? void 0 : I.error), t(new Error((I == null ? void 0 : I.error) || "Authentication failed"));
|
|
4652
4680
|
return;
|
|
4653
4681
|
}
|
|
4654
|
-
if (!
|
|
4682
|
+
if (!G && (I != null && I.error)) {
|
|
4655
4683
|
c.error("[CROSSx] OAuth 실패:", I.error), t(new Error(I.error || "Authentication failed"));
|
|
4656
4684
|
return;
|
|
4657
4685
|
}
|
|
4658
|
-
const
|
|
4686
|
+
const M = I == null ? void 0 : I.idToken, X = I == null ? void 0 : I.accessToken, he = X ?? M, we = (I == null ? void 0 : I.email) || void 0;
|
|
4659
4687
|
if (c.log("[CROSSx] OAuth 토큰 수신:", {
|
|
4660
4688
|
hasAccessToken: !!X,
|
|
4661
|
-
hasIdToken:
|
|
4689
|
+
hasIdToken: !!M,
|
|
4662
4690
|
hasEmail: !!we
|
|
4663
4691
|
}), !he) {
|
|
4664
|
-
c.error("[CROSSx] 토큰을 찾을 수 없음:",
|
|
4692
|
+
c.error("[CROSSx] 토큰을 찾을 수 없음:", L.data), t(new Error("Token not found in response"));
|
|
4665
4693
|
return;
|
|
4666
4694
|
}
|
|
4667
4695
|
const _e = { token: he, email: we }, se = (ue) => {
|
|
@@ -4669,13 +4697,13 @@ class ne {
|
|
|
4669
4697
|
c.error("[CROSSx] nonce 검증 실패:", J), t(J instanceof Error ? J : new Error("nonce verification failed"));
|
|
4670
4698
|
});
|
|
4671
4699
|
};
|
|
4672
|
-
X ? X.split(".").length === 3 ? se(X) :
|
|
4700
|
+
X ? X.split(".").length === 3 ? se(X) : M ? se(M) : (c.warn(
|
|
4673
4701
|
"[CROSSx] opaque accessToken만 수신 (idToken 없음) — nonce 검증 불가.",
|
|
4674
4702
|
"서버 측 nonce 검증이 필요합니다."
|
|
4675
|
-
), r(_e)) :
|
|
4703
|
+
), r(_e)) : M ? se(M) : t(new Error("Token not found in response"));
|
|
4676
4704
|
};
|
|
4677
|
-
this.abortPending = (
|
|
4678
|
-
W(), t(new Error(
|
|
4705
|
+
this.abortPending = (L) => {
|
|
4706
|
+
W(), t(new Error(L));
|
|
4679
4707
|
}, window.addEventListener("message", Y);
|
|
4680
4708
|
});
|
|
4681
4709
|
}
|
|
@@ -4916,7 +4944,7 @@ class ae {
|
|
|
4916
4944
|
);
|
|
4917
4945
|
const y = m === d.AUTH_NOT_AUTHENTICATED ? d.SESSION_EXPIRED : m, S = y === d.SESSION_EXPIRED ? "인증 세션이 만료되었습니다. 다시 로그인해 주세요." : ae.getGatewayErrorMessage(g.code, f), E = g.data;
|
|
4918
4946
|
let A;
|
|
4919
|
-
throw m === d.PIN_LOCKED ? A = ae.extractLockDetails(E) : m === d.ADDRESS_LIMIT_EXCEEDED ? A = { limit:
|
|
4947
|
+
throw m === d.PIN_LOCKED ? A = ae.extractLockDetails(E) : m === d.ADDRESS_LIMIT_EXCEEDED ? A = { limit: Le, raw: E } : A = E ?? void 0, new _(y, S, A);
|
|
4920
4948
|
}
|
|
4921
4949
|
return c.log("[CROSSx] Wallet Gateway API 성공:", { code: g.code, url: n, method: e }), g.data ?? g;
|
|
4922
4950
|
}
|
|
@@ -5304,7 +5332,7 @@ class ae {
|
|
|
5304
5332
|
case -10033:
|
|
5305
5333
|
return "User not found. You have been signed out.";
|
|
5306
5334
|
case -10036:
|
|
5307
|
-
return `Account limit reached. Maximum ${
|
|
5335
|
+
return `Account limit reached. Maximum ${Le} accounts allowed.`;
|
|
5308
5336
|
case -10040:
|
|
5309
5337
|
return "HMAC signature header is required.";
|
|
5310
5338
|
case -10041:
|
|
@@ -8231,7 +8259,7 @@ button.__crossx-connect-other-block:active {
|
|
|
8231
8259
|
display: block;
|
|
8232
8260
|
}
|
|
8233
8261
|
`;
|
|
8234
|
-
function
|
|
8262
|
+
function K() {
|
|
8235
8263
|
let i = document.getElementById(dt);
|
|
8236
8264
|
i || (i = document.createElement("style"), i.id = dt, document.head.appendChild(i)), i.textContent = Hr;
|
|
8237
8265
|
}
|
|
@@ -8247,7 +8275,7 @@ function Gr() {
|
|
|
8247
8275
|
document.removeEventListener("focusin", e, !0), document.removeEventListener("focusout", r, !0);
|
|
8248
8276
|
};
|
|
8249
8277
|
}
|
|
8250
|
-
function
|
|
8278
|
+
function z(i) {
|
|
8251
8279
|
const e = i.querySelector(".__crossx-card");
|
|
8252
8280
|
if (e) {
|
|
8253
8281
|
const a = (e.getAttribute("style") ?? "").match(/--cx-bg:\s*([^;]+)/);
|
|
@@ -8295,7 +8323,7 @@ function Kr(i) {
|
|
|
8295
8323
|
e.removeEventListener("resize", t), e.removeEventListener("scroll", t), i.style.removeProperty("--cx-keyboard-inset");
|
|
8296
8324
|
};
|
|
8297
8325
|
}
|
|
8298
|
-
function
|
|
8326
|
+
function zr(i) {
|
|
8299
8327
|
const e = Array.from(i.querySelectorAll(".__crossx-amount-tip"));
|
|
8300
8328
|
if (!e.length) return;
|
|
8301
8329
|
const r = document.createElement("div");
|
|
@@ -8319,9 +8347,9 @@ function Vr(i) {
|
|
|
8319
8347
|
n.target.closest(".__crossx-amount-tip") || o();
|
|
8320
8348
|
}, { passive: !0 });
|
|
8321
8349
|
}
|
|
8322
|
-
const
|
|
8350
|
+
const Vr = () => /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
|
|
8323
8351
|
function oe() {
|
|
8324
|
-
if (
|
|
8352
|
+
if (Vr()) {
|
|
8325
8353
|
const e = window.scrollY;
|
|
8326
8354
|
return document.body.style.position = "fixed", document.body.style.top = `-${e}px`, document.body.style.left = "0", document.body.style.right = "0", () => {
|
|
8327
8355
|
document.body.style.position = "", document.body.style.top = "", document.body.style.left = "", document.body.style.right = "", window.scrollTo(0, e);
|
|
@@ -8373,7 +8401,7 @@ const ht = {
|
|
|
8373
8401
|
202601: "Ronin Saigon",
|
|
8374
8402
|
612044: "ONEchain Testnet",
|
|
8375
8403
|
612055: "CROSS Mainnet"
|
|
8376
|
-
},
|
|
8404
|
+
}, ze = /* @__PURE__ */ new Map();
|
|
8377
8405
|
let Pe = !1;
|
|
8378
8406
|
function qr() {
|
|
8379
8407
|
if (Pe || (Pe = !0, typeof fetch > "u")) return;
|
|
@@ -8383,7 +8411,7 @@ function qr() {
|
|
|
8383
8411
|
if (r)
|
|
8384
8412
|
for (const [t, s] of Object.entries(r)) {
|
|
8385
8413
|
const o = Number(t);
|
|
8386
|
-
!Number.isNaN(o) && s &&
|
|
8414
|
+
!Number.isNaN(o) && s && ze.set(o, s);
|
|
8387
8415
|
}
|
|
8388
8416
|
}).catch(() => {
|
|
8389
8417
|
Pe = !1;
|
|
@@ -8396,18 +8424,18 @@ function yt(i) {
|
|
|
8396
8424
|
var r;
|
|
8397
8425
|
const e = mt(i);
|
|
8398
8426
|
if (!isNaN(e)) {
|
|
8399
|
-
const t = (r =
|
|
8427
|
+
const t = (r = ze.get(e)) == null ? void 0 : r.name;
|
|
8400
8428
|
if (t) return t;
|
|
8401
8429
|
if (ht[e]) return ht[e];
|
|
8402
8430
|
}
|
|
8403
8431
|
return i;
|
|
8404
8432
|
}
|
|
8405
|
-
function
|
|
8433
|
+
function Ve(i, e) {
|
|
8406
8434
|
var r;
|
|
8407
8435
|
if (i) {
|
|
8408
8436
|
const t = mt(i);
|
|
8409
8437
|
if (!isNaN(t)) {
|
|
8410
|
-
const s = (r =
|
|
8438
|
+
const s = (r = ze.get(t)) == null ? void 0 : r.nativeSymbol;
|
|
8411
8439
|
if (s) return s;
|
|
8412
8440
|
}
|
|
8413
8441
|
}
|
|
@@ -8442,7 +8470,7 @@ function jr(i) {
|
|
|
8442
8470
|
}
|
|
8443
8471
|
}
|
|
8444
8472
|
function Yr(i, e) {
|
|
8445
|
-
const { gasLimit: r, gasPrice: t, maxFeePerGas: s, maxPriorityFeePerGas: o, nativeDecimals: n = 18 } = i, a =
|
|
8473
|
+
const { gasLimit: r, gasPrice: t, maxFeePerGas: s, maxPriorityFeePerGas: o, nativeDecimals: n = 18 } = i, a = Ve(i.chainId, i.nativeSymbol ?? "ETH");
|
|
8446
8474
|
if (!r) return null;
|
|
8447
8475
|
try {
|
|
8448
8476
|
const l = BigInt(r), p = jr(r);
|
|
@@ -8478,9 +8506,9 @@ function Yr(i, e) {
|
|
|
8478
8506
|
}
|
|
8479
8507
|
function bt(i, e, r) {
|
|
8480
8508
|
const t = Yr(i, e);
|
|
8481
|
-
if (!t) return
|
|
8482
|
-
let s =
|
|
8483
|
-
return t.isDynamic ? (t.maxPriorityFeeGwei !== void 0 && (s +=
|
|
8509
|
+
if (!t) return D((r == null ? void 0 : r.label_estimated_fee) ?? "Estimated fee", "<span>—</span>");
|
|
8510
|
+
let s = D((r == null ? void 0 : r.label_est_tx_fee) ?? "Est. Tx Fee", `<span>${t.estTxFee}</span>`);
|
|
8511
|
+
return t.isDynamic ? (t.maxPriorityFeeGwei !== void 0 && (s += D((r == null ? void 0 : r.label_max_priority_fee) ?? "Max Priority Fee", `<span>${t.maxPriorityFeeGwei} Gwei</span>`)), t.maxFeeGwei !== void 0 && (s += D((r == null ? void 0 : r.label_max_gas_fee) ?? "Max Gas Fee", `<span>${t.maxFeeGwei} Gwei</span>`))) : t.gasPriceGwei !== void 0 && (s += D((r == null ? void 0 : r.label_gas_price) ?? "Gas Price", `<span>${t.gasPriceGwei} Gwei</span>`)), t.gasLimitFormatted && (s += D((r == null ? void 0 : r.label_gas_limit) ?? "Gas Limit", `<span>${t.gasLimitFormatted}</span>`)), s;
|
|
8484
8512
|
}
|
|
8485
8513
|
const ee = `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
8486
8514
|
<rect x="9" y="9" width="13" height="13" rx="2"/>
|
|
@@ -8539,7 +8567,7 @@ function H(i) {
|
|
|
8539
8567
|
function rs(i, e) {
|
|
8540
8568
|
i.style.setProperty("--cx-bg", e.bg), i.style.setProperty("--cx-border", e.border), i.style.setProperty("--cx-border-medium", e.borderMedium), i.style.setProperty("--cx-title", e.titleColor), i.style.setProperty("--cx-subtitle", e.subtitleColor), i.style.setProperty("--cx-label", e.labelColor), i.style.setProperty("--cx-value", e.valueColor), i.style.setProperty("--cx-pill-bg", e.pillBg), i.style.setProperty("--cx-pill-from", e.pillFromColor), i.style.setProperty("--cx-pill-amt", e.pillAmtColor), i.style.setProperty("--cx-divider", e.divider), i.style.setProperty("--cx-close", e.closeColor), i.style.setProperty("--cx-close-hover", e.closeHoverBg), i.style.setProperty("--cx-copy", e.copyColor), i.style.setProperty("--cx-input-bg", e.inputBg), i.style.setProperty("--cx-input-border", e.inputBorder), i.style.setProperty("--cx-hint", e.hintColor), i.style.setProperty("--cx-surface-subtle", e.surfaceSubtle), i.style.setProperty("--cx-surface-high", e.surfaceHigh), i.style.setProperty("--cx-primary", e.primary), i.style.setProperty("--cx-primary-glow", e.primaryGlow), i.style.setProperty("--cx-primary-gradient", e.primaryGradient), i.style.setProperty("--cx-secondary", e.secondary), i.style.setProperty("--cx-error", e.errorColor), i.style.setProperty("--cx-notice-bg", e.noticeBg), i.style.setProperty("--cx-notice-border", e.noticeBorder), i.style.setProperty("--cx-notice-title", e.noticeTitleColor), i.style.setProperty("--cx-on-primary", e.onPrimary);
|
|
8541
8569
|
}
|
|
8542
|
-
function
|
|
8570
|
+
function D(i, e) {
|
|
8543
8571
|
return `
|
|
8544
8572
|
<div class="__crossx-row">
|
|
8545
8573
|
<span class="__crossx-row-label">${i}</span>
|
|
@@ -8547,8 +8575,8 @@ function L(i, e) {
|
|
|
8547
8575
|
</div>`;
|
|
8548
8576
|
}
|
|
8549
8577
|
function ss(i, e, r, t) {
|
|
8550
|
-
const s = e, o =
|
|
8551
|
-
<button class="__crossx-copy-btn" data-copy="${w(i.to)}" title="Copy address">${ee}</button>` : "<span>—</span>", p = bt(i, r, t), h = wt(i.value, o, n, r), u = h ?
|
|
8578
|
+
const s = e, o = Ve(i.chainId, i.nativeSymbol ?? "ETH"), n = i.nativeDecimals ?? 18, a = Ie(i.dappName), l = i.to ? `<span class="__crossx-addr-text">${te(i.to)}</span>
|
|
8579
|
+
<button class="__crossx-copy-btn" data-copy="${w(i.to)}" title="Copy address">${ee}</button>` : "<span>—</span>", p = bt(i, r, t), h = wt(i.value, o, n, r), u = h ? D((t == null ? void 0 : t.label_value) ?? "Value", `<span>${h}</span>`) : "", x = i.data ?? "0x", g = document.createElement("div");
|
|
8552
8580
|
return g.id = F, g.innerHTML = `
|
|
8553
8581
|
<div class="__crossx-card __crossx-card--migration __crossx-card--sign-tx" style="${H(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8554
8582
|
<div class="__crossx-header">
|
|
@@ -8571,8 +8599,8 @@ function ss(i, e, r, t) {
|
|
|
8571
8599
|
<hr class="__crossx-divider __crossx-divider--cols">
|
|
8572
8600
|
<div class="__crossx-col-right-sign">
|
|
8573
8601
|
<div class="__crossx-rows">
|
|
8574
|
-
${
|
|
8575
|
-
${
|
|
8602
|
+
${D((t == null ? void 0 : t.label_to) ?? "To", l)}
|
|
8603
|
+
${D((t == null ? void 0 : t.label_network) ?? "Network", `<span>${yt(i.chainId)}</span>`)}
|
|
8576
8604
|
${u}
|
|
8577
8605
|
${p}
|
|
8578
8606
|
</div>
|
|
@@ -8601,7 +8629,7 @@ function os(i) {
|
|
|
8601
8629
|
return i ? is.has(i.slice(0, 10).toLowerCase()) : !1;
|
|
8602
8630
|
}
|
|
8603
8631
|
function ns(i, e, r, t) {
|
|
8604
|
-
const s = e, o =
|
|
8632
|
+
const s = e, o = Ve(i.chainId, i.nativeSymbol ?? "ETH"), n = i.nativeDecimals ?? 18, a = Ie(i.dappName), l = i.to ? `<span class="__crossx-addr-text">${te(i.to)}</span>
|
|
8605
8633
|
<button class="__crossx-copy-btn" data-copy="${w(i.to)}" title="Copy address">${ee}</button>` : "<span>—</span>", p = bt(i, r, t), u = wt(i.value, o, n, r) ?? "—", x = os(i.data) ? (t == null ? void 0 : t.send_tx_approve_button) ?? "Approve" : (t == null ? void 0 : t.send_tx_confirm_button) ?? "Confirm", g = document.createElement("div");
|
|
8606
8634
|
return g.id = F, g.innerHTML = `
|
|
8607
8635
|
<div class="__crossx-card __crossx-card--migration __crossx-card--send-tx" style="${H(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
@@ -8616,8 +8644,8 @@ function ns(i, e, r, t) {
|
|
|
8616
8644
|
</p>
|
|
8617
8645
|
<div class="__crossx-body-cols">
|
|
8618
8646
|
<div class="__crossx-rows">
|
|
8619
|
-
${
|
|
8620
|
-
${
|
|
8647
|
+
${D((t == null ? void 0 : t.label_to) ?? "To", l)}
|
|
8648
|
+
${D((t == null ? void 0 : t.label_network) ?? "Network", `<span>${yt(i.chainId)}</span>`)}
|
|
8621
8649
|
${p}
|
|
8622
8650
|
</div>
|
|
8623
8651
|
<div class="__crossx-pill">
|
|
@@ -8673,12 +8701,12 @@ function At(i, e) {
|
|
|
8673
8701
|
return Et(te(e), ps(i, e));
|
|
8674
8702
|
}
|
|
8675
8703
|
function hs(i, e, r) {
|
|
8676
|
-
const t =
|
|
8704
|
+
const t = D(
|
|
8677
8705
|
(r == null ? void 0 : r.label_from) ?? "From",
|
|
8678
8706
|
`${Se(i.from)}
|
|
8679
8707
|
<button class="__crossx-copy-btn" data-copy="${w(i.from)}" title="Copy address">${ee}</button>`
|
|
8680
|
-
), s = i.to ?
|
|
8681
|
-
<button class="__crossx-copy-btn" data-copy="${w(i.to)}" title="Copy address">${ee}</button>`) : "", o = i.amount ?
|
|
8708
|
+
), s = i.to ? D((r == null ? void 0 : r.label_to) ?? "To", `${Se(i.to)}
|
|
8709
|
+
<button class="__crossx-copy-btn" data-copy="${w(i.to)}" title="Copy address">${ee}</button>`) : "", o = i.amount ? D((r == null ? void 0 : r.label_transfer) ?? "Transfer", `<span>${w(i.amount)}</span>`) : "", n = i.fees ? D((r == null ? void 0 : r.label_tx_fee) ?? "Tx Fee", `<span>${w(i.fees)}</span>`) : "", a = i.txHash ? D((r == null ? void 0 : r.label_tx_hash) ?? "Tx Hash", `${At(i.chainId, i.txHash)}
|
|
8682
8710
|
<button class="__crossx-copy-btn" data-copy="${w(i.txHash)}" title="Copy hash">${ee}</button>`) : "", l = i.total ? `<div class="__crossx-total-pill">
|
|
8683
8711
|
<span class="__crossx-total-label">${w((r == null ? void 0 : r.label_total) ?? "Total")}<br>${w((r == null ? void 0 : r.label_including_fees) ?? "(including fees)")}</span>
|
|
8684
8712
|
<span class="__crossx-total-amount">${w(i.total)}</span>
|
|
@@ -8733,9 +8761,9 @@ function us(i, e, r, t) {
|
|
|
8733
8761
|
}
|
|
8734
8762
|
const l = i.querySelector("#__crossx-progress-body");
|
|
8735
8763
|
if (!l) return;
|
|
8736
|
-
const p = e.from ?
|
|
8737
|
-
<button class="__crossx-copy-btn" data-copy="${w(e.from)}" title="Copy address">${ee}</button>`) : "", h = e.to ?
|
|
8738
|
-
<button class="__crossx-copy-btn" data-copy="${w(e.to)}" title="Copy address">${ee}</button>`) : "", u = e.amount ?
|
|
8764
|
+
const p = e.from ? D((t == null ? void 0 : t.label_from) ?? "From", `${Se(e.from)}
|
|
8765
|
+
<button class="__crossx-copy-btn" data-copy="${w(e.from)}" title="Copy address">${ee}</button>`) : "", h = e.to ? D((t == null ? void 0 : t.label_to) ?? "To", `${Se(e.to)}
|
|
8766
|
+
<button class="__crossx-copy-btn" data-copy="${w(e.to)}" title="Copy address">${ee}</button>`) : "", u = e.amount ? D((t == null ? void 0 : t.label_transfer) ?? "Transfer", `<span>${w(e.amount)}</span>`) : "", x = e.fees ? D((t == null ? void 0 : t.label_tx_fee) ?? "Tx Fee", `<span>${w(e.fees)}</span>`) : "", g = e.txHash ? D((t == null ? void 0 : t.label_tx_hash) ?? "Tx Hash", `${At(e.chainId, e.txHash)}
|
|
8739
8767
|
<button class="__crossx-copy-btn" data-copy="${w(e.txHash)}" title="Copy hash">${ee}</button>`) : "", f = e.total ? `<div class="__crossx-total-pill">
|
|
8740
8768
|
<span class="__crossx-total-label">${w((t == null ? void 0 : t.label_total) ?? "Total")}<br>${w((t == null ? void 0 : t.label_including_fees) ?? "(including fees)")}</span>
|
|
8741
8769
|
<span class="__crossx-total-amount">${w(e.total)}</span>
|
|
@@ -9121,7 +9149,7 @@ function Os(i, e, r) {
|
|
|
9121
9149
|
return () => clearInterval(u);
|
|
9122
9150
|
} };
|
|
9123
9151
|
}
|
|
9124
|
-
function
|
|
9152
|
+
function Ds(i) {
|
|
9125
9153
|
const r = [i.check1, i.check2].map((t, s) => `
|
|
9126
9154
|
<div class="__crossx-pw-notice-item" data-check-index="${s}" role="checkbox" aria-checked="false" tabindex="0">
|
|
9127
9155
|
<div class="__crossx-pw-notice-check" id="__crossx-notice-check-${s}">${Fs}</div>
|
|
@@ -9190,7 +9218,7 @@ function Oe(i) {
|
|
|
9190
9218
|
<div class="__crossx-pin6-numpad-row">
|
|
9191
9219
|
<button type="button" class="__crossx-pin6-numpad-key --empty" aria-hidden="true"></button>
|
|
9192
9220
|
<button type="button" class="__crossx-pin6-numpad-key${g}" data-key="0">0</button>
|
|
9193
|
-
<button type="button" class="__crossx-pin6-numpad-key --delete${g}" data-key="backspace" aria-label="Delete">${
|
|
9221
|
+
<button type="button" class="__crossx-pin6-numpad-key --delete${g}" data-key="backspace" aria-label="Delete">${$s}</button>
|
|
9194
9222
|
</div>
|
|
9195
9223
|
</div>`;
|
|
9196
9224
|
return `
|
|
@@ -9225,18 +9253,18 @@ function _t(i, e) {
|
|
|
9225
9253
|
</div>
|
|
9226
9254
|
`, r;
|
|
9227
9255
|
}
|
|
9228
|
-
function
|
|
9256
|
+
function Ls(i, e) {
|
|
9229
9257
|
if (i.length !== 6) return e.tooShort;
|
|
9230
9258
|
if (!/^\d+$/.test(i)) return e.numbersOnly;
|
|
9231
9259
|
if (/(.)\1{2}/.test(i)) return e.repeatingDigit;
|
|
9232
9260
|
const r = i.split("").map(Number), t = r.every((o, n) => n === 0 || o === (r[n - 1] + 1) % 10), s = r.every((o, n) => n === 0 || o === (r[n - 1] + 9) % 10);
|
|
9233
9261
|
return t || s ? e.sequential : i[0] !== i[1] && i === i.slice(0, 2).repeat(3) ? e.alternatingPattern : null;
|
|
9234
9262
|
}
|
|
9235
|
-
function
|
|
9263
|
+
function Ms(i) {
|
|
9236
9264
|
const e = Math.max(0, Math.ceil(i / 1e3)), r = Math.floor(e / 3600), t = Math.floor(e % 3600 / 60), s = e % 60;
|
|
9237
9265
|
return r > 0 ? `${r}h ${String(t).padStart(2, "0")}m` : `${String(t).padStart(2, "0")}:${String(s).padStart(2, "0")}`;
|
|
9238
9266
|
}
|
|
9239
|
-
function
|
|
9267
|
+
function De(i, e, r, t, s, o, n) {
|
|
9240
9268
|
var je, Ye;
|
|
9241
9269
|
let a = !!(o && o > Date.now()), l = !1;
|
|
9242
9270
|
const p = () => Array.from(i.querySelectorAll(".__crossx-pin6-box")), h = () => i.querySelector("#__crossx-pin6-boxes"), u = () => i.querySelector("#__crossx-pin6-error"), x = () => i.querySelector("#__crossx-pin6-lock-msg"), g = () => i.querySelector("#__crossx-pin6-lock-countdown"), f = () => i.querySelector(".__crossx-pin6-body"), m = "●", y = (b, v) => {
|
|
@@ -9247,10 +9275,10 @@ function Le(i, e, r, t, s, o, n) {
|
|
|
9247
9275
|
var k;
|
|
9248
9276
|
const b = p(), v = T();
|
|
9249
9277
|
if (v.length && (v.forEach((C, P) => {
|
|
9250
|
-
const
|
|
9251
|
-
C.classList.toggle("--filled",
|
|
9278
|
+
const $ = !!(b[P] && E(b[P]));
|
|
9279
|
+
C.classList.toggle("--filled", $), C.classList.toggle("--active", !1);
|
|
9252
9280
|
}), !a && !l)) {
|
|
9253
|
-
const C = b.findIndex((
|
|
9281
|
+
const C = b.findIndex(($) => !E($));
|
|
9254
9282
|
(k = v[C === -1 ? 5 : C]) == null || k.classList.add("--active");
|
|
9255
9283
|
}
|
|
9256
9284
|
}, N = () => {
|
|
@@ -9259,10 +9287,10 @@ function Le(i, e, r, t, s, o, n) {
|
|
|
9259
9287
|
a = b, p().forEach((v) => {
|
|
9260
9288
|
v.disabled = b, v.classList.toggle("--locked", b);
|
|
9261
9289
|
});
|
|
9262
|
-
}, Y = () => i.querySelector("#__crossx-pin6-attempt"),
|
|
9290
|
+
}, Y = () => i.querySelector("#__crossx-pin6-attempt"), L = () => {
|
|
9263
9291
|
const b = u();
|
|
9264
9292
|
b && (b.textContent = "");
|
|
9265
|
-
},
|
|
9293
|
+
}, G = () => n ?? "Your account will be locked after further failures.", I = () => i.querySelector("#__crossx-pin6-warning"), O = (b) => {
|
|
9266
9294
|
var k;
|
|
9267
9295
|
let v = I();
|
|
9268
9296
|
if (!v) {
|
|
@@ -9271,7 +9299,7 @@ function Le(i, e, r, t, s, o, n) {
|
|
|
9271
9299
|
C ? C.insertAdjacentElement("afterend", v) : (k = f()) == null || k.appendChild(v);
|
|
9272
9300
|
}
|
|
9273
9301
|
v.textContent = b;
|
|
9274
|
-
},
|
|
9302
|
+
}, M = () => {
|
|
9275
9303
|
const b = I();
|
|
9276
9304
|
b && (b.textContent = "");
|
|
9277
9305
|
}, X = (b, v) => {
|
|
@@ -9295,22 +9323,22 @@ function Le(i, e, r, t, s, o, n) {
|
|
|
9295
9323
|
(C = p()[0]) == null || C.focus(), R();
|
|
9296
9324
|
}, 50);
|
|
9297
9325
|
}, _e = (b) => {
|
|
9298
|
-
var
|
|
9326
|
+
var $;
|
|
9299
9327
|
W(!0), p().forEach(S), N();
|
|
9300
9328
|
const v = u();
|
|
9301
9329
|
if (v && (v.textContent = "Too many failed attempts. Please wait."), !x()) {
|
|
9302
9330
|
const B = document.createElement("p");
|
|
9303
9331
|
B.className = "__crossx-pin6-lock-msg", B.id = "__crossx-pin6-lock-msg", B.innerHTML = `${Tt}<span id="__crossx-pin6-lock-countdown"></span>`;
|
|
9304
|
-
const
|
|
9305
|
-
|
|
9332
|
+
const V = u();
|
|
9333
|
+
V ? V.insertAdjacentElement("afterend", B) : ($ = f()) == null || $.appendChild(B);
|
|
9306
9334
|
}
|
|
9307
9335
|
const k = () => {
|
|
9308
9336
|
var re;
|
|
9309
|
-
const B = b - Date.now(),
|
|
9337
|
+
const B = b - Date.now(), V = g();
|
|
9310
9338
|
B <= 0 ? (clearInterval(C), W(!1), (re = x()) == null || re.remove(), v && (v.textContent = ""), N(), setTimeout(() => {
|
|
9311
9339
|
var me;
|
|
9312
9340
|
return (me = p()[0]) == null ? void 0 : me.focus();
|
|
9313
|
-
}, 50)) :
|
|
9341
|
+
}, 50)) : V && (V.textContent = ` ${Ms(B)}`);
|
|
9314
9342
|
}, C = setInterval(k, 1e3);
|
|
9315
9343
|
k();
|
|
9316
9344
|
const P = new MutationObserver(() => {
|
|
@@ -9327,7 +9355,7 @@ function Le(i, e, r, t, s, o, n) {
|
|
|
9327
9355
|
try {
|
|
9328
9356
|
if (s) {
|
|
9329
9357
|
const v = await s(b);
|
|
9330
|
-
v.ok ? e(b) : v.lockExpiresAt ? (he(), _e(v.lockExpiresAt)) : (we(v.error ?? "Incorrect PIN. Please try again."), v.attemptCount != null && v.maxAttempts != null ? (O(
|
|
9358
|
+
v.ok ? e(b) : v.lockExpiresAt ? (he(), _e(v.lockExpiresAt)) : (we(v.error ?? "Incorrect PIN. Please try again."), v.attemptCount != null && v.maxAttempts != null ? (O(G()), X(v.attemptCount, v.maxAttempts)) : (M(), he()));
|
|
9331
9359
|
} else
|
|
9332
9360
|
e(b);
|
|
9333
9361
|
} catch (v) {
|
|
@@ -9357,27 +9385,27 @@ function Le(i, e, r, t, s, o, n) {
|
|
|
9357
9385
|
b.addEventListener("input", () => {
|
|
9358
9386
|
var C;
|
|
9359
9387
|
const k = b.value.replace(/\D/g, "").slice(-1);
|
|
9360
|
-
k ? y(b, k) : S(b),
|
|
9388
|
+
k ? y(b, k) : S(b), L(), k && v < 5 && ((C = p()[v + 1]) == null || C.focus()), R(), A().length === 6 && setTimeout(se, 80);
|
|
9361
9389
|
}), b.addEventListener("keydown", (k) => {
|
|
9362
9390
|
var C, P;
|
|
9363
9391
|
if (k.key === "Backspace") {
|
|
9364
9392
|
if (k.preventDefault(), E(b))
|
|
9365
9393
|
S(b);
|
|
9366
9394
|
else if (v > 0) {
|
|
9367
|
-
const
|
|
9368
|
-
S(
|
|
9395
|
+
const $ = p()[v - 1];
|
|
9396
|
+
S($), $.focus();
|
|
9369
9397
|
}
|
|
9370
9398
|
R();
|
|
9371
9399
|
} else k.key === "ArrowLeft" && v > 0 ? (k.preventDefault(), (C = p()[v - 1]) == null || C.focus()) : k.key === "ArrowRight" && v < 5 ? (k.preventDefault(), (P = p()[v + 1]) == null || P.focus()) : k.key === "Escape" && r();
|
|
9372
9400
|
}), b.addEventListener("paste", (k) => {
|
|
9373
|
-
var
|
|
9401
|
+
var $, B;
|
|
9374
9402
|
k.preventDefault();
|
|
9375
|
-
const C = (((
|
|
9403
|
+
const C = ((($ = k.clipboardData) == null ? void 0 : $.getData("text")) ?? "").replace(/\D/g, "").slice(0, 6);
|
|
9376
9404
|
if (!C) return;
|
|
9377
9405
|
const P = p();
|
|
9378
|
-
C.split("").forEach((
|
|
9379
|
-
P[re] && y(P[re],
|
|
9380
|
-
}), (B = P[Math.min(C.length - 1, 5)]) == null || B.focus(),
|
|
9406
|
+
C.split("").forEach((V, re) => {
|
|
9407
|
+
P[re] && y(P[re], V);
|
|
9408
|
+
}), (B = P[Math.min(C.length - 1, 5)]) == null || B.focus(), L(), R(), A().length === 6 && setTimeout(se, 80);
|
|
9381
9409
|
}), b.addEventListener("focus", () => b.select());
|
|
9382
9410
|
});
|
|
9383
9411
|
const J = i.querySelector("#__crossx-pin6-numpad");
|
|
@@ -9395,23 +9423,23 @@ function Le(i, e, r, t, s, o, n) {
|
|
|
9395
9423
|
if (!P) return;
|
|
9396
9424
|
if (P === "backspace") {
|
|
9397
9425
|
const re = [...p()].reverse().find((me) => E(me));
|
|
9398
|
-
re && (S(re),
|
|
9426
|
+
re && (S(re), L()), R();
|
|
9399
9427
|
return;
|
|
9400
9428
|
}
|
|
9401
9429
|
if (!/^\d$/.test(P)) return;
|
|
9402
|
-
const B = p().find((
|
|
9403
|
-
B && (y(B, P),
|
|
9430
|
+
const B = p().find((V) => !E(V));
|
|
9431
|
+
B && (y(B, P), L(), R(), A().length === 6 && setTimeout(se, 80));
|
|
9404
9432
|
};
|
|
9405
9433
|
J.addEventListener("pointerup", (C) => {
|
|
9406
9434
|
if (!b) return;
|
|
9407
9435
|
const P = b;
|
|
9408
9436
|
v();
|
|
9409
|
-
const
|
|
9410
|
-
C.clientX >=
|
|
9437
|
+
const $ = P.getBoundingClientRect();
|
|
9438
|
+
C.clientX >= $.left && C.clientX <= $.right && C.clientY >= $.top && C.clientY <= $.bottom && !a && !l && k(P);
|
|
9411
9439
|
}), J.addEventListener("pointercancel", v), J.addEventListener("pointerleave", v, !0), R(), o && o > Date.now() && N();
|
|
9412
9440
|
}
|
|
9413
9441
|
}
|
|
9414
|
-
const
|
|
9442
|
+
const $s = `<svg width="22" height="17" viewBox="0 0 22 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
9415
9443
|
<path d="M7.36 0.5H19.5C20.6046 0.5 21.5 1.39543 21.5 2.5V14.5C21.5 15.6046 20.6046 16.5 19.5 16.5H7.36C6.76 16.5 6.19 16.24 5.8 15.79L0.94 10.02C0.35 9.32 0.35 8.3 0.94 7.6L5.8 1.71C6.19 1.26 6.76 0.5 7.36 0.5Z" stroke="currentColor" stroke-width="1.2" fill="none"/>
|
|
9416
9444
|
<line x1="10" y1="5.5" x2="16" y2="11.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
|
9417
9445
|
<line x1="16" y1="5.5" x2="10" y2="11.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
|
@@ -9499,9 +9527,9 @@ class Ws {
|
|
|
9499
9527
|
showWalletSelector(e, r, t) {
|
|
9500
9528
|
return new Promise((s, o) => {
|
|
9501
9529
|
var E;
|
|
9502
|
-
|
|
9530
|
+
K();
|
|
9503
9531
|
const n = [...e], a = vs(n, this.tokens, t, this.messages), l = oe();
|
|
9504
|
-
|
|
9532
|
+
z(a);
|
|
9505
9533
|
let p = !1;
|
|
9506
9534
|
const h = () => {
|
|
9507
9535
|
p || (p = !0, a.remove(), l());
|
|
@@ -9552,9 +9580,9 @@ class Ws {
|
|
|
9552
9580
|
showWalletCreatedPrompt() {
|
|
9553
9581
|
return new Promise((e) => {
|
|
9554
9582
|
var a, l;
|
|
9555
|
-
|
|
9583
|
+
K();
|
|
9556
9584
|
const r = Ss(this.tokens, this.messages), t = oe();
|
|
9557
|
-
|
|
9585
|
+
z(r);
|
|
9558
9586
|
let s = !1, o = null;
|
|
9559
9587
|
const n = () => {
|
|
9560
9588
|
s || (s = !0, o && document.removeEventListener("keydown", o), r.remove(), t(), e());
|
|
@@ -9576,7 +9604,7 @@ class Ws {
|
|
|
9576
9604
|
resolveAddWalletErrorMessage(e) {
|
|
9577
9605
|
const r = this.messages;
|
|
9578
9606
|
if (e instanceof _ && e.code === d.ADDRESS_LIMIT_EXCEEDED) {
|
|
9579
|
-
const s = e.details, o = typeof (s == null ? void 0 : s.limit) == "number" ? s.limit :
|
|
9607
|
+
const s = e.details, o = typeof (s == null ? void 0 : s.limit) == "number" ? s.limit : Le;
|
|
9580
9608
|
return ((r == null ? void 0 : r.wallet_selector_add_error_limit_exceeded) ?? "Account limit reached. Maximum {limit} accounts allowed.").replace("{limit}", String(o));
|
|
9581
9609
|
}
|
|
9582
9610
|
return (r == null ? void 0 : r.wallet_selector_add_error_generic) ?? "Failed to add a new account. Please try again.";
|
|
@@ -9593,9 +9621,9 @@ class Ws {
|
|
|
9593
9621
|
)) ?? [];
|
|
9594
9622
|
return new Promise((s) => {
|
|
9595
9623
|
var x, g, f, m;
|
|
9596
|
-
|
|
9624
|
+
K();
|
|
9597
9625
|
const o = Ts(this.tokens, r, this.messages), n = oe();
|
|
9598
|
-
|
|
9626
|
+
z(o);
|
|
9599
9627
|
const a = () => {
|
|
9600
9628
|
o.remove(), n();
|
|
9601
9629
|
}, l = (y) => {
|
|
@@ -9622,7 +9650,7 @@ class Ws {
|
|
|
9622
9650
|
showSessionAlert(e) {
|
|
9623
9651
|
return new Promise((r) => {
|
|
9624
9652
|
var h, u, x;
|
|
9625
|
-
|
|
9653
|
+
K();
|
|
9626
9654
|
const t = this.messages, s = Rs(this.tokens, {
|
|
9627
9655
|
title: e.title,
|
|
9628
9656
|
message: e.message,
|
|
@@ -9631,7 +9659,7 @@ class Ws {
|
|
|
9631
9659
|
signOutLabel: (t == null ? void 0 : t.session_alert_sign_out_button) ?? "Sign out",
|
|
9632
9660
|
signInAgainLabel: (t == null ? void 0 : t.session_alert_sign_in_again_button) ?? "Sign in again"
|
|
9633
9661
|
}), o = oe();
|
|
9634
|
-
|
|
9662
|
+
z(s);
|
|
9635
9663
|
let n = !1;
|
|
9636
9664
|
const a = () => {
|
|
9637
9665
|
n || (n = !0, s.remove(), o());
|
|
@@ -9652,9 +9680,9 @@ class Ws {
|
|
|
9652
9680
|
const r = (e == null ? void 0 : e.allowSkip) ?? !0;
|
|
9653
9681
|
return new Promise((t) => {
|
|
9654
9682
|
var a, l, p;
|
|
9655
|
-
|
|
9683
|
+
K();
|
|
9656
9684
|
const s = Cs(this.tokens, r);
|
|
9657
|
-
|
|
9685
|
+
z(s);
|
|
9658
9686
|
const o = () => s.remove(), n = () => {
|
|
9659
9687
|
o(), t("recover");
|
|
9660
9688
|
};
|
|
@@ -9681,7 +9709,7 @@ class Ws {
|
|
|
9681
9709
|
*/
|
|
9682
9710
|
showPinSetupPrompt(e) {
|
|
9683
9711
|
return new Promise((r) => {
|
|
9684
|
-
|
|
9712
|
+
K();
|
|
9685
9713
|
const t = this.messages, s = {
|
|
9686
9714
|
title: (t == null ? void 0 : t.pin_setup_title) ?? "Create PIN",
|
|
9687
9715
|
headerSubtitle: (t == null ? void 0 : t.pin_notice_header_subtitle) ?? "Required for transactions, PK/mnemonic export & account deletion.",
|
|
@@ -9700,8 +9728,8 @@ class Ws {
|
|
|
9700
9728
|
title: (t == null ? void 0 : t.pin_setup_confirm_title) ?? "Confirm PIN",
|
|
9701
9729
|
headerSubtitle: (t == null ? void 0 : t.pin_setup_header_subtitle) ?? "This PIN is used to authorize your transactions.",
|
|
9702
9730
|
subtitle: (t == null ? void 0 : t.pin_setup_confirm_subtitle) ?? "Confirm your 6-digit PIN"
|
|
9703
|
-
}, a = _t(this.tokens,
|
|
9704
|
-
|
|
9731
|
+
}, a = _t(this.tokens, Ds(s)), l = oe();
|
|
9732
|
+
z(a);
|
|
9705
9733
|
let p = !1;
|
|
9706
9734
|
const h = () => {
|
|
9707
9735
|
p || (p = !0, a.remove(), l());
|
|
@@ -9721,7 +9749,7 @@ class Ws {
|
|
|
9721
9749
|
title: n.title,
|
|
9722
9750
|
headerSubtitle: n.headerSubtitle,
|
|
9723
9751
|
subtitle: n.subtitle
|
|
9724
|
-
}), this.applyPinKeyboardMode(g), (A = g.querySelector("#__crossx-close-btn")) == null || A.addEventListener("click", x),
|
|
9752
|
+
}), this.applyPinKeyboardMode(g), (A = g.querySelector("#__crossx-close-btn")) == null || A.addEventListener("click", x), De(g, (T) => {
|
|
9725
9753
|
T === E ? u(E) : y(o.mismatchError);
|
|
9726
9754
|
}, x);
|
|
9727
9755
|
}, y = (E) => {
|
|
@@ -9731,13 +9759,13 @@ class Ws {
|
|
|
9731
9759
|
headerSubtitle: o.headerSubtitle,
|
|
9732
9760
|
subtitle: o.subtitle,
|
|
9733
9761
|
errorMessage: E
|
|
9734
|
-
}), this.applyPinKeyboardMode(g), (A = g.querySelector("#__crossx-close-btn")) == null || A.addEventListener("click", x),
|
|
9735
|
-
const R =
|
|
9762
|
+
}), this.applyPinKeyboardMode(g), (A = g.querySelector("#__crossx-close-btn")) == null || A.addEventListener("click", x), De(g, (T) => {
|
|
9763
|
+
const R = Ls(T, f);
|
|
9736
9764
|
R ? y(R) : m(T);
|
|
9737
9765
|
}, x);
|
|
9738
9766
|
};
|
|
9739
9767
|
(() => {
|
|
9740
|
-
var
|
|
9768
|
+
var G;
|
|
9741
9769
|
const E = Array.from(g.querySelectorAll(".__crossx-pw-notice-item")), A = g.querySelector("#__crossx-pin-notice-next"), T = /* @__PURE__ */ new Set();
|
|
9742
9770
|
A.removeAttribute("disabled");
|
|
9743
9771
|
const R = A.dataset.nextLabel ?? "Next", N = A.dataset.submitLabel ?? "I Understand", W = () => {
|
|
@@ -9745,27 +9773,27 @@ class Ws {
|
|
|
9745
9773
|
A.classList.toggle("--disabled", !I), A.textContent = N || R;
|
|
9746
9774
|
}, Y = (I, O) => {
|
|
9747
9775
|
if (T.has(O)) return;
|
|
9748
|
-
const
|
|
9749
|
-
T.add(O),
|
|
9750
|
-
},
|
|
9776
|
+
const M = I.querySelector(`#__crossx-notice-check-${O}`);
|
|
9777
|
+
T.add(O), M.classList.add("--checked"), I.setAttribute("aria-checked", "true"), W();
|
|
9778
|
+
}, L = (I, O) => {
|
|
9751
9779
|
if (!T.has(O)) return;
|
|
9752
|
-
const
|
|
9753
|
-
T.delete(O),
|
|
9780
|
+
const M = I.querySelector(`#__crossx-notice-check-${O}`);
|
|
9781
|
+
T.delete(O), M.classList.remove("--checked"), I.setAttribute("aria-checked", "false"), W();
|
|
9754
9782
|
};
|
|
9755
9783
|
E.forEach((I) => {
|
|
9756
9784
|
const O = parseInt(I.dataset.checkIndex ?? "0", 10);
|
|
9757
9785
|
I.addEventListener("click", () => {
|
|
9758
|
-
T.has(O) ?
|
|
9759
|
-
}), I.addEventListener("keydown", (
|
|
9760
|
-
(
|
|
9786
|
+
T.has(O) ? L(I, O) : Y(I, O);
|
|
9787
|
+
}), I.addEventListener("keydown", (M) => {
|
|
9788
|
+
(M.key === " " || M.key === "Enter") && (M.preventDefault(), T.has(O) ? L(I, O) : Y(I, O));
|
|
9761
9789
|
});
|
|
9762
9790
|
}), A.addEventListener("click", () => {
|
|
9763
9791
|
if (T.size === E.length) {
|
|
9764
9792
|
y(e == null ? void 0 : e.errorMessage);
|
|
9765
9793
|
return;
|
|
9766
9794
|
}
|
|
9767
|
-
const I = E.find((
|
|
9768
|
-
const X = parseInt(
|
|
9795
|
+
const I = E.find((M) => {
|
|
9796
|
+
const X = parseInt(M.dataset.checkIndex ?? "0", 10);
|
|
9769
9797
|
return !T.has(X);
|
|
9770
9798
|
});
|
|
9771
9799
|
if (!I) return;
|
|
@@ -9773,7 +9801,7 @@ class Ws {
|
|
|
9773
9801
|
I.scrollIntoView({ behavior: "smooth", block: "nearest" }), I.classList.add("--highlight"), setTimeout(() => {
|
|
9774
9802
|
I.classList.remove("--highlight"), Y(I, O);
|
|
9775
9803
|
}, 400);
|
|
9776
|
-
}), (
|
|
9804
|
+
}), (G = g.querySelector("#__crossx-close-btn")) == null || G.addEventListener("click", x);
|
|
9777
9805
|
})(), a.addEventListener("click", (E) => {
|
|
9778
9806
|
E.target === a && x();
|
|
9779
9807
|
});
|
|
@@ -9787,7 +9815,7 @@ class Ws {
|
|
|
9787
9815
|
showPinInputPrompt(e) {
|
|
9788
9816
|
return new Promise((r, t) => {
|
|
9789
9817
|
var S;
|
|
9790
|
-
|
|
9818
|
+
K();
|
|
9791
9819
|
const s = this.messages, o = (e == null ? void 0 : e.verifyMode) === !0, n = o ? (s == null ? void 0 : s.verify_pin_title) ?? "Verify Your PIN" : (s == null ? void 0 : s.pin_input_title) ?? "Enter PIN", a = o ? (s == null ? void 0 : s.verify_pin_subtitle) ?? "Enter your PIN to authorize this transaction." : (s == null ? void 0 : s.pin_input_subtitle) ?? "Enter your 6-digit PIN to continue.", l = (s == null ? void 0 : s.pin_locked_failure_warning) ?? "Your account will be locked after further failures.", p = _t(
|
|
9792
9820
|
this.tokens,
|
|
9793
9821
|
Oe({
|
|
@@ -9800,7 +9828,7 @@ class Ws {
|
|
|
9800
9828
|
maxAttempts: e == null ? void 0 : e.maxAttempts
|
|
9801
9829
|
})
|
|
9802
9830
|
), h = oe();
|
|
9803
|
-
|
|
9831
|
+
z(p);
|
|
9804
9832
|
let u = !1;
|
|
9805
9833
|
const x = () => {
|
|
9806
9834
|
u || (u = !0, p.remove(), h());
|
|
@@ -9811,7 +9839,7 @@ class Ws {
|
|
|
9811
9839
|
}, m = (E) => {
|
|
9812
9840
|
x(), t(E);
|
|
9813
9841
|
}, y = p.querySelector(".__crossx-card");
|
|
9814
|
-
this.applyPinKeyboardMode(y), (S = y.querySelector("#__crossx-close-btn")) == null || S.addEventListener("click", f),
|
|
9842
|
+
this.applyPinKeyboardMode(y), (S = y.querySelector("#__crossx-close-btn")) == null || S.addEventListener("click", f), De(y, g, f, m, e == null ? void 0 : e.onSubmit, e == null ? void 0 : e.lockExpiresAt, l), p.addEventListener("click", (E) => {
|
|
9815
9843
|
E.target === p && f();
|
|
9816
9844
|
});
|
|
9817
9845
|
});
|
|
@@ -9826,9 +9854,9 @@ class Ws {
|
|
|
9826
9854
|
showRecoveryPinInputPrompt(e) {
|
|
9827
9855
|
return new Promise((r) => {
|
|
9828
9856
|
var l;
|
|
9829
|
-
|
|
9857
|
+
K();
|
|
9830
9858
|
const t = Ps(this.tokens, e);
|
|
9831
|
-
|
|
9859
|
+
z(t);
|
|
9832
9860
|
const s = () => t.remove(), o = (p) => {
|
|
9833
9861
|
s(), r(p);
|
|
9834
9862
|
}, n = () => {
|
|
@@ -9848,9 +9876,9 @@ class Ws {
|
|
|
9848
9876
|
showRecoveryPinLockedPrompt(e, r) {
|
|
9849
9877
|
return new Promise((t) => {
|
|
9850
9878
|
var p;
|
|
9851
|
-
|
|
9879
|
+
K();
|
|
9852
9880
|
const { overlay: s, startCountdown: o } = Os(this.tokens, e, r);
|
|
9853
|
-
|
|
9881
|
+
z(s);
|
|
9854
9882
|
const n = () => {
|
|
9855
9883
|
l(), s.remove();
|
|
9856
9884
|
}, a = () => {
|
|
@@ -9868,9 +9896,9 @@ class Ws {
|
|
|
9868
9896
|
showTransactionComplete(e) {
|
|
9869
9897
|
return new Promise((r) => {
|
|
9870
9898
|
var a, l;
|
|
9871
|
-
|
|
9899
|
+
K();
|
|
9872
9900
|
const t = hs(e, this.tokens, this.messages);
|
|
9873
|
-
|
|
9901
|
+
z(t);
|
|
9874
9902
|
const s = () => t.remove(), o = () => {
|
|
9875
9903
|
s(), r();
|
|
9876
9904
|
};
|
|
@@ -9897,9 +9925,9 @@ class Ws {
|
|
|
9897
9925
|
*/
|
|
9898
9926
|
showTransactionProgress(e, r) {
|
|
9899
9927
|
return new Promise((t) => {
|
|
9900
|
-
|
|
9928
|
+
K();
|
|
9901
9929
|
const s = _s(e, this.tokens, this.messages);
|
|
9902
|
-
|
|
9930
|
+
z(s);
|
|
9903
9931
|
const o = () => s.remove();
|
|
9904
9932
|
let n = !1;
|
|
9905
9933
|
const a = () => {
|
|
@@ -9922,11 +9950,11 @@ class Ws {
|
|
|
9922
9950
|
requestConfirmation(e) {
|
|
9923
9951
|
return new Promise((r) => {
|
|
9924
9952
|
var p, h, u;
|
|
9925
|
-
|
|
9953
|
+
K();
|
|
9926
9954
|
let t;
|
|
9927
9955
|
e.type === "sign-message" ? t = xs(e, this.tokens, this.messages) : e.type === "sign-typed-data" ? t = gs(e, this.tokens, this.messages) : e.type === "sign" ? t = ss(e, this.tokens, this.displayDecimals, this.messages) : t = ns(e, this.tokens, this.displayDecimals, this.messages);
|
|
9928
9956
|
const s = oe();
|
|
9929
|
-
|
|
9957
|
+
z(t);
|
|
9930
9958
|
const o = () => {
|
|
9931
9959
|
t.remove(), s();
|
|
9932
9960
|
}, n = () => {
|
|
@@ -9942,7 +9970,7 @@ class Ws {
|
|
|
9942
9970
|
f && ((m = navigator.clipboard) == null || m.writeText(f).catch(() => {
|
|
9943
9971
|
}));
|
|
9944
9972
|
});
|
|
9945
|
-
}),
|
|
9973
|
+
}), zr(t), t.addEventListener("click", (x) => {
|
|
9946
9974
|
x.target === t && a();
|
|
9947
9975
|
});
|
|
9948
9976
|
const l = (x) => {
|
|
@@ -10217,7 +10245,7 @@ Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
|
|
|
10217
10245
|
},
|
|
10218
10246
|
() => typeof window < "u" ? window.location.origin : "http://localhost",
|
|
10219
10247
|
f
|
|
10220
|
-
), A = e != null && e.wrapConfirmation ? e.wrapConfirmation(E) : E, T = new
|
|
10248
|
+
), A = e != null && e.wrapConfirmation ? e.wrapConfirmation(E) : E, T = new $e(
|
|
10221
10249
|
t,
|
|
10222
10250
|
s,
|
|
10223
10251
|
n,
|
|
@@ -10235,7 +10263,7 @@ Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
|
|
|
10235
10263
|
return R && typeof R.setFreshTokenCallback == "function" && R.setFreshTokenCallback(() => T.requestFreshFirebaseIdTokenFromBridge()), typeof window < "u" && (window.__crossxSDK = T), T;
|
|
10236
10264
|
}
|
|
10237
10265
|
function ri(i) {
|
|
10238
|
-
const e = Ks(i), r =
|
|
10266
|
+
const e = Ks(i), r = zs(e), t = JSON.parse(r);
|
|
10239
10267
|
qs(t);
|
|
10240
10268
|
const { data: s } = t;
|
|
10241
10269
|
return {
|
|
@@ -10260,15 +10288,15 @@ function Ks(i) {
|
|
|
10260
10288
|
}
|
|
10261
10289
|
return i;
|
|
10262
10290
|
}
|
|
10263
|
-
function
|
|
10291
|
+
function zs(i) {
|
|
10264
10292
|
if (i.startsWith("{"))
|
|
10265
10293
|
return i;
|
|
10266
10294
|
if (i.startsWith("%7B") || i.startsWith("%7b"))
|
|
10267
10295
|
return decodeURIComponent(i);
|
|
10268
|
-
const e =
|
|
10296
|
+
const e = Vs(i);
|
|
10269
10297
|
return decodeURIComponent(e);
|
|
10270
10298
|
}
|
|
10271
|
-
function
|
|
10299
|
+
function Vs(i) {
|
|
10272
10300
|
if (typeof atob == "function")
|
|
10273
10301
|
return atob(i);
|
|
10274
10302
|
if (typeof Buffer < "u")
|
|
@@ -10295,11 +10323,11 @@ export {
|
|
|
10295
10323
|
Ht as CONNECT_OTHER_WALLET_DISPLAY_ORDER,
|
|
10296
10324
|
_ as CROSSxError,
|
|
10297
10325
|
qt as CROSSxEthereumProvider,
|
|
10298
|
-
|
|
10326
|
+
$e as CROSSxSDK,
|
|
10299
10327
|
Zs as ChainId,
|
|
10300
10328
|
ge as ConnectOtherWalletItem,
|
|
10301
10329
|
d as ErrorCode,
|
|
10302
|
-
|
|
10330
|
+
Le as MNEMONIC_ADDRESS_LIMIT,
|
|
10303
10331
|
xt as PinMemoryStore,
|
|
10304
10332
|
Gs as TokenMemoryStore,
|
|
10305
10333
|
He as WALLET_BRAND_NAME,
|