@nexus-cross/crossx-sdk-core 2.3.11-beta.1 → 2.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/constants.d.ts +1 -1
- package/dist/crossx.global +18 -21
- package/dist/index.cjs +29 -32
- package/dist/index.js +191 -190
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createRemoteJWKSet as
|
|
2
|
-
import { secp256k1 as
|
|
1
|
+
import { createRemoteJWKSet as Rt, jwtVerify as Ct, decodeJwt as Pt } from "jose";
|
|
2
|
+
import { secp256k1 as Nt } from "@noble/curves/secp256k1.js";
|
|
3
3
|
import { keccak_256 as Xe } from "@noble/hashes/sha3.js";
|
|
4
|
-
import { bytesToHex as
|
|
4
|
+
import { bytesToHex as Ot } from "@noble/hashes/utils.js";
|
|
5
5
|
var d = /* @__PURE__ */ ((i) => (i.AUTH_NOT_INITIALIZED = "AUTH_NOT_INITIALIZED", i.AUTH_FAILED = "AUTH_FAILED", i.AUTH_TOKEN_INVALID = "AUTH_TOKEN_INVALID", i.AUTH_TOKEN_EXPIRED = "AUTH_TOKEN_EXPIRED", i.AUTH_NOT_AUTHENTICATED = "AUTH_NOT_AUTHENTICATED", i.ALREADY_AUTHENTICATED = "ALREADY_AUTHENTICATED", i.SESSION_EXPIRED = "SESSION_EXPIRED", i.OAUTH_POPUP_BLOCKED = "OAUTH_POPUP_BLOCKED", i.WALLET_NOT_FOUND = "WALLET_NOT_FOUND", i.WALLET_CREATION_FAILED = "WALLET_CREATION_FAILED", i.WALLET_ALREADY_EXISTS = "WALLET_ALREADY_EXISTS", i.ADDRESS_LIMIT_EXCEEDED = "ADDRESS_LIMIT_EXCEEDED", i.SIGN_FAILED = "SIGN_FAILED", i.SIGN_REJECTED = "SIGN_REJECTED", i.TX_FAILED = "TX_FAILED", i.TX_REJECTED = "TX_REJECTED", i.BROADCAST_FAILED = "BROADCAST_FAILED", i.USER_REJECTED = "USER_REJECTED", i.TX_INVALID_PARAMS = "TX_INVALID_PARAMS", i.NETWORK_ERROR = "NETWORK_ERROR", i.NETWORK_NOT_CONFIGURED = "NETWORK_NOT_CONFIGURED", i.INVALID_CHAIN = "INVALID_CHAIN", i.CHAIN_NOT_SUPPORTED = "CHAIN_NOT_SUPPORTED", i.CHAIN_ADAPTER_NOT_FOUND = "CHAIN_ADAPTER_NOT_FOUND", i.NOT_IMPLEMENTED = "NOT_IMPLEMENTED", i.SIGNATURE_FAILED = "SIGNATURE_FAILED", i.TRANSACTION_FAILED = "TRANSACTION_FAILED", i.PREPARE_FAILED = "PREPARE_FAILED", i.PREPARE_EXPIRED = "PREPARE_EXPIRED", i.PREPARE_MISMATCH = "PREPARE_MISMATCH", i.MIGRATION_FAILED = "MIGRATION_FAILED", i.MIGRATION_BACKUP_EXISTS = "MIGRATION_BACKUP_EXISTS", i.MIGRATION_PIN_LOCKED = "MIGRATION_PIN_LOCKED", i.GATEWAY_INTERNAL_ERROR = "GATEWAY_INTERNAL_ERROR", i.GATEWAY_LOCK_CONFLICT = "GATEWAY_LOCK_CONFLICT", i.WALLET_INCONSISTENT_STATE = "WALLET_INCONSISTENT_STATE", i.PROJECT_ID_MISSING = "PROJECT_ID_MISSING", i.ORIGIN_NOT_ALLOWED = "ORIGIN_NOT_ALLOWED", i.APP_IDENTIFIER_MISSING = "APP_IDENTIFIER_MISSING", i.INVALID_APP_TYPE = "INVALID_APP_TYPE", i.PROJECT_NOT_REGISTERED = "PROJECT_NOT_REGISTERED", i.SIGNATURE_SIGNER_MISMATCH = "SIGNATURE_SIGNER_MISMATCH", i.GAS_ESTIMATION_FAILED = "GAS_ESTIMATION_FAILED", i.TYPED_DATA_CHAIN_ID_MISMATCH = "TYPED_DATA_CHAIN_ID_MISMATCH", i.PIN_NOT_SET = "PIN_NOT_SET", i.PIN_WRONG = "PIN_WRONG", i.PIN_INVALID = "PIN_INVALID", i.PIN_REPEATED_PATTERN = "PIN_REPEATED_PATTERN", i.PIN_CANCELLED = "PIN_CANCELLED", i.EXTERNAL_WALLET_REQUESTED = "EXTERNAL_WALLET_REQUESTED", i.PIN_LOCKED = "PIN_LOCKED", i.HMAC_REQUIRED = "HMAC_REQUIRED", i.HMAC_VERIFICATION_FAILED = "HMAC_VERIFICATION_FAILED", i.WITHDRAW_FAILED = "WITHDRAW_FAILED", i.USER_NOT_FOUND = "USER_NOT_FOUND", i.RN_BRIDGE_NOT_AVAILABLE = "RN_BRIDGE_NOT_AVAILABLE", i.RN_BRIDGE_HANDSHAKE_FAILED = "RN_BRIDGE_HANDSHAKE_FAILED", i.RN_NATIVE_SESSION_EXPIRED = "RN_NATIVE_SESSION_EXPIRED", i.INVALID_CONFIG = "INVALID_CONFIG", i.UNKNOWN_ERROR = "UNKNOWN_ERROR", i))(d || {});
|
|
6
6
|
class _ extends Error {
|
|
7
7
|
constructor(e, r, t) {
|
|
@@ -16,23 +16,23 @@ class _ extends Error {
|
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
const
|
|
19
|
+
const Lt = 2e3, Je = 6e4, Dt = 1e3, $t = 1e4, Mt = "0x77359400", Ze = "0x3B9ACA00", Qe = 130, We = 6, et = 18, tt = 3e4, Ft = 5 * 60 * 1e3, Bt = 30 * 1e3, De = 100, Ut = "crossx-sdk-js/2.3.12", He = "ONEpocket";
|
|
20
20
|
var ge = /* @__PURE__ */ ((i) => (i.MetaMask = "io.metamask", i.Binance = "com.binance.wallet", i.CROSSx = "crossx", i))(ge || {});
|
|
21
|
-
const
|
|
21
|
+
const Wt = {
|
|
22
22
|
"io.metamask": "MetaMask",
|
|
23
23
|
"com.binance.wallet": "Binance Wallet",
|
|
24
24
|
crossx: He
|
|
25
|
-
},
|
|
25
|
+
}, Ht = [
|
|
26
26
|
"crossx",
|
|
27
27
|
"io.metamask",
|
|
28
28
|
"com.binance.wallet"
|
|
29
29
|
/* Binance */
|
|
30
30
|
];
|
|
31
|
-
function Ht(i) {
|
|
32
|
-
return Ut[i] ?? i;
|
|
33
|
-
}
|
|
34
31
|
function Gt(i) {
|
|
35
|
-
return
|
|
32
|
+
return Wt[i] ?? i;
|
|
33
|
+
}
|
|
34
|
+
function Kt(i) {
|
|
35
|
+
return Array.isArray(i.connectOtherWallets) && i.connectOtherWallets.length > 0 ? [...i.connectOtherWallets] : i.showConnectOtherWallets === !0 ? [...Ht] : [];
|
|
36
36
|
}
|
|
37
37
|
const Ae = {
|
|
38
38
|
// ─── CROSS ────────────────────────────────────────────
|
|
@@ -85,18 +85,18 @@ const Ae = {
|
|
|
85
85
|
}
|
|
86
86
|
}, Zs = Object.fromEntries(
|
|
87
87
|
Object.entries(Ae).map(([i, e]) => [i, e.caipId])
|
|
88
|
-
),
|
|
88
|
+
), Vt = new Map(
|
|
89
89
|
Object.values(Ae).map((i) => [i.caipId, i])
|
|
90
90
|
);
|
|
91
91
|
new Map(
|
|
92
92
|
Object.values(Ae).map((i) => [i.chainId, i])
|
|
93
93
|
);
|
|
94
|
-
const
|
|
94
|
+
const zt = { symbol: "", decimals: 18 };
|
|
95
95
|
function ke(i) {
|
|
96
96
|
var e;
|
|
97
|
-
return ((e =
|
|
97
|
+
return ((e = Vt.get(i)) == null ? void 0 : e.nativeCurrency) ?? zt;
|
|
98
98
|
}
|
|
99
|
-
class
|
|
99
|
+
class qt {
|
|
100
100
|
constructor(e, r) {
|
|
101
101
|
this.sdk = e, this.chainId = r, this._listeners = /* @__PURE__ */ new Map();
|
|
102
102
|
}
|
|
@@ -216,7 +216,7 @@ const c = {
|
|
|
216
216
|
return;
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
|
-
},
|
|
219
|
+
}, jt = {
|
|
220
220
|
// ── 공통 버튼 ────────────────────────────────────────────────
|
|
221
221
|
confirm: "확인",
|
|
222
222
|
cancel: "취소",
|
|
@@ -395,7 +395,7 @@ const c = {
|
|
|
395
395
|
login_selector_connect_other_wallets_desc: "Connect your existing Web3 wallet to manage your assets.",
|
|
396
396
|
// ── Migration modal ──────────────────────────────────────────
|
|
397
397
|
migration_found_title: "Existing Wallet Found",
|
|
398
|
-
migration_found_description: "An existing
|
|
398
|
+
migration_found_description: "An existing wallet was found. Would you like to recover it?",
|
|
399
399
|
migration_recover_button: "Recover",
|
|
400
400
|
migration_skip_button: "Skip",
|
|
401
401
|
// ── Recovery PIN input modal (migration — CROSSx 4-digit PIN) ─
|
|
@@ -459,14 +459,14 @@ For security, you must continue with the same account.`,
|
|
|
459
459
|
session_alert_apple_account: "Apple account",
|
|
460
460
|
session_alert_sign_out_button: "Sign out",
|
|
461
461
|
session_alert_sign_in_again_button: "Sign in again"
|
|
462
|
-
},
|
|
463
|
-
ko:
|
|
462
|
+
}, Yt = {
|
|
463
|
+
ko: jt,
|
|
464
464
|
en: ut
|
|
465
465
|
};
|
|
466
466
|
function Q(i = "en", e) {
|
|
467
|
-
return
|
|
467
|
+
return Yt[i] ?? ut;
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function Xt(i) {
|
|
470
470
|
return i === "ko" || i === "en" ? i : typeof navigator < "u" && (navigator.language ?? "").toLowerCase().startsWith("ko") ? "ko" : "en";
|
|
471
471
|
}
|
|
472
472
|
const st = "crossx_access_token", it = "crossx_refresh_token", ot = "crossx_user_info", Ee = class Ee {
|
|
@@ -568,7 +568,7 @@ const st = "crossx_access_token", it = "crossx_refresh_token", ot = "crossx_user
|
|
|
568
568
|
const s = e == null ? void 0 : e.provider;
|
|
569
569
|
let o = "/login";
|
|
570
570
|
s === "google" ? o = "/google" : s === "apple" && (o = "/apple");
|
|
571
|
-
const { oauthServiceUrl: n, legacyOauthServiceUrl: a } = this.config, l =
|
|
571
|
+
const { oauthServiceUrl: n, legacyOauthServiceUrl: a } = this.config, l = Xt(this.getLocale()), p = (g) => {
|
|
572
572
|
const f = `${g}${o}`, m = f.includes("?") ? "&" : "?";
|
|
573
573
|
return `${f}${m}locale=${l}`;
|
|
574
574
|
}, h = p(n), u = a ? p(a) : void 0;
|
|
@@ -1056,8 +1056,8 @@ const st = "crossx_access_token", it = "crossx_refresh_token", ot = "crossx_user
|
|
|
1056
1056
|
}
|
|
1057
1057
|
};
|
|
1058
1058
|
Ee.REFRESH_RELOGIN_CODES = /* @__PURE__ */ new Set([1007, 1008]);
|
|
1059
|
-
let
|
|
1060
|
-
class
|
|
1059
|
+
let $e = Ee;
|
|
1060
|
+
class Jt {
|
|
1061
1061
|
constructor(e, r, t) {
|
|
1062
1062
|
this.config = e, this.storage = r, this.tokenStore = t;
|
|
1063
1063
|
const s = e.projectId;
|
|
@@ -1067,7 +1067,7 @@ class Xt {
|
|
|
1067
1067
|
this.tokenStore.clear(), this.config.authMode !== "cookie" && (await this.storage.remove(this.STORAGE_KEY_ACCESS_TOKEN), await this.storage.remove(this.STORAGE_KEY_REFRESH_TOKEN)), await this.storage.remove(this.STORAGE_KEY_USER), await this.storage.clear();
|
|
1068
1068
|
}
|
|
1069
1069
|
}
|
|
1070
|
-
class
|
|
1070
|
+
class Zt {
|
|
1071
1071
|
constructor(e, r) {
|
|
1072
1072
|
this.storage = e, this.walletProvider = r;
|
|
1073
1073
|
}
|
|
@@ -1125,7 +1125,7 @@ class xt {
|
|
|
1125
1125
|
return this.encryptedBytes !== null;
|
|
1126
1126
|
}
|
|
1127
1127
|
}
|
|
1128
|
-
class
|
|
1128
|
+
class Qt {
|
|
1129
1129
|
constructor(e, r) {
|
|
1130
1130
|
this.chainRegistry = e, this.transport = r, this._nextId = 1;
|
|
1131
1131
|
}
|
|
@@ -1157,7 +1157,7 @@ class Zt {
|
|
|
1157
1157
|
return a == null ? void 0 : a.result;
|
|
1158
1158
|
}
|
|
1159
1159
|
}
|
|
1160
|
-
class
|
|
1160
|
+
class er {
|
|
1161
1161
|
constructor() {
|
|
1162
1162
|
this.listeners = /* @__PURE__ */ new Map();
|
|
1163
1163
|
}
|
|
@@ -1180,7 +1180,7 @@ class Qt {
|
|
|
1180
1180
|
this.listeners.clear();
|
|
1181
1181
|
}
|
|
1182
1182
|
}
|
|
1183
|
-
function
|
|
1183
|
+
function tr() {
|
|
1184
1184
|
var e;
|
|
1185
1185
|
if (typeof globalThis < "u" && ((e = globalThis.crypto) != null && e.getRandomValues)) {
|
|
1186
1186
|
const r = new Uint8Array(16);
|
|
@@ -1250,7 +1250,7 @@ class j {
|
|
|
1250
1250
|
async handshake() {
|
|
1251
1251
|
if (!this.bridge)
|
|
1252
1252
|
throw new _(d.AUTH_NOT_INITIALIZED, "Bridge not initialized");
|
|
1253
|
-
const e =
|
|
1253
|
+
const e = tr(), r = Date.now(), t = {
|
|
1254
1254
|
version: 1,
|
|
1255
1255
|
appId: this.config.appId,
|
|
1256
1256
|
appVersion: this.config.appVersion,
|
|
@@ -1441,7 +1441,7 @@ const pe = {
|
|
|
1441
1441
|
contentsBaseUrl: "https://stg-contents.crosstoken.io/frontend/common/app-launcher"
|
|
1442
1442
|
}
|
|
1443
1443
|
};
|
|
1444
|
-
function
|
|
1444
|
+
function rr(i) {
|
|
1445
1445
|
const e = i.environment, r = e && e in pe ? pe[e] : null;
|
|
1446
1446
|
if (!r)
|
|
1447
1447
|
return null;
|
|
@@ -1456,7 +1456,7 @@ function tr(i) {
|
|
|
1456
1456
|
function Ge() {
|
|
1457
1457
|
try {
|
|
1458
1458
|
if (typeof __CROSSX_CONFIG__ < "u") {
|
|
1459
|
-
const i = typeof __CROSSX_CONFIG__ == "string" ? JSON.parse(__CROSSX_CONFIG__) : __CROSSX_CONFIG__, e =
|
|
1459
|
+
const i = typeof __CROSSX_CONFIG__ == "string" ? JSON.parse(__CROSSX_CONFIG__) : __CROSSX_CONFIG__, e = rr(i);
|
|
1460
1460
|
if (e) return e;
|
|
1461
1461
|
}
|
|
1462
1462
|
} catch {
|
|
@@ -1474,7 +1474,7 @@ function gt(i) {
|
|
|
1474
1474
|
for (; e > 0 && i.charCodeAt(e - 1) === 48; ) e--;
|
|
1475
1475
|
return i.slice(0, e);
|
|
1476
1476
|
}
|
|
1477
|
-
function
|
|
1477
|
+
function sr(i, e = We) {
|
|
1478
1478
|
if (!i || i === "0x0" || i === "0x") return "0";
|
|
1479
1479
|
try {
|
|
1480
1480
|
const r = BigInt(i);
|
|
@@ -1496,7 +1496,7 @@ function ye(i, e, r, t = We) {
|
|
|
1496
1496
|
return;
|
|
1497
1497
|
}
|
|
1498
1498
|
}
|
|
1499
|
-
function
|
|
1499
|
+
function ir(i) {
|
|
1500
1500
|
const e = i.startsWith("0x") ? i.slice(2) : i;
|
|
1501
1501
|
if (!/^[0-9a-fA-F]+$/.test(e))
|
|
1502
1502
|
throw new _(
|
|
@@ -1509,7 +1509,7 @@ function sr(i) {
|
|
|
1509
1509
|
`서명 길이가 유효하지 않습니다: ${Qe} hex 문자(65 바이트) 예상, 현재 ${e.length}`
|
|
1510
1510
|
);
|
|
1511
1511
|
}
|
|
1512
|
-
function
|
|
1512
|
+
function or(i) {
|
|
1513
1513
|
const e = i.startsWith("0x") ? i.slice(2) : i;
|
|
1514
1514
|
if (!/^[0-9a-fA-F]+$/.test(e))
|
|
1515
1515
|
throw new _(
|
|
@@ -1522,8 +1522,8 @@ function ir(i) {
|
|
|
1522
1522
|
"유효하지 않은 서명된 트랜잭션: 너무 짧습니다"
|
|
1523
1523
|
);
|
|
1524
1524
|
}
|
|
1525
|
-
function
|
|
1526
|
-
const r =
|
|
1525
|
+
function nr(i, e) {
|
|
1526
|
+
const r = ar(e);
|
|
1527
1527
|
if (i === "0") {
|
|
1528
1528
|
if (r !== void 0 && r !== 0)
|
|
1529
1529
|
throw new _(
|
|
@@ -1547,7 +1547,7 @@ function or(i, e) {
|
|
|
1547
1547
|
);
|
|
1548
1548
|
}
|
|
1549
1549
|
}
|
|
1550
|
-
function
|
|
1550
|
+
function ar(i) {
|
|
1551
1551
|
if (i == null || typeof i != "object") return;
|
|
1552
1552
|
const e = i.domain;
|
|
1553
1553
|
if (e == null || typeof e != "object") return;
|
|
@@ -1711,7 +1711,7 @@ class de {
|
|
|
1711
1711
|
return { ok: !1, error: s, ...o };
|
|
1712
1712
|
}
|
|
1713
1713
|
}
|
|
1714
|
-
class
|
|
1714
|
+
class cr {
|
|
1715
1715
|
constructor(e) {
|
|
1716
1716
|
this.deps = e;
|
|
1717
1717
|
}
|
|
@@ -1732,10 +1732,10 @@ class ar {
|
|
|
1732
1732
|
});
|
|
1733
1733
|
}
|
|
1734
1734
|
}
|
|
1735
|
-
function
|
|
1735
|
+
function lr(i) {
|
|
1736
1736
|
return i === "google" || i === "apple";
|
|
1737
1737
|
}
|
|
1738
|
-
class
|
|
1738
|
+
class dr {
|
|
1739
1739
|
constructor(e) {
|
|
1740
1740
|
this.deps = e;
|
|
1741
1741
|
}
|
|
@@ -1746,7 +1746,7 @@ class lr {
|
|
|
1746
1746
|
this.deps.setRecoveringSession(!0);
|
|
1747
1747
|
try {
|
|
1748
1748
|
this.deps.setAuthenticated(!1), this.deps.clearTokenStore();
|
|
1749
|
-
const s =
|
|
1749
|
+
const s = lr(e.loginType) ? { provider: e.loginType } : void 0;
|
|
1750
1750
|
let o;
|
|
1751
1751
|
try {
|
|
1752
1752
|
o = await this.deps.executeSignIn(s);
|
|
@@ -1826,7 +1826,7 @@ class lr {
|
|
|
1826
1826
|
}
|
|
1827
1827
|
}
|
|
1828
1828
|
}
|
|
1829
|
-
class
|
|
1829
|
+
class pr {
|
|
1830
1830
|
constructor(e) {
|
|
1831
1831
|
this.deps = e;
|
|
1832
1832
|
}
|
|
@@ -1873,7 +1873,7 @@ class dr {
|
|
|
1873
1873
|
c.log("[CROSSx] 세션 복원 후 지갑 주소 로드 완료:", a.address), this.deps.setActiveWallet(a.address, 0);
|
|
1874
1874
|
}
|
|
1875
1875
|
}
|
|
1876
|
-
class
|
|
1876
|
+
class hr {
|
|
1877
1877
|
constructor(e) {
|
|
1878
1878
|
this.deps = e;
|
|
1879
1879
|
}
|
|
@@ -2030,7 +2030,7 @@ class pr {
|
|
|
2030
2030
|
}
|
|
2031
2031
|
}
|
|
2032
2032
|
}
|
|
2033
|
-
class
|
|
2033
|
+
class _r {
|
|
2034
2034
|
constructor(e) {
|
|
2035
2035
|
this.deps = e;
|
|
2036
2036
|
}
|
|
@@ -2071,7 +2071,7 @@ class hr {
|
|
|
2071
2071
|
return !n && a && (l.maxPriorityFeePerGas = Ze, c.log("[CROSSx] maxPriorityFeePerGas 비어있음 → 1 Gwei 기본값 적용")), l;
|
|
2072
2072
|
}
|
|
2073
2073
|
}
|
|
2074
|
-
class
|
|
2074
|
+
class ur {
|
|
2075
2075
|
constructor(e) {
|
|
2076
2076
|
this.crypto = e;
|
|
2077
2077
|
}
|
|
@@ -2097,10 +2097,10 @@ class _r {
|
|
|
2097
2097
|
}
|
|
2098
2098
|
}
|
|
2099
2099
|
}
|
|
2100
|
-
function
|
|
2100
|
+
function xr(i) {
|
|
2101
2101
|
return i ? i.includes("google") ? "google" : i.includes("apple") ? "apple" : i : null;
|
|
2102
2102
|
}
|
|
2103
|
-
class
|
|
2103
|
+
class gr {
|
|
2104
2104
|
constructor(e) {
|
|
2105
2105
|
this.deps = e;
|
|
2106
2106
|
}
|
|
@@ -2122,7 +2122,7 @@ class xr {
|
|
|
2122
2122
|
activeWalletIndex: 0,
|
|
2123
2123
|
userEmail: ((o = e.user) == null ? void 0 : o.email) ?? null,
|
|
2124
2124
|
providerSub: ((n = e.user) == null ? void 0 : n.providerSub) ?? null,
|
|
2125
|
-
loginType:
|
|
2125
|
+
loginType: xr(
|
|
2126
2126
|
(a = e.user) == null ? void 0 : a.signInProvider
|
|
2127
2127
|
),
|
|
2128
2128
|
tokenSignatureVerified: e.tokenSignatureVerified ?? !1
|
|
@@ -2152,7 +2152,7 @@ class xr {
|
|
|
2152
2152
|
});
|
|
2153
2153
|
}
|
|
2154
2154
|
}
|
|
2155
|
-
class
|
|
2155
|
+
class fr {
|
|
2156
2156
|
constructor(e) {
|
|
2157
2157
|
this.deps = e;
|
|
2158
2158
|
}
|
|
@@ -2171,7 +2171,7 @@ class gr {
|
|
|
2171
2171
|
)).address, index: e };
|
|
2172
2172
|
}
|
|
2173
2173
|
}
|
|
2174
|
-
class
|
|
2174
|
+
class wr {
|
|
2175
2175
|
constructor(e) {
|
|
2176
2176
|
this.deps = e;
|
|
2177
2177
|
}
|
|
@@ -2190,7 +2190,7 @@ class fr {
|
|
|
2190
2190
|
);
|
|
2191
2191
|
}
|
|
2192
2192
|
}
|
|
2193
|
-
class
|
|
2193
|
+
class mr {
|
|
2194
2194
|
constructor(e) {
|
|
2195
2195
|
this.deps = e;
|
|
2196
2196
|
}
|
|
@@ -2254,7 +2254,7 @@ function nt(i, e) {
|
|
|
2254
2254
|
const r = i.replace(/\/$/, ""), t = e.startsWith("/") ? e : `/${e}`;
|
|
2255
2255
|
return `${r}/cross-auth${t}`;
|
|
2256
2256
|
}
|
|
2257
|
-
class
|
|
2257
|
+
class yr {
|
|
2258
2258
|
constructor(e) {
|
|
2259
2259
|
this.deps = e;
|
|
2260
2260
|
}
|
|
@@ -2402,10 +2402,10 @@ function Te(i, e = "Apple account") {
|
|
|
2402
2402
|
const t = i.substring(0, r), s = i.substring(r);
|
|
2403
2403
|
return t.length <= 1 ? `${t}${"*".repeat(Math.max(t.length, 1))}${s}` : `${t[0]}${"*".repeat(t.length - 1)}${s}`;
|
|
2404
2404
|
}
|
|
2405
|
-
const ce = class ce extends
|
|
2405
|
+
const ce = class ce extends er {
|
|
2406
2406
|
constructor(e, r, t, s, o, n, a, l, p, h, u) {
|
|
2407
2407
|
var x, g;
|
|
2408
|
-
super(), this.storage = t, this.crypto = s, this.transport = o, this.oauth = n, this.walletProvider = a, this.tokenStore = l, this.initialized = !1, this._initPromise = null, this.authenticated = !1, this.userId = null, this.address = null, this.activeWalletIndex = 0, this.userEmail = null, this.loginType = null, this.providerSub = null, this.tokenSignatureVerified = !1, this._themeMediaCleanup = null, this._isRecoveringSession = !1, this._rnBridgeService = null, this._providers = /* @__PURE__ */ new Map(), this._isAuthenticatedViaRNBridge = !1, this._bridgeSessionRestorePromise = null, this._config = Object.freeze({ ...e }), this.internalConfig = e, this.adapterConfig = r, e.logger && rt(e.logger), this.confirmation = p, this.pinStore = u ?? new xt(), this.stateManager = new
|
|
2408
|
+
super(), this.storage = t, this.crypto = s, this.transport = o, this.oauth = n, this.walletProvider = a, this.tokenStore = l, this.initialized = !1, this._initPromise = null, this.authenticated = !1, this.userId = null, this.address = null, this.activeWalletIndex = 0, this.userEmail = null, this.loginType = null, this.providerSub = null, this.tokenSignatureVerified = !1, this._themeMediaCleanup = null, this._isRecoveringSession = !1, this._rnBridgeService = null, this._providers = /* @__PURE__ */ new Map(), this._isAuthenticatedViaRNBridge = !1, this._bridgeSessionRestorePromise = null, this._config = Object.freeze({ ...e }), this.internalConfig = e, this.adapterConfig = r, e.logger && rt(e.logger), this.confirmation = p, this.pinStore = u ?? new xt(), this.stateManager = new gr({
|
|
2409
2409
|
setState: (f) => {
|
|
2410
2410
|
f.authenticated !== void 0 && (this.authenticated = f.authenticated), f.userId !== void 0 && (this.userId = f.userId), f.address !== void 0 && (this.address = f.address), f.activeWalletIndex !== void 0 && (this.activeWalletIndex = f.activeWalletIndex), f.userEmail !== void 0 && (this.userEmail = f.userEmail), f.providerSub !== void 0 && (this.providerSub = f.providerSub), f.loginType !== void 0 && (this.loginType = f.loginType), f.tokenSignatureVerified !== void 0 && (this.tokenSignatureVerified = f.tokenSignatureVerified);
|
|
2411
2411
|
},
|
|
@@ -2438,19 +2438,19 @@ const ce = class ce extends Qt {
|
|
|
2438
2438
|
// dApp 이 sdk.pinOrchestrator.ensureVerifiedPin() 을 직접 호출해도 (SigningOrchestrator 우회)
|
|
2439
2439
|
// WebView 안에서 embedded PIN 프롬프트가 뜨지 않도록 게이팅. SigningOrchestrator 와 동일 신호.
|
|
2440
2440
|
isRNBridgeMode: () => this._isAuthenticatedViaRNBridge
|
|
2441
|
-
}), this.signingOrchestrator = new
|
|
2441
|
+
}), this.signingOrchestrator = new cr({
|
|
2442
2442
|
confirmation: this.confirmation,
|
|
2443
2443
|
walletProvider: this.walletProvider,
|
|
2444
2444
|
pinOrchestrator: this.pinOrchestrator,
|
|
2445
2445
|
// §12 native sign delegation: 이 SDK 세션이 RN bridge 자동 로그인으로 인증된 경우만 활성.
|
|
2446
2446
|
// 자동 로그인 거부 / OAuth 로 별도 로그인한 세션에서는 native SDK 가 미인증이라 우회한다.
|
|
2447
2447
|
isRNBridgeMode: () => this._isAuthenticatedViaRNBridge
|
|
2448
|
-
}), this.walletLifecycleService = new
|
|
2448
|
+
}), this.walletLifecycleService = new pr({
|
|
2449
2449
|
walletProvider: this.walletProvider,
|
|
2450
2450
|
pinOrchestrator: this.pinOrchestrator,
|
|
2451
2451
|
getUserId: () => this.userId,
|
|
2452
2452
|
setActiveWallet: (f, m, y) => this.setActiveWallet(f, m, y)
|
|
2453
|
-
}), this.migrationOrchestrator = new
|
|
2453
|
+
}), this.migrationOrchestrator = new hr({
|
|
2454
2454
|
confirmation: this.confirmation,
|
|
2455
2455
|
walletProvider: this.walletProvider,
|
|
2456
2456
|
pinOrchestrator: this.pinOrchestrator,
|
|
@@ -2464,21 +2464,21 @@ const ce = class ce extends Qt {
|
|
|
2464
2464
|
var f;
|
|
2465
2465
|
return ((f = this._config.migration) == null ? void 0 : f.allowSkip) ?? !0;
|
|
2466
2466
|
}
|
|
2467
|
-
}), this.transactionLifecycleService = new
|
|
2467
|
+
}), this.transactionLifecycleService = new _r({
|
|
2468
2468
|
getActiveAddress: () => this.address,
|
|
2469
2469
|
estimateGas: (f, m) => this.estimateGas(f, m),
|
|
2470
2470
|
getBaseFeePerGas: (f) => this.getBaseFeePerGas(f),
|
|
2471
2471
|
jsonRpcCall: (f, m, y) => this.jsonRpc.call(f, m, y)
|
|
2472
|
-
}), this.signatureVerifier = new
|
|
2472
|
+
}), this.signatureVerifier = new ur(this.crypto), this.addressResolverService = new fr({
|
|
2473
2473
|
walletProvider: this.walletProvider,
|
|
2474
2474
|
pinOrchestrator: this.pinOrchestrator,
|
|
2475
2475
|
getActiveAddress: () => this.address,
|
|
2476
2476
|
getActiveWalletIndex: () => this.activeWalletIndex,
|
|
2477
2477
|
getUserId: () => this.userId
|
|
2478
|
-
}), this.authGuardService = new
|
|
2478
|
+
}), this.authGuardService = new wr({
|
|
2479
2479
|
isInitialized: () => this.initialized,
|
|
2480
2480
|
isAuthenticated: () => this.authenticated
|
|
2481
|
-
}), this.walletCreationService = new
|
|
2481
|
+
}), this.walletCreationService = new mr({
|
|
2482
2482
|
walletProvider: this.walletProvider,
|
|
2483
2483
|
pinOrchestrator: this.pinOrchestrator,
|
|
2484
2484
|
migrationOrchestrator: this.migrationOrchestrator,
|
|
@@ -2490,10 +2490,10 @@ const ce = class ce extends Qt {
|
|
|
2490
2490
|
var f, m;
|
|
2491
2491
|
return ((m = (f = this.confirmation).showWalletCreatedPrompt) == null ? void 0 : m.call(f)) ?? Promise.resolve();
|
|
2492
2492
|
}
|
|
2493
|
-
}), this.tokenHistoryService = new
|
|
2493
|
+
}), this.tokenHistoryService = new yr({
|
|
2494
2494
|
transport: o,
|
|
2495
2495
|
getApiBaseUrl: () => this.internalConfig.authApiUrl
|
|
2496
|
-
}), this.sessionOrchestrator = new
|
|
2496
|
+
}), this.sessionOrchestrator = new dr({
|
|
2497
2497
|
ensureInitialized: () => this.ensureInitialized(),
|
|
2498
2498
|
getSessionSnapshot: () => ({
|
|
2499
2499
|
providerSub: this.providerSub,
|
|
@@ -2516,7 +2516,7 @@ const ce = class ce extends Qt {
|
|
|
2516
2516
|
loadWalletAfterAuth: () => this.walletLifecycleService.loadWalletAfterAuth(),
|
|
2517
2517
|
getLocale: () => this._config.locale,
|
|
2518
2518
|
maskEmail: Te
|
|
2519
|
-
}), this.chainRegistry = h, this.jsonRpc = new
|
|
2519
|
+
}), this.chainRegistry = h, this.jsonRpc = new Qt(h, o), this.signInUseCase = new $e(
|
|
2520
2520
|
this.internalConfig,
|
|
2521
2521
|
t,
|
|
2522
2522
|
s,
|
|
@@ -2526,7 +2526,7 @@ const ce = class ce extends Qt {
|
|
|
2526
2526
|
l,
|
|
2527
2527
|
void 0,
|
|
2528
2528
|
() => this._config.locale
|
|
2529
|
-
), this.signOutUseCase = new
|
|
2529
|
+
), this.signOutUseCase = new Jt(this.internalConfig, t, l), this.migrateWalletUseCase = new Zt(t, a), (x = a.setOnUnauthorized) == null || x.call(a, () => this.forceLogout()), (g = a.setTokenRefresher) == null || g.call(
|
|
2530
2530
|
a,
|
|
2531
2531
|
() => this.signInUseCase.refreshAccessToken()
|
|
2532
2532
|
), e.autoDetectTheme && this._setupAutoDetectTheme();
|
|
@@ -2568,7 +2568,7 @@ const ce = class ce extends Qt {
|
|
|
2568
2568
|
}
|
|
2569
2569
|
async _doInitialize(e) {
|
|
2570
2570
|
var r, t;
|
|
2571
|
-
c.log("[CROSSx SDK] v2.3.
|
|
2571
|
+
c.log("[CROSSx SDK] v2.3.12 초기화 중..."), this.confirmation.setMessages(Q(this._config.locale));
|
|
2572
2572
|
try {
|
|
2573
2573
|
const s = Ge();
|
|
2574
2574
|
this.internalConfig.oauthServiceUrl = s.oauthServiceUrl, this.internalConfig.legacyOauthServiceUrl = s.legacyOauthServiceUrl, this.internalConfig.authApiUrl = s.authApiUrl, this.internalConfig.walletGatewayUrl = s.walletGatewayUrl, this.adapterConfig.gatewayUrl = s.walletGatewayUrl, (t = (r = this.crypto).setJWKSEndpoint) == null || t.call(r, `${s.authApiUrl}/.well-known/jwks.json`);
|
|
@@ -2604,7 +2604,7 @@ const ce = class ce extends Qt {
|
|
|
2604
2604
|
throw u;
|
|
2605
2605
|
}
|
|
2606
2606
|
}
|
|
2607
|
-
return this.initialized = !0, c.info("[CROSSx SDK] v2.3.
|
|
2607
|
+
return this.initialized = !0, c.info("[CROSSx SDK] v2.3.12 초기화 완료"), this.emit("initialized", { restored: !!(l != null && l.success) }), l ?? null;
|
|
2608
2608
|
} catch (s) {
|
|
2609
2609
|
throw new _(d.AUTH_NOT_INITIALIZED, "SDK 초기화에 실패했습니다", s);
|
|
2610
2610
|
}
|
|
@@ -2624,7 +2624,7 @@ const ce = class ce extends Qt {
|
|
|
2624
2624
|
c.log("[CROSSx] RN Bridge 감지 — Handshake 시도"), c.info("[CROSSx][RNBridge trace] Bootstrap config", {
|
|
2625
2625
|
appId: this._config.projectId,
|
|
2626
2626
|
appVersion: "1.0.0",
|
|
2627
|
-
sdkVersion: "2.3.
|
|
2627
|
+
sdkVersion: "2.3.12",
|
|
2628
2628
|
keyId: "key-id-1",
|
|
2629
2629
|
userIdHash: "user-hash-placeholder",
|
|
2630
2630
|
projectId: this._config.projectId
|
|
@@ -2632,7 +2632,7 @@ const ce = class ce extends Qt {
|
|
|
2632
2632
|
const e = new j({
|
|
2633
2633
|
appId: this._config.projectId,
|
|
2634
2634
|
appVersion: "1.0.0",
|
|
2635
|
-
sdkVersion: "2.3.
|
|
2635
|
+
sdkVersion: "2.3.12",
|
|
2636
2636
|
keyId: "key-id-1",
|
|
2637
2637
|
userIdHash: "user-hash-placeholder",
|
|
2638
2638
|
projectId: this._config.projectId
|
|
@@ -2751,7 +2751,7 @@ const ce = class ce extends Qt {
|
|
|
2751
2751
|
let t = e;
|
|
2752
2752
|
if (!(e != null && e.provider)) {
|
|
2753
2753
|
const s = await this.confirmation.showLoginSelector({
|
|
2754
|
-
connectOtherWallets:
|
|
2754
|
+
connectOtherWallets: Kt(this._config)
|
|
2755
2755
|
});
|
|
2756
2756
|
if (s === null)
|
|
2757
2757
|
return { success: !1, error: "User cancelled login" };
|
|
@@ -3349,7 +3349,7 @@ const ce = class ce extends Qt {
|
|
|
3349
3349
|
throw new _(d.AUTH_NOT_AUTHENTICATED, "사용자 ID를 찾을 수 없습니다");
|
|
3350
3350
|
if (!this.walletProvider.signTypedData)
|
|
3351
3351
|
throw new _(d.NOT_IMPLEMENTED, "signTypedData가 구현되어 있지 않습니다");
|
|
3352
|
-
|
|
3352
|
+
nr(e, r);
|
|
3353
3353
|
const s = await this.resolveAddress(t == null ? void 0 : t.index);
|
|
3354
3354
|
try {
|
|
3355
3355
|
const o = await this.signingOrchestrator.confirmAndExecuteWithPreparedPin({
|
|
@@ -3373,7 +3373,7 @@ const ce = class ce extends Qt {
|
|
|
3373
3373
|
s.address
|
|
3374
3374
|
)
|
|
3375
3375
|
});
|
|
3376
|
-
return
|
|
3376
|
+
return ir(o.signature), {
|
|
3377
3377
|
chainId: e,
|
|
3378
3378
|
signature: o.signature,
|
|
3379
3379
|
address: s.address
|
|
@@ -3451,7 +3451,7 @@ const ce = class ce extends Qt {
|
|
|
3451
3451
|
a
|
|
3452
3452
|
)
|
|
3453
3453
|
});
|
|
3454
|
-
return
|
|
3454
|
+
return or(n.signature), {
|
|
3455
3455
|
chainId: e,
|
|
3456
3456
|
signedTx: n.signature,
|
|
3457
3457
|
txHash: n.txHash ?? ""
|
|
@@ -3520,7 +3520,7 @@ const ce = class ce extends Qt {
|
|
|
3520
3520
|
return u.txHash ?? u.signature;
|
|
3521
3521
|
}
|
|
3522
3522
|
}), a = (r.data ?? "").toLowerCase().replace(/^0x/, ""), l = a === "" || a === "00000000", p = a.startsWith("a9059cbb");
|
|
3523
|
-
return (l || p) && this.tokenHistoryService.registerHistoryFireAndForget(e, n,
|
|
3523
|
+
return (l || p) && this.tokenHistoryService.registerHistoryFireAndForget(e, n, Ut).catch(
|
|
3524
3524
|
(h) => c.log("[TokenHistory] register failed (non-critical):", h)
|
|
3525
3525
|
), { chainId: e, txHash: n, status: "pending" };
|
|
3526
3526
|
} catch (n) {
|
|
@@ -3552,7 +3552,7 @@ const ce = class ce extends Qt {
|
|
|
3552
3552
|
* @param opts.timeoutMs 최대 대기 시간 (기본 60000ms)
|
|
3553
3553
|
*/
|
|
3554
3554
|
async waitForTxAndGetReceipt(e, r, t = {}) {
|
|
3555
|
-
const s = t.intervalMs ??
|
|
3555
|
+
const s = t.intervalMs ?? Dt, o = $t, n = t.timeoutMs ?? Je, a = Date.now() + n;
|
|
3556
3556
|
let l = s;
|
|
3557
3557
|
for (; Date.now() < a; ) {
|
|
3558
3558
|
const p = await this.getTransactionReceipt(e, r);
|
|
@@ -3586,7 +3586,7 @@ const ce = class ce extends Qt {
|
|
|
3586
3586
|
if (S != null && S.sendTransactionWithWaitForReceipt)
|
|
3587
3587
|
return this.bridgeSendTransactionWithWaitForReceipt(S, e, r, t);
|
|
3588
3588
|
}
|
|
3589
|
-
const { intervalMs: s, timeoutMs: o, ...n } = t, { txHash: a } = await this.sendTransaction(e, r, n), l = s ?? ((m = this._config.receiptPolling) == null ? void 0 : m.intervalMs) ??
|
|
3589
|
+
const { intervalMs: s, timeoutMs: o, ...n } = t, { txHash: a } = await this.sendTransaction(e, r, n), l = s ?? ((m = this._config.receiptPolling) == null ? void 0 : m.intervalMs) ?? Lt, p = o ?? ((y = this._config.receiptPolling) == null ? void 0 : y.timeoutMs) ?? Je, h = ke(e), u = r.from ?? "";
|
|
3590
3590
|
let x, g;
|
|
3591
3591
|
const f = this.waitForTxAndGetReceipt(a, e, { intervalMs: l, timeoutMs: p }).then((S) => {
|
|
3592
3592
|
x = S;
|
|
@@ -3841,7 +3841,7 @@ const ce = class ce extends Qt {
|
|
|
3841
3841
|
return { wei: "0x0", formatted: "0", chainId: e };
|
|
3842
3842
|
try {
|
|
3843
3843
|
const s = await this.jsonRpc.call("eth_getBalance", [r, "latest"], e) ?? "0x0";
|
|
3844
|
-
return { wei: s, formatted:
|
|
3844
|
+
return { wei: s, formatted: sr(s, this._config.displayDecimals), chainId: e };
|
|
3845
3845
|
} catch (t) {
|
|
3846
3846
|
if (t instanceof _) throw t;
|
|
3847
3847
|
const s = t instanceof Error ? t.message : String(t);
|
|
@@ -3869,7 +3869,7 @@ const ce = class ce extends Qt {
|
|
|
3869
3869
|
getProvider(e) {
|
|
3870
3870
|
this.ensureAuthenticated();
|
|
3871
3871
|
let r = this._providers.get(e);
|
|
3872
|
-
return r || (r = new
|
|
3872
|
+
return r || (r = new qt(this, e), this._providers.set(e, r)), r;
|
|
3873
3873
|
}
|
|
3874
3874
|
/**
|
|
3875
3875
|
* EIP-1193 `accountsChanged` 이벤트를 모든 활성 provider 인스턴스에 dispatch 한다.
|
|
@@ -4111,8 +4111,8 @@ const ce = class ce extends Qt {
|
|
|
4111
4111
|
}
|
|
4112
4112
|
};
|
|
4113
4113
|
ce.WALLET_PREF_KEY = "wallet_preference", ce.OFFCHAIN_CHAIN_ID = "0";
|
|
4114
|
-
let
|
|
4115
|
-
class
|
|
4114
|
+
let Me = ce;
|
|
4115
|
+
class br {
|
|
4116
4116
|
constructor() {
|
|
4117
4117
|
this.prefix = "crossx_";
|
|
4118
4118
|
}
|
|
@@ -4149,7 +4149,7 @@ class yr {
|
|
|
4149
4149
|
}
|
|
4150
4150
|
}
|
|
4151
4151
|
}
|
|
4152
|
-
const Re = "crossx-sdk",
|
|
4152
|
+
const Re = "crossx-sdk", vr = 1, q = "data", ie = "keys", be = "aes-primary", Sr = 12;
|
|
4153
4153
|
class at {
|
|
4154
4154
|
constructor(e) {
|
|
4155
4155
|
this.db = null, this.cryptoKey = null, this.initPromise = null, this.dbName = `crossx-sdk-${e}`;
|
|
@@ -4159,7 +4159,7 @@ class at {
|
|
|
4159
4159
|
}
|
|
4160
4160
|
openDB(e = this.dbName) {
|
|
4161
4161
|
return new Promise((r, t) => {
|
|
4162
|
-
const s = indexedDB.open(e,
|
|
4162
|
+
const s = indexedDB.open(e, vr);
|
|
4163
4163
|
s.onupgradeneeded = () => {
|
|
4164
4164
|
const o = s.result;
|
|
4165
4165
|
o.objectStoreNames.contains(q) || o.createObjectStore(q), o.objectStoreNames.contains(ie) || o.createObjectStore(ie);
|
|
@@ -4237,7 +4237,7 @@ class at {
|
|
|
4237
4237
|
}
|
|
4238
4238
|
}
|
|
4239
4239
|
async encrypt(e) {
|
|
4240
|
-
const r = new Uint8Array(
|
|
4240
|
+
const r = new Uint8Array(Sr);
|
|
4241
4241
|
crypto.getRandomValues(r);
|
|
4242
4242
|
const t = new TextEncoder().encode(e), s = await crypto.subtle.encrypt(
|
|
4243
4243
|
{ name: "AES-GCM", iv: r },
|
|
@@ -4295,14 +4295,14 @@ class at {
|
|
|
4295
4295
|
return typeof indexedDB < "u" && typeof crypto < "u" && typeof crypto.subtle < "u";
|
|
4296
4296
|
}
|
|
4297
4297
|
}
|
|
4298
|
-
const
|
|
4299
|
-
class
|
|
4298
|
+
const Er = 60;
|
|
4299
|
+
class Ar {
|
|
4300
4300
|
constructor() {
|
|
4301
4301
|
this.jwks = null;
|
|
4302
4302
|
}
|
|
4303
4303
|
setJWKSEndpoint(e) {
|
|
4304
4304
|
try {
|
|
4305
|
-
this.jwks =
|
|
4305
|
+
this.jwks = Rt(new URL(e)), c.log("[CROSSx] JWKS 엔드포인트 설정:", e);
|
|
4306
4306
|
} catch (r) {
|
|
4307
4307
|
c.warn("[CROSSx] JWKS 엔드포인트 URL 파싱 실패:", r);
|
|
4308
4308
|
}
|
|
@@ -4316,7 +4316,7 @@ class Er {
|
|
|
4316
4316
|
iat: t.iat
|
|
4317
4317
|
});
|
|
4318
4318
|
const s = Math.floor(Date.now() / 1e3);
|
|
4319
|
-
if (t.exp && t.exp +
|
|
4319
|
+
if (t.exp && t.exp + Er < s)
|
|
4320
4320
|
return c.warn("[CROSSx] 토큰 만료:", {
|
|
4321
4321
|
exp: t.exp,
|
|
4322
4322
|
now: s,
|
|
@@ -4326,7 +4326,7 @@ class Er {
|
|
|
4326
4326
|
return c.warn("[CROSSx] JWT에 sub(사용자ID) 없음"), { payload: t, valid: !1, signatureVerified: !1 };
|
|
4327
4327
|
if (this.jwks)
|
|
4328
4328
|
try {
|
|
4329
|
-
const { payload: o } = await
|
|
4329
|
+
const { payload: o } = await Ct(e, this.jwks, {
|
|
4330
4330
|
algorithms: ["RS256", "ES256"]
|
|
4331
4331
|
});
|
|
4332
4332
|
return c.log("[CROSSx] JWT 서명 검증 성공"), {
|
|
@@ -4345,7 +4345,7 @@ class Er {
|
|
|
4345
4345
|
}
|
|
4346
4346
|
}
|
|
4347
4347
|
decodeJWT(e) {
|
|
4348
|
-
return
|
|
4348
|
+
return Pt(e);
|
|
4349
4349
|
}
|
|
4350
4350
|
/**
|
|
4351
4351
|
* EIP-191 personal_sign 서명에서 서명자 Ethereum 주소를 복원합니다.
|
|
@@ -4363,14 +4363,14 @@ ${t.length}`
|
|
|
4363
4363
|
const n = Xe(o), a = r.startsWith("0x") ? r.slice(2) : r;
|
|
4364
4364
|
if (a.length !== 130)
|
|
4365
4365
|
throw new Error(`서명 길이가 유효하지 않습니다: 130 hex 문자 예상, 현재 ${a.length}`);
|
|
4366
|
-
const l =
|
|
4366
|
+
const l = Ir(a), p = l.slice(0, 32), h = l.slice(32, 64), u = l[64], x = u >= 27 ? u - 27 : u, m = new Nt.Signature(
|
|
4367
4367
|
ct(p),
|
|
4368
4368
|
ct(h)
|
|
4369
4369
|
).addRecoveryBit(x).recoverPublicKey(n).toBytes(!1).slice(1), y = Xe(m);
|
|
4370
|
-
return "0x" +
|
|
4370
|
+
return "0x" + Ot(y.slice(12));
|
|
4371
4371
|
}
|
|
4372
4372
|
}
|
|
4373
|
-
function
|
|
4373
|
+
function Ir(i) {
|
|
4374
4374
|
const e = new Uint8Array(i.length / 2);
|
|
4375
4375
|
for (let r = 0; r < e.length; r++)
|
|
4376
4376
|
e[r] = parseInt(i.substring(r * 2, r * 2 + 2), 16);
|
|
@@ -4381,8 +4381,8 @@ function ct(i) {
|
|
|
4381
4381
|
for (const r of i) e += r.toString(16).padStart(2, "0");
|
|
4382
4382
|
return BigInt(e);
|
|
4383
4383
|
}
|
|
4384
|
-
const
|
|
4385
|
-
class
|
|
4384
|
+
const kr = 3e4, Tr = 1e3;
|
|
4385
|
+
class Rr {
|
|
4386
4386
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4387
4387
|
async request(e) {
|
|
4388
4388
|
const r = e.retries ?? 0;
|
|
@@ -4393,7 +4393,7 @@ class Tr {
|
|
|
4393
4393
|
} catch (s) {
|
|
4394
4394
|
if (t === r) throw s;
|
|
4395
4395
|
}
|
|
4396
|
-
await new Promise((s) => setTimeout(s,
|
|
4396
|
+
await new Promise((s) => setTimeout(s, Tr * 2 ** t));
|
|
4397
4397
|
}
|
|
4398
4398
|
throw new Error("Unexpected: retry loop exited without result");
|
|
4399
4399
|
}
|
|
@@ -4401,7 +4401,7 @@ class Tr {
|
|
|
4401
4401
|
async _doRequest(e) {
|
|
4402
4402
|
const r = new AbortController(), t = setTimeout(
|
|
4403
4403
|
() => r.abort(),
|
|
4404
|
-
e.timeoutMs ??
|
|
4404
|
+
e.timeoutMs ?? kr
|
|
4405
4405
|
);
|
|
4406
4406
|
try {
|
|
4407
4407
|
const s = await fetch(e.url, {
|
|
@@ -4428,7 +4428,7 @@ class Tr {
|
|
|
4428
4428
|
}
|
|
4429
4429
|
}
|
|
4430
4430
|
}
|
|
4431
|
-
const
|
|
4431
|
+
const Cr = [
|
|
4432
4432
|
/CROSSx\/([\d.]+)/i,
|
|
4433
4433
|
/ONE\s?wallet[^\s/]*\/([\d.]+)/i,
|
|
4434
4434
|
/ONE\s?pocket[^\s/]*\/([\d.]+)/i
|
|
@@ -4436,18 +4436,18 @@ const Rr = [
|
|
|
4436
4436
|
function Ke() {
|
|
4437
4437
|
return typeof window > "u" ? void 0 : window;
|
|
4438
4438
|
}
|
|
4439
|
-
function
|
|
4439
|
+
function Pr() {
|
|
4440
4440
|
const i = Ke();
|
|
4441
4441
|
return i == null ? void 0 : i.__crossx;
|
|
4442
4442
|
}
|
|
4443
|
-
function
|
|
4443
|
+
function Nr(i) {
|
|
4444
4444
|
return i === "ios" || i === "android" ? i : null;
|
|
4445
4445
|
}
|
|
4446
4446
|
function Ce() {
|
|
4447
4447
|
const i = typeof navigator > "u" ? "" : navigator.userAgent;
|
|
4448
4448
|
return /Android/i.test(i) ? "android" : /iPhone|iPad|iPod|Macintosh/i.test(i) ? "ios" : null;
|
|
4449
4449
|
}
|
|
4450
|
-
function
|
|
4450
|
+
function Or(i, e) {
|
|
4451
4451
|
const r = (n) => n.split(/[^\d]+/).filter((a) => a !== "").map((a) => Number.parseInt(a, 10)), t = r(i), s = r(e), o = Math.max(t.length, s.length);
|
|
4452
4452
|
for (let n = 0; n < o; n += 1) {
|
|
4453
4453
|
const a = (t[n] ?? 0) - (s[n] ?? 0);
|
|
@@ -4455,7 +4455,7 @@ function Nr(i, e) {
|
|
|
4455
4455
|
}
|
|
4456
4456
|
return 0;
|
|
4457
4457
|
}
|
|
4458
|
-
function
|
|
4458
|
+
function Lr() {
|
|
4459
4459
|
const i = Ke();
|
|
4460
4460
|
if (!i) return !1;
|
|
4461
4461
|
const e = i.__crossxRNBridge;
|
|
@@ -4463,20 +4463,20 @@ function Or() {
|
|
|
4463
4463
|
}
|
|
4464
4464
|
function lt() {
|
|
4465
4465
|
const i = typeof navigator > "u" ? "" : navigator.userAgent;
|
|
4466
|
-
for (const e of
|
|
4466
|
+
for (const e of Cr) {
|
|
4467
4467
|
const r = e.exec(i);
|
|
4468
4468
|
if (r) return r[1] ?? null;
|
|
4469
4469
|
}
|
|
4470
4470
|
}
|
|
4471
4471
|
function ve() {
|
|
4472
|
-
const i =
|
|
4472
|
+
const i = Pr();
|
|
4473
4473
|
if (i != null && i.browser)
|
|
4474
4474
|
return {
|
|
4475
4475
|
version: i.version ?? null,
|
|
4476
|
-
platform:
|
|
4476
|
+
platform: Nr(i.platform) ?? Ce(),
|
|
4477
4477
|
detectedBy: "marker"
|
|
4478
4478
|
};
|
|
4479
|
-
if (
|
|
4479
|
+
if (Lr())
|
|
4480
4480
|
return {
|
|
4481
4481
|
version: lt() ?? null,
|
|
4482
4482
|
platform: Ce(),
|
|
@@ -4501,16 +4501,16 @@ function ei(i = 3e3) {
|
|
|
4501
4501
|
}, 50);
|
|
4502
4502
|
}) : Promise.resolve(null);
|
|
4503
4503
|
}
|
|
4504
|
-
const
|
|
4504
|
+
const Dr = /* @__PURE__ */ new Set([
|
|
4505
4505
|
"https://cross-wallet-oauth.crosstoken.io",
|
|
4506
4506
|
"https://stg-cross-wallet-oauth.crosstoken.io",
|
|
4507
4507
|
"https://dev-cross-wallet-oauth.crosstoken.io",
|
|
4508
4508
|
"https://one-wallet-oauth.onechain.nexus",
|
|
4509
4509
|
"https://stg-one-wallet-oauth.onechain.nexus",
|
|
4510
4510
|
"https://dev-one-wallet-oauth.onechain.nexus"
|
|
4511
|
-
]),
|
|
4512
|
-
function
|
|
4513
|
-
return i.platform !== "ios" ? !1 : i.version ?
|
|
4511
|
+
]), $r = "crossx://oauth-callback", Mr = "2.3.2";
|
|
4512
|
+
function Fr(i) {
|
|
4513
|
+
return i.platform !== "ios" ? !1 : i.version ? Or(i.version, Mr) <= 0 : !0;
|
|
4514
4514
|
}
|
|
4515
4515
|
class ne {
|
|
4516
4516
|
constructor() {
|
|
@@ -4588,14 +4588,14 @@ class ne {
|
|
|
4588
4588
|
return new Promise((r, t) => {
|
|
4589
4589
|
const s = Math.max(e.width ?? 500, 500), o = Math.max(e.height ?? 700, 700), n = window.screenX + (window.outerWidth - s) / 2, a = window.screenY + (window.outerHeight - o) / 2, l = ne.generateRandom16Hex(), p = ne.generateRandom16Hex(), h = ve();
|
|
4590
4590
|
let u = e.authUrl;
|
|
4591
|
-
h && e.legacyAuthUrl &&
|
|
4591
|
+
h && e.legacyAuthUrl && Fr(h) && (u = e.legacyAuthUrl, c.info("[CROSSx] 구버전 iOS 지갑 감지 — 이관 전 OAuth 호스트 사용", {
|
|
4592
4592
|
appVersion: h.version ?? "(unknown)",
|
|
4593
4593
|
detectedBy: h.detectedBy,
|
|
4594
4594
|
authUrlBase: e.legacyAuthUrl
|
|
4595
4595
|
}));
|
|
4596
4596
|
const x = u.includes("?") ? "&" : "?", g = encodeURIComponent(window.location.origin);
|
|
4597
4597
|
let f = `${u}${x}state=${l}&nonce=${p}&origin=${g}`;
|
|
4598
|
-
h && !f.includes("redirectUrl=") && (f += `&redirectUrl=${encodeURIComponent(
|
|
4598
|
+
h && !f.includes("redirectUrl=") && (f += `&redirectUrl=${encodeURIComponent($r)}`, c.info("[CROSSx] 지갑 인앱 브라우저 감지 — redirectUrl 콜백 자동 부착", {
|
|
4599
4599
|
detectedBy: h.detectedBy,
|
|
4600
4600
|
appVersion: h.version ?? "(unknown)",
|
|
4601
4601
|
platform: h.platform ?? "(unknown)"
|
|
@@ -4635,7 +4635,7 @@ class ne {
|
|
|
4635
4635
|
}, 1e3), W = () => {
|
|
4636
4636
|
this.abortPending = null, clearTimeout(y), clearInterval(N), T && clearTimeout(T), window.removeEventListener("message", Y);
|
|
4637
4637
|
}, Y = (D) => {
|
|
4638
|
-
if (!
|
|
4638
|
+
if (!Dr.has(D.origin)) return;
|
|
4639
4639
|
W();
|
|
4640
4640
|
const V = typeof D.data.status == "string", I = V ? D.data.data ?? {} : D.data;
|
|
4641
4641
|
c.log("[CROSSx] OAuth postMessage 수신 —", {
|
|
@@ -4655,10 +4655,10 @@ class ne {
|
|
|
4655
4655
|
c.error("[CROSSx] OAuth 실패:", I.error), t(new Error(I.error || "Authentication failed"));
|
|
4656
4656
|
return;
|
|
4657
4657
|
}
|
|
4658
|
-
const
|
|
4658
|
+
const $ = I == null ? void 0 : I.idToken, X = I == null ? void 0 : I.accessToken, he = X ?? $, we = (I == null ? void 0 : I.email) || void 0;
|
|
4659
4659
|
if (c.log("[CROSSx] OAuth 토큰 수신:", {
|
|
4660
4660
|
hasAccessToken: !!X,
|
|
4661
|
-
hasIdToken:
|
|
4661
|
+
hasIdToken: !!$,
|
|
4662
4662
|
hasEmail: !!we
|
|
4663
4663
|
}), !he) {
|
|
4664
4664
|
c.error("[CROSSx] 토큰을 찾을 수 없음:", D.data), t(new Error("Token not found in response"));
|
|
@@ -4669,10 +4669,10 @@ class ne {
|
|
|
4669
4669
|
c.error("[CROSSx] nonce 검증 실패:", J), t(J instanceof Error ? J : new Error("nonce verification failed"));
|
|
4670
4670
|
});
|
|
4671
4671
|
};
|
|
4672
|
-
X ? X.split(".").length === 3 ? se(X) :
|
|
4672
|
+
X ? X.split(".").length === 3 ? se(X) : $ ? se($) : (c.warn(
|
|
4673
4673
|
"[CROSSx] opaque accessToken만 수신 (idToken 없음) — nonce 검증 불가.",
|
|
4674
4674
|
"서버 측 nonce 검증이 필요합니다."
|
|
4675
|
-
), r(_e)) :
|
|
4675
|
+
), r(_e)) : $ ? se($) : t(new Error("Token not found in response"));
|
|
4676
4676
|
};
|
|
4677
4677
|
this.abortPending = (D) => {
|
|
4678
4678
|
W(), t(new Error(D));
|
|
@@ -4681,7 +4681,7 @@ class ne {
|
|
|
4681
4681
|
}
|
|
4682
4682
|
}
|
|
4683
4683
|
const xe = "crossx_wallet_data", le = "crossx_mock_pin_hash";
|
|
4684
|
-
class
|
|
4684
|
+
class Br {
|
|
4685
4685
|
constructor(e, r) {
|
|
4686
4686
|
this.storage = e, this.pinStore = r ?? null;
|
|
4687
4687
|
}
|
|
@@ -4969,7 +4969,7 @@ class ae {
|
|
|
4969
4969
|
if (this._walletStatusCache !== null ? (r = this._walletStatusCache, this._walletStatusCache = null, c.log("[CROSSx] getOrCreateWallet — 캐시된 상태 사용:", r)) : (c.log("[CROSSx] GET /mnemonic/check — 지갑 상태 확인"), r = await this.checkWallet(), this._walletStatusCache = null), r === "migration_required")
|
|
4970
4970
|
throw c.log("[CROSSx] migration_required → MIGRATION_BACKUP_EXISTS throw"), new _(
|
|
4971
4971
|
d.MIGRATION_BACKUP_EXISTS,
|
|
4972
|
-
"
|
|
4972
|
+
"기존 지갑 백업이 존재합니다. 마이그레이션을 진행해 주세요."
|
|
4973
4973
|
);
|
|
4974
4974
|
if (r === "exists") {
|
|
4975
4975
|
c.log("[CROSSx] 기존 지갑 발견 — POST /mnemonic/address(0)로 주소 조회");
|
|
@@ -5314,7 +5314,7 @@ class ae {
|
|
|
5314
5314
|
}
|
|
5315
5315
|
}
|
|
5316
5316
|
}
|
|
5317
|
-
class
|
|
5317
|
+
class Ur {
|
|
5318
5318
|
constructor(e, r, t, s = () => {
|
|
5319
5319
|
}, o = () => {
|
|
5320
5320
|
}) {
|
|
@@ -5465,7 +5465,7 @@ class fe {
|
|
|
5465
5465
|
}
|
|
5466
5466
|
isCacheValid() {
|
|
5467
5467
|
if (this.loadedAt === 0) return !1;
|
|
5468
|
-
const e = this.usingFallback ?
|
|
5468
|
+
const e = this.usingFallback ? Bt : Ft;
|
|
5469
5469
|
return e === 0 ? !0 : Date.now() - this.loadedAt < e;
|
|
5470
5470
|
}
|
|
5471
5471
|
populateCache(e, r) {
|
|
@@ -5527,7 +5527,7 @@ class fe {
|
|
|
5527
5527
|
}
|
|
5528
5528
|
}
|
|
5529
5529
|
}
|
|
5530
|
-
const dt = "__crossx-confirm-style", F = "__crossx-confirm-overlay",
|
|
5530
|
+
const dt = "__crossx-confirm-style", F = "__crossx-confirm-overlay", Wr = {
|
|
5531
5531
|
light: {
|
|
5532
5532
|
bg: "#FFFFFF",
|
|
5533
5533
|
border: "rgba(0,0,0,0.07)",
|
|
@@ -5596,7 +5596,7 @@ const dt = "__crossx-confirm-style", F = "__crossx-confirm-overlay", Ur = {
|
|
|
5596
5596
|
}
|
|
5597
5597
|
};
|
|
5598
5598
|
function pt(i, e) {
|
|
5599
|
-
const r =
|
|
5599
|
+
const r = Wr[i], t = e == null ? void 0 : e[i];
|
|
5600
5600
|
return t ? {
|
|
5601
5601
|
...r,
|
|
5602
5602
|
// ── Brand
|
|
@@ -5630,7 +5630,7 @@ function pt(i, e) {
|
|
|
5630
5630
|
...t.error !== void 0 && { errorColor: t.error }
|
|
5631
5631
|
} : r;
|
|
5632
5632
|
}
|
|
5633
|
-
const
|
|
5633
|
+
const Hr = `
|
|
5634
5634
|
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400&family=Sora:wght@400;600&display=swap');
|
|
5635
5635
|
|
|
5636
5636
|
#${F} {
|
|
@@ -8233,9 +8233,9 @@ button.__crossx-connect-other-block:active {
|
|
|
8233
8233
|
`;
|
|
8234
8234
|
function G() {
|
|
8235
8235
|
let i = document.getElementById(dt);
|
|
8236
|
-
i || (i = document.createElement("style"), i.id = dt, document.head.appendChild(i)), i.textContent =
|
|
8236
|
+
i || (i = document.createElement("style"), i.id = dt, document.head.appendChild(i)), i.textContent = Hr;
|
|
8237
8237
|
}
|
|
8238
|
-
function
|
|
8238
|
+
function Gr() {
|
|
8239
8239
|
const i = `#${F}`, e = (t) => {
|
|
8240
8240
|
var s, o;
|
|
8241
8241
|
(o = (s = t.target) == null ? void 0 : s.closest) != null && o.call(s, i) && t.stopImmediatePropagation();
|
|
@@ -8275,12 +8275,12 @@ function K(i) {
|
|
|
8275
8275
|
}
|
|
8276
8276
|
n.preventDefault();
|
|
8277
8277
|
}, { passive: !1 });
|
|
8278
|
-
const t =
|
|
8278
|
+
const t = Gr(), s = Kr(i), o = i.remove.bind(i);
|
|
8279
8279
|
i.remove = () => {
|
|
8280
8280
|
s(), t(), o();
|
|
8281
8281
|
}, document.body.appendChild(i);
|
|
8282
8282
|
}
|
|
8283
|
-
function
|
|
8283
|
+
function Kr(i) {
|
|
8284
8284
|
if (typeof window > "u") return () => {
|
|
8285
8285
|
};
|
|
8286
8286
|
const e = window.visualViewport;
|
|
@@ -8295,7 +8295,7 @@ function Gr(i) {
|
|
|
8295
8295
|
e.removeEventListener("resize", t), e.removeEventListener("scroll", t), i.style.removeProperty("--cx-keyboard-inset");
|
|
8296
8296
|
};
|
|
8297
8297
|
}
|
|
8298
|
-
function
|
|
8298
|
+
function Vr(i) {
|
|
8299
8299
|
const e = Array.from(i.querySelectorAll(".__crossx-amount-tip"));
|
|
8300
8300
|
if (!e.length) return;
|
|
8301
8301
|
const r = document.createElement("div");
|
|
@@ -8319,9 +8319,9 @@ function Kr(i) {
|
|
|
8319
8319
|
n.target.closest(".__crossx-amount-tip") || o();
|
|
8320
8320
|
}, { passive: !0 });
|
|
8321
8321
|
}
|
|
8322
|
-
const
|
|
8322
|
+
const zr = () => /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
|
|
8323
8323
|
function oe() {
|
|
8324
|
-
if (
|
|
8324
|
+
if (zr()) {
|
|
8325
8325
|
const e = window.scrollY;
|
|
8326
8326
|
return document.body.style.position = "fixed", document.body.style.top = `-${e}px`, document.body.style.left = "0", document.body.style.right = "0", () => {
|
|
8327
8327
|
document.body.style.position = "", document.body.style.top = "", document.body.style.left = "", document.body.style.right = "", window.scrollTo(0, e);
|
|
@@ -8375,7 +8375,7 @@ const ht = {
|
|
|
8375
8375
|
612055: "CROSS Mainnet"
|
|
8376
8376
|
}, Ve = /* @__PURE__ */ new Map();
|
|
8377
8377
|
let Pe = !1;
|
|
8378
|
-
function
|
|
8378
|
+
function qr() {
|
|
8379
8379
|
if (Pe || (Pe = !0, typeof fetch > "u")) return;
|
|
8380
8380
|
const i = Ge().contentsBaseUrl;
|
|
8381
8381
|
i && fetch(`${i}/chains.json`, { cache: "no-store" }).then((e) => e.ok ? e.json() : null).then((e) => {
|
|
@@ -8434,18 +8434,18 @@ function Ne(i) {
|
|
|
8434
8434
|
return i;
|
|
8435
8435
|
}
|
|
8436
8436
|
}
|
|
8437
|
-
function
|
|
8437
|
+
function jr(i) {
|
|
8438
8438
|
try {
|
|
8439
8439
|
return BigInt(i).toLocaleString();
|
|
8440
8440
|
} catch {
|
|
8441
8441
|
return i;
|
|
8442
8442
|
}
|
|
8443
8443
|
}
|
|
8444
|
-
function
|
|
8444
|
+
function Yr(i, e) {
|
|
8445
8445
|
const { gasLimit: r, gasPrice: t, maxFeePerGas: s, maxPriorityFeePerGas: o, nativeDecimals: n = 18 } = i, a = ze(i.chainId, i.nativeSymbol ?? "ETH");
|
|
8446
8446
|
if (!r) return null;
|
|
8447
8447
|
try {
|
|
8448
|
-
const l = BigInt(r), p =
|
|
8448
|
+
const l = BigInt(r), p = jr(r);
|
|
8449
8449
|
if (s) {
|
|
8450
8450
|
const h = l * BigInt(s);
|
|
8451
8451
|
return {
|
|
@@ -8477,7 +8477,7 @@ function jr(i, e) {
|
|
|
8477
8477
|
}
|
|
8478
8478
|
}
|
|
8479
8479
|
function bt(i, e, r) {
|
|
8480
|
-
const t =
|
|
8480
|
+
const t = Yr(i, e);
|
|
8481
8481
|
if (!t) return L((r == null ? void 0 : r.label_estimated_fee) ?? "Estimated fee", "<span>—</span>");
|
|
8482
8482
|
let s = L((r == null ? void 0 : r.label_est_tx_fee) ?? "Est. Tx Fee", `<span>${t.estTxFee}</span>`);
|
|
8483
8483
|
return t.isDynamic ? (t.maxPriorityFeeGwei !== void 0 && (s += L((r == null ? void 0 : r.label_max_priority_fee) ?? "Max Priority Fee", `<span>${t.maxPriorityFeeGwei} Gwei</span>`)), t.maxFeeGwei !== void 0 && (s += L((r == null ? void 0 : r.label_max_gas_fee) ?? "Max Gas Fee", `<span>${t.maxFeeGwei} Gwei</span>`))) : t.gasPriceGwei !== void 0 && (s += L((r == null ? void 0 : r.label_gas_price) ?? "Gas Price", `<span>${t.gasPriceGwei} Gwei</span>`)), t.gasLimitFormatted && (s += L((r == null ? void 0 : r.label_gas_limit) ?? "Gas Limit", `<span>${t.gasLimitFormatted}</span>`)), s;
|
|
@@ -8488,14 +8488,15 @@ const ee = `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="
|
|
|
8488
8488
|
</svg>`, U = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
|
|
8489
8489
|
<line x1="18" y1="6" x2="6" y2="18"/>
|
|
8490
8490
|
<line x1="6" y1="6" x2="18" y2="18"/>
|
|
8491
|
-
</svg>`,
|
|
8492
|
-
|
|
8493
|
-
|
|
8494
|
-
|
|
8491
|
+
</svg>`, Xr = '<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>', Jr = '<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>';
|
|
8492
|
+
function vt(i, e) {
|
|
8493
|
+
return `<svg width="${i}" height="${i}" viewBox="0 0 229 229" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><g clip-path="url(#clip0_${e})"><rect width="228.273" height="228.273" rx="87" fill="white"/><path d="M228.307 -0.0644531H0.0332031V228.209H228.307V-0.0644531Z" fill="#CE3E35"/><path d="M33.9219 43.7533C33.9219 31.934 43.5033 22.3527 55.3225 22.3527H173.019C184.838 22.3527 194.419 31.9341 194.419 43.7533V123.107H33.9219V43.7533Z" fill="white"/><g filter="url(#filter0_d_${e})"><path d="M228.241 228.21H0.0332031V56.5961C0.0332031 48.7166 6.4208 42.329 14.3003 42.329H77.9502C84.6851 42.329 90.1926 47.3831 94.2527 52.7566C98.8699 58.8676 106.06 62.7958 114.137 62.7958C122.214 62.7958 129.404 58.8676 134.021 52.7566C138.081 47.3831 143.589 42.329 150.324 42.329H213.974C221.854 42.329 228.241 48.7166 228.241 56.5961V228.21Z" fill="url(#paint0_linear_${e})"/></g><path d="M79.7598 228.096H228.24V64.7367L79.7598 159.851V228.096Z" fill="url(#paint1_linear_${e})"/><path d="M79.7694 228.209H0.0332031V75.9257L79.7694 160.218V228.209Z" fill="url(#paint2_linear_${e})"/><g filter="url(#filter1_d_${e})"><path d="M113.105 89.2908L81.3322 107.655C75.7279 110.878 73.7862 118.118 77.0076 123.724C80.229 129.331 87.4661 131.273 93.0704 128.051L119.945 112.511L107.147 126.241V180.098C107.147 186.588 112.443 191.885 118.93 191.885C125.417 191.885 130.712 186.588 130.712 180.098V99.4884C130.712 97.237 130.006 95.0297 129.124 93.5729C125.814 88.0106 118.665 86.024 113.061 89.2466L113.105 89.2908Z" fill="white"/></g></g><defs><filter id="filter0_d_${e}" x="-7.10034" y="33.4121" width="242.474" height="200.148" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dy="-1.78339"/><feGaussianBlur stdDeviation="3.56677"/><feComposite in2="hardAlpha" operator="out"/><feColorMatrix type="matrix" values="0 0 0 0 0.892803 0 0 0 0 0.220099 0 0 0 0 0.293135 0 0 0 0.5 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_${e}"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_${e}" result="shape"/></filter><filter id="filter1_d_${e}" x="67.9009" y="80.1489" width="75.3839" height="124.308" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset dx="2.51084" dy="2.51084"/><feGaussianBlur stdDeviation="5.03056"/><feColorMatrix type="matrix" values="0 0 0 0 0.831373 0 0 0 0 0.113725 0 0 0 0 0.356863 0 0 0 0.3 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_${e}"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_${e}" result="shape"/></filter><linearGradient id="paint0_linear_${e}" x1="-26.3993" y1="19.4879" x2="193.409" y2="286.17" gradientUnits="userSpaceOnUse"><stop stop-color="#F3752D"/><stop offset="1" stop-color="#EC1272"/></linearGradient><linearGradient id="paint1_linear_${e}" x1="56.978" y1="73.7355" x2="168.096" y2="169.248" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><linearGradient id="paint2_linear_${e}" x1="142.362" y1="29.5078" x2="37.3384" y2="166.255" gradientUnits="userSpaceOnUse"><stop stop-color="white" stop-opacity="0.5"/><stop offset="1" stop-color="white" stop-opacity="0"/></linearGradient><clipPath id="clip0_${e}"><rect width="228.273" height="228.273" rx="87" fill="white"/></clipPath></defs></svg>`;
|
|
8494
|
+
}
|
|
8495
|
+
const Zr = vt(16, "connect-inline"), Qr = {
|
|
8495
8496
|
[ge.MetaMask]: Xr,
|
|
8496
8497
|
[ge.Binance]: Jr,
|
|
8497
8498
|
[ge.CROSSx]: Zr
|
|
8498
|
-
},
|
|
8499
|
+
}, St = '<path d="M22.6667 11.8333V10.1667C22.6667 9.2475 21.9192 8.5 21.0001 8.5H10.1667C8.78841 8.5 7.66675 9.62167 7.66675 11V21C7.66675 22.8342 9.16175 23.5 10.1667 23.5H22.6667C23.5859 23.5 24.3334 22.7525 24.3334 21.8333V13.5C24.3334 12.5808 23.5859 11.8333 22.6667 11.8333ZM21.0001 19.3333H19.3334V16H21.0001V19.3333ZM10.1667 11.8333C9.95218 11.8237 9.74959 11.7317 9.60114 11.5765C9.4527 11.4213 9.36986 11.2148 9.36986 11C9.36986 10.7852 9.4527 10.5787 9.60114 10.4235C9.74959 10.2683 9.95218 10.1763 10.1667 10.1667H21.0001V11.8333H10.1667Z"/>', qe = `<svg width="20" height="20" viewBox="0 0 32 32" fill="currentColor" xmlns="http://www.w3.org/2000/svg">${St}</svg>`, es = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
8499
8500
|
<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)"/>
|
|
8500
8501
|
</svg>`, ts = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
8501
8502
|
<circle cx="12" cy="12" r="12" fill="var(--cx-error)"/>
|
|
@@ -8662,14 +8663,14 @@ function ds(i) {
|
|
|
8662
8663
|
function ps(i, e) {
|
|
8663
8664
|
return `https://explorer.crosstoken.io/${ls(i)}/tx/${e}`;
|
|
8664
8665
|
}
|
|
8665
|
-
function
|
|
8666
|
+
function Et(i, e) {
|
|
8666
8667
|
return `<a class="__crossx-addr-text __crossx-row-link" href="${w(e)}" target="_blank" rel="noopener noreferrer">${w(i)}</a>`;
|
|
8667
8668
|
}
|
|
8668
8669
|
function Se(i) {
|
|
8669
|
-
return
|
|
8670
|
+
return Et(te(i), ds(i));
|
|
8670
8671
|
}
|
|
8671
|
-
function
|
|
8672
|
-
return
|
|
8672
|
+
function At(i, e) {
|
|
8673
|
+
return Et(te(e), ps(i, e));
|
|
8673
8674
|
}
|
|
8674
8675
|
function hs(i, e, r) {
|
|
8675
8676
|
const t = L(
|
|
@@ -8677,7 +8678,7 @@ function hs(i, e, r) {
|
|
|
8677
8678
|
`${Se(i.from)}
|
|
8678
8679
|
<button class="__crossx-copy-btn" data-copy="${w(i.from)}" title="Copy address">${ee}</button>`
|
|
8679
8680
|
), s = i.to ? L((r == null ? void 0 : r.label_to) ?? "To", `${Se(i.to)}
|
|
8680
|
-
<button class="__crossx-copy-btn" data-copy="${w(i.to)}" title="Copy address">${ee}</button>`) : "", o = i.amount ? L((r == null ? void 0 : r.label_transfer) ?? "Transfer", `<span>${w(i.amount)}</span>`) : "", n = i.fees ? L((r == null ? void 0 : r.label_tx_fee) ?? "Tx Fee", `<span>${w(i.fees)}</span>`) : "", a = i.txHash ? L((r == null ? void 0 : r.label_tx_hash) ?? "Tx Hash", `${
|
|
8681
|
+
<button class="__crossx-copy-btn" data-copy="${w(i.to)}" title="Copy address">${ee}</button>`) : "", o = i.amount ? L((r == null ? void 0 : r.label_transfer) ?? "Transfer", `<span>${w(i.amount)}</span>`) : "", n = i.fees ? L((r == null ? void 0 : r.label_tx_fee) ?? "Tx Fee", `<span>${w(i.fees)}</span>`) : "", a = i.txHash ? L((r == null ? void 0 : r.label_tx_hash) ?? "Tx Hash", `${At(i.chainId, i.txHash)}
|
|
8681
8682
|
<button class="__crossx-copy-btn" data-copy="${w(i.txHash)}" title="Copy hash">${ee}</button>`) : "", l = i.total ? `<div class="__crossx-total-pill">
|
|
8682
8683
|
<span class="__crossx-total-label">${w((r == null ? void 0 : r.label_total) ?? "Total")}<br>${w((r == null ? void 0 : r.label_including_fees) ?? "(including fees)")}</span>
|
|
8683
8684
|
<span class="__crossx-total-amount">${w(i.total)}</span>
|
|
@@ -8734,7 +8735,7 @@ function us(i, e, r, t) {
|
|
|
8734
8735
|
if (!l) return;
|
|
8735
8736
|
const p = e.from ? L((t == null ? void 0 : t.label_from) ?? "From", `${Se(e.from)}
|
|
8736
8737
|
<button class="__crossx-copy-btn" data-copy="${w(e.from)}" title="Copy address">${ee}</button>`) : "", h = e.to ? L((t == null ? void 0 : t.label_to) ?? "To", `${Se(e.to)}
|
|
8737
|
-
<button class="__crossx-copy-btn" data-copy="${w(e.to)}" title="Copy address">${ee}</button>`) : "", u = e.amount ? L((t == null ? void 0 : t.label_transfer) ?? "Transfer", `<span>${w(e.amount)}</span>`) : "", x = e.fees ? L((t == null ? void 0 : t.label_tx_fee) ?? "Tx Fee", `<span>${w(e.fees)}</span>`) : "", g = e.txHash ? L((t == null ? void 0 : t.label_tx_hash) ?? "Tx Hash", `${
|
|
8738
|
+
<button class="__crossx-copy-btn" data-copy="${w(e.to)}" title="Copy address">${ee}</button>`) : "", u = e.amount ? L((t == null ? void 0 : t.label_transfer) ?? "Transfer", `<span>${w(e.amount)}</span>`) : "", x = e.fees ? L((t == null ? void 0 : t.label_tx_fee) ?? "Tx Fee", `<span>${w(e.fees)}</span>`) : "", g = e.txHash ? L((t == null ? void 0 : t.label_tx_hash) ?? "Tx Hash", `${At(e.chainId, e.txHash)}
|
|
8738
8739
|
<button class="__crossx-copy-btn" data-copy="${w(e.txHash)}" title="Copy hash">${ee}</button>`) : "", f = e.total ? `<div class="__crossx-total-pill">
|
|
8739
8740
|
<span class="__crossx-total-label">${w((t == null ? void 0 : t.label_total) ?? "Total")}<br>${w((t == null ? void 0 : t.label_including_fees) ?? "(including fees)")}</span>
|
|
8740
8741
|
<span class="__crossx-total-amount">${w(e.total)}</span>
|
|
@@ -8850,18 +8851,18 @@ const fs = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="
|
|
|
8850
8851
|
<line x1="12" y1="5" x2="12" y2="19"/>
|
|
8851
8852
|
<line x1="5" y1="12" x2="19" y2="12"/>
|
|
8852
8853
|
</svg>`, ws = '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="12" fill="var(--cx-primary, #00ceb2)"/><path d="M7.5 12.5L10.5 15.5L16.5 8.5" stroke="var(--cx-on-primary, #000)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>';
|
|
8853
|
-
function
|
|
8854
|
+
function It(i) {
|
|
8854
8855
|
return i.name || `Account ${i.index + 1}`;
|
|
8855
8856
|
}
|
|
8856
8857
|
function ms() {
|
|
8857
|
-
return `<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><rect width="32" height="32" rx="16" fill="#121212" fill-opacity="0.1"/><g fill="#121212" fill-opacity="0.5">${
|
|
8858
|
+
return `<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><rect width="32" height="32" rx="16" fill="#121212" fill-opacity="0.1"/><g fill="#121212" fill-opacity="0.5">${St}</g></svg>`;
|
|
8858
8859
|
}
|
|
8859
8860
|
const ys = Ge().portraitBaseUrl;
|
|
8860
8861
|
function bs(i, e) {
|
|
8861
8862
|
const r = e.replace("#", "");
|
|
8862
8863
|
return `${ys}/portrait/evm/${i}.png?size=256&bg=${r}`;
|
|
8863
8864
|
}
|
|
8864
|
-
function
|
|
8865
|
+
function kt(i, e, r) {
|
|
8865
8866
|
const t = bs(i, r), o = ms().replace(/"/g, """);
|
|
8866
8867
|
return `<span class="__crossx-wallet-avatar"><img class="__crossx-wallet-avatar-img" src="${t}" alt="" onerror="this.style.display='none';this.nextElementSibling.innerHTML='${o}';this.nextElementSibling.style.display='flex';"><span class="__crossx-wallet-avatar-fallback"></span></span>`;
|
|
8867
8868
|
}
|
|
@@ -8869,7 +8870,7 @@ function vs(i, e, r, t) {
|
|
|
8869
8870
|
const s = r == null ? void 0 : r.toLowerCase(), o = i.map((a) => {
|
|
8870
8871
|
const l = s && a.address.toLowerCase() === s, p = l ? " __crossx-wallet-item--selected" : "", h = l ? `<span class="__crossx-wallet-selected">${w((t == null ? void 0 : t.wallet_selector_selected) ?? "Selected")}</span><span class="__crossx-wallet-check">${ws}</span>` : "";
|
|
8871
8872
|
return `<button class="__crossx-wallet-item${p}" data-wallet-index="${a.index}" data-wallet-address="${w(a.address)}">
|
|
8872
|
-
${
|
|
8873
|
+
${kt(a.address, a.index, e.bg)}<span class="__crossx-wallet-info"><span class="__crossx-wallet-idx">${w(It(a))}</span><span class="__crossx-wallet-addr">${ft(a.address)}</span></span>${h}
|
|
8873
8874
|
</button>`;
|
|
8874
8875
|
}).join(""), n = document.createElement("div");
|
|
8875
8876
|
return n.id = F, n.className = "__crossx-overlay--wallet-selector", n.innerHTML = `
|
|
@@ -8955,7 +8956,7 @@ const Es = `<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="h
|
|
|
8955
8956
|
<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"/>
|
|
8956
8957
|
</svg>`;
|
|
8957
8958
|
function Is(i) {
|
|
8958
|
-
const e =
|
|
8959
|
+
const e = Gt(i);
|
|
8959
8960
|
return `<span class="__crossx-connect-other-wallet-desc-part"><span class="__crossx-connect-other-wallet-icon" aria-hidden="true">${Qr[i] ?? ""}</span><span class="__crossx-connect-other-wallet-name">${w(e)}</span></span>`;
|
|
8960
8961
|
}
|
|
8961
8962
|
function ks(i) {
|
|
@@ -9053,7 +9054,7 @@ function Cs(i, e = !0) {
|
|
|
9053
9054
|
<p class="__crossx-mig-info-desc">It safely restores and integrates all your previous assets. Simply verify your PIN to get started.</p>
|
|
9054
9055
|
</div>
|
|
9055
9056
|
<button class="__crossx-recover-btn" id="__crossx-recover-btn">
|
|
9056
|
-
<span class="__crossx-recover-icon">${
|
|
9057
|
+
<span class="__crossx-recover-icon">${vt(40, "recover")}</span>
|
|
9057
9058
|
<span class="__crossx-recover-label">Import from Social Backup</span>
|
|
9058
9059
|
</button>
|
|
9059
9060
|
${s}
|
|
@@ -9161,7 +9162,7 @@ function Ls(i) {
|
|
|
9161
9162
|
}
|
|
9162
9163
|
function Oe(i) {
|
|
9163
9164
|
const e = !!i.lockExpiresAt && i.lockExpiresAt > Date.now(), r = i.lockExpiresAt ? ` data-lock-expires="${i.lockExpiresAt}"` : "", t = i.headerSubtitle ? `<p class="__crossx-pin6-header-sub">${w(i.headerSubtitle)}</p>` : "", s = i.subtitle ? `<p class="__crossx-pin6-subtitle">${w(i.subtitle)}</p>` : "", o = i.errorMessage ? `<p class="__crossx-pin6-error" id="__crossx-pin6-error">${w(i.errorMessage)}</p>` : '<p class="__crossx-pin6-error" id="__crossx-pin6-error"></p>', n = e ? `<p class="__crossx-pin6-lock-msg" id="__crossx-pin6-lock-msg">
|
|
9164
|
-
${
|
|
9165
|
+
${Tt}
|
|
9165
9166
|
<span id="__crossx-pin6-lock-countdown"></span>
|
|
9166
9167
|
</p>` : "", a = i.warningMessage && i.attemptCount != null && i.attemptCount > 0 ? `<p class="__crossx-pin6-warning" id="__crossx-pin6-warning">${w(i.warningMessage)}</p>` : '<p class="__crossx-pin6-warning" id="__crossx-pin6-warning"></p>', l = i.attemptCount != null && i.attemptCount > 0 ? `<p class="__crossx-pin6-attempt" id="__crossx-pin6-attempt">${i.attemptCount}/${i.maxAttempts ?? "?"}</p>` : '<p class="__crossx-pin6-attempt" id="__crossx-pin6-attempt"></p>', p = e ? " --locked" : "", h = Array.from(
|
|
9167
9168
|
{ length: 6 },
|
|
@@ -9189,7 +9190,7 @@ function Oe(i) {
|
|
|
9189
9190
|
<div class="__crossx-pin6-numpad-row">
|
|
9190
9191
|
<button type="button" class="__crossx-pin6-numpad-key --empty" aria-hidden="true"></button>
|
|
9191
9192
|
<button type="button" class="__crossx-pin6-numpad-key${g}" data-key="0">0</button>
|
|
9192
|
-
<button type="button" class="__crossx-pin6-numpad-key --delete${g}" data-key="backspace" aria-label="Delete">${
|
|
9193
|
+
<button type="button" class="__crossx-pin6-numpad-key --delete${g}" data-key="backspace" aria-label="Delete">${Ms}</button>
|
|
9193
9194
|
</div>
|
|
9194
9195
|
</div>`;
|
|
9195
9196
|
return `
|
|
@@ -9231,7 +9232,7 @@ function Ds(i, e) {
|
|
|
9231
9232
|
const r = i.split("").map(Number), t = r.every((o, n) => n === 0 || o === (r[n - 1] + 1) % 10), s = r.every((o, n) => n === 0 || o === (r[n - 1] + 9) % 10);
|
|
9232
9233
|
return t || s ? e.sequential : i[0] !== i[1] && i === i.slice(0, 2).repeat(3) ? e.alternatingPattern : null;
|
|
9233
9234
|
}
|
|
9234
|
-
function
|
|
9235
|
+
function $s(i) {
|
|
9235
9236
|
const e = Math.max(0, Math.ceil(i / 1e3)), r = Math.floor(e / 3600), t = Math.floor(e % 3600 / 60), s = e % 60;
|
|
9236
9237
|
return r > 0 ? `${r}h ${String(t).padStart(2, "0")}m` : `${String(t).padStart(2, "0")}:${String(s).padStart(2, "0")}`;
|
|
9237
9238
|
}
|
|
@@ -9246,10 +9247,10 @@ function Le(i, e, r, t, s, o, n) {
|
|
|
9246
9247
|
var k;
|
|
9247
9248
|
const b = p(), v = T();
|
|
9248
9249
|
if (v.length && (v.forEach((C, P) => {
|
|
9249
|
-
const
|
|
9250
|
-
C.classList.toggle("--filled",
|
|
9250
|
+
const M = !!(b[P] && E(b[P]));
|
|
9251
|
+
C.classList.toggle("--filled", M), C.classList.toggle("--active", !1);
|
|
9251
9252
|
}), !a && !l)) {
|
|
9252
|
-
const C = b.findIndex((
|
|
9253
|
+
const C = b.findIndex((M) => !E(M));
|
|
9253
9254
|
(k = v[C === -1 ? 5 : C]) == null || k.classList.add("--active");
|
|
9254
9255
|
}
|
|
9255
9256
|
}, N = () => {
|
|
@@ -9270,7 +9271,7 @@ function Le(i, e, r, t, s, o, n) {
|
|
|
9270
9271
|
C ? C.insertAdjacentElement("afterend", v) : (k = f()) == null || k.appendChild(v);
|
|
9271
9272
|
}
|
|
9272
9273
|
v.textContent = b;
|
|
9273
|
-
},
|
|
9274
|
+
}, $ = () => {
|
|
9274
9275
|
const b = I();
|
|
9275
9276
|
b && (b.textContent = "");
|
|
9276
9277
|
}, X = (b, v) => {
|
|
@@ -9294,14 +9295,14 @@ function Le(i, e, r, t, s, o, n) {
|
|
|
9294
9295
|
(C = p()[0]) == null || C.focus(), R();
|
|
9295
9296
|
}, 50);
|
|
9296
9297
|
}, _e = (b) => {
|
|
9297
|
-
var
|
|
9298
|
+
var M;
|
|
9298
9299
|
W(!0), p().forEach(S), N();
|
|
9299
9300
|
const v = u();
|
|
9300
9301
|
if (v && (v.textContent = "Too many failed attempts. Please wait."), !x()) {
|
|
9301
9302
|
const B = document.createElement("p");
|
|
9302
|
-
B.className = "__crossx-pin6-lock-msg", B.id = "__crossx-pin6-lock-msg", B.innerHTML = `${
|
|
9303
|
+
B.className = "__crossx-pin6-lock-msg", B.id = "__crossx-pin6-lock-msg", B.innerHTML = `${Tt}<span id="__crossx-pin6-lock-countdown"></span>`;
|
|
9303
9304
|
const z = u();
|
|
9304
|
-
z ? z.insertAdjacentElement("afterend", B) : (
|
|
9305
|
+
z ? z.insertAdjacentElement("afterend", B) : (M = f()) == null || M.appendChild(B);
|
|
9305
9306
|
}
|
|
9306
9307
|
const k = () => {
|
|
9307
9308
|
var re;
|
|
@@ -9309,7 +9310,7 @@ function Le(i, e, r, t, s, o, n) {
|
|
|
9309
9310
|
B <= 0 ? (clearInterval(C), W(!1), (re = x()) == null || re.remove(), v && (v.textContent = ""), N(), setTimeout(() => {
|
|
9310
9311
|
var me;
|
|
9311
9312
|
return (me = p()[0]) == null ? void 0 : me.focus();
|
|
9312
|
-
}, 50)) : z && (z.textContent = ` ${
|
|
9313
|
+
}, 50)) : z && (z.textContent = ` ${$s(B)}`);
|
|
9313
9314
|
}, C = setInterval(k, 1e3);
|
|
9314
9315
|
k();
|
|
9315
9316
|
const P = new MutationObserver(() => {
|
|
@@ -9326,7 +9327,7 @@ function Le(i, e, r, t, s, o, n) {
|
|
|
9326
9327
|
try {
|
|
9327
9328
|
if (s) {
|
|
9328
9329
|
const v = await s(b);
|
|
9329
|
-
v.ok ? e(b) : v.lockExpiresAt ? (he(), _e(v.lockExpiresAt)) : (we(v.error ?? "Incorrect PIN. Please try again."), v.attemptCount != null && v.maxAttempts != null ? (O(V()), X(v.attemptCount, v.maxAttempts)) : (
|
|
9330
|
+
v.ok ? e(b) : v.lockExpiresAt ? (he(), _e(v.lockExpiresAt)) : (we(v.error ?? "Incorrect PIN. Please try again."), v.attemptCount != null && v.maxAttempts != null ? (O(V()), X(v.attemptCount, v.maxAttempts)) : ($(), he()));
|
|
9330
9331
|
} else
|
|
9331
9332
|
e(b);
|
|
9332
9333
|
} catch (v) {
|
|
@@ -9363,15 +9364,15 @@ function Le(i, e, r, t, s, o, n) {
|
|
|
9363
9364
|
if (k.preventDefault(), E(b))
|
|
9364
9365
|
S(b);
|
|
9365
9366
|
else if (v > 0) {
|
|
9366
|
-
const
|
|
9367
|
-
S(
|
|
9367
|
+
const M = p()[v - 1];
|
|
9368
|
+
S(M), M.focus();
|
|
9368
9369
|
}
|
|
9369
9370
|
R();
|
|
9370
9371
|
} else k.key === "ArrowLeft" && v > 0 ? (k.preventDefault(), (C = p()[v - 1]) == null || C.focus()) : k.key === "ArrowRight" && v < 5 ? (k.preventDefault(), (P = p()[v + 1]) == null || P.focus()) : k.key === "Escape" && r();
|
|
9371
9372
|
}), b.addEventListener("paste", (k) => {
|
|
9372
|
-
var
|
|
9373
|
+
var M, B;
|
|
9373
9374
|
k.preventDefault();
|
|
9374
|
-
const C = (((
|
|
9375
|
+
const C = (((M = k.clipboardData) == null ? void 0 : M.getData("text")) ?? "").replace(/\D/g, "").slice(0, 6);
|
|
9375
9376
|
if (!C) return;
|
|
9376
9377
|
const P = p();
|
|
9377
9378
|
C.split("").forEach((z, re) => {
|
|
@@ -9405,16 +9406,16 @@ function Le(i, e, r, t, s, o, n) {
|
|
|
9405
9406
|
if (!b) return;
|
|
9406
9407
|
const P = b;
|
|
9407
9408
|
v();
|
|
9408
|
-
const
|
|
9409
|
-
C.clientX >=
|
|
9409
|
+
const M = P.getBoundingClientRect();
|
|
9410
|
+
C.clientX >= M.left && C.clientX <= M.right && C.clientY >= M.top && C.clientY <= M.bottom && !a && !l && k(P);
|
|
9410
9411
|
}), J.addEventListener("pointercancel", v), J.addEventListener("pointerleave", v, !0), R(), o && o > Date.now() && N();
|
|
9411
9412
|
}
|
|
9412
9413
|
}
|
|
9413
|
-
const
|
|
9414
|
+
const Ms = `<svg width="22" height="17" viewBox="0 0 22 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
9414
9415
|
<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"/>
|
|
9415
9416
|
<line x1="10" y1="5.5" x2="16" y2="11.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
|
9416
9417
|
<line x1="16" y1="5.5" x2="10" y2="11.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
|
9417
|
-
</svg>`,
|
|
9418
|
+
</svg>`, Tt = `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
9418
9419
|
<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"/>
|
|
9419
9420
|
</svg>`, Fs = `<svg width="11" height="9" viewBox="0 0 11 9" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
9420
9421
|
<path d="M1 4.5L4 7.5L10 1" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
@@ -9456,7 +9457,7 @@ function Us(i, e, r) {
|
|
|
9456
9457
|
}
|
|
9457
9458
|
class Ws {
|
|
9458
9459
|
constructor(e = "light", r, t = We, s) {
|
|
9459
|
-
this.theme = e, this.overrides = r, this.tokens = pt(e, r), this.displayDecimals = t, this.pinKeyboard = s,
|
|
9460
|
+
this.theme = e, this.overrides = r, this.tokens = pt(e, r), this.displayDecimals = t, this.pinKeyboard = s, qr();
|
|
9460
9461
|
}
|
|
9461
9462
|
setPinKeyboard(e) {
|
|
9462
9463
|
this.pinKeyboard = e;
|
|
@@ -9528,7 +9529,7 @@ class Ws {
|
|
|
9528
9529
|
const T = a.querySelector("#__crossx-wallet-list");
|
|
9529
9530
|
if (T) {
|
|
9530
9531
|
const R = document.createElement("button");
|
|
9531
|
-
R.className = "__crossx-wallet-item", R.dataset.walletIndex = String(A.index), R.dataset.walletAddress = A.address, R.innerHTML = `${
|
|
9532
|
+
R.className = "__crossx-wallet-item", R.dataset.walletIndex = String(A.index), R.dataset.walletAddress = A.address, R.innerHTML = `${kt(A.address, A.index, this.tokens.bg)}<span class="__crossx-wallet-info"><span class="__crossx-wallet-idx">${w(It(A))}</span><span class="__crossx-wallet-addr">${ft(A.address)}</span></span>`, R.addEventListener("click", () => x(A)), T.appendChild(R);
|
|
9532
9533
|
try {
|
|
9533
9534
|
R.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
9534
9535
|
} catch {
|
|
@@ -9744,27 +9745,27 @@ class Ws {
|
|
|
9744
9745
|
A.classList.toggle("--disabled", !I), A.textContent = N || R;
|
|
9745
9746
|
}, Y = (I, O) => {
|
|
9746
9747
|
if (T.has(O)) return;
|
|
9747
|
-
const
|
|
9748
|
-
T.add(O),
|
|
9748
|
+
const $ = I.querySelector(`#__crossx-notice-check-${O}`);
|
|
9749
|
+
T.add(O), $.classList.add("--checked"), I.setAttribute("aria-checked", "true"), W();
|
|
9749
9750
|
}, D = (I, O) => {
|
|
9750
9751
|
if (!T.has(O)) return;
|
|
9751
|
-
const
|
|
9752
|
-
T.delete(O),
|
|
9752
|
+
const $ = I.querySelector(`#__crossx-notice-check-${O}`);
|
|
9753
|
+
T.delete(O), $.classList.remove("--checked"), I.setAttribute("aria-checked", "false"), W();
|
|
9753
9754
|
};
|
|
9754
9755
|
E.forEach((I) => {
|
|
9755
9756
|
const O = parseInt(I.dataset.checkIndex ?? "0", 10);
|
|
9756
9757
|
I.addEventListener("click", () => {
|
|
9757
9758
|
T.has(O) ? D(I, O) : Y(I, O);
|
|
9758
|
-
}), I.addEventListener("keydown", (
|
|
9759
|
-
(
|
|
9759
|
+
}), I.addEventListener("keydown", ($) => {
|
|
9760
|
+
($.key === " " || $.key === "Enter") && ($.preventDefault(), T.has(O) ? D(I, O) : Y(I, O));
|
|
9760
9761
|
});
|
|
9761
9762
|
}), A.addEventListener("click", () => {
|
|
9762
9763
|
if (T.size === E.length) {
|
|
9763
9764
|
y(e == null ? void 0 : e.errorMessage);
|
|
9764
9765
|
return;
|
|
9765
9766
|
}
|
|
9766
|
-
const I = E.find((
|
|
9767
|
-
const X = parseInt(
|
|
9767
|
+
const I = E.find(($) => {
|
|
9768
|
+
const X = parseInt($.dataset.checkIndex ?? "0", 10);
|
|
9768
9769
|
return !T.has(X);
|
|
9769
9770
|
});
|
|
9770
9771
|
if (!I) return;
|
|
@@ -9941,7 +9942,7 @@ class Ws {
|
|
|
9941
9942
|
f && ((m = navigator.clipboard) == null || m.writeText(f).catch(() => {
|
|
9942
9943
|
}));
|
|
9943
9944
|
});
|
|
9944
|
-
}),
|
|
9945
|
+
}), Vr(t), t.addEventListener("click", (x) => {
|
|
9945
9946
|
x.target === t && a();
|
|
9946
9947
|
});
|
|
9947
9948
|
const l = (x) => {
|
|
@@ -10176,9 +10177,9 @@ Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
|
|
|
10176
10177
|
"refresh_token이 평문 저장되지 않도록 세션 영속성이 제한됩니다.",
|
|
10177
10178
|
"IndexedDB를 지원하는 브라우저 사용을 권장합니다."
|
|
10178
10179
|
), t.secureStorageAvailable = o;
|
|
10179
|
-
const n = o ? new at(i.projectId) : new
|
|
10180
|
+
const n = o ? new at(i.projectId) : new br(), a = new Ar(), l = new Rr(), p = new ne(), h = new Gs(), u = new xt();
|
|
10180
10181
|
let x;
|
|
10181
|
-
i.useMockWallet ? (c.log("[CROSSx] Mock Wallet Provider 사용"), x = new
|
|
10182
|
+
i.useMockWallet ? (c.log("[CROSSx] Mock Wallet Provider 사용"), x = new Br(n, u)) : (c.log("[CROSSx] Remote Wallet Provider 사용"), x = new ae(
|
|
10182
10183
|
s,
|
|
10183
10184
|
n,
|
|
10184
10185
|
l,
|
|
@@ -10193,7 +10194,7 @@ Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
|
|
|
10193
10194
|
var N;
|
|
10194
10195
|
return (N = g == null ? void 0 : g.assertRNBridgeSessionActive) == null ? void 0 : N.call(g);
|
|
10195
10196
|
};
|
|
10196
|
-
x = new
|
|
10197
|
+
x = new Ur(
|
|
10197
10198
|
x,
|
|
10198
10199
|
() => {
|
|
10199
10200
|
var N;
|
|
@@ -10216,7 +10217,7 @@ Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
|
|
|
10216
10217
|
},
|
|
10217
10218
|
() => typeof window < "u" ? window.location.origin : "http://localhost",
|
|
10218
10219
|
f
|
|
10219
|
-
), A = e != null && e.wrapConfirmation ? e.wrapConfirmation(E) : E, T = new
|
|
10220
|
+
), A = e != null && e.wrapConfirmation ? e.wrapConfirmation(E) : E, T = new Me(
|
|
10220
10221
|
t,
|
|
10221
10222
|
s,
|
|
10222
10223
|
n,
|
|
@@ -10291,10 +10292,10 @@ function qs(i) {
|
|
|
10291
10292
|
throw new Error("Deeplink data에 accessToken 필드가 없습니다");
|
|
10292
10293
|
}
|
|
10293
10294
|
export {
|
|
10294
|
-
|
|
10295
|
+
Ht as CONNECT_OTHER_WALLET_DISPLAY_ORDER,
|
|
10295
10296
|
_ as CROSSxError,
|
|
10296
|
-
|
|
10297
|
-
|
|
10297
|
+
qt as CROSSxEthereumProvider,
|
|
10298
|
+
Me as CROSSxSDK,
|
|
10298
10299
|
Zs as ChainId,
|
|
10299
10300
|
ge as ConnectOtherWalletItem,
|
|
10300
10301
|
d as ErrorCode,
|
|
@@ -10303,7 +10304,7 @@ export {
|
|
|
10303
10304
|
Gs as TokenMemoryStore,
|
|
10304
10305
|
He as WALLET_BRAND_NAME,
|
|
10305
10306
|
ti as createCROSSxSDK,
|
|
10306
|
-
|
|
10307
|
+
Gt as getConnectOtherWalletLabel,
|
|
10307
10308
|
ve as getWalletBrowserInfo,
|
|
10308
10309
|
Qs as isWalletInAppBrowser,
|
|
10309
10310
|
ri as parseOAuthDeeplink,
|