@nexus-cross/crossx-sdk-core 1.3.8 → 1.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/i18n/messages.en.d.ts.map +1 -1
- package/dist/core/i18n/messages.ko.d.ts.map +1 -1
- package/dist/core/i18n/types.d.ts +2 -0
- package/dist/core/i18n/types.d.ts.map +1 -1
- package/dist/crossx.global +12 -12
- package/dist/index.cjs +9 -9
- package/dist/index.js +100 -94
- package/dist/sdk/CROSSxSDK.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -168,7 +168,7 @@ class Fs {
|
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
let _e = null;
|
|
171
|
-
function
|
|
171
|
+
function St(r) {
|
|
172
172
|
_e = r;
|
|
173
173
|
}
|
|
174
174
|
const d = {
|
|
@@ -264,7 +264,8 @@ const d = {
|
|
|
264
264
|
verifyPin_subtitle: "계속하려면 PIN을 확인해 주세요.",
|
|
265
265
|
// ── PIN 잠금 안내 ─────────────────────────────────────────────
|
|
266
266
|
pinLocked_message: "잠금이 해제된 후 다시 시도해 주세요.",
|
|
267
|
-
pinLocked_availableFrom: "이용 가능 시간"
|
|
267
|
+
pinLocked_availableFrom: "이용 가능 시간",
|
|
268
|
+
alert_sessionExpired: "인증이 만료되었습니다. 확인을 누른 뒤 다시 로그인해 주세요."
|
|
268
269
|
}, Qt = {
|
|
269
270
|
// ── Common buttons ───────────────────────────────────────────
|
|
270
271
|
confirm: "Confirm",
|
|
@@ -331,12 +332,13 @@ const d = {
|
|
|
331
332
|
verifyPin_subtitle: "To continue, please confirm your PIN.",
|
|
332
333
|
// ── PIN lock message ─────────────────────────────────────────
|
|
333
334
|
pinLocked_message: "Please try again after the lock expires.",
|
|
334
|
-
pinLocked_availableFrom: "Available from"
|
|
335
|
+
pinLocked_availableFrom: "Available from",
|
|
336
|
+
alert_sessionExpired: "Your session has expired. Tap OK and sign in again."
|
|
335
337
|
}, Ws = {
|
|
336
338
|
ko: Gs,
|
|
337
339
|
en: Qt
|
|
338
340
|
};
|
|
339
|
-
function
|
|
341
|
+
function Xe(r = "en", e) {
|
|
340
342
|
return Ws[r] ?? Qt;
|
|
341
343
|
}
|
|
342
344
|
const Et = "crossx_access_token", It = "crossx_refresh_token", Tt = "crossx_user_info";
|
|
@@ -877,7 +879,7 @@ function Js() {
|
|
|
877
879
|
const Xs = 2e3, At = 6e4, Zs = 1e3, Qs = 1e4, er = "0x77359400", Rt = "0x3B9ACA00", kt = 130, Pt = 6, Ot = 18, tr = 3e4, sr = 5 * 60 * 1e3, rr = 30 * 1e3, re = class re extends js {
|
|
878
880
|
constructor(e, s, t, n, o, i, a, c, l, u, h) {
|
|
879
881
|
var _, f;
|
|
880
|
-
super(), this.storage = t, this.crypto = n, this.transport = o, this.oauth = i, this.walletProvider = a, this.tokenStore = c, this.initialized = !1, this._initPromise = null, this.authenticated = !1, this.userId = null, this.address = null, this.activeWalletIndex = 0, this.userEmail = null, this.loginType = null, this.providerSub = null, this.tokenSignatureVerified = !1, this._verifyPinMutex = null, this._themeMediaCleanup = null, this._config = Object.freeze({ ...e }), this.internalConfig = e, this.adapterConfig = s, e.logger &&
|
|
882
|
+
super(), this.storage = t, this.crypto = n, this.transport = o, this.oauth = i, this.walletProvider = a, this.tokenStore = c, this.initialized = !1, this._initPromise = null, this.authenticated = !1, this.userId = null, this.address = null, this.activeWalletIndex = 0, this.userEmail = null, this.loginType = null, this.providerSub = null, this.tokenSignatureVerified = !1, this._verifyPinMutex = null, this._themeMediaCleanup = null, this._config = Object.freeze({ ...e }), this.internalConfig = e, this.adapterConfig = s, e.logger && St(e.logger), this.confirmation = l, this.pinStore = h ?? new es(), this.chainRegistry = u, this.jsonRpc = new zs(u, o), this.signInUseCase = new qs(
|
|
881
883
|
this.internalConfig,
|
|
882
884
|
t,
|
|
883
885
|
n,
|
|
@@ -914,7 +916,7 @@ const Xs = 2e3, At = 6e4, Zs = 1e3, Qs = 1e4, er = "0x77359400", Rt = "0x3B9ACA0
|
|
|
914
916
|
}
|
|
915
917
|
async _doInitialize(e) {
|
|
916
918
|
var s, t;
|
|
917
|
-
d.log("[CROSSx SDK] v1.3.
|
|
919
|
+
d.log("[CROSSx SDK] v1.3.9 초기화 중..."), this.confirmation.setMessages(Xe(this._config.locale));
|
|
918
920
|
try {
|
|
919
921
|
const n = Js();
|
|
920
922
|
this.internalConfig.oauthServiceUrl = n.oauthServiceUrl, this.internalConfig.authApiUrl = n.authApiUrl, this.internalConfig.walletGatewayUrl = n.walletGatewayUrl, this.adapterConfig.gatewayUrl = n.walletGatewayUrl, (t = (s = this.crypto).setJWKSEndpoint) == null || t.call(s, `${n.authApiUrl}/.well-known/jwks.json`);
|
|
@@ -929,7 +931,7 @@ const Xs = 2e3, At = 6e4, Zs = 1e3, Qs = 1e4, er = "0x77359400", Rt = "0x3B9ACA0
|
|
|
929
931
|
d.log("[CROSSx] initialize: 비밀번호 입력 취소 — 지갑 미로드 상태로 계속");
|
|
930
932
|
}
|
|
931
933
|
}
|
|
932
|
-
return this.initialized = !0, d.info("[CROSSx SDK] v1.3.
|
|
934
|
+
return this.initialized = !0, d.info("[CROSSx SDK] v1.3.9 초기화 완료"), this.emit("initialized", { restored: !!(o != null && o.success) }), o ?? null;
|
|
933
935
|
} catch (n) {
|
|
934
936
|
throw new m(p.AUTH_NOT_INITIALIZED, "SDK 초기화에 실패했습니다", n);
|
|
935
937
|
}
|
|
@@ -1337,7 +1339,7 @@ const Xs = 2e3, At = 6e4, Zs = 1e3, Qs = 1e4, er = "0x77359400", Rt = "0x3B9ACA0
|
|
|
1337
1339
|
* sdk.applyLocale('ko');
|
|
1338
1340
|
*/
|
|
1339
1341
|
applyLocale(e = this._config.locale ?? "en") {
|
|
1340
|
-
this._config = Object.freeze({ ...this._config, locale: e }), this.confirmation.setMessages(
|
|
1342
|
+
this._config = Object.freeze({ ...this._config, locale: e }), this.confirmation.setMessages(Xe(e));
|
|
1341
1343
|
}
|
|
1342
1344
|
/**
|
|
1343
1345
|
* 지갑 생성/로드 (로그인 후 address가 없는 경우)
|
|
@@ -2280,6 +2282,10 @@ const Xs = 2e3, At = 6e4, Zs = 1e3, Qs = 1e4, er = "0x77359400", Rt = "0x3B9ACA0
|
|
|
2280
2282
|
throw new m(p.PIN_CANCELLED, "사용자가 PIN 입력을 취소했습니다");
|
|
2281
2283
|
this.pinStore.set(o), d.log("[CROSSx] PIN 갱신 완료 (verify 모달 닫힘)"), t();
|
|
2282
2284
|
} catch (o) {
|
|
2285
|
+
if (o instanceof m && (o.code === p.AUTH_NOT_AUTHENTICATED || o.code === p.AUTH_TOKEN_EXPIRED)) {
|
|
2286
|
+
const { alert_sessionExpired: i } = Xe(this._config.locale ?? "en");
|
|
2287
|
+
typeof globalThis.alert == "function" && globalThis.alert(i);
|
|
2288
|
+
}
|
|
2283
2289
|
throw n(o), o;
|
|
2284
2290
|
} finally {
|
|
2285
2291
|
this._verifyPinMutex = null;
|
|
@@ -2397,7 +2403,7 @@ const Xs = 2e3, At = 6e4, Zs = 1e3, Qs = 1e4, er = "0x77359400", Rt = "0x3B9ACA0
|
|
|
2397
2403
|
*/
|
|
2398
2404
|
dispose() {
|
|
2399
2405
|
var e;
|
|
2400
|
-
(e = this._themeMediaCleanup) == null || e.call(this), this._themeMediaCleanup = null, this.clearAuthState(), this.tokenStore.clear(), this.pinStore.clear(), this.initialized = !1, this.removeAllListeners(),
|
|
2406
|
+
(e = this._themeMediaCleanup) == null || e.call(this), this._themeMediaCleanup = null, this.clearAuthState(), this.tokenStore.clear(), this.pinStore.clear(), this.initialized = !1, this.removeAllListeners(), St(null);
|
|
2401
2407
|
}
|
|
2402
2408
|
/**
|
|
2403
2409
|
* @internal internal 패키지 전용 — 공개 문서에 기재하지 않음
|
|
@@ -2418,7 +2424,7 @@ const Xs = 2e3, At = 6e4, Zs = 1e3, Qs = 1e4, er = "0x77359400", Rt = "0x3B9ACA0
|
|
|
2418
2424
|
}
|
|
2419
2425
|
};
|
|
2420
2426
|
re.OFFCHAIN_CHAIN_ID = "0";
|
|
2421
|
-
let
|
|
2427
|
+
let at = re;
|
|
2422
2428
|
class nr {
|
|
2423
2429
|
constructor() {
|
|
2424
2430
|
this.prefix = "crossx_";
|
|
@@ -2456,7 +2462,7 @@ class nr {
|
|
|
2456
2462
|
}
|
|
2457
2463
|
}
|
|
2458
2464
|
}
|
|
2459
|
-
const
|
|
2465
|
+
const Ze = "crossx-sdk", or = 1, de = "data", Se = "keys", $e = "aes-primary", ir = 12;
|
|
2460
2466
|
class Ct {
|
|
2461
2467
|
constructor(e) {
|
|
2462
2468
|
this.db = null, this.cryptoKey = null, this.initPromise = null, this.dbName = `crossx-sdk-${e}`;
|
|
@@ -2520,9 +2526,9 @@ class Ct {
|
|
|
2520
2526
|
* 마이그레이션 성공 시 레거시 DB 삭제.
|
|
2521
2527
|
*/
|
|
2522
2528
|
async migrateFromLegacyDB() {
|
|
2523
|
-
if (this.dbName ===
|
|
2529
|
+
if (this.dbName === Ze) return null;
|
|
2524
2530
|
try {
|
|
2525
|
-
const e = await this.openDB(
|
|
2531
|
+
const e = await this.openDB(Ze), s = e.transaction([Se, de], "readonly"), t = s.objectStore(Se).get($e), n = await new Promise((l, u) => {
|
|
2526
2532
|
t.onsuccess = () => l(t.result), t.onerror = () => u(t.error);
|
|
2527
2533
|
});
|
|
2528
2534
|
if (!n)
|
|
@@ -2538,7 +2544,7 @@ class Ct {
|
|
|
2538
2544
|
e.close(), await this.idbPut(Se, $e, n);
|
|
2539
2545
|
for (let l = 0; l < c.length; l++)
|
|
2540
2546
|
await this.idbPut(de, String(c[l]), a[l]);
|
|
2541
|
-
return indexedDB.deleteDatabase(
|
|
2547
|
+
return indexedDB.deleteDatabase(Ze), d.log("[CROSSx] IndexedDB 레거시 DB 마이그레이션 완료"), n;
|
|
2542
2548
|
} catch (e) {
|
|
2543
2549
|
return d.warn("[CROSSx] IndexedDB 레거시 DB 마이그레이션 실패:", e), null;
|
|
2544
2550
|
}
|
|
@@ -2603,7 +2609,7 @@ class Ct {
|
|
|
2603
2609
|
}
|
|
2604
2610
|
}
|
|
2605
2611
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
2606
|
-
function
|
|
2612
|
+
function ht(r) {
|
|
2607
2613
|
return r instanceof Uint8Array || ArrayBuffer.isView(r) && r.constructor.name === "Uint8Array";
|
|
2608
2614
|
}
|
|
2609
2615
|
function me(r, e = "") {
|
|
@@ -2613,7 +2619,7 @@ function me(r, e = "") {
|
|
|
2613
2619
|
}
|
|
2614
2620
|
}
|
|
2615
2621
|
function V(r, e, s = "") {
|
|
2616
|
-
const t =
|
|
2622
|
+
const t = ht(r), n = r == null ? void 0 : r.length, o = e !== void 0;
|
|
2617
2623
|
if (!t || o && n !== e) {
|
|
2618
2624
|
const i = s && `"${s}" `, a = o ? ` of length ${e}` : "", c = t ? `length=${n}` : `type=${typeof r}`;
|
|
2619
2625
|
throw new Error(i + "expected Uint8Array" + a + ", got " + c);
|
|
@@ -2644,7 +2650,7 @@ function Pe(...r) {
|
|
|
2644
2650
|
for (let e = 0; e < r.length; e++)
|
|
2645
2651
|
r[e].fill(0);
|
|
2646
2652
|
}
|
|
2647
|
-
function
|
|
2653
|
+
function Qe(r) {
|
|
2648
2654
|
return new DataView(r.buffer, r.byteOffset, r.byteLength);
|
|
2649
2655
|
}
|
|
2650
2656
|
function ue(r, e) {
|
|
@@ -2741,7 +2747,7 @@ class _r {
|
|
|
2741
2747
|
E(this, "length", 0);
|
|
2742
2748
|
E(this, "pos", 0);
|
|
2743
2749
|
E(this, "destroyed", !1);
|
|
2744
|
-
this.blockLen = e, this.outputLen = s, this.padOffset = t, this.isLE = n, this.buffer = new Uint8Array(e), this.view =
|
|
2750
|
+
this.blockLen = e, this.outputLen = s, this.padOffset = t, this.isLE = n, this.buffer = new Uint8Array(e), this.view = Qe(this.buffer);
|
|
2745
2751
|
}
|
|
2746
2752
|
update(e) {
|
|
2747
2753
|
ke(this), V(e);
|
|
@@ -2749,7 +2755,7 @@ class _r {
|
|
|
2749
2755
|
for (let i = 0; i < o; ) {
|
|
2750
2756
|
const a = Math.min(n - this.pos, o - i);
|
|
2751
2757
|
if (a === n) {
|
|
2752
|
-
const c =
|
|
2758
|
+
const c = Qe(e);
|
|
2753
2759
|
for (; n <= o - i; i += n)
|
|
2754
2760
|
this.process(c, i);
|
|
2755
2761
|
continue;
|
|
@@ -2766,7 +2772,7 @@ class _r {
|
|
|
2766
2772
|
for (let h = i; h < n; h++)
|
|
2767
2773
|
s[h] = 0;
|
|
2768
2774
|
t.setBigUint64(n - 8, BigInt(this.length * 8), o), this.process(t, 0);
|
|
2769
|
-
const a =
|
|
2775
|
+
const a = Qe(e), c = this.outputLen;
|
|
2770
2776
|
if (c % 4)
|
|
2771
2777
|
throw new Error("_sha2: outputLen must be aligned to 32bit");
|
|
2772
2778
|
const l = c / 4, u = this.get();
|
|
@@ -2931,7 +2937,7 @@ const Ir = /* @__PURE__ */ ns(
|
|
|
2931
2937
|
/* @__PURE__ */ hr(1)
|
|
2932
2938
|
);
|
|
2933
2939
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
2934
|
-
const
|
|
2940
|
+
const pt = /* @__PURE__ */ BigInt(0), ct = /* @__PURE__ */ BigInt(1);
|
|
2935
2941
|
function qe(r, e = "") {
|
|
2936
2942
|
if (typeof r != "boolean") {
|
|
2937
2943
|
const s = e && `"${e}" `;
|
|
@@ -2954,7 +2960,7 @@ function Ue(r) {
|
|
|
2954
2960
|
function as(r) {
|
|
2955
2961
|
if (typeof r != "string")
|
|
2956
2962
|
throw new Error("hex string expected, got " + typeof r);
|
|
2957
|
-
return r === "" ?
|
|
2963
|
+
return r === "" ? pt : BigInt("0x" + r);
|
|
2958
2964
|
}
|
|
2959
2965
|
function ze(r) {
|
|
2960
2966
|
return as(Me(r));
|
|
@@ -2962,7 +2968,7 @@ function ze(r) {
|
|
|
2962
2968
|
function cs(r) {
|
|
2963
2969
|
return as(Me(Tr(V(r)).reverse()));
|
|
2964
2970
|
}
|
|
2965
|
-
function
|
|
2971
|
+
function ft(r, e) {
|
|
2966
2972
|
me(e), r = is(r);
|
|
2967
2973
|
const s = We(r.toString(16).padStart(e * 2, "0"));
|
|
2968
2974
|
if (s.length !== e)
|
|
@@ -2970,12 +2976,12 @@ function pt(r, e) {
|
|
|
2970
2976
|
return s;
|
|
2971
2977
|
}
|
|
2972
2978
|
function ls(r, e) {
|
|
2973
|
-
return
|
|
2979
|
+
return ft(r, e).reverse();
|
|
2974
2980
|
}
|
|
2975
2981
|
function Tr(r) {
|
|
2976
2982
|
return Uint8Array.from(r);
|
|
2977
2983
|
}
|
|
2978
|
-
const Fe = (r) => typeof r == "bigint" &&
|
|
2984
|
+
const Fe = (r) => typeof r == "bigint" && pt <= r;
|
|
2979
2985
|
function Ar(r, e, s) {
|
|
2980
2986
|
return Fe(r) && Fe(e) && Fe(s) && e <= r && r < s;
|
|
2981
2987
|
}
|
|
@@ -2985,11 +2991,11 @@ function Rr(r, e, s, t) {
|
|
|
2985
2991
|
}
|
|
2986
2992
|
function kr(r) {
|
|
2987
2993
|
let e;
|
|
2988
|
-
for (e = 0; r >
|
|
2994
|
+
for (e = 0; r > pt; r >>= ct, e += 1)
|
|
2989
2995
|
;
|
|
2990
2996
|
return e;
|
|
2991
2997
|
}
|
|
2992
|
-
const
|
|
2998
|
+
const _t = (r) => (ct << BigInt(r)) - ct;
|
|
2993
2999
|
function Pr(r, e, s) {
|
|
2994
3000
|
if (me(r, "hashLen"), me(e, "qByteLen"), typeof s != "function")
|
|
2995
3001
|
throw new Error("hmacFn must be a function");
|
|
@@ -3019,7 +3025,7 @@ function Pr(r, e, s) {
|
|
|
3019
3025
|
return h(), N;
|
|
3020
3026
|
};
|
|
3021
3027
|
}
|
|
3022
|
-
function
|
|
3028
|
+
function xt(r, e = {}, s = {}) {
|
|
3023
3029
|
if (!r || typeof r != "object")
|
|
3024
3030
|
throw new Error("expected valid options object");
|
|
3025
3031
|
function t(o, i, a) {
|
|
@@ -3069,17 +3075,17 @@ function $t(r, e) {
|
|
|
3069
3075
|
throw new Error("invert: does not exist");
|
|
3070
3076
|
return le(n, e);
|
|
3071
3077
|
}
|
|
3072
|
-
function
|
|
3078
|
+
function gt(r, e, s) {
|
|
3073
3079
|
if (!r.eql(r.sqr(e), s))
|
|
3074
3080
|
throw new Error("Cannot find square root");
|
|
3075
3081
|
}
|
|
3076
3082
|
function _s(r, e) {
|
|
3077
3083
|
const s = (r.ORDER + ee) / us, t = r.pow(e, s);
|
|
3078
|
-
return
|
|
3084
|
+
return gt(r, t, e), t;
|
|
3079
3085
|
}
|
|
3080
3086
|
function Nr(r, e) {
|
|
3081
3087
|
const s = (r.ORDER - hs) / ps, t = r.mul(e, Ie), n = r.pow(t, s), o = r.mul(e, n), i = r.mul(r.mul(o, Ie), n), a = r.mul(o, r.sub(i, r.ONE));
|
|
3082
|
-
return
|
|
3088
|
+
return gt(r, a, e), a;
|
|
3083
3089
|
}
|
|
3084
3090
|
function Lr(r) {
|
|
3085
3091
|
const e = je(r), s = xs(r), t = s(e, e.neg(e.ONE)), n = s(e, t), o = s(e, e.neg(t)), i = (r + Or) / fs;
|
|
@@ -3088,7 +3094,7 @@ function Lr(r) {
|
|
|
3088
3094
|
const h = a.mul(l, n), _ = a.mul(l, o), f = a.eql(a.sqr(u), c), w = a.eql(a.sqr(h), c);
|
|
3089
3095
|
l = a.cmov(l, u, f), u = a.cmov(_, h, w);
|
|
3090
3096
|
const b = a.eql(a.sqr(u), c), y = a.cmov(l, u, b);
|
|
3091
|
-
return
|
|
3097
|
+
return gt(a, y, c), y;
|
|
3092
3098
|
};
|
|
3093
3099
|
}
|
|
3094
3100
|
function xs(r) {
|
|
@@ -3153,7 +3159,7 @@ function $r(r) {
|
|
|
3153
3159
|
BYTES: "number",
|
|
3154
3160
|
BITS: "number"
|
|
3155
3161
|
}, s = Mr.reduce((t, n) => (t[n] = "function", t), e);
|
|
3156
|
-
return
|
|
3162
|
+
return xt(r, s), r;
|
|
3157
3163
|
}
|
|
3158
3164
|
function Br(r, e, s) {
|
|
3159
3165
|
if (s < ne)
|
|
@@ -3266,7 +3272,7 @@ class Hr {
|
|
|
3266
3272
|
return this._sqrt || (this._sqrt = Dr(this.ORDER)), this._sqrt(this, e);
|
|
3267
3273
|
}
|
|
3268
3274
|
toBytes(e) {
|
|
3269
|
-
return this.isLE ? ls(e, this.BYTES) :
|
|
3275
|
+
return this.isLE ? ls(e, this.BYTES) : ft(e, this.BYTES);
|
|
3270
3276
|
}
|
|
3271
3277
|
fromBytes(e, s = !1) {
|
|
3272
3278
|
V(e);
|
|
@@ -3313,7 +3319,7 @@ function Fr(r, e, s = !1) {
|
|
|
3313
3319
|
if (t < 16 || t < o || t > 1024)
|
|
3314
3320
|
throw new Error("expected " + o + "-1024 bytes of input, got " + t);
|
|
3315
3321
|
const i = s ? cs(r) : ze(r), a = le(i, e - ee) + ee;
|
|
3316
|
-
return s ? ls(a, n) :
|
|
3322
|
+
return s ? ls(a, n) : ft(a, n);
|
|
3317
3323
|
}
|
|
3318
3324
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
3319
3325
|
const Oe = /* @__PURE__ */ BigInt(0), Te = /* @__PURE__ */ BigInt(1);
|
|
@@ -3329,9 +3335,9 @@ function ys(r, e) {
|
|
|
3329
3335
|
if (!Number.isSafeInteger(r) || r <= 0 || r > e)
|
|
3330
3336
|
throw new Error("invalid window size, expected [1.." + e + "], got W=" + r);
|
|
3331
3337
|
}
|
|
3332
|
-
function
|
|
3338
|
+
function et(r, e) {
|
|
3333
3339
|
ys(r, e);
|
|
3334
|
-
const s = Math.ceil(e / r) + 1, t = 2 ** (r - 1), n = 2 ** r, o =
|
|
3340
|
+
const s = Math.ceil(e / r) + 1, t = 2 ** (r - 1), n = 2 ** r, o = _t(r), i = BigInt(r);
|
|
3335
3341
|
return { windows: s, windowSize: t, mask: o, maxNumber: n, shiftBy: i };
|
|
3336
3342
|
}
|
|
3337
3343
|
function Ht(r, e, s) {
|
|
@@ -3341,8 +3347,8 @@ function Ht(r, e, s) {
|
|
|
3341
3347
|
const l = e * t, u = l + Math.abs(a) - 1, h = a === 0, _ = a < 0, f = e % 2 !== 0;
|
|
3342
3348
|
return { nextN: c, offset: u, isZero: h, isNeg: _, isNegF: f, offsetF: l };
|
|
3343
3349
|
}
|
|
3344
|
-
const
|
|
3345
|
-
function
|
|
3350
|
+
const tt = /* @__PURE__ */ new WeakMap(), bs = /* @__PURE__ */ new WeakMap();
|
|
3351
|
+
function st(r) {
|
|
3346
3352
|
return bs.get(r) || 1;
|
|
3347
3353
|
}
|
|
3348
3354
|
function Ft(r) {
|
|
@@ -3378,7 +3384,7 @@ class Gr {
|
|
|
3378
3384
|
* @returns precomputed point tables flattened to a single array
|
|
3379
3385
|
*/
|
|
3380
3386
|
precomputeWindow(e, s) {
|
|
3381
|
-
const { windows: t, windowSize: n } =
|
|
3387
|
+
const { windows: t, windowSize: n } = et(s, this.bits), o = [];
|
|
3382
3388
|
let i = e, a = i;
|
|
3383
3389
|
for (let c = 0; c < t; c++) {
|
|
3384
3390
|
a = i, o.push(a);
|
|
@@ -3398,7 +3404,7 @@ class Gr {
|
|
|
3398
3404
|
if (!this.Fn.isValid(t))
|
|
3399
3405
|
throw new Error("invalid scalar");
|
|
3400
3406
|
let n = this.ZERO, o = this.BASE;
|
|
3401
|
-
const i =
|
|
3407
|
+
const i = et(e, this.bits);
|
|
3402
3408
|
for (let a = 0; a < i.windows; a++) {
|
|
3403
3409
|
const { nextN: c, offset: l, isZero: u, isNeg: h, isNegF: _, offsetF: f } = Ht(t, a, i);
|
|
3404
3410
|
t = c, u ? o = o.add(Ke(_, s[f])) : n = n.add(Ke(h, s[l]));
|
|
@@ -3411,7 +3417,7 @@ class Gr {
|
|
|
3411
3417
|
* @returns point
|
|
3412
3418
|
*/
|
|
3413
3419
|
wNAFUnsafe(e, s, t, n = this.ZERO) {
|
|
3414
|
-
const o =
|
|
3420
|
+
const o = et(e, this.bits);
|
|
3415
3421
|
for (let i = 0; i < o.windows && t !== Oe; i++) {
|
|
3416
3422
|
const { nextN: a, offset: c, isZero: l, isNeg: u } = Ht(t, i, o);
|
|
3417
3423
|
if (t = a, !l) {
|
|
@@ -3422,25 +3428,25 @@ class Gr {
|
|
|
3422
3428
|
return Ft(t), n;
|
|
3423
3429
|
}
|
|
3424
3430
|
getPrecomputes(e, s, t) {
|
|
3425
|
-
let n =
|
|
3426
|
-
return n || (n = this.precomputeWindow(s, e), e !== 1 && (typeof t == "function" && (n = t(n)),
|
|
3431
|
+
let n = tt.get(s);
|
|
3432
|
+
return n || (n = this.precomputeWindow(s, e), e !== 1 && (typeof t == "function" && (n = t(n)), tt.set(s, n))), n;
|
|
3427
3433
|
}
|
|
3428
3434
|
cached(e, s, t) {
|
|
3429
|
-
const n =
|
|
3435
|
+
const n = st(e);
|
|
3430
3436
|
return this.wNAF(n, this.getPrecomputes(n, e, t), s);
|
|
3431
3437
|
}
|
|
3432
3438
|
unsafe(e, s, t, n) {
|
|
3433
|
-
const o =
|
|
3439
|
+
const o = st(e);
|
|
3434
3440
|
return o === 1 ? this._unsafeLadder(e, s, n) : this.wNAFUnsafe(o, this.getPrecomputes(o, e, t), s, n);
|
|
3435
3441
|
}
|
|
3436
3442
|
// We calculate precomputes for elliptic curve point multiplication
|
|
3437
3443
|
// using windowed method. This specifies window size and
|
|
3438
3444
|
// stores precomputed values. Usually only base point would be precomputed.
|
|
3439
3445
|
createCache(e, s) {
|
|
3440
|
-
ys(s, this.bits), bs.set(e, s),
|
|
3446
|
+
ys(s, this.bits), bs.set(e, s), tt.delete(e);
|
|
3441
3447
|
}
|
|
3442
3448
|
hasCache(e) {
|
|
3443
|
-
return
|
|
3449
|
+
return st(e) !== 1;
|
|
3444
3450
|
}
|
|
3445
3451
|
}
|
|
3446
3452
|
function Wr(r, e, s, t) {
|
|
@@ -3528,21 +3534,21 @@ function Vr(r, e, s) {
|
|
|
3528
3534
|
let l = r - a * t - c * o, u = -a * n - c * i;
|
|
3529
3535
|
const h = l < xe, _ = u < xe;
|
|
3530
3536
|
h && (l = -l), _ && (u = -u);
|
|
3531
|
-
const f =
|
|
3537
|
+
const f = _t(Math.ceil(kr(s) / 2)) + Re;
|
|
3532
3538
|
if (l < xe || l >= f || u < xe || u >= f)
|
|
3533
3539
|
throw new Error("splitScalar (endomorphism): failed, k=" + r);
|
|
3534
3540
|
return { k1neg: h, k1: l, k2neg: _, k2: u };
|
|
3535
3541
|
}
|
|
3536
|
-
function
|
|
3542
|
+
function lt(r) {
|
|
3537
3543
|
if (!["compact", "recovered", "der"].includes(r))
|
|
3538
3544
|
throw new Error('Signature format must be "compact", "recovered", or "der"');
|
|
3539
3545
|
return r;
|
|
3540
3546
|
}
|
|
3541
|
-
function
|
|
3547
|
+
function rt(r, e) {
|
|
3542
3548
|
const s = {};
|
|
3543
3549
|
for (let t of Object.keys(e))
|
|
3544
3550
|
s[t] = r[t] === void 0 ? e[t] : r[t];
|
|
3545
|
-
return qe(s.lowS, "lowS"), qe(s.prehash, "prehash"), s.format !== void 0 &&
|
|
3551
|
+
return qe(s.lowS, "lowS"), qe(s.prehash, "prehash"), s.format !== void 0 && lt(s.format), s;
|
|
3546
3552
|
}
|
|
3547
3553
|
class zr extends Error {
|
|
3548
3554
|
constructor(e = "") {
|
|
@@ -3641,7 +3647,7 @@ function Yr(r, e = {}) {
|
|
|
3641
3647
|
const s = qr("weierstrass", r, e), { Fp: t, Fn: n } = s;
|
|
3642
3648
|
let o = s.CURVE;
|
|
3643
3649
|
const { h: i, n: a } = o;
|
|
3644
|
-
|
|
3650
|
+
xt(e, {}, {
|
|
3645
3651
|
allowInfinityPoint: "boolean",
|
|
3646
3652
|
clearCofactor: "function",
|
|
3647
3653
|
isTorsionFree: "function",
|
|
@@ -3968,7 +3974,7 @@ function Jr(r, e = {}) {
|
|
|
3968
3974
|
}
|
|
3969
3975
|
function l(f) {
|
|
3970
3976
|
const { secretKey: w, publicKey: b, publicKeyUncompressed: y } = n;
|
|
3971
|
-
if (!
|
|
3977
|
+
if (!ht(f) || "_lengths" in s && s._lengths || w === b)
|
|
3972
3978
|
return;
|
|
3973
3979
|
const T = V(f, void 0, "key").length;
|
|
3974
3980
|
return T === b || T === y;
|
|
@@ -3989,7 +3995,7 @@ function Jr(r, e = {}) {
|
|
|
3989
3995
|
return Object.freeze({ getPublicKey: c, getSharedSecret: u, keygen: _, Point: r, utils: h, lengths: n });
|
|
3990
3996
|
}
|
|
3991
3997
|
function Xr(r, e, s = {}) {
|
|
3992
|
-
ts(e),
|
|
3998
|
+
ts(e), xt(s, {}, {
|
|
3993
3999
|
hmac: "function",
|
|
3994
4000
|
lowS: "boolean",
|
|
3995
4001
|
randomBytes: "function",
|
|
@@ -4016,7 +4022,7 @@ function Xr(r, e, s = {}) {
|
|
|
4016
4022
|
throw new Error('"recovered" sig type is not supported for cofactor >2 curves');
|
|
4017
4023
|
}
|
|
4018
4024
|
function W(x, g) {
|
|
4019
|
-
|
|
4025
|
+
lt(g);
|
|
4020
4026
|
const v = f.signature, k = g === "compact" ? v : g === "recovered" ? v + 1 : void 0;
|
|
4021
4027
|
return V(x, k);
|
|
4022
4028
|
}
|
|
@@ -4069,7 +4075,7 @@ function Xr(r, e, s = {}) {
|
|
|
4069
4075
|
return y(this.s);
|
|
4070
4076
|
}
|
|
4071
4077
|
toBytes(g = w.format) {
|
|
4072
|
-
if (
|
|
4078
|
+
if (lt(g), g === "der")
|
|
4073
4079
|
return We(be.hexFromSig(this));
|
|
4074
4080
|
const { r: v, s: k } = this, D = i.toBytes(v), C = i.toBytes(k);
|
|
4075
4081
|
return g === "recovered" ? (N(), ve(Uint8Array.of(this.assertRecovery()), D, C)) : ve(D, C);
|
|
@@ -4085,7 +4091,7 @@ function Xr(r, e, s = {}) {
|
|
|
4085
4091
|
return k > 0 ? v >> BigInt(k) : v;
|
|
4086
4092
|
}, q = s.bits2int_modN || function(g) {
|
|
4087
4093
|
return i.create(j(g));
|
|
4088
|
-
}, P =
|
|
4094
|
+
}, P = _t(c);
|
|
4089
4095
|
function S(x) {
|
|
4090
4096
|
return Rr("num < 2^" + c, x, xe, P), i.toBytes(x);
|
|
4091
4097
|
}
|
|
@@ -4093,7 +4099,7 @@ function Xr(r, e, s = {}) {
|
|
|
4093
4099
|
return V(x, void 0, "message"), g ? V(e(x), void 0, "prehashed message") : x;
|
|
4094
4100
|
}
|
|
4095
4101
|
function G(x, g, v) {
|
|
4096
|
-
const { lowS: k, prehash: D, extraEntropy: C } =
|
|
4102
|
+
const { lowS: k, prehash: D, extraEntropy: C } = rt(v, w);
|
|
4097
4103
|
x = L(x, D);
|
|
4098
4104
|
const M = q(x), R = i.fromBytes(g);
|
|
4099
4105
|
if (!i.isValidNot0(R))
|
|
@@ -4114,8 +4120,8 @@ function Xr(r, e, s = {}) {
|
|
|
4114
4120
|
const Q = i.create(Z * i.create(J + z * R));
|
|
4115
4121
|
if (Q === xe)
|
|
4116
4122
|
return;
|
|
4117
|
-
let
|
|
4118
|
-
return k && y(Q) && (
|
|
4123
|
+
let bt = (oe.x === z ? 0 : 2) | Number(oe.y & Re), vt = Q;
|
|
4124
|
+
return k && y(Q) && (vt = i.neg(Q), bt ^= 1), new B(z, vt, b ? void 0 : bt);
|
|
4119
4125
|
}
|
|
4120
4126
|
return { seed: F, k2sig: K };
|
|
4121
4127
|
}
|
|
@@ -4124,8 +4130,8 @@ function Xr(r, e, s = {}) {
|
|
|
4124
4130
|
return Pr(e.outputLen, i.BYTES, n)(k, D).toBytes(v.format);
|
|
4125
4131
|
}
|
|
4126
4132
|
function A(x, g, v, k = {}) {
|
|
4127
|
-
const { lowS: D, prehash: C, format: M } =
|
|
4128
|
-
if (v = V(v, void 0, "publicKey"), g = L(g, C), !
|
|
4133
|
+
const { lowS: D, prehash: C, format: M } = rt(k, w);
|
|
4134
|
+
if (v = V(v, void 0, "publicKey"), g = L(g, C), !ht(x)) {
|
|
4129
4135
|
const R = x instanceof B ? ", use sig.toBytes()" : "";
|
|
4130
4136
|
throw new Error("verify expects Uint8Array signature" + R);
|
|
4131
4137
|
}
|
|
@@ -4141,7 +4147,7 @@ function Xr(r, e, s = {}) {
|
|
|
4141
4147
|
}
|
|
4142
4148
|
}
|
|
4143
4149
|
function I(x, g, v = {}) {
|
|
4144
|
-
const { prehash: k } =
|
|
4150
|
+
const { prehash: k } = rt(v, w);
|
|
4145
4151
|
return g = L(g, k), B.fromBytes(x, "recovered").recoverPublicKey(g).toBytes();
|
|
4146
4152
|
}
|
|
4147
4153
|
return Object.freeze({
|
|
@@ -4159,7 +4165,7 @@ function Xr(r, e, s = {}) {
|
|
|
4159
4165
|
});
|
|
4160
4166
|
}
|
|
4161
4167
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
4162
|
-
const
|
|
4168
|
+
const mt = {
|
|
4163
4169
|
p: BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),
|
|
4164
4170
|
n: BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),
|
|
4165
4171
|
h: BigInt(1),
|
|
@@ -4175,13 +4181,13 @@ const gt = {
|
|
|
4175
4181
|
]
|
|
4176
4182
|
}, qt = /* @__PURE__ */ BigInt(2);
|
|
4177
4183
|
function Qr(r) {
|
|
4178
|
-
const e =
|
|
4179
|
-
if (!
|
|
4184
|
+
const e = mt.p, s = BigInt(3), t = BigInt(6), n = BigInt(11), o = BigInt(22), i = BigInt(23), a = BigInt(44), c = BigInt(88), l = r * r * r % e, u = l * l * r % e, h = ae(u, s, e) * u % e, _ = ae(h, s, e) * u % e, f = ae(_, qt, e) * l % e, w = ae(f, n, e) * f % e, b = ae(w, o, e) * w % e, y = ae(b, a, e) * b % e, T = ae(y, c, e) * y % e, N = ae(T, a, e) * b % e, W = ae(N, s, e) * u % e, B = ae(W, i, e) * w % e, j = ae(B, t, e) * l % e, q = ae(j, qt, e);
|
|
4185
|
+
if (!dt.eql(dt.sqr(q), r))
|
|
4180
4186
|
throw new Error("Cannot find square root");
|
|
4181
4187
|
return q;
|
|
4182
4188
|
}
|
|
4183
|
-
const
|
|
4184
|
-
Fp:
|
|
4189
|
+
const dt = je(mt.p, { sqrt: Qr }), en = /* @__PURE__ */ Yr(mt, {
|
|
4190
|
+
Fp: dt,
|
|
4185
4191
|
endo: Zr
|
|
4186
4192
|
}), tn = /* @__PURE__ */ Xr(en, Ir), sn = BigInt(0), Ce = BigInt(1), rn = BigInt(2), nn = BigInt(7), on = BigInt(256), an = BigInt(113), As = [], Rs = [], ks = [];
|
|
4187
4193
|
for (let r = 0, e = Ce, s = 1, t = 0; r < 24; r++) {
|
|
@@ -4217,7 +4223,7 @@ function dn(r, e = 24) {
|
|
|
4217
4223
|
}
|
|
4218
4224
|
Pe(s);
|
|
4219
4225
|
}
|
|
4220
|
-
class
|
|
4226
|
+
class wt {
|
|
4221
4227
|
// NOTE: we accept arguments in bytes instead of bits here.
|
|
4222
4228
|
constructor(e, s, t, n = !1, o = 24) {
|
|
4223
4229
|
E(this, "state");
|
|
@@ -4290,10 +4296,10 @@ class mt {
|
|
|
4290
4296
|
}
|
|
4291
4297
|
_cloneInto(e) {
|
|
4292
4298
|
const { blockLen: s, suffix: t, outputLen: n, rounds: o, enableXOF: i } = this;
|
|
4293
|
-
return e || (e = new
|
|
4299
|
+
return e || (e = new wt(s, t, n, i, o)), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = o, e.suffix = t, e.outputLen = n, e.enableXOF = i, e.destroyed = this.destroyed, e;
|
|
4294
4300
|
}
|
|
4295
4301
|
}
|
|
4296
|
-
const un = (r, e, s, t = {}) => ns(() => new
|
|
4302
|
+
const un = (r, e, s, t = {}) => ns(() => new wt(e, r, s), t), zt = /* @__PURE__ */ un(1, 136, 32), hn = 60;
|
|
4297
4303
|
class pn {
|
|
4298
4304
|
constructor() {
|
|
4299
4305
|
this.jwks = null;
|
|
@@ -7064,7 +7070,7 @@ function vn(r, e = "CROSS", s = 18) {
|
|
|
7064
7070
|
try {
|
|
7065
7071
|
const t = BigInt(r);
|
|
7066
7072
|
if (t === 0n) return null;
|
|
7067
|
-
const n =
|
|
7073
|
+
const n = ut(t, s);
|
|
7068
7074
|
return n === "0" ? null : `${n} ${e}`;
|
|
7069
7075
|
} catch {
|
|
7070
7076
|
return null;
|
|
@@ -7097,12 +7103,12 @@ function Os(r) {
|
|
|
7097
7103
|
const e = parseInt(r.split(":")[1] ?? "", 10);
|
|
7098
7104
|
return !isNaN(e) && Xt[e] ? Xt[e] : r;
|
|
7099
7105
|
}
|
|
7100
|
-
function
|
|
7106
|
+
function ut(r, e) {
|
|
7101
7107
|
if (r === 0n) return "0";
|
|
7102
7108
|
const s = 10n ** BigInt(e), t = r / s, i = (r % s).toString().padStart(e, "0").slice(0, 6).replace(/0+$/, "");
|
|
7103
7109
|
return i ? `${t}.${i}` : `${t}`;
|
|
7104
7110
|
}
|
|
7105
|
-
function
|
|
7111
|
+
function nt(r) {
|
|
7106
7112
|
try {
|
|
7107
7113
|
const e = BigInt(r), s = e / 1000000000n, n = (e % 1000000000n).toString().padStart(9, "0").slice(0, 2).replace(/0+$/, "");
|
|
7108
7114
|
return n ? `${s}.${n}` : `${s}`;
|
|
@@ -7126,9 +7132,9 @@ function En(r) {
|
|
|
7126
7132
|
const l = a * BigInt(t);
|
|
7127
7133
|
return {
|
|
7128
7134
|
isDynamic: !0,
|
|
7129
|
-
estTxFee: `${
|
|
7130
|
-
maxFeeGwei:
|
|
7131
|
-
maxPriorityFeeGwei: n ?
|
|
7135
|
+
estTxFee: `${ut(l, i)} ${o}`,
|
|
7136
|
+
maxFeeGwei: nt(t),
|
|
7137
|
+
maxPriorityFeeGwei: n ? nt(n) : void 0,
|
|
7132
7138
|
gasLimitFormatted: c
|
|
7133
7139
|
};
|
|
7134
7140
|
}
|
|
@@ -7136,8 +7142,8 @@ function En(r) {
|
|
|
7136
7142
|
const l = a * BigInt(s);
|
|
7137
7143
|
return {
|
|
7138
7144
|
isDynamic: !1,
|
|
7139
|
-
estTxFee: `${
|
|
7140
|
-
gasPriceGwei:
|
|
7145
|
+
estTxFee: `${ut(l, i)} ${o}`,
|
|
7146
|
+
gasPriceGwei: nt(s),
|
|
7141
7147
|
gasLimitFormatted: c
|
|
7142
7148
|
};
|
|
7143
7149
|
}
|
|
@@ -7161,7 +7167,7 @@ const ge = `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="
|
|
|
7161
7167
|
</svg>`, In = `<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
7162
7168
|
<circle cx="20" cy="20" r="20" fill="#00D5AA"/>
|
|
7163
7169
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.3225 2.85742L23.7249 6.25982V11.8301L28.1175 7.43757L32.9292 12.2493L28.5806 16.5979H20.3225C18.4435 16.5979 16.9201 18.1212 16.9201 20.0003C16.9201 21.8794 18.4434 23.4027 20.3225 23.4027H28.5372L32.9293 27.7948L28.1176 32.6066L23.7249 28.2139V33.7407L20.3225 37.1431L16.9201 33.7407V28.2584L12.5719 32.6066L7.76022 27.7948L12.1524 23.4027H6.58209L3.17969 20.0003L6.58209 16.5979H12.1089L7.76035 12.2493L12.5721 7.43757L16.9201 11.7857V6.25982L20.3225 2.85742Z" fill="#121212"/>
|
|
7164
|
-
</svg>`,
|
|
7170
|
+
</svg>`, yt = `<svg width="20" height="20" viewBox="0 0 20 20" fill="none">
|
|
7165
7171
|
<rect x="2" y="5" width="16" height="12" rx="2" stroke="currentColor" stroke-width="1.5"/>
|
|
7166
7172
|
<path d="M2 9h16" stroke="currentColor" stroke-width="1.5"/>
|
|
7167
7173
|
<rect x="12.5" y="11.5" width="3.5" height="2.5" rx="0.75" fill="currentColor"/>
|
|
@@ -7222,7 +7228,7 @@ function Rn(r, e) {
|
|
|
7222
7228
|
<span class="__crossx-sig-origin">${U(t)} </span>is requesting a Signature
|
|
7223
7229
|
</p>
|
|
7224
7230
|
<div class="__crossx-addr-pill">
|
|
7225
|
-
${
|
|
7231
|
+
${yt}
|
|
7226
7232
|
<span class="__crossx-addr-pill-text">${se(r.from)}</span>
|
|
7227
7233
|
</div>
|
|
7228
7234
|
<p class="__crossx-warning">After you sign, changes or cancellations are not possible.</p>
|
|
@@ -7403,7 +7409,7 @@ function Dn(r, e) {
|
|
|
7403
7409
|
<span class="__crossx-sig-origin">${U(t)} </span>is requesting a Signature
|
|
7404
7410
|
</p>
|
|
7405
7411
|
<div class="__crossx-addr-pill">
|
|
7406
|
-
${
|
|
7412
|
+
${yt}
|
|
7407
7413
|
<span class="__crossx-addr-pill-text">${se(r.from)}</span>
|
|
7408
7414
|
</div>
|
|
7409
7415
|
<p class="__crossx-warning">After you sign, changes or cancellations are not possible.</p>
|
|
@@ -7458,7 +7464,7 @@ function Mn(r, e) {
|
|
|
7458
7464
|
<span class="__crossx-sig-origin">${U(t)} </span>is requesting a Signature
|
|
7459
7465
|
</p>
|
|
7460
7466
|
<div class="__crossx-addr-pill">
|
|
7461
|
-
${
|
|
7467
|
+
${yt}
|
|
7462
7468
|
<span class="__crossx-addr-pill-text">${se(r.from)}</span>
|
|
7463
7469
|
</div>
|
|
7464
7470
|
<p class="__crossx-warning">After you sign, changes or cancellations are not possible.</p>
|
|
@@ -7685,7 +7691,7 @@ function Vn(r) {
|
|
|
7685
7691
|
<div class="__crossx-home-indicator"></div>
|
|
7686
7692
|
`;
|
|
7687
7693
|
}
|
|
7688
|
-
function
|
|
7694
|
+
function ot(r) {
|
|
7689
7695
|
const e = !!r.lockExpiresAt && r.lockExpiresAt > Date.now(), s = r.lockExpiresAt ? ` data-lock-expires="${r.lockExpiresAt}"` : "", t = r.headerSubtitle ? `<p class="__crossx-pin6-header-sub">${U(r.headerSubtitle)}</p>` : "", n = r.subtitle ? `<p class="__crossx-pin6-subtitle">${U(r.subtitle)}</p>` : "", o = r.errorMessage ? `<p class="__crossx-pin6-error" id="__crossx-pin6-error">${U(r.errorMessage)}</p>` : '<p class="__crossx-pin6-error" id="__crossx-pin6-error"></p>', i = e ? `<p class="__crossx-pin6-lock-msg" id="__crossx-pin6-lock-msg">
|
|
7690
7696
|
${Ns}
|
|
7691
7697
|
<span id="__crossx-pin6-lock-countdown"></span>
|
|
@@ -7730,7 +7736,7 @@ function jn(r) {
|
|
|
7730
7736
|
const e = Math.max(0, Math.ceil(r / 1e3)), s = Math.floor(e / 3600), t = Math.floor(e % 3600 / 60), n = e % 60;
|
|
7731
7737
|
return s > 0 ? `${s}h ${String(t).padStart(2, "0")}m` : `${String(t).padStart(2, "0")}:${String(n).padStart(2, "0")}`;
|
|
7732
7738
|
}
|
|
7733
|
-
function
|
|
7739
|
+
function it(r, e, s, t, n, o) {
|
|
7734
7740
|
var j, q;
|
|
7735
7741
|
let i = !!(o && o > Date.now()), a = !1;
|
|
7736
7742
|
const c = () => Array.from(r.querySelectorAll(".__crossx-pin6-box")), l = () => r.querySelector("#__crossx-pin6-boxes"), u = () => r.querySelector("#__crossx-pin6-error"), h = () => r.querySelector("#__crossx-pin6-lock-msg"), _ = () => r.querySelector("#__crossx-pin6-lock-countdown"), f = () => r.querySelector(".__crossx-pin6-body"), w = () => c().map((P) => P.value).join(""), b = (P) => {
|
|
@@ -8043,20 +8049,20 @@ class Zn {
|
|
|
8043
8049
|
alternatingPattern: (t == null ? void 0 : t.pinValidation_alternatingPattern) ?? "Repeating patterns (e.g., 121212) are not allowed."
|
|
8044
8050
|
}, b = (N) => {
|
|
8045
8051
|
var W;
|
|
8046
|
-
f.innerHTML =
|
|
8052
|
+
f.innerHTML = ot({
|
|
8047
8053
|
title: i.title,
|
|
8048
8054
|
headerSubtitle: i.headerSubtitle
|
|
8049
|
-
}), (W = f.querySelector("#__crossx-close-btn")) == null || W.addEventListener("click", _),
|
|
8055
|
+
}), (W = f.querySelector("#__crossx-close-btn")) == null || W.addEventListener("click", _), it(f, (B) => {
|
|
8050
8056
|
B === N ? h(N) : y(o.mismatchError);
|
|
8051
8057
|
}, _);
|
|
8052
8058
|
}, y = (N) => {
|
|
8053
8059
|
var W;
|
|
8054
|
-
f.innerHTML =
|
|
8060
|
+
f.innerHTML = ot({
|
|
8055
8061
|
title: o.title,
|
|
8056
8062
|
headerSubtitle: o.headerSubtitle,
|
|
8057
8063
|
subtitle: o.subtitle,
|
|
8058
8064
|
errorMessage: N
|
|
8059
|
-
}), (W = f.querySelector("#__crossx-close-btn")) == null || W.addEventListener("click", _),
|
|
8065
|
+
}), (W = f.querySelector("#__crossx-close-btn")) == null || W.addEventListener("click", _), it(f, (B) => {
|
|
8060
8066
|
const j = zn(B, w);
|
|
8061
8067
|
j ? y(j) : b(B);
|
|
8062
8068
|
}, _);
|
|
@@ -8115,7 +8121,7 @@ class Zn {
|
|
|
8115
8121
|
he();
|
|
8116
8122
|
const n = this.messages, o = (e == null ? void 0 : e.verifyMode) === !0, i = o ? (n == null ? void 0 : n.verifyPin_title) ?? "Verify Your PIN" : (n == null ? void 0 : n.pinInput_title) ?? "Enter PIN", a = o ? (n == null ? void 0 : n.verifyPin_subtitle) ?? "Enter your PIN to authorize this transaction." : (n == null ? void 0 : n.pinInput_subtitle) ?? "Enter your 6-digit PIN to continue.", c = Zt(
|
|
8117
8123
|
this.tokens,
|
|
8118
|
-
|
|
8124
|
+
ot({
|
|
8119
8125
|
title: i,
|
|
8120
8126
|
headerSubtitle: a,
|
|
8121
8127
|
errorMessage: e == null ? void 0 : e.errorMessage,
|
|
@@ -8133,7 +8139,7 @@ class Zn {
|
|
|
8133
8139
|
}, w = (T) => {
|
|
8134
8140
|
h(), t(T);
|
|
8135
8141
|
}, b = c.querySelector(".__crossx-card");
|
|
8136
|
-
(y = b.querySelector("#__crossx-close-btn")) == null || y.addEventListener("click", f),
|
|
8142
|
+
(y = b.querySelector("#__crossx-close-btn")) == null || y.addEventListener("click", f), it(b, _, f, w, e == null ? void 0 : e.onSubmit, e == null ? void 0 : e.lockExpiresAt), c.addEventListener("click", (T) => {
|
|
8137
8143
|
T.target === c && f();
|
|
8138
8144
|
});
|
|
8139
8145
|
});
|
|
@@ -8327,7 +8333,7 @@ function ao(r, e) {
|
|
|
8327
8333
|
u,
|
|
8328
8334
|
h
|
|
8329
8335
|
));
|
|
8330
|
-
const f = new De(n, c), w = new Zn(r.theme ?? "light", r.themeTokens), b = e != null && e.wrapConfirmation ? e.wrapConfirmation(w) : w, y = new
|
|
8336
|
+
const f = new De(n, c), w = new Zn(r.theme ?? "light", r.themeTokens), b = e != null && e.wrapConfirmation ? e.wrapConfirmation(w) : w, y = new at(
|
|
8331
8337
|
t,
|
|
8332
8338
|
n,
|
|
8333
8339
|
i,
|
|
@@ -8402,7 +8408,7 @@ function ro(r) {
|
|
|
8402
8408
|
export {
|
|
8403
8409
|
m as CROSSxError,
|
|
8404
8410
|
Fs as CROSSxEthereumProvider,
|
|
8405
|
-
|
|
8411
|
+
at as CROSSxSDK,
|
|
8406
8412
|
io as ChainId,
|
|
8407
8413
|
p as ErrorCode,
|
|
8408
8414
|
es as PinMemoryStore,
|