@nexus-cross/crossx-sdk-core 2.3.10-beta.5 → 2.3.10-beta.6
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/core/utils/walletBrowser.d.ts +54 -0
- package/dist/crossx.global +79 -79
- package/dist/index.cjs +90 -90
- package/dist/index.d.ts +2 -0
- package/dist/index.js +750 -682
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createRemoteJWKSet as
|
|
2
|
-
import { secp256k1 as
|
|
3
|
-
import { keccak_256 as
|
|
4
|
-
import { bytesToHex as
|
|
1
|
+
import { createRemoteJWKSet as kt, jwtVerify as Tt, decodeJwt as Rt } from "jose";
|
|
2
|
+
import { secp256k1 as Ct } from "@noble/curves/secp256k1.js";
|
|
3
|
+
import { keccak_256 as Ye } from "@noble/hashes/sha3.js";
|
|
4
|
+
import { bytesToHex as Pt } 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 h extends Error {
|
|
7
7
|
constructor(e, r, t) {
|
|
@@ -16,25 +16,25 @@ class h extends Error {
|
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
const
|
|
19
|
+
const Nt = 2e3, Xe = 6e4, Ot = 1e3, Lt = 1e4, Dt = "0x77359400", Je = "0x3B9ACA00", Ze = 130, We = 6, Qe = 18, et = 3e4, Mt = 5 * 60 * 1e3, $t = 30 * 1e3, Le = 100, Ft = "crossx-sdk-js/2.3.10-beta.6", Ue = "ONEwallet";
|
|
20
20
|
var ge = /* @__PURE__ */ ((i) => (i.MetaMask = "io.metamask", i.Binance = "com.binance.wallet", i.CROSSx = "crossx", i))(ge || {});
|
|
21
|
-
const
|
|
21
|
+
const Bt = {
|
|
22
22
|
"io.metamask": "MetaMask",
|
|
23
23
|
"com.binance.wallet": "Binance Wallet",
|
|
24
|
-
crossx:
|
|
25
|
-
},
|
|
24
|
+
crossx: Ue
|
|
25
|
+
}, Wt = [
|
|
26
26
|
"crossx",
|
|
27
27
|
"io.metamask",
|
|
28
28
|
"com.binance.wallet"
|
|
29
29
|
/* Binance */
|
|
30
30
|
];
|
|
31
|
-
function
|
|
32
|
-
return
|
|
31
|
+
function Ut(i) {
|
|
32
|
+
return Bt[i] ?? i;
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
return Array.isArray(i.connectOtherWallets) && i.connectOtherWallets.length > 0 ? [...i.connectOtherWallets] : i.showConnectOtherWallets === !0 ? [
|
|
34
|
+
function Ht(i) {
|
|
35
|
+
return Array.isArray(i.connectOtherWallets) && i.connectOtherWallets.length > 0 ? [...i.connectOtherWallets] : i.showConnectOtherWallets === !0 ? [...Wt] : [];
|
|
36
36
|
}
|
|
37
|
-
const
|
|
37
|
+
const Ae = {
|
|
38
38
|
// ─── CROSS ────────────────────────────────────────────
|
|
39
39
|
CROSS_MAINNET: {
|
|
40
40
|
caipId: "eip155:612055",
|
|
@@ -83,20 +83,20 @@ const Se = {
|
|
|
83
83
|
rpcUrl: "https://saigon-testnet.roninchain.com/rpc",
|
|
84
84
|
testnet: !0
|
|
85
85
|
}
|
|
86
|
-
},
|
|
87
|
-
Object.entries(
|
|
88
|
-
),
|
|
89
|
-
Object.values(
|
|
86
|
+
}, js = Object.fromEntries(
|
|
87
|
+
Object.entries(Ae).map(([i, e]) => [i, e.caipId])
|
|
88
|
+
), Gt = new Map(
|
|
89
|
+
Object.values(Ae).map((i) => [i.caipId, i])
|
|
90
90
|
);
|
|
91
91
|
new Map(
|
|
92
|
-
Object.values(
|
|
92
|
+
Object.values(Ae).map((i) => [i.chainId, i])
|
|
93
93
|
);
|
|
94
|
-
const
|
|
95
|
-
function
|
|
94
|
+
const Kt = { symbol: "", decimals: 18 };
|
|
95
|
+
function ke(i) {
|
|
96
96
|
var e;
|
|
97
|
-
return ((e =
|
|
97
|
+
return ((e = Gt.get(i)) == null ? void 0 : e.nativeCurrency) ?? Kt;
|
|
98
98
|
}
|
|
99
|
-
class
|
|
99
|
+
class Vt {
|
|
100
100
|
constructor(e, r) {
|
|
101
101
|
this.sdk = e, this.chainId = r, this._listeners = /* @__PURE__ */ new Map();
|
|
102
102
|
}
|
|
@@ -185,38 +185,38 @@ class Ht {
|
|
|
185
185
|
};
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
let
|
|
189
|
-
function
|
|
190
|
-
|
|
188
|
+
let X = null;
|
|
189
|
+
function tt(i) {
|
|
190
|
+
X = i;
|
|
191
191
|
}
|
|
192
192
|
const c = {
|
|
193
193
|
/** 빌드 모드와 무관하게 항상 출력되는 정보성 로그 (SDK 수명주기 등) */
|
|
194
194
|
info(...i) {
|
|
195
|
-
if (
|
|
196
|
-
|
|
195
|
+
if (X) {
|
|
196
|
+
X.log(...i);
|
|
197
197
|
return;
|
|
198
198
|
}
|
|
199
199
|
console.log(...i);
|
|
200
200
|
},
|
|
201
201
|
log(...i) {
|
|
202
|
-
if (
|
|
203
|
-
|
|
202
|
+
if (X) {
|
|
203
|
+
X.log(...i);
|
|
204
204
|
return;
|
|
205
205
|
}
|
|
206
206
|
},
|
|
207
207
|
warn(...i) {
|
|
208
|
-
if (
|
|
209
|
-
|
|
208
|
+
if (X) {
|
|
209
|
+
X.warn(...i);
|
|
210
210
|
return;
|
|
211
211
|
}
|
|
212
212
|
},
|
|
213
213
|
error(...i) {
|
|
214
|
-
if (
|
|
215
|
-
|
|
214
|
+
if (X) {
|
|
215
|
+
X.error(...i);
|
|
216
216
|
return;
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
|
-
},
|
|
219
|
+
}, zt = {
|
|
220
220
|
// ── 공통 버튼 ────────────────────────────────────────────────
|
|
221
221
|
confirm: "확인",
|
|
222
222
|
cancel: "취소",
|
|
@@ -338,7 +338,7 @@ const c = {
|
|
|
338
338
|
session_alert_apple_account: "Apple 계정",
|
|
339
339
|
session_alert_sign_out_button: "로그아웃",
|
|
340
340
|
session_alert_sign_in_again_button: "다시 로그인"
|
|
341
|
-
},
|
|
341
|
+
}, ht = {
|
|
342
342
|
// ── Common buttons ───────────────────────────────────────────
|
|
343
343
|
confirm: "Confirm",
|
|
344
344
|
cancel: "Cancel",
|
|
@@ -383,7 +383,7 @@ const c = {
|
|
|
383
383
|
label_including_fees: "(including fees)",
|
|
384
384
|
label_primary_type: "Primary Type",
|
|
385
385
|
// ── Login selector modal ─────────────────────────────────────
|
|
386
|
-
login_selector_title:
|
|
386
|
+
login_selector_title: Ue,
|
|
387
387
|
login_selector_subtitle: "Sign in instantly with your social account",
|
|
388
388
|
login_selector_google: "Sign in with Google",
|
|
389
389
|
login_selector_apple: "Sign in with Apple",
|
|
@@ -459,17 +459,17 @@ 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:
|
|
464
|
-
en:
|
|
462
|
+
}, qt = {
|
|
463
|
+
ko: zt,
|
|
464
|
+
en: ht
|
|
465
465
|
};
|
|
466
|
-
function
|
|
467
|
-
return
|
|
466
|
+
function J(i = "en", e) {
|
|
467
|
+
return qt[i] ?? ht;
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function jt(i) {
|
|
470
470
|
return i === "ko" || i === "en" ? i : typeof navigator < "u" && (navigator.language ?? "").toLowerCase().startsWith("ko") ? "ko" : "en";
|
|
471
471
|
}
|
|
472
|
-
const
|
|
472
|
+
const rt = "crossx_access_token", st = "crossx_refresh_token", it = "crossx_user_info", Ee = class Ee {
|
|
473
473
|
constructor(e, r, t, s, o, n, a, l, p = () => {
|
|
474
474
|
}) {
|
|
475
475
|
this.config = e, this.storage = r, this.crypto = t, this.oauth = s, this.transport = o, this.walletProvider = n, this.tokenStore = a, this.requestFreshTokenFromBridge = l, this.getLocale = p, this._refreshPromise = null, this._migrated = !1;
|
|
@@ -568,7 +568,7 @@ const et = "crossx_access_token", tt = "crossx_refresh_token", rt = "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 } = this.config, a =
|
|
571
|
+
const { oauthServiceUrl: n } = this.config, a = jt(this.getLocale()), l = `${n}${o}`, p = l.includes("?") ? "&" : "?", _ = `${l}${p}locale=${a}`;
|
|
572
572
|
c.log(`[CROSSx] OAuth 팝업 열기 (${s || "일반"} 로그인)`), c.log(`[CROSSx] Auth URL: ${_}`);
|
|
573
573
|
const u = await this.oauth.openAuth({
|
|
574
574
|
authUrl: _,
|
|
@@ -679,30 +679,30 @@ const et = "crossx_access_token", tt = "crossx_refresh_token", rt = "crossx_user
|
|
|
679
679
|
try {
|
|
680
680
|
const S = this.crypto.decodeJWT(e);
|
|
681
681
|
c.log("[CROSSx] Firebase JWT 필드:", Object.keys(S).join(", ")), f = (o = S.firebase) == null ? void 0 : o.sign_in_provider;
|
|
682
|
-
const
|
|
683
|
-
m = S.email ?? ((a =
|
|
682
|
+
const A = ((n = S.firebase) == null ? void 0 : n.identities) ?? {};
|
|
683
|
+
m = S.email ?? ((a = A.email) == null ? void 0 : a[0]), f === "google.com" ? g = (l = A["google.com"]) == null ? void 0 : l[0] : f === "apple.com" && (g = (p = A["apple.com"]) == null ? void 0 : p[0]), c.log("[CROSSx] OAuth provider sub 추출 — provider:", f, "hasProviderSub:", !!g, "email:", m ?? "(없음)");
|
|
684
684
|
} catch {
|
|
685
685
|
c.warn("[CROSSx] firebaseToken에서 providerSub 추출 실패");
|
|
686
686
|
}
|
|
687
687
|
if (u) {
|
|
688
688
|
const S = this.crypto.decodeJWT(u);
|
|
689
689
|
c.log("[CROSSx] access_token 디코딩 — sub:", S.sub, "exp:", S.exp, "필드:", Object.keys(S).join(", "));
|
|
690
|
-
const
|
|
691
|
-
if (s =
|
|
690
|
+
const A = await this.crypto.verifyJWT(u);
|
|
691
|
+
if (s = A.signatureVerified ?? !1, !A.valid)
|
|
692
692
|
throw c.error("[CROSSx] access_token 검증 실패"), new Error("유효하지 않은 access token");
|
|
693
|
-
const
|
|
693
|
+
const E = A.payload, k = E.email ?? m ?? r;
|
|
694
694
|
c.log(
|
|
695
695
|
"[CROSSx] email 소스 — CROSSx JWT:",
|
|
696
|
-
|
|
696
|
+
E.email ?? "(없음)",
|
|
697
697
|
"/ Firebase JWT:",
|
|
698
698
|
m ?? "(없음)",
|
|
699
699
|
"/ OAuth 콜백:",
|
|
700
700
|
r ?? "(없음)",
|
|
701
701
|
"→",
|
|
702
|
-
|
|
702
|
+
k ?? "(없음)"
|
|
703
703
|
), t = {
|
|
704
|
-
id:
|
|
705
|
-
email:
|
|
704
|
+
id: E.sub,
|
|
705
|
+
email: k,
|
|
706
706
|
signInProvider: f,
|
|
707
707
|
providerSub: g
|
|
708
708
|
}, this.tokenStore.set(u), this.useCookieAuth || (await this.storage.set(this.STORAGE_KEY_ACCESS_TOKEN, u), x && this.config.secureStorageAvailable !== !1 ? await this.storage.set(this.STORAGE_KEY_REFRESH_TOKEN, x) : x && c.warn("[CROSSx] 안전한 스토리지 미사용 — refresh_token 영속 저장을 건너뜁니다"));
|
|
@@ -915,7 +915,7 @@ const et = "crossx_access_token", tt = "crossx_refresh_token", rt = "crossx_user
|
|
|
915
915
|
c.log("[CROSSx] silentRefresh 응답 — status:", n.status);
|
|
916
916
|
const a = n.data, l = this.extractResponseErrorCode(a);
|
|
917
917
|
if (l) {
|
|
918
|
-
const _ =
|
|
918
|
+
const _ = Ee.REFRESH_RELOGIN_CODES.has(l.code);
|
|
919
919
|
throw new h(
|
|
920
920
|
_ ? d.SESSION_EXPIRED : d.AUTH_FAILED,
|
|
921
921
|
`토큰 갱신 실패 (코드 ${l.code}): ${l.message}`
|
|
@@ -1010,13 +1010,13 @@ const et = "crossx_access_token", tt = "crossx_refresh_token", rt = "crossx_user
|
|
|
1010
1010
|
if (!this._migrated) {
|
|
1011
1011
|
this._migrated = !0;
|
|
1012
1012
|
try {
|
|
1013
|
-
const e = await this.storage.get(
|
|
1013
|
+
const e = await this.storage.get(it);
|
|
1014
1014
|
if (!e || await this.storage.get(this.STORAGE_KEY_USER)) return;
|
|
1015
1015
|
await this.storage.set(this.STORAGE_KEY_USER, e);
|
|
1016
|
-
const t = await this.storage.get(
|
|
1016
|
+
const t = await this.storage.get(rt);
|
|
1017
1017
|
t && await this.storage.set(this.STORAGE_KEY_ACCESS_TOKEN, t);
|
|
1018
|
-
const s = await this.storage.get(
|
|
1019
|
-
s && await this.storage.set(this.STORAGE_KEY_REFRESH_TOKEN, s), await this.storage.remove(
|
|
1018
|
+
const s = await this.storage.get(st);
|
|
1019
|
+
s && await this.storage.set(this.STORAGE_KEY_REFRESH_TOKEN, s), await this.storage.remove(it), await this.storage.remove(rt), await this.storage.remove(st), c.log("[CROSSx] 스토리지 키 마이그레이션 완료 (projectId 스코프)");
|
|
1020
1020
|
} catch (e) {
|
|
1021
1021
|
c.warn("[CROSSx] 스토리지 키 마이그레이션 실패:", e);
|
|
1022
1022
|
}
|
|
@@ -1051,9 +1051,9 @@ const et = "crossx_access_token", tt = "crossx_refresh_token", rt = "crossx_user
|
|
|
1051
1051
|
return c.log("[CROSSx] loadWallet 결과 — address:", t, "needsMigration:", s), { success: !0, address: t, user: e, needsMigration: s, tokenSignatureVerified: r };
|
|
1052
1052
|
}
|
|
1053
1053
|
};
|
|
1054
|
-
|
|
1055
|
-
let
|
|
1056
|
-
class
|
|
1054
|
+
Ee.REFRESH_RELOGIN_CODES = /* @__PURE__ */ new Set([1007, 1008]);
|
|
1055
|
+
let De = Ee;
|
|
1056
|
+
class Yt {
|
|
1057
1057
|
constructor(e, r, t) {
|
|
1058
1058
|
this.config = e, this.storage = r, this.tokenStore = t;
|
|
1059
1059
|
const s = e.projectId;
|
|
@@ -1063,7 +1063,7 @@ class Vt {
|
|
|
1063
1063
|
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();
|
|
1064
1064
|
}
|
|
1065
1065
|
}
|
|
1066
|
-
class
|
|
1066
|
+
class Xt {
|
|
1067
1067
|
constructor(e, r) {
|
|
1068
1068
|
this.storage = e, this.walletProvider = r;
|
|
1069
1069
|
}
|
|
@@ -1080,7 +1080,7 @@ class qt {
|
|
|
1080
1080
|
};
|
|
1081
1081
|
}
|
|
1082
1082
|
}
|
|
1083
|
-
class
|
|
1083
|
+
class ut {
|
|
1084
1084
|
constructor() {
|
|
1085
1085
|
this.encryptedBytes = null, this.xorKey = null;
|
|
1086
1086
|
}
|
|
@@ -1121,7 +1121,7 @@ class pt {
|
|
|
1121
1121
|
return this.encryptedBytes !== null;
|
|
1122
1122
|
}
|
|
1123
1123
|
}
|
|
1124
|
-
class
|
|
1124
|
+
class Jt {
|
|
1125
1125
|
constructor(e, r) {
|
|
1126
1126
|
this.chainRegistry = e, this.transport = r, this._nextId = 1;
|
|
1127
1127
|
}
|
|
@@ -1153,7 +1153,7 @@ class jt {
|
|
|
1153
1153
|
return a == null ? void 0 : a.result;
|
|
1154
1154
|
}
|
|
1155
1155
|
}
|
|
1156
|
-
class
|
|
1156
|
+
class Zt {
|
|
1157
1157
|
constructor() {
|
|
1158
1158
|
this.listeners = /* @__PURE__ */ new Map();
|
|
1159
1159
|
}
|
|
@@ -1176,7 +1176,7 @@ class Yt {
|
|
|
1176
1176
|
this.listeners.clear();
|
|
1177
1177
|
}
|
|
1178
1178
|
}
|
|
1179
|
-
function
|
|
1179
|
+
function Qt() {
|
|
1180
1180
|
var e;
|
|
1181
1181
|
if (typeof globalThis < "u" && ((e = globalThis.crypto) != null && e.getRandomValues)) {
|
|
1182
1182
|
const r = new Uint8Array(16);
|
|
@@ -1184,7 +1184,7 @@ function Xt() {
|
|
|
1184
1184
|
}
|
|
1185
1185
|
return require("crypto").randomBytes(16).toString("hex");
|
|
1186
1186
|
}
|
|
1187
|
-
class
|
|
1187
|
+
class Y {
|
|
1188
1188
|
constructor(e) {
|
|
1189
1189
|
this.config = e, this.context = null;
|
|
1190
1190
|
}
|
|
@@ -1221,7 +1221,7 @@ class j {
|
|
|
1221
1221
|
* Initialize and activate bridge
|
|
1222
1222
|
*/
|
|
1223
1223
|
async initialize() {
|
|
1224
|
-
if (await
|
|
1224
|
+
if (await Y.waitForBridgeReady(5e3) || c.warn("[RNBridge] Bridge did not become ready in time"), this.bridge = Y.getBridge(), !this.bridge)
|
|
1225
1225
|
throw new h(
|
|
1226
1226
|
d.AUTH_NOT_INITIALIZED,
|
|
1227
1227
|
"RN Bridge not available in this environment"
|
|
@@ -1246,7 +1246,7 @@ class j {
|
|
|
1246
1246
|
async handshake() {
|
|
1247
1247
|
if (!this.bridge)
|
|
1248
1248
|
throw new h(d.AUTH_NOT_INITIALIZED, "Bridge not initialized");
|
|
1249
|
-
const e =
|
|
1249
|
+
const e = Qt(), r = Date.now(), t = {
|
|
1250
1250
|
version: 1,
|
|
1251
1251
|
appId: this.config.appId,
|
|
1252
1252
|
appVersion: this.config.appVersion,
|
|
@@ -1410,7 +1410,7 @@ class j {
|
|
|
1410
1410
|
);
|
|
1411
1411
|
}
|
|
1412
1412
|
}
|
|
1413
|
-
const
|
|
1413
|
+
const _e = {
|
|
1414
1414
|
production: {
|
|
1415
1415
|
oauthServiceUrl: "https://one-wallet-oauth.onechain.nexus",
|
|
1416
1416
|
authApiUrl: "https://cross-auth.crosstoken.io",
|
|
@@ -1434,8 +1434,8 @@ const de = {
|
|
|
1434
1434
|
contentsBaseUrl: "https://stg-contents.crosstoken.io/frontend/common/app-launcher"
|
|
1435
1435
|
}
|
|
1436
1436
|
};
|
|
1437
|
-
function
|
|
1438
|
-
const e = i.environment, r = e && e in
|
|
1437
|
+
function er(i) {
|
|
1438
|
+
const e = i.environment, r = e && e in _e ? _e[e] : null;
|
|
1439
1439
|
if (!r)
|
|
1440
1440
|
return null;
|
|
1441
1441
|
const t = i.overrides;
|
|
@@ -1446,63 +1446,63 @@ function Jt(i) {
|
|
|
1446
1446
|
typeof n == "string" && n.trim() !== "" && (s[o] = n);
|
|
1447
1447
|
return s;
|
|
1448
1448
|
}
|
|
1449
|
-
function
|
|
1449
|
+
function He() {
|
|
1450
1450
|
try {
|
|
1451
1451
|
if (typeof __CROSSX_CONFIG__ < "u") {
|
|
1452
|
-
const i = typeof __CROSSX_CONFIG__ == "string" ? JSON.parse(__CROSSX_CONFIG__) : __CROSSX_CONFIG__, e =
|
|
1452
|
+
const i = typeof __CROSSX_CONFIG__ == "string" ? JSON.parse(__CROSSX_CONFIG__) : __CROSSX_CONFIG__, e = er(i);
|
|
1453
1453
|
if (e) return e;
|
|
1454
1454
|
}
|
|
1455
1455
|
} catch {
|
|
1456
1456
|
}
|
|
1457
1457
|
try {
|
|
1458
1458
|
const i = process.env.NEXT_PUBLIC_CROSSX_ENVIRONMENT;
|
|
1459
|
-
if (i && i in
|
|
1460
|
-
return
|
|
1459
|
+
if (i && i in _e)
|
|
1460
|
+
return _e[i];
|
|
1461
1461
|
} catch {
|
|
1462
1462
|
}
|
|
1463
|
-
return
|
|
1463
|
+
return _e.production;
|
|
1464
1464
|
}
|
|
1465
|
-
function
|
|
1465
|
+
function xt(i) {
|
|
1466
1466
|
let e = i.length;
|
|
1467
1467
|
for (; e > 0 && i.charCodeAt(e - 1) === 48; ) e--;
|
|
1468
1468
|
return i.slice(0, e);
|
|
1469
1469
|
}
|
|
1470
|
-
function
|
|
1470
|
+
function tr(i, e = We) {
|
|
1471
1471
|
if (!i || i === "0x0" || i === "0x") return "0";
|
|
1472
1472
|
try {
|
|
1473
1473
|
const r = BigInt(i);
|
|
1474
1474
|
if (r === 0n) return "0";
|
|
1475
|
-
const t = 10n ** BigInt(
|
|
1475
|
+
const t = 10n ** BigInt(Qe), s = r / t, n = (r % t).toString().padStart(Qe, "0"), a = xt(n).slice(0, e);
|
|
1476
1476
|
return a ? `${s}.${a}` : `${s}`;
|
|
1477
1477
|
} catch {
|
|
1478
1478
|
return "?";
|
|
1479
1479
|
}
|
|
1480
1480
|
}
|
|
1481
|
-
function
|
|
1481
|
+
function ye(i, e, r, t = We) {
|
|
1482
1482
|
if (!(!i || i === "0x" || i === "0x0"))
|
|
1483
1483
|
try {
|
|
1484
1484
|
const s = BigInt(i);
|
|
1485
1485
|
if (s === 0n) return;
|
|
1486
|
-
const o = 10n ** BigInt(r), n = s / o, l = (s % o).toString().padStart(r, "0"), p =
|
|
1486
|
+
const o = 10n ** BigInt(r), n = s / o, l = (s % o).toString().padStart(r, "0"), p = xt(l.slice(0, t));
|
|
1487
1487
|
return `${p ? `${n}.${p}` : `${n}`} ${e}`;
|
|
1488
1488
|
} catch {
|
|
1489
1489
|
return;
|
|
1490
1490
|
}
|
|
1491
1491
|
}
|
|
1492
|
-
function
|
|
1492
|
+
function rr(i) {
|
|
1493
1493
|
const e = i.startsWith("0x") ? i.slice(2) : i;
|
|
1494
1494
|
if (!/^[0-9a-fA-F]+$/.test(e))
|
|
1495
1495
|
throw new h(
|
|
1496
1496
|
d.SIGNATURE_FAILED,
|
|
1497
1497
|
"유효하지 않은 서명: 올바른 hex 문자열이 아닙니다"
|
|
1498
1498
|
);
|
|
1499
|
-
if (e.length !==
|
|
1499
|
+
if (e.length !== Ze)
|
|
1500
1500
|
throw new h(
|
|
1501
1501
|
d.SIGNATURE_FAILED,
|
|
1502
|
-
`서명 길이가 유효하지 않습니다: ${
|
|
1502
|
+
`서명 길이가 유효하지 않습니다: ${Ze} hex 문자(65 바이트) 예상, 현재 ${e.length}`
|
|
1503
1503
|
);
|
|
1504
1504
|
}
|
|
1505
|
-
function
|
|
1505
|
+
function sr(i) {
|
|
1506
1506
|
const e = i.startsWith("0x") ? i.slice(2) : i;
|
|
1507
1507
|
if (!/^[0-9a-fA-F]+$/.test(e))
|
|
1508
1508
|
throw new h(
|
|
@@ -1515,8 +1515,8 @@ function er(i) {
|
|
|
1515
1515
|
"유효하지 않은 서명된 트랜잭션: 너무 짧습니다"
|
|
1516
1516
|
);
|
|
1517
1517
|
}
|
|
1518
|
-
function
|
|
1519
|
-
const r =
|
|
1518
|
+
function ir(i, e) {
|
|
1519
|
+
const r = or(e);
|
|
1520
1520
|
if (i === "0") {
|
|
1521
1521
|
if (r !== void 0 && r !== 0)
|
|
1522
1522
|
throw new h(
|
|
@@ -1540,7 +1540,7 @@ function tr(i, e) {
|
|
|
1540
1540
|
);
|
|
1541
1541
|
}
|
|
1542
1542
|
}
|
|
1543
|
-
function
|
|
1543
|
+
function or(i) {
|
|
1544
1544
|
if (i == null || typeof i != "object") return;
|
|
1545
1545
|
const e = i.domain;
|
|
1546
1546
|
if (e == null || typeof e != "object") return;
|
|
@@ -1549,7 +1549,7 @@ function rr(i) {
|
|
|
1549
1549
|
const t = Number(r);
|
|
1550
1550
|
return Number.isFinite(t) ? t : void 0;
|
|
1551
1551
|
}
|
|
1552
|
-
class
|
|
1552
|
+
class pe {
|
|
1553
1553
|
constructor(e) {
|
|
1554
1554
|
this.deps = e, this.verifyPinMutex = null;
|
|
1555
1555
|
}
|
|
@@ -1590,7 +1590,7 @@ class le {
|
|
|
1590
1590
|
this.verifyPinMutex = new Promise((_, u) => {
|
|
1591
1591
|
o = _, n = u;
|
|
1592
1592
|
});
|
|
1593
|
-
const a =
|
|
1593
|
+
const a = J(this.deps.getLocale() ?? "en");
|
|
1594
1594
|
try {
|
|
1595
1595
|
if (typeof this.deps.walletProvider.verifyPin != "function") {
|
|
1596
1596
|
const u = await this.deps.confirmation.showPinInputPrompt({
|
|
@@ -1625,7 +1625,7 @@ class le {
|
|
|
1625
1625
|
if (x.code === d.PIN_INVALID)
|
|
1626
1626
|
return { ok: !1, error: x.message };
|
|
1627
1627
|
if (x.code === d.PIN_LOCKED)
|
|
1628
|
-
return
|
|
1628
|
+
return pe.buildPinLockedResult(x, a);
|
|
1629
1629
|
}
|
|
1630
1630
|
throw x;
|
|
1631
1631
|
}
|
|
@@ -1639,7 +1639,7 @@ class le {
|
|
|
1639
1639
|
this.deps.pinStore.set(_), c.log("[CROSSx] PIN 갱신 완료 (verify 모달 닫힘)"), o();
|
|
1640
1640
|
} catch (_) {
|
|
1641
1641
|
if (_ instanceof h && (_.code === d.AUTH_NOT_AUTHENTICATED || _.code === d.AUTH_TOKEN_EXPIRED || _.code === d.SESSION_EXPIRED) && _.code !== d.SESSION_EXPIRED) {
|
|
1642
|
-
const u =
|
|
1642
|
+
const u = J(this.deps.getLocale() ?? "en"), x = this.deps.getUserEmail();
|
|
1643
1643
|
if (await this.deps.confirmation.showSessionAlert({
|
|
1644
1644
|
title: u.session_alert_title,
|
|
1645
1645
|
message: u.alert_session_expired,
|
|
@@ -1653,13 +1653,13 @@ class le {
|
|
|
1653
1653
|
}
|
|
1654
1654
|
}
|
|
1655
1655
|
async withPinRetry(e) {
|
|
1656
|
-
const r =
|
|
1656
|
+
const r = J(this.deps.getLocale() ?? "en");
|
|
1657
1657
|
let t = null;
|
|
1658
1658
|
try {
|
|
1659
1659
|
return await e();
|
|
1660
1660
|
} catch (s) {
|
|
1661
1661
|
if (s instanceof h) {
|
|
1662
|
-
if (t =
|
|
1662
|
+
if (t = pe.parsePinError(s, r), !t) throw s;
|
|
1663
1663
|
} else
|
|
1664
1664
|
throw s;
|
|
1665
1665
|
}
|
|
@@ -1673,7 +1673,7 @@ class le {
|
|
|
1673
1673
|
try {
|
|
1674
1674
|
return await e();
|
|
1675
1675
|
} catch (s) {
|
|
1676
|
-
if (s instanceof h && (t =
|
|
1676
|
+
if (s instanceof h && (t = pe.parsePinError(s, r), t))
|
|
1677
1677
|
continue;
|
|
1678
1678
|
throw s;
|
|
1679
1679
|
}
|
|
@@ -1698,13 +1698,13 @@ class le {
|
|
|
1698
1698
|
return null;
|
|
1699
1699
|
}
|
|
1700
1700
|
static buildPinLockedResult(e, r) {
|
|
1701
|
-
const t =
|
|
1701
|
+
const t = pe.parsePinError(e, r);
|
|
1702
1702
|
if (!t) return { ok: !1, error: e.message };
|
|
1703
1703
|
const { errorMessage: s, ...o } = t;
|
|
1704
1704
|
return { ok: !1, error: s, ...o };
|
|
1705
1705
|
}
|
|
1706
1706
|
}
|
|
1707
|
-
class
|
|
1707
|
+
class nr {
|
|
1708
1708
|
constructor(e) {
|
|
1709
1709
|
this.deps = e;
|
|
1710
1710
|
}
|
|
@@ -1725,10 +1725,10 @@ class sr {
|
|
|
1725
1725
|
});
|
|
1726
1726
|
}
|
|
1727
1727
|
}
|
|
1728
|
-
function
|
|
1728
|
+
function ar(i) {
|
|
1729
1729
|
return i === "google" || i === "apple";
|
|
1730
1730
|
}
|
|
1731
|
-
class
|
|
1731
|
+
class cr {
|
|
1732
1732
|
constructor(e) {
|
|
1733
1733
|
this.deps = e;
|
|
1734
1734
|
}
|
|
@@ -1739,7 +1739,7 @@ class or {
|
|
|
1739
1739
|
this.deps.setRecoveringSession(!0);
|
|
1740
1740
|
try {
|
|
1741
1741
|
this.deps.setAuthenticated(!1), this.deps.clearTokenStore();
|
|
1742
|
-
const s =
|
|
1742
|
+
const s = ar(e.loginType) ? { provider: e.loginType } : void 0;
|
|
1743
1743
|
let o;
|
|
1744
1744
|
try {
|
|
1745
1745
|
o = await this.deps.executeSignIn(s);
|
|
@@ -1754,7 +1754,7 @@ class or {
|
|
|
1754
1754
|
"[CROSSx] signInAgain: providerSub/userId 불일치 — 잘못된 계정으로 로그인됨"
|
|
1755
1755
|
), await this.deps.executeSignOut().catch(() => {
|
|
1756
1756
|
});
|
|
1757
|
-
const p =
|
|
1757
|
+
const p = J(this.deps.getLocale() ?? "en");
|
|
1758
1758
|
return await this.deps.showSessionAlert({
|
|
1759
1759
|
title: p.session_alert_title,
|
|
1760
1760
|
message: p.alert_different_account,
|
|
@@ -1779,7 +1779,7 @@ class or {
|
|
|
1779
1779
|
try {
|
|
1780
1780
|
return await e();
|
|
1781
1781
|
} catch (r) {
|
|
1782
|
-
const t =
|
|
1782
|
+
const t = J(this.deps.getLocale() ?? "en"), { userEmail: s } = this.deps.getSessionSnapshot(), o = s ? this.deps.maskEmail(s, t.session_alert_apple_account) : void 0;
|
|
1783
1783
|
if (r instanceof h && r.code === d.WITHDRAW_FAILED) {
|
|
1784
1784
|
if (c.warn("[CROSSx] WITHDRAW_FAILED — 로컬 인증 초기화"), await this.deps.showSessionAlert({
|
|
1785
1785
|
title: t.session_alert_title,
|
|
@@ -1819,7 +1819,7 @@ class or {
|
|
|
1819
1819
|
}
|
|
1820
1820
|
}
|
|
1821
1821
|
}
|
|
1822
|
-
class
|
|
1822
|
+
class lr {
|
|
1823
1823
|
constructor(e) {
|
|
1824
1824
|
this.deps = e;
|
|
1825
1825
|
}
|
|
@@ -1866,7 +1866,7 @@ class nr {
|
|
|
1866
1866
|
c.log("[CROSSx] 세션 복원 후 지갑 주소 로드 완료:", a.address), this.deps.setActiveWallet(a.address, 0);
|
|
1867
1867
|
}
|
|
1868
1868
|
}
|
|
1869
|
-
class
|
|
1869
|
+
class dr {
|
|
1870
1870
|
constructor(e) {
|
|
1871
1871
|
this.deps = e;
|
|
1872
1872
|
}
|
|
@@ -1934,7 +1934,7 @@ class ar {
|
|
|
1934
1934
|
c.warn(
|
|
1935
1935
|
"[CROSSx][Migration Phase 4] 세션 만료 — 재로그인 후 PIN 입력 재시도"
|
|
1936
1936
|
);
|
|
1937
|
-
const x =
|
|
1937
|
+
const x = J(this.deps.getLocale() ?? "en"), g = this.deps.getUserEmail();
|
|
1938
1938
|
if (await this.deps.confirmation.showSessionAlert({
|
|
1939
1939
|
title: x.session_alert_title,
|
|
1940
1940
|
message: x.alert_session_expired,
|
|
@@ -1992,7 +1992,7 @@ class ar {
|
|
|
1992
1992
|
c.warn(
|
|
1993
1993
|
"[CROSSx][Migration Phase 5] 세션 만료 — 재로그인 후 마이그레이션 재시도"
|
|
1994
1994
|
);
|
|
1995
|
-
const u =
|
|
1995
|
+
const u = J(this.deps.getLocale() ?? "en"), x = this.deps.getUserEmail();
|
|
1996
1996
|
if (await this.deps.confirmation.showSessionAlert({
|
|
1997
1997
|
title: u.session_alert_title,
|
|
1998
1998
|
message: u.alert_session_expired,
|
|
@@ -2023,7 +2023,7 @@ class ar {
|
|
|
2023
2023
|
}
|
|
2024
2024
|
}
|
|
2025
2025
|
}
|
|
2026
|
-
class
|
|
2026
|
+
class pr {
|
|
2027
2027
|
constructor(e) {
|
|
2028
2028
|
this.deps = e;
|
|
2029
2029
|
}
|
|
@@ -2050,7 +2050,7 @@ class cr {
|
|
|
2050
2050
|
if (p && (l.nonce = parseInt(_ ?? "0x0", 16), c.log("[CROSSx] nonce 결과:", l.nonce)), o && (l.gasLimit = u, c.log("[CROSSx] estimateGas 결과:", l.gasLimit)), n) {
|
|
2051
2051
|
const g = x;
|
|
2052
2052
|
if (g) {
|
|
2053
|
-
const f =
|
|
2053
|
+
const f = Je;
|
|
2054
2054
|
l.maxFeePerGas = `0x${(BigInt(g) + BigInt(f)).toString(16)}`, l.maxPriorityFeePerGas = f, c.log(
|
|
2055
2055
|
"[CROSSx] Dynamic 체인 감지 — baseFee:",
|
|
2056
2056
|
g,
|
|
@@ -2059,12 +2059,12 @@ class cr {
|
|
|
2059
2059
|
"maxPriorityFeePerGas: 1 Gwei"
|
|
2060
2060
|
);
|
|
2061
2061
|
} else
|
|
2062
|
-
l.gasPrice =
|
|
2062
|
+
l.gasPrice = Dt, c.log("[CROSSx] Legacy 체인 감지 — gasPrice: 2 Gwei");
|
|
2063
2063
|
}
|
|
2064
|
-
return !n && a && (l.maxPriorityFeePerGas =
|
|
2064
|
+
return !n && a && (l.maxPriorityFeePerGas = Je, c.log("[CROSSx] maxPriorityFeePerGas 비어있음 → 1 Gwei 기본값 적용")), l;
|
|
2065
2065
|
}
|
|
2066
2066
|
}
|
|
2067
|
-
class
|
|
2067
|
+
class _r {
|
|
2068
2068
|
constructor(e) {
|
|
2069
2069
|
this.crypto = e;
|
|
2070
2070
|
}
|
|
@@ -2090,10 +2090,10 @@ class lr {
|
|
|
2090
2090
|
}
|
|
2091
2091
|
}
|
|
2092
2092
|
}
|
|
2093
|
-
function
|
|
2093
|
+
function hr(i) {
|
|
2094
2094
|
return i ? i.includes("google") ? "google" : i.includes("apple") ? "apple" : i : null;
|
|
2095
2095
|
}
|
|
2096
|
-
class
|
|
2096
|
+
class ur {
|
|
2097
2097
|
constructor(e) {
|
|
2098
2098
|
this.deps = e;
|
|
2099
2099
|
}
|
|
@@ -2115,7 +2115,7 @@ class pr {
|
|
|
2115
2115
|
activeWalletIndex: 0,
|
|
2116
2116
|
userEmail: ((o = e.user) == null ? void 0 : o.email) ?? null,
|
|
2117
2117
|
providerSub: ((n = e.user) == null ? void 0 : n.providerSub) ?? null,
|
|
2118
|
-
loginType:
|
|
2118
|
+
loginType: hr(
|
|
2119
2119
|
(a = e.user) == null ? void 0 : a.signInProvider
|
|
2120
2120
|
),
|
|
2121
2121
|
tokenSignatureVerified: e.tokenSignatureVerified ?? !1
|
|
@@ -2145,7 +2145,7 @@ class pr {
|
|
|
2145
2145
|
});
|
|
2146
2146
|
}
|
|
2147
2147
|
}
|
|
2148
|
-
class
|
|
2148
|
+
class xr {
|
|
2149
2149
|
constructor(e) {
|
|
2150
2150
|
this.deps = e;
|
|
2151
2151
|
}
|
|
@@ -2164,7 +2164,7 @@ class _r {
|
|
|
2164
2164
|
)).address, index: e };
|
|
2165
2165
|
}
|
|
2166
2166
|
}
|
|
2167
|
-
class
|
|
2167
|
+
class gr {
|
|
2168
2168
|
constructor(e) {
|
|
2169
2169
|
this.deps = e;
|
|
2170
2170
|
}
|
|
@@ -2183,7 +2183,7 @@ class hr {
|
|
|
2183
2183
|
);
|
|
2184
2184
|
}
|
|
2185
2185
|
}
|
|
2186
|
-
class
|
|
2186
|
+
class fr {
|
|
2187
2187
|
constructor(e) {
|
|
2188
2188
|
this.deps = e;
|
|
2189
2189
|
}
|
|
@@ -2243,11 +2243,11 @@ class ur {
|
|
|
2243
2243
|
}
|
|
2244
2244
|
}
|
|
2245
2245
|
}
|
|
2246
|
-
function
|
|
2246
|
+
function ot(i, e) {
|
|
2247
2247
|
const r = i.replace(/\/$/, ""), t = e.startsWith("/") ? e : `/${e}`;
|
|
2248
2248
|
return `${r}/cross-auth${t}`;
|
|
2249
2249
|
}
|
|
2250
|
-
class
|
|
2250
|
+
class wr {
|
|
2251
2251
|
constructor(e) {
|
|
2252
2252
|
this.deps = e;
|
|
2253
2253
|
}
|
|
@@ -2283,7 +2283,7 @@ class xr {
|
|
|
2283
2283
|
d.TX_INVALID_PARAMS,
|
|
2284
2284
|
"invalid param body"
|
|
2285
2285
|
);
|
|
2286
|
-
const o = this.deps.getApiBaseUrl(), n =
|
|
2286
|
+
const o = this.deps.getApiBaseUrl(), n = ot(o, `/v2/token-historical/${e}/${s}`), a = { clientVersion: t };
|
|
2287
2287
|
try {
|
|
2288
2288
|
c.log("[TokenHistory] Registering tx:", e, s);
|
|
2289
2289
|
const l = await this.deps.transport.request({
|
|
@@ -2313,7 +2313,7 @@ class xr {
|
|
|
2313
2313
|
*/
|
|
2314
2314
|
async getTokenHistory(e) {
|
|
2315
2315
|
var s;
|
|
2316
|
-
const r = this.deps.getApiBaseUrl(), t = new URL(
|
|
2316
|
+
const r = this.deps.getApiBaseUrl(), t = new URL(ot(r, "/v2/token-historical"));
|
|
2317
2317
|
(e == null ? void 0 : e.lastTimestamp) !== void 0 && t.searchParams.append("last_timestamp", e.lastTimestamp.toString()), (e == null ? void 0 : e.lastTxIndex) !== void 0 && t.searchParams.append("last_tx_index", e.lastTxIndex.toString());
|
|
2318
2318
|
try {
|
|
2319
2319
|
c.log("[TokenHistory] Fetching token history");
|
|
@@ -2388,17 +2388,17 @@ class xr {
|
|
|
2388
2388
|
throw new h(s.code, s.message);
|
|
2389
2389
|
}
|
|
2390
2390
|
}
|
|
2391
|
-
function
|
|
2391
|
+
function Te(i, e = "Apple account") {
|
|
2392
2392
|
if (i.endsWith("@privaterelay.appleid.com")) return e;
|
|
2393
2393
|
const r = i.indexOf("@");
|
|
2394
2394
|
if (r < 0) return "*".repeat(i.length || 3);
|
|
2395
2395
|
const t = i.substring(0, r), s = i.substring(r);
|
|
2396
2396
|
return t.length <= 1 ? `${t}${"*".repeat(Math.max(t.length, 1))}${s}` : `${t[0]}${"*".repeat(t.length - 1)}${s}`;
|
|
2397
2397
|
}
|
|
2398
|
-
const
|
|
2398
|
+
const oe = class oe extends Zt {
|
|
2399
2399
|
constructor(e, r, t, s, o, n, a, l, p, _, u) {
|
|
2400
2400
|
var x, g;
|
|
2401
|
-
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 &&
|
|
2401
|
+
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 && tt(e.logger), this.confirmation = p, this.pinStore = u ?? new ut(), this.stateManager = new ur({
|
|
2402
2402
|
setState: (f) => {
|
|
2403
2403
|
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);
|
|
2404
2404
|
},
|
|
@@ -2416,62 +2416,62 @@ const ne = class ne extends Yt {
|
|
|
2416
2416
|
});
|
|
2417
2417
|
},
|
|
2418
2418
|
shouldPersistWalletPreference: () => this._config.persistWalletPreference !== !1,
|
|
2419
|
-
walletPreferenceKey:
|
|
2419
|
+
walletPreferenceKey: oe.WALLET_PREF_KEY,
|
|
2420
2420
|
storage: this.storage,
|
|
2421
2421
|
pinStore: this.pinStore
|
|
2422
|
-
}), this.pinOrchestrator = new
|
|
2422
|
+
}), this.pinOrchestrator = new pe({
|
|
2423
2423
|
confirmation: this.confirmation,
|
|
2424
2424
|
walletProvider: this.walletProvider,
|
|
2425
2425
|
pinStore: this.pinStore,
|
|
2426
2426
|
getLocale: () => this._config.locale,
|
|
2427
2427
|
getUserEmail: () => this.userEmail,
|
|
2428
|
-
maskEmail:
|
|
2428
|
+
maskEmail: Te,
|
|
2429
2429
|
signInAgain: () => this.signInAgain(),
|
|
2430
2430
|
// §12 native sign delegation: bridge 자동 로그인 세션이면 JS PIN 단계를 스킵한다.
|
|
2431
2431
|
// dApp 이 sdk.pinOrchestrator.ensureVerifiedPin() 을 직접 호출해도 (SigningOrchestrator 우회)
|
|
2432
2432
|
// WebView 안에서 embedded PIN 프롬프트가 뜨지 않도록 게이팅. SigningOrchestrator 와 동일 신호.
|
|
2433
2433
|
isRNBridgeMode: () => this._isAuthenticatedViaRNBridge
|
|
2434
|
-
}), this.signingOrchestrator = new
|
|
2434
|
+
}), this.signingOrchestrator = new nr({
|
|
2435
2435
|
confirmation: this.confirmation,
|
|
2436
2436
|
walletProvider: this.walletProvider,
|
|
2437
2437
|
pinOrchestrator: this.pinOrchestrator,
|
|
2438
2438
|
// §12 native sign delegation: 이 SDK 세션이 RN bridge 자동 로그인으로 인증된 경우만 활성.
|
|
2439
2439
|
// 자동 로그인 거부 / OAuth 로 별도 로그인한 세션에서는 native SDK 가 미인증이라 우회한다.
|
|
2440
2440
|
isRNBridgeMode: () => this._isAuthenticatedViaRNBridge
|
|
2441
|
-
}), this.walletLifecycleService = new
|
|
2441
|
+
}), this.walletLifecycleService = new lr({
|
|
2442
2442
|
walletProvider: this.walletProvider,
|
|
2443
2443
|
pinOrchestrator: this.pinOrchestrator,
|
|
2444
2444
|
getUserId: () => this.userId,
|
|
2445
2445
|
setActiveWallet: (f, m, y) => this.setActiveWallet(f, m, y)
|
|
2446
|
-
}), this.migrationOrchestrator = new
|
|
2446
|
+
}), this.migrationOrchestrator = new dr({
|
|
2447
2447
|
confirmation: this.confirmation,
|
|
2448
2448
|
walletProvider: this.walletProvider,
|
|
2449
2449
|
pinOrchestrator: this.pinOrchestrator,
|
|
2450
2450
|
executeMigrate: (f, m) => this.migrateWalletUseCase.execute(f, m),
|
|
2451
2451
|
getLocale: () => this._config.locale,
|
|
2452
2452
|
getUserEmail: () => this.userEmail,
|
|
2453
|
-
maskEmail:
|
|
2453
|
+
maskEmail: Te,
|
|
2454
2454
|
signInAgain: () => this.signInAgain(),
|
|
2455
2455
|
clearAuthState: () => this.clearAuthState(),
|
|
2456
2456
|
getAllowSkip: () => {
|
|
2457
2457
|
var f;
|
|
2458
2458
|
return ((f = this._config.migration) == null ? void 0 : f.allowSkip) ?? !0;
|
|
2459
2459
|
}
|
|
2460
|
-
}), this.transactionLifecycleService = new
|
|
2460
|
+
}), this.transactionLifecycleService = new pr({
|
|
2461
2461
|
getActiveAddress: () => this.address,
|
|
2462
2462
|
estimateGas: (f, m) => this.estimateGas(f, m),
|
|
2463
2463
|
getBaseFeePerGas: (f) => this.getBaseFeePerGas(f),
|
|
2464
2464
|
jsonRpcCall: (f, m, y) => this.jsonRpc.call(f, m, y)
|
|
2465
|
-
}), this.signatureVerifier = new
|
|
2465
|
+
}), this.signatureVerifier = new _r(this.crypto), this.addressResolverService = new xr({
|
|
2466
2466
|
walletProvider: this.walletProvider,
|
|
2467
2467
|
pinOrchestrator: this.pinOrchestrator,
|
|
2468
2468
|
getActiveAddress: () => this.address,
|
|
2469
2469
|
getActiveWalletIndex: () => this.activeWalletIndex,
|
|
2470
2470
|
getUserId: () => this.userId
|
|
2471
|
-
}), this.authGuardService = new
|
|
2471
|
+
}), this.authGuardService = new gr({
|
|
2472
2472
|
isInitialized: () => this.initialized,
|
|
2473
2473
|
isAuthenticated: () => this.authenticated
|
|
2474
|
-
}), this.walletCreationService = new
|
|
2474
|
+
}), this.walletCreationService = new fr({
|
|
2475
2475
|
walletProvider: this.walletProvider,
|
|
2476
2476
|
pinOrchestrator: this.pinOrchestrator,
|
|
2477
2477
|
migrationOrchestrator: this.migrationOrchestrator,
|
|
@@ -2483,10 +2483,10 @@ const ne = class ne extends Yt {
|
|
|
2483
2483
|
var f, m;
|
|
2484
2484
|
return ((m = (f = this.confirmation).showWalletCreatedPrompt) == null ? void 0 : m.call(f)) ?? Promise.resolve();
|
|
2485
2485
|
}
|
|
2486
|
-
}), this.tokenHistoryService = new
|
|
2486
|
+
}), this.tokenHistoryService = new wr({
|
|
2487
2487
|
transport: o,
|
|
2488
2488
|
getApiBaseUrl: () => this.internalConfig.authApiUrl
|
|
2489
|
-
}), this.sessionOrchestrator = new
|
|
2489
|
+
}), this.sessionOrchestrator = new cr({
|
|
2490
2490
|
ensureInitialized: () => this.ensureInitialized(),
|
|
2491
2491
|
getSessionSnapshot: () => ({
|
|
2492
2492
|
providerSub: this.providerSub,
|
|
@@ -2508,8 +2508,8 @@ const ne = class ne extends Yt {
|
|
|
2508
2508
|
applyAuthResult: (f) => this.applyAuthResult(f),
|
|
2509
2509
|
loadWalletAfterAuth: () => this.walletLifecycleService.loadWalletAfterAuth(),
|
|
2510
2510
|
getLocale: () => this._config.locale,
|
|
2511
|
-
maskEmail:
|
|
2512
|
-
}), this.chainRegistry = _, this.jsonRpc = new
|
|
2511
|
+
maskEmail: Te
|
|
2512
|
+
}), this.chainRegistry = _, this.jsonRpc = new Jt(_, o), this.signInUseCase = new De(
|
|
2513
2513
|
this.internalConfig,
|
|
2514
2514
|
t,
|
|
2515
2515
|
s,
|
|
@@ -2519,7 +2519,7 @@ const ne = class ne extends Yt {
|
|
|
2519
2519
|
l,
|
|
2520
2520
|
void 0,
|
|
2521
2521
|
() => this._config.locale
|
|
2522
|
-
), this.signOutUseCase = new
|
|
2522
|
+
), this.signOutUseCase = new Yt(this.internalConfig, t, l), this.migrateWalletUseCase = new Xt(t, a), (x = a.setOnUnauthorized) == null || x.call(a, () => this.forceLogout()), (g = a.setTokenRefresher) == null || g.call(
|
|
2523
2523
|
a,
|
|
2524
2524
|
() => this.signInUseCase.refreshAccessToken()
|
|
2525
2525
|
), e.autoDetectTheme && this._setupAutoDetectTheme();
|
|
@@ -2561,12 +2561,12 @@ const ne = class ne extends Yt {
|
|
|
2561
2561
|
}
|
|
2562
2562
|
async _doInitialize(e) {
|
|
2563
2563
|
var r, t;
|
|
2564
|
-
c.log("[CROSSx SDK] v2.3.10-beta.
|
|
2564
|
+
c.log("[CROSSx SDK] v2.3.10-beta.6 초기화 중..."), this.confirmation.setMessages(J(this._config.locale));
|
|
2565
2565
|
try {
|
|
2566
|
-
const s =
|
|
2566
|
+
const s = He();
|
|
2567
2567
|
this.internalConfig.oauthServiceUrl = s.oauthServiceUrl, 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`);
|
|
2568
2568
|
const o = this._config.persistWalletPreference !== !1 ? await this.storage.get(
|
|
2569
|
-
|
|
2569
|
+
oe.WALLET_PREF_KEY
|
|
2570
2570
|
).catch(() => null) : null, n = (e == null ? void 0 : e.preferredWalletIndex) ?? (o == null ? void 0 : o.index);
|
|
2571
2571
|
let a = (e == null ? void 0 : e.preferredWalletAddress) ?? (o == null ? void 0 : o.address), l = await this.tryRNBridgeBootstrap();
|
|
2572
2572
|
if (this._rnBridgeWalletAddress && ((a == null ? void 0 : a.toLowerCase()) !== this._rnBridgeWalletAddress.toLowerCase() && c.log("[CROSSx] RN Bridge active wallet으로 preferredWalletAddress 갱신:", this._rnBridgeWalletAddress), a = this._rnBridgeWalletAddress), l || (l = await this.signInUseCase.restoreSession()), l != null && l.success) {
|
|
@@ -2597,7 +2597,7 @@ const ne = class ne extends Yt {
|
|
|
2597
2597
|
throw u;
|
|
2598
2598
|
}
|
|
2599
2599
|
}
|
|
2600
|
-
return this.initialized = !0, c.info("[CROSSx SDK] v2.3.10-beta.
|
|
2600
|
+
return this.initialized = !0, c.info("[CROSSx SDK] v2.3.10-beta.6 초기화 완료"), this.emit("initialized", { restored: !!(l != null && l.success) }), l ?? null;
|
|
2601
2601
|
} catch (s) {
|
|
2602
2602
|
throw new h(d.AUTH_NOT_INITIALIZED, "SDK 초기화에 실패했습니다", s);
|
|
2603
2603
|
}
|
|
@@ -2612,20 +2612,20 @@ const ne = class ne extends Yt {
|
|
|
2612
2612
|
* → 사용자가 signIn() 을 호출할 때 bridge 로그인을 시도한다.
|
|
2613
2613
|
*/
|
|
2614
2614
|
async tryRNBridgeBootstrap() {
|
|
2615
|
-
if (!
|
|
2615
|
+
if (!Y.isAvailable()) return null;
|
|
2616
2616
|
try {
|
|
2617
2617
|
c.log("[CROSSx] RN Bridge 감지 — Handshake 시도"), c.info("[CROSSx][RNBridge trace] Bootstrap config", {
|
|
2618
2618
|
appId: this._config.projectId,
|
|
2619
2619
|
appVersion: "1.0.0",
|
|
2620
|
-
sdkVersion: "2.3.10-beta.
|
|
2620
|
+
sdkVersion: "2.3.10-beta.6",
|
|
2621
2621
|
keyId: "key-id-1",
|
|
2622
2622
|
userIdHash: "user-hash-placeholder",
|
|
2623
2623
|
projectId: this._config.projectId
|
|
2624
2624
|
});
|
|
2625
|
-
const e = new
|
|
2625
|
+
const e = new Y({
|
|
2626
2626
|
appId: this._config.projectId,
|
|
2627
2627
|
appVersion: "1.0.0",
|
|
2628
|
-
sdkVersion: "2.3.10-beta.
|
|
2628
|
+
sdkVersion: "2.3.10-beta.6",
|
|
2629
2629
|
keyId: "key-id-1",
|
|
2630
2630
|
userIdHash: "user-hash-placeholder",
|
|
2631
2631
|
projectId: this._config.projectId
|
|
@@ -2724,7 +2724,7 @@ const ne = class ne extends Yt {
|
|
|
2724
2724
|
* @internal
|
|
2725
2725
|
*/
|
|
2726
2726
|
getRNBridge() {
|
|
2727
|
-
return
|
|
2727
|
+
return Y.getBridge();
|
|
2728
2728
|
}
|
|
2729
2729
|
async signIn(e) {
|
|
2730
2730
|
if (this.ensureInitialized(), this.authenticated)
|
|
@@ -2744,7 +2744,7 @@ const ne = class ne extends Yt {
|
|
|
2744
2744
|
let t = e;
|
|
2745
2745
|
if (!(e != null && e.provider)) {
|
|
2746
2746
|
const s = await this.confirmation.showLoginSelector({
|
|
2747
|
-
connectOtherWallets:
|
|
2747
|
+
connectOtherWallets: Ht(this._config)
|
|
2748
2748
|
});
|
|
2749
2749
|
if (s === null)
|
|
2750
2750
|
return { success: !1, error: "User cancelled login" };
|
|
@@ -2880,7 +2880,7 @@ const ne = class ne extends Yt {
|
|
|
2880
2880
|
this.ensureInitialized();
|
|
2881
2881
|
try {
|
|
2882
2882
|
await this.signOutUseCase.execute(), this.clearAuthState();
|
|
2883
|
-
const e =
|
|
2883
|
+
const e = Y.getBridge();
|
|
2884
2884
|
if (e != null && e.signOut)
|
|
2885
2885
|
try {
|
|
2886
2886
|
await e.signOut(), c.log("[CROSSx] RN Bridge signOut 통보 완료 — native trust cache 무효화");
|
|
@@ -3220,7 +3220,7 @@ const ne = class ne extends Yt {
|
|
|
3220
3220
|
* sdk.applyLocale('ko');
|
|
3221
3221
|
*/
|
|
3222
3222
|
applyLocale(e = this._config.locale ?? "en") {
|
|
3223
|
-
this._config = Object.freeze({ ...this._config, locale: e }), this.confirmation.setMessages(
|
|
3223
|
+
this._config = Object.freeze({ ...this._config, locale: e }), this.confirmation.setMessages(J(e));
|
|
3224
3224
|
}
|
|
3225
3225
|
/**
|
|
3226
3226
|
* PIN 입력 모달의 키보드 방식을 런타임에 변경합니다.
|
|
@@ -3263,7 +3263,7 @@ const ne = class ne extends Yt {
|
|
|
3263
3263
|
return this.withSessionRecovery(() => this._signMessage(e, r, t));
|
|
3264
3264
|
}
|
|
3265
3265
|
async _signMessage(e, r, t) {
|
|
3266
|
-
const s =
|
|
3266
|
+
const s = Y.getBridge();
|
|
3267
3267
|
if (s != null && s.signMessage) {
|
|
3268
3268
|
const n = await s.signMessage({
|
|
3269
3269
|
chainId: e,
|
|
@@ -3342,7 +3342,7 @@ const ne = class ne extends Yt {
|
|
|
3342
3342
|
throw new h(d.AUTH_NOT_AUTHENTICATED, "사용자 ID를 찾을 수 없습니다");
|
|
3343
3343
|
if (!this.walletProvider.signTypedData)
|
|
3344
3344
|
throw new h(d.NOT_IMPLEMENTED, "signTypedData가 구현되어 있지 않습니다");
|
|
3345
|
-
|
|
3345
|
+
ir(e, r);
|
|
3346
3346
|
const s = await this.resolveAddress(t == null ? void 0 : t.index);
|
|
3347
3347
|
try {
|
|
3348
3348
|
const o = await this.signingOrchestrator.confirmAndExecuteWithPreparedPin({
|
|
@@ -3366,7 +3366,7 @@ const ne = class ne extends Yt {
|
|
|
3366
3366
|
s.address
|
|
3367
3367
|
)
|
|
3368
3368
|
});
|
|
3369
|
-
return
|
|
3369
|
+
return rr(o.signature), {
|
|
3370
3370
|
chainId: e,
|
|
3371
3371
|
signature: o.signature,
|
|
3372
3372
|
address: s.address
|
|
@@ -3395,7 +3395,7 @@ const ne = class ne extends Yt {
|
|
|
3395
3395
|
* });
|
|
3396
3396
|
*/
|
|
3397
3397
|
async signTypedDataOffchain(e, r) {
|
|
3398
|
-
return this.signTypedData(
|
|
3398
|
+
return this.signTypedData(oe.OFFCHAIN_CHAIN_ID, e, r);
|
|
3399
3399
|
}
|
|
3400
3400
|
// ============================================================================
|
|
3401
3401
|
// 트랜잭션
|
|
@@ -3414,7 +3414,7 @@ const ne = class ne extends Yt {
|
|
|
3414
3414
|
throw new h(d.AUTH_NOT_AUTHENTICATED, "사용자 ID를 찾을 수 없습니다");
|
|
3415
3415
|
const s = await this.transactionLifecycleService.withResolvedGasAndFee(r, e);
|
|
3416
3416
|
s.from || (s.from = (await this.resolveAddress(t == null ? void 0 : t.index)).address);
|
|
3417
|
-
const o =
|
|
3417
|
+
const o = ke(e);
|
|
3418
3418
|
try {
|
|
3419
3419
|
const n = await this.signingOrchestrator.confirmAndExecuteWithPreparedPin({
|
|
3420
3420
|
confirmation: {
|
|
@@ -3444,7 +3444,7 @@ const ne = class ne extends Yt {
|
|
|
3444
3444
|
a
|
|
3445
3445
|
)
|
|
3446
3446
|
});
|
|
3447
|
-
return
|
|
3447
|
+
return sr(n.signature), {
|
|
3448
3448
|
chainId: e,
|
|
3449
3449
|
signedTx: n.signature,
|
|
3450
3450
|
txHash: n.txHash ?? ""
|
|
@@ -3473,7 +3473,7 @@ const ne = class ne extends Yt {
|
|
|
3473
3473
|
throw new h(d.AUTH_NOT_AUTHENTICATED, "사용자 ID를 찾을 수 없습니다");
|
|
3474
3474
|
const s = await this.transactionLifecycleService.withResolvedGasAndFee(r, e);
|
|
3475
3475
|
s.from || (s.from = (await this.resolveAddress(t == null ? void 0 : t.index)).address);
|
|
3476
|
-
const o =
|
|
3476
|
+
const o = ke(e);
|
|
3477
3477
|
try {
|
|
3478
3478
|
const n = await this.signingOrchestrator.confirmAndExecuteWithPreparedPin({
|
|
3479
3479
|
confirmation: {
|
|
@@ -3513,7 +3513,7 @@ const ne = class ne extends Yt {
|
|
|
3513
3513
|
return u.txHash ?? u.signature;
|
|
3514
3514
|
}
|
|
3515
3515
|
}), a = (r.data ?? "").toLowerCase().replace(/^0x/, ""), l = a === "" || a === "00000000", p = a.startsWith("a9059cbb");
|
|
3516
|
-
return (l || p) && this.tokenHistoryService.registerHistoryFireAndForget(e, n,
|
|
3516
|
+
return (l || p) && this.tokenHistoryService.registerHistoryFireAndForget(e, n, Ft).catch(
|
|
3517
3517
|
(_) => c.log("[TokenHistory] register failed (non-critical):", _)
|
|
3518
3518
|
), { chainId: e, txHash: n, status: "pending" };
|
|
3519
3519
|
} catch (n) {
|
|
@@ -3545,7 +3545,7 @@ const ne = class ne extends Yt {
|
|
|
3545
3545
|
* @param opts.timeoutMs 최대 대기 시간 (기본 60000ms)
|
|
3546
3546
|
*/
|
|
3547
3547
|
async waitForTxAndGetReceipt(e, r, t = {}) {
|
|
3548
|
-
const s = t.intervalMs ??
|
|
3548
|
+
const s = t.intervalMs ?? Ot, o = Lt, n = t.timeoutMs ?? Xe, a = Date.now() + n;
|
|
3549
3549
|
let l = s;
|
|
3550
3550
|
for (; Date.now() < a; ) {
|
|
3551
3551
|
const p = await this.getTransactionReceipt(e, r);
|
|
@@ -3575,23 +3575,23 @@ const ne = class ne extends Yt {
|
|
|
3575
3575
|
async sendTransactionWithWaitForReceipt(e, r, t = {}) {
|
|
3576
3576
|
var m, y;
|
|
3577
3577
|
if (this._isAuthenticatedViaRNBridge) {
|
|
3578
|
-
const S =
|
|
3578
|
+
const S = Y.getBridge();
|
|
3579
3579
|
if (S != null && S.sendTransactionWithWaitForReceipt)
|
|
3580
3580
|
return this.bridgeSendTransactionWithWaitForReceipt(S, e, r, t);
|
|
3581
3581
|
}
|
|
3582
|
-
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) ??
|
|
3582
|
+
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) ?? Nt, p = o ?? ((y = this._config.receiptPolling) == null ? void 0 : y.timeoutMs) ?? Xe, _ = ke(e), u = r.from ?? "";
|
|
3583
3583
|
let x, g;
|
|
3584
3584
|
const f = this.waitForTxAndGetReceipt(a, e, { intervalMs: l, timeoutMs: p }).then((S) => {
|
|
3585
3585
|
x = S;
|
|
3586
|
-
const
|
|
3586
|
+
const A = BigInt(S.gasUsed) * BigInt(S.effectiveGasPrice), E = r.value ? BigInt(r.value) : 0n, k = ye(r.value, _.symbol, _.decimals, this._config.displayDecimals), T = ye("0x" + A.toString(16), _.symbol, _.decimals, this._config.displayDecimals), C = ye("0x" + (E + A).toString(16), _.symbol, _.decimals, this._config.displayDecimals);
|
|
3587
3587
|
return {
|
|
3588
3588
|
chainId: e,
|
|
3589
3589
|
txHash: a,
|
|
3590
3590
|
from: S.from,
|
|
3591
3591
|
to: S.to ?? r.to,
|
|
3592
|
-
amount:
|
|
3593
|
-
fees:
|
|
3594
|
-
total:
|
|
3592
|
+
amount: k,
|
|
3593
|
+
fees: T,
|
|
3594
|
+
total: C,
|
|
3595
3595
|
nativeSymbol: _.symbol,
|
|
3596
3596
|
status: S.status === "0x1" ? "success" : "reverted"
|
|
3597
3597
|
};
|
|
@@ -3600,7 +3600,7 @@ const ne = class ne extends Yt {
|
|
|
3600
3600
|
txHash: a,
|
|
3601
3601
|
from: u,
|
|
3602
3602
|
to: r.to,
|
|
3603
|
-
amount:
|
|
3603
|
+
amount: ye(r.value, _.symbol, _.decimals, this._config.displayDecimals),
|
|
3604
3604
|
nativeSymbol: _.symbol,
|
|
3605
3605
|
status: "timeout"
|
|
3606
3606
|
}));
|
|
@@ -3834,7 +3834,7 @@ const ne = class ne extends Yt {
|
|
|
3834
3834
|
return { wei: "0x0", formatted: "0", chainId: e };
|
|
3835
3835
|
try {
|
|
3836
3836
|
const s = await this.jsonRpc.call("eth_getBalance", [r, "latest"], e) ?? "0x0";
|
|
3837
|
-
return { wei: s, formatted:
|
|
3837
|
+
return { wei: s, formatted: tr(s, this._config.displayDecimals), chainId: e };
|
|
3838
3838
|
} catch (t) {
|
|
3839
3839
|
if (t instanceof h) throw t;
|
|
3840
3840
|
const s = t instanceof Error ? t.message : String(t);
|
|
@@ -3862,7 +3862,7 @@ const ne = class ne extends Yt {
|
|
|
3862
3862
|
getProvider(e) {
|
|
3863
3863
|
this.ensureAuthenticated();
|
|
3864
3864
|
let r = this._providers.get(e);
|
|
3865
|
-
return r || (r = new
|
|
3865
|
+
return r || (r = new Vt(this, e), this._providers.set(e, r)), r;
|
|
3866
3866
|
}
|
|
3867
3867
|
/**
|
|
3868
3868
|
* EIP-1193 `accountsChanged` 이벤트를 모든 활성 provider 인스턴스에 dispatch 한다.
|
|
@@ -3922,7 +3922,7 @@ const ne = class ne extends Yt {
|
|
|
3922
3922
|
* 보안: bridge.isActivated() 가 false 이거나 payload sanitize 실패 시 이벤트 무시.
|
|
3923
3923
|
*/
|
|
3924
3924
|
subscribeBridgeWalletChanged() {
|
|
3925
|
-
const e =
|
|
3925
|
+
const e = Y.getBridge();
|
|
3926
3926
|
if (!(e != null && e.onEvent)) {
|
|
3927
3927
|
c.warn("[CROSSx] bridge.onEvent 미지원 — walletChanged 구독 불가");
|
|
3928
3928
|
return;
|
|
@@ -4083,7 +4083,7 @@ const ne = class ne extends Yt {
|
|
|
4083
4083
|
*/
|
|
4084
4084
|
dispose() {
|
|
4085
4085
|
var e;
|
|
4086
|
-
(e = this._themeMediaCleanup) == null || e.call(this), this._themeMediaCleanup = null, this.clearAuthState(), this.tokenStore.clear(), this.pinStore.clear(), this.initialized = !1, this.removeAllListeners(),
|
|
4086
|
+
(e = this._themeMediaCleanup) == null || e.call(this), this._themeMediaCleanup = null, this.clearAuthState(), this.tokenStore.clear(), this.pinStore.clear(), this.initialized = !1, this.removeAllListeners(), tt(null);
|
|
4087
4087
|
}
|
|
4088
4088
|
/**
|
|
4089
4089
|
* @internal internal 패키지 전용 — 공개 문서에 기재하지 않음
|
|
@@ -4103,9 +4103,9 @@ const ne = class ne extends Yt {
|
|
|
4103
4103
|
};
|
|
4104
4104
|
}
|
|
4105
4105
|
};
|
|
4106
|
-
|
|
4107
|
-
let
|
|
4108
|
-
class
|
|
4106
|
+
oe.WALLET_PREF_KEY = "wallet_preference", oe.OFFCHAIN_CHAIN_ID = "0";
|
|
4107
|
+
let Me = oe;
|
|
4108
|
+
class mr {
|
|
4109
4109
|
constructor() {
|
|
4110
4110
|
this.prefix = "crossx_";
|
|
4111
4111
|
}
|
|
@@ -4142,8 +4142,8 @@ class gr {
|
|
|
4142
4142
|
}
|
|
4143
4143
|
}
|
|
4144
4144
|
}
|
|
4145
|
-
const
|
|
4146
|
-
class
|
|
4145
|
+
const Re = "crossx-sdk", yr = 1, j = "data", te = "keys", be = "aes-primary", br = 12;
|
|
4146
|
+
class nt {
|
|
4147
4147
|
constructor(e) {
|
|
4148
4148
|
this.db = null, this.cryptoKey = null, this.initPromise = null, this.dbName = `crossx-sdk-${e}`;
|
|
4149
4149
|
}
|
|
@@ -4152,10 +4152,10 @@ class it {
|
|
|
4152
4152
|
}
|
|
4153
4153
|
openDB(e = this.dbName) {
|
|
4154
4154
|
return new Promise((r, t) => {
|
|
4155
|
-
const s = indexedDB.open(e,
|
|
4155
|
+
const s = indexedDB.open(e, yr);
|
|
4156
4156
|
s.onupgradeneeded = () => {
|
|
4157
4157
|
const o = s.result;
|
|
4158
|
-
o.objectStoreNames.contains(
|
|
4158
|
+
o.objectStoreNames.contains(j) || o.createObjectStore(j), o.objectStoreNames.contains(te) || o.createObjectStore(te);
|
|
4159
4159
|
}, s.onsuccess = () => r(s.result), s.onerror = () => t(s.error);
|
|
4160
4160
|
});
|
|
4161
4161
|
}
|
|
@@ -4185,7 +4185,7 @@ class it {
|
|
|
4185
4185
|
}
|
|
4186
4186
|
async init() {
|
|
4187
4187
|
this.db = await this.openDB();
|
|
4188
|
-
const e = await this.idbGet(
|
|
4188
|
+
const e = await this.idbGet(te, be);
|
|
4189
4189
|
if (e) {
|
|
4190
4190
|
this.cryptoKey = e;
|
|
4191
4191
|
return;
|
|
@@ -4199,21 +4199,21 @@ class it {
|
|
|
4199
4199
|
{ name: "AES-GCM", length: 256 },
|
|
4200
4200
|
!1,
|
|
4201
4201
|
["encrypt", "decrypt"]
|
|
4202
|
-
), await this.idbPut(
|
|
4202
|
+
), await this.idbPut(te, be, this.cryptoKey);
|
|
4203
4203
|
}
|
|
4204
4204
|
/**
|
|
4205
4205
|
* 레거시 DB('crossx-sdk')에서 projectId 스코프 DB로 암호키·데이터 마이그레이션.
|
|
4206
4206
|
* 마이그레이션 성공 시 레거시 DB 삭제.
|
|
4207
4207
|
*/
|
|
4208
4208
|
async migrateFromLegacyDB() {
|
|
4209
|
-
if (this.dbName ===
|
|
4209
|
+
if (this.dbName === Re) return null;
|
|
4210
4210
|
try {
|
|
4211
|
-
const e = await this.openDB(
|
|
4211
|
+
const e = await this.openDB(Re), r = e.transaction([te, j], "readonly"), t = r.objectStore(te).get(be), s = await new Promise((p, _) => {
|
|
4212
4212
|
t.onsuccess = () => p(t.result), t.onerror = () => _(t.error);
|
|
4213
4213
|
});
|
|
4214
4214
|
if (!s)
|
|
4215
4215
|
return e.close(), null;
|
|
4216
|
-
const o = r.objectStore(
|
|
4216
|
+
const o = r.objectStore(j).getAll(), n = r.objectStore(j).getAllKeys(), [a, l] = await Promise.all([
|
|
4217
4217
|
new Promise((p, _) => {
|
|
4218
4218
|
o.onsuccess = () => p(o.result), o.onerror = () => _(o.error);
|
|
4219
4219
|
}),
|
|
@@ -4221,16 +4221,16 @@ class it {
|
|
|
4221
4221
|
n.onsuccess = () => p(n.result), n.onerror = () => _(n.error);
|
|
4222
4222
|
})
|
|
4223
4223
|
]);
|
|
4224
|
-
e.close(), await this.idbPut(
|
|
4224
|
+
e.close(), await this.idbPut(te, be, s);
|
|
4225
4225
|
for (let p = 0; p < l.length; p++)
|
|
4226
|
-
await this.idbPut(
|
|
4227
|
-
return indexedDB.deleteDatabase(
|
|
4226
|
+
await this.idbPut(j, String(l[p]), a[p]);
|
|
4227
|
+
return indexedDB.deleteDatabase(Re), c.log("[CROSSx] IndexedDB 레거시 DB 마이그레이션 완료"), s;
|
|
4228
4228
|
} catch (e) {
|
|
4229
4229
|
return c.warn("[CROSSx] IndexedDB 레거시 DB 마이그레이션 실패:", e), null;
|
|
4230
4230
|
}
|
|
4231
4231
|
}
|
|
4232
4232
|
async encrypt(e) {
|
|
4233
|
-
const r = new Uint8Array(
|
|
4233
|
+
const r = new Uint8Array(br);
|
|
4234
4234
|
crypto.getRandomValues(r);
|
|
4235
4235
|
const t = new TextEncoder().encode(e), s = await crypto.subtle.encrypt(
|
|
4236
4236
|
{ name: "AES-GCM", iv: r },
|
|
@@ -4251,7 +4251,7 @@ class it {
|
|
|
4251
4251
|
try {
|
|
4252
4252
|
await this.ensureReady();
|
|
4253
4253
|
const t = JSON.stringify(r), s = await this.encrypt(t);
|
|
4254
|
-
await this.idbPut(
|
|
4254
|
+
await this.idbPut(j, e, s);
|
|
4255
4255
|
} catch (t) {
|
|
4256
4256
|
throw c.error("[CROSSx] IndexedDB set error:", t), t;
|
|
4257
4257
|
}
|
|
@@ -4259,7 +4259,7 @@ class it {
|
|
|
4259
4259
|
async get(e) {
|
|
4260
4260
|
try {
|
|
4261
4261
|
await this.ensureReady();
|
|
4262
|
-
const r = await this.idbGet(
|
|
4262
|
+
const r = await this.idbGet(j, e);
|
|
4263
4263
|
if (!r) return null;
|
|
4264
4264
|
const t = await this.decrypt(r);
|
|
4265
4265
|
return JSON.parse(t);
|
|
@@ -4269,14 +4269,14 @@ class it {
|
|
|
4269
4269
|
}
|
|
4270
4270
|
async remove(e) {
|
|
4271
4271
|
try {
|
|
4272
|
-
await this.ensureReady(), await this.idbDelete(
|
|
4272
|
+
await this.ensureReady(), await this.idbDelete(j, e);
|
|
4273
4273
|
} catch (r) {
|
|
4274
4274
|
throw c.error("[CROSSx] IndexedDB remove error:", r), r;
|
|
4275
4275
|
}
|
|
4276
4276
|
}
|
|
4277
4277
|
async clear() {
|
|
4278
4278
|
try {
|
|
4279
|
-
await this.ensureReady(), await this.idbClear(
|
|
4279
|
+
await this.ensureReady(), await this.idbClear(j);
|
|
4280
4280
|
} catch (e) {
|
|
4281
4281
|
throw c.error("[CROSSx] IndexedDB clear error:", e), e;
|
|
4282
4282
|
}
|
|
@@ -4288,14 +4288,14 @@ class it {
|
|
|
4288
4288
|
return typeof indexedDB < "u" && typeof crypto < "u" && typeof crypto.subtle < "u";
|
|
4289
4289
|
}
|
|
4290
4290
|
}
|
|
4291
|
-
const
|
|
4292
|
-
class
|
|
4291
|
+
const vr = 60;
|
|
4292
|
+
class Sr {
|
|
4293
4293
|
constructor() {
|
|
4294
4294
|
this.jwks = null;
|
|
4295
4295
|
}
|
|
4296
4296
|
setJWKSEndpoint(e) {
|
|
4297
4297
|
try {
|
|
4298
|
-
this.jwks =
|
|
4298
|
+
this.jwks = kt(new URL(e)), c.log("[CROSSx] JWKS 엔드포인트 설정:", e);
|
|
4299
4299
|
} catch (r) {
|
|
4300
4300
|
c.warn("[CROSSx] JWKS 엔드포인트 URL 파싱 실패:", r);
|
|
4301
4301
|
}
|
|
@@ -4309,7 +4309,7 @@ class yr {
|
|
|
4309
4309
|
iat: t.iat
|
|
4310
4310
|
});
|
|
4311
4311
|
const s = Math.floor(Date.now() / 1e3);
|
|
4312
|
-
if (t.exp && t.exp +
|
|
4312
|
+
if (t.exp && t.exp + vr < s)
|
|
4313
4313
|
return c.warn("[CROSSx] 토큰 만료:", {
|
|
4314
4314
|
exp: t.exp,
|
|
4315
4315
|
now: s,
|
|
@@ -4319,7 +4319,7 @@ class yr {
|
|
|
4319
4319
|
return c.warn("[CROSSx] JWT에 sub(사용자ID) 없음"), { payload: t, valid: !1, signatureVerified: !1 };
|
|
4320
4320
|
if (this.jwks)
|
|
4321
4321
|
try {
|
|
4322
|
-
const { payload: o } = await
|
|
4322
|
+
const { payload: o } = await Tt(e, this.jwks, {
|
|
4323
4323
|
algorithms: ["RS256", "ES256"]
|
|
4324
4324
|
});
|
|
4325
4325
|
return c.log("[CROSSx] JWT 서명 검증 성공"), {
|
|
@@ -4338,7 +4338,7 @@ class yr {
|
|
|
4338
4338
|
}
|
|
4339
4339
|
}
|
|
4340
4340
|
decodeJWT(e) {
|
|
4341
|
-
return
|
|
4341
|
+
return Rt(e);
|
|
4342
4342
|
}
|
|
4343
4343
|
/**
|
|
4344
4344
|
* EIP-191 personal_sign 서명에서 서명자 Ethereum 주소를 복원합니다.
|
|
@@ -4353,29 +4353,29 @@ class yr {
|
|
|
4353
4353
|
${t.length}`
|
|
4354
4354
|
), o = new Uint8Array(s.length + t.length);
|
|
4355
4355
|
o.set(s, 0), o.set(t, s.length);
|
|
4356
|
-
const n =
|
|
4356
|
+
const n = Ye(o), a = r.startsWith("0x") ? r.slice(2) : r;
|
|
4357
4357
|
if (a.length !== 130)
|
|
4358
4358
|
throw new Error(`서명 길이가 유효하지 않습니다: 130 hex 문자 예상, 현재 ${a.length}`);
|
|
4359
|
-
const l =
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
).addRecoveryBit(x).recoverPublicKey(n).toBytes(!1).slice(1), y =
|
|
4363
|
-
return "0x" +
|
|
4359
|
+
const l = Er(a), p = l.slice(0, 32), _ = l.slice(32, 64), u = l[64], x = u >= 27 ? u - 27 : u, m = new Ct.Signature(
|
|
4360
|
+
at(p),
|
|
4361
|
+
at(_)
|
|
4362
|
+
).addRecoveryBit(x).recoverPublicKey(n).toBytes(!1).slice(1), y = Ye(m);
|
|
4363
|
+
return "0x" + Pt(y.slice(12));
|
|
4364
4364
|
}
|
|
4365
4365
|
}
|
|
4366
|
-
function
|
|
4366
|
+
function Er(i) {
|
|
4367
4367
|
const e = new Uint8Array(i.length / 2);
|
|
4368
4368
|
for (let r = 0; r < e.length; r++)
|
|
4369
4369
|
e[r] = parseInt(i.substring(r * 2, r * 2 + 2), 16);
|
|
4370
4370
|
return e;
|
|
4371
4371
|
}
|
|
4372
|
-
function
|
|
4372
|
+
function at(i) {
|
|
4373
4373
|
let e = "0x";
|
|
4374
4374
|
for (const r of i) e += r.toString(16).padStart(2, "0");
|
|
4375
4375
|
return BigInt(e);
|
|
4376
4376
|
}
|
|
4377
|
-
const
|
|
4378
|
-
class
|
|
4377
|
+
const Ar = 3e4, Ir = 1e3;
|
|
4378
|
+
class kr {
|
|
4379
4379
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4380
4380
|
async request(e) {
|
|
4381
4381
|
const r = e.retries ?? 0;
|
|
@@ -4386,7 +4386,7 @@ class Er {
|
|
|
4386
4386
|
} catch (s) {
|
|
4387
4387
|
if (t === r) throw s;
|
|
4388
4388
|
}
|
|
4389
|
-
await new Promise((s) => setTimeout(s,
|
|
4389
|
+
await new Promise((s) => setTimeout(s, Ir * 2 ** t));
|
|
4390
4390
|
}
|
|
4391
4391
|
throw new Error("Unexpected: retry loop exited without result");
|
|
4392
4392
|
}
|
|
@@ -4394,7 +4394,7 @@ class Er {
|
|
|
4394
4394
|
async _doRequest(e) {
|
|
4395
4395
|
const r = new AbortController(), t = setTimeout(
|
|
4396
4396
|
() => r.abort(),
|
|
4397
|
-
e.timeoutMs ??
|
|
4397
|
+
e.timeoutMs ?? Ar
|
|
4398
4398
|
);
|
|
4399
4399
|
try {
|
|
4400
4400
|
const s = await fetch(e.url, {
|
|
@@ -4421,15 +4421,75 @@ class Er {
|
|
|
4421
4421
|
}
|
|
4422
4422
|
}
|
|
4423
4423
|
}
|
|
4424
|
-
const
|
|
4424
|
+
const Tr = [
|
|
4425
|
+
/CROSSx\/([\d.]+)/i,
|
|
4426
|
+
/ONE\s?wallet[^\s/]*\/([\d.]+)/i
|
|
4427
|
+
];
|
|
4428
|
+
function Ge() {
|
|
4429
|
+
return typeof window > "u" ? void 0 : window;
|
|
4430
|
+
}
|
|
4431
|
+
function Rr() {
|
|
4432
|
+
const i = Ge();
|
|
4433
|
+
return i == null ? void 0 : i.__crossx;
|
|
4434
|
+
}
|
|
4435
|
+
function Cr(i) {
|
|
4436
|
+
return i === "ios" || i === "android" ? i : null;
|
|
4437
|
+
}
|
|
4438
|
+
function Pr() {
|
|
4439
|
+
const i = Ge();
|
|
4440
|
+
if (!i) return !1;
|
|
4441
|
+
const e = i.__crossxRNBridge;
|
|
4442
|
+
return e != null && e.isInstalled ? !0 : i.__CROSSX_BRIDGE_INITIALIZED__ === !0 || i.__CROSSX_RN_BRIDGE_READY__ === !0;
|
|
4443
|
+
}
|
|
4444
|
+
function ct() {
|
|
4445
|
+
const i = typeof navigator > "u" ? "" : navigator.userAgent;
|
|
4446
|
+
for (const e of Tr) {
|
|
4447
|
+
const r = e.exec(i);
|
|
4448
|
+
if (r) return r[1] ?? null;
|
|
4449
|
+
}
|
|
4450
|
+
}
|
|
4451
|
+
function ve() {
|
|
4452
|
+
const i = Rr();
|
|
4453
|
+
if (i != null && i.browser)
|
|
4454
|
+
return {
|
|
4455
|
+
version: i.version ?? null,
|
|
4456
|
+
platform: Cr(i.platform),
|
|
4457
|
+
detectedBy: "marker"
|
|
4458
|
+
};
|
|
4459
|
+
if (Pr())
|
|
4460
|
+
return {
|
|
4461
|
+
version: ct() ?? null,
|
|
4462
|
+
platform: null,
|
|
4463
|
+
detectedBy: "bridge"
|
|
4464
|
+
};
|
|
4465
|
+
const e = ct();
|
|
4466
|
+
return e !== void 0 ? { version: e, platform: null, detectedBy: "user-agent" } : null;
|
|
4467
|
+
}
|
|
4468
|
+
function Ys() {
|
|
4469
|
+
return ve() !== null;
|
|
4470
|
+
}
|
|
4471
|
+
function Xs(i = 3e3) {
|
|
4472
|
+
const e = ve();
|
|
4473
|
+
return e ? Promise.resolve(e) : Ge() ? new Promise((r) => {
|
|
4474
|
+
const t = Date.now(), s = setInterval(() => {
|
|
4475
|
+
const o = ve();
|
|
4476
|
+
if (o) {
|
|
4477
|
+
clearInterval(s), r(o);
|
|
4478
|
+
return;
|
|
4479
|
+
}
|
|
4480
|
+
Date.now() - t >= i && (clearInterval(s), r(null));
|
|
4481
|
+
}, 50);
|
|
4482
|
+
}) : Promise.resolve(null);
|
|
4483
|
+
}
|
|
4484
|
+
const Nr = /* @__PURE__ */ new Set([
|
|
4425
4485
|
"https://cross-wallet-oauth.crosstoken.io",
|
|
4426
4486
|
"https://stg-cross-wallet-oauth.crosstoken.io",
|
|
4427
4487
|
"https://dev-cross-wallet-oauth.crosstoken.io",
|
|
4428
4488
|
"https://one-wallet-oauth.onechain.nexus",
|
|
4429
4489
|
"https://stg-one-wallet-oauth.onechain.nexus",
|
|
4430
4490
|
"https://dev-one-wallet-oauth.onechain.nexus"
|
|
4431
|
-
]),
|
|
4432
|
-
class
|
|
4491
|
+
]), Or = "crossx://oauth-callback";
|
|
4492
|
+
class se {
|
|
4433
4493
|
constructor() {
|
|
4434
4494
|
this.abortPending = null;
|
|
4435
4495
|
}
|
|
@@ -4464,7 +4524,7 @@ class ie {
|
|
|
4464
4524
|
* - Google 및 기타: originalNonce === jwt.nonce
|
|
4465
4525
|
*/
|
|
4466
4526
|
static async verifyIdTokenNonce(e, r) {
|
|
4467
|
-
const t =
|
|
4527
|
+
const t = se.parseJwtPayload(e), s = t.nonce, o = typeof t.iss == "string" ? t.iss : "(unknown)";
|
|
4468
4528
|
if (c.log("[CROSSx] nonce 검증 시작 —", {
|
|
4469
4529
|
iss: o,
|
|
4470
4530
|
nonceClaimType: typeof s,
|
|
@@ -4486,7 +4546,7 @@ class ie {
|
|
|
4486
4546
|
return;
|
|
4487
4547
|
}
|
|
4488
4548
|
if (o.includes("appleid.apple.com")) {
|
|
4489
|
-
const n = await
|
|
4549
|
+
const n = await se.sha256Hex(r);
|
|
4490
4550
|
if (c.log("[CROSSx] Apple nonce 검증 —", {
|
|
4491
4551
|
expectedHashLength: n.length,
|
|
4492
4552
|
receivedHashLength: s.length,
|
|
@@ -4503,91 +4563,96 @@ class ie {
|
|
|
4503
4563
|
}
|
|
4504
4564
|
openAuth(e) {
|
|
4505
4565
|
return new Promise((r, t) => {
|
|
4506
|
-
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 =
|
|
4566
|
+
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 = se.generateRandom16Hex(), p = se.generateRandom16Hex(), _ = e.authUrl.includes("?") ? "&" : "?", u = encodeURIComponent(window.location.origin);
|
|
4507
4567
|
let x = `${e.authUrl}${_}state=${l}&nonce=${p}&origin=${u}`;
|
|
4508
|
-
|
|
4568
|
+
const g = ve();
|
|
4569
|
+
g && !x.includes("redirectUrl=") && (x += `&redirectUrl=${encodeURIComponent(Or)}`, c.info("[CROSSx] 지갑 인앱 브라우저 감지 — redirectUrl 콜백 자동 부착", {
|
|
4570
|
+
detectedBy: g.detectedBy,
|
|
4571
|
+
appVersion: g.version ?? "(unknown)",
|
|
4572
|
+
platform: g.platform ?? "(unknown)"
|
|
4573
|
+
})), c.log("[CROSSx] OAuth 팝업 열기 — state, nonce 생성 완료:", {
|
|
4509
4574
|
stateLength: l.length,
|
|
4510
4575
|
nonceLength: p.length,
|
|
4511
4576
|
authUrlBase: e.authUrl
|
|
4512
4577
|
});
|
|
4513
|
-
const
|
|
4578
|
+
const f = window.open(
|
|
4514
4579
|
x,
|
|
4515
4580
|
"CROSSx OAuth",
|
|
4516
4581
|
`width=${s},height=${o},left=${n},top=${a}`
|
|
4517
4582
|
);
|
|
4518
|
-
if (!
|
|
4583
|
+
if (!f) {
|
|
4519
4584
|
t(new Error("팝업 창을 열 수 없습니다. 팝업 차단을 해제해 주세요."));
|
|
4520
4585
|
return;
|
|
4521
4586
|
}
|
|
4522
|
-
const
|
|
4523
|
-
c.warn("[CROSSx] OAuth 타임아웃 (5분) — postMessage를 수신하지 못했습니다"),
|
|
4524
|
-
}, 5 * 60 * 1e3),
|
|
4525
|
-
let
|
|
4526
|
-
const
|
|
4527
|
-
clearInterval(T), c.warn("[CROSSx] COOP 감지 — OAuth 서버 응답을 " +
|
|
4528
|
-
|
|
4587
|
+
const m = setTimeout(() => {
|
|
4588
|
+
c.warn("[CROSSx] OAuth 타임아웃 (5분) — postMessage를 수신하지 못했습니다"), C(), t(new Error("Authentication timeout"));
|
|
4589
|
+
}, 5 * 60 * 1e3), y = 10, S = 30;
|
|
4590
|
+
let A = 0, E = null;
|
|
4591
|
+
const k = () => {
|
|
4592
|
+
clearInterval(T), c.warn("[CROSSx] COOP 감지 — OAuth 서버 응답을 " + S + "초간 대기합니다"), E = setTimeout(() => {
|
|
4593
|
+
C(), t(new Error(
|
|
4529
4594
|
"OAuth 서버로부터 응답을 받지 못했습니다. 브라우저 보안 정책(COOP)으로 인해 팝업 통신이 차단되었을 수 있습니다. 다시 시도해 주세요."
|
|
4530
4595
|
));
|
|
4531
|
-
},
|
|
4596
|
+
}, S * 1e3);
|
|
4532
4597
|
}, T = setInterval(() => {
|
|
4533
|
-
|
|
4598
|
+
A++;
|
|
4534
4599
|
try {
|
|
4535
|
-
if (!
|
|
4600
|
+
if (!f.closed) return;
|
|
4536
4601
|
const M = typeof document < "u" && document.hasFocus();
|
|
4537
|
-
|
|
4602
|
+
A <= y && !M ? k() : (C(), t(new Error("로그인이 취소되었습니다")));
|
|
4538
4603
|
} catch {
|
|
4539
|
-
|
|
4604
|
+
k();
|
|
4540
4605
|
}
|
|
4541
|
-
}, 1e3),
|
|
4542
|
-
this.abortPending = null, clearTimeout(
|
|
4543
|
-
},
|
|
4544
|
-
if (!
|
|
4545
|
-
|
|
4546
|
-
const
|
|
4606
|
+
}, 1e3), C = () => {
|
|
4607
|
+
this.abortPending = null, clearTimeout(m), clearInterval(T), E && clearTimeout(E), window.removeEventListener("message", z);
|
|
4608
|
+
}, z = (M) => {
|
|
4609
|
+
if (!Nr.has(M.origin)) return;
|
|
4610
|
+
C();
|
|
4611
|
+
const H = typeof M.data.status == "string", O = H ? M.data.data ?? {} : M.data;
|
|
4547
4612
|
c.log("[CROSSx] OAuth postMessage 수신 —", {
|
|
4548
|
-
format:
|
|
4549
|
-
status:
|
|
4613
|
+
format: H ? "wrapped" : "flat",
|
|
4614
|
+
status: H ? M.data.status : "(flat)"
|
|
4550
4615
|
});
|
|
4551
|
-
const
|
|
4552
|
-
if (!
|
|
4616
|
+
const P = (O == null ? void 0 : O.state) ?? M.data.state;
|
|
4617
|
+
if (!P || P !== l) {
|
|
4553
4618
|
t(new Error("OAuth state mismatch — possible CSRF attack"));
|
|
4554
4619
|
return;
|
|
4555
4620
|
}
|
|
4556
|
-
if (
|
|
4557
|
-
c.error("[CROSSx] OAuth 실패:",
|
|
4621
|
+
if (H && M.data.status !== "success") {
|
|
4622
|
+
c.error("[CROSSx] OAuth 실패:", O == null ? void 0 : O.error), t(new Error((O == null ? void 0 : O.error) || "Authentication failed"));
|
|
4558
4623
|
return;
|
|
4559
4624
|
}
|
|
4560
|
-
if (!
|
|
4561
|
-
c.error("[CROSSx] OAuth 실패:",
|
|
4625
|
+
if (!H && (O != null && O.error)) {
|
|
4626
|
+
c.error("[CROSSx] OAuth 실패:", O.error), t(new Error(O.error || "Authentication failed"));
|
|
4562
4627
|
return;
|
|
4563
4628
|
}
|
|
4564
|
-
const
|
|
4629
|
+
const L = O == null ? void 0 : O.idToken, B = O == null ? void 0 : O.accessToken, ne = B ?? L, he = (O == null ? void 0 : O.email) || void 0;
|
|
4565
4630
|
if (c.log("[CROSSx] OAuth 토큰 수신:", {
|
|
4566
|
-
hasAccessToken: !!
|
|
4567
|
-
hasIdToken: !!
|
|
4568
|
-
hasEmail: !!
|
|
4569
|
-
}), !
|
|
4631
|
+
hasAccessToken: !!B,
|
|
4632
|
+
hasIdToken: !!L,
|
|
4633
|
+
hasEmail: !!he
|
|
4634
|
+
}), !ne) {
|
|
4570
4635
|
c.error("[CROSSx] 토큰을 찾을 수 없음:", M.data), t(new Error("Token not found in response"));
|
|
4571
4636
|
return;
|
|
4572
4637
|
}
|
|
4573
|
-
const
|
|
4574
|
-
|
|
4575
|
-
c.error("[CROSSx] nonce 검증 실패:",
|
|
4638
|
+
const we = { token: ne, email: he }, ae = (ce) => {
|
|
4639
|
+
se.verifyIdTokenNonce(ce, p).then(() => r(we)).catch((le) => {
|
|
4640
|
+
c.error("[CROSSx] nonce 검증 실패:", le), t(le instanceof Error ? le : new Error("nonce verification failed"));
|
|
4576
4641
|
});
|
|
4577
4642
|
};
|
|
4578
|
-
|
|
4643
|
+
B ? B.split(".").length === 3 ? ae(B) : L ? ae(L) : (c.warn(
|
|
4579
4644
|
"[CROSSx] opaque accessToken만 수신 (idToken 없음) — nonce 검증 불가.",
|
|
4580
4645
|
"서버 측 nonce 검증이 필요합니다."
|
|
4581
|
-
), r(
|
|
4646
|
+
), r(we)) : L ? ae(L) : t(new Error("Token not found in response"));
|
|
4582
4647
|
};
|
|
4583
4648
|
this.abortPending = (M) => {
|
|
4584
|
-
|
|
4585
|
-
}, window.addEventListener("message",
|
|
4649
|
+
C(), t(new Error(M));
|
|
4650
|
+
}, window.addEventListener("message", z);
|
|
4586
4651
|
});
|
|
4587
4652
|
}
|
|
4588
4653
|
}
|
|
4589
|
-
const xe = "crossx_wallet_data",
|
|
4590
|
-
class
|
|
4654
|
+
const xe = "crossx_wallet_data", de = "crossx_mock_pin_hash";
|
|
4655
|
+
class Lr {
|
|
4591
4656
|
constructor(e, r) {
|
|
4592
4657
|
this.storage = e, this.pinStore = r ?? null;
|
|
4593
4658
|
}
|
|
@@ -4616,7 +4681,7 @@ class Tr {
|
|
|
4616
4681
|
};
|
|
4617
4682
|
await this.storage.set(xe, s);
|
|
4618
4683
|
const o = (r = this.pinStore) == null ? void 0 : r.get();
|
|
4619
|
-
return o && (await this.storage.set(
|
|
4684
|
+
return o && (await this.storage.set(de, o), c.log("[Mock] 지갑 생성 — PIN 저장됨")), s;
|
|
4620
4685
|
} catch (t) {
|
|
4621
4686
|
throw new h(d.WALLET_CREATION_FAILED, "지갑 생성에 실패했습니다", t);
|
|
4622
4687
|
}
|
|
@@ -4658,8 +4723,8 @@ class Tr {
|
|
|
4658
4723
|
var t;
|
|
4659
4724
|
if (c.log("[Mock] verifyPin"), this.pinScenario === "wrong")
|
|
4660
4725
|
return !1;
|
|
4661
|
-
const r = await this.storage.get(
|
|
4662
|
-
return r && r !== e ? !1 : (r || await this.storage.set(
|
|
4726
|
+
const r = await this.storage.get(de);
|
|
4727
|
+
return r && r !== e ? !1 : (r || await this.storage.set(de, e), (t = this.pinStore) == null || t.set(e), c.log("[Mock] verifyPin → 성공"), !0);
|
|
4663
4728
|
}
|
|
4664
4729
|
/**
|
|
4665
4730
|
* POST /mnemonic/change-password 모킹
|
|
@@ -4669,10 +4734,10 @@ class Tr {
|
|
|
4669
4734
|
var o;
|
|
4670
4735
|
if (c.log("[Mock] changePin"), this.pinScenario === "wrong")
|
|
4671
4736
|
throw new h(d.PIN_WRONG, "Incorrect PIN.");
|
|
4672
|
-
const t = (o = this.pinStore) == null ? void 0 : o.get(), s = await this.storage.get(
|
|
4737
|
+
const t = (o = this.pinStore) == null ? void 0 : o.get(), s = await this.storage.get(de);
|
|
4673
4738
|
if (s && t && s !== t)
|
|
4674
4739
|
throw new h(d.PIN_WRONG, "Incorrect PIN.");
|
|
4675
|
-
await this.storage.set(
|
|
4740
|
+
await this.storage.set(de, r), c.log("[Mock] changePin 완료");
|
|
4676
4741
|
}
|
|
4677
4742
|
async migrateWallet(e, r) {
|
|
4678
4743
|
var o;
|
|
@@ -4705,7 +4770,7 @@ class Tr {
|
|
|
4705
4770
|
};
|
|
4706
4771
|
await this.storage.set(xe, t);
|
|
4707
4772
|
const s = (o = this.pinStore) == null ? void 0 : o.get();
|
|
4708
|
-
return s && (await this.storage.set(
|
|
4773
|
+
return s && (await this.storage.set(de, s), c.log("[Mock] 마이그레이션 — PIN 저장됨")), t;
|
|
4709
4774
|
}
|
|
4710
4775
|
/**
|
|
4711
4776
|
* POST /mnemonic/share-c 모킹
|
|
@@ -4732,7 +4797,7 @@ class Tr {
|
|
|
4732
4797
|
).join("");
|
|
4733
4798
|
}
|
|
4734
4799
|
}
|
|
4735
|
-
class
|
|
4800
|
+
class ie {
|
|
4736
4801
|
constructor(e, r, t, s, o) {
|
|
4737
4802
|
this._refreshPromise = null, this._walletStatusCache = null, this.adapterConfig = e, this.projectId = e.projectId, this.storage = r, this.transport = t, this.tokenStore = s, this.pinStore = o ?? null;
|
|
4738
4803
|
}
|
|
@@ -4759,9 +4824,9 @@ class oe {
|
|
|
4759
4824
|
*/
|
|
4760
4825
|
async ensureValidToken() {
|
|
4761
4826
|
const e = this.tokenStore.get();
|
|
4762
|
-
if (e && !this.tokenStore.isExpiringSoon(
|
|
4827
|
+
if (e && !this.tokenStore.isExpiringSoon(et))
|
|
4763
4828
|
return e;
|
|
4764
|
-
const r = !e || this.tokenStore.isExpiringSoon(
|
|
4829
|
+
const r = !e || this.tokenStore.isExpiringSoon(et);
|
|
4765
4830
|
if (this._onTokenRefresh) {
|
|
4766
4831
|
if (await this.deduplicatedRefresh()) {
|
|
4767
4832
|
const s = this.tokenStore.get();
|
|
@@ -4809,7 +4874,7 @@ class oe {
|
|
|
4809
4874
|
url: n,
|
|
4810
4875
|
method: e
|
|
4811
4876
|
});
|
|
4812
|
-
const m =
|
|
4877
|
+
const m = ie.mapGatewayError(g.code, g.data);
|
|
4813
4878
|
if (m === d.AUTH_NOT_AUTHENTICATED && !s && this._onTokenRefresh) {
|
|
4814
4879
|
if (c.warn("[CROSSx] Gateway -10002 감지 — 토큰 갱신 후 재시도"), await this.deduplicatedRefresh())
|
|
4815
4880
|
return this.request(e, r, t, !0);
|
|
@@ -4818,11 +4883,11 @@ class oe {
|
|
|
4818
4883
|
if (m === d.USER_NOT_FOUND)
|
|
4819
4884
|
throw c.warn("[CROSSx] Gateway -10033 감지 — 유저 미존재, 강제 로그아웃"), (l = this._onUnauthorized) == null || l.call(this), new h(
|
|
4820
4885
|
d.USER_NOT_FOUND,
|
|
4821
|
-
|
|
4886
|
+
ie.getGatewayErrorMessage(g.code, f)
|
|
4822
4887
|
);
|
|
4823
|
-
const y = m === d.AUTH_NOT_AUTHENTICATED ? d.SESSION_EXPIRED : m, S = y === d.SESSION_EXPIRED ? "인증 세션이 만료되었습니다. 다시 로그인해 주세요." :
|
|
4824
|
-
let
|
|
4825
|
-
throw m === d.PIN_LOCKED ?
|
|
4888
|
+
const y = m === d.AUTH_NOT_AUTHENTICATED ? d.SESSION_EXPIRED : m, S = y === d.SESSION_EXPIRED ? "인증 세션이 만료되었습니다. 다시 로그인해 주세요." : ie.getGatewayErrorMessage(g.code, f), A = g.data;
|
|
4889
|
+
let E;
|
|
4890
|
+
throw m === d.PIN_LOCKED ? E = ie.extractLockDetails(A) : m === d.ADDRESS_LIMIT_EXCEEDED ? E = { limit: Le, raw: A } : E = A ?? void 0, new h(y, S, E);
|
|
4826
4891
|
}
|
|
4827
4892
|
return c.log("[CROSSx] Wallet Gateway API 성공:", { code: g.code, url: n, method: e }), g.data ?? g;
|
|
4828
4893
|
}
|
|
@@ -5139,7 +5204,7 @@ class oe {
|
|
|
5139
5204
|
case -10025:
|
|
5140
5205
|
return d.INVALID_APP_TYPE;
|
|
5141
5206
|
case -10028:
|
|
5142
|
-
return
|
|
5207
|
+
return ie.hasLockInfo(r) ? d.PIN_LOCKED : d.PIN_WRONG;
|
|
5143
5208
|
case -10029:
|
|
5144
5209
|
return d.PIN_INVALID;
|
|
5145
5210
|
case -10031:
|
|
@@ -5210,7 +5275,7 @@ class oe {
|
|
|
5210
5275
|
case -10033:
|
|
5211
5276
|
return "User not found. You have been signed out.";
|
|
5212
5277
|
case -10036:
|
|
5213
|
-
return `Account limit reached. Maximum ${
|
|
5278
|
+
return `Account limit reached. Maximum ${Le} accounts allowed.`;
|
|
5214
5279
|
case -10040:
|
|
5215
5280
|
return "HMAC signature header is required.";
|
|
5216
5281
|
case -10041:
|
|
@@ -5220,7 +5285,7 @@ class oe {
|
|
|
5220
5285
|
}
|
|
5221
5286
|
}
|
|
5222
5287
|
}
|
|
5223
|
-
class
|
|
5288
|
+
class Dr {
|
|
5224
5289
|
constructor(e, r, t, s = () => {
|
|
5225
5290
|
}, o = () => {
|
|
5226
5291
|
}) {
|
|
@@ -5371,7 +5436,7 @@ class fe {
|
|
|
5371
5436
|
}
|
|
5372
5437
|
isCacheValid() {
|
|
5373
5438
|
if (this.loadedAt === 0) return !1;
|
|
5374
|
-
const e = this.usingFallback ?
|
|
5439
|
+
const e = this.usingFallback ? $t : Mt;
|
|
5375
5440
|
return e === 0 ? !0 : Date.now() - this.loadedAt < e;
|
|
5376
5441
|
}
|
|
5377
5442
|
populateCache(e, r) {
|
|
@@ -5409,7 +5474,7 @@ class fe {
|
|
|
5409
5474
|
);
|
|
5410
5475
|
}
|
|
5411
5476
|
static fallbackChains() {
|
|
5412
|
-
return Object.values(
|
|
5477
|
+
return Object.values(Ae).map((e) => ({
|
|
5413
5478
|
chainId: e.caipId,
|
|
5414
5479
|
rpcUrl: e.rpcUrl
|
|
5415
5480
|
}));
|
|
@@ -5433,7 +5498,7 @@ class fe {
|
|
|
5433
5498
|
}
|
|
5434
5499
|
}
|
|
5435
5500
|
}
|
|
5436
|
-
const
|
|
5501
|
+
const lt = "__crossx-confirm-style", F = "__crossx-confirm-overlay", Mr = {
|
|
5437
5502
|
light: {
|
|
5438
5503
|
bg: "#FFFFFF",
|
|
5439
5504
|
border: "rgba(0,0,0,0.07)",
|
|
@@ -5501,8 +5566,8 @@ const nt = "__crossx-confirm-style", F = "__crossx-confirm-overlay", Cr = {
|
|
|
5501
5566
|
onPrimary: "#000000"
|
|
5502
5567
|
}
|
|
5503
5568
|
};
|
|
5504
|
-
function
|
|
5505
|
-
const r =
|
|
5569
|
+
function dt(i, e) {
|
|
5570
|
+
const r = Mr[i], t = e == null ? void 0 : e[i];
|
|
5506
5571
|
return t ? {
|
|
5507
5572
|
...r,
|
|
5508
5573
|
// ── Brand
|
|
@@ -5536,7 +5601,7 @@ function at(i, e) {
|
|
|
5536
5601
|
...t.error !== void 0 && { errorColor: t.error }
|
|
5537
5602
|
} : r;
|
|
5538
5603
|
}
|
|
5539
|
-
const
|
|
5604
|
+
const $r = `
|
|
5540
5605
|
@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');
|
|
5541
5606
|
|
|
5542
5607
|
#${F} {
|
|
@@ -8138,10 +8203,10 @@ button.__crossx-connect-other-block:active {
|
|
|
8138
8203
|
}
|
|
8139
8204
|
`;
|
|
8140
8205
|
function K() {
|
|
8141
|
-
let i = document.getElementById(
|
|
8142
|
-
i || (i = document.createElement("style"), i.id =
|
|
8206
|
+
let i = document.getElementById(lt);
|
|
8207
|
+
i || (i = document.createElement("style"), i.id = lt, document.head.appendChild(i)), i.textContent = $r;
|
|
8143
8208
|
}
|
|
8144
|
-
function
|
|
8209
|
+
function Fr() {
|
|
8145
8210
|
const i = `#${F}`, e = (t) => {
|
|
8146
8211
|
var s, o;
|
|
8147
8212
|
(o = (s = t.target) == null ? void 0 : s.closest) != null && o.call(s, i) && t.stopImmediatePropagation();
|
|
@@ -8153,7 +8218,7 @@ function Nr() {
|
|
|
8153
8218
|
document.removeEventListener("focusin", e, !0), document.removeEventListener("focusout", r, !0);
|
|
8154
8219
|
};
|
|
8155
8220
|
}
|
|
8156
|
-
function
|
|
8221
|
+
function V(i) {
|
|
8157
8222
|
const e = i.querySelector(".__crossx-card");
|
|
8158
8223
|
if (e) {
|
|
8159
8224
|
const a = (e.getAttribute("style") ?? "").match(/--cx-bg:\s*([^;]+)/);
|
|
@@ -8181,12 +8246,12 @@ function z(i) {
|
|
|
8181
8246
|
}
|
|
8182
8247
|
n.preventDefault();
|
|
8183
8248
|
}, { passive: !1 });
|
|
8184
|
-
const t =
|
|
8249
|
+
const t = Fr(), s = Br(i), o = i.remove.bind(i);
|
|
8185
8250
|
i.remove = () => {
|
|
8186
8251
|
s(), t(), o();
|
|
8187
8252
|
}, document.body.appendChild(i);
|
|
8188
8253
|
}
|
|
8189
|
-
function
|
|
8254
|
+
function Br(i) {
|
|
8190
8255
|
if (typeof window > "u") return () => {
|
|
8191
8256
|
};
|
|
8192
8257
|
const e = window.visualViewport;
|
|
@@ -8201,7 +8266,7 @@ function Or(i) {
|
|
|
8201
8266
|
e.removeEventListener("resize", t), e.removeEventListener("scroll", t), i.style.removeProperty("--cx-keyboard-inset");
|
|
8202
8267
|
};
|
|
8203
8268
|
}
|
|
8204
|
-
function
|
|
8269
|
+
function Wr(i) {
|
|
8205
8270
|
const e = Array.from(i.querySelectorAll(".__crossx-amount-tip"));
|
|
8206
8271
|
if (!e.length) return;
|
|
8207
8272
|
const r = document.createElement("div");
|
|
@@ -8225,9 +8290,9 @@ function Lr(i) {
|
|
|
8225
8290
|
n.target.closest(".__crossx-amount-tip") || o();
|
|
8226
8291
|
}, { passive: !0 });
|
|
8227
8292
|
}
|
|
8228
|
-
const
|
|
8229
|
-
function
|
|
8230
|
-
if (
|
|
8293
|
+
const Ur = () => /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
|
|
8294
|
+
function re() {
|
|
8295
|
+
if (Ur()) {
|
|
8231
8296
|
const e = window.scrollY;
|
|
8232
8297
|
return document.body.style.position = "fixed", document.body.style.top = `-${e}px`, document.body.style.left = "0", document.body.style.right = "0", () => {
|
|
8233
8298
|
document.body.style.position = "", document.body.style.top = "", document.body.style.left = "", document.body.style.right = "", window.scrollTo(0, e);
|
|
@@ -8238,26 +8303,26 @@ function se() {
|
|
|
8238
8303
|
document.body.style.overflow = i;
|
|
8239
8304
|
};
|
|
8240
8305
|
}
|
|
8241
|
-
function
|
|
8306
|
+
function Q(i) {
|
|
8242
8307
|
return i ? i.length <= 13 ? i : `${i.slice(0, 6)}…${i.slice(-4)}` : "—";
|
|
8243
8308
|
}
|
|
8244
|
-
function
|
|
8309
|
+
function gt(i) {
|
|
8245
8310
|
return i ? i.length <= 13 ? i : `${i.slice(0, 6)}...${i.slice(-4)}` : "—";
|
|
8246
8311
|
}
|
|
8247
|
-
function
|
|
8312
|
+
function ft(i, e = "ONE", r = 18, t = 6) {
|
|
8248
8313
|
if (!i || i === "0x" || i === "0x0") return null;
|
|
8249
8314
|
try {
|
|
8250
8315
|
const s = BigInt(i);
|
|
8251
8316
|
if (s === 0n) return null;
|
|
8252
|
-
const o =
|
|
8317
|
+
const o = Be(s, r, t);
|
|
8253
8318
|
if (o === "0") return null;
|
|
8254
|
-
const n =
|
|
8255
|
-
return
|
|
8319
|
+
const n = $e(s, r);
|
|
8320
|
+
return Fe(`${o} ${e}`, `${n} ${e}`);
|
|
8256
8321
|
} catch {
|
|
8257
8322
|
return null;
|
|
8258
8323
|
}
|
|
8259
8324
|
}
|
|
8260
|
-
const
|
|
8325
|
+
const pt = {
|
|
8261
8326
|
1: "Ethereum Mainnet",
|
|
8262
8327
|
5: "Goerli Testnet",
|
|
8263
8328
|
11155111: "Ethereum Sepolia",
|
|
@@ -8279,60 +8344,60 @@ const ct = {
|
|
|
8279
8344
|
202601: "Ronin Saigon",
|
|
8280
8345
|
612044: "ONEchain Testnet",
|
|
8281
8346
|
612055: "CROSS Mainnet"
|
|
8282
|
-
},
|
|
8283
|
-
let
|
|
8284
|
-
function
|
|
8285
|
-
if (
|
|
8286
|
-
const i =
|
|
8347
|
+
}, Ke = /* @__PURE__ */ new Map();
|
|
8348
|
+
let Ce = !1;
|
|
8349
|
+
function Hr() {
|
|
8350
|
+
if (Ce || (Ce = !0, typeof fetch > "u")) return;
|
|
8351
|
+
const i = He().contentsBaseUrl;
|
|
8287
8352
|
i && fetch(`${i}/chains.json`, { cache: "no-store" }).then((e) => e.ok ? e.json() : null).then((e) => {
|
|
8288
8353
|
const r = e == null ? void 0 : e.chains;
|
|
8289
8354
|
if (r)
|
|
8290
8355
|
for (const [t, s] of Object.entries(r)) {
|
|
8291
8356
|
const o = Number(t);
|
|
8292
|
-
!Number.isNaN(o) && s &&
|
|
8357
|
+
!Number.isNaN(o) && s && Ke.set(o, s);
|
|
8293
8358
|
}
|
|
8294
8359
|
}).catch(() => {
|
|
8295
|
-
|
|
8360
|
+
Ce = !1;
|
|
8296
8361
|
});
|
|
8297
8362
|
}
|
|
8298
|
-
function
|
|
8363
|
+
function wt(i) {
|
|
8299
8364
|
return parseInt(i.split(":")[1] ?? "", 10);
|
|
8300
8365
|
}
|
|
8301
|
-
function
|
|
8366
|
+
function mt(i) {
|
|
8302
8367
|
var r;
|
|
8303
|
-
const e =
|
|
8368
|
+
const e = wt(i);
|
|
8304
8369
|
if (!isNaN(e)) {
|
|
8305
|
-
const t = (r =
|
|
8370
|
+
const t = (r = Ke.get(e)) == null ? void 0 : r.name;
|
|
8306
8371
|
if (t) return t;
|
|
8307
|
-
if (
|
|
8372
|
+
if (pt[e]) return pt[e];
|
|
8308
8373
|
}
|
|
8309
8374
|
return i;
|
|
8310
8375
|
}
|
|
8311
|
-
function
|
|
8376
|
+
function Ve(i, e) {
|
|
8312
8377
|
var r;
|
|
8313
8378
|
if (i) {
|
|
8314
|
-
const t =
|
|
8379
|
+
const t = wt(i);
|
|
8315
8380
|
if (!isNaN(t)) {
|
|
8316
|
-
const s = (r =
|
|
8381
|
+
const s = (r = Ke.get(t)) == null ? void 0 : r.nativeSymbol;
|
|
8317
8382
|
if (s) return s;
|
|
8318
8383
|
}
|
|
8319
8384
|
}
|
|
8320
8385
|
return e;
|
|
8321
8386
|
}
|
|
8322
|
-
function
|
|
8387
|
+
function $e(i, e) {
|
|
8323
8388
|
if (i === 0n) return "0";
|
|
8324
8389
|
const r = 10n ** BigInt(e), t = i / r, o = (i % r).toString().padStart(e, "0").replace(/0+$/, "");
|
|
8325
8390
|
return o ? `${t}.${o}` : `${t}`;
|
|
8326
8391
|
}
|
|
8327
|
-
function
|
|
8392
|
+
function Fe(i, e) {
|
|
8328
8393
|
return i === e ? w(i) : `<span class="__crossx-amount-tip" data-full="${w(e)}">${w(i)}</span>`;
|
|
8329
8394
|
}
|
|
8330
|
-
function
|
|
8395
|
+
function Be(i, e, r) {
|
|
8331
8396
|
if (i === 0n) return "0";
|
|
8332
8397
|
const t = 10n ** BigInt(e), s = i / t, a = (i % t).toString().padStart(e, "0").slice(0, r).replace(/0+$/, "");
|
|
8333
8398
|
return a ? `${s}.${a}` : `${s}`;
|
|
8334
8399
|
}
|
|
8335
|
-
function
|
|
8400
|
+
function Pe(i) {
|
|
8336
8401
|
try {
|
|
8337
8402
|
const e = BigInt(i), r = e / 1000000000n, s = (e % 1000000000n).toString().padStart(9, "0").slice(0, 2).replace(/0+$/, "");
|
|
8338
8403
|
return s ? `${r}.${s}` : `${r}`;
|
|
@@ -8340,28 +8405,28 @@ function Re(i) {
|
|
|
8340
8405
|
return i;
|
|
8341
8406
|
}
|
|
8342
8407
|
}
|
|
8343
|
-
function
|
|
8408
|
+
function Gr(i) {
|
|
8344
8409
|
try {
|
|
8345
8410
|
return BigInt(i).toLocaleString();
|
|
8346
8411
|
} catch {
|
|
8347
8412
|
return i;
|
|
8348
8413
|
}
|
|
8349
8414
|
}
|
|
8350
|
-
function
|
|
8351
|
-
const { gasLimit: r, gasPrice: t, maxFeePerGas: s, maxPriorityFeePerGas: o, nativeDecimals: n = 18 } = i, a =
|
|
8415
|
+
function Kr(i, e) {
|
|
8416
|
+
const { gasLimit: r, gasPrice: t, maxFeePerGas: s, maxPriorityFeePerGas: o, nativeDecimals: n = 18 } = i, a = Ve(i.chainId, i.nativeSymbol ?? "ETH");
|
|
8352
8417
|
if (!r) return null;
|
|
8353
8418
|
try {
|
|
8354
|
-
const l = BigInt(r), p =
|
|
8419
|
+
const l = BigInt(r), p = Gr(r);
|
|
8355
8420
|
if (s) {
|
|
8356
8421
|
const _ = l * BigInt(s);
|
|
8357
8422
|
return {
|
|
8358
8423
|
isDynamic: !0,
|
|
8359
|
-
estTxFee:
|
|
8360
|
-
`${
|
|
8361
|
-
`${
|
|
8424
|
+
estTxFee: Fe(
|
|
8425
|
+
`${Be(_, n, e)} ${a}`,
|
|
8426
|
+
`${$e(_, n)} ${a}`
|
|
8362
8427
|
),
|
|
8363
|
-
maxFeeGwei:
|
|
8364
|
-
maxPriorityFeeGwei: o ?
|
|
8428
|
+
maxFeeGwei: Pe(s),
|
|
8429
|
+
maxPriorityFeeGwei: o ? Pe(o) : void 0,
|
|
8365
8430
|
gasLimitFormatted: p
|
|
8366
8431
|
};
|
|
8367
8432
|
}
|
|
@@ -8369,11 +8434,11 @@ function Fr(i, e) {
|
|
|
8369
8434
|
const _ = l * BigInt(t);
|
|
8370
8435
|
return {
|
|
8371
8436
|
isDynamic: !1,
|
|
8372
|
-
estTxFee:
|
|
8373
|
-
`${
|
|
8374
|
-
`${
|
|
8437
|
+
estTxFee: Fe(
|
|
8438
|
+
`${Be(_, n, e)} ${a}`,
|
|
8439
|
+
`${$e(_, n)} ${a}`
|
|
8375
8440
|
),
|
|
8376
|
-
gasPriceGwei:
|
|
8441
|
+
gasPriceGwei: Pe(t),
|
|
8377
8442
|
gasLimitFormatted: p
|
|
8378
8443
|
};
|
|
8379
8444
|
}
|
|
@@ -8382,33 +8447,33 @@ function Fr(i, e) {
|
|
|
8382
8447
|
return null;
|
|
8383
8448
|
}
|
|
8384
8449
|
}
|
|
8385
|
-
function
|
|
8386
|
-
const t =
|
|
8450
|
+
function yt(i, e, r) {
|
|
8451
|
+
const t = Kr(i, e);
|
|
8387
8452
|
if (!t) return D((r == null ? void 0 : r.label_estimated_fee) ?? "Estimated fee", "<span>—</span>");
|
|
8388
8453
|
let s = D((r == null ? void 0 : r.label_est_tx_fee) ?? "Est. Tx Fee", `<span>${t.estTxFee}</span>`);
|
|
8389
8454
|
return t.isDynamic ? (t.maxPriorityFeeGwei !== void 0 && (s += D((r == null ? void 0 : r.label_max_priority_fee) ?? "Max Priority Fee", `<span>${t.maxPriorityFeeGwei} Gwei</span>`)), t.maxFeeGwei !== void 0 && (s += D((r == null ? void 0 : r.label_max_gas_fee) ?? "Max Gas Fee", `<span>${t.maxFeeGwei} Gwei</span>`))) : t.gasPriceGwei !== void 0 && (s += D((r == null ? void 0 : r.label_gas_price) ?? "Gas Price", `<span>${t.gasPriceGwei} Gwei</span>`)), t.gasLimitFormatted && (s += D((r == null ? void 0 : r.label_gas_limit) ?? "Gas Limit", `<span>${t.gasLimitFormatted}</span>`)), s;
|
|
8390
8455
|
}
|
|
8391
|
-
const
|
|
8456
|
+
const Z = `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
8392
8457
|
<rect x="9" y="9" width="13" height="13" rx="2"/>
|
|
8393
8458
|
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/>
|
|
8394
|
-
</svg>`,
|
|
8459
|
+
</svg>`, U = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
|
|
8395
8460
|
<line x1="18" y1="6" x2="6" y2="18"/>
|
|
8396
8461
|
<line x1="6" y1="6" x2="18" y2="18"/>
|
|
8397
|
-
</svg>`,
|
|
8462
|
+
</svg>`, Vr = `<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
8398
8463
|
<circle cx="20" cy="20" r="20" fill="#00D5AA"/>
|
|
8399
8464
|
<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"/>
|
|
8400
|
-
</svg>`,
|
|
8401
|
-
[ge.MetaMask]:
|
|
8402
|
-
[ge.Binance]:
|
|
8403
|
-
[ge.CROSSx]:
|
|
8404
|
-
},
|
|
8465
|
+
</svg>`, zr = '<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>', qr = '<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>', jr = '<svg width="16" height="16" viewBox="0 0 229 229" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><g clip-path="url(#clip0_74746_12130)"><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_74746_12130)"><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_74746_12130)"/></g><path d="M79.7598 228.096H228.24V64.7367L79.7598 159.851V228.096Z" fill="url(#paint1_linear_74746_12130)"/><path d="M79.7694 228.209H0.0332031V75.9257L79.7694 160.218V228.209Z" fill="url(#paint2_linear_74746_12130)"/><g filter="url(#filter1_d_74746_12130)"><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_74746_12130" 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_74746_12130"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_74746_12130" result="shape"/></filter><filter id="filter1_d_74746_12130" 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_74746_12130"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_74746_12130" result="shape"/></filter><linearGradient id="paint0_linear_74746_12130" 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_74746_12130" 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_74746_12130" 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_74746_12130"><rect width="228.273" height="228.273" rx="87" fill="white"/></clipPath></defs></svg>', Yr = {
|
|
8466
|
+
[ge.MetaMask]: zr,
|
|
8467
|
+
[ge.Binance]: qr,
|
|
8468
|
+
[ge.CROSSx]: jr
|
|
8469
|
+
}, bt = '<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"/>', ze = `<svg width="20" height="20" viewBox="0 0 32 32" fill="currentColor" xmlns="http://www.w3.org/2000/svg">${bt}</svg>`, Xr = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
8405
8470
|
<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)"/>
|
|
8406
|
-
</svg>`,
|
|
8471
|
+
</svg>`, Jr = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
8407
8472
|
<circle cx="12" cy="12" r="12" fill="var(--cx-error)"/>
|
|
8408
8473
|
<circle cx="12" cy="12" r="5.5" stroke="white" stroke-width="1.5"/>
|
|
8409
8474
|
<path d="M12 9.5v3l2 1.5" stroke="white" stroke-width="1.5" stroke-linecap="round"/>
|
|
8410
8475
|
</svg>`;
|
|
8411
|
-
function
|
|
8476
|
+
function G(i) {
|
|
8412
8477
|
return [
|
|
8413
8478
|
`--cx-bg:${i.bg}`,
|
|
8414
8479
|
`--cx-border:${i.border}`,
|
|
@@ -8441,7 +8506,7 @@ function H(i) {
|
|
|
8441
8506
|
`--cx-on-primary:${i.onPrimary}`
|
|
8442
8507
|
].join(";");
|
|
8443
8508
|
}
|
|
8444
|
-
function
|
|
8509
|
+
function Zr(i, e) {
|
|
8445
8510
|
i.style.setProperty("--cx-bg", e.bg), i.style.setProperty("--cx-border", e.border), i.style.setProperty("--cx-border-medium", e.borderMedium), i.style.setProperty("--cx-title", e.titleColor), i.style.setProperty("--cx-subtitle", e.subtitleColor), i.style.setProperty("--cx-label", e.labelColor), i.style.setProperty("--cx-value", e.valueColor), i.style.setProperty("--cx-pill-bg", e.pillBg), i.style.setProperty("--cx-pill-from", e.pillFromColor), i.style.setProperty("--cx-pill-amt", e.pillAmtColor), i.style.setProperty("--cx-divider", e.divider), i.style.setProperty("--cx-close", e.closeColor), i.style.setProperty("--cx-close-hover", e.closeHoverBg), i.style.setProperty("--cx-copy", e.copyColor), i.style.setProperty("--cx-input-bg", e.inputBg), i.style.setProperty("--cx-input-border", e.inputBorder), i.style.setProperty("--cx-hint", e.hintColor), i.style.setProperty("--cx-surface-subtle", e.surfaceSubtle), i.style.setProperty("--cx-surface-high", e.surfaceHigh), i.style.setProperty("--cx-primary", e.primary), i.style.setProperty("--cx-primary-glow", e.primaryGlow), i.style.setProperty("--cx-primary-gradient", e.primaryGradient), i.style.setProperty("--cx-secondary", e.secondary), i.style.setProperty("--cx-error", e.errorColor), i.style.setProperty("--cx-notice-bg", e.noticeBg), i.style.setProperty("--cx-notice-border", e.noticeBorder), i.style.setProperty("--cx-notice-title", e.noticeTitleColor), i.style.setProperty("--cx-on-primary", e.onPrimary);
|
|
8446
8511
|
}
|
|
8447
8512
|
function D(i, e) {
|
|
@@ -8451,14 +8516,14 @@ function D(i, e) {
|
|
|
8451
8516
|
<div class="__crossx-row-value">${e}</div>
|
|
8452
8517
|
</div>`;
|
|
8453
8518
|
}
|
|
8454
|
-
function
|
|
8455
|
-
const s = e, o =
|
|
8456
|
-
<button class="__crossx-copy-btn" data-copy="${w(i.to)}" title="Copy address">${
|
|
8519
|
+
function Qr(i, e, r, t) {
|
|
8520
|
+
const s = e, o = Ve(i.chainId, i.nativeSymbol ?? "ETH"), n = i.nativeDecimals ?? 18, a = Ie(i.dappName), l = i.to ? `<span class="__crossx-addr-text">${Q(i.to)}</span>
|
|
8521
|
+
<button class="__crossx-copy-btn" data-copy="${w(i.to)}" title="Copy address">${Z}</button>` : "<span>—</span>", p = yt(i, r, t), _ = ft(i.value, o, n, r), u = _ ? D((t == null ? void 0 : t.label_value) ?? "Value", `<span>${_}</span>`) : "", x = i.data ?? "0x", g = document.createElement("div");
|
|
8457
8522
|
return g.id = F, g.innerHTML = `
|
|
8458
|
-
<div class="__crossx-card __crossx-card--migration __crossx-card--sign-tx" style="${
|
|
8523
|
+
<div class="__crossx-card __crossx-card--migration __crossx-card--sign-tx" style="${G(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8459
8524
|
<div class="__crossx-header">
|
|
8460
8525
|
<p class="__crossx-title" id="__crossx-ttl">${w((t == null ? void 0 : t.sign_transaction_title) ?? "Signature Request")}</p>
|
|
8461
|
-
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${
|
|
8526
|
+
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${U}</button>
|
|
8462
8527
|
</div>
|
|
8463
8528
|
<hr class="__crossx-divider">
|
|
8464
8529
|
<div class="__crossx-body">
|
|
@@ -8468,8 +8533,8 @@ function qr(i, e, r, t) {
|
|
|
8468
8533
|
<span class="__crossx-sig-origin">${w(a)}</span>${w((t == null ? void 0 : t.signature_requesting) ?? " is requesting a Signature")}
|
|
8469
8534
|
</p>
|
|
8470
8535
|
<div class="__crossx-addr-pill">
|
|
8471
|
-
${
|
|
8472
|
-
<span class="__crossx-addr-pill-text">${
|
|
8536
|
+
${ze}
|
|
8537
|
+
<span class="__crossx-addr-pill-text">${Q(i.from)}</span>
|
|
8473
8538
|
</div>
|
|
8474
8539
|
<p class="__crossx-warning">${w((t == null ? void 0 : t.signature_warning) ?? "After you sign, changes or cancellations are not possible.")}</p>
|
|
8475
8540
|
</div>
|
|
@@ -8477,7 +8542,7 @@ function qr(i, e, r, t) {
|
|
|
8477
8542
|
<div class="__crossx-col-right-sign">
|
|
8478
8543
|
<div class="__crossx-rows">
|
|
8479
8544
|
${D((t == null ? void 0 : t.label_to) ?? "To", l)}
|
|
8480
|
-
${D((t == null ? void 0 : t.label_network) ?? "Network", `<span>${
|
|
8545
|
+
${D((t == null ? void 0 : t.label_network) ?? "Network", `<span>${mt(i.chainId)}</span>`)}
|
|
8481
8546
|
${u}
|
|
8482
8547
|
${p}
|
|
8483
8548
|
</div>
|
|
@@ -8492,7 +8557,7 @@ function qr(i, e, r, t) {
|
|
|
8492
8557
|
</div>
|
|
8493
8558
|
`, g;
|
|
8494
8559
|
}
|
|
8495
|
-
const
|
|
8560
|
+
const es = /* @__PURE__ */ new Set([
|
|
8496
8561
|
"0x095ea7b3",
|
|
8497
8562
|
// approve(address,uint256) — ERC20 / ERC721
|
|
8498
8563
|
"0xa22cb465",
|
|
@@ -8502,17 +8567,17 @@ const jr = /* @__PURE__ */ new Set([
|
|
|
8502
8567
|
"0x8fcbaf0c"
|
|
8503
8568
|
// permit(address,address,uint256,uint256,bool,uint8,bytes32,bytes32) — DAI 스타일
|
|
8504
8569
|
]);
|
|
8505
|
-
function
|
|
8506
|
-
return i ?
|
|
8570
|
+
function ts(i) {
|
|
8571
|
+
return i ? es.has(i.slice(0, 10).toLowerCase()) : !1;
|
|
8507
8572
|
}
|
|
8508
|
-
function
|
|
8509
|
-
const s = e, o =
|
|
8510
|
-
<button class="__crossx-copy-btn" data-copy="${w(i.to)}" title="Copy address">${
|
|
8573
|
+
function rs(i, e, r, t) {
|
|
8574
|
+
const s = e, o = Ve(i.chainId, i.nativeSymbol ?? "ETH"), n = i.nativeDecimals ?? 18, a = Ie(i.dappName), l = i.to ? `<span class="__crossx-addr-text">${Q(i.to)}</span>
|
|
8575
|
+
<button class="__crossx-copy-btn" data-copy="${w(i.to)}" title="Copy address">${Z}</button>` : "<span>—</span>", p = yt(i, r, t), u = ft(i.value, o, n, r) ?? "—", x = ts(i.data) ? (t == null ? void 0 : t.send_tx_approve_button) ?? "Approve" : (t == null ? void 0 : t.send_tx_confirm_button) ?? "Confirm", g = document.createElement("div");
|
|
8511
8576
|
return g.id = F, g.innerHTML = `
|
|
8512
|
-
<div class="__crossx-card __crossx-card--migration __crossx-card--send-tx" style="${
|
|
8577
|
+
<div class="__crossx-card __crossx-card--migration __crossx-card--send-tx" style="${G(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8513
8578
|
<div class="__crossx-header">
|
|
8514
8579
|
<p class="__crossx-title" id="__crossx-ttl">${w((t == null ? void 0 : t.send_transaction_title) ?? "Approve transaction")}</p>
|
|
8515
|
-
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${
|
|
8580
|
+
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${U}</button>
|
|
8516
8581
|
</div>
|
|
8517
8582
|
<hr class="__crossx-divider">
|
|
8518
8583
|
<div class="__crossx-body">
|
|
@@ -8522,11 +8587,11 @@ function Xr(i, e, r, t) {
|
|
|
8522
8587
|
<div class="__crossx-body-cols">
|
|
8523
8588
|
<div class="__crossx-rows">
|
|
8524
8589
|
${D((t == null ? void 0 : t.label_to) ?? "To", l)}
|
|
8525
|
-
${D((t == null ? void 0 : t.label_network) ?? "Network", `<span>${
|
|
8590
|
+
${D((t == null ? void 0 : t.label_network) ?? "Network", `<span>${mt(i.chainId)}</span>`)}
|
|
8526
8591
|
${p}
|
|
8527
8592
|
</div>
|
|
8528
8593
|
<div class="__crossx-pill">
|
|
8529
|
-
<span class="__crossx-pill-from">${
|
|
8594
|
+
<span class="__crossx-pill-from">${Q(i.from)}</span>
|
|
8530
8595
|
<span class="__crossx-pill-amount">${u}</span>
|
|
8531
8596
|
</div>
|
|
8532
8597
|
</div>
|
|
@@ -8535,7 +8600,7 @@ function Xr(i, e, r, t) {
|
|
|
8535
8600
|
</div>
|
|
8536
8601
|
`, g;
|
|
8537
8602
|
}
|
|
8538
|
-
function
|
|
8603
|
+
function Ie(i) {
|
|
8539
8604
|
var e;
|
|
8540
8605
|
if (i) return i;
|
|
8541
8606
|
try {
|
|
@@ -8547,10 +8612,10 @@ function Ee(i) {
|
|
|
8547
8612
|
function w(i) {
|
|
8548
8613
|
return i.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
8549
8614
|
}
|
|
8550
|
-
function
|
|
8615
|
+
function ss(i) {
|
|
8551
8616
|
return typeof i == "string" && /^0x[0-9a-fA-F]{40}$/i.test(i);
|
|
8552
8617
|
}
|
|
8553
|
-
function
|
|
8618
|
+
function is(i) {
|
|
8554
8619
|
if (typeof i == "string") return w(i);
|
|
8555
8620
|
if (typeof i == "number" || typeof i == "bigint" || typeof i == "boolean") return String(i);
|
|
8556
8621
|
try {
|
|
@@ -8559,40 +8624,40 @@ function Zr(i) {
|
|
|
8559
8624
|
return String(i);
|
|
8560
8625
|
}
|
|
8561
8626
|
}
|
|
8562
|
-
function
|
|
8627
|
+
function os(i) {
|
|
8563
8628
|
return i.includes(":") ? i.split(":")[1] ?? i : i;
|
|
8564
8629
|
}
|
|
8565
|
-
function
|
|
8630
|
+
function ns(i) {
|
|
8566
8631
|
return `https://www.crossscan.io/address/${i}?tab=txs`;
|
|
8567
8632
|
}
|
|
8568
|
-
function
|
|
8569
|
-
return `https://explorer.crosstoken.io/${
|
|
8633
|
+
function as(i, e) {
|
|
8634
|
+
return `https://explorer.crosstoken.io/${os(i)}/tx/${e}`;
|
|
8570
8635
|
}
|
|
8571
|
-
function
|
|
8636
|
+
function vt(i, e) {
|
|
8572
8637
|
return `<a class="__crossx-addr-text __crossx-row-link" href="${w(e)}" target="_blank" rel="noopener noreferrer">${w(i)}</a>`;
|
|
8573
8638
|
}
|
|
8574
|
-
function
|
|
8575
|
-
return
|
|
8639
|
+
function Se(i) {
|
|
8640
|
+
return vt(Q(i), ns(i));
|
|
8576
8641
|
}
|
|
8577
|
-
function
|
|
8578
|
-
return
|
|
8642
|
+
function St(i, e) {
|
|
8643
|
+
return vt(Q(e), as(i, e));
|
|
8579
8644
|
}
|
|
8580
|
-
function
|
|
8645
|
+
function cs(i, e, r) {
|
|
8581
8646
|
const t = D(
|
|
8582
8647
|
(r == null ? void 0 : r.label_from) ?? "From",
|
|
8583
|
-
`${
|
|
8584
|
-
<button class="__crossx-copy-btn" data-copy="${w(i.from)}" title="Copy address">${
|
|
8585
|
-
), s = i.to ? D((r == null ? void 0 : r.label_to) ?? "To", `${
|
|
8586
|
-
<button class="__crossx-copy-btn" data-copy="${w(i.to)}" title="Copy address">${
|
|
8587
|
-
<button class="__crossx-copy-btn" data-copy="${w(i.txHash)}" title="Copy hash">${
|
|
8648
|
+
`${Se(i.from)}
|
|
8649
|
+
<button class="__crossx-copy-btn" data-copy="${w(i.from)}" title="Copy address">${Z}</button>`
|
|
8650
|
+
), s = i.to ? D((r == null ? void 0 : r.label_to) ?? "To", `${Se(i.to)}
|
|
8651
|
+
<button class="__crossx-copy-btn" data-copy="${w(i.to)}" title="Copy address">${Z}</button>`) : "", o = i.amount ? D((r == null ? void 0 : r.label_transfer) ?? "Transfer", `<span>${w(i.amount)}</span>`) : "", n = i.fees ? D((r == null ? void 0 : r.label_tx_fee) ?? "Tx Fee", `<span>${w(i.fees)}</span>`) : "", a = i.txHash ? D((r == null ? void 0 : r.label_tx_hash) ?? "Tx Hash", `${St(i.chainId, i.txHash)}
|
|
8652
|
+
<button class="__crossx-copy-btn" data-copy="${w(i.txHash)}" title="Copy hash">${Z}</button>`) : "", l = i.total ? `<div class="__crossx-total-pill">
|
|
8588
8653
|
<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>
|
|
8589
8654
|
<span class="__crossx-total-amount">${w(i.total)}</span>
|
|
8590
8655
|
</div>` : "", p = document.createElement("div");
|
|
8591
8656
|
return p.id = F, p.innerHTML = `
|
|
8592
|
-
<div class="__crossx-card __crossx-card--migration" style="${
|
|
8657
|
+
<div class="__crossx-card __crossx-card--migration" style="${G(e)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8593
8658
|
<div class="__crossx-header">
|
|
8594
8659
|
<p class="__crossx-title" id="__crossx-ttl">${w((r == null ? void 0 : r.tx_success) ?? "Transaction complete")}</p>
|
|
8595
|
-
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${
|
|
8660
|
+
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${U}</button>
|
|
8596
8661
|
</div>
|
|
8597
8662
|
<hr class="__crossx-divider">
|
|
8598
8663
|
<div class="__crossx-body">
|
|
@@ -8609,10 +8674,10 @@ function rs(i, e, r) {
|
|
|
8609
8674
|
</div>
|
|
8610
8675
|
`, p;
|
|
8611
8676
|
}
|
|
8612
|
-
function
|
|
8677
|
+
function ls(i, e, r) {
|
|
8613
8678
|
const t = document.createElement("div");
|
|
8614
8679
|
return t.id = F, t.innerHTML = `
|
|
8615
|
-
<div class="__crossx-card __crossx-card--migration" style="${
|
|
8680
|
+
<div class="__crossx-card __crossx-card--migration" style="${G(e)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8616
8681
|
<div class="__crossx-header">
|
|
8617
8682
|
<p class="__crossx-title" id="__crossx-ttl">${w((r == null ? void 0 : r.tx_progress_waiting_title) ?? "Waiting for confirmation")}</p>
|
|
8618
8683
|
</div>
|
|
@@ -8626,22 +8691,22 @@ function ss(i, e, r) {
|
|
|
8626
8691
|
</div>
|
|
8627
8692
|
`, t;
|
|
8628
8693
|
}
|
|
8629
|
-
function
|
|
8694
|
+
function ds(i, e, r, t) {
|
|
8630
8695
|
const s = e.status !== "reverted" && e.status !== "timeout", o = e.status === "timeout", n = i.querySelector("#__crossx-ttl"), a = i.querySelector(".__crossx-header");
|
|
8631
8696
|
if (n) {
|
|
8632
|
-
const m = o ?
|
|
8697
|
+
const m = o ? Jr : s ? "" : Xr, y = o ? (t == null ? void 0 : t.tx_timeout) ?? "Transaction timeout" : s ? (t == null ? void 0 : t.tx_success) ?? "Transaction complete" : (t == null ? void 0 : t.tx_failed) ?? "Transaction failed";
|
|
8633
8698
|
m ? (n.style.display = "flex", n.style.alignItems = "center", n.style.gap = "8px", n.innerHTML = `${m}<span>${w(y)}</span>`) : n.textContent = y;
|
|
8634
8699
|
}
|
|
8635
8700
|
if (a && !i.querySelector("#__crossx-close-btn")) {
|
|
8636
8701
|
const m = document.createElement("button");
|
|
8637
|
-
m.className = "__crossx-close", m.id = "__crossx-close-btn", m.setAttribute("aria-label", "Close"), m.innerHTML =
|
|
8702
|
+
m.className = "__crossx-close", m.id = "__crossx-close-btn", m.setAttribute("aria-label", "Close"), m.innerHTML = U, a.appendChild(m);
|
|
8638
8703
|
}
|
|
8639
8704
|
const l = i.querySelector("#__crossx-progress-body");
|
|
8640
8705
|
if (!l) return;
|
|
8641
|
-
const p = e.from ? D((t == null ? void 0 : t.label_from) ?? "From", `${
|
|
8642
|
-
<button class="__crossx-copy-btn" data-copy="${w(e.from)}" title="Copy address">${
|
|
8643
|
-
<button class="__crossx-copy-btn" data-copy="${w(e.to)}" title="Copy address">${
|
|
8644
|
-
<button class="__crossx-copy-btn" data-copy="${w(e.txHash)}" title="Copy hash">${
|
|
8706
|
+
const p = e.from ? D((t == null ? void 0 : t.label_from) ?? "From", `${Se(e.from)}
|
|
8707
|
+
<button class="__crossx-copy-btn" data-copy="${w(e.from)}" title="Copy address">${Z}</button>`) : "", _ = e.to ? D((t == null ? void 0 : t.label_to) ?? "To", `${Se(e.to)}
|
|
8708
|
+
<button class="__crossx-copy-btn" data-copy="${w(e.to)}" title="Copy address">${Z}</button>`) : "", u = e.amount ? D((t == null ? void 0 : t.label_transfer) ?? "Transfer", `<span>${w(e.amount)}</span>`) : "", x = e.fees ? D((t == null ? void 0 : t.label_tx_fee) ?? "Tx Fee", `<span>${w(e.fees)}</span>`) : "", g = e.txHash ? D((t == null ? void 0 : t.label_tx_hash) ?? "Tx Hash", `${St(e.chainId, e.txHash)}
|
|
8709
|
+
<button class="__crossx-copy-btn" data-copy="${w(e.txHash)}" title="Copy hash">${Z}</button>`) : "", f = e.total ? `<div class="__crossx-total-pill">
|
|
8645
8710
|
<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>
|
|
8646
8711
|
<span class="__crossx-total-amount">${w(e.total)}</span>
|
|
8647
8712
|
</div>` : "";
|
|
@@ -8657,21 +8722,21 @@ function is(i, e, r, t) {
|
|
|
8657
8722
|
<button class="__crossx-approve-btn" id="__crossx-done-btn">${w((t == null ? void 0 : t.tx_complete_done_button) ?? (s ? "All Done" : "Done"))}</button>
|
|
8658
8723
|
`, l.querySelectorAll(".__crossx-copy-btn").forEach((m) => {
|
|
8659
8724
|
m.addEventListener("click", (y) => {
|
|
8660
|
-
var
|
|
8725
|
+
var A;
|
|
8661
8726
|
y.stopPropagation();
|
|
8662
8727
|
const S = m.dataset.copy;
|
|
8663
|
-
S && ((
|
|
8728
|
+
S && ((A = navigator.clipboard) == null || A.writeText(S).catch(() => {
|
|
8664
8729
|
}));
|
|
8665
8730
|
});
|
|
8666
8731
|
});
|
|
8667
8732
|
}
|
|
8668
|
-
function
|
|
8669
|
-
const t = e, s =
|
|
8733
|
+
function ps(i, e, r) {
|
|
8734
|
+
const t = e, s = Ie(i.dappName), o = w(i.message), n = document.createElement("div");
|
|
8670
8735
|
return n.id = F, n.innerHTML = `
|
|
8671
|
-
<div class="__crossx-card __crossx-card--migration __crossx-card--sign-msg" style="${
|
|
8736
|
+
<div class="__crossx-card __crossx-card--migration __crossx-card--sign-msg" style="${G(t)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8672
8737
|
<div class="__crossx-header">
|
|
8673
8738
|
<p class="__crossx-title" id="__crossx-ttl">${w((r == null ? void 0 : r.sign_message_title) ?? "Signature Request")}</p>
|
|
8674
|
-
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${
|
|
8739
|
+
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${U}</button>
|
|
8675
8740
|
</div>
|
|
8676
8741
|
<hr class="__crossx-divider">
|
|
8677
8742
|
<div class="__crossx-body">
|
|
@@ -8681,8 +8746,8 @@ function os(i, e, r) {
|
|
|
8681
8746
|
<span class="__crossx-sig-origin">${w(s)}</span>${w((r == null ? void 0 : r.signature_requesting) ?? " is requesting a Signature")}
|
|
8682
8747
|
</p>
|
|
8683
8748
|
<div class="__crossx-addr-pill">
|
|
8684
|
-
${
|
|
8685
|
-
<span class="__crossx-addr-pill-text">${
|
|
8749
|
+
${ze}
|
|
8750
|
+
<span class="__crossx-addr-pill-text">${Q(i.from)}</span>
|
|
8686
8751
|
</div>
|
|
8687
8752
|
<p class="__crossx-warning">${w((r == null ? void 0 : r.signature_warning) ?? "After you sign, changes or cancellations are not possible.")}</p>
|
|
8688
8753
|
</div>
|
|
@@ -8697,8 +8762,8 @@ function os(i, e, r) {
|
|
|
8697
8762
|
</div>
|
|
8698
8763
|
`, n;
|
|
8699
8764
|
}
|
|
8700
|
-
function
|
|
8701
|
-
const t = e, s =
|
|
8765
|
+
function _s(i, e, r) {
|
|
8766
|
+
const t = e, s = Ie(i.dappName);
|
|
8702
8767
|
let o = {};
|
|
8703
8768
|
if (typeof i.typedData == "string")
|
|
8704
8769
|
try {
|
|
@@ -8713,8 +8778,8 @@ function ns(i, e, r) {
|
|
|
8713
8778
|
<span class="__crossx-td-value">${w(n)}</span>
|
|
8714
8779
|
</div>`;
|
|
8715
8780
|
for (const [_, u] of Object.entries(a)) {
|
|
8716
|
-
const x =
|
|
8717
|
-
<button class="__crossx-copy-btn" data-copy="${w(String(u))}" title="Copy">${
|
|
8781
|
+
const x = is(u), f = ss(u) ? `<span class="__crossx-addr-text">${Q(u)}</span>
|
|
8782
|
+
<button class="__crossx-copy-btn" data-copy="${w(String(u))}" title="Copy">${Z}</button>` : `<span>${x}</span>`;
|
|
8718
8783
|
l += `
|
|
8719
8784
|
<div class="__crossx-td-row">
|
|
8720
8785
|
<span class="__crossx-td-label">${w(_)}</span>
|
|
@@ -8723,10 +8788,10 @@ function ns(i, e, r) {
|
|
|
8723
8788
|
}
|
|
8724
8789
|
const p = document.createElement("div");
|
|
8725
8790
|
return p.id = F, p.innerHTML = `
|
|
8726
|
-
<div class="__crossx-card __crossx-card--migration __crossx-card--sign-typed" style="${
|
|
8791
|
+
<div class="__crossx-card __crossx-card--migration __crossx-card--sign-typed" style="${G(t)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8727
8792
|
<div class="__crossx-header">
|
|
8728
8793
|
<p class="__crossx-title" id="__crossx-ttl">${w((r == null ? void 0 : r.sign_typed_data_title) ?? "Signature Request")}</p>
|
|
8729
|
-
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${
|
|
8794
|
+
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${U}</button>
|
|
8730
8795
|
</div>
|
|
8731
8796
|
<hr class="__crossx-divider">
|
|
8732
8797
|
<div class="__crossx-body">
|
|
@@ -8736,8 +8801,8 @@ function ns(i, e, r) {
|
|
|
8736
8801
|
<span class="__crossx-sig-origin">${w(s)}</span>${w((r == null ? void 0 : r.signature_requesting) ?? " is requesting a Signature")}
|
|
8737
8802
|
</p>
|
|
8738
8803
|
<div class="__crossx-addr-pill">
|
|
8739
|
-
${
|
|
8740
|
-
<span class="__crossx-addr-pill-text">${
|
|
8804
|
+
${ze}
|
|
8805
|
+
<span class="__crossx-addr-pill-text">${Q(i.from)}</span>
|
|
8741
8806
|
</div>
|
|
8742
8807
|
<p class="__crossx-warning">${w((r == null ? void 0 : r.signature_warning) ?? "After you sign, changes or cancellations are not possible.")}</p>
|
|
8743
8808
|
</div>
|
|
@@ -8752,41 +8817,41 @@ function ns(i, e, r) {
|
|
|
8752
8817
|
</div>
|
|
8753
8818
|
`, p;
|
|
8754
8819
|
}
|
|
8755
|
-
const
|
|
8820
|
+
const hs = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
|
|
8756
8821
|
<line x1="12" y1="5" x2="12" y2="19"/>
|
|
8757
8822
|
<line x1="5" y1="12" x2="19" y2="12"/>
|
|
8758
|
-
</svg>`,
|
|
8759
|
-
function
|
|
8823
|
+
</svg>`, us = '<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>';
|
|
8824
|
+
function Et(i) {
|
|
8760
8825
|
return i.name || `Account ${i.index + 1}`;
|
|
8761
8826
|
}
|
|
8762
|
-
function
|
|
8763
|
-
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">${
|
|
8827
|
+
function xs() {
|
|
8828
|
+
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">${bt}</g></svg>`;
|
|
8764
8829
|
}
|
|
8765
|
-
const
|
|
8766
|
-
function
|
|
8830
|
+
const gs = He().portraitBaseUrl;
|
|
8831
|
+
function fs(i, e) {
|
|
8767
8832
|
const r = e.replace("#", "");
|
|
8768
|
-
return `${
|
|
8833
|
+
return `${gs}/portrait/evm/${i}.png?size=256&bg=${r}`;
|
|
8769
8834
|
}
|
|
8770
|
-
function
|
|
8771
|
-
const t =
|
|
8835
|
+
function At(i, e, r) {
|
|
8836
|
+
const t = fs(i, r), o = xs().replace(/"/g, """);
|
|
8772
8837
|
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>`;
|
|
8773
8838
|
}
|
|
8774
|
-
function
|
|
8839
|
+
function ws(i, e, r, t) {
|
|
8775
8840
|
const s = r == null ? void 0 : r.toLowerCase(), o = i.map((a) => {
|
|
8776
|
-
const l = s && a.address.toLowerCase() === s, p = l ? " __crossx-wallet-item--selected" : "", _ = l ? `<span class="__crossx-wallet-selected">${w((t == null ? void 0 : t.wallet_selector_selected) ?? "Selected")}</span><span class="__crossx-wallet-check">${
|
|
8841
|
+
const l = s && a.address.toLowerCase() === s, p = l ? " __crossx-wallet-item--selected" : "", _ = l ? `<span class="__crossx-wallet-selected">${w((t == null ? void 0 : t.wallet_selector_selected) ?? "Selected")}</span><span class="__crossx-wallet-check">${us}</span>` : "";
|
|
8777
8842
|
return `<button class="__crossx-wallet-item${p}" data-wallet-index="${a.index}" data-wallet-address="${w(a.address)}">
|
|
8778
|
-
${
|
|
8843
|
+
${At(a.address, a.index, e.bg)}<span class="__crossx-wallet-info"><span class="__crossx-wallet-idx">${w(Et(a))}</span><span class="__crossx-wallet-addr">${gt(a.address)}</span></span>${_}
|
|
8779
8844
|
</button>`;
|
|
8780
8845
|
}).join(""), n = document.createElement("div");
|
|
8781
8846
|
return n.id = F, n.className = "__crossx-overlay--wallet-selector", n.innerHTML = `
|
|
8782
|
-
<div class="__crossx-card __crossx-card--wallet-selector" style="${
|
|
8847
|
+
<div class="__crossx-card __crossx-card--wallet-selector" style="${G(e)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8783
8848
|
<div class="__crossx-header">
|
|
8784
8849
|
<span class="__crossx-wallet-sheet-handle" aria-hidden="true"></span>
|
|
8785
8850
|
<div class="__crossx-wallet-header-copy">
|
|
8786
8851
|
<p class="__crossx-title" id="__crossx-ttl">${w((t == null ? void 0 : t.wallet_selector_title) ?? "Select Connected Wallet")}</p>
|
|
8787
8852
|
<p class="__crossx-subtitle--body">${w((t == null ? void 0 : t.wallet_selector_description) ?? "Please select the wallet you previously used for this game to continue.")}</p>
|
|
8788
8853
|
</div>
|
|
8789
|
-
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${
|
|
8854
|
+
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${U}</button>
|
|
8790
8855
|
</div>
|
|
8791
8856
|
<hr class="__crossx-divider">
|
|
8792
8857
|
<div class="__crossx-body __crossx-wallet-selector-body">
|
|
@@ -8795,7 +8860,7 @@ function _s(i, e, r, t) {
|
|
|
8795
8860
|
${o}
|
|
8796
8861
|
</div>
|
|
8797
8862
|
<button class="__crossx-wallet-add" id="__crossx-add-wallet-btn" type="button">
|
|
8798
|
-
<span class="__crossx-wallet-add-icon">${
|
|
8863
|
+
<span class="__crossx-wallet-add-icon">${hs}</span>
|
|
8799
8864
|
<span class="__crossx-wallet-add-label">${w((t == null ? void 0 : t.wallet_selector_add_button) ?? "Add Wallet")}</span>
|
|
8800
8865
|
</button>
|
|
8801
8866
|
<p class="__crossx-wallet-add-error" id="__crossx-add-wallet-error" role="alert" aria-live="polite" hidden></p>
|
|
@@ -8810,11 +8875,11 @@ function _s(i, e, r, t) {
|
|
|
8810
8875
|
</div>
|
|
8811
8876
|
`, n;
|
|
8812
8877
|
}
|
|
8813
|
-
function
|
|
8878
|
+
function ms(i, e) {
|
|
8814
8879
|
const r = document.createElement("div");
|
|
8815
8880
|
r.id = F;
|
|
8816
8881
|
const t = document.createElement("div");
|
|
8817
|
-
t.className = "__crossx-card __crossx-card--wallet-created",
|
|
8882
|
+
t.className = "__crossx-card __crossx-card--wallet-created", Zr(t, i), t.role = "dialog", t.ariaModal = "true", t.setAttribute("aria-labelledby", "__crossx-ttl");
|
|
8818
8883
|
const s = document.createElement("div");
|
|
8819
8884
|
s.className = "__crossx-header";
|
|
8820
8885
|
const o = document.createElement("span");
|
|
@@ -8822,7 +8887,7 @@ function hs(i, e) {
|
|
|
8822
8887
|
const n = document.createElement("p");
|
|
8823
8888
|
n.className = "__crossx-title", n.id = "__crossx-ttl", n.style.paddingRight = "48px", n.textContent = (e == null ? void 0 : e.wallet_created_title) ?? "Wallet Created!";
|
|
8824
8889
|
const a = document.createElement("button");
|
|
8825
|
-
a.className = "__crossx-close", a.id = "__crossx-close-btn", a.type = "button", a.ariaLabel = "Close", a.innerHTML =
|
|
8890
|
+
a.className = "__crossx-close", a.id = "__crossx-close-btn", a.type = "button", a.ariaLabel = "Close", a.innerHTML = U, s.append(o, n, a);
|
|
8826
8891
|
const l = document.createElement("hr");
|
|
8827
8892
|
l.className = "__crossx-divider";
|
|
8828
8893
|
const p = document.createElement("div");
|
|
@@ -8851,22 +8916,22 @@ function hs(i, e) {
|
|
|
8851
8916
|
const f = document.createElement("button");
|
|
8852
8917
|
return f.className = "__crossx-wallet-created-btn", f.id = "__crossx-wallet-created-done", f.type = "button", f.textContent = (e == null ? void 0 : e.wallet_created_button) ?? "Got it", g.appendChild(f), t.append(s, l, p, g), r.appendChild(t), r;
|
|
8853
8918
|
}
|
|
8854
|
-
const
|
|
8919
|
+
const ys = `<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
8855
8920
|
<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"/>
|
|
8856
8921
|
<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"/>
|
|
8857
|
-
</svg>`,
|
|
8922
|
+
</svg>`, bs = `<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
8858
8923
|
<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"/>
|
|
8859
8924
|
<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"/>
|
|
8860
8925
|
<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"/>
|
|
8861
8926
|
<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"/>
|
|
8862
8927
|
</svg>`;
|
|
8863
|
-
function
|
|
8864
|
-
const e =
|
|
8865
|
-
return `<span class="__crossx-connect-other-wallet-desc-part"><span class="__crossx-connect-other-wallet-icon" aria-hidden="true">${
|
|
8928
|
+
function vs(i) {
|
|
8929
|
+
const e = Ut(i);
|
|
8930
|
+
return `<span class="__crossx-connect-other-wallet-desc-part"><span class="__crossx-connect-other-wallet-icon" aria-hidden="true">${Yr[i] ?? ""}</span><span class="__crossx-connect-other-wallet-name">${w(e)}</span></span>`;
|
|
8866
8931
|
}
|
|
8867
|
-
function
|
|
8932
|
+
function Ss(i) {
|
|
8868
8933
|
if (i.length === 0) return "";
|
|
8869
|
-
const e = (s) =>
|
|
8934
|
+
const e = (s) => vs(i[s]), r = "Supported wallets include ";
|
|
8870
8935
|
if (i.length === 1)
|
|
8871
8936
|
return `${r}${e(0)}.`;
|
|
8872
8937
|
if (i.length === 2)
|
|
@@ -8876,7 +8941,7 @@ function fs(i) {
|
|
|
8876
8941
|
const t = i.length - 3;
|
|
8877
8942
|
return `${r}${e(0)}, ${e(1)}, ${e(2)}, and ${t} more.`;
|
|
8878
8943
|
}
|
|
8879
|
-
function
|
|
8944
|
+
function Es(i, e = [], r) {
|
|
8880
8945
|
const t = i, s = w(String(e[0])), o = w((r == null ? void 0 : r.login_selector_or) ?? "or"), n = e.length > 0 ? `
|
|
8881
8946
|
<div class="__crossx-login-or-divider">
|
|
8882
8947
|
<hr><span>${o}</span><hr>
|
|
@@ -8884,27 +8949,27 @@ function ws(i, e = [], r) {
|
|
|
8884
8949
|
<button type="button" class="__crossx-connect-other-block" id="__crossx-connect-other-wallet-btn" data-wallet-id="${s}" aria-labelledby="__crossx-connect-other-heading">
|
|
8885
8950
|
<span class="__crossx-connect-other-text">
|
|
8886
8951
|
<span class="__crossx-connect-other-title" id="__crossx-connect-other-heading">${w((r == null ? void 0 : r.login_selector_connect_other_wallets) ?? "Connect with Other Wallets")}</span>
|
|
8887
|
-
<span class="__crossx-connect-other-desc __crossx-connect-other-summary">${
|
|
8952
|
+
<span class="__crossx-connect-other-desc __crossx-connect-other-summary">${Ss(e)}</span>
|
|
8888
8953
|
</span>
|
|
8889
8954
|
</button>` : "", a = document.createElement("div");
|
|
8890
8955
|
return a.id = F, a.innerHTML = `
|
|
8891
|
-
<div class="__crossx-card __crossx-card--migration" style="${
|
|
8956
|
+
<div class="__crossx-card __crossx-card--migration" style="${G(t)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8892
8957
|
<div class="__crossx-header">
|
|
8893
8958
|
<div style="display:flex;flex-direction:column;gap:4px;padding-right:36px;">
|
|
8894
|
-
<p class="__crossx-title" id="__crossx-ttl" style="padding-right:0;">${w((r == null ? void 0 : r.login_selector_title) ??
|
|
8959
|
+
<p class="__crossx-title" id="__crossx-ttl" style="padding-right:0;">${w((r == null ? void 0 : r.login_selector_title) ?? Ue)}</p>
|
|
8895
8960
|
<p class="__crossx-subtitle">${w((r == null ? void 0 : r.login_selector_subtitle) ?? "Sign in instantly with your social account")}</p>
|
|
8896
8961
|
</div>
|
|
8897
|
-
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${
|
|
8962
|
+
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${U}</button>
|
|
8898
8963
|
</div>
|
|
8899
8964
|
<hr class="__crossx-divider">
|
|
8900
8965
|
<div class="__crossx-body">
|
|
8901
8966
|
<div class="__crossx-login-btn-row">
|
|
8902
8967
|
<button class="__crossx-login-btn" id="__crossx-apple-btn" type="button">
|
|
8903
|
-
<span class="__crossx-login-icon" style="color:var(--cx-value);">${
|
|
8968
|
+
<span class="__crossx-login-icon" style="color:var(--cx-value);">${ys}</span>
|
|
8904
8969
|
<span class="__crossx-login-btn-label">${w((r == null ? void 0 : r.login_selector_apple) ?? "Sign in with Apple")}</span>
|
|
8905
8970
|
</button>
|
|
8906
8971
|
<button class="__crossx-login-btn" id="__crossx-google-btn" type="button">
|
|
8907
|
-
<span class="__crossx-login-icon">${
|
|
8972
|
+
<span class="__crossx-login-icon">${bs}</span>
|
|
8908
8973
|
<span class="__crossx-login-btn-label">${w((r == null ? void 0 : r.login_selector_google) ?? "Sign in with Google")}</span>
|
|
8909
8974
|
</button>
|
|
8910
8975
|
</div>${n}
|
|
@@ -8915,7 +8980,7 @@ function ws(i, e = [], r) {
|
|
|
8915
8980
|
</div>
|
|
8916
8981
|
`, a;
|
|
8917
8982
|
}
|
|
8918
|
-
function
|
|
8983
|
+
function As(i, e) {
|
|
8919
8984
|
const r = i, t = document.createElement("div");
|
|
8920
8985
|
t.id = F;
|
|
8921
8986
|
const s = w(e.message).replace(/\n/g, "<br>"), o = e.email ? `<div class="__crossx-session-account-card">
|
|
@@ -8923,10 +8988,10 @@ function ms(i, e) {
|
|
|
8923
8988
|
<p class="__crossx-session-account-email">${w(e.email)}</p>
|
|
8924
8989
|
</div>` : "";
|
|
8925
8990
|
return t.innerHTML = `
|
|
8926
|
-
<div class="__crossx-card __crossx-card--migration" style="${
|
|
8991
|
+
<div class="__crossx-card __crossx-card--migration" style="${G(r)}" role="alertdialog" aria-modal="true" aria-labelledby="__crossx-session-header-title" aria-describedby="__crossx-session-msg">
|
|
8927
8992
|
<div class="__crossx-header">
|
|
8928
8993
|
<p class="__crossx-title" id="__crossx-session-header-title">${w(e.title)}</p>
|
|
8929
|
-
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${
|
|
8994
|
+
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${U}</button>
|
|
8930
8995
|
</div>
|
|
8931
8996
|
<hr class="__crossx-divider">
|
|
8932
8997
|
<div class="__crossx-body" style="padding:20px 24px 24px;display:flex;flex-direction:column;gap:16px;">
|
|
@@ -8943,10 +9008,10 @@ function ms(i, e) {
|
|
|
8943
9008
|
</div>
|
|
8944
9009
|
`, t;
|
|
8945
9010
|
}
|
|
8946
|
-
function
|
|
8947
|
-
const r = i, t = e ? `<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${
|
|
9011
|
+
function Is(i, e = !0) {
|
|
9012
|
+
const r = i, t = e ? `<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${U}</button>` : "", s = e ? '<button class="__crossx-skip-btn" id="__crossx-skip-btn">Skip for Now</button>' : "", o = document.createElement("div");
|
|
8948
9013
|
return o.id = F, o.innerHTML = `
|
|
8949
|
-
<div class="__crossx-card __crossx-card--migration" style="${
|
|
9014
|
+
<div class="__crossx-card __crossx-card--migration" style="${G(r)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8950
9015
|
<div class="__crossx-header">
|
|
8951
9016
|
<p class="__crossx-title" id="__crossx-ttl">Wallet Found on Social Account 🎉</p>
|
|
8952
9017
|
<p class="__crossx-subtitle--body">We found a wallet linked to your social account. Enter your 4-digit PIN to restore your assets.</p>
|
|
@@ -8959,7 +9024,7 @@ function ys(i, e = !0) {
|
|
|
8959
9024
|
<p class="__crossx-mig-info-desc">It safely restores and integrates all your previous assets. Simply verify your PIN to get started.</p>
|
|
8960
9025
|
</div>
|
|
8961
9026
|
<button class="__crossx-recover-btn" id="__crossx-recover-btn">
|
|
8962
|
-
<span class="__crossx-recover-icon">${
|
|
9027
|
+
<span class="__crossx-recover-icon">${Vr}</span>
|
|
8963
9028
|
<span class="__crossx-recover-label">Import from Social Backup</span>
|
|
8964
9029
|
</button>
|
|
8965
9030
|
${s}
|
|
@@ -8967,13 +9032,13 @@ function ys(i, e = !0) {
|
|
|
8967
9032
|
</div>
|
|
8968
9033
|
`, o;
|
|
8969
9034
|
}
|
|
8970
|
-
function
|
|
9035
|
+
function ks(i, e) {
|
|
8971
9036
|
const r = i, { errorMessage: t, attemptCount: s, maxAttempts: o = 5 } = e ?? {}, n = !!t, a = n ? " --error" : "", l = s != null && s > 0 ? `<p class="__crossx-pin-attempt">${s}/${o}</p>` : "", p = s != null && s >= 3 ? '<p class="__crossx-pin-warning">Your account will be locked after further failures.</p>' : "", _ = n ? `<p class="__crossx-pin-error-text">${t}</p>` : "", u = document.createElement("div");
|
|
8972
9037
|
return u.id = F, u.innerHTML = `
|
|
8973
|
-
<div class="__crossx-card __crossx-card--migration" style="${
|
|
9038
|
+
<div class="__crossx-card __crossx-card--migration" style="${G(r)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
8974
9039
|
<div class="__crossx-header">
|
|
8975
9040
|
<p class="__crossx-title" id="__crossx-ttl">Import from Social Backup</p>
|
|
8976
|
-
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${
|
|
9041
|
+
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${U}</button>
|
|
8977
9042
|
</div>
|
|
8978
9043
|
<hr class="__crossx-divider">
|
|
8979
9044
|
<div class="__crossx-pin-center">
|
|
@@ -8991,17 +9056,17 @@ function bs(i, e) {
|
|
|
8991
9056
|
</div>
|
|
8992
9057
|
`, u;
|
|
8993
9058
|
}
|
|
8994
|
-
function
|
|
9059
|
+
function Ts(i) {
|
|
8995
9060
|
const e = new Date(i), r = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], t = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], s = r[e.getDay()], o = t[e.getMonth()], n = e.getDate(), a = String(e.getHours()).padStart(2, "0"), l = String(e.getMinutes()).padStart(2, "0");
|
|
8996
9061
|
return `${s}, ${o} ${n} ${a}:${l}`;
|
|
8997
9062
|
}
|
|
8998
|
-
function
|
|
8999
|
-
const t = i, s = e <= 0, o = s ? null : Date.now() + e * 1e3, n = o ?
|
|
9063
|
+
function Rs(i, e, r) {
|
|
9064
|
+
const t = i, s = e <= 0, o = s ? null : Date.now() + e * 1e3, n = o ? Ts(o) : null, a = document.createElement("div");
|
|
9000
9065
|
return a.id = F, a.innerHTML = `
|
|
9001
|
-
<div class="__crossx-card __crossx-card--migration" style="${
|
|
9066
|
+
<div class="__crossx-card __crossx-card--migration" style="${G(t)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
9002
9067
|
<div class="__crossx-header">
|
|
9003
9068
|
<p class="__crossx-title" id="__crossx-ttl">Import from Social Backup</p>
|
|
9004
|
-
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${
|
|
9069
|
+
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${U}</button>
|
|
9005
9070
|
</div>
|
|
9006
9071
|
<hr class="__crossx-divider">
|
|
9007
9072
|
<div class="__crossx-pin-center">
|
|
@@ -9026,10 +9091,10 @@ function Ss(i, e, r) {
|
|
|
9026
9091
|
return () => clearInterval(u);
|
|
9027
9092
|
} };
|
|
9028
9093
|
}
|
|
9029
|
-
function
|
|
9094
|
+
function Cs(i) {
|
|
9030
9095
|
const r = [i.check1, i.check2].map((t, s) => `
|
|
9031
9096
|
<div class="__crossx-pw-notice-item" data-check-index="${s}" role="checkbox" aria-checked="false" tabindex="0">
|
|
9032
|
-
<div class="__crossx-pw-notice-check" id="__crossx-notice-check-${s}">${
|
|
9097
|
+
<div class="__crossx-pw-notice-check" id="__crossx-notice-check-${s}">${Ls}</div>
|
|
9033
9098
|
<span class="__crossx-pw-notice-item-text">${w(t)}</span>
|
|
9034
9099
|
</div>
|
|
9035
9100
|
`).join("");
|
|
@@ -9038,14 +9103,14 @@ function Es(i) {
|
|
|
9038
9103
|
<span class="__crossx-pin6-sheet-handle" aria-hidden="true"></span>
|
|
9039
9104
|
<p class="__crossx-title" id="__crossx-ttl" style="padding-right:48px;">${w(i.title)}</p>
|
|
9040
9105
|
<p class="__crossx-pw-subtitle">${w(i.headerSubtitle)}</p>
|
|
9041
|
-
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${
|
|
9106
|
+
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${U}</button>
|
|
9042
9107
|
</div>
|
|
9043
9108
|
<hr class="__crossx-divider">
|
|
9044
9109
|
<div class="__crossx-pw-body">
|
|
9045
9110
|
<div class="__crossx-pw-fields __crossx-pw-fields--notice">
|
|
9046
9111
|
<div class="__crossx-pw-notice-header">
|
|
9047
9112
|
<div class="__crossx-pw-notice-title-row">
|
|
9048
|
-
<span class="__crossx-pw-notice-icon">${
|
|
9113
|
+
<span class="__crossx-pw-notice-icon">${Ds}</span>
|
|
9049
9114
|
<p class="__crossx-pw-notice-title">${w(i.noticeTitle)}</p>
|
|
9050
9115
|
</div>
|
|
9051
9116
|
<p class="__crossx-pw-notice-desc">${w(i.noticeDesc)}</p>
|
|
@@ -9065,9 +9130,9 @@ function Es(i) {
|
|
|
9065
9130
|
<div class="__crossx-home-indicator"></div>
|
|
9066
9131
|
`;
|
|
9067
9132
|
}
|
|
9068
|
-
function
|
|
9133
|
+
function Ne(i) {
|
|
9069
9134
|
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">
|
|
9070
|
-
${
|
|
9135
|
+
${It}
|
|
9071
9136
|
<span id="__crossx-pin6-lock-countdown"></span>
|
|
9072
9137
|
</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" : "", _ = Array.from(
|
|
9073
9138
|
{ length: 6 },
|
|
@@ -9095,7 +9160,7 @@ function Ce(i) {
|
|
|
9095
9160
|
<div class="__crossx-pin6-numpad-row">
|
|
9096
9161
|
<button type="button" class="__crossx-pin6-numpad-key --empty" aria-hidden="true"></button>
|
|
9097
9162
|
<button type="button" class="__crossx-pin6-numpad-key${g}" data-key="0">0</button>
|
|
9098
|
-
<button type="button" class="__crossx-pin6-numpad-key --delete${g}" data-key="backspace" aria-label="Delete">${
|
|
9163
|
+
<button type="button" class="__crossx-pin6-numpad-key --delete${g}" data-key="backspace" aria-label="Delete">${Os}</button>
|
|
9099
9164
|
</div>
|
|
9100
9165
|
</div>`;
|
|
9101
9166
|
return `
|
|
@@ -9103,7 +9168,7 @@ function Ce(i) {
|
|
|
9103
9168
|
<span class="__crossx-pin6-sheet-handle" aria-hidden="true"></span>
|
|
9104
9169
|
<p class="__crossx-title" id="__crossx-ttl" style="padding-right:48px;">${w(i.title)}</p>
|
|
9105
9170
|
${t}
|
|
9106
|
-
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${
|
|
9171
|
+
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${U}</button>
|
|
9107
9172
|
</div>
|
|
9108
9173
|
<hr class="__crossx-divider">
|
|
9109
9174
|
<div class="__crossx-pin6-body"${r}>
|
|
@@ -9122,109 +9187,109 @@ function Ce(i) {
|
|
|
9122
9187
|
${f}
|
|
9123
9188
|
`;
|
|
9124
9189
|
}
|
|
9125
|
-
function
|
|
9190
|
+
function _t(i, e) {
|
|
9126
9191
|
const r = document.createElement("div");
|
|
9127
9192
|
return r.id = F, r.innerHTML = `
|
|
9128
|
-
<div class="__crossx-card __crossx-card--pin6" style="${
|
|
9193
|
+
<div class="__crossx-card __crossx-card--pin6" style="${G(i)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
9129
9194
|
${e}
|
|
9130
9195
|
</div>
|
|
9131
9196
|
`, r;
|
|
9132
9197
|
}
|
|
9133
|
-
function
|
|
9198
|
+
function Ps(i, e) {
|
|
9134
9199
|
if (i.length !== 6) return e.tooShort;
|
|
9135
9200
|
if (!/^\d+$/.test(i)) return e.numbersOnly;
|
|
9136
9201
|
if (/(.)\1{2}/.test(i)) return e.repeatingDigit;
|
|
9137
9202
|
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);
|
|
9138
9203
|
return t || s ? e.sequential : i[0] !== i[1] && i === i.slice(0, 2).repeat(3) ? e.alternatingPattern : null;
|
|
9139
9204
|
}
|
|
9140
|
-
function
|
|
9205
|
+
function Ns(i) {
|
|
9141
9206
|
const e = Math.max(0, Math.ceil(i / 1e3)), r = Math.floor(e / 3600), t = Math.floor(e % 3600 / 60), s = e % 60;
|
|
9142
9207
|
return r > 0 ? `${r}h ${String(t).padStart(2, "0")}m` : `${String(t).padStart(2, "0")}:${String(s).padStart(2, "0")}`;
|
|
9143
9208
|
}
|
|
9144
|
-
function
|
|
9145
|
-
var
|
|
9209
|
+
function Oe(i, e, r, t, s, o, n) {
|
|
9210
|
+
var qe, je;
|
|
9146
9211
|
let a = !!(o && o > Date.now()), l = !1;
|
|
9147
9212
|
const p = () => Array.from(i.querySelectorAll(".__crossx-pin6-box")), _ = () => i.querySelector("#__crossx-pin6-boxes"), u = () => i.querySelector("#__crossx-pin6-error"), x = () => i.querySelector("#__crossx-pin6-lock-msg"), g = () => i.querySelector("#__crossx-pin6-lock-countdown"), f = () => i.querySelector(".__crossx-pin6-body"), m = "●", y = (b, v) => {
|
|
9148
9213
|
b.dataset.digit = v, b.value = m;
|
|
9149
9214
|
}, S = (b) => {
|
|
9150
9215
|
delete b.dataset.digit, b.value = "";
|
|
9151
|
-
},
|
|
9216
|
+
}, A = (b) => b.dataset.digit ?? "", E = () => p().map(A).join(""), k = () => Array.from(i.querySelectorAll(".__crossx-pin6-dot")), T = () => {
|
|
9152
9217
|
var I;
|
|
9153
|
-
const b = p(), v =
|
|
9218
|
+
const b = p(), v = k();
|
|
9154
9219
|
if (v.length && (v.forEach((R, N) => {
|
|
9155
|
-
const $ = !!(b[N] &&
|
|
9220
|
+
const $ = !!(b[N] && A(b[N]));
|
|
9156
9221
|
R.classList.toggle("--filled", $), R.classList.toggle("--active", !1);
|
|
9157
9222
|
}), !a && !l)) {
|
|
9158
|
-
const R = b.findIndex(($) => !
|
|
9223
|
+
const R = b.findIndex(($) => !A($));
|
|
9159
9224
|
(I = v[R === -1 ? 5 : R]) == null || I.classList.add("--active");
|
|
9160
9225
|
}
|
|
9161
|
-
},
|
|
9162
|
-
i.querySelectorAll(".__crossx-pin6-numpad-key[data-key]").forEach((v) => v.classList.toggle("--disabled", a)),
|
|
9163
|
-
},
|
|
9226
|
+
}, C = () => {
|
|
9227
|
+
i.querySelectorAll(".__crossx-pin6-numpad-key[data-key]").forEach((v) => v.classList.toggle("--disabled", a)), k().forEach((v) => v.classList.toggle("--locked", a)), T();
|
|
9228
|
+
}, z = (b) => {
|
|
9164
9229
|
a = b, p().forEach((v) => {
|
|
9165
9230
|
v.disabled = b, v.classList.toggle("--locked", b);
|
|
9166
9231
|
});
|
|
9167
|
-
},
|
|
9232
|
+
}, M = () => i.querySelector("#__crossx-pin6-attempt"), H = () => {
|
|
9168
9233
|
const b = u();
|
|
9169
9234
|
b && (b.textContent = "");
|
|
9170
|
-
},
|
|
9235
|
+
}, O = () => n ?? "Your account will be locked after further failures.", P = () => i.querySelector("#__crossx-pin6-warning"), L = (b) => {
|
|
9171
9236
|
var I;
|
|
9172
|
-
let v =
|
|
9237
|
+
let v = P();
|
|
9173
9238
|
if (!v) {
|
|
9174
9239
|
v = document.createElement("p"), v.className = "__crossx-pin6-warning", v.id = "__crossx-pin6-warning";
|
|
9175
9240
|
const R = u();
|
|
9176
9241
|
R ? R.insertAdjacentElement("afterend", v) : (I = f()) == null || I.appendChild(v);
|
|
9177
9242
|
}
|
|
9178
9243
|
v.textContent = b;
|
|
9179
|
-
},
|
|
9180
|
-
const b =
|
|
9244
|
+
}, B = () => {
|
|
9245
|
+
const b = P();
|
|
9181
9246
|
b && (b.textContent = "");
|
|
9182
|
-
},
|
|
9247
|
+
}, ne = (b, v) => {
|
|
9183
9248
|
var R;
|
|
9184
|
-
let I =
|
|
9249
|
+
let I = M();
|
|
9185
9250
|
if (!I) {
|
|
9186
9251
|
I = document.createElement("p"), I.className = "__crossx-pin6-attempt", I.id = "__crossx-pin6-attempt";
|
|
9187
|
-
const N =
|
|
9252
|
+
const N = P() ?? u();
|
|
9188
9253
|
N ? N.insertAdjacentElement("afterend", I) : (R = f()) == null || R.appendChild(I);
|
|
9189
9254
|
}
|
|
9190
9255
|
I.textContent = `${b}/${v}`;
|
|
9191
|
-
},
|
|
9192
|
-
const b =
|
|
9256
|
+
}, he = () => {
|
|
9257
|
+
const b = M();
|
|
9193
9258
|
b && (b.textContent = "");
|
|
9194
|
-
},
|
|
9259
|
+
}, we = (b) => {
|
|
9195
9260
|
const v = u();
|
|
9196
9261
|
v && (v.textContent = b);
|
|
9197
9262
|
const I = _();
|
|
9198
9263
|
I == null || I.classList.add("--shake"), setTimeout(() => I == null ? void 0 : I.classList.remove("--shake"), 500), p().forEach(S), setTimeout(() => {
|
|
9199
9264
|
var R;
|
|
9200
|
-
(R = p()[0]) == null || R.focus(),
|
|
9265
|
+
(R = p()[0]) == null || R.focus(), T();
|
|
9201
9266
|
}, 50);
|
|
9202
|
-
},
|
|
9267
|
+
}, ae = (b) => {
|
|
9203
9268
|
var $;
|
|
9204
|
-
|
|
9269
|
+
z(!0), p().forEach(S), C();
|
|
9205
9270
|
const v = u();
|
|
9206
9271
|
if (v && (v.textContent = "Too many failed attempts. Please wait."), !x()) {
|
|
9207
|
-
const
|
|
9208
|
-
|
|
9209
|
-
const
|
|
9210
|
-
|
|
9272
|
+
const W = document.createElement("p");
|
|
9273
|
+
W.className = "__crossx-pin6-lock-msg", W.id = "__crossx-pin6-lock-msg", W.innerHTML = `${It}<span id="__crossx-pin6-lock-countdown"></span>`;
|
|
9274
|
+
const q = u();
|
|
9275
|
+
q ? q.insertAdjacentElement("afterend", W) : ($ = f()) == null || $.appendChild(W);
|
|
9211
9276
|
}
|
|
9212
9277
|
const I = () => {
|
|
9213
|
-
var
|
|
9214
|
-
const
|
|
9215
|
-
|
|
9216
|
-
var
|
|
9217
|
-
return (
|
|
9218
|
-
}, 50)) :
|
|
9278
|
+
var ee;
|
|
9279
|
+
const W = b - Date.now(), q = g();
|
|
9280
|
+
W <= 0 ? (clearInterval(R), z(!1), (ee = x()) == null || ee.remove(), v && (v.textContent = ""), C(), setTimeout(() => {
|
|
9281
|
+
var me;
|
|
9282
|
+
return (me = p()[0]) == null ? void 0 : me.focus();
|
|
9283
|
+
}, 50)) : q && (q.textContent = ` ${Ns(W)}`);
|
|
9219
9284
|
}, R = setInterval(I, 1e3);
|
|
9220
9285
|
I();
|
|
9221
9286
|
const N = new MutationObserver(() => {
|
|
9222
9287
|
document.contains(i) || (clearInterval(R), N.disconnect());
|
|
9223
9288
|
});
|
|
9224
9289
|
N.observe(document.body, { childList: !0, subtree: !1 });
|
|
9225
|
-
},
|
|
9290
|
+
}, ce = async () => {
|
|
9226
9291
|
if (a || l) return;
|
|
9227
|
-
const b =
|
|
9292
|
+
const b = E();
|
|
9228
9293
|
if (b.length === 6) {
|
|
9229
9294
|
l = !0, p().forEach((v) => {
|
|
9230
9295
|
v.disabled = !0;
|
|
@@ -9232,7 +9297,7 @@ function Pe(i, e, r, t, s, o, n) {
|
|
|
9232
9297
|
try {
|
|
9233
9298
|
if (s) {
|
|
9234
9299
|
const v = await s(b);
|
|
9235
|
-
v.ok ? e(b) : v.lockExpiresAt ? (
|
|
9300
|
+
v.ok ? e(b) : v.lockExpiresAt ? (he(), ae(v.lockExpiresAt)) : (we(v.error ?? "Incorrect PIN. Please try again."), v.attemptCount != null && v.maxAttempts != null ? (L(O()), ne(v.attemptCount, v.maxAttempts)) : (B(), he()));
|
|
9236
9301
|
} else
|
|
9237
9302
|
e(b);
|
|
9238
9303
|
} catch (v) {
|
|
@@ -9240,49 +9305,49 @@ function Pe(i, e, r, t, s, o, n) {
|
|
|
9240
9305
|
} finally {
|
|
9241
9306
|
l = !1, a || p().forEach((v) => {
|
|
9242
9307
|
v.disabled = !1;
|
|
9243
|
-
}),
|
|
9308
|
+
}), T();
|
|
9244
9309
|
}
|
|
9245
9310
|
}
|
|
9246
9311
|
};
|
|
9247
|
-
o && o > Date.now() ?
|
|
9312
|
+
o && o > Date.now() ? ae(o) : setTimeout(() => {
|
|
9248
9313
|
var b;
|
|
9249
9314
|
return (b = p()[0]) == null ? void 0 : b.focus();
|
|
9250
9315
|
}, 100);
|
|
9251
|
-
const
|
|
9316
|
+
const le = () => {
|
|
9252
9317
|
if (a || l) return;
|
|
9253
|
-
const b = p(), v = b.find((I) => !
|
|
9318
|
+
const b = p(), v = b.find((I) => !A(I)) ?? b[b.length - 1];
|
|
9254
9319
|
v == null || v.focus();
|
|
9255
9320
|
};
|
|
9256
|
-
(
|
|
9257
|
-
b.target.classList.contains("__crossx-pin6-box") ||
|
|
9258
|
-
}), (
|
|
9321
|
+
(qe = _()) == null || qe.addEventListener("click", (b) => {
|
|
9322
|
+
b.target.classList.contains("__crossx-pin6-box") || le();
|
|
9323
|
+
}), (je = f()) == null || je.addEventListener("click", (b) => {
|
|
9259
9324
|
const v = b.target;
|
|
9260
|
-
v.classList.contains("__crossx-pin6-box") || v.closest("button") ||
|
|
9325
|
+
v.classList.contains("__crossx-pin6-box") || v.closest("button") || le();
|
|
9261
9326
|
}), p().forEach((b, v) => {
|
|
9262
9327
|
b.addEventListener("input", () => {
|
|
9263
9328
|
var R;
|
|
9264
9329
|
const I = b.value.replace(/\D/g, "").slice(-1);
|
|
9265
|
-
I ? y(b, I) : S(b),
|
|
9330
|
+
I ? y(b, I) : S(b), H(), I && v < 5 && ((R = p()[v + 1]) == null || R.focus()), T(), E().length === 6 && setTimeout(ce, 80);
|
|
9266
9331
|
}), b.addEventListener("keydown", (I) => {
|
|
9267
9332
|
var R, N;
|
|
9268
9333
|
if (I.key === "Backspace") {
|
|
9269
|
-
if (I.preventDefault(),
|
|
9334
|
+
if (I.preventDefault(), A(b))
|
|
9270
9335
|
S(b);
|
|
9271
9336
|
else if (v > 0) {
|
|
9272
9337
|
const $ = p()[v - 1];
|
|
9273
9338
|
S($), $.focus();
|
|
9274
9339
|
}
|
|
9275
|
-
|
|
9340
|
+
T();
|
|
9276
9341
|
} else I.key === "ArrowLeft" && v > 0 ? (I.preventDefault(), (R = p()[v - 1]) == null || R.focus()) : I.key === "ArrowRight" && v < 5 ? (I.preventDefault(), (N = p()[v + 1]) == null || N.focus()) : I.key === "Escape" && r();
|
|
9277
9342
|
}), b.addEventListener("paste", (I) => {
|
|
9278
|
-
var $,
|
|
9343
|
+
var $, W;
|
|
9279
9344
|
I.preventDefault();
|
|
9280
9345
|
const R = ((($ = I.clipboardData) == null ? void 0 : $.getData("text")) ?? "").replace(/\D/g, "").slice(0, 6);
|
|
9281
9346
|
if (!R) return;
|
|
9282
9347
|
const N = p();
|
|
9283
|
-
R.split("").forEach((
|
|
9284
|
-
N[
|
|
9285
|
-
}), (
|
|
9348
|
+
R.split("").forEach((q, ee) => {
|
|
9349
|
+
N[ee] && y(N[ee], q);
|
|
9350
|
+
}), (W = N[Math.min(R.length - 1, 5)]) == null || W.focus(), H(), T(), E().length === 6 && setTimeout(ce, 80);
|
|
9286
9351
|
}), b.addEventListener("focus", () => b.select());
|
|
9287
9352
|
});
|
|
9288
9353
|
const ue = i.querySelector("#__crossx-pin6-numpad");
|
|
@@ -9299,13 +9364,13 @@ function Pe(i, e, r, t, s, o, n) {
|
|
|
9299
9364
|
const N = R.dataset.key;
|
|
9300
9365
|
if (!N) return;
|
|
9301
9366
|
if (N === "backspace") {
|
|
9302
|
-
const
|
|
9303
|
-
|
|
9367
|
+
const ee = [...p()].reverse().find((me) => A(me));
|
|
9368
|
+
ee && (S(ee), H()), T();
|
|
9304
9369
|
return;
|
|
9305
9370
|
}
|
|
9306
9371
|
if (!/^\d$/.test(N)) return;
|
|
9307
|
-
const
|
|
9308
|
-
|
|
9372
|
+
const W = p().find((q) => !A(q));
|
|
9373
|
+
W && (y(W, N), H(), T(), E().length === 6 && setTimeout(ce, 80));
|
|
9309
9374
|
};
|
|
9310
9375
|
ue.addEventListener("pointerup", (R) => {
|
|
9311
9376
|
if (!b) return;
|
|
@@ -9313,21 +9378,21 @@ function Pe(i, e, r, t, s, o, n) {
|
|
|
9313
9378
|
v();
|
|
9314
9379
|
const $ = N.getBoundingClientRect();
|
|
9315
9380
|
R.clientX >= $.left && R.clientX <= $.right && R.clientY >= $.top && R.clientY <= $.bottom && !a && !l && I(N);
|
|
9316
|
-
}), ue.addEventListener("pointercancel", v), ue.addEventListener("pointerleave", v, !0),
|
|
9381
|
+
}), ue.addEventListener("pointercancel", v), ue.addEventListener("pointerleave", v, !0), T(), o && o > Date.now() && C();
|
|
9317
9382
|
}
|
|
9318
9383
|
}
|
|
9319
|
-
const
|
|
9384
|
+
const Os = `<svg width="22" height="17" viewBox="0 0 22 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
9320
9385
|
<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"/>
|
|
9321
9386
|
<line x1="10" y1="5.5" x2="16" y2="11.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
|
9322
9387
|
<line x1="16" y1="5.5" x2="10" y2="11.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
|
9323
|
-
</svg>`,
|
|
9388
|
+
</svg>`, It = `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
9324
9389
|
<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"/>
|
|
9325
|
-
</svg>`,
|
|
9390
|
+
</svg>`, Ls = `<svg width="11" height="9" viewBox="0 0 11 9" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
9326
9391
|
<path d="M1 4.5L4 7.5L10 1" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
9327
|
-
</svg>`,
|
|
9392
|
+
</svg>`, Ds = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
9328
9393
|
<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"/>
|
|
9329
9394
|
</svg>`;
|
|
9330
|
-
function
|
|
9395
|
+
function Ms(i, e, r) {
|
|
9331
9396
|
var o;
|
|
9332
9397
|
const t = i.querySelectorAll(".__crossx-pin-input");
|
|
9333
9398
|
t.forEach((n, a) => {
|
|
@@ -9360,9 +9425,9 @@ function Cs(i, e, r) {
|
|
|
9360
9425
|
}
|
|
9361
9426
|
}), (o = t[0]) == null || o.focus();
|
|
9362
9427
|
}
|
|
9363
|
-
class
|
|
9364
|
-
constructor(e = "light", r, t =
|
|
9365
|
-
this.theme = e, this.overrides = r, this.tokens =
|
|
9428
|
+
class $s {
|
|
9429
|
+
constructor(e = "light", r, t = We, s) {
|
|
9430
|
+
this.theme = e, this.overrides = r, this.tokens = dt(e, r), this.displayDecimals = t, this.pinKeyboard = s, Hr();
|
|
9366
9431
|
}
|
|
9367
9432
|
setPinKeyboard(e) {
|
|
9368
9433
|
this.pinKeyboard = e;
|
|
@@ -9382,7 +9447,7 @@ class Ps {
|
|
|
9382
9447
|
e && e.classList.toggle("--native-keypad", this.resolvePinKeyboardMode() === "native");
|
|
9383
9448
|
}
|
|
9384
9449
|
setTheme(e, r) {
|
|
9385
|
-
this.theme = e, r !== void 0 && (this.overrides = r), this.tokens =
|
|
9450
|
+
this.theme = e, r !== void 0 && (this.overrides = r), this.tokens = dt(e, this.overrides);
|
|
9386
9451
|
}
|
|
9387
9452
|
setMessages(e) {
|
|
9388
9453
|
this.messages = e;
|
|
@@ -9403,25 +9468,25 @@ class Ps {
|
|
|
9403
9468
|
*/
|
|
9404
9469
|
showWalletSelector(e, r, t) {
|
|
9405
9470
|
return new Promise((s, o) => {
|
|
9406
|
-
var
|
|
9471
|
+
var A;
|
|
9407
9472
|
K();
|
|
9408
|
-
const n = [...e], a =
|
|
9409
|
-
|
|
9473
|
+
const n = [...e], a = ws(n, this.tokens, t, this.messages), l = re();
|
|
9474
|
+
V(a);
|
|
9410
9475
|
let p = !1;
|
|
9411
9476
|
const _ = () => {
|
|
9412
9477
|
p || (p = !0, a.remove(), l());
|
|
9413
9478
|
};
|
|
9414
9479
|
let u = null;
|
|
9415
|
-
const x = (
|
|
9416
|
-
_(), s(
|
|
9480
|
+
const x = (E) => {
|
|
9481
|
+
_(), s(E);
|
|
9417
9482
|
}, g = () => {
|
|
9418
9483
|
_(), u ? o(u) : s(null);
|
|
9419
9484
|
};
|
|
9420
9485
|
(() => {
|
|
9421
|
-
a.querySelectorAll(".__crossx-wallet-item").forEach((
|
|
9422
|
-
|
|
9423
|
-
const
|
|
9424
|
-
x({ address:
|
|
9486
|
+
a.querySelectorAll(".__crossx-wallet-item").forEach((E) => {
|
|
9487
|
+
E.addEventListener("click", () => {
|
|
9488
|
+
const k = E.dataset.walletAddress ?? "", T = parseInt(E.dataset.walletIndex ?? "0", 10), C = n.find((z) => z.index === T);
|
|
9489
|
+
x({ address: k, index: T, name: C == null ? void 0 : C.name });
|
|
9425
9490
|
});
|
|
9426
9491
|
});
|
|
9427
9492
|
})();
|
|
@@ -9429,27 +9494,27 @@ class Ps {
|
|
|
9429
9494
|
y && y.addEventListener("click", async () => {
|
|
9430
9495
|
y.disabled = !0, m && (m.hidden = !0, m.textContent = "");
|
|
9431
9496
|
try {
|
|
9432
|
-
const
|
|
9433
|
-
n.push(
|
|
9434
|
-
const
|
|
9435
|
-
if (
|
|
9436
|
-
const
|
|
9437
|
-
|
|
9497
|
+
const E = await r();
|
|
9498
|
+
n.push(E);
|
|
9499
|
+
const k = a.querySelector("#__crossx-wallet-list");
|
|
9500
|
+
if (k) {
|
|
9501
|
+
const T = document.createElement("button");
|
|
9502
|
+
T.className = "__crossx-wallet-item", T.dataset.walletIndex = String(E.index), T.dataset.walletAddress = E.address, T.innerHTML = `${At(E.address, E.index, this.tokens.bg)}<span class="__crossx-wallet-info"><span class="__crossx-wallet-idx">${w(Et(E))}</span><span class="__crossx-wallet-addr">${gt(E.address)}</span></span>`, T.addEventListener("click", () => x(E)), k.appendChild(T);
|
|
9438
9503
|
try {
|
|
9439
|
-
|
|
9504
|
+
T.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
9440
9505
|
} catch {
|
|
9441
9506
|
}
|
|
9442
9507
|
}
|
|
9443
9508
|
y.disabled = !1;
|
|
9444
|
-
} catch (
|
|
9445
|
-
const
|
|
9446
|
-
m && (m.textContent =
|
|
9509
|
+
} catch (E) {
|
|
9510
|
+
const k = E instanceof h && E.code === d.ADDRESS_LIMIT_EXCEEDED, T = this.resolveAddWalletErrorMessage(E);
|
|
9511
|
+
m && (m.textContent = T, m.hidden = !1), k ? (y.disabled = !0, y.setAttribute("aria-disabled", "true")) : y.disabled = !1, u = E;
|
|
9447
9512
|
}
|
|
9448
|
-
}), (
|
|
9449
|
-
|
|
9513
|
+
}), (A = a.querySelector("#__crossx-close-btn")) == null || A.addEventListener("click", g), a.addEventListener("click", (E) => {
|
|
9514
|
+
E.target === a && g();
|
|
9450
9515
|
});
|
|
9451
|
-
const S = (
|
|
9452
|
-
|
|
9516
|
+
const S = (E) => {
|
|
9517
|
+
E.key === "Escape" && (document.removeEventListener("keydown", S), g());
|
|
9453
9518
|
};
|
|
9454
9519
|
document.addEventListener("keydown", S);
|
|
9455
9520
|
});
|
|
@@ -9458,8 +9523,8 @@ class Ps {
|
|
|
9458
9523
|
return new Promise((e) => {
|
|
9459
9524
|
var a, l;
|
|
9460
9525
|
K();
|
|
9461
|
-
const r =
|
|
9462
|
-
|
|
9526
|
+
const r = ms(this.tokens, this.messages), t = re();
|
|
9527
|
+
V(r);
|
|
9463
9528
|
let s = !1, o = null;
|
|
9464
9529
|
const n = () => {
|
|
9465
9530
|
s || (s = !0, o && document.removeEventListener("keydown", o), r.remove(), t(), e());
|
|
@@ -9481,7 +9546,7 @@ class Ps {
|
|
|
9481
9546
|
resolveAddWalletErrorMessage(e) {
|
|
9482
9547
|
const r = this.messages;
|
|
9483
9548
|
if (e instanceof h && e.code === d.ADDRESS_LIMIT_EXCEEDED) {
|
|
9484
|
-
const s = e.details, o = typeof (s == null ? void 0 : s.limit) == "number" ? s.limit :
|
|
9549
|
+
const s = e.details, o = typeof (s == null ? void 0 : s.limit) == "number" ? s.limit : Le;
|
|
9485
9550
|
return ((r == null ? void 0 : r.wallet_selector_add_error_limit_exceeded) ?? "Account limit reached. Maximum {limit} accounts allowed.").replace("{limit}", String(o));
|
|
9486
9551
|
}
|
|
9487
9552
|
return (r == null ? void 0 : r.wallet_selector_add_error_generic) ?? "Failed to add a new account. Please try again.";
|
|
@@ -9499,8 +9564,8 @@ class Ps {
|
|
|
9499
9564
|
return new Promise((s) => {
|
|
9500
9565
|
var x, g, f, m;
|
|
9501
9566
|
K();
|
|
9502
|
-
const o =
|
|
9503
|
-
|
|
9567
|
+
const o = Es(this.tokens, r, this.messages), n = re();
|
|
9568
|
+
V(o);
|
|
9504
9569
|
const a = () => {
|
|
9505
9570
|
o.remove(), n();
|
|
9506
9571
|
}, l = (y) => {
|
|
@@ -9511,8 +9576,8 @@ class Ps {
|
|
|
9511
9576
|
a(), s(null);
|
|
9512
9577
|
};
|
|
9513
9578
|
(x = o.querySelector("#__crossx-apple-btn")) == null || x.addEventListener("click", () => l("apple")), (g = o.querySelector("#__crossx-google-btn")) == null || g.addEventListener("click", () => l("google")), (f = o.querySelector("#__crossx-connect-other-wallet-btn")) == null || f.addEventListener("click", (y) => {
|
|
9514
|
-
const
|
|
9515
|
-
|
|
9579
|
+
const A = y.currentTarget.dataset.walletId ?? "";
|
|
9580
|
+
A && p(A);
|
|
9516
9581
|
}), (m = o.querySelector("#__crossx-close-btn")) == null || m.addEventListener("click", _), o.addEventListener("click", (y) => {
|
|
9517
9582
|
y.target === o && _();
|
|
9518
9583
|
}), o.querySelectorAll(".__crossx-login-terms-link").forEach((y) => {
|
|
@@ -9528,15 +9593,15 @@ class Ps {
|
|
|
9528
9593
|
return new Promise((r) => {
|
|
9529
9594
|
var _, u, x;
|
|
9530
9595
|
K();
|
|
9531
|
-
const t = this.messages, s =
|
|
9596
|
+
const t = this.messages, s = As(this.tokens, {
|
|
9532
9597
|
title: e.title,
|
|
9533
9598
|
message: e.message,
|
|
9534
9599
|
email: e.email,
|
|
9535
9600
|
accountLabel: (t == null ? void 0 : t.session_alert_account_label) ?? "Account",
|
|
9536
9601
|
signOutLabel: (t == null ? void 0 : t.session_alert_sign_out_button) ?? "Sign out",
|
|
9537
9602
|
signInAgainLabel: (t == null ? void 0 : t.session_alert_sign_in_again_button) ?? "Sign in again"
|
|
9538
|
-
}), o =
|
|
9539
|
-
|
|
9603
|
+
}), o = re();
|
|
9604
|
+
V(s);
|
|
9540
9605
|
let n = !1;
|
|
9541
9606
|
const a = () => {
|
|
9542
9607
|
n || (n = !0, s.remove(), o());
|
|
@@ -9558,8 +9623,8 @@ class Ps {
|
|
|
9558
9623
|
return new Promise((t) => {
|
|
9559
9624
|
var a, l, p;
|
|
9560
9625
|
K();
|
|
9561
|
-
const s =
|
|
9562
|
-
|
|
9626
|
+
const s = Is(this.tokens, r);
|
|
9627
|
+
V(s);
|
|
9563
9628
|
const o = () => s.remove(), n = () => {
|
|
9564
9629
|
o(), t("recover");
|
|
9565
9630
|
};
|
|
@@ -9605,13 +9670,13 @@ class Ps {
|
|
|
9605
9670
|
title: (t == null ? void 0 : t.pin_setup_confirm_title) ?? "Confirm PIN",
|
|
9606
9671
|
headerSubtitle: (t == null ? void 0 : t.pin_setup_header_subtitle) ?? "This PIN is used to authorize your transactions.",
|
|
9607
9672
|
subtitle: (t == null ? void 0 : t.pin_setup_confirm_subtitle) ?? "Confirm your 6-digit PIN"
|
|
9608
|
-
}, a =
|
|
9609
|
-
|
|
9673
|
+
}, a = _t(this.tokens, Cs(s)), l = re();
|
|
9674
|
+
V(a);
|
|
9610
9675
|
let p = !1;
|
|
9611
9676
|
const _ = () => {
|
|
9612
9677
|
p || (p = !0, a.remove(), l());
|
|
9613
|
-
}, u = (
|
|
9614
|
-
_(), r(
|
|
9678
|
+
}, u = (A) => {
|
|
9679
|
+
_(), r(A);
|
|
9615
9680
|
}, x = () => {
|
|
9616
9681
|
_(), r(null);
|
|
9617
9682
|
}, g = a.querySelector(".__crossx-card"), f = {
|
|
@@ -9620,67 +9685,67 @@ class Ps {
|
|
|
9620
9685
|
repeatingDigit: (t == null ? void 0 : t.pin_validation_repeating_digit) ?? "Cannot use the same number 3+ times in a row.",
|
|
9621
9686
|
sequential: (t == null ? void 0 : t.pin_validation_sequential) ?? "Sequential numbers (e.g., 123456) are not allowed.",
|
|
9622
9687
|
alternatingPattern: (t == null ? void 0 : t.pin_validation_alternating_pattern) ?? "Repeating patterns (e.g., 121212) are not allowed."
|
|
9623
|
-
}, m = (
|
|
9624
|
-
var
|
|
9625
|
-
g.innerHTML =
|
|
9688
|
+
}, m = (A) => {
|
|
9689
|
+
var E;
|
|
9690
|
+
g.innerHTML = Ne({
|
|
9626
9691
|
title: n.title,
|
|
9627
9692
|
headerSubtitle: n.headerSubtitle,
|
|
9628
9693
|
subtitle: n.subtitle
|
|
9629
|
-
}), this.applyPinKeyboardMode(g), (
|
|
9630
|
-
|
|
9694
|
+
}), this.applyPinKeyboardMode(g), (E = g.querySelector("#__crossx-close-btn")) == null || E.addEventListener("click", x), Oe(g, (k) => {
|
|
9695
|
+
k === A ? u(A) : y(o.mismatchError);
|
|
9631
9696
|
}, x);
|
|
9632
|
-
}, y = (
|
|
9633
|
-
var
|
|
9634
|
-
g.innerHTML =
|
|
9697
|
+
}, y = (A) => {
|
|
9698
|
+
var E;
|
|
9699
|
+
g.innerHTML = Ne({
|
|
9635
9700
|
title: o.title,
|
|
9636
9701
|
headerSubtitle: o.headerSubtitle,
|
|
9637
9702
|
subtitle: o.subtitle,
|
|
9638
|
-
errorMessage:
|
|
9639
|
-
}), this.applyPinKeyboardMode(g), (
|
|
9640
|
-
const
|
|
9641
|
-
|
|
9703
|
+
errorMessage: A
|
|
9704
|
+
}), this.applyPinKeyboardMode(g), (E = g.querySelector("#__crossx-close-btn")) == null || E.addEventListener("click", x), Oe(g, (k) => {
|
|
9705
|
+
const T = Ps(k, f);
|
|
9706
|
+
T ? y(T) : m(k);
|
|
9642
9707
|
}, x);
|
|
9643
9708
|
};
|
|
9644
9709
|
(() => {
|
|
9645
|
-
var
|
|
9646
|
-
const
|
|
9647
|
-
|
|
9648
|
-
const
|
|
9649
|
-
const
|
|
9650
|
-
|
|
9651
|
-
},
|
|
9652
|
-
if (
|
|
9653
|
-
const
|
|
9654
|
-
|
|
9655
|
-
},
|
|
9656
|
-
if (!
|
|
9657
|
-
const
|
|
9658
|
-
|
|
9710
|
+
var O;
|
|
9711
|
+
const A = Array.from(g.querySelectorAll(".__crossx-pw-notice-item")), E = g.querySelector("#__crossx-pin-notice-next"), k = /* @__PURE__ */ new Set();
|
|
9712
|
+
E.removeAttribute("disabled");
|
|
9713
|
+
const T = E.dataset.nextLabel ?? "Next", C = E.dataset.submitLabel ?? "I Understand", z = () => {
|
|
9714
|
+
const P = k.size === A.length;
|
|
9715
|
+
E.classList.toggle("--disabled", !P), E.textContent = C || T;
|
|
9716
|
+
}, M = (P, L) => {
|
|
9717
|
+
if (k.has(L)) return;
|
|
9718
|
+
const B = P.querySelector(`#__crossx-notice-check-${L}`);
|
|
9719
|
+
k.add(L), B.classList.add("--checked"), P.setAttribute("aria-checked", "true"), z();
|
|
9720
|
+
}, H = (P, L) => {
|
|
9721
|
+
if (!k.has(L)) return;
|
|
9722
|
+
const B = P.querySelector(`#__crossx-notice-check-${L}`);
|
|
9723
|
+
k.delete(L), B.classList.remove("--checked"), P.setAttribute("aria-checked", "false"), z();
|
|
9659
9724
|
};
|
|
9660
|
-
|
|
9661
|
-
const L = parseInt(
|
|
9662
|
-
|
|
9663
|
-
|
|
9664
|
-
}),
|
|
9665
|
-
(
|
|
9725
|
+
A.forEach((P) => {
|
|
9726
|
+
const L = parseInt(P.dataset.checkIndex ?? "0", 10);
|
|
9727
|
+
P.addEventListener("click", () => {
|
|
9728
|
+
k.has(L) ? H(P, L) : M(P, L);
|
|
9729
|
+
}), P.addEventListener("keydown", (B) => {
|
|
9730
|
+
(B.key === " " || B.key === "Enter") && (B.preventDefault(), k.has(L) ? H(P, L) : M(P, L));
|
|
9666
9731
|
});
|
|
9667
|
-
}),
|
|
9668
|
-
if (
|
|
9732
|
+
}), E.addEventListener("click", () => {
|
|
9733
|
+
if (k.size === A.length) {
|
|
9669
9734
|
y(e == null ? void 0 : e.errorMessage);
|
|
9670
9735
|
return;
|
|
9671
9736
|
}
|
|
9672
|
-
const
|
|
9673
|
-
const
|
|
9674
|
-
return !
|
|
9737
|
+
const P = A.find((B) => {
|
|
9738
|
+
const ne = parseInt(B.dataset.checkIndex ?? "0", 10);
|
|
9739
|
+
return !k.has(ne);
|
|
9675
9740
|
});
|
|
9676
|
-
if (!
|
|
9677
|
-
const L = parseInt(
|
|
9678
|
-
|
|
9679
|
-
|
|
9741
|
+
if (!P) return;
|
|
9742
|
+
const L = parseInt(P.dataset.checkIndex ?? "0", 10);
|
|
9743
|
+
P.scrollIntoView({ behavior: "smooth", block: "nearest" }), P.classList.add("--highlight"), setTimeout(() => {
|
|
9744
|
+
P.classList.remove("--highlight"), M(P, L);
|
|
9680
9745
|
}, 400);
|
|
9681
|
-
}), (
|
|
9682
|
-
})(), a.addEventListener("click", (
|
|
9683
|
-
|
|
9746
|
+
}), (O = g.querySelector("#__crossx-close-btn")) == null || O.addEventListener("click", x);
|
|
9747
|
+
})(), a.addEventListener("click", (A) => {
|
|
9748
|
+
A.target === a && x();
|
|
9684
9749
|
});
|
|
9685
9750
|
});
|
|
9686
9751
|
}
|
|
@@ -9693,9 +9758,9 @@ class Ps {
|
|
|
9693
9758
|
return new Promise((r, t) => {
|
|
9694
9759
|
var S;
|
|
9695
9760
|
K();
|
|
9696
|
-
const s = this.messages, o = (e == null ? void 0 : e.verifyMode) === !0, n = o ? (s == null ? void 0 : s.verify_pin_title) ?? "Verify Your PIN" : (s == null ? void 0 : s.pin_input_title) ?? "Enter PIN", a = o ? (s == null ? void 0 : s.verify_pin_subtitle) ?? "Enter your PIN to authorize this transaction." : (s == null ? void 0 : s.pin_input_subtitle) ?? "Enter your 6-digit PIN to continue.", l = (s == null ? void 0 : s.pin_locked_failure_warning) ?? "Your account will be locked after further failures.", p =
|
|
9761
|
+
const s = this.messages, o = (e == null ? void 0 : e.verifyMode) === !0, n = o ? (s == null ? void 0 : s.verify_pin_title) ?? "Verify Your PIN" : (s == null ? void 0 : s.pin_input_title) ?? "Enter PIN", a = o ? (s == null ? void 0 : s.verify_pin_subtitle) ?? "Enter your PIN to authorize this transaction." : (s == null ? void 0 : s.pin_input_subtitle) ?? "Enter your 6-digit PIN to continue.", l = (s == null ? void 0 : s.pin_locked_failure_warning) ?? "Your account will be locked after further failures.", p = _t(
|
|
9697
9762
|
this.tokens,
|
|
9698
|
-
|
|
9763
|
+
Ne({
|
|
9699
9764
|
title: n,
|
|
9700
9765
|
headerSubtitle: a,
|
|
9701
9766
|
errorMessage: e == null ? void 0 : e.errorMessage,
|
|
@@ -9704,20 +9769,20 @@ class Ps {
|
|
|
9704
9769
|
attemptCount: e == null ? void 0 : e.attemptCount,
|
|
9705
9770
|
maxAttempts: e == null ? void 0 : e.maxAttempts
|
|
9706
9771
|
})
|
|
9707
|
-
), _ =
|
|
9708
|
-
|
|
9772
|
+
), _ = re();
|
|
9773
|
+
V(p);
|
|
9709
9774
|
let u = !1;
|
|
9710
9775
|
const x = () => {
|
|
9711
9776
|
u || (u = !0, p.remove(), _());
|
|
9712
|
-
}, g = (
|
|
9713
|
-
x(), r(
|
|
9777
|
+
}, g = (A) => {
|
|
9778
|
+
x(), r(A);
|
|
9714
9779
|
}, f = () => {
|
|
9715
9780
|
x(), r(null);
|
|
9716
|
-
}, m = (
|
|
9717
|
-
x(), t(
|
|
9781
|
+
}, m = (A) => {
|
|
9782
|
+
x(), t(A);
|
|
9718
9783
|
}, y = p.querySelector(".__crossx-card");
|
|
9719
|
-
this.applyPinKeyboardMode(y), (S = y.querySelector("#__crossx-close-btn")) == null || S.addEventListener("click", f),
|
|
9720
|
-
|
|
9784
|
+
this.applyPinKeyboardMode(y), (S = y.querySelector("#__crossx-close-btn")) == null || S.addEventListener("click", f), Oe(y, g, f, m, e == null ? void 0 : e.onSubmit, e == null ? void 0 : e.lockExpiresAt, l), p.addEventListener("click", (A) => {
|
|
9785
|
+
A.target === p && f();
|
|
9721
9786
|
});
|
|
9722
9787
|
});
|
|
9723
9788
|
}
|
|
@@ -9732,14 +9797,14 @@ class Ps {
|
|
|
9732
9797
|
return new Promise((r) => {
|
|
9733
9798
|
var l;
|
|
9734
9799
|
K();
|
|
9735
|
-
const t =
|
|
9736
|
-
|
|
9800
|
+
const t = ks(this.tokens, e);
|
|
9801
|
+
V(t);
|
|
9737
9802
|
const s = () => t.remove(), o = (p) => {
|
|
9738
9803
|
s(), r(p);
|
|
9739
9804
|
}, n = () => {
|
|
9740
9805
|
s(), r(null);
|
|
9741
9806
|
}, a = t.querySelector(".__crossx-card");
|
|
9742
|
-
a && this.applyPinKeyboardMode(a),
|
|
9807
|
+
a && this.applyPinKeyboardMode(a), Ms(t, o, n), (l = t.querySelector("#__crossx-close-btn")) == null || l.addEventListener("click", n), t.addEventListener("click", (p) => {
|
|
9743
9808
|
p.target === t && n();
|
|
9744
9809
|
});
|
|
9745
9810
|
});
|
|
@@ -9754,8 +9819,8 @@ class Ps {
|
|
|
9754
9819
|
return new Promise((t) => {
|
|
9755
9820
|
var p;
|
|
9756
9821
|
K();
|
|
9757
|
-
const { overlay: s, startCountdown: o } =
|
|
9758
|
-
|
|
9822
|
+
const { overlay: s, startCountdown: o } = Rs(this.tokens, e, r);
|
|
9823
|
+
V(s);
|
|
9759
9824
|
const n = () => {
|
|
9760
9825
|
l(), s.remove();
|
|
9761
9826
|
}, a = () => {
|
|
@@ -9774,8 +9839,8 @@ class Ps {
|
|
|
9774
9839
|
return new Promise((r) => {
|
|
9775
9840
|
var a, l;
|
|
9776
9841
|
K();
|
|
9777
|
-
const t =
|
|
9778
|
-
|
|
9842
|
+
const t = cs(e, this.tokens, this.messages);
|
|
9843
|
+
V(t);
|
|
9779
9844
|
const s = () => t.remove(), o = () => {
|
|
9780
9845
|
s(), r();
|
|
9781
9846
|
};
|
|
@@ -9803,8 +9868,8 @@ class Ps {
|
|
|
9803
9868
|
showTransactionProgress(e, r) {
|
|
9804
9869
|
return new Promise((t) => {
|
|
9805
9870
|
K();
|
|
9806
|
-
const s =
|
|
9807
|
-
|
|
9871
|
+
const s = ls(e, this.tokens, this.messages);
|
|
9872
|
+
V(s);
|
|
9808
9873
|
const o = () => s.remove();
|
|
9809
9874
|
let n = !1;
|
|
9810
9875
|
const a = () => {
|
|
@@ -9820,7 +9885,7 @@ class Ps {
|
|
|
9820
9885
|
document.addEventListener("keydown", p);
|
|
9821
9886
|
};
|
|
9822
9887
|
r.then((p) => {
|
|
9823
|
-
n || (
|
|
9888
|
+
n || (ds(s, p, this.tokens, this.messages), l());
|
|
9824
9889
|
});
|
|
9825
9890
|
});
|
|
9826
9891
|
}
|
|
@@ -9829,9 +9894,9 @@ class Ps {
|
|
|
9829
9894
|
var p, _, u;
|
|
9830
9895
|
K();
|
|
9831
9896
|
let t;
|
|
9832
|
-
e.type === "sign-message" ? t =
|
|
9833
|
-
const s =
|
|
9834
|
-
|
|
9897
|
+
e.type === "sign-message" ? t = ps(e, this.tokens, this.messages) : e.type === "sign-typed-data" ? t = _s(e, this.tokens, this.messages) : e.type === "sign" ? t = Qr(e, this.tokens, this.displayDecimals, this.messages) : t = rs(e, this.tokens, this.displayDecimals, this.messages);
|
|
9898
|
+
const s = re();
|
|
9899
|
+
V(t);
|
|
9835
9900
|
const o = () => {
|
|
9836
9901
|
t.remove(), s();
|
|
9837
9902
|
}, n = () => {
|
|
@@ -9847,7 +9912,7 @@ class Ps {
|
|
|
9847
9912
|
f && ((m = navigator.clipboard) == null || m.writeText(f).catch(() => {
|
|
9848
9913
|
}));
|
|
9849
9914
|
});
|
|
9850
|
-
}),
|
|
9915
|
+
}), Wr(t), t.addEventListener("click", (x) => {
|
|
9851
9916
|
x.target === t && a();
|
|
9852
9917
|
});
|
|
9853
9918
|
const l = (x) => {
|
|
@@ -9857,7 +9922,7 @@ class Ps {
|
|
|
9857
9922
|
});
|
|
9858
9923
|
}
|
|
9859
9924
|
}
|
|
9860
|
-
class
|
|
9925
|
+
class Fs {
|
|
9861
9926
|
constructor(e, r, t, s = () => !1) {
|
|
9862
9927
|
this.browserConfirmation = e, this.getBridge = r, this.getOrigin = t, this.isAuthenticatedViaRNBridge = s;
|
|
9863
9928
|
}
|
|
@@ -10027,7 +10092,7 @@ class Ns {
|
|
|
10027
10092
|
(t = (r = this.browserConfirmation).setPinKeyboard) == null || t.call(r, e);
|
|
10028
10093
|
}
|
|
10029
10094
|
}
|
|
10030
|
-
class
|
|
10095
|
+
class Bs {
|
|
10031
10096
|
constructor() {
|
|
10032
10097
|
this._accessToken = null, this._expiresAt = 0;
|
|
10033
10098
|
}
|
|
@@ -10059,7 +10124,7 @@ class Os {
|
|
|
10059
10124
|
return !this._accessToken || this._expiresAt <= 0 ? !0 : Date.now() >= this._expiresAt - e;
|
|
10060
10125
|
}
|
|
10061
10126
|
}
|
|
10062
|
-
function
|
|
10127
|
+
function Js(i, e) {
|
|
10063
10128
|
if (!i.projectId)
|
|
10064
10129
|
throw new Error(
|
|
10065
10130
|
`[CROSSx] Fatal: projectId is required but was not provided.
|
|
@@ -10067,7 +10132,7 @@ Set the projectId field in SDKConfig when calling createCROSSxSDK().
|
|
|
10067
10132
|
Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
|
|
10068
10133
|
);
|
|
10069
10134
|
i.debug;
|
|
10070
|
-
const r =
|
|
10135
|
+
const r = _e.production, t = {
|
|
10071
10136
|
...i,
|
|
10072
10137
|
oauthServiceUrl: r.oauthServiceUrl,
|
|
10073
10138
|
authApiUrl: r.authApiUrl,
|
|
@@ -10075,15 +10140,15 @@ Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
|
|
|
10075
10140
|
}, s = {
|
|
10076
10141
|
gatewayUrl: r.walletGatewayUrl,
|
|
10077
10142
|
projectId: i.projectId
|
|
10078
|
-
}, o = t.authMode !== "cookie" &&
|
|
10143
|
+
}, o = t.authMode !== "cookie" && nt.isAvailable();
|
|
10079
10144
|
!o && t.authMode !== "cookie" && c.warn(
|
|
10080
10145
|
"[CROSSx] IndexedDB 사용 불가 — LocalStorage fallback 사용 중.",
|
|
10081
10146
|
"refresh_token이 평문 저장되지 않도록 세션 영속성이 제한됩니다.",
|
|
10082
10147
|
"IndexedDB를 지원하는 브라우저 사용을 권장합니다."
|
|
10083
10148
|
), t.secureStorageAvailable = o;
|
|
10084
|
-
const n = o ? new
|
|
10149
|
+
const n = o ? new nt(i.projectId) : new mr(), a = new Sr(), l = new kr(), p = new se(), _ = new Bs(), u = new ut();
|
|
10085
10150
|
let x;
|
|
10086
|
-
i.useMockWallet ? (c.log("[CROSSx] Mock Wallet Provider 사용"), x = new
|
|
10151
|
+
i.useMockWallet ? (c.log("[CROSSx] Mock Wallet Provider 사용"), x = new Lr(n, u)) : (c.log("[CROSSx] Remote Wallet Provider 사용"), x = new ie(
|
|
10087
10152
|
s,
|
|
10088
10153
|
n,
|
|
10089
10154
|
l,
|
|
@@ -10092,36 +10157,36 @@ Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
|
|
|
10092
10157
|
));
|
|
10093
10158
|
let g = null;
|
|
10094
10159
|
const f = () => {
|
|
10095
|
-
var
|
|
10096
|
-
return ((
|
|
10160
|
+
var C;
|
|
10161
|
+
return ((C = g == null ? void 0 : g.isAuthenticatedViaRNBridge) == null ? void 0 : C.call(g)) ?? !1;
|
|
10097
10162
|
}, m = () => {
|
|
10098
|
-
var
|
|
10099
|
-
return (
|
|
10163
|
+
var C;
|
|
10164
|
+
return (C = g == null ? void 0 : g.assertRNBridgeSessionActive) == null ? void 0 : C.call(g);
|
|
10100
10165
|
};
|
|
10101
|
-
x = new
|
|
10166
|
+
x = new Dr(
|
|
10102
10167
|
x,
|
|
10103
10168
|
() => {
|
|
10104
|
-
var
|
|
10105
|
-
return (
|
|
10169
|
+
var C;
|
|
10170
|
+
return (C = g == null ? void 0 : g.getRNBridge) == null ? void 0 : C.call(g);
|
|
10106
10171
|
},
|
|
10107
10172
|
f,
|
|
10108
10173
|
m,
|
|
10109
10174
|
() => i.appName
|
|
10110
10175
|
);
|
|
10111
|
-
const y = new fe(s, l), S = new
|
|
10176
|
+
const y = new fe(s, l), S = new $s(
|
|
10112
10177
|
i.theme ?? "light",
|
|
10113
10178
|
i.themeTokens,
|
|
10114
10179
|
i.displayDecimals,
|
|
10115
10180
|
i.pinKeyboard
|
|
10116
|
-
),
|
|
10181
|
+
), A = new Fs(
|
|
10117
10182
|
S,
|
|
10118
10183
|
() => {
|
|
10119
|
-
var
|
|
10120
|
-
return (
|
|
10184
|
+
var C;
|
|
10185
|
+
return (C = g == null ? void 0 : g.getRNBridge) == null ? void 0 : C.call(g);
|
|
10121
10186
|
},
|
|
10122
10187
|
() => typeof window < "u" ? window.location.origin : "http://localhost",
|
|
10123
10188
|
f
|
|
10124
|
-
),
|
|
10189
|
+
), E = e != null && e.wrapConfirmation ? e.wrapConfirmation(A) : A, k = new Me(
|
|
10125
10190
|
t,
|
|
10126
10191
|
s,
|
|
10127
10192
|
n,
|
|
@@ -10130,17 +10195,17 @@ Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
|
|
|
10130
10195
|
p,
|
|
10131
10196
|
x,
|
|
10132
10197
|
_,
|
|
10133
|
-
|
|
10198
|
+
E,
|
|
10134
10199
|
y,
|
|
10135
10200
|
u
|
|
10136
10201
|
);
|
|
10137
|
-
g =
|
|
10138
|
-
const
|
|
10139
|
-
return
|
|
10202
|
+
g = k;
|
|
10203
|
+
const T = k.signInUseCase;
|
|
10204
|
+
return T && typeof T.setFreshTokenCallback == "function" && T.setFreshTokenCallback(() => k.requestFreshFirebaseIdTokenFromBridge()), typeof window < "u" && (window.__crossxSDK = k), k;
|
|
10140
10205
|
}
|
|
10141
|
-
function
|
|
10142
|
-
const e =
|
|
10143
|
-
|
|
10206
|
+
function Zs(i) {
|
|
10207
|
+
const e = Ws(i), r = Us(e), t = JSON.parse(r);
|
|
10208
|
+
Gs(t);
|
|
10144
10209
|
const { data: s } = t;
|
|
10145
10210
|
return {
|
|
10146
10211
|
status: t.status,
|
|
@@ -10154,7 +10219,7 @@ function Ks(i) {
|
|
|
10154
10219
|
raw: t
|
|
10155
10220
|
};
|
|
10156
10221
|
}
|
|
10157
|
-
function
|
|
10222
|
+
function Ws(i) {
|
|
10158
10223
|
if (i.includes("://") && i.includes("?")) {
|
|
10159
10224
|
const e = new URL(i), r = e.searchParams.get("crossx_oauth_result");
|
|
10160
10225
|
if (r) return r;
|
|
@@ -10164,22 +10229,22 @@ function Ls(i) {
|
|
|
10164
10229
|
}
|
|
10165
10230
|
return i;
|
|
10166
10231
|
}
|
|
10167
|
-
function
|
|
10232
|
+
function Us(i) {
|
|
10168
10233
|
if (i.startsWith("{"))
|
|
10169
10234
|
return i;
|
|
10170
10235
|
if (i.startsWith("%7B") || i.startsWith("%7b"))
|
|
10171
10236
|
return decodeURIComponent(i);
|
|
10172
|
-
const e =
|
|
10237
|
+
const e = Hs(i);
|
|
10173
10238
|
return decodeURIComponent(e);
|
|
10174
10239
|
}
|
|
10175
|
-
function
|
|
10240
|
+
function Hs(i) {
|
|
10176
10241
|
if (typeof atob == "function")
|
|
10177
10242
|
return atob(i);
|
|
10178
10243
|
if (typeof Buffer < "u")
|
|
10179
10244
|
return Buffer.from(i, "base64").toString("utf-8");
|
|
10180
10245
|
throw new Error("Base64 디코딩을 지원하는 환경이 아닙니다");
|
|
10181
10246
|
}
|
|
10182
|
-
function
|
|
10247
|
+
function Gs(i) {
|
|
10183
10248
|
if (typeof i != "object" || i === null)
|
|
10184
10249
|
throw new Error("Deeplink payload가 유효한 객체가 아닙니다");
|
|
10185
10250
|
const e = i;
|
|
@@ -10196,18 +10261,21 @@ function $s(i) {
|
|
|
10196
10261
|
throw new Error("Deeplink data에 accessToken 필드가 없습니다");
|
|
10197
10262
|
}
|
|
10198
10263
|
export {
|
|
10199
|
-
|
|
10264
|
+
Wt as CONNECT_OTHER_WALLET_DISPLAY_ORDER,
|
|
10200
10265
|
h as CROSSxError,
|
|
10201
|
-
|
|
10202
|
-
|
|
10203
|
-
|
|
10266
|
+
Vt as CROSSxEthereumProvider,
|
|
10267
|
+
Me as CROSSxSDK,
|
|
10268
|
+
js as ChainId,
|
|
10204
10269
|
ge as ConnectOtherWalletItem,
|
|
10205
10270
|
d as ErrorCode,
|
|
10206
|
-
|
|
10207
|
-
|
|
10208
|
-
|
|
10209
|
-
|
|
10210
|
-
|
|
10211
|
-
|
|
10212
|
-
|
|
10271
|
+
Le as MNEMONIC_ADDRESS_LIMIT,
|
|
10272
|
+
ut as PinMemoryStore,
|
|
10273
|
+
Bs as TokenMemoryStore,
|
|
10274
|
+
Ue as WALLET_BRAND_NAME,
|
|
10275
|
+
Js as createCROSSxSDK,
|
|
10276
|
+
Ut as getConnectOtherWalletLabel,
|
|
10277
|
+
ve as getWalletBrowserInfo,
|
|
10278
|
+
Ys as isWalletInAppBrowser,
|
|
10279
|
+
Zs as parseOAuthDeeplink,
|
|
10280
|
+
Xs as waitForWalletBrowser
|
|
10213
10281
|
};
|