@nexus-cross/crossx-sdk-core 2.0.2-beta.2 → 2.0.2
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 +36 -36
- package/dist/index.cjs +46 -46
- package/dist/index.js +235 -222
- 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
|
|
@@ -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,41 +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
|
-
|
|
7757
|
+
o.preventDefault();
|
|
7746
7758
|
}, { passive: !1 });
|
|
7747
|
-
|
|
7748
|
-
|
|
7749
|
-
|
|
7759
|
+
const t = Pn(), n = r.remove.bind(r);
|
|
7760
|
+
r.remove = () => {
|
|
7761
|
+
t(), n();
|
|
7762
|
+
}, document.body.appendChild(r);
|
|
7750
7763
|
}
|
|
7751
|
-
const
|
|
7764
|
+
const Cn = () => /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
|
|
7752
7765
|
function Oe() {
|
|
7753
|
-
if (
|
|
7766
|
+
if (Cn()) {
|
|
7754
7767
|
const e = window.scrollY;
|
|
7755
7768
|
return document.body.style.position = "fixed", document.body.style.top = `-${e}px`, document.body.style.left = "0", document.body.style.right = "0", () => {
|
|
7756
7769
|
document.body.style.position = "", document.body.style.top = "", document.body.style.left = "", document.body.style.right = "", window.scrollTo(0, e);
|
|
@@ -7815,18 +7828,18 @@ function ct(r) {
|
|
|
7815
7828
|
return r;
|
|
7816
7829
|
}
|
|
7817
7830
|
}
|
|
7818
|
-
function
|
|
7831
|
+
function Nn(r) {
|
|
7819
7832
|
try {
|
|
7820
7833
|
return BigInt(r).toLocaleString();
|
|
7821
7834
|
} catch {
|
|
7822
7835
|
return r;
|
|
7823
7836
|
}
|
|
7824
7837
|
}
|
|
7825
|
-
function
|
|
7838
|
+
function Ln(r) {
|
|
7826
7839
|
const { gasLimit: e, gasPrice: s, maxFeePerGas: t, maxPriorityFeePerGas: n, nativeSymbol: o = "ETH", nativeDecimals: i = 18 } = r;
|
|
7827
7840
|
if (!e) return null;
|
|
7828
7841
|
try {
|
|
7829
|
-
const a = BigInt(e), c =
|
|
7842
|
+
const a = BigInt(e), c = Nn(e);
|
|
7830
7843
|
if (t) {
|
|
7831
7844
|
const l = a * BigInt(t);
|
|
7832
7845
|
return {
|
|
@@ -7852,7 +7865,7 @@ function Nn(r) {
|
|
|
7852
7865
|
}
|
|
7853
7866
|
}
|
|
7854
7867
|
function Us(r) {
|
|
7855
|
-
const e =
|
|
7868
|
+
const e = Ln(r);
|
|
7856
7869
|
if (!e) return Y("Estimated fee", "<span>—</span>");
|
|
7857
7870
|
let s = Y("Est. Tx Fee", `<span>${e.estTxFee}</span>`);
|
|
7858
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;
|
|
@@ -7863,18 +7876,18 @@ const me = `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="
|
|
|
7863
7876
|
</svg>`, oe = `<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round">
|
|
7864
7877
|
<line x1="18" y1="6" x2="6" y2="18"/>
|
|
7865
7878
|
<line x1="6" y1="6" x2="18" y2="18"/>
|
|
7866
|
-
</svg>`,
|
|
7879
|
+
</svg>`, Dn = `<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
7867
7880
|
<circle cx="20" cy="20" r="20" fill="#00D5AA"/>
|
|
7868
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"/>
|
|
7869
|
-
</svg>`,
|
|
7870
|
-
[Ue.MetaMask]:
|
|
7871
|
-
[Ue.Binance]:
|
|
7872
|
-
[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
|
|
7873
7886
|
}, It = `<svg width="20" height="20" viewBox="0 0 20 20" fill="none">
|
|
7874
7887
|
<rect x="2" y="5" width="16" height="12" rx="2" stroke="currentColor" stroke-width="1.5"/>
|
|
7875
7888
|
<path d="M2 9h16" stroke="currentColor" stroke-width="1.5"/>
|
|
7876
7889
|
<rect x="12.5" y="11.5" width="3.5" height="2.5" rx="0.75" fill="currentColor"/>
|
|
7877
|
-
</svg>`,
|
|
7890
|
+
</svg>`, Fn = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
7878
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)"/>
|
|
7879
7892
|
</svg>`, Hn = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
7880
7893
|
<circle cx="12" cy="12" r="12" fill="var(--cx-error)"/>
|
|
@@ -7914,10 +7927,10 @@ function Y(r, e) {
|
|
|
7914
7927
|
<div class="__crossx-row-value">${e}</div>
|
|
7915
7928
|
</div>`;
|
|
7916
7929
|
}
|
|
7917
|
-
function
|
|
7930
|
+
function Wn(r, e) {
|
|
7918
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>
|
|
7919
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");
|
|
7920
|
-
return f.id =
|
|
7933
|
+
return f.id = Z, f.innerHTML = `
|
|
7921
7934
|
<div class="__crossx-card __crossx-card--migration __crossx-card--sign-tx" style="${ae(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
7922
7935
|
<div class="__crossx-header">
|
|
7923
7936
|
<p class="__crossx-title" id="__crossx-ttl">Signature Request</p>
|
|
@@ -7955,10 +7968,10 @@ function Fn(r, e) {
|
|
|
7955
7968
|
</div>
|
|
7956
7969
|
`, f;
|
|
7957
7970
|
}
|
|
7958
|
-
function
|
|
7971
|
+
function Gn(r, e) {
|
|
7959
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>
|
|
7960
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");
|
|
7961
|
-
return u.id =
|
|
7974
|
+
return u.id = Z, u.innerHTML = `
|
|
7962
7975
|
<div class="__crossx-card __crossx-card--migration __crossx-card--send-tx" style="${ae(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
7963
7976
|
<div class="__crossx-header">
|
|
7964
7977
|
<p class="__crossx-title" id="__crossx-ttl">Approve transaction</p>
|
|
@@ -7997,10 +8010,10 @@ function et(r) {
|
|
|
7997
8010
|
function L(r) {
|
|
7998
8011
|
return r.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
7999
8012
|
}
|
|
8000
|
-
function
|
|
8013
|
+
function qn(r) {
|
|
8001
8014
|
return typeof r == "string" && /^0x[0-9a-fA-F]{40}$/i.test(r);
|
|
8002
8015
|
}
|
|
8003
|
-
function
|
|
8016
|
+
function Kn(r) {
|
|
8004
8017
|
if (typeof r == "string") return L(r);
|
|
8005
8018
|
if (typeof r == "number" || typeof r == "bigint" || typeof r == "boolean") return String(r);
|
|
8006
8019
|
try {
|
|
@@ -8009,7 +8022,7 @@ function qn(r) {
|
|
|
8009
8022
|
return String(r);
|
|
8010
8023
|
}
|
|
8011
8024
|
}
|
|
8012
|
-
function
|
|
8025
|
+
function zn(r, e) {
|
|
8013
8026
|
const s = Y(
|
|
8014
8027
|
"From",
|
|
8015
8028
|
`<span class="__crossx-addr-text">${re(r.from)}</span>
|
|
@@ -8020,7 +8033,7 @@ function Kn(r, e) {
|
|
|
8020
8033
|
<span class="__crossx-total-label">Total<br>(including fees)</span>
|
|
8021
8034
|
<span class="__crossx-total-amount">${L(r.total)}</span>
|
|
8022
8035
|
</div>` : "", c = document.createElement("div");
|
|
8023
|
-
return c.id =
|
|
8036
|
+
return c.id = Z, c.innerHTML = `
|
|
8024
8037
|
<div class="__crossx-card __crossx-card--migration" style="${ae(e)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8025
8038
|
<div class="__crossx-header">
|
|
8026
8039
|
<p class="__crossx-title" id="__crossx-ttl">Transaction complete</p>
|
|
@@ -8041,9 +8054,9 @@ function Kn(r, e) {
|
|
|
8041
8054
|
</div>
|
|
8042
8055
|
`, c;
|
|
8043
8056
|
}
|
|
8044
|
-
function
|
|
8057
|
+
function Vn(r, e) {
|
|
8045
8058
|
const s = document.createElement("div");
|
|
8046
|
-
return s.id =
|
|
8059
|
+
return s.id = Z, s.innerHTML = `
|
|
8047
8060
|
<div class="__crossx-card __crossx-card--migration" style="${ae(e)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8048
8061
|
<div class="__crossx-header">
|
|
8049
8062
|
<p class="__crossx-title" id="__crossx-ttl">Waiting for confirmation</p>
|
|
@@ -8058,10 +8071,10 @@ function zn(r, e) {
|
|
|
8058
8071
|
</div>
|
|
8059
8072
|
`, s;
|
|
8060
8073
|
}
|
|
8061
|
-
function
|
|
8074
|
+
function jn(r, e, s) {
|
|
8062
8075
|
const t = e.status !== "reverted" && e.status !== "timeout", n = e.status === "timeout", o = r.querySelector("#__crossx-ttl"), i = r.querySelector(".__crossx-header");
|
|
8063
8076
|
if (o) {
|
|
8064
|
-
const b = n ? Hn : t ? "" :
|
|
8077
|
+
const b = n ? Hn : t ? "" : Fn, E = n ? "Transaction timeout" : t ? "Transaction complete" : "Transaction failed";
|
|
8065
8078
|
b ? (o.style.display = "flex", o.style.alignItems = "center", o.style.gap = "8px", o.innerHTML = `${b}<span>${E}</span>`) : o.textContent = E;
|
|
8066
8079
|
}
|
|
8067
8080
|
if (i && !r.querySelector("#__crossx-close-btn")) {
|
|
@@ -8097,9 +8110,9 @@ function Vn(r, e, s) {
|
|
|
8097
8110
|
});
|
|
8098
8111
|
});
|
|
8099
8112
|
}
|
|
8100
|
-
function
|
|
8113
|
+
function Yn(r, e) {
|
|
8101
8114
|
const s = e, t = et(r.dappName), n = L(r.message), o = document.createElement("div");
|
|
8102
|
-
return o.id =
|
|
8115
|
+
return o.id = Z, o.innerHTML = `
|
|
8103
8116
|
<div class="__crossx-card __crossx-card--migration __crossx-card--sign-msg" style="${ae(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8104
8117
|
<div class="__crossx-header">
|
|
8105
8118
|
<p class="__crossx-title" id="__crossx-ttl">Signature Request</p>
|
|
@@ -8129,7 +8142,7 @@ function jn(r, e) {
|
|
|
8129
8142
|
</div>
|
|
8130
8143
|
`, o;
|
|
8131
8144
|
}
|
|
8132
|
-
function
|
|
8145
|
+
function Xn(r, e) {
|
|
8133
8146
|
const s = e, t = et(r.dappName);
|
|
8134
8147
|
let n = {};
|
|
8135
8148
|
if (typeof r.typedData == "string")
|
|
@@ -8145,7 +8158,7 @@ function Yn(r, e) {
|
|
|
8145
8158
|
<span class="__crossx-td-value">${L(o)}</span>
|
|
8146
8159
|
</div>`;
|
|
8147
8160
|
for (const [l, u] of Object.entries(i)) {
|
|
8148
|
-
const f =
|
|
8161
|
+
const f = Kn(u), p = qn(u) ? `<span class="__crossx-addr-text">${re(u)}</span>
|
|
8149
8162
|
<button class="__crossx-copy-btn" data-copy="${L(String(u))}" title="Copy">${me}</button>` : `<span>${f}</span>`;
|
|
8150
8163
|
a += `
|
|
8151
8164
|
<div class="__crossx-td-row">
|
|
@@ -8154,7 +8167,7 @@ function Yn(r, e) {
|
|
|
8154
8167
|
</div>`;
|
|
8155
8168
|
}
|
|
8156
8169
|
const c = document.createElement("div");
|
|
8157
|
-
return c.id =
|
|
8170
|
+
return c.id = Z, c.innerHTML = `
|
|
8158
8171
|
<div class="__crossx-card __crossx-card--migration __crossx-card--sign-typed" style="${ae(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8159
8172
|
<div class="__crossx-header">
|
|
8160
8173
|
<p class="__crossx-title" id="__crossx-ttl">Signature Request</p>
|
|
@@ -8184,18 +8197,18 @@ function Yn(r, e) {
|
|
|
8184
8197
|
</div>
|
|
8185
8198
|
`, c;
|
|
8186
8199
|
}
|
|
8187
|
-
const
|
|
8200
|
+
const Jn = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
|
|
8188
8201
|
<line x1="12" y1="5" x2="12" y2="19"/>
|
|
8189
8202
|
<line x1="5" y1="12" x2="19" y2="12"/>
|
|
8190
8203
|
</svg>`;
|
|
8191
|
-
function
|
|
8204
|
+
function Zn(r, e, s) {
|
|
8192
8205
|
const t = s == null ? void 0 : s.toLowerCase(), n = r.map((i) => {
|
|
8193
8206
|
const a = t && i.address.toLowerCase() === t;
|
|
8194
8207
|
return `<button class="__crossx-wallet-item" data-wallet-index="${i.index}" data-wallet-address="${L(i.address)}">
|
|
8195
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>' : ""}
|
|
8196
8209
|
</button>`;
|
|
8197
8210
|
}).join(""), o = document.createElement("div");
|
|
8198
|
-
return o.id =
|
|
8211
|
+
return o.id = Z, o.innerHTML = `
|
|
8199
8212
|
<div class="__crossx-card __crossx-card--migration __crossx-card--wallet-selector" style="${ae(e)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8200
8213
|
<div class="__crossx-header">
|
|
8201
8214
|
<div style="display:flex;flex-direction:column;gap:4px;padding-right:36px;">
|
|
@@ -8219,7 +8232,7 @@ function Jn(r, e, s) {
|
|
|
8219
8232
|
${n}
|
|
8220
8233
|
</div>
|
|
8221
8234
|
<button class="__crossx-wallet-add" id="__crossx-add-wallet-btn" type="button">
|
|
8222
|
-
<span class="__crossx-wallet-add-icon">${
|
|
8235
|
+
<span class="__crossx-wallet-add-icon">${Jn}</span>
|
|
8223
8236
|
<span class="__crossx-wallet-add-label">add a wallet</span>
|
|
8224
8237
|
</button>
|
|
8225
8238
|
</div>
|
|
@@ -8228,22 +8241,22 @@ function Jn(r, e, s) {
|
|
|
8228
8241
|
</div>
|
|
8229
8242
|
`, o;
|
|
8230
8243
|
}
|
|
8231
|
-
const
|
|
8244
|
+
const Qn = `<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
8232
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"/>
|
|
8233
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"/>
|
|
8234
|
-
</svg>`,
|
|
8247
|
+
</svg>`, eo = `<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
8235
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"/>
|
|
8236
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"/>
|
|
8237
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"/>
|
|
8238
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"/>
|
|
8239
8252
|
</svg>`;
|
|
8240
|
-
function
|
|
8253
|
+
function to(r) {
|
|
8241
8254
|
const e = js(r);
|
|
8242
|
-
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>`;
|
|
8243
8256
|
}
|
|
8244
|
-
function
|
|
8257
|
+
function so(r) {
|
|
8245
8258
|
if (r.length === 0) return "";
|
|
8246
|
-
const e = (n) =>
|
|
8259
|
+
const e = (n) => to(r[n]), s = "Supported wallets include ";
|
|
8247
8260
|
if (r.length === 1)
|
|
8248
8261
|
return `${s}${e(0)}.`;
|
|
8249
8262
|
if (r.length === 2)
|
|
@@ -8253,7 +8266,7 @@ function to(r) {
|
|
|
8253
8266
|
const t = r.length - 3;
|
|
8254
8267
|
return `${s}${e(0)}, ${e(1)}, ${e(2)}, and ${t} more.`;
|
|
8255
8268
|
}
|
|
8256
|
-
function
|
|
8269
|
+
function ro(r, e = []) {
|
|
8257
8270
|
const s = r, t = L(String(e[0])), n = e.length > 0 ? `
|
|
8258
8271
|
<div class="__crossx-login-or-divider">
|
|
8259
8272
|
<hr><span>or</span><hr>
|
|
@@ -8261,10 +8274,10 @@ function so(r, e = []) {
|
|
|
8261
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">
|
|
8262
8275
|
<span class="__crossx-connect-other-text">
|
|
8263
8276
|
<span class="__crossx-connect-other-title" id="__crossx-connect-other-heading">Connect with Other Wallets</span>
|
|
8264
|
-
<span class="__crossx-connect-other-desc __crossx-connect-other-summary">${
|
|
8277
|
+
<span class="__crossx-connect-other-desc __crossx-connect-other-summary">${so(e)}</span>
|
|
8265
8278
|
</span>
|
|
8266
8279
|
</button>` : "", o = document.createElement("div");
|
|
8267
|
-
return o.id =
|
|
8280
|
+
return o.id = Z, o.innerHTML = `
|
|
8268
8281
|
<div class="__crossx-card __crossx-card--migration" style="${ae(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8269
8282
|
<div class="__crossx-header">
|
|
8270
8283
|
<div style="display:flex;flex-direction:column;gap:4px;padding-right:36px;">
|
|
@@ -8277,11 +8290,11 @@ function so(r, e = []) {
|
|
|
8277
8290
|
<div class="__crossx-body">
|
|
8278
8291
|
<div class="__crossx-login-btn-row">
|
|
8279
8292
|
<button class="__crossx-login-btn" id="__crossx-apple-btn" type="button">
|
|
8280
|
-
<span class="__crossx-login-icon" style="color:var(--cx-value);">${
|
|
8293
|
+
<span class="__crossx-login-icon" style="color:var(--cx-value);">${Qn}</span>
|
|
8281
8294
|
<span class="__crossx-login-btn-label">Sign in with Apple</span>
|
|
8282
8295
|
</button>
|
|
8283
8296
|
<button class="__crossx-login-btn" id="__crossx-google-btn" type="button">
|
|
8284
|
-
<span class="__crossx-login-icon">${
|
|
8297
|
+
<span class="__crossx-login-icon">${eo}</span>
|
|
8285
8298
|
<span class="__crossx-login-btn-label">Sign in with Google</span>
|
|
8286
8299
|
</button>
|
|
8287
8300
|
</div>${n}
|
|
@@ -8292,9 +8305,9 @@ function so(r, e = []) {
|
|
|
8292
8305
|
</div>
|
|
8293
8306
|
`, o;
|
|
8294
8307
|
}
|
|
8295
|
-
function
|
|
8308
|
+
function no(r, e) {
|
|
8296
8309
|
const s = r, t = document.createElement("div");
|
|
8297
|
-
t.id =
|
|
8310
|
+
t.id = Z;
|
|
8298
8311
|
const n = L(e.message).replace(/\n/g, "<br>"), o = e.email ? `<div class="__crossx-session-account-card">
|
|
8299
8312
|
<p class="__crossx-session-account-label">${L(e.accountLabel)}</p>
|
|
8300
8313
|
<p class="__crossx-session-account-email">${L(e.email)}</p>
|
|
@@ -8320,9 +8333,9 @@ function ro(r, e) {
|
|
|
8320
8333
|
</div>
|
|
8321
8334
|
`, t;
|
|
8322
8335
|
}
|
|
8323
|
-
function
|
|
8336
|
+
function oo(r, e = !0) {
|
|
8324
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");
|
|
8325
|
-
return o.id =
|
|
8338
|
+
return o.id = Z, o.innerHTML = `
|
|
8326
8339
|
<div class="__crossx-card __crossx-card--migration" style="${ae(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8327
8340
|
<div class="__crossx-header">
|
|
8328
8341
|
<p class="__crossx-title" id="__crossx-ttl">Wallet Found on Social Account 🎉</p>
|
|
@@ -8336,7 +8349,7 @@ function no(r, e = !0) {
|
|
|
8336
8349
|
<p class="__crossx-mig-info-desc">It safely restores and integrates all your previous assets. Simply verify your PIN to get started.</p>
|
|
8337
8350
|
</div>
|
|
8338
8351
|
<button class="__crossx-recover-btn" id="__crossx-recover-btn">
|
|
8339
|
-
<span class="__crossx-recover-icon">${
|
|
8352
|
+
<span class="__crossx-recover-icon">${Dn}</span>
|
|
8340
8353
|
<span class="__crossx-recover-label">Import from Social Backup</span>
|
|
8341
8354
|
</button>
|
|
8342
8355
|
${n}
|
|
@@ -8344,9 +8357,9 @@ function no(r, e = !0) {
|
|
|
8344
8357
|
</div>
|
|
8345
8358
|
`, o;
|
|
8346
8359
|
}
|
|
8347
|
-
function
|
|
8360
|
+
function io(r, e) {
|
|
8348
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");
|
|
8349
|
-
return f.id =
|
|
8362
|
+
return f.id = Z, f.innerHTML = `
|
|
8350
8363
|
<div class="__crossx-card __crossx-card--migration" style="${ae(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8351
8364
|
<div class="__crossx-header">
|
|
8352
8365
|
<p class="__crossx-title" id="__crossx-ttl">Import from Social Backup</p>
|
|
@@ -8368,13 +8381,13 @@ function oo(r, e) {
|
|
|
8368
8381
|
</div>
|
|
8369
8382
|
`, f;
|
|
8370
8383
|
}
|
|
8371
|
-
function
|
|
8384
|
+
function ao(r) {
|
|
8372
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");
|
|
8373
8386
|
return `${n}, ${o} ${i} ${a}:${c}`;
|
|
8374
8387
|
}
|
|
8375
|
-
function
|
|
8376
|
-
const t = r, n = e <= 0, o = n ? null : Date.now() + e * 1e3, i = o ?
|
|
8377
|
-
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 = `
|
|
8378
8391
|
<div class="__crossx-card __crossx-card--migration" style="${ae(t)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8379
8392
|
<div class="__crossx-header">
|
|
8380
8393
|
<p class="__crossx-title" id="__crossx-ttl">Import from Social Backup</p>
|
|
@@ -8403,10 +8416,10 @@ function ao(r, e, s) {
|
|
|
8403
8416
|
return () => clearInterval(f);
|
|
8404
8417
|
} };
|
|
8405
8418
|
}
|
|
8406
|
-
function
|
|
8419
|
+
function lo(r) {
|
|
8407
8420
|
const s = [r.check1, r.check2].map((t, n) => `
|
|
8408
8421
|
<div class="__crossx-pw-notice-item" data-check-index="${n}" role="checkbox" aria-checked="false" tabindex="0">
|
|
8409
|
-
<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>
|
|
8410
8423
|
<span class="__crossx-pw-notice-item-text">${L(t)}</span>
|
|
8411
8424
|
</div>
|
|
8412
8425
|
`).join("");
|
|
@@ -8421,7 +8434,7 @@ function co(r) {
|
|
|
8421
8434
|
<div class="__crossx-pw-fields __crossx-pw-fields--notice">
|
|
8422
8435
|
<div class="__crossx-pw-notice-header">
|
|
8423
8436
|
<div class="__crossx-pw-notice-title-row">
|
|
8424
|
-
<span class="__crossx-pw-notice-icon">${
|
|
8437
|
+
<span class="__crossx-pw-notice-icon">${_o}</span>
|
|
8425
8438
|
<p class="__crossx-pw-notice-title">${L(r.noticeTitle)}</p>
|
|
8426
8439
|
</div>
|
|
8427
8440
|
<p class="__crossx-pw-notice-desc">${L(r.noticeDesc)}</p>
|
|
@@ -8441,7 +8454,7 @@ function co(r) {
|
|
|
8441
8454
|
}
|
|
8442
8455
|
function lt(r) {
|
|
8443
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">
|
|
8444
|
-
${
|
|
8457
|
+
${Fs}
|
|
8445
8458
|
<span id="__crossx-pin6-lock-countdown"></span>
|
|
8446
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(
|
|
8447
8460
|
{ length: 6 },
|
|
@@ -8469,7 +8482,7 @@ function lt(r) {
|
|
|
8469
8482
|
<div class="__crossx-pin6-numpad-row">
|
|
8470
8483
|
<button type="button" class="__crossx-pin6-numpad-key --empty" aria-hidden="true"></button>
|
|
8471
8484
|
<button type="button" class="__crossx-pin6-numpad-key${p}" data-key="0">0</button>
|
|
8472
|
-
<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>
|
|
8473
8486
|
</div>
|
|
8474
8487
|
</div>`;
|
|
8475
8488
|
return `
|
|
@@ -8497,20 +8510,20 @@ function lt(r) {
|
|
|
8497
8510
|
}
|
|
8498
8511
|
function ns(r, e) {
|
|
8499
8512
|
const s = document.createElement("div");
|
|
8500
|
-
return s.id =
|
|
8513
|
+
return s.id = Z, s.innerHTML = `
|
|
8501
8514
|
<div class="__crossx-card __crossx-card--pin6" style="${ae(r)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8502
8515
|
${e}
|
|
8503
8516
|
</div>
|
|
8504
8517
|
`, s;
|
|
8505
8518
|
}
|
|
8506
|
-
function
|
|
8519
|
+
function uo(r, e) {
|
|
8507
8520
|
if (r.length !== 6) return e.tooShort;
|
|
8508
8521
|
if (!/^\d+$/.test(r)) return e.numbersOnly;
|
|
8509
8522
|
if (/(.)\1{2}/.test(r)) return e.repeatingDigit;
|
|
8510
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);
|
|
8511
8524
|
return t || n ? e.sequential : r[0] !== r[1] && r === r.slice(0, 2).repeat(3) ? e.alternatingPattern : null;
|
|
8512
8525
|
}
|
|
8513
|
-
function
|
|
8526
|
+
function ho(r) {
|
|
8514
8527
|
const e = Math.max(0, Math.ceil(r / 1e3)), s = Math.floor(e / 3600), t = Math.floor(e % 3600 / 60), n = e % 60;
|
|
8515
8528
|
return s > 0 ? `${s}h ${String(t).padStart(2, "0")}m` : `${String(t).padStart(2, "0")}:${String(n).padStart(2, "0")}`;
|
|
8516
8529
|
}
|
|
@@ -8521,24 +8534,24 @@ function dt(r, e, s, t, n, o, i) {
|
|
|
8521
8534
|
var v;
|
|
8522
8535
|
const w = l(), y = S();
|
|
8523
8536
|
if (y.length && (y.forEach((I, R) => {
|
|
8524
|
-
const
|
|
8525
|
-
I.classList.toggle("--filled",
|
|
8537
|
+
const F = !!(w[R] && w[R].value);
|
|
8538
|
+
I.classList.toggle("--filled", F), I.classList.toggle("--active", !1);
|
|
8526
8539
|
}), !a && !c)) {
|
|
8527
|
-
const I = w.findIndex((
|
|
8540
|
+
const I = w.findIndex((F) => !F.value);
|
|
8528
8541
|
(v = y[I === -1 ? 5 : I]) == null || v.classList.add("--active");
|
|
8529
8542
|
}
|
|
8530
8543
|
}, k = () => {
|
|
8531
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();
|
|
8532
|
-
},
|
|
8545
|
+
}, H = (w) => {
|
|
8533
8546
|
a = w, l().forEach((y) => {
|
|
8534
8547
|
y.disabled = w, y.classList.toggle("--locked", w);
|
|
8535
8548
|
});
|
|
8536
8549
|
}, M = () => r.querySelector("#__crossx-pin6-attempt"), K = () => {
|
|
8537
8550
|
const w = f();
|
|
8538
8551
|
w && (w.textContent = "");
|
|
8539
|
-
}, 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) => {
|
|
8540
8553
|
var v;
|
|
8541
|
-
let y =
|
|
8554
|
+
let y = Q();
|
|
8542
8555
|
if (!y) {
|
|
8543
8556
|
y = document.createElement("p"), y.className = "__crossx-pin6-warning", y.id = "__crossx-pin6-warning";
|
|
8544
8557
|
const I = f();
|
|
@@ -8546,14 +8559,14 @@ function dt(r, e, s, t, n, o, i) {
|
|
|
8546
8559
|
}
|
|
8547
8560
|
y.textContent = w;
|
|
8548
8561
|
}, J = () => {
|
|
8549
|
-
const w =
|
|
8562
|
+
const w = Q();
|
|
8550
8563
|
w && (w.textContent = "");
|
|
8551
|
-
},
|
|
8564
|
+
}, ee = (w, y) => {
|
|
8552
8565
|
var I;
|
|
8553
8566
|
let v = M();
|
|
8554
8567
|
if (!v) {
|
|
8555
8568
|
v = document.createElement("p"), v.className = "__crossx-pin6-attempt", v.id = "__crossx-pin6-attempt";
|
|
8556
|
-
const R =
|
|
8569
|
+
const R = Q() ?? f();
|
|
8557
8570
|
R ? R.insertAdjacentElement("afterend", v) : (I = b()) == null || I.appendChild(v);
|
|
8558
8571
|
}
|
|
8559
8572
|
v.textContent = `${w}/${y}`;
|
|
@@ -8571,24 +8584,24 @@ function dt(r, e, s, t, n, o, i) {
|
|
|
8571
8584
|
(I = l()[0]) == null || I.focus(), A();
|
|
8572
8585
|
}, 50);
|
|
8573
8586
|
}, $ = (w) => {
|
|
8574
|
-
var
|
|
8575
|
-
|
|
8587
|
+
var F;
|
|
8588
|
+
H(!0), l().forEach((B) => {
|
|
8576
8589
|
B.value = "";
|
|
8577
8590
|
}), k();
|
|
8578
8591
|
const y = f();
|
|
8579
8592
|
if (y && (y.textContent = "Too many failed attempts. Please wait."), !_()) {
|
|
8580
8593
|
const B = document.createElement("p");
|
|
8581
|
-
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>`;
|
|
8582
8595
|
const N = f();
|
|
8583
|
-
N ? N.insertAdjacentElement("afterend", B) : (
|
|
8596
|
+
N ? N.insertAdjacentElement("afterend", B) : (F = b()) == null || F.appendChild(B);
|
|
8584
8597
|
}
|
|
8585
8598
|
const v = () => {
|
|
8586
8599
|
var G;
|
|
8587
8600
|
const B = w - Date.now(), N = p();
|
|
8588
|
-
B <= 0 ? (clearInterval(I),
|
|
8601
|
+
B <= 0 ? (clearInterval(I), H(!1), (G = _()) == null || G.remove(), y && (y.textContent = ""), k(), setTimeout(() => {
|
|
8589
8602
|
var X;
|
|
8590
8603
|
return (X = l()[0]) == null ? void 0 : X.focus();
|
|
8591
|
-
}, 50)) : N && (N.textContent = ` ${
|
|
8604
|
+
}, 50)) : N && (N.textContent = ` ${ho(B)}`);
|
|
8592
8605
|
}, I = setInterval(v, 1e3);
|
|
8593
8606
|
v();
|
|
8594
8607
|
const R = new MutationObserver(() => {
|
|
@@ -8605,7 +8618,7 @@ function dt(r, e, s, t, n, o, i) {
|
|
|
8605
8618
|
try {
|
|
8606
8619
|
if (n) {
|
|
8607
8620
|
const y = await n(w);
|
|
8608
|
-
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()));
|
|
8609
8622
|
} else
|
|
8610
8623
|
e(w);
|
|
8611
8624
|
} catch (y) {
|
|
@@ -8642,15 +8655,15 @@ function dt(r, e, s, t, n, o, i) {
|
|
|
8642
8655
|
if (v.preventDefault(), w.value)
|
|
8643
8656
|
w.value = "";
|
|
8644
8657
|
else if (y > 0) {
|
|
8645
|
-
const
|
|
8646
|
-
|
|
8658
|
+
const F = l()[y - 1];
|
|
8659
|
+
F.value = "", F.focus();
|
|
8647
8660
|
}
|
|
8648
8661
|
A();
|
|
8649
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();
|
|
8650
8663
|
}), w.addEventListener("paste", (v) => {
|
|
8651
|
-
var
|
|
8664
|
+
var F, B;
|
|
8652
8665
|
v.preventDefault();
|
|
8653
|
-
const I = (((
|
|
8666
|
+
const I = (((F = v.clipboardData) == null ? void 0 : F.getData("text")) ?? "").replace(/\D/g, "").slice(0, 6);
|
|
8654
8667
|
if (!I) return;
|
|
8655
8668
|
const R = l();
|
|
8656
8669
|
I.split("").forEach((N, G) => {
|
|
@@ -8684,23 +8697,23 @@ function dt(r, e, s, t, n, o, i) {
|
|
|
8684
8697
|
if (!w) return;
|
|
8685
8698
|
const R = w;
|
|
8686
8699
|
y();
|
|
8687
|
-
const
|
|
8688
|
-
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);
|
|
8689
8702
|
}), T.addEventListener("pointercancel", y), T.addEventListener("pointerleave", y, !0), A(), o && o > Date.now() && k();
|
|
8690
8703
|
}
|
|
8691
8704
|
}
|
|
8692
|
-
const
|
|
8705
|
+
const po = `<svg width="22" height="17" viewBox="0 0 22 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
8693
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"/>
|
|
8694
8707
|
<line x1="10" y1="5.5" x2="16" y2="11.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
|
8695
8708
|
<line x1="16" y1="5.5" x2="10" y2="11.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
|
8696
|
-
</svg>`,
|
|
8709
|
+
</svg>`, Fs = `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
8697
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"/>
|
|
8698
|
-
</svg>`,
|
|
8711
|
+
</svg>`, fo = `<svg width="11" height="9" viewBox="0 0 11 9" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
8699
8712
|
<path d="M1 4.5L4 7.5L10 1" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
8700
|
-
</svg>`,
|
|
8713
|
+
</svg>`, _o = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
8701
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"/>
|
|
8702
8715
|
</svg>`;
|
|
8703
|
-
function
|
|
8716
|
+
function xo(r, e, s) {
|
|
8704
8717
|
var o;
|
|
8705
8718
|
const t = r.querySelectorAll(".__crossx-pin-input");
|
|
8706
8719
|
t.forEach((i, a) => {
|
|
@@ -8733,7 +8746,7 @@ function _o(r, e, s) {
|
|
|
8733
8746
|
}
|
|
8734
8747
|
}), (o = t[0]) == null || o.focus();
|
|
8735
8748
|
}
|
|
8736
|
-
class
|
|
8749
|
+
class go {
|
|
8737
8750
|
constructor(e = "light", s) {
|
|
8738
8751
|
this.theme = e, this.overrides = s, this.tokens = ss(e, s);
|
|
8739
8752
|
}
|
|
@@ -8755,7 +8768,7 @@ class xo {
|
|
|
8755
8768
|
return new Promise((n) => {
|
|
8756
8769
|
var E;
|
|
8757
8770
|
le();
|
|
8758
|
-
const o = [...e], i =
|
|
8771
|
+
const o = [...e], i = Zn(o, this.tokens, t), a = Oe();
|
|
8759
8772
|
de(i);
|
|
8760
8773
|
let c = !1;
|
|
8761
8774
|
const l = () => {
|
|
@@ -8810,7 +8823,7 @@ class xo {
|
|
|
8810
8823
|
return new Promise((n) => {
|
|
8811
8824
|
var _, p, b, E;
|
|
8812
8825
|
le();
|
|
8813
|
-
const o =
|
|
8826
|
+
const o = ro(this.tokens, s), i = Oe();
|
|
8814
8827
|
de(o);
|
|
8815
8828
|
const a = () => {
|
|
8816
8829
|
o.remove(), i();
|
|
@@ -8839,7 +8852,7 @@ class xo {
|
|
|
8839
8852
|
return new Promise((s) => {
|
|
8840
8853
|
var u, f, _;
|
|
8841
8854
|
le();
|
|
8842
|
-
const t = this.messages, n =
|
|
8855
|
+
const t = this.messages, n = no(this.tokens, {
|
|
8843
8856
|
title: e.title,
|
|
8844
8857
|
message: e.message,
|
|
8845
8858
|
email: e.email,
|
|
@@ -8869,7 +8882,7 @@ class xo {
|
|
|
8869
8882
|
return new Promise((t) => {
|
|
8870
8883
|
var a, c, l;
|
|
8871
8884
|
le();
|
|
8872
|
-
const n =
|
|
8885
|
+
const n = oo(this.tokens, s);
|
|
8873
8886
|
de(n);
|
|
8874
8887
|
const o = () => n.remove(), i = () => {
|
|
8875
8888
|
o(), t("recover");
|
|
@@ -8915,7 +8928,7 @@ class xo {
|
|
|
8915
8928
|
}, i = {
|
|
8916
8929
|
title: (t == null ? void 0 : t.pinSetup_confirmTitle) ?? "Confirm PIN",
|
|
8917
8930
|
headerSubtitle: (t == null ? void 0 : t.pinSetup_confirmSubtitle) ?? "Enter your PIN again to confirm."
|
|
8918
|
-
}, a = ns(this.tokens,
|
|
8931
|
+
}, a = ns(this.tokens, lo(n)), c = Oe();
|
|
8919
8932
|
de(a);
|
|
8920
8933
|
let l = !1;
|
|
8921
8934
|
const u = () => {
|
|
@@ -8931,40 +8944,40 @@ class xo {
|
|
|
8931
8944
|
sequential: (t == null ? void 0 : t.pinValidation_sequential) ?? "Sequential numbers (e.g., 123456) are not allowed.",
|
|
8932
8945
|
alternatingPattern: (t == null ? void 0 : t.pinValidation_alternatingPattern) ?? "Repeating patterns (e.g., 121212) are not allowed."
|
|
8933
8946
|
}, E = (k) => {
|
|
8934
|
-
var
|
|
8947
|
+
var H;
|
|
8935
8948
|
p.innerHTML = lt({
|
|
8936
8949
|
title: i.title,
|
|
8937
8950
|
headerSubtitle: i.headerSubtitle
|
|
8938
|
-
}), (
|
|
8951
|
+
}), (H = p.querySelector("#__crossx-close-btn")) == null || H.addEventListener("click", _), dt(p, (M) => {
|
|
8939
8952
|
M === k ? f(k) : S(o.mismatchError);
|
|
8940
8953
|
}, _);
|
|
8941
8954
|
}, S = (k) => {
|
|
8942
|
-
var
|
|
8955
|
+
var H;
|
|
8943
8956
|
p.innerHTML = lt({
|
|
8944
8957
|
title: o.title,
|
|
8945
8958
|
headerSubtitle: o.headerSubtitle,
|
|
8946
8959
|
subtitle: o.subtitle,
|
|
8947
8960
|
errorMessage: k
|
|
8948
|
-
}), (
|
|
8949
|
-
const K =
|
|
8961
|
+
}), (H = p.querySelector("#__crossx-close-btn")) == null || H.addEventListener("click", _), dt(p, (M) => {
|
|
8962
|
+
const K = uo(M, b);
|
|
8950
8963
|
K ? S(K) : E(M);
|
|
8951
8964
|
}, _);
|
|
8952
8965
|
};
|
|
8953
8966
|
(() => {
|
|
8954
|
-
var
|
|
8955
|
-
const k = Array.from(p.querySelectorAll(".__crossx-pw-notice-item")),
|
|
8956
|
-
|
|
8957
|
-
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 = () => {
|
|
8958
8971
|
const U = M.size === k.length;
|
|
8959
|
-
|
|
8972
|
+
H.classList.toggle("--disabled", !U), H.textContent = U ? q : K;
|
|
8960
8973
|
}, W = (U, C) => {
|
|
8961
8974
|
if (M.has(C)) return;
|
|
8962
8975
|
const $ = U.querySelector(`#__crossx-notice-check-${C}`);
|
|
8963
|
-
M.add(C), $.classList.add("--checked"), U.setAttribute("aria-checked", "true"),
|
|
8976
|
+
M.add(C), $.classList.add("--checked"), U.setAttribute("aria-checked", "true"), Q();
|
|
8964
8977
|
}, J = (U, C) => {
|
|
8965
8978
|
if (!M.has(C)) return;
|
|
8966
8979
|
const $ = U.querySelector(`#__crossx-notice-check-${C}`);
|
|
8967
|
-
M.delete(C), $.classList.remove("--checked"), U.setAttribute("aria-checked", "false"),
|
|
8980
|
+
M.delete(C), $.classList.remove("--checked"), U.setAttribute("aria-checked", "false"), Q();
|
|
8968
8981
|
};
|
|
8969
8982
|
k.forEach((U) => {
|
|
8970
8983
|
const C = parseInt(U.dataset.checkIndex ?? "0", 10);
|
|
@@ -8973,7 +8986,7 @@ class xo {
|
|
|
8973
8986
|
}), U.addEventListener("keydown", ($) => {
|
|
8974
8987
|
($.key === " " || $.key === "Enter") && ($.preventDefault(), M.has(C) ? J(U, C) : W(U, C));
|
|
8975
8988
|
});
|
|
8976
|
-
}),
|
|
8989
|
+
}), H.addEventListener("click", () => {
|
|
8977
8990
|
if (M.size === k.length) {
|
|
8978
8991
|
S(e == null ? void 0 : e.errorMessage);
|
|
8979
8992
|
return;
|
|
@@ -8987,7 +9000,7 @@ class xo {
|
|
|
8987
9000
|
U.scrollIntoView({ behavior: "smooth", block: "nearest" }), U.classList.add("--highlight"), setTimeout(() => {
|
|
8988
9001
|
U.classList.remove("--highlight"), W(U, C);
|
|
8989
9002
|
}, 400);
|
|
8990
|
-
}), (
|
|
9003
|
+
}), (ee = p.querySelector("#__crossx-close-btn")) == null || ee.addEventListener("click", _);
|
|
8991
9004
|
})(), a.addEventListener("click", (k) => {
|
|
8992
9005
|
k.target === a && _();
|
|
8993
9006
|
});
|
|
@@ -9041,14 +9054,14 @@ class xo {
|
|
|
9041
9054
|
return new Promise((s) => {
|
|
9042
9055
|
var a;
|
|
9043
9056
|
le();
|
|
9044
|
-
const t =
|
|
9057
|
+
const t = io(this.tokens, e);
|
|
9045
9058
|
de(t);
|
|
9046
9059
|
const n = () => t.remove(), o = (c) => {
|
|
9047
9060
|
n(), s(c);
|
|
9048
9061
|
}, i = () => {
|
|
9049
9062
|
n(), s(null);
|
|
9050
9063
|
};
|
|
9051
|
-
|
|
9064
|
+
xo(t, o, i), (a = t.querySelector("#__crossx-close-btn")) == null || a.addEventListener("click", i), t.addEventListener("click", (c) => {
|
|
9052
9065
|
c.target === t && i();
|
|
9053
9066
|
});
|
|
9054
9067
|
});
|
|
@@ -9063,7 +9076,7 @@ class xo {
|
|
|
9063
9076
|
return new Promise((t) => {
|
|
9064
9077
|
var l;
|
|
9065
9078
|
le();
|
|
9066
|
-
const { overlay: n, startCountdown: o } =
|
|
9079
|
+
const { overlay: n, startCountdown: o } = co(this.tokens, e, s);
|
|
9067
9080
|
de(n);
|
|
9068
9081
|
const i = () => {
|
|
9069
9082
|
c(), n.remove();
|
|
@@ -9083,7 +9096,7 @@ class xo {
|
|
|
9083
9096
|
return new Promise((s) => {
|
|
9084
9097
|
var a, c;
|
|
9085
9098
|
le();
|
|
9086
|
-
const t =
|
|
9099
|
+
const t = zn(e, this.tokens);
|
|
9087
9100
|
de(t);
|
|
9088
9101
|
const n = () => t.remove(), o = () => {
|
|
9089
9102
|
n(), s();
|
|
@@ -9112,7 +9125,7 @@ class xo {
|
|
|
9112
9125
|
showTransactionProgress(e, s) {
|
|
9113
9126
|
return new Promise((t) => {
|
|
9114
9127
|
le();
|
|
9115
|
-
const n =
|
|
9128
|
+
const n = Vn(e, this.tokens);
|
|
9116
9129
|
de(n);
|
|
9117
9130
|
const o = () => n.remove();
|
|
9118
9131
|
let i = !1;
|
|
@@ -9129,7 +9142,7 @@ class xo {
|
|
|
9129
9142
|
document.addEventListener("keydown", l);
|
|
9130
9143
|
};
|
|
9131
9144
|
s.then((l) => {
|
|
9132
|
-
i || (
|
|
9145
|
+
i || (jn(n, l, this.tokens), c());
|
|
9133
9146
|
});
|
|
9134
9147
|
});
|
|
9135
9148
|
}
|
|
@@ -9138,7 +9151,7 @@ class xo {
|
|
|
9138
9151
|
var l, u, f;
|
|
9139
9152
|
le();
|
|
9140
9153
|
let t;
|
|
9141
|
-
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);
|
|
9142
9155
|
const n = Oe();
|
|
9143
9156
|
de(t);
|
|
9144
9157
|
const o = () => {
|
|
@@ -9166,7 +9179,7 @@ class xo {
|
|
|
9166
9179
|
});
|
|
9167
9180
|
}
|
|
9168
9181
|
}
|
|
9169
|
-
class
|
|
9182
|
+
class mo {
|
|
9170
9183
|
constructor() {
|
|
9171
9184
|
this._accessToken = null, this._expiresAt = 0;
|
|
9172
9185
|
}
|
|
@@ -9198,7 +9211,7 @@ class go {
|
|
|
9198
9211
|
return !this._accessToken || this._expiresAt <= 0 ? !0 : Date.now() >= this._expiresAt - e;
|
|
9199
9212
|
}
|
|
9200
9213
|
}
|
|
9201
|
-
function
|
|
9214
|
+
function Ao(r, e) {
|
|
9202
9215
|
r.debug;
|
|
9203
9216
|
const s = Pe.production, t = {
|
|
9204
9217
|
...r,
|
|
@@ -9214,7 +9227,7 @@ function Io(r, e) {
|
|
|
9214
9227
|
"refresh_token이 평문 저장되지 않도록 세션 영속성이 제한됩니다.",
|
|
9215
9228
|
"IndexedDB를 지원하는 브라우저 사용을 권장합니다."
|
|
9216
9229
|
), t.secureStorageAvailable = o;
|
|
9217
|
-
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();
|
|
9218
9231
|
let _;
|
|
9219
9232
|
r.useMockWallet ? (d.log("[CROSSx] Mock Wallet Provider 사용"), _ = new kn(i, f)) : (d.log("[CROSSx] Remote Wallet Provider 사용"), _ = new Ae(
|
|
9220
9233
|
n,
|
|
@@ -9223,7 +9236,7 @@ function Io(r, e) {
|
|
|
9223
9236
|
u,
|
|
9224
9237
|
f
|
|
9225
9238
|
));
|
|
9226
|
-
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(
|
|
9227
9240
|
t,
|
|
9228
9241
|
n,
|
|
9229
9242
|
i,
|
|
@@ -9238,9 +9251,9 @@ function Io(r, e) {
|
|
|
9238
9251
|
);
|
|
9239
9252
|
return typeof window < "u" && (window.__crossxSDK = S), S;
|
|
9240
9253
|
}
|
|
9241
|
-
function
|
|
9242
|
-
const e =
|
|
9243
|
-
|
|
9254
|
+
function To(r) {
|
|
9255
|
+
const e = wo(r), s = yo(e), t = JSON.parse(s);
|
|
9256
|
+
So(t);
|
|
9244
9257
|
const { data: n } = t;
|
|
9245
9258
|
return {
|
|
9246
9259
|
status: t.status,
|
|
@@ -9254,7 +9267,7 @@ function Ao(r) {
|
|
|
9254
9267
|
raw: t
|
|
9255
9268
|
};
|
|
9256
9269
|
}
|
|
9257
|
-
function
|
|
9270
|
+
function wo(r) {
|
|
9258
9271
|
if (r.includes("://") && r.includes("?")) {
|
|
9259
9272
|
const e = new URL(r), s = e.searchParams.get("crossx_oauth_result");
|
|
9260
9273
|
if (s) return s;
|
|
@@ -9264,22 +9277,22 @@ function mo(r) {
|
|
|
9264
9277
|
}
|
|
9265
9278
|
return r;
|
|
9266
9279
|
}
|
|
9267
|
-
function
|
|
9280
|
+
function yo(r) {
|
|
9268
9281
|
if (r.startsWith("{"))
|
|
9269
9282
|
return r;
|
|
9270
9283
|
if (r.startsWith("%7B") || r.startsWith("%7b"))
|
|
9271
9284
|
return decodeURIComponent(r);
|
|
9272
|
-
const e =
|
|
9285
|
+
const e = bo(r);
|
|
9273
9286
|
return decodeURIComponent(e);
|
|
9274
9287
|
}
|
|
9275
|
-
function
|
|
9288
|
+
function bo(r) {
|
|
9276
9289
|
if (typeof atob == "function")
|
|
9277
9290
|
return atob(r);
|
|
9278
9291
|
if (typeof Buffer < "u")
|
|
9279
9292
|
return Buffer.from(r, "base64").toString("utf-8");
|
|
9280
9293
|
throw new Error("Base64 디코딩을 지원하는 환경이 아닙니다");
|
|
9281
9294
|
}
|
|
9282
|
-
function
|
|
9295
|
+
function So(r) {
|
|
9283
9296
|
if (typeof r != "object" || r === null)
|
|
9284
9297
|
throw new Error("Deeplink payload가 유효한 객체가 아닙니다");
|
|
9285
9298
|
const e = r;
|
|
@@ -9300,12 +9313,12 @@ export {
|
|
|
9300
9313
|
x as CROSSxError,
|
|
9301
9314
|
Zs as CROSSxEthereumProvider,
|
|
9302
9315
|
ht as CROSSxSDK,
|
|
9303
|
-
|
|
9316
|
+
Io as ChainId,
|
|
9304
9317
|
Ue as ConnectOtherWalletItem,
|
|
9305
9318
|
h as ErrorCode,
|
|
9306
9319
|
is as PinMemoryStore,
|
|
9307
|
-
|
|
9308
|
-
|
|
9320
|
+
mo as TokenMemoryStore,
|
|
9321
|
+
Ao as createCROSSxSDK,
|
|
9309
9322
|
js as getConnectOtherWalletLabel,
|
|
9310
|
-
|
|
9323
|
+
To as parseOAuthDeeplink
|
|
9311
9324
|
};
|