@nexus-cross/crossx-sdk-core 2.0.2-beta.1 → 2.0.2-beta.3
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/README.md +225 -196
- package/dist/adapters/confirmation/BrowserConfirmationAdapter.d.ts.map +1 -1
- package/dist/crossx.global +42 -42
- package/dist/index.cjs +46 -46
- package/dist/index.js +238 -222
- package/dist/sdk/CROSSxSDK.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var
|
|
2
|
-
var Ws = (r, e, s) => e in r ?
|
|
1
|
+
var Hs = Object.defineProperty;
|
|
2
|
+
var Ws = (r, e, s) => e in r ? Hs(r, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[e] = s;
|
|
3
3
|
var P = (r, e, s) => Ws(r, typeof e != "symbol" ? e + "" : e, s);
|
|
4
4
|
import { createRemoteJWKSet as Gs, jwtVerify as qs, decodeJwt as Ks } from "jose";
|
|
5
5
|
var h = /* @__PURE__ */ ((r) => (r.AUTH_NOT_INITIALIZED = "AUTH_NOT_INITIALIZED", r.AUTH_FAILED = "AUTH_FAILED", r.AUTH_TOKEN_INVALID = "AUTH_TOKEN_INVALID", r.AUTH_TOKEN_EXPIRED = "AUTH_TOKEN_EXPIRED", r.AUTH_NOT_AUTHENTICATED = "AUTH_NOT_AUTHENTICATED", r.ALREADY_AUTHENTICATED = "ALREADY_AUTHENTICATED", r.SESSION_EXPIRED = "SESSION_EXPIRED", r.OAUTH_POPUP_BLOCKED = "OAUTH_POPUP_BLOCKED", r.WALLET_NOT_FOUND = "WALLET_NOT_FOUND", r.WALLET_CREATION_FAILED = "WALLET_CREATION_FAILED", r.WALLET_ALREADY_EXISTS = "WALLET_ALREADY_EXISTS", r.SIGN_FAILED = "SIGN_FAILED", r.SIGN_REJECTED = "SIGN_REJECTED", r.TX_FAILED = "TX_FAILED", r.TX_REJECTED = "TX_REJECTED", r.BROADCAST_FAILED = "BROADCAST_FAILED", r.USER_REJECTED = "USER_REJECTED", r.TX_INVALID_PARAMS = "TX_INVALID_PARAMS", r.NETWORK_ERROR = "NETWORK_ERROR", r.NETWORK_NOT_CONFIGURED = "NETWORK_NOT_CONFIGURED", r.INVALID_CHAIN = "INVALID_CHAIN", r.CHAIN_NOT_SUPPORTED = "CHAIN_NOT_SUPPORTED", r.CHAIN_ADAPTER_NOT_FOUND = "CHAIN_ADAPTER_NOT_FOUND", r.NOT_IMPLEMENTED = "NOT_IMPLEMENTED", r.SIGNATURE_FAILED = "SIGNATURE_FAILED", r.TRANSACTION_FAILED = "TRANSACTION_FAILED", r.PREPARE_FAILED = "PREPARE_FAILED", r.PREPARE_EXPIRED = "PREPARE_EXPIRED", r.PREPARE_MISMATCH = "PREPARE_MISMATCH", r.MIGRATION_FAILED = "MIGRATION_FAILED", r.MIGRATION_BACKUP_EXISTS = "MIGRATION_BACKUP_EXISTS", r.MIGRATION_PIN_LOCKED = "MIGRATION_PIN_LOCKED", r.GATEWAY_INTERNAL_ERROR = "GATEWAY_INTERNAL_ERROR", r.GATEWAY_LOCK_CONFLICT = "GATEWAY_LOCK_CONFLICT", r.WALLET_INCONSISTENT_STATE = "WALLET_INCONSISTENT_STATE", r.PROJECT_ID_MISSING = "PROJECT_ID_MISSING", r.ORIGIN_NOT_ALLOWED = "ORIGIN_NOT_ALLOWED", r.APP_IDENTIFIER_MISSING = "APP_IDENTIFIER_MISSING", r.INVALID_APP_TYPE = "INVALID_APP_TYPE", r.PROJECT_NOT_REGISTERED = "PROJECT_NOT_REGISTERED", r.SIGNATURE_SIGNER_MISMATCH = "SIGNATURE_SIGNER_MISMATCH", r.GAS_ESTIMATION_FAILED = "GAS_ESTIMATION_FAILED", r.TYPED_DATA_CHAIN_ID_MISMATCH = "TYPED_DATA_CHAIN_ID_MISMATCH", r.PIN_NOT_SET = "PIN_NOT_SET", r.PIN_WRONG = "PIN_WRONG", r.PIN_INVALID = "PIN_INVALID", r.PIN_REPEATED_PATTERN = "PIN_REPEATED_PATTERN", r.PIN_CANCELLED = "PIN_CANCELLED", r.EXTERNAL_WALLET_REQUESTED = "EXTERNAL_WALLET_REQUESTED", r.PIN_LOCKED = "PIN_LOCKED", r.HMAC_REQUIRED = "HMAC_REQUIRED", r.HMAC_VERIFICATION_FAILED = "HMAC_VERIFICATION_FAILED", r.WITHDRAW_FAILED = "WITHDRAW_FAILED", r.USER_NOT_FOUND = "USER_NOT_FOUND", r.INVALID_CONFIG = "INVALID_CONFIG", r.UNKNOWN_ERROR = "UNKNOWN_ERROR", r))(h || {});
|
|
@@ -82,7 +82,7 @@ const Je = {
|
|
|
82
82
|
rpcUrl: "https://saigon-testnet.roninchain.com/rpc",
|
|
83
83
|
testnet: !0
|
|
84
84
|
}
|
|
85
|
-
},
|
|
85
|
+
}, Io = Object.fromEntries(
|
|
86
86
|
Object.entries(Je).map(([r, e]) => [r, e.caipId])
|
|
87
87
|
), Xs = new Map(
|
|
88
88
|
Object.values(Je).map((r) => [r.caipId, r])
|
|
@@ -483,10 +483,10 @@ const Rt = "crossx_access_token", Ot = "crossx_refresh_token", Pt = "crossx_user
|
|
|
483
483
|
const k = await this.crypto.verifyJWT(f);
|
|
484
484
|
if (n = k.signatureVerified ?? !1, !k.valid)
|
|
485
485
|
throw d.error("[CROSSx] access_token 검증 실패"), new Error("유효하지 않은 access token");
|
|
486
|
-
const
|
|
486
|
+
const H = k.payload, M = H.email ?? E ?? s;
|
|
487
487
|
d.log(
|
|
488
488
|
"[CROSSx] email 소스 — CROSSx JWT:",
|
|
489
|
-
|
|
489
|
+
H.email ?? "(없음)",
|
|
490
490
|
"/ Firebase JWT:",
|
|
491
491
|
E ?? "(없음)",
|
|
492
492
|
"/ OAuth 콜백:",
|
|
@@ -494,7 +494,7 @@ const Rt = "crossx_access_token", Ot = "crossx_refresh_token", Pt = "crossx_user
|
|
|
494
494
|
"→",
|
|
495
495
|
M ?? "(없음)"
|
|
496
496
|
), t = {
|
|
497
|
-
id:
|
|
497
|
+
id: H.sub,
|
|
498
498
|
email: M,
|
|
499
499
|
signInProvider: b,
|
|
500
500
|
providerSub: p
|
|
@@ -1107,7 +1107,7 @@ const V = class V extends nr {
|
|
|
1107
1107
|
const s = await this.signInUseCase.executeWithOAuthToken(e);
|
|
1108
1108
|
return s.success && this.applyAuthResult(s), s;
|
|
1109
1109
|
} catch (s) {
|
|
1110
|
-
throw new x(h.AUTH_FAILED, "OAuth 토큰 로그인에 실패했습니다", s);
|
|
1110
|
+
throw s instanceof x ? s : new x(h.AUTH_FAILED, "OAuth 토큰 로그인에 실패했습니다", s);
|
|
1111
1111
|
}
|
|
1112
1112
|
}
|
|
1113
1113
|
/**
|
|
@@ -1135,7 +1135,7 @@ const V = class V extends nr {
|
|
|
1135
1135
|
const t = await this.signInUseCase.executeWithJWT(e, s);
|
|
1136
1136
|
return t.success && this.applyAuthResult(t), t;
|
|
1137
1137
|
} catch (t) {
|
|
1138
|
-
throw new x(h.AUTH_FAILED, "JWT 로그인에 실패했습니다", t);
|
|
1138
|
+
throw t instanceof x ? t : new x(h.AUTH_FAILED, "JWT 로그인에 실패했습니다", t);
|
|
1139
1139
|
}
|
|
1140
1140
|
}
|
|
1141
1141
|
async signOut() {
|
|
@@ -1824,7 +1824,7 @@ const V = class V extends nr {
|
|
|
1824
1824
|
let _, p;
|
|
1825
1825
|
const b = this.waitForTxAndGetReceipt(a, e, { intervalMs: c, timeoutMs: l }).then((A) => {
|
|
1826
1826
|
_ = A;
|
|
1827
|
-
const k = BigInt(A.gasUsed) * BigInt(A.effectiveGasPrice),
|
|
1827
|
+
const k = BigInt(A.gasUsed) * BigInt(A.effectiveGasPrice), H = s.value ? BigInt(s.value) : 0n, M = V.formatTxAmount(s.value, u.symbol, u.decimals), K = V.formatTxAmount("0x" + k.toString(16), u.symbol, u.decimals), q = V.formatTxAmount("0x" + (H + k).toString(16), u.symbol, u.decimals);
|
|
1828
1828
|
return {
|
|
1829
1829
|
chainId: e,
|
|
1830
1830
|
txHash: a,
|
|
@@ -2953,7 +2953,7 @@ function wr(r) {
|
|
|
2953
2953
|
return r;
|
|
2954
2954
|
}
|
|
2955
2955
|
const Ut = gr ? (r) => r : wr, ls = /* @ts-ignore */ typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", yr = /* @__PURE__ */ Array.from({ length: 256 }, (r, e) => e.toString(16).padStart(2, "0"));
|
|
2956
|
-
function
|
|
2956
|
+
function He(r) {
|
|
2957
2957
|
if (z(r), ls)
|
|
2958
2958
|
return r.toHex();
|
|
2959
2959
|
let e = "";
|
|
@@ -2962,7 +2962,7 @@ function Fe(r) {
|
|
|
2962
2962
|
return e;
|
|
2963
2963
|
}
|
|
2964
2964
|
const _e = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
|
|
2965
|
-
function
|
|
2965
|
+
function Ft(r) {
|
|
2966
2966
|
if (r >= _e._0 && r <= _e._9)
|
|
2967
2967
|
return r - _e._0;
|
|
2968
2968
|
if (r >= _e.A && r <= _e.F)
|
|
@@ -2980,7 +2980,7 @@ function Ve(r) {
|
|
|
2980
2980
|
throw new Error("hex string expected, got unpadded hex of length " + e);
|
|
2981
2981
|
const t = new Uint8Array(s);
|
|
2982
2982
|
for (let n = 0, o = 0; n < s; n++, o += 2) {
|
|
2983
|
-
const i =
|
|
2983
|
+
const i = Ft(r.charCodeAt(o)), a = Ft(r.charCodeAt(o + 1));
|
|
2984
2984
|
if (i === void 0 || a === void 0) {
|
|
2985
2985
|
const c = r[o] + r[o + 1];
|
|
2986
2986
|
throw new Error('hex string expected, got non-hex character "' + c + '" at index ' + o);
|
|
@@ -3092,9 +3092,9 @@ const ye = /* @__PURE__ */ Uint32Array.from([
|
|
|
3092
3092
|
2600822924,
|
|
3093
3093
|
528734635,
|
|
3094
3094
|
1541459225
|
|
3095
|
-
]), Ge = /* @__PURE__ */ BigInt(2 ** 32 - 1),
|
|
3095
|
+
]), Ge = /* @__PURE__ */ BigInt(2 ** 32 - 1), Ht = /* @__PURE__ */ BigInt(32);
|
|
3096
3096
|
function Ir(r, e = !1) {
|
|
3097
|
-
return e ? { h: Number(r & Ge), l: Number(r >>
|
|
3097
|
+
return e ? { h: Number(r & Ge), l: Number(r >> Ht & Ge) } : { h: Number(r >> Ht & Ge) | 0, l: Number(r & Ge) | 0 };
|
|
3098
3098
|
}
|
|
3099
3099
|
function Ar(r, e = !1) {
|
|
3100
3100
|
const s = r.length;
|
|
@@ -3250,10 +3250,10 @@ function ps(r) {
|
|
|
3250
3250
|
return r === "" ? mt : BigInt("0x" + r);
|
|
3251
3251
|
}
|
|
3252
3252
|
function Ze(r) {
|
|
3253
|
-
return ps(
|
|
3253
|
+
return ps(He(r));
|
|
3254
3254
|
}
|
|
3255
3255
|
function fs(r) {
|
|
3256
|
-
return ps(
|
|
3256
|
+
return ps(He(Dr(z(r)).reverse()));
|
|
3257
3257
|
}
|
|
3258
3258
|
function wt(r, e) {
|
|
3259
3259
|
we(e), r = hs(r);
|
|
@@ -3337,7 +3337,7 @@ function Wt(r) {
|
|
|
3337
3337
|
};
|
|
3338
3338
|
}
|
|
3339
3339
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
3340
|
-
const ne = /* @__PURE__ */ BigInt(0), se = /* @__PURE__ */ BigInt(1), Te = /* @__PURE__ */ BigInt(2), xs = /* @__PURE__ */ BigInt(3), gs = /* @__PURE__ */ BigInt(4), ms = /* @__PURE__ */ BigInt(5),
|
|
3340
|
+
const ne = /* @__PURE__ */ BigInt(0), se = /* @__PURE__ */ BigInt(1), Te = /* @__PURE__ */ BigInt(2), xs = /* @__PURE__ */ BigInt(3), gs = /* @__PURE__ */ BigInt(4), ms = /* @__PURE__ */ BigInt(5), Fr = /* @__PURE__ */ BigInt(7), ws = /* @__PURE__ */ BigInt(8), Hr = /* @__PURE__ */ BigInt(9), ys = /* @__PURE__ */ BigInt(16);
|
|
3341
3341
|
function ue(r, e) {
|
|
3342
3342
|
const s = r % e;
|
|
3343
3343
|
return s >= ne ? s : e + s;
|
|
@@ -3375,7 +3375,7 @@ function Wr(r, e) {
|
|
|
3375
3375
|
return St(r, a, e), a;
|
|
3376
3376
|
}
|
|
3377
3377
|
function Gr(r) {
|
|
3378
|
-
const e = Qe(r), s = Ss(r), t = s(e, e.neg(e.ONE)), n = s(e, t), o = s(e, e.neg(t)), i = (r +
|
|
3378
|
+
const e = Qe(r), s = Ss(r), t = s(e, e.neg(e.ONE)), n = s(e, t), o = s(e, e.neg(t)), i = (r + Fr) / ys;
|
|
3379
3379
|
return (a, c) => {
|
|
3380
3380
|
let l = a.pow(c, i), u = a.mul(l, t);
|
|
3381
3381
|
const f = a.mul(l, n), _ = a.mul(l, o), p = a.eql(a.sqr(u), c), b = a.eql(a.sqr(f), c);
|
|
@@ -3419,7 +3419,7 @@ function Ss(r) {
|
|
|
3419
3419
|
};
|
|
3420
3420
|
}
|
|
3421
3421
|
function qr(r) {
|
|
3422
|
-
return r % gs === xs ? bs : r % ws === ms ? Wr : r % ys ===
|
|
3422
|
+
return r % gs === xs ? bs : r % ws === ms ? Wr : r % ys === Hr ? Gr(r) : Ss(r);
|
|
3423
3423
|
}
|
|
3424
3424
|
const Kr = [
|
|
3425
3425
|
"create",
|
|
@@ -3970,8 +3970,8 @@ function nn(r, e = {}) {
|
|
|
3970
3970
|
let v;
|
|
3971
3971
|
try {
|
|
3972
3972
|
v = t.sqrt(y);
|
|
3973
|
-
} catch (
|
|
3974
|
-
const B =
|
|
3973
|
+
} catch (F) {
|
|
3974
|
+
const B = F instanceof Error ? ": " + F.message : "";
|
|
3975
3975
|
throw new Error("bad point: is not on curve, sqrt error" + B);
|
|
3976
3976
|
}
|
|
3977
3977
|
u();
|
|
@@ -3999,7 +3999,7 @@ function nn(r, e = {}) {
|
|
|
3999
3999
|
const A = t.mul(t.pow(o.a, Ke), rn), k = t.mul(t.sqr(o.b), BigInt(27));
|
|
4000
4000
|
if (t.is0(t.add(A, k)))
|
|
4001
4001
|
throw new Error("bad curve params: a or b");
|
|
4002
|
-
function
|
|
4002
|
+
function H($, g, m = !1) {
|
|
4003
4003
|
if (!t.isValid(g) || m && t.is0(g))
|
|
4004
4004
|
throw new Error(`bad point coordinate ${$}`);
|
|
4005
4005
|
return g;
|
|
@@ -4025,7 +4025,7 @@ function nn(r, e = {}) {
|
|
|
4025
4025
|
if (!t.eql(v, t.ONE))
|
|
4026
4026
|
throw new Error("invZ was invalid");
|
|
4027
4027
|
return { x: w, y };
|
|
4028
|
-
}),
|
|
4028
|
+
}), Q = Wt(($) => {
|
|
4029
4029
|
if ($.is0()) {
|
|
4030
4030
|
if (e.allowInfinityPoint && !t.is0($.Y))
|
|
4031
4031
|
return;
|
|
@@ -4049,7 +4049,7 @@ function nn(r, e = {}) {
|
|
|
4049
4049
|
P(this, "X");
|
|
4050
4050
|
P(this, "Y");
|
|
4051
4051
|
P(this, "Z");
|
|
4052
|
-
this.X =
|
|
4052
|
+
this.X = H("x", g), this.Y = H("y", m, !0), this.Z = H("z", T), Object.freeze(this);
|
|
4053
4053
|
}
|
|
4054
4054
|
static CURVE() {
|
|
4055
4055
|
return o;
|
|
@@ -4088,7 +4088,7 @@ function nn(r, e = {}) {
|
|
|
4088
4088
|
// TODO: return `this`
|
|
4089
4089
|
/** A point on curve is valid if it conforms to equation. */
|
|
4090
4090
|
assertValidity() {
|
|
4091
|
-
|
|
4091
|
+
Q(this);
|
|
4092
4092
|
}
|
|
4093
4093
|
hasEvenY() {
|
|
4094
4094
|
const { y: g } = this.toAffine();
|
|
@@ -4112,8 +4112,8 @@ function nn(r, e = {}) {
|
|
|
4112
4112
|
// Cost: 8M + 3S + 3*a + 2*b3 + 15add.
|
|
4113
4113
|
double() {
|
|
4114
4114
|
const { a: g, b: m } = o, T = t.mul(m, Ke), { X: O, Y: D, Z: w } = this;
|
|
4115
|
-
let y = t.ZERO, v = t.ZERO, I = t.ZERO, R = t.mul(O, O),
|
|
4116
|
-
return N = t.add(N, N), I = t.mul(O, w), I = t.add(I, I), y = t.mul(g, I), v = t.mul(T, B), v = t.add(y, v), y = t.sub(
|
|
4115
|
+
let y = t.ZERO, v = t.ZERO, I = t.ZERO, R = t.mul(O, O), F = t.mul(D, D), B = t.mul(w, w), N = t.mul(O, D);
|
|
4116
|
+
return N = t.add(N, N), I = t.mul(O, w), I = t.add(I, I), y = t.mul(g, I), v = t.mul(T, B), v = t.add(y, v), y = t.sub(F, v), v = t.add(F, v), v = t.mul(y, v), y = t.mul(N, y), I = t.mul(T, I), B = t.mul(g, B), N = t.sub(R, B), N = t.mul(g, N), N = t.add(N, I), I = t.add(R, R), R = t.add(I, R), R = t.add(R, B), R = t.mul(R, N), v = t.add(v, R), B = t.mul(D, w), B = t.add(B, B), R = t.mul(B, N), y = t.sub(y, R), I = t.mul(B, F), I = t.add(I, I), I = t.add(I, I), new C(y, v, I);
|
|
4117
4117
|
}
|
|
4118
4118
|
// Renes-Costello-Batina exception-free addition formula.
|
|
4119
4119
|
// There is 30% faster Jacobian formula, but it is not complete.
|
|
@@ -4123,11 +4123,11 @@ function nn(r, e = {}) {
|
|
|
4123
4123
|
M(g);
|
|
4124
4124
|
const { X: m, Y: T, Z: O } = this, { X: D, Y: w, Z: y } = g;
|
|
4125
4125
|
let v = t.ZERO, I = t.ZERO, R = t.ZERO;
|
|
4126
|
-
const
|
|
4126
|
+
const F = o.a, B = t.mul(o.b, Ke);
|
|
4127
4127
|
let N = t.mul(m, D), G = t.mul(T, w), X = t.mul(O, y), ie = t.add(m, T), j = t.add(D, w);
|
|
4128
4128
|
ie = t.mul(ie, j), j = t.add(N, G), ie = t.sub(ie, j), j = t.add(m, O);
|
|
4129
4129
|
let te = t.add(D, y);
|
|
4130
|
-
return j = t.mul(j, te), te = t.add(N, X), j = t.sub(j, te), te = t.add(T, O), v = t.add(w, y), te = t.mul(te, v), v = t.add(G, X), te = t.sub(te, v), R = t.mul(
|
|
4130
|
+
return j = t.mul(j, te), te = t.add(N, X), j = t.sub(j, te), te = t.add(T, O), v = t.add(w, y), te = t.mul(te, v), v = t.add(G, X), te = t.sub(te, v), R = t.mul(F, j), v = t.mul(B, X), R = t.add(v, R), v = t.sub(G, R), R = t.add(G, R), I = t.mul(v, R), G = t.add(N, N), G = t.add(G, N), X = t.mul(F, X), j = t.mul(B, j), G = t.add(G, X), X = t.sub(N, X), X = t.mul(F, X), j = t.add(j, X), N = t.mul(G, j), I = t.add(I, N), N = t.mul(te, j), v = t.mul(ie, v), v = t.sub(v, N), N = t.mul(ie, G), R = t.mul(te, R), R = t.add(R, N), new C(v, I, R);
|
|
4131
4131
|
}
|
|
4132
4132
|
subtract(g) {
|
|
4133
4133
|
return this.add(g.negate());
|
|
@@ -4151,8 +4151,8 @@ function nn(r, e = {}) {
|
|
|
4151
4151
|
let T, O;
|
|
4152
4152
|
const D = (w) => U.cached(this, w, (y) => Kt(C, y));
|
|
4153
4153
|
if (m) {
|
|
4154
|
-
const { k1neg: w, k1: y, k2neg: v, k2: I } = K(g), { p: R, f:
|
|
4155
|
-
O =
|
|
4154
|
+
const { k1neg: w, k1: y, k2neg: v, k2: I } = K(g), { p: R, f: F } = D(y), { p: B, f: N } = D(I);
|
|
4155
|
+
O = F.add(N), T = W(m.beta, R, B, w, v);
|
|
4156
4156
|
} else {
|
|
4157
4157
|
const { p: w, f: y } = D(g);
|
|
4158
4158
|
T = w, O = y;
|
|
@@ -4206,7 +4206,7 @@ function nn(r, e = {}) {
|
|
|
4206
4206
|
return je(g, "isCompressed"), this.assertValidity(), p(C, this, g);
|
|
4207
4207
|
}
|
|
4208
4208
|
toHex(g = !0) {
|
|
4209
|
-
return
|
|
4209
|
+
return He(this.toBytes(g));
|
|
4210
4210
|
}
|
|
4211
4211
|
toString() {
|
|
4212
4212
|
return `<Point ${this.is0() ? "ZERO" : this.toHex()}>`;
|
|
@@ -4219,7 +4219,7 @@ function nn(r, e = {}) {
|
|
|
4219
4219
|
P(C, "Fp", t), // scalar field
|
|
4220
4220
|
P(C, "Fn", n);
|
|
4221
4221
|
let J = C;
|
|
4222
|
-
const
|
|
4222
|
+
const ee = n.BITS, U = new Jr(J, e.endo ? Math.ceil(ee / 2) : ee);
|
|
4223
4223
|
return J.BASE.precompute(8), J;
|
|
4224
4224
|
}
|
|
4225
4225
|
function Ps(r) {
|
|
@@ -4308,7 +4308,7 @@ function an(r, e, s = {}) {
|
|
|
4308
4308
|
if (E)
|
|
4309
4309
|
throw new Error('"recovered" sig type is not supported for cofactor >2 curves');
|
|
4310
4310
|
}
|
|
4311
|
-
function
|
|
4311
|
+
function H(g, m) {
|
|
4312
4312
|
ft(m);
|
|
4313
4313
|
const T = p.signature, O = m === "compact" ? T : m === "recovered" ? T + 1 : void 0;
|
|
4314
4314
|
return z(g, O);
|
|
@@ -4326,7 +4326,7 @@ function an(r, e, s = {}) {
|
|
|
4326
4326
|
Object.freeze(this);
|
|
4327
4327
|
}
|
|
4328
4328
|
static fromBytes(m, T = b.format) {
|
|
4329
|
-
|
|
4329
|
+
H(m, T);
|
|
4330
4330
|
let O;
|
|
4331
4331
|
if (T === "der") {
|
|
4332
4332
|
const { r: v, s: I } = Se.toSig(z(m));
|
|
@@ -4352,7 +4352,7 @@ function an(r, e, s = {}) {
|
|
|
4352
4352
|
const { r: T, s: O } = this, D = this.assertRecovery(), w = D === 2 || D === 3 ? T + a : T;
|
|
4353
4353
|
if (!o.isValid(w))
|
|
4354
4354
|
throw new Error("invalid recovery id: sig.r+curve.n != R.x");
|
|
4355
|
-
const y = o.toBytes(w), v = r.fromBytes(ve(Ps((D & 1) === 0), y)), I = i.inv(w), R = q(z(m, void 0, "msgHash")),
|
|
4355
|
+
const y = o.toBytes(w), v = r.fromBytes(ve(Ps((D & 1) === 0), y)), I = i.inv(w), R = q(z(m, void 0, "msgHash")), F = i.create(-R * I), B = i.create(O * I), N = r.BASE.multiplyUnsafe(F).add(v.multiplyUnsafe(B));
|
|
4356
4356
|
if (N.is0())
|
|
4357
4357
|
throw new Error("invalid recovery: point at infinify");
|
|
4358
4358
|
return N.assertValidity(), N;
|
|
@@ -4368,7 +4368,7 @@ function an(r, e, s = {}) {
|
|
|
4368
4368
|
return m === "recovered" ? (k(), ve(Uint8Array.of(this.assertRecovery()), D, w)) : ve(D, w);
|
|
4369
4369
|
}
|
|
4370
4370
|
toHex(m) {
|
|
4371
|
-
return
|
|
4371
|
+
return He(this.toBytes(m));
|
|
4372
4372
|
}
|
|
4373
4373
|
}
|
|
4374
4374
|
const K = s.bits2int || function(m) {
|
|
@@ -4378,14 +4378,14 @@ function an(r, e, s = {}) {
|
|
|
4378
4378
|
return O > 0 ? T >> BigInt(O) : T;
|
|
4379
4379
|
}, q = s.bits2int_modN || function(m) {
|
|
4380
4380
|
return i.create(K(m));
|
|
4381
|
-
},
|
|
4381
|
+
}, Q = yt(c);
|
|
4382
4382
|
function W(g) {
|
|
4383
|
-
return Mr("num < 2^" + c, g, ge,
|
|
4383
|
+
return Mr("num < 2^" + c, g, ge, Q), i.toBytes(g);
|
|
4384
4384
|
}
|
|
4385
4385
|
function J(g, m) {
|
|
4386
4386
|
return z(g, void 0, "message"), m ? z(e(g), void 0, "prehashed message") : g;
|
|
4387
4387
|
}
|
|
4388
|
-
function
|
|
4388
|
+
function ee(g, m, T) {
|
|
4389
4389
|
const { lowS: O, prehash: D, extraEntropy: w } = at(T, b);
|
|
4390
4390
|
g = J(g, D);
|
|
4391
4391
|
const y = q(g), v = i.fromBytes(m);
|
|
@@ -4396,7 +4396,7 @@ function an(r, e, s = {}) {
|
|
|
4396
4396
|
const N = w === !0 ? t(p.secretKey) : w;
|
|
4397
4397
|
I.push(z(N, void 0, "extraEntropy"));
|
|
4398
4398
|
}
|
|
4399
|
-
const R = ve(...I),
|
|
4399
|
+
const R = ve(...I), F = y;
|
|
4400
4400
|
function B(N) {
|
|
4401
4401
|
const G = K(N);
|
|
4402
4402
|
if (!i.isValidNot0(G))
|
|
@@ -4404,7 +4404,7 @@ function an(r, e, s = {}) {
|
|
|
4404
4404
|
const X = i.inv(G), ie = r.BASE.multiply(G).toAffine(), j = i.create(ie.x);
|
|
4405
4405
|
if (j === ge)
|
|
4406
4406
|
return;
|
|
4407
|
-
const te = i.create(X * i.create(
|
|
4407
|
+
const te = i.create(X * i.create(F + j * v));
|
|
4408
4408
|
if (te === ge)
|
|
4409
4409
|
return;
|
|
4410
4410
|
let At = (ie.x === j ? 0 : 2) | Number(ie.y & Ce), Tt = te;
|
|
@@ -4413,7 +4413,7 @@ function an(r, e, s = {}) {
|
|
|
4413
4413
|
return { seed: R, k2sig: B };
|
|
4414
4414
|
}
|
|
4415
4415
|
function U(g, m, T = {}) {
|
|
4416
|
-
const { seed: O, k2sig: D } =
|
|
4416
|
+
const { seed: O, k2sig: D } = ee(g, m, T);
|
|
4417
4417
|
return Ur(e.outputLen, i.BYTES, n)(O, D).toBytes(T.format);
|
|
4418
4418
|
}
|
|
4419
4419
|
function C(g, m, T, O = {}) {
|
|
@@ -4422,12 +4422,12 @@ function an(r, e, s = {}) {
|
|
|
4422
4422
|
const v = g instanceof M ? ", use sig.toBytes()" : "";
|
|
4423
4423
|
throw new Error("verify expects Uint8Array signature" + v);
|
|
4424
4424
|
}
|
|
4425
|
-
|
|
4425
|
+
H(g, y);
|
|
4426
4426
|
try {
|
|
4427
4427
|
const v = M.fromBytes(g, y), I = r.fromBytes(T);
|
|
4428
4428
|
if (D && v.hasHighS())
|
|
4429
4429
|
return !1;
|
|
4430
|
-
const { r: R, s:
|
|
4430
|
+
const { r: R, s: F } = v, B = q(m), N = i.inv(F), G = i.create(B * N), X = i.create(R * N), ie = r.BASE.multiplyUnsafe(G).add(I.multiplyUnsafe(X));
|
|
4431
4431
|
return ie.is0() ? !1 : i.create(ie.x) === R;
|
|
4432
4432
|
} catch {
|
|
4433
4433
|
return !1;
|
|
@@ -4468,7 +4468,7 @@ const vt = {
|
|
|
4468
4468
|
]
|
|
4469
4469
|
}, Xt = /* @__PURE__ */ BigInt(2);
|
|
4470
4470
|
function ln(r) {
|
|
4471
|
-
const e = vt.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, f = ce(u, s, e) * u % e, _ = ce(f, s, e) * u % e, p = ce(_, Xt, e) * l % e, b = ce(p, n, e) * p % e, E = ce(b, o, e) * b % e, S = ce(E, a, e) * E % e, A = ce(S, c, e) * S % e, k = ce(A, a, e) * E % e,
|
|
4471
|
+
const e = vt.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, f = ce(u, s, e) * u % e, _ = ce(f, s, e) * u % e, p = ce(_, Xt, e) * l % e, b = ce(p, n, e) * p % e, E = ce(b, o, e) * b % e, S = ce(E, a, e) * E % e, A = ce(S, c, e) * S % e, k = ce(A, a, e) * E % e, H = ce(k, s, e) * u % e, M = ce(H, i, e) * b % e, K = ce(M, t, e) * l % e, q = ce(K, Xt, e);
|
|
4472
4472
|
if (!_t.eql(_t.sqr(q), r))
|
|
4473
4473
|
throw new Error("Cannot find square root");
|
|
4474
4474
|
return q;
|
|
@@ -4658,7 +4658,7 @@ ${t.length}`
|
|
|
4658
4658
|
es(l),
|
|
4659
4659
|
es(u)
|
|
4660
4660
|
).addRecoveryBit(_).recoverPublicKey(i).toBytes(!1).slice(1), S = Qt(E);
|
|
4661
|
-
return "0x" +
|
|
4661
|
+
return "0x" + He(S.slice(12));
|
|
4662
4662
|
}
|
|
4663
4663
|
}
|
|
4664
4664
|
function vn(r) {
|
|
@@ -4807,12 +4807,12 @@ class Ie {
|
|
|
4807
4807
|
}, 5 * 60 * 1e3), b = 10, E = 30;
|
|
4808
4808
|
let S = 0, A = null;
|
|
4809
4809
|
const k = () => {
|
|
4810
|
-
clearInterval(
|
|
4810
|
+
clearInterval(H), d.warn("[CROSSx] COOP 감지 — OAuth 서버 응답을 " + E + "초간 대기합니다"), A = setTimeout(() => {
|
|
4811
4811
|
M(), t(new Error(
|
|
4812
4812
|
"OAuth 서버로부터 응답을 받지 못했습니다. 브라우저 보안 정책(COOP)으로 인해 팝업 통신이 차단되었을 수 있습니다. 다시 시도해 주세요."
|
|
4813
4813
|
));
|
|
4814
4814
|
}, E * 1e3);
|
|
4815
|
-
},
|
|
4815
|
+
}, H = setInterval(() => {
|
|
4816
4816
|
S++;
|
|
4817
4817
|
try {
|
|
4818
4818
|
_.closed && (S <= b ? k() : (M(), t(new Error("로그인이 취소되었습니다"))));
|
|
@@ -4820,7 +4820,7 @@ class Ie {
|
|
|
4820
4820
|
k();
|
|
4821
4821
|
}
|
|
4822
4822
|
}, 1e3), M = () => {
|
|
4823
|
-
clearTimeout(p), clearInterval(
|
|
4823
|
+
clearTimeout(p), clearInterval(H), A && clearTimeout(A), window.removeEventListener("message", K);
|
|
4824
4824
|
}, K = (q) => {
|
|
4825
4825
|
if (q.origin !== e.expectedOrigin) return;
|
|
4826
4826
|
if (!Tn.has(q.origin)) {
|
|
@@ -4828,28 +4828,28 @@ class Ie {
|
|
|
4828
4828
|
return;
|
|
4829
4829
|
}
|
|
4830
4830
|
M();
|
|
4831
|
-
const
|
|
4831
|
+
const Q = typeof q.data.status == "string", W = Q ? q.data.data ?? {} : q.data;
|
|
4832
4832
|
d.log("[CROSSx] OAuth postMessage 수신 —", {
|
|
4833
|
-
format:
|
|
4834
|
-
status:
|
|
4833
|
+
format: Q ? "wrapped" : "flat",
|
|
4834
|
+
status: Q ? q.data.status : "(flat)"
|
|
4835
4835
|
});
|
|
4836
4836
|
const J = (W == null ? void 0 : W.state) ?? q.data.state;
|
|
4837
4837
|
if (!J || J !== c) {
|
|
4838
4838
|
t(new Error("OAuth state mismatch — possible CSRF attack"));
|
|
4839
4839
|
return;
|
|
4840
4840
|
}
|
|
4841
|
-
if (
|
|
4841
|
+
if (Q && q.data.status !== "success") {
|
|
4842
4842
|
d.error("[CROSSx] OAuth 실패:", W == null ? void 0 : W.error), t(new Error((W == null ? void 0 : W.error) || "Authentication failed"));
|
|
4843
4843
|
return;
|
|
4844
4844
|
}
|
|
4845
|
-
if (!
|
|
4845
|
+
if (!Q && (W != null && W.error)) {
|
|
4846
4846
|
d.error("[CROSSx] OAuth 실패:", W.error), t(new Error(W.error || "Authentication failed"));
|
|
4847
4847
|
return;
|
|
4848
4848
|
}
|
|
4849
|
-
const
|
|
4849
|
+
const ee = W == null ? void 0 : W.idToken, U = W == null ? void 0 : W.accessToken, C = U ?? ee, $ = (W == null ? void 0 : W.email) || void 0;
|
|
4850
4850
|
if (d.log("[CROSSx] OAuth 토큰 수신:", {
|
|
4851
4851
|
hasAccessToken: !!U,
|
|
4852
|
-
hasIdToken: !!
|
|
4852
|
+
hasIdToken: !!ee,
|
|
4853
4853
|
hasEmail: !!$
|
|
4854
4854
|
}), !C) {
|
|
4855
4855
|
d.error("[CROSSx] 토큰을 찾을 수 없음:", q.data), t(new Error("Token not found in response"));
|
|
@@ -4860,10 +4860,10 @@ class Ie {
|
|
|
4860
4860
|
d.error("[CROSSx] nonce 검증 실패:", O), t(O instanceof Error ? O : new Error("nonce verification failed"));
|
|
4861
4861
|
});
|
|
4862
4862
|
};
|
|
4863
|
-
U ? U.split(".").length === 3 ? m(U) :
|
|
4863
|
+
U ? U.split(".").length === 3 ? m(U) : ee ? m(ee) : (d.warn(
|
|
4864
4864
|
"[CROSSx] opaque accessToken만 수신 (idToken 없음) — nonce 검증 불가.",
|
|
4865
4865
|
"서버 측 nonce 검증이 필요합니다."
|
|
4866
|
-
), s(g)) :
|
|
4866
|
+
), s(g)) : ee ? m(ee) : t(new Error("Token not found in response"));
|
|
4867
4867
|
};
|
|
4868
4868
|
window.addEventListener("message", K);
|
|
4869
4869
|
});
|
|
@@ -5103,8 +5103,8 @@ class Ae {
|
|
|
5103
5103
|
h.USER_NOT_FOUND,
|
|
5104
5104
|
Ae.getGatewayErrorMessage(p.code, b)
|
|
5105
5105
|
);
|
|
5106
|
-
const S = E === h.AUTH_NOT_AUTHENTICATED ? h.SESSION_EXPIRED : E, A = S === h.SESSION_EXPIRED ? "인증 세션이 만료되었습니다. 다시 로그인해 주세요." : Ae.getGatewayErrorMessage(p.code, b), k = p.data,
|
|
5107
|
-
throw new x(S, A,
|
|
5106
|
+
const S = E === h.AUTH_NOT_AUTHENTICATED ? h.SESSION_EXPIRED : E, A = S === h.SESSION_EXPIRED ? "인증 세션이 만료되었습니다. 다시 로그인해 주세요." : Ae.getGatewayErrorMessage(p.code, b), k = p.data, H = E === h.PIN_LOCKED ? Ae.extractLockDetails(k) : k ?? void 0;
|
|
5107
|
+
throw new x(S, A, H);
|
|
5108
5108
|
}
|
|
5109
5109
|
return d.log("[CROSSx] Wallet Gateway API 성공:", { code: p.code, url: i, method: e }), p.data ?? p;
|
|
5110
5110
|
}
|
|
@@ -5498,7 +5498,7 @@ class Ae {
|
|
|
5498
5498
|
}
|
|
5499
5499
|
}
|
|
5500
5500
|
}
|
|
5501
|
-
class
|
|
5501
|
+
class Fe {
|
|
5502
5502
|
constructor(e, s) {
|
|
5503
5503
|
this.cache = /* @__PURE__ */ new Map(), this.loadedAt = 0, this.usingFallback = !1, this._fetchPromise = null, this.adapterConfig = e, this.projectId = e.projectId, this.transport = s;
|
|
5504
5504
|
}
|
|
@@ -5519,7 +5519,7 @@ class He {
|
|
|
5519
5519
|
const s = e.data.chains;
|
|
5520
5520
|
return this.populateCache(s, !1), s;
|
|
5521
5521
|
} catch {
|
|
5522
|
-
const e =
|
|
5522
|
+
const e = Fe.fallbackChains();
|
|
5523
5523
|
return this.populateCache(e, !0), e;
|
|
5524
5524
|
}
|
|
5525
5525
|
}
|
|
@@ -5555,13 +5555,13 @@ class He {
|
|
|
5555
5555
|
if (e.code < 0) {
|
|
5556
5556
|
const s = typeof e.data == "string" ? e.data : e.message ?? "체인 레지스트리 요청에 실패했습니다";
|
|
5557
5557
|
throw new x(
|
|
5558
|
-
|
|
5558
|
+
Fe.mapErrorCode(e.code),
|
|
5559
5559
|
s
|
|
5560
5560
|
);
|
|
5561
5561
|
}
|
|
5562
5562
|
}
|
|
5563
5563
|
fallbackOrThrow(e) {
|
|
5564
|
-
const s =
|
|
5564
|
+
const s = Fe.fallbackChains().find(
|
|
5565
5565
|
(t) => t.chainId === e
|
|
5566
5566
|
);
|
|
5567
5567
|
if (s) return s;
|
|
@@ -5595,7 +5595,7 @@ class He {
|
|
|
5595
5595
|
}
|
|
5596
5596
|
}
|
|
5597
5597
|
}
|
|
5598
|
-
const ts = "__crossx-confirm-style",
|
|
5598
|
+
const ts = "__crossx-confirm-style", Z = "__crossx-confirm-overlay", Rn = {
|
|
5599
5599
|
light: {
|
|
5600
5600
|
bg: "#FFFFFF",
|
|
5601
5601
|
border: "rgba(18,18,18,0.05)",
|
|
@@ -5687,7 +5687,7 @@ function ss(r, e) {
|
|
|
5687
5687
|
const On = `
|
|
5688
5688
|
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600&display=swap');
|
|
5689
5689
|
|
|
5690
|
-
#${
|
|
5690
|
+
#${Z} {
|
|
5691
5691
|
position: fixed;
|
|
5692
5692
|
inset: 0;
|
|
5693
5693
|
z-index: 2147483647;
|
|
@@ -7008,7 +7008,7 @@ button.__crossx-connect-other-block:active {
|
|
|
7008
7008
|
}
|
|
7009
7009
|
/* ── Mobile bottom sheet ───────────────────────────────────── */
|
|
7010
7010
|
@media (max-width: 480px) {
|
|
7011
|
-
#${
|
|
7011
|
+
#${Z} { align-items: flex-end; }
|
|
7012
7012
|
.__crossx-safe-area-fill {
|
|
7013
7013
|
display: block;
|
|
7014
7014
|
position: fixed;
|
|
@@ -7216,7 +7216,7 @@ button.__crossx-connect-other-block:active {
|
|
|
7216
7216
|
|
|
7217
7217
|
/* ── Landscape for signing/transaction modals ──────────── */
|
|
7218
7218
|
@media (orientation: landscape) and (max-height: 500px) {
|
|
7219
|
-
#${
|
|
7219
|
+
#${Z} { align-items: center !important; overflow: hidden; }
|
|
7220
7220
|
.__crossx-card--send-tx,
|
|
7221
7221
|
.__crossx-card--sign-tx,
|
|
7222
7222
|
.__crossx-card--sign-msg,
|
|
@@ -7716,38 +7716,54 @@ function le() {
|
|
|
7716
7716
|
let r = document.getElementById(ts);
|
|
7717
7717
|
r || (r = document.createElement("style"), r.id = ts, document.head.appendChild(r)), r.textContent = On;
|
|
7718
7718
|
}
|
|
7719
|
+
function Pn() {
|
|
7720
|
+
const r = `#${Z}`, e = (t) => {
|
|
7721
|
+
var n, o;
|
|
7722
|
+
(o = (n = t.target) == null ? void 0 : n.closest) != null && o.call(n, r) && t.stopImmediatePropagation();
|
|
7723
|
+
}, s = (t) => {
|
|
7724
|
+
var n, o;
|
|
7725
|
+
(o = (n = t.relatedTarget) == null ? void 0 : n.closest) != null && o.call(n, r) && t.stopImmediatePropagation();
|
|
7726
|
+
};
|
|
7727
|
+
return document.addEventListener("focusin", e, !0), document.addEventListener("focusout", s, !0), () => {
|
|
7728
|
+
document.removeEventListener("focusin", e, !0), document.removeEventListener("focusout", s, !0);
|
|
7729
|
+
};
|
|
7730
|
+
}
|
|
7719
7731
|
function de(r) {
|
|
7720
7732
|
const e = r.querySelector(".__crossx-card");
|
|
7721
7733
|
if (e) {
|
|
7722
|
-
const
|
|
7723
|
-
if (
|
|
7724
|
-
const
|
|
7725
|
-
r.style.setProperty("--cx-bg",
|
|
7726
|
-
const
|
|
7727
|
-
|
|
7734
|
+
const i = (e.getAttribute("style") ?? "").match(/--cx-bg:\s*([^;]+)/);
|
|
7735
|
+
if (i) {
|
|
7736
|
+
const a = i[1].trim();
|
|
7737
|
+
r.style.setProperty("--cx-bg", a);
|
|
7738
|
+
const c = document.createElement("div");
|
|
7739
|
+
c.className = "__crossx-safe-area-fill", c.style.background = a, r.appendChild(c);
|
|
7728
7740
|
}
|
|
7729
7741
|
}
|
|
7730
|
-
const s = (
|
|
7731
|
-
for (const
|
|
7732
|
-
r.addEventListener(
|
|
7742
|
+
const s = (o) => o.stopPropagation();
|
|
7743
|
+
for (const o of ["pointerdown", "pointerup", "mousedown", "mouseup", "click"])
|
|
7744
|
+
r.addEventListener(o, s);
|
|
7733
7745
|
r.setAttribute("data-vaul-no-drag", "");
|
|
7734
|
-
for (const
|
|
7735
|
-
r.addEventListener(
|
|
7736
|
-
r.addEventListener("touchmove", (
|
|
7737
|
-
|
|
7738
|
-
let
|
|
7739
|
-
for (;
|
|
7740
|
-
const
|
|
7741
|
-
if ((
|
|
7746
|
+
for (const o of ["touchstart", "touchend"])
|
|
7747
|
+
r.addEventListener(o, s);
|
|
7748
|
+
r.addEventListener("touchmove", (o) => {
|
|
7749
|
+
o.stopPropagation();
|
|
7750
|
+
let i = o.target;
|
|
7751
|
+
for (; i && i !== r; ) {
|
|
7752
|
+
const a = window.getComputedStyle(i);
|
|
7753
|
+
if ((a.overflowY === "auto" || a.overflowY === "scroll") && i.scrollHeight > i.clientHeight)
|
|
7742
7754
|
return;
|
|
7743
|
-
|
|
7755
|
+
i = i.parentElement;
|
|
7744
7756
|
}
|
|
7745
|
-
|
|
7746
|
-
}, { passive: !1 })
|
|
7757
|
+
o.preventDefault();
|
|
7758
|
+
}, { passive: !1 });
|
|
7759
|
+
const t = Pn(), n = r.remove.bind(r);
|
|
7760
|
+
r.remove = () => {
|
|
7761
|
+
t(), n();
|
|
7762
|
+
}, document.body.appendChild(r);
|
|
7747
7763
|
}
|
|
7748
|
-
const
|
|
7764
|
+
const Cn = () => /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
|
|
7749
7765
|
function Oe() {
|
|
7750
|
-
if (
|
|
7766
|
+
if (Cn()) {
|
|
7751
7767
|
const e = window.scrollY;
|
|
7752
7768
|
return document.body.style.position = "fixed", document.body.style.top = `-${e}px`, document.body.style.left = "0", document.body.style.right = "0", () => {
|
|
7753
7769
|
document.body.style.position = "", document.body.style.top = "", document.body.style.left = "", document.body.style.right = "", window.scrollTo(0, e);
|
|
@@ -7812,18 +7828,18 @@ function ct(r) {
|
|
|
7812
7828
|
return r;
|
|
7813
7829
|
}
|
|
7814
7830
|
}
|
|
7815
|
-
function
|
|
7831
|
+
function Nn(r) {
|
|
7816
7832
|
try {
|
|
7817
7833
|
return BigInt(r).toLocaleString();
|
|
7818
7834
|
} catch {
|
|
7819
7835
|
return r;
|
|
7820
7836
|
}
|
|
7821
7837
|
}
|
|
7822
|
-
function
|
|
7838
|
+
function Ln(r) {
|
|
7823
7839
|
const { gasLimit: e, gasPrice: s, maxFeePerGas: t, maxPriorityFeePerGas: n, nativeSymbol: o = "ETH", nativeDecimals: i = 18 } = r;
|
|
7824
7840
|
if (!e) return null;
|
|
7825
7841
|
try {
|
|
7826
|
-
const a = BigInt(e), c =
|
|
7842
|
+
const a = BigInt(e), c = Nn(e);
|
|
7827
7843
|
if (t) {
|
|
7828
7844
|
const l = a * BigInt(t);
|
|
7829
7845
|
return {
|
|
@@ -7849,7 +7865,7 @@ function Nn(r) {
|
|
|
7849
7865
|
}
|
|
7850
7866
|
}
|
|
7851
7867
|
function Us(r) {
|
|
7852
|
-
const e =
|
|
7868
|
+
const e = Ln(r);
|
|
7853
7869
|
if (!e) return Y("Estimated fee", "<span>—</span>");
|
|
7854
7870
|
let s = Y("Est. Tx Fee", `<span>${e.estTxFee}</span>`);
|
|
7855
7871
|
return e.isDynamic ? (e.maxPriorityFeeGwei !== void 0 && (s += Y("Max Priority Fee", `<span>${e.maxPriorityFeeGwei} Gwei</span>`)), e.maxFeeGwei !== void 0 && (s += Y("Max Gas Fee", `<span>${e.maxFeeGwei} Gwei</span>`))) : e.gasPriceGwei !== void 0 && (s += Y("Gas Price", `<span>${e.gasPriceGwei} Gwei</span>`)), e.gasLimitFormatted && (s += Y("Gas Limit", `<span>${e.gasLimitFormatted}</span>`)), s;
|
|
@@ -7860,18 +7876,18 @@ const me = `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="
|
|
|
7860
7876
|
</svg>`, oe = `<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round">
|
|
7861
7877
|
<line x1="18" y1="6" x2="6" y2="18"/>
|
|
7862
7878
|
<line x1="6" y1="6" x2="18" y2="18"/>
|
|
7863
|
-
</svg>`,
|
|
7879
|
+
</svg>`, Dn = `<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
7864
7880
|
<circle cx="20" cy="20" r="20" fill="#00D5AA"/>
|
|
7865
7881
|
<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"/>
|
|
7866
|
-
</svg>`,
|
|
7867
|
-
[Ue.MetaMask]:
|
|
7868
|
-
[Ue.Binance]:
|
|
7869
|
-
[Ue.CROSSx]:
|
|
7882
|
+
</svg>`, $n = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 318.6 318.6" aria-hidden="true"><style>.st1,.st6{fill:#e4761b;stroke:#e4761b;stroke-linecap:round;stroke-linejoin:round}.st6{fill:#f6851b;stroke:#f6851b}</style><path fill="#e2761b" stroke="#e2761b" stroke-linecap="round" stroke-linejoin="round" d="m274.1 35.5-99.5 73.9L193 65.8z"/><path d="m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z" class="st1"/><path d="m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z" class="st1"/><path fill="#d7c1b3" stroke="#d7c1b3" stroke-linecap="round" stroke-linejoin="round" d="m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"/><path fill="#233447" stroke="#233447" stroke-linecap="round" stroke-linejoin="round" d="m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"/><path fill="#cd6116" stroke="#cd6116" stroke-linecap="round" stroke-linejoin="round" d="m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"/><path fill="#e4751f" stroke="#e4751f" stroke-linecap="round" stroke-linejoin="round" d="m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"/><path d="m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z" class="st6"/><path fill="#c0ad9e" stroke="#c0ad9e" stroke-linecap="round" stroke-linejoin="round" d="m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"/><path fill="#161616" stroke="#161616" stroke-linecap="round" stroke-linejoin="round" d="m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"/><path fill="#763d16" stroke="#763d16" stroke-linecap="round" stroke-linejoin="round" d="m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"/><path d="m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z" class="st6"/></svg>', Mn = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 126.611 126.611" aria-hidden="true"><polygon fill="#F3BA2F" points="38.171,53.203 62.759,28.616 87.36,53.216 101.667,38.909 62.759,0 23.864,38.896 "/><rect x="3.644" y="53.188" transform="matrix(0.7071 0.7071 -0.7071 0.7071 48.7933 8.8106)" fill="#F3BA2F" width="20.233" height="20.234"/><polygon fill="#F3BA2F" points="38.171,73.408 62.759,97.995 87.359,73.396 101.674,87.695 101.667,87.703 62.759,126.611 23.863,87.716 23.843,87.696 "/><rect x="101.64" y="53.189" transform="matrix(-0.7071 0.7071 -0.7071 -0.7071 235.5457 29.0503)" fill="#F3BA2F" width="20.234" height="20.233"/><polygon fill="#F3BA2F" points="77.271,63.298 77.277,63.298 62.759,48.78 52.03,59.509 52.029,59.509 50.797,60.742 48.254,63.285 48.254,63.285 48.234,63.305 48.254,63.326 62.759,77.831 77.277,63.313 77.284,63.305 "/></svg>', Bn = '<svg width="16" height="16" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><circle cx="20" cy="20" r="20" fill="#00D5AA"/><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"/></svg>', Un = {
|
|
7883
|
+
[Ue.MetaMask]: $n,
|
|
7884
|
+
[Ue.Binance]: Mn,
|
|
7885
|
+
[Ue.CROSSx]: Bn
|
|
7870
7886
|
}, It = `<svg width="20" height="20" viewBox="0 0 20 20" fill="none">
|
|
7871
7887
|
<rect x="2" y="5" width="16" height="12" rx="2" stroke="currentColor" stroke-width="1.5"/>
|
|
7872
7888
|
<path d="M2 9h16" stroke="currentColor" stroke-width="1.5"/>
|
|
7873
7889
|
<rect x="12.5" y="11.5" width="3.5" height="2.5" rx="0.75" fill="currentColor"/>
|
|
7874
|
-
</svg>`,
|
|
7890
|
+
</svg>`, Fn = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
7875
7891
|
<path d="M12 0C18.6274 0 24 5.37258 24 12C23.9999 18.6273 18.6274 24 12 24C5.37264 24 9.89594e-05 18.6273 0 12C0 5.37258 5.37258 0 12 0ZM10.875 15.127V17.377H13.125V15.127H10.875ZM10.875 6.62207V13.627H13.125V6.62207H10.875Z" fill="var(--cx-error)"/>
|
|
7876
7892
|
</svg>`, Hn = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
7877
7893
|
<circle cx="12" cy="12" r="12" fill="var(--cx-error)"/>
|
|
@@ -7911,10 +7927,10 @@ function Y(r, e) {
|
|
|
7911
7927
|
<div class="__crossx-row-value">${e}</div>
|
|
7912
7928
|
</div>`;
|
|
7913
7929
|
}
|
|
7914
|
-
function
|
|
7930
|
+
function Wn(r, e) {
|
|
7915
7931
|
const s = e, t = r.nativeSymbol ?? "ETH", n = r.nativeDecimals ?? 18, o = et(r.dappName), i = r.to ? `<span class="__crossx-addr-text">${re(r.to)}</span>
|
|
7916
7932
|
<button class="__crossx-copy-btn" data-copy="${L(r.to)}" title="Copy address">${me}</button>` : "<span>—</span>", a = Us(r), c = Ms(r.value, t, n), l = c ? Y("Value", `<span>${c}</span>`) : "", u = r.data ?? "0x", f = document.createElement("div");
|
|
7917
|
-
return f.id =
|
|
7933
|
+
return f.id = Z, f.innerHTML = `
|
|
7918
7934
|
<div class="__crossx-card __crossx-card--migration __crossx-card--sign-tx" style="${ae(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
7919
7935
|
<div class="__crossx-header">
|
|
7920
7936
|
<p class="__crossx-title" id="__crossx-ttl">Signature Request</p>
|
|
@@ -7952,10 +7968,10 @@ function Fn(r, e) {
|
|
|
7952
7968
|
</div>
|
|
7953
7969
|
`, f;
|
|
7954
7970
|
}
|
|
7955
|
-
function
|
|
7971
|
+
function Gn(r, e) {
|
|
7956
7972
|
const s = e, t = r.nativeSymbol ?? "ETH", n = r.nativeDecimals ?? 18, o = et(r.dappName), i = r.to ? `<span class="__crossx-addr-text">${re(r.to)}</span>
|
|
7957
7973
|
<button class="__crossx-copy-btn" data-copy="${L(r.to)}" title="Copy address">${me}</button>` : "<span>—</span>", a = Us(r), l = Ms(r.value, t, n) ?? "—", u = document.createElement("div");
|
|
7958
|
-
return u.id =
|
|
7974
|
+
return u.id = Z, u.innerHTML = `
|
|
7959
7975
|
<div class="__crossx-card __crossx-card--migration __crossx-card--send-tx" style="${ae(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
7960
7976
|
<div class="__crossx-header">
|
|
7961
7977
|
<p class="__crossx-title" id="__crossx-ttl">Approve transaction</p>
|
|
@@ -7994,10 +8010,10 @@ function et(r) {
|
|
|
7994
8010
|
function L(r) {
|
|
7995
8011
|
return r.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
7996
8012
|
}
|
|
7997
|
-
function
|
|
8013
|
+
function qn(r) {
|
|
7998
8014
|
return typeof r == "string" && /^0x[0-9a-fA-F]{40}$/i.test(r);
|
|
7999
8015
|
}
|
|
8000
|
-
function
|
|
8016
|
+
function Kn(r) {
|
|
8001
8017
|
if (typeof r == "string") return L(r);
|
|
8002
8018
|
if (typeof r == "number" || typeof r == "bigint" || typeof r == "boolean") return String(r);
|
|
8003
8019
|
try {
|
|
@@ -8006,7 +8022,7 @@ function qn(r) {
|
|
|
8006
8022
|
return String(r);
|
|
8007
8023
|
}
|
|
8008
8024
|
}
|
|
8009
|
-
function
|
|
8025
|
+
function zn(r, e) {
|
|
8010
8026
|
const s = Y(
|
|
8011
8027
|
"From",
|
|
8012
8028
|
`<span class="__crossx-addr-text">${re(r.from)}</span>
|
|
@@ -8017,7 +8033,7 @@ function Kn(r, e) {
|
|
|
8017
8033
|
<span class="__crossx-total-label">Total<br>(including fees)</span>
|
|
8018
8034
|
<span class="__crossx-total-amount">${L(r.total)}</span>
|
|
8019
8035
|
</div>` : "", c = document.createElement("div");
|
|
8020
|
-
return c.id =
|
|
8036
|
+
return c.id = Z, c.innerHTML = `
|
|
8021
8037
|
<div class="__crossx-card __crossx-card--migration" style="${ae(e)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8022
8038
|
<div class="__crossx-header">
|
|
8023
8039
|
<p class="__crossx-title" id="__crossx-ttl">Transaction complete</p>
|
|
@@ -8038,9 +8054,9 @@ function Kn(r, e) {
|
|
|
8038
8054
|
</div>
|
|
8039
8055
|
`, c;
|
|
8040
8056
|
}
|
|
8041
|
-
function
|
|
8057
|
+
function Vn(r, e) {
|
|
8042
8058
|
const s = document.createElement("div");
|
|
8043
|
-
return s.id =
|
|
8059
|
+
return s.id = Z, s.innerHTML = `
|
|
8044
8060
|
<div class="__crossx-card __crossx-card--migration" style="${ae(e)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8045
8061
|
<div class="__crossx-header">
|
|
8046
8062
|
<p class="__crossx-title" id="__crossx-ttl">Waiting for confirmation</p>
|
|
@@ -8055,10 +8071,10 @@ function zn(r, e) {
|
|
|
8055
8071
|
</div>
|
|
8056
8072
|
`, s;
|
|
8057
8073
|
}
|
|
8058
|
-
function
|
|
8074
|
+
function jn(r, e, s) {
|
|
8059
8075
|
const t = e.status !== "reverted" && e.status !== "timeout", n = e.status === "timeout", o = r.querySelector("#__crossx-ttl"), i = r.querySelector(".__crossx-header");
|
|
8060
8076
|
if (o) {
|
|
8061
|
-
const b = n ? Hn : t ? "" :
|
|
8077
|
+
const b = n ? Hn : t ? "" : Fn, E = n ? "Transaction timeout" : t ? "Transaction complete" : "Transaction failed";
|
|
8062
8078
|
b ? (o.style.display = "flex", o.style.alignItems = "center", o.style.gap = "8px", o.innerHTML = `${b}<span>${E}</span>`) : o.textContent = E;
|
|
8063
8079
|
}
|
|
8064
8080
|
if (i && !r.querySelector("#__crossx-close-btn")) {
|
|
@@ -8094,9 +8110,9 @@ function Vn(r, e, s) {
|
|
|
8094
8110
|
});
|
|
8095
8111
|
});
|
|
8096
8112
|
}
|
|
8097
|
-
function
|
|
8113
|
+
function Yn(r, e) {
|
|
8098
8114
|
const s = e, t = et(r.dappName), n = L(r.message), o = document.createElement("div");
|
|
8099
|
-
return o.id =
|
|
8115
|
+
return o.id = Z, o.innerHTML = `
|
|
8100
8116
|
<div class="__crossx-card __crossx-card--migration __crossx-card--sign-msg" style="${ae(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8101
8117
|
<div class="__crossx-header">
|
|
8102
8118
|
<p class="__crossx-title" id="__crossx-ttl">Signature Request</p>
|
|
@@ -8126,7 +8142,7 @@ function jn(r, e) {
|
|
|
8126
8142
|
</div>
|
|
8127
8143
|
`, o;
|
|
8128
8144
|
}
|
|
8129
|
-
function
|
|
8145
|
+
function Xn(r, e) {
|
|
8130
8146
|
const s = e, t = et(r.dappName);
|
|
8131
8147
|
let n = {};
|
|
8132
8148
|
if (typeof r.typedData == "string")
|
|
@@ -8142,7 +8158,7 @@ function Yn(r, e) {
|
|
|
8142
8158
|
<span class="__crossx-td-value">${L(o)}</span>
|
|
8143
8159
|
</div>`;
|
|
8144
8160
|
for (const [l, u] of Object.entries(i)) {
|
|
8145
|
-
const f =
|
|
8161
|
+
const f = Kn(u), p = qn(u) ? `<span class="__crossx-addr-text">${re(u)}</span>
|
|
8146
8162
|
<button class="__crossx-copy-btn" data-copy="${L(String(u))}" title="Copy">${me}</button>` : `<span>${f}</span>`;
|
|
8147
8163
|
a += `
|
|
8148
8164
|
<div class="__crossx-td-row">
|
|
@@ -8151,7 +8167,7 @@ function Yn(r, e) {
|
|
|
8151
8167
|
</div>`;
|
|
8152
8168
|
}
|
|
8153
8169
|
const c = document.createElement("div");
|
|
8154
|
-
return c.id =
|
|
8170
|
+
return c.id = Z, c.innerHTML = `
|
|
8155
8171
|
<div class="__crossx-card __crossx-card--migration __crossx-card--sign-typed" style="${ae(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8156
8172
|
<div class="__crossx-header">
|
|
8157
8173
|
<p class="__crossx-title" id="__crossx-ttl">Signature Request</p>
|
|
@@ -8181,18 +8197,18 @@ function Yn(r, e) {
|
|
|
8181
8197
|
</div>
|
|
8182
8198
|
`, c;
|
|
8183
8199
|
}
|
|
8184
|
-
const
|
|
8200
|
+
const Jn = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
|
|
8185
8201
|
<line x1="12" y1="5" x2="12" y2="19"/>
|
|
8186
8202
|
<line x1="5" y1="12" x2="19" y2="12"/>
|
|
8187
8203
|
</svg>`;
|
|
8188
|
-
function
|
|
8204
|
+
function Zn(r, e, s) {
|
|
8189
8205
|
const t = s == null ? void 0 : s.toLowerCase(), n = r.map((i) => {
|
|
8190
8206
|
const a = t && i.address.toLowerCase() === t;
|
|
8191
8207
|
return `<button class="__crossx-wallet-item" data-wallet-index="${i.index}" data-wallet-address="${L(i.address)}">
|
|
8192
8208
|
<span class="__crossx-wallet-info"><span class="__crossx-wallet-idx">Account ${i.index + 1}</span><span class="__crossx-wallet-addr">${re(i.address)}</span></span>${a ? '<span class="__crossx-wallet-selected">selected</span>' : ""}
|
|
8193
8209
|
</button>`;
|
|
8194
8210
|
}).join(""), o = document.createElement("div");
|
|
8195
|
-
return o.id =
|
|
8211
|
+
return o.id = Z, o.innerHTML = `
|
|
8196
8212
|
<div class="__crossx-card __crossx-card--migration __crossx-card--wallet-selector" style="${ae(e)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8197
8213
|
<div class="__crossx-header">
|
|
8198
8214
|
<div style="display:flex;flex-direction:column;gap:4px;padding-right:36px;">
|
|
@@ -8216,7 +8232,7 @@ function Jn(r, e, s) {
|
|
|
8216
8232
|
${n}
|
|
8217
8233
|
</div>
|
|
8218
8234
|
<button class="__crossx-wallet-add" id="__crossx-add-wallet-btn" type="button">
|
|
8219
|
-
<span class="__crossx-wallet-add-icon">${
|
|
8235
|
+
<span class="__crossx-wallet-add-icon">${Jn}</span>
|
|
8220
8236
|
<span class="__crossx-wallet-add-label">add a wallet</span>
|
|
8221
8237
|
</button>
|
|
8222
8238
|
</div>
|
|
@@ -8225,22 +8241,22 @@ function Jn(r, e, s) {
|
|
|
8225
8241
|
</div>
|
|
8226
8242
|
`, o;
|
|
8227
8243
|
}
|
|
8228
|
-
const
|
|
8244
|
+
const Qn = `<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
8229
8245
|
<path d="M26.693 21.193c-.028-3.168 2.587-4.712 2.706-4.786-1.477-2.16-3.77-2.454-4.58-2.484-1.944-.197-3.804 1.148-4.793 1.148-.992 0-2.52-1.12-4.147-1.09-2.13.032-4.1 1.239-5.198 3.133-2.222 3.855-.569 9.562 1.593 12.69 1.061 1.535 2.318 3.258 3.975 3.196 1.6-.064 2.2-1.03 4.133-1.03 1.928 0 2.48 1.03 4.172.997 1.72-.03 2.806-1.56 3.862-3.1 1.211-1.779 1.713-3.495 1.74-3.583-.037-.017-3.427-1.316-3.463-5.09z" fill="currentColor"/>
|
|
8230
8246
|
<path d="M23.527 11.876c.877-1.065 1.471-2.545 1.31-4.024-1.266.053-2.807.845-3.718 1.907-.813.946-1.53 2.468-1.34 3.915 1.41.107 2.852-.716 3.748-1.798z" fill="currentColor"/>
|
|
8231
|
-
</svg>`,
|
|
8247
|
+
</svg>`, eo = `<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
8232
8248
|
<path d="M38.06 20.44c0-1.34-.12-2.63-.34-3.87H20.5v7.32h9.84c-.42 2.28-1.71 4.21-3.65 5.51v4.57h5.91c3.46-3.19 5.46-7.88 5.46-13.53z" fill="#4285F4"/>
|
|
8233
8249
|
<path d="M20.5 38.5c4.94 0 9.09-1.64 12.12-4.44l-5.91-4.57c-1.64 1.1-3.73 1.75-6.21 1.75-4.77 0-8.82-3.22-10.26-7.55H4.16v4.72A18.49 18.49 0 0 0 20.5 38.5z" fill="#34A853"/>
|
|
8234
8250
|
<path d="M10.24 23.69A11.16 11.16 0 0 1 9.66 20c0-1.28.22-2.52.58-3.69v-4.72H4.16A18.49 18.49 0 0 0 2 20c0 2.97.71 5.78 1.97 8.28l6.27-4.59z" fill="#FBBC05"/>
|
|
8235
8251
|
<path d="M20.5 8.76c2.69 0 5.1.92 7 2.73l5.24-5.24C29.58 3.36 25.43 1.5 20.5 1.5A18.49 18.49 0 0 0 4.16 11.59l6.08 4.72C11.68 11.98 15.73 8.76 20.5 8.76z" fill="#EA4335"/>
|
|
8236
8252
|
</svg>`;
|
|
8237
|
-
function
|
|
8253
|
+
function to(r) {
|
|
8238
8254
|
const e = js(r);
|
|
8239
|
-
return `<span class="__crossx-connect-other-wallet-desc-part"><span class="__crossx-connect-other-wallet-icon" aria-hidden="true">${
|
|
8255
|
+
return `<span class="__crossx-connect-other-wallet-desc-part"><span class="__crossx-connect-other-wallet-icon" aria-hidden="true">${Un[r] ?? ""}</span><span class="__crossx-connect-other-wallet-name">${L(e)}</span></span>`;
|
|
8240
8256
|
}
|
|
8241
|
-
function
|
|
8257
|
+
function so(r) {
|
|
8242
8258
|
if (r.length === 0) return "";
|
|
8243
|
-
const e = (n) =>
|
|
8259
|
+
const e = (n) => to(r[n]), s = "Supported wallets include ";
|
|
8244
8260
|
if (r.length === 1)
|
|
8245
8261
|
return `${s}${e(0)}.`;
|
|
8246
8262
|
if (r.length === 2)
|
|
@@ -8250,7 +8266,7 @@ function to(r) {
|
|
|
8250
8266
|
const t = r.length - 3;
|
|
8251
8267
|
return `${s}${e(0)}, ${e(1)}, ${e(2)}, and ${t} more.`;
|
|
8252
8268
|
}
|
|
8253
|
-
function
|
|
8269
|
+
function ro(r, e = []) {
|
|
8254
8270
|
const s = r, t = L(String(e[0])), n = e.length > 0 ? `
|
|
8255
8271
|
<div class="__crossx-login-or-divider">
|
|
8256
8272
|
<hr><span>or</span><hr>
|
|
@@ -8258,10 +8274,10 @@ function so(r, e = []) {
|
|
|
8258
8274
|
<button type="button" class="__crossx-connect-other-block" id="__crossx-connect-other-wallet-btn" data-wallet-id="${t}" aria-labelledby="__crossx-connect-other-heading">
|
|
8259
8275
|
<span class="__crossx-connect-other-text">
|
|
8260
8276
|
<span class="__crossx-connect-other-title" id="__crossx-connect-other-heading">Connect with Other Wallets</span>
|
|
8261
|
-
<span class="__crossx-connect-other-desc __crossx-connect-other-summary">${
|
|
8277
|
+
<span class="__crossx-connect-other-desc __crossx-connect-other-summary">${so(e)}</span>
|
|
8262
8278
|
</span>
|
|
8263
8279
|
</button>` : "", o = document.createElement("div");
|
|
8264
|
-
return o.id =
|
|
8280
|
+
return o.id = Z, o.innerHTML = `
|
|
8265
8281
|
<div class="__crossx-card __crossx-card--migration" style="${ae(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8266
8282
|
<div class="__crossx-header">
|
|
8267
8283
|
<div style="display:flex;flex-direction:column;gap:4px;padding-right:36px;">
|
|
@@ -8274,11 +8290,11 @@ function so(r, e = []) {
|
|
|
8274
8290
|
<div class="__crossx-body">
|
|
8275
8291
|
<div class="__crossx-login-btn-row">
|
|
8276
8292
|
<button class="__crossx-login-btn" id="__crossx-apple-btn" type="button">
|
|
8277
|
-
<span class="__crossx-login-icon" style="color:var(--cx-value);">${
|
|
8293
|
+
<span class="__crossx-login-icon" style="color:var(--cx-value);">${Qn}</span>
|
|
8278
8294
|
<span class="__crossx-login-btn-label">Sign in with Apple</span>
|
|
8279
8295
|
</button>
|
|
8280
8296
|
<button class="__crossx-login-btn" id="__crossx-google-btn" type="button">
|
|
8281
|
-
<span class="__crossx-login-icon">${
|
|
8297
|
+
<span class="__crossx-login-icon">${eo}</span>
|
|
8282
8298
|
<span class="__crossx-login-btn-label">Sign in with Google</span>
|
|
8283
8299
|
</button>
|
|
8284
8300
|
</div>${n}
|
|
@@ -8289,9 +8305,9 @@ function so(r, e = []) {
|
|
|
8289
8305
|
</div>
|
|
8290
8306
|
`, o;
|
|
8291
8307
|
}
|
|
8292
|
-
function
|
|
8308
|
+
function no(r, e) {
|
|
8293
8309
|
const s = r, t = document.createElement("div");
|
|
8294
|
-
t.id =
|
|
8310
|
+
t.id = Z;
|
|
8295
8311
|
const n = L(e.message).replace(/\n/g, "<br>"), o = e.email ? `<div class="__crossx-session-account-card">
|
|
8296
8312
|
<p class="__crossx-session-account-label">${L(e.accountLabel)}</p>
|
|
8297
8313
|
<p class="__crossx-session-account-email">${L(e.email)}</p>
|
|
@@ -8317,9 +8333,9 @@ function ro(r, e) {
|
|
|
8317
8333
|
</div>
|
|
8318
8334
|
`, t;
|
|
8319
8335
|
}
|
|
8320
|
-
function
|
|
8336
|
+
function oo(r, e = !0) {
|
|
8321
8337
|
const s = r, t = e ? `<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${oe}</button>` : "", n = e ? '<button class="__crossx-skip-btn" id="__crossx-skip-btn">Skip for Now</button>' : "", o = document.createElement("div");
|
|
8322
|
-
return o.id =
|
|
8338
|
+
return o.id = Z, o.innerHTML = `
|
|
8323
8339
|
<div class="__crossx-card __crossx-card--migration" style="${ae(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8324
8340
|
<div class="__crossx-header">
|
|
8325
8341
|
<p class="__crossx-title" id="__crossx-ttl">Wallet Found on Social Account 🎉</p>
|
|
@@ -8333,7 +8349,7 @@ function no(r, e = !0) {
|
|
|
8333
8349
|
<p class="__crossx-mig-info-desc">It safely restores and integrates all your previous assets. Simply verify your PIN to get started.</p>
|
|
8334
8350
|
</div>
|
|
8335
8351
|
<button class="__crossx-recover-btn" id="__crossx-recover-btn">
|
|
8336
|
-
<span class="__crossx-recover-icon">${
|
|
8352
|
+
<span class="__crossx-recover-icon">${Dn}</span>
|
|
8337
8353
|
<span class="__crossx-recover-label">Import from Social Backup</span>
|
|
8338
8354
|
</button>
|
|
8339
8355
|
${n}
|
|
@@ -8341,9 +8357,9 @@ function no(r, e = !0) {
|
|
|
8341
8357
|
</div>
|
|
8342
8358
|
`, o;
|
|
8343
8359
|
}
|
|
8344
|
-
function
|
|
8360
|
+
function io(r, e) {
|
|
8345
8361
|
const s = r, { errorMessage: t, attemptCount: n, maxAttempts: o = 5 } = e ?? {}, i = !!t, a = i ? " --error" : "", c = n != null && n > 0 ? `<p class="__crossx-pin-attempt">${n}/${o}</p>` : "", l = n != null && n >= 3 ? '<p class="__crossx-pin-warning">Your account will be locked after further failures.</p>' : "", u = i ? `<p class="__crossx-pin-error-text">${t}</p>` : "", f = document.createElement("div");
|
|
8346
|
-
return f.id =
|
|
8362
|
+
return f.id = Z, f.innerHTML = `
|
|
8347
8363
|
<div class="__crossx-card __crossx-card--migration" style="${ae(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8348
8364
|
<div class="__crossx-header">
|
|
8349
8365
|
<p class="__crossx-title" id="__crossx-ttl">Import from Social Backup</p>
|
|
@@ -8365,13 +8381,13 @@ function oo(r, e) {
|
|
|
8365
8381
|
</div>
|
|
8366
8382
|
`, f;
|
|
8367
8383
|
}
|
|
8368
|
-
function
|
|
8384
|
+
function ao(r) {
|
|
8369
8385
|
const e = new Date(r), s = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], t = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], n = s[e.getDay()], o = t[e.getMonth()], i = e.getDate(), a = String(e.getHours()).padStart(2, "0"), c = String(e.getMinutes()).padStart(2, "0");
|
|
8370
8386
|
return `${n}, ${o} ${i} ${a}:${c}`;
|
|
8371
8387
|
}
|
|
8372
|
-
function
|
|
8373
|
-
const t = r, n = e <= 0, o = n ? null : Date.now() + e * 1e3, i = o ?
|
|
8374
|
-
return a.id =
|
|
8388
|
+
function co(r, e, s) {
|
|
8389
|
+
const t = r, n = e <= 0, o = n ? null : Date.now() + e * 1e3, i = o ? ao(o) : null, a = document.createElement("div");
|
|
8390
|
+
return a.id = Z, a.innerHTML = `
|
|
8375
8391
|
<div class="__crossx-card __crossx-card--migration" style="${ae(t)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8376
8392
|
<div class="__crossx-header">
|
|
8377
8393
|
<p class="__crossx-title" id="__crossx-ttl">Import from Social Backup</p>
|
|
@@ -8400,10 +8416,10 @@ function ao(r, e, s) {
|
|
|
8400
8416
|
return () => clearInterval(f);
|
|
8401
8417
|
} };
|
|
8402
8418
|
}
|
|
8403
|
-
function
|
|
8419
|
+
function lo(r) {
|
|
8404
8420
|
const s = [r.check1, r.check2].map((t, n) => `
|
|
8405
8421
|
<div class="__crossx-pw-notice-item" data-check-index="${n}" role="checkbox" aria-checked="false" tabindex="0">
|
|
8406
|
-
<div class="__crossx-pw-notice-check" id="__crossx-notice-check-${n}">${
|
|
8422
|
+
<div class="__crossx-pw-notice-check" id="__crossx-notice-check-${n}">${fo}</div>
|
|
8407
8423
|
<span class="__crossx-pw-notice-item-text">${L(t)}</span>
|
|
8408
8424
|
</div>
|
|
8409
8425
|
`).join("");
|
|
@@ -8418,7 +8434,7 @@ function co(r) {
|
|
|
8418
8434
|
<div class="__crossx-pw-fields __crossx-pw-fields--notice">
|
|
8419
8435
|
<div class="__crossx-pw-notice-header">
|
|
8420
8436
|
<div class="__crossx-pw-notice-title-row">
|
|
8421
|
-
<span class="__crossx-pw-notice-icon">${
|
|
8437
|
+
<span class="__crossx-pw-notice-icon">${_o}</span>
|
|
8422
8438
|
<p class="__crossx-pw-notice-title">${L(r.noticeTitle)}</p>
|
|
8423
8439
|
</div>
|
|
8424
8440
|
<p class="__crossx-pw-notice-desc">${L(r.noticeDesc)}</p>
|
|
@@ -8438,7 +8454,7 @@ function co(r) {
|
|
|
8438
8454
|
}
|
|
8439
8455
|
function lt(r) {
|
|
8440
8456
|
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">${L(r.headerSubtitle)}</p>` : "", n = r.subtitle ? `<p class="__crossx-pin6-subtitle">${L(r.subtitle)}</p>` : "", o = r.errorMessage ? `<p class="__crossx-pin6-error" id="__crossx-pin6-error">${L(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">
|
|
8441
|
-
${
|
|
8457
|
+
${Fs}
|
|
8442
8458
|
<span id="__crossx-pin6-lock-countdown"></span>
|
|
8443
8459
|
</p>` : "", a = r.warningMessage && r.attemptCount != null && r.attemptCount > 0 ? `<p class="__crossx-pin6-warning" id="__crossx-pin6-warning">${L(r.warningMessage)}</p>` : '<p class="__crossx-pin6-warning" id="__crossx-pin6-warning"></p>', c = r.attemptCount != null && r.attemptCount > 0 ? `<p class="__crossx-pin6-attempt" id="__crossx-pin6-attempt">${r.attemptCount}/${r.maxAttempts ?? "?"}</p>` : '<p class="__crossx-pin6-attempt" id="__crossx-pin6-attempt"></p>', l = e ? " --locked" : "", u = Array.from(
|
|
8444
8460
|
{ length: 6 },
|
|
@@ -8466,7 +8482,7 @@ function lt(r) {
|
|
|
8466
8482
|
<div class="__crossx-pin6-numpad-row">
|
|
8467
8483
|
<button type="button" class="__crossx-pin6-numpad-key --empty" aria-hidden="true"></button>
|
|
8468
8484
|
<button type="button" class="__crossx-pin6-numpad-key${p}" data-key="0">0</button>
|
|
8469
|
-
<button type="button" class="__crossx-pin6-numpad-key --delete${p}" data-key="backspace" aria-label="Delete">${
|
|
8485
|
+
<button type="button" class="__crossx-pin6-numpad-key --delete${p}" data-key="backspace" aria-label="Delete">${po}</button>
|
|
8470
8486
|
</div>
|
|
8471
8487
|
</div>`;
|
|
8472
8488
|
return `
|
|
@@ -8494,20 +8510,20 @@ function lt(r) {
|
|
|
8494
8510
|
}
|
|
8495
8511
|
function ns(r, e) {
|
|
8496
8512
|
const s = document.createElement("div");
|
|
8497
|
-
return s.id =
|
|
8513
|
+
return s.id = Z, s.innerHTML = `
|
|
8498
8514
|
<div class="__crossx-card __crossx-card--pin6" style="${ae(r)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8499
8515
|
${e}
|
|
8500
8516
|
</div>
|
|
8501
8517
|
`, s;
|
|
8502
8518
|
}
|
|
8503
|
-
function
|
|
8519
|
+
function uo(r, e) {
|
|
8504
8520
|
if (r.length !== 6) return e.tooShort;
|
|
8505
8521
|
if (!/^\d+$/.test(r)) return e.numbersOnly;
|
|
8506
8522
|
if (/(.)\1{2}/.test(r)) return e.repeatingDigit;
|
|
8507
8523
|
const s = r.split("").map(Number), t = s.every((o, i) => i === 0 || o === (s[i - 1] + 1) % 10), n = s.every((o, i) => i === 0 || o === (s[i - 1] + 9) % 10);
|
|
8508
8524
|
return t || n ? e.sequential : r[0] !== r[1] && r === r.slice(0, 2).repeat(3) ? e.alternatingPattern : null;
|
|
8509
8525
|
}
|
|
8510
|
-
function
|
|
8526
|
+
function ho(r) {
|
|
8511
8527
|
const e = Math.max(0, Math.ceil(r / 1e3)), s = Math.floor(e / 3600), t = Math.floor(e % 3600 / 60), n = e % 60;
|
|
8512
8528
|
return s > 0 ? `${s}h ${String(t).padStart(2, "0")}m` : `${String(t).padStart(2, "0")}:${String(n).padStart(2, "0")}`;
|
|
8513
8529
|
}
|
|
@@ -8518,24 +8534,24 @@ function dt(r, e, s, t, n, o, i) {
|
|
|
8518
8534
|
var v;
|
|
8519
8535
|
const w = l(), y = S();
|
|
8520
8536
|
if (y.length && (y.forEach((I, R) => {
|
|
8521
|
-
const
|
|
8522
|
-
I.classList.toggle("--filled",
|
|
8537
|
+
const F = !!(w[R] && w[R].value);
|
|
8538
|
+
I.classList.toggle("--filled", F), I.classList.toggle("--active", !1);
|
|
8523
8539
|
}), !a && !c)) {
|
|
8524
|
-
const I = w.findIndex((
|
|
8540
|
+
const I = w.findIndex((F) => !F.value);
|
|
8525
8541
|
(v = y[I === -1 ? 5 : I]) == null || v.classList.add("--active");
|
|
8526
8542
|
}
|
|
8527
8543
|
}, k = () => {
|
|
8528
8544
|
r.querySelectorAll(".__crossx-pin6-numpad-key[data-key]").forEach((y) => y.classList.toggle("--disabled", a)), S().forEach((y) => y.classList.toggle("--locked", a)), A();
|
|
8529
|
-
},
|
|
8545
|
+
}, H = (w) => {
|
|
8530
8546
|
a = w, l().forEach((y) => {
|
|
8531
8547
|
y.disabled = w, y.classList.toggle("--locked", w);
|
|
8532
8548
|
});
|
|
8533
8549
|
}, M = () => r.querySelector("#__crossx-pin6-attempt"), K = () => {
|
|
8534
8550
|
const w = f();
|
|
8535
8551
|
w && (w.textContent = "");
|
|
8536
|
-
}, q = () => i ?? "Your account will be locked after further failures.",
|
|
8552
|
+
}, q = () => i ?? "Your account will be locked after further failures.", Q = () => r.querySelector("#__crossx-pin6-warning"), W = (w) => {
|
|
8537
8553
|
var v;
|
|
8538
|
-
let y =
|
|
8554
|
+
let y = Q();
|
|
8539
8555
|
if (!y) {
|
|
8540
8556
|
y = document.createElement("p"), y.className = "__crossx-pin6-warning", y.id = "__crossx-pin6-warning";
|
|
8541
8557
|
const I = f();
|
|
@@ -8543,14 +8559,14 @@ function dt(r, e, s, t, n, o, i) {
|
|
|
8543
8559
|
}
|
|
8544
8560
|
y.textContent = w;
|
|
8545
8561
|
}, J = () => {
|
|
8546
|
-
const w =
|
|
8562
|
+
const w = Q();
|
|
8547
8563
|
w && (w.textContent = "");
|
|
8548
|
-
},
|
|
8564
|
+
}, ee = (w, y) => {
|
|
8549
8565
|
var I;
|
|
8550
8566
|
let v = M();
|
|
8551
8567
|
if (!v) {
|
|
8552
8568
|
v = document.createElement("p"), v.className = "__crossx-pin6-attempt", v.id = "__crossx-pin6-attempt";
|
|
8553
|
-
const R =
|
|
8569
|
+
const R = Q() ?? f();
|
|
8554
8570
|
R ? R.insertAdjacentElement("afterend", v) : (I = b()) == null || I.appendChild(v);
|
|
8555
8571
|
}
|
|
8556
8572
|
v.textContent = `${w}/${y}`;
|
|
@@ -8568,24 +8584,24 @@ function dt(r, e, s, t, n, o, i) {
|
|
|
8568
8584
|
(I = l()[0]) == null || I.focus(), A();
|
|
8569
8585
|
}, 50);
|
|
8570
8586
|
}, $ = (w) => {
|
|
8571
|
-
var
|
|
8572
|
-
|
|
8587
|
+
var F;
|
|
8588
|
+
H(!0), l().forEach((B) => {
|
|
8573
8589
|
B.value = "";
|
|
8574
8590
|
}), k();
|
|
8575
8591
|
const y = f();
|
|
8576
8592
|
if (y && (y.textContent = "Too many failed attempts. Please wait."), !_()) {
|
|
8577
8593
|
const B = document.createElement("p");
|
|
8578
|
-
B.className = "__crossx-pin6-lock-msg", B.id = "__crossx-pin6-lock-msg", B.innerHTML = `${
|
|
8594
|
+
B.className = "__crossx-pin6-lock-msg", B.id = "__crossx-pin6-lock-msg", B.innerHTML = `${Fs}<span id="__crossx-pin6-lock-countdown"></span>`;
|
|
8579
8595
|
const N = f();
|
|
8580
|
-
N ? N.insertAdjacentElement("afterend", B) : (
|
|
8596
|
+
N ? N.insertAdjacentElement("afterend", B) : (F = b()) == null || F.appendChild(B);
|
|
8581
8597
|
}
|
|
8582
8598
|
const v = () => {
|
|
8583
8599
|
var G;
|
|
8584
8600
|
const B = w - Date.now(), N = p();
|
|
8585
|
-
B <= 0 ? (clearInterval(I),
|
|
8601
|
+
B <= 0 ? (clearInterval(I), H(!1), (G = _()) == null || G.remove(), y && (y.textContent = ""), k(), setTimeout(() => {
|
|
8586
8602
|
var X;
|
|
8587
8603
|
return (X = l()[0]) == null ? void 0 : X.focus();
|
|
8588
|
-
}, 50)) : N && (N.textContent = ` ${
|
|
8604
|
+
}, 50)) : N && (N.textContent = ` ${ho(B)}`);
|
|
8589
8605
|
}, I = setInterval(v, 1e3);
|
|
8590
8606
|
v();
|
|
8591
8607
|
const R = new MutationObserver(() => {
|
|
@@ -8602,7 +8618,7 @@ function dt(r, e, s, t, n, o, i) {
|
|
|
8602
8618
|
try {
|
|
8603
8619
|
if (n) {
|
|
8604
8620
|
const y = await n(w);
|
|
8605
|
-
y.ok ? e(w) : y.lockExpiresAt ? (U(), $(y.lockExpiresAt)) : (C(y.error ?? "Incorrect PIN. Please try again."), y.attemptCount != null && y.maxAttempts != null ? (W(q()),
|
|
8621
|
+
y.ok ? e(w) : y.lockExpiresAt ? (U(), $(y.lockExpiresAt)) : (C(y.error ?? "Incorrect PIN. Please try again."), y.attemptCount != null && y.maxAttempts != null ? (W(q()), ee(y.attemptCount, y.maxAttempts)) : (J(), U()));
|
|
8606
8622
|
} else
|
|
8607
8623
|
e(w);
|
|
8608
8624
|
} catch (y) {
|
|
@@ -8639,15 +8655,15 @@ function dt(r, e, s, t, n, o, i) {
|
|
|
8639
8655
|
if (v.preventDefault(), w.value)
|
|
8640
8656
|
w.value = "";
|
|
8641
8657
|
else if (y > 0) {
|
|
8642
|
-
const
|
|
8643
|
-
|
|
8658
|
+
const F = l()[y - 1];
|
|
8659
|
+
F.value = "", F.focus();
|
|
8644
8660
|
}
|
|
8645
8661
|
A();
|
|
8646
8662
|
} else v.key === "ArrowLeft" && y > 0 ? (v.preventDefault(), (I = l()[y - 1]) == null || I.focus()) : v.key === "ArrowRight" && y < 5 ? (v.preventDefault(), (R = l()[y + 1]) == null || R.focus()) : v.key === "Escape" && s();
|
|
8647
8663
|
}), w.addEventListener("paste", (v) => {
|
|
8648
|
-
var
|
|
8664
|
+
var F, B;
|
|
8649
8665
|
v.preventDefault();
|
|
8650
|
-
const I = (((
|
|
8666
|
+
const I = (((F = v.clipboardData) == null ? void 0 : F.getData("text")) ?? "").replace(/\D/g, "").slice(0, 6);
|
|
8651
8667
|
if (!I) return;
|
|
8652
8668
|
const R = l();
|
|
8653
8669
|
I.split("").forEach((N, G) => {
|
|
@@ -8681,23 +8697,23 @@ function dt(r, e, s, t, n, o, i) {
|
|
|
8681
8697
|
if (!w) return;
|
|
8682
8698
|
const R = w;
|
|
8683
8699
|
y();
|
|
8684
|
-
const
|
|
8685
|
-
I.clientX >=
|
|
8700
|
+
const F = R.getBoundingClientRect();
|
|
8701
|
+
I.clientX >= F.left && I.clientX <= F.right && I.clientY >= F.top && I.clientY <= F.bottom && !a && !c && v(R);
|
|
8686
8702
|
}), T.addEventListener("pointercancel", y), T.addEventListener("pointerleave", y, !0), A(), o && o > Date.now() && k();
|
|
8687
8703
|
}
|
|
8688
8704
|
}
|
|
8689
|
-
const
|
|
8705
|
+
const po = `<svg width="22" height="17" viewBox="0 0 22 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
8690
8706
|
<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"/>
|
|
8691
8707
|
<line x1="10" y1="5.5" x2="16" y2="11.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
|
8692
8708
|
<line x1="16" y1="5.5" x2="10" y2="11.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
|
8693
|
-
</svg>`,
|
|
8709
|
+
</svg>`, Fs = `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
8694
8710
|
<path d="M14.5 8.5H14V6.5C14 4.015 11.985 2 9.5 2C7.015 2 5 4.015 5 6.5V8.5H4.5C3.672 8.5 3 9.172 3 10V16.5C3 17.328 3.672 18 4.5 18H14.5C15.328 18 16 17.328 16 16.5V10C16 9.172 15.328 8.5 14.5 8.5ZM10.5 13.415V15C10.5 15.276 10.276 15.5 10 15.5H9C8.724 15.5 8.5 15.276 8.5 15V13.415C8.187 13.196 8 12.847 8 12.5C8 11.672 8.672 11 9.5 11C10.328 11 11 11.672 11 12.5C11 12.847 10.813 13.196 10.5 13.415ZM12.5 8.5H6.5V6.5C6.5 4.843 7.843 3.5 9.5 3.5C11.157 3.5 12.5 4.843 12.5 6.5V8.5Z" fill="currentColor"/>
|
|
8695
|
-
</svg>`,
|
|
8711
|
+
</svg>`, fo = `<svg width="11" height="9" viewBox="0 0 11 9" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
8696
8712
|
<path d="M1 4.5L4 7.5L10 1" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
8697
|
-
</svg>`,
|
|
8713
|
+
</svg>`, _o = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
8698
8714
|
<path d="M12 0C18.6274 0 24 5.37258 24 12C23.9999 18.6273 18.6274 24 12 24C5.37264 24 9.89594e-05 18.6273 0 12C0 5.37258 5.37258 0 12 0ZM10.875 15.127V17.377H13.125V15.127H10.875ZM10.875 6.62207V13.627H13.125V6.62207H10.875Z" fill="currentColor"/>
|
|
8699
8715
|
</svg>`;
|
|
8700
|
-
function
|
|
8716
|
+
function xo(r, e, s) {
|
|
8701
8717
|
var o;
|
|
8702
8718
|
const t = r.querySelectorAll(".__crossx-pin-input");
|
|
8703
8719
|
t.forEach((i, a) => {
|
|
@@ -8730,7 +8746,7 @@ function _o(r, e, s) {
|
|
|
8730
8746
|
}
|
|
8731
8747
|
}), (o = t[0]) == null || o.focus();
|
|
8732
8748
|
}
|
|
8733
|
-
class
|
|
8749
|
+
class go {
|
|
8734
8750
|
constructor(e = "light", s) {
|
|
8735
8751
|
this.theme = e, this.overrides = s, this.tokens = ss(e, s);
|
|
8736
8752
|
}
|
|
@@ -8752,7 +8768,7 @@ class xo {
|
|
|
8752
8768
|
return new Promise((n) => {
|
|
8753
8769
|
var E;
|
|
8754
8770
|
le();
|
|
8755
|
-
const o = [...e], i =
|
|
8771
|
+
const o = [...e], i = Zn(o, this.tokens, t), a = Oe();
|
|
8756
8772
|
de(i);
|
|
8757
8773
|
let c = !1;
|
|
8758
8774
|
const l = () => {
|
|
@@ -8807,7 +8823,7 @@ class xo {
|
|
|
8807
8823
|
return new Promise((n) => {
|
|
8808
8824
|
var _, p, b, E;
|
|
8809
8825
|
le();
|
|
8810
|
-
const o =
|
|
8826
|
+
const o = ro(this.tokens, s), i = Oe();
|
|
8811
8827
|
de(o);
|
|
8812
8828
|
const a = () => {
|
|
8813
8829
|
o.remove(), i();
|
|
@@ -8836,7 +8852,7 @@ class xo {
|
|
|
8836
8852
|
return new Promise((s) => {
|
|
8837
8853
|
var u, f, _;
|
|
8838
8854
|
le();
|
|
8839
|
-
const t = this.messages, n =
|
|
8855
|
+
const t = this.messages, n = no(this.tokens, {
|
|
8840
8856
|
title: e.title,
|
|
8841
8857
|
message: e.message,
|
|
8842
8858
|
email: e.email,
|
|
@@ -8866,7 +8882,7 @@ class xo {
|
|
|
8866
8882
|
return new Promise((t) => {
|
|
8867
8883
|
var a, c, l;
|
|
8868
8884
|
le();
|
|
8869
|
-
const n =
|
|
8885
|
+
const n = oo(this.tokens, s);
|
|
8870
8886
|
de(n);
|
|
8871
8887
|
const o = () => n.remove(), i = () => {
|
|
8872
8888
|
o(), t("recover");
|
|
@@ -8912,7 +8928,7 @@ class xo {
|
|
|
8912
8928
|
}, i = {
|
|
8913
8929
|
title: (t == null ? void 0 : t.pinSetup_confirmTitle) ?? "Confirm PIN",
|
|
8914
8930
|
headerSubtitle: (t == null ? void 0 : t.pinSetup_confirmSubtitle) ?? "Enter your PIN again to confirm."
|
|
8915
|
-
}, a = ns(this.tokens,
|
|
8931
|
+
}, a = ns(this.tokens, lo(n)), c = Oe();
|
|
8916
8932
|
de(a);
|
|
8917
8933
|
let l = !1;
|
|
8918
8934
|
const u = () => {
|
|
@@ -8928,40 +8944,40 @@ class xo {
|
|
|
8928
8944
|
sequential: (t == null ? void 0 : t.pinValidation_sequential) ?? "Sequential numbers (e.g., 123456) are not allowed.",
|
|
8929
8945
|
alternatingPattern: (t == null ? void 0 : t.pinValidation_alternatingPattern) ?? "Repeating patterns (e.g., 121212) are not allowed."
|
|
8930
8946
|
}, E = (k) => {
|
|
8931
|
-
var
|
|
8947
|
+
var H;
|
|
8932
8948
|
p.innerHTML = lt({
|
|
8933
8949
|
title: i.title,
|
|
8934
8950
|
headerSubtitle: i.headerSubtitle
|
|
8935
|
-
}), (
|
|
8951
|
+
}), (H = p.querySelector("#__crossx-close-btn")) == null || H.addEventListener("click", _), dt(p, (M) => {
|
|
8936
8952
|
M === k ? f(k) : S(o.mismatchError);
|
|
8937
8953
|
}, _);
|
|
8938
8954
|
}, S = (k) => {
|
|
8939
|
-
var
|
|
8955
|
+
var H;
|
|
8940
8956
|
p.innerHTML = lt({
|
|
8941
8957
|
title: o.title,
|
|
8942
8958
|
headerSubtitle: o.headerSubtitle,
|
|
8943
8959
|
subtitle: o.subtitle,
|
|
8944
8960
|
errorMessage: k
|
|
8945
|
-
}), (
|
|
8946
|
-
const K =
|
|
8961
|
+
}), (H = p.querySelector("#__crossx-close-btn")) == null || H.addEventListener("click", _), dt(p, (M) => {
|
|
8962
|
+
const K = uo(M, b);
|
|
8947
8963
|
K ? S(K) : E(M);
|
|
8948
8964
|
}, _);
|
|
8949
8965
|
};
|
|
8950
8966
|
(() => {
|
|
8951
|
-
var
|
|
8952
|
-
const k = Array.from(p.querySelectorAll(".__crossx-pw-notice-item")),
|
|
8953
|
-
|
|
8954
|
-
const K =
|
|
8967
|
+
var ee;
|
|
8968
|
+
const k = Array.from(p.querySelectorAll(".__crossx-pw-notice-item")), H = p.querySelector("#__crossx-pin-notice-next"), M = /* @__PURE__ */ new Set();
|
|
8969
|
+
H.removeAttribute("disabled");
|
|
8970
|
+
const K = H.dataset.nextLabel ?? "Next", q = H.dataset.submitLabel ?? "I Understand", Q = () => {
|
|
8955
8971
|
const U = M.size === k.length;
|
|
8956
|
-
|
|
8972
|
+
H.classList.toggle("--disabled", !U), H.textContent = U ? q : K;
|
|
8957
8973
|
}, W = (U, C) => {
|
|
8958
8974
|
if (M.has(C)) return;
|
|
8959
8975
|
const $ = U.querySelector(`#__crossx-notice-check-${C}`);
|
|
8960
|
-
M.add(C), $.classList.add("--checked"), U.setAttribute("aria-checked", "true"),
|
|
8976
|
+
M.add(C), $.classList.add("--checked"), U.setAttribute("aria-checked", "true"), Q();
|
|
8961
8977
|
}, J = (U, C) => {
|
|
8962
8978
|
if (!M.has(C)) return;
|
|
8963
8979
|
const $ = U.querySelector(`#__crossx-notice-check-${C}`);
|
|
8964
|
-
M.delete(C), $.classList.remove("--checked"), U.setAttribute("aria-checked", "false"),
|
|
8980
|
+
M.delete(C), $.classList.remove("--checked"), U.setAttribute("aria-checked", "false"), Q();
|
|
8965
8981
|
};
|
|
8966
8982
|
k.forEach((U) => {
|
|
8967
8983
|
const C = parseInt(U.dataset.checkIndex ?? "0", 10);
|
|
@@ -8970,7 +8986,7 @@ class xo {
|
|
|
8970
8986
|
}), U.addEventListener("keydown", ($) => {
|
|
8971
8987
|
($.key === " " || $.key === "Enter") && ($.preventDefault(), M.has(C) ? J(U, C) : W(U, C));
|
|
8972
8988
|
});
|
|
8973
|
-
}),
|
|
8989
|
+
}), H.addEventListener("click", () => {
|
|
8974
8990
|
if (M.size === k.length) {
|
|
8975
8991
|
S(e == null ? void 0 : e.errorMessage);
|
|
8976
8992
|
return;
|
|
@@ -8984,7 +9000,7 @@ class xo {
|
|
|
8984
9000
|
U.scrollIntoView({ behavior: "smooth", block: "nearest" }), U.classList.add("--highlight"), setTimeout(() => {
|
|
8985
9001
|
U.classList.remove("--highlight"), W(U, C);
|
|
8986
9002
|
}, 400);
|
|
8987
|
-
}), (
|
|
9003
|
+
}), (ee = p.querySelector("#__crossx-close-btn")) == null || ee.addEventListener("click", _);
|
|
8988
9004
|
})(), a.addEventListener("click", (k) => {
|
|
8989
9005
|
k.target === a && _();
|
|
8990
9006
|
});
|
|
@@ -9038,14 +9054,14 @@ class xo {
|
|
|
9038
9054
|
return new Promise((s) => {
|
|
9039
9055
|
var a;
|
|
9040
9056
|
le();
|
|
9041
|
-
const t =
|
|
9057
|
+
const t = io(this.tokens, e);
|
|
9042
9058
|
de(t);
|
|
9043
9059
|
const n = () => t.remove(), o = (c) => {
|
|
9044
9060
|
n(), s(c);
|
|
9045
9061
|
}, i = () => {
|
|
9046
9062
|
n(), s(null);
|
|
9047
9063
|
};
|
|
9048
|
-
|
|
9064
|
+
xo(t, o, i), (a = t.querySelector("#__crossx-close-btn")) == null || a.addEventListener("click", i), t.addEventListener("click", (c) => {
|
|
9049
9065
|
c.target === t && i();
|
|
9050
9066
|
});
|
|
9051
9067
|
});
|
|
@@ -9060,7 +9076,7 @@ class xo {
|
|
|
9060
9076
|
return new Promise((t) => {
|
|
9061
9077
|
var l;
|
|
9062
9078
|
le();
|
|
9063
|
-
const { overlay: n, startCountdown: o } =
|
|
9079
|
+
const { overlay: n, startCountdown: o } = co(this.tokens, e, s);
|
|
9064
9080
|
de(n);
|
|
9065
9081
|
const i = () => {
|
|
9066
9082
|
c(), n.remove();
|
|
@@ -9080,7 +9096,7 @@ class xo {
|
|
|
9080
9096
|
return new Promise((s) => {
|
|
9081
9097
|
var a, c;
|
|
9082
9098
|
le();
|
|
9083
|
-
const t =
|
|
9099
|
+
const t = zn(e, this.tokens);
|
|
9084
9100
|
de(t);
|
|
9085
9101
|
const n = () => t.remove(), o = () => {
|
|
9086
9102
|
n(), s();
|
|
@@ -9109,7 +9125,7 @@ class xo {
|
|
|
9109
9125
|
showTransactionProgress(e, s) {
|
|
9110
9126
|
return new Promise((t) => {
|
|
9111
9127
|
le();
|
|
9112
|
-
const n =
|
|
9128
|
+
const n = Vn(e, this.tokens);
|
|
9113
9129
|
de(n);
|
|
9114
9130
|
const o = () => n.remove();
|
|
9115
9131
|
let i = !1;
|
|
@@ -9126,7 +9142,7 @@ class xo {
|
|
|
9126
9142
|
document.addEventListener("keydown", l);
|
|
9127
9143
|
};
|
|
9128
9144
|
s.then((l) => {
|
|
9129
|
-
i || (
|
|
9145
|
+
i || (jn(n, l, this.tokens), c());
|
|
9130
9146
|
});
|
|
9131
9147
|
});
|
|
9132
9148
|
}
|
|
@@ -9135,7 +9151,7 @@ class xo {
|
|
|
9135
9151
|
var l, u, f;
|
|
9136
9152
|
le();
|
|
9137
9153
|
let t;
|
|
9138
|
-
e.type === "sign-message" ? t =
|
|
9154
|
+
e.type === "sign-message" ? t = Yn(e, this.tokens) : e.type === "sign-typed-data" ? t = Xn(e, this.tokens) : e.type === "sign" ? t = Wn(e, this.tokens) : t = Gn(e, this.tokens);
|
|
9139
9155
|
const n = Oe();
|
|
9140
9156
|
de(t);
|
|
9141
9157
|
const o = () => {
|
|
@@ -9163,7 +9179,7 @@ class xo {
|
|
|
9163
9179
|
});
|
|
9164
9180
|
}
|
|
9165
9181
|
}
|
|
9166
|
-
class
|
|
9182
|
+
class mo {
|
|
9167
9183
|
constructor() {
|
|
9168
9184
|
this._accessToken = null, this._expiresAt = 0;
|
|
9169
9185
|
}
|
|
@@ -9195,7 +9211,7 @@ class go {
|
|
|
9195
9211
|
return !this._accessToken || this._expiresAt <= 0 ? !0 : Date.now() >= this._expiresAt - e;
|
|
9196
9212
|
}
|
|
9197
9213
|
}
|
|
9198
|
-
function
|
|
9214
|
+
function Ao(r, e) {
|
|
9199
9215
|
r.debug;
|
|
9200
9216
|
const s = Pe.production, t = {
|
|
9201
9217
|
...r,
|
|
@@ -9211,7 +9227,7 @@ function Io(r, e) {
|
|
|
9211
9227
|
"refresh_token이 평문 저장되지 않도록 세션 영속성이 제한됩니다.",
|
|
9212
9228
|
"IndexedDB를 지원하는 브라우저 사용을 권장합니다."
|
|
9213
9229
|
), t.secureStorageAvailable = o;
|
|
9214
|
-
const i = o ? new Bt(r.projectId) : new pr(), a = new Sn(), c = new An(), l = new Ie(), u = new
|
|
9230
|
+
const i = o ? new Bt(r.projectId) : new pr(), a = new Sn(), c = new An(), l = new Ie(), u = new mo(), f = new is();
|
|
9215
9231
|
let _;
|
|
9216
9232
|
r.useMockWallet ? (d.log("[CROSSx] Mock Wallet Provider 사용"), _ = new kn(i, f)) : (d.log("[CROSSx] Remote Wallet Provider 사용"), _ = new Ae(
|
|
9217
9233
|
n,
|
|
@@ -9220,7 +9236,7 @@ function Io(r, e) {
|
|
|
9220
9236
|
u,
|
|
9221
9237
|
f
|
|
9222
9238
|
));
|
|
9223
|
-
const p = new
|
|
9239
|
+
const p = new Fe(n, c), b = new go(r.theme ?? "light", r.themeTokens), E = e != null && e.wrapConfirmation ? e.wrapConfirmation(b) : b, S = new ht(
|
|
9224
9240
|
t,
|
|
9225
9241
|
n,
|
|
9226
9242
|
i,
|
|
@@ -9235,9 +9251,9 @@ function Io(r, e) {
|
|
|
9235
9251
|
);
|
|
9236
9252
|
return typeof window < "u" && (window.__crossxSDK = S), S;
|
|
9237
9253
|
}
|
|
9238
|
-
function
|
|
9239
|
-
const e =
|
|
9240
|
-
|
|
9254
|
+
function To(r) {
|
|
9255
|
+
const e = wo(r), s = yo(e), t = JSON.parse(s);
|
|
9256
|
+
So(t);
|
|
9241
9257
|
const { data: n } = t;
|
|
9242
9258
|
return {
|
|
9243
9259
|
status: t.status,
|
|
@@ -9251,7 +9267,7 @@ function Ao(r) {
|
|
|
9251
9267
|
raw: t
|
|
9252
9268
|
};
|
|
9253
9269
|
}
|
|
9254
|
-
function
|
|
9270
|
+
function wo(r) {
|
|
9255
9271
|
if (r.includes("://") && r.includes("?")) {
|
|
9256
9272
|
const e = new URL(r), s = e.searchParams.get("crossx_oauth_result");
|
|
9257
9273
|
if (s) return s;
|
|
@@ -9261,22 +9277,22 @@ function mo(r) {
|
|
|
9261
9277
|
}
|
|
9262
9278
|
return r;
|
|
9263
9279
|
}
|
|
9264
|
-
function
|
|
9280
|
+
function yo(r) {
|
|
9265
9281
|
if (r.startsWith("{"))
|
|
9266
9282
|
return r;
|
|
9267
9283
|
if (r.startsWith("%7B") || r.startsWith("%7b"))
|
|
9268
9284
|
return decodeURIComponent(r);
|
|
9269
|
-
const e =
|
|
9285
|
+
const e = bo(r);
|
|
9270
9286
|
return decodeURIComponent(e);
|
|
9271
9287
|
}
|
|
9272
|
-
function
|
|
9288
|
+
function bo(r) {
|
|
9273
9289
|
if (typeof atob == "function")
|
|
9274
9290
|
return atob(r);
|
|
9275
9291
|
if (typeof Buffer < "u")
|
|
9276
9292
|
return Buffer.from(r, "base64").toString("utf-8");
|
|
9277
9293
|
throw new Error("Base64 디코딩을 지원하는 환경이 아닙니다");
|
|
9278
9294
|
}
|
|
9279
|
-
function
|
|
9295
|
+
function So(r) {
|
|
9280
9296
|
if (typeof r != "object" || r === null)
|
|
9281
9297
|
throw new Error("Deeplink payload가 유효한 객체가 아닙니다");
|
|
9282
9298
|
const e = r;
|
|
@@ -9297,12 +9313,12 @@ export {
|
|
|
9297
9313
|
x as CROSSxError,
|
|
9298
9314
|
Zs as CROSSxEthereumProvider,
|
|
9299
9315
|
ht as CROSSxSDK,
|
|
9300
|
-
|
|
9316
|
+
Io as ChainId,
|
|
9301
9317
|
Ue as ConnectOtherWalletItem,
|
|
9302
9318
|
h as ErrorCode,
|
|
9303
9319
|
is as PinMemoryStore,
|
|
9304
|
-
|
|
9305
|
-
|
|
9320
|
+
mo as TokenMemoryStore,
|
|
9321
|
+
Ao as createCROSSxSDK,
|
|
9306
9322
|
js as getConnectOtherWalletLabel,
|
|
9307
|
-
|
|
9323
|
+
To as parseOAuthDeeplink
|
|
9308
9324
|
};
|