@nexus-cross/crossx-sdk-core 2.3.10-beta.4 → 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/config/environments.d.ts +14 -0
- package/dist/core/constants.d.ts +1 -1
- package/dist/core/types/events.d.ts +12 -0
- 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 +845 -758
- package/dist/sdk/CROSSxSDK.d.ts +7 -1
- package/dist/sdk/services/StateManager.d.ts +3 -1
- 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 ve = {
|
|
|
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: _,
|
|
@@ -677,40 +677,40 @@ const et = "crossx_access_token", tt = "crossx_refresh_token", rt = "crossx_user
|
|
|
677
677
|
const { authApiUrl: _ } = this.config, { accessToken: u, refreshToken: x } = await this.exchangeFirebaseToken(e, _);
|
|
678
678
|
let g, f, m;
|
|
679
679
|
try {
|
|
680
|
-
const
|
|
681
|
-
c.log("[CROSSx] Firebase JWT 필드:", Object.keys(
|
|
682
|
-
const
|
|
683
|
-
m =
|
|
680
|
+
const S = this.crypto.decodeJWT(e);
|
|
681
|
+
c.log("[CROSSx] Firebase JWT 필드:", Object.keys(S).join(", ")), f = (o = S.firebase) == null ? void 0 : o.sign_in_provider;
|
|
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
|
-
const
|
|
689
|
-
c.log("[CROSSx] access_token 디코딩 — sub:",
|
|
690
|
-
const
|
|
691
|
-
if (s =
|
|
688
|
+
const S = this.crypto.decodeJWT(u);
|
|
689
|
+
c.log("[CROSSx] access_token 디코딩 — sub:", S.sub, "exp:", S.exp, "필드:", Object.keys(S).join(", "));
|
|
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 영속 저장을 건너뜁니다"));
|
|
709
709
|
} else {
|
|
710
|
-
const
|
|
710
|
+
const S = this.crypto.decodeJWT(e);
|
|
711
711
|
t = {
|
|
712
|
-
id:
|
|
713
|
-
email:
|
|
712
|
+
id: S.sub,
|
|
713
|
+
email: S.email ?? r,
|
|
714
714
|
signInProvider: f,
|
|
715
715
|
providerSub: g
|
|
716
716
|
}, c.log("[CROSSx] Cookie 모드 — Firebase 토큰에서 사용자 정보 추출 — id:", t.id);
|
|
@@ -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,67 +1434,75 @@ 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;
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1437
|
+
function er(i) {
|
|
1438
|
+
const e = i.environment, r = e && e in _e ? _e[e] : null;
|
|
1439
|
+
if (!r)
|
|
1440
|
+
return null;
|
|
1441
|
+
const t = i.overrides;
|
|
1442
|
+
if (!t)
|
|
1443
|
+
return r;
|
|
1444
|
+
const s = { ...r };
|
|
1445
|
+
for (const [o, n] of Object.entries(t))
|
|
1446
|
+
typeof n == "string" && n.trim() !== "" && (s[o] = n);
|
|
1447
|
+
return s;
|
|
1448
|
+
}
|
|
1449
|
+
function He() {
|
|
1442
1450
|
try {
|
|
1443
1451
|
if (typeof __CROSSX_CONFIG__ < "u") {
|
|
1444
|
-
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);
|
|
1445
1453
|
if (e) return e;
|
|
1446
1454
|
}
|
|
1447
1455
|
} catch {
|
|
1448
1456
|
}
|
|
1449
1457
|
try {
|
|
1450
1458
|
const i = process.env.NEXT_PUBLIC_CROSSX_ENVIRONMENT;
|
|
1451
|
-
if (i && i in
|
|
1452
|
-
return
|
|
1459
|
+
if (i && i in _e)
|
|
1460
|
+
return _e[i];
|
|
1453
1461
|
} catch {
|
|
1454
1462
|
}
|
|
1455
|
-
return
|
|
1463
|
+
return _e.production;
|
|
1456
1464
|
}
|
|
1457
|
-
function
|
|
1465
|
+
function xt(i) {
|
|
1458
1466
|
let e = i.length;
|
|
1459
1467
|
for (; e > 0 && i.charCodeAt(e - 1) === 48; ) e--;
|
|
1460
1468
|
return i.slice(0, e);
|
|
1461
1469
|
}
|
|
1462
|
-
function
|
|
1470
|
+
function tr(i, e = We) {
|
|
1463
1471
|
if (!i || i === "0x0" || i === "0x") return "0";
|
|
1464
1472
|
try {
|
|
1465
1473
|
const r = BigInt(i);
|
|
1466
1474
|
if (r === 0n) return "0";
|
|
1467
|
-
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);
|
|
1468
1476
|
return a ? `${s}.${a}` : `${s}`;
|
|
1469
1477
|
} catch {
|
|
1470
1478
|
return "?";
|
|
1471
1479
|
}
|
|
1472
1480
|
}
|
|
1473
|
-
function
|
|
1481
|
+
function ye(i, e, r, t = We) {
|
|
1474
1482
|
if (!(!i || i === "0x" || i === "0x0"))
|
|
1475
1483
|
try {
|
|
1476
1484
|
const s = BigInt(i);
|
|
1477
1485
|
if (s === 0n) return;
|
|
1478
|
-
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));
|
|
1479
1487
|
return `${p ? `${n}.${p}` : `${n}`} ${e}`;
|
|
1480
1488
|
} catch {
|
|
1481
1489
|
return;
|
|
1482
1490
|
}
|
|
1483
1491
|
}
|
|
1484
|
-
function
|
|
1492
|
+
function rr(i) {
|
|
1485
1493
|
const e = i.startsWith("0x") ? i.slice(2) : i;
|
|
1486
1494
|
if (!/^[0-9a-fA-F]+$/.test(e))
|
|
1487
1495
|
throw new h(
|
|
1488
1496
|
d.SIGNATURE_FAILED,
|
|
1489
1497
|
"유효하지 않은 서명: 올바른 hex 문자열이 아닙니다"
|
|
1490
1498
|
);
|
|
1491
|
-
if (e.length !==
|
|
1499
|
+
if (e.length !== Ze)
|
|
1492
1500
|
throw new h(
|
|
1493
1501
|
d.SIGNATURE_FAILED,
|
|
1494
|
-
`서명 길이가 유효하지 않습니다: ${
|
|
1502
|
+
`서명 길이가 유효하지 않습니다: ${Ze} hex 문자(65 바이트) 예상, 현재 ${e.length}`
|
|
1495
1503
|
);
|
|
1496
1504
|
}
|
|
1497
|
-
function
|
|
1505
|
+
function sr(i) {
|
|
1498
1506
|
const e = i.startsWith("0x") ? i.slice(2) : i;
|
|
1499
1507
|
if (!/^[0-9a-fA-F]+$/.test(e))
|
|
1500
1508
|
throw new h(
|
|
@@ -1507,8 +1515,8 @@ function er(i) {
|
|
|
1507
1515
|
"유효하지 않은 서명된 트랜잭션: 너무 짧습니다"
|
|
1508
1516
|
);
|
|
1509
1517
|
}
|
|
1510
|
-
function
|
|
1511
|
-
const r =
|
|
1518
|
+
function ir(i, e) {
|
|
1519
|
+
const r = or(e);
|
|
1512
1520
|
if (i === "0") {
|
|
1513
1521
|
if (r !== void 0 && r !== 0)
|
|
1514
1522
|
throw new h(
|
|
@@ -1532,7 +1540,7 @@ function tr(i, e) {
|
|
|
1532
1540
|
);
|
|
1533
1541
|
}
|
|
1534
1542
|
}
|
|
1535
|
-
function
|
|
1543
|
+
function or(i) {
|
|
1536
1544
|
if (i == null || typeof i != "object") return;
|
|
1537
1545
|
const e = i.domain;
|
|
1538
1546
|
if (e == null || typeof e != "object") return;
|
|
@@ -1541,7 +1549,7 @@ function rr(i) {
|
|
|
1541
1549
|
const t = Number(r);
|
|
1542
1550
|
return Number.isFinite(t) ? t : void 0;
|
|
1543
1551
|
}
|
|
1544
|
-
class
|
|
1552
|
+
class pe {
|
|
1545
1553
|
constructor(e) {
|
|
1546
1554
|
this.deps = e, this.verifyPinMutex = null;
|
|
1547
1555
|
}
|
|
@@ -1582,7 +1590,7 @@ class le {
|
|
|
1582
1590
|
this.verifyPinMutex = new Promise((_, u) => {
|
|
1583
1591
|
o = _, n = u;
|
|
1584
1592
|
});
|
|
1585
|
-
const a =
|
|
1593
|
+
const a = J(this.deps.getLocale() ?? "en");
|
|
1586
1594
|
try {
|
|
1587
1595
|
if (typeof this.deps.walletProvider.verifyPin != "function") {
|
|
1588
1596
|
const u = await this.deps.confirmation.showPinInputPrompt({
|
|
@@ -1617,7 +1625,7 @@ class le {
|
|
|
1617
1625
|
if (x.code === d.PIN_INVALID)
|
|
1618
1626
|
return { ok: !1, error: x.message };
|
|
1619
1627
|
if (x.code === d.PIN_LOCKED)
|
|
1620
|
-
return
|
|
1628
|
+
return pe.buildPinLockedResult(x, a);
|
|
1621
1629
|
}
|
|
1622
1630
|
throw x;
|
|
1623
1631
|
}
|
|
@@ -1631,7 +1639,7 @@ class le {
|
|
|
1631
1639
|
this.deps.pinStore.set(_), c.log("[CROSSx] PIN 갱신 완료 (verify 모달 닫힘)"), o();
|
|
1632
1640
|
} catch (_) {
|
|
1633
1641
|
if (_ instanceof h && (_.code === d.AUTH_NOT_AUTHENTICATED || _.code === d.AUTH_TOKEN_EXPIRED || _.code === d.SESSION_EXPIRED) && _.code !== d.SESSION_EXPIRED) {
|
|
1634
|
-
const u =
|
|
1642
|
+
const u = J(this.deps.getLocale() ?? "en"), x = this.deps.getUserEmail();
|
|
1635
1643
|
if (await this.deps.confirmation.showSessionAlert({
|
|
1636
1644
|
title: u.session_alert_title,
|
|
1637
1645
|
message: u.alert_session_expired,
|
|
@@ -1645,13 +1653,13 @@ class le {
|
|
|
1645
1653
|
}
|
|
1646
1654
|
}
|
|
1647
1655
|
async withPinRetry(e) {
|
|
1648
|
-
const r =
|
|
1656
|
+
const r = J(this.deps.getLocale() ?? "en");
|
|
1649
1657
|
let t = null;
|
|
1650
1658
|
try {
|
|
1651
1659
|
return await e();
|
|
1652
1660
|
} catch (s) {
|
|
1653
1661
|
if (s instanceof h) {
|
|
1654
|
-
if (t =
|
|
1662
|
+
if (t = pe.parsePinError(s, r), !t) throw s;
|
|
1655
1663
|
} else
|
|
1656
1664
|
throw s;
|
|
1657
1665
|
}
|
|
@@ -1665,7 +1673,7 @@ class le {
|
|
|
1665
1673
|
try {
|
|
1666
1674
|
return await e();
|
|
1667
1675
|
} catch (s) {
|
|
1668
|
-
if (s instanceof h && (t =
|
|
1676
|
+
if (s instanceof h && (t = pe.parsePinError(s, r), t))
|
|
1669
1677
|
continue;
|
|
1670
1678
|
throw s;
|
|
1671
1679
|
}
|
|
@@ -1690,13 +1698,13 @@ class le {
|
|
|
1690
1698
|
return null;
|
|
1691
1699
|
}
|
|
1692
1700
|
static buildPinLockedResult(e, r) {
|
|
1693
|
-
const t =
|
|
1701
|
+
const t = pe.parsePinError(e, r);
|
|
1694
1702
|
if (!t) return { ok: !1, error: e.message };
|
|
1695
1703
|
const { errorMessage: s, ...o } = t;
|
|
1696
1704
|
return { ok: !1, error: s, ...o };
|
|
1697
1705
|
}
|
|
1698
1706
|
}
|
|
1699
|
-
class
|
|
1707
|
+
class nr {
|
|
1700
1708
|
constructor(e) {
|
|
1701
1709
|
this.deps = e;
|
|
1702
1710
|
}
|
|
@@ -1717,10 +1725,10 @@ class sr {
|
|
|
1717
1725
|
});
|
|
1718
1726
|
}
|
|
1719
1727
|
}
|
|
1720
|
-
function
|
|
1728
|
+
function ar(i) {
|
|
1721
1729
|
return i === "google" || i === "apple";
|
|
1722
1730
|
}
|
|
1723
|
-
class
|
|
1731
|
+
class cr {
|
|
1724
1732
|
constructor(e) {
|
|
1725
1733
|
this.deps = e;
|
|
1726
1734
|
}
|
|
@@ -1731,7 +1739,7 @@ class or {
|
|
|
1731
1739
|
this.deps.setRecoveringSession(!0);
|
|
1732
1740
|
try {
|
|
1733
1741
|
this.deps.setAuthenticated(!1), this.deps.clearTokenStore();
|
|
1734
|
-
const s =
|
|
1742
|
+
const s = ar(e.loginType) ? { provider: e.loginType } : void 0;
|
|
1735
1743
|
let o;
|
|
1736
1744
|
try {
|
|
1737
1745
|
o = await this.deps.executeSignIn(s);
|
|
@@ -1746,7 +1754,7 @@ class or {
|
|
|
1746
1754
|
"[CROSSx] signInAgain: providerSub/userId 불일치 — 잘못된 계정으로 로그인됨"
|
|
1747
1755
|
), await this.deps.executeSignOut().catch(() => {
|
|
1748
1756
|
});
|
|
1749
|
-
const p =
|
|
1757
|
+
const p = J(this.deps.getLocale() ?? "en");
|
|
1750
1758
|
return await this.deps.showSessionAlert({
|
|
1751
1759
|
title: p.session_alert_title,
|
|
1752
1760
|
message: p.alert_different_account,
|
|
@@ -1771,7 +1779,7 @@ class or {
|
|
|
1771
1779
|
try {
|
|
1772
1780
|
return await e();
|
|
1773
1781
|
} catch (r) {
|
|
1774
|
-
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;
|
|
1775
1783
|
if (r instanceof h && r.code === d.WITHDRAW_FAILED) {
|
|
1776
1784
|
if (c.warn("[CROSSx] WITHDRAW_FAILED — 로컬 인증 초기화"), await this.deps.showSessionAlert({
|
|
1777
1785
|
title: t.session_alert_title,
|
|
@@ -1811,7 +1819,7 @@ class or {
|
|
|
1811
1819
|
}
|
|
1812
1820
|
}
|
|
1813
1821
|
}
|
|
1814
|
-
class
|
|
1822
|
+
class lr {
|
|
1815
1823
|
constructor(e) {
|
|
1816
1824
|
this.deps = e;
|
|
1817
1825
|
}
|
|
@@ -1858,7 +1866,7 @@ class nr {
|
|
|
1858
1866
|
c.log("[CROSSx] 세션 복원 후 지갑 주소 로드 완료:", a.address), this.deps.setActiveWallet(a.address, 0);
|
|
1859
1867
|
}
|
|
1860
1868
|
}
|
|
1861
|
-
class
|
|
1869
|
+
class dr {
|
|
1862
1870
|
constructor(e) {
|
|
1863
1871
|
this.deps = e;
|
|
1864
1872
|
}
|
|
@@ -1926,7 +1934,7 @@ class ar {
|
|
|
1926
1934
|
c.warn(
|
|
1927
1935
|
"[CROSSx][Migration Phase 4] 세션 만료 — 재로그인 후 PIN 입력 재시도"
|
|
1928
1936
|
);
|
|
1929
|
-
const x =
|
|
1937
|
+
const x = J(this.deps.getLocale() ?? "en"), g = this.deps.getUserEmail();
|
|
1930
1938
|
if (await this.deps.confirmation.showSessionAlert({
|
|
1931
1939
|
title: x.session_alert_title,
|
|
1932
1940
|
message: x.alert_session_expired,
|
|
@@ -1984,7 +1992,7 @@ class ar {
|
|
|
1984
1992
|
c.warn(
|
|
1985
1993
|
"[CROSSx][Migration Phase 5] 세션 만료 — 재로그인 후 마이그레이션 재시도"
|
|
1986
1994
|
);
|
|
1987
|
-
const u =
|
|
1995
|
+
const u = J(this.deps.getLocale() ?? "en"), x = this.deps.getUserEmail();
|
|
1988
1996
|
if (await this.deps.confirmation.showSessionAlert({
|
|
1989
1997
|
title: u.session_alert_title,
|
|
1990
1998
|
message: u.alert_session_expired,
|
|
@@ -2015,7 +2023,7 @@ class ar {
|
|
|
2015
2023
|
}
|
|
2016
2024
|
}
|
|
2017
2025
|
}
|
|
2018
|
-
class
|
|
2026
|
+
class pr {
|
|
2019
2027
|
constructor(e) {
|
|
2020
2028
|
this.deps = e;
|
|
2021
2029
|
}
|
|
@@ -2042,7 +2050,7 @@ class cr {
|
|
|
2042
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) {
|
|
2043
2051
|
const g = x;
|
|
2044
2052
|
if (g) {
|
|
2045
|
-
const f =
|
|
2053
|
+
const f = Je;
|
|
2046
2054
|
l.maxFeePerGas = `0x${(BigInt(g) + BigInt(f)).toString(16)}`, l.maxPriorityFeePerGas = f, c.log(
|
|
2047
2055
|
"[CROSSx] Dynamic 체인 감지 — baseFee:",
|
|
2048
2056
|
g,
|
|
@@ -2051,12 +2059,12 @@ class cr {
|
|
|
2051
2059
|
"maxPriorityFeePerGas: 1 Gwei"
|
|
2052
2060
|
);
|
|
2053
2061
|
} else
|
|
2054
|
-
l.gasPrice =
|
|
2062
|
+
l.gasPrice = Dt, c.log("[CROSSx] Legacy 체인 감지 — gasPrice: 2 Gwei");
|
|
2055
2063
|
}
|
|
2056
|
-
return !n && a && (l.maxPriorityFeePerGas =
|
|
2064
|
+
return !n && a && (l.maxPriorityFeePerGas = Je, c.log("[CROSSx] maxPriorityFeePerGas 비어있음 → 1 Gwei 기본값 적용")), l;
|
|
2057
2065
|
}
|
|
2058
2066
|
}
|
|
2059
|
-
class
|
|
2067
|
+
class _r {
|
|
2060
2068
|
constructor(e) {
|
|
2061
2069
|
this.crypto = e;
|
|
2062
2070
|
}
|
|
@@ -2082,10 +2090,10 @@ class lr {
|
|
|
2082
2090
|
}
|
|
2083
2091
|
}
|
|
2084
2092
|
}
|
|
2085
|
-
function
|
|
2093
|
+
function hr(i) {
|
|
2086
2094
|
return i ? i.includes("google") ? "google" : i.includes("apple") ? "apple" : i : null;
|
|
2087
2095
|
}
|
|
2088
|
-
class
|
|
2096
|
+
class ur {
|
|
2089
2097
|
constructor(e) {
|
|
2090
2098
|
this.deps = e;
|
|
2091
2099
|
}
|
|
@@ -2098,24 +2106,25 @@ class pr {
|
|
|
2098
2106
|
(t == null ? void 0 : t.walletName) !== void 0 && (s.walletName = t.walletName), this.deps.emitAddressChanged(s), this.deps.shouldPersistWalletPreference() && this.deps.storage.set(this.deps.walletPreferenceKey, { index: r, address: e }).catch(() => {
|
|
2099
2107
|
});
|
|
2100
2108
|
}
|
|
2101
|
-
applyAuthResult(e) {
|
|
2102
|
-
var
|
|
2103
|
-
const
|
|
2109
|
+
applyAuthResult(e, r) {
|
|
2110
|
+
var s, o, n, a, l;
|
|
2111
|
+
const t = {
|
|
2104
2112
|
authenticated: e.success,
|
|
2105
|
-
userId: ((
|
|
2113
|
+
userId: ((s = e.user) == null ? void 0 : s.id) ?? null,
|
|
2106
2114
|
address: e.address ?? null,
|
|
2107
2115
|
activeWalletIndex: 0,
|
|
2108
|
-
userEmail: ((
|
|
2109
|
-
providerSub: ((
|
|
2110
|
-
loginType:
|
|
2111
|
-
(
|
|
2116
|
+
userEmail: ((o = e.user) == null ? void 0 : o.email) ?? null,
|
|
2117
|
+
providerSub: ((n = e.user) == null ? void 0 : n.providerSub) ?? null,
|
|
2118
|
+
loginType: hr(
|
|
2119
|
+
(a = e.user) == null ? void 0 : a.signInProvider
|
|
2112
2120
|
),
|
|
2113
2121
|
tokenSignatureVerified: e.tokenSignatureVerified ?? !1
|
|
2114
2122
|
};
|
|
2115
|
-
this.deps.setState(
|
|
2123
|
+
this.deps.setState(t), this.deps.getIsRecoveringSession() || this.deps.emitAuthChanged({
|
|
2116
2124
|
isAuthenticated: e.success,
|
|
2117
2125
|
address: e.address ?? null,
|
|
2118
|
-
userId: ((
|
|
2126
|
+
userId: ((l = e.user) == null ? void 0 : l.id) ?? null,
|
|
2127
|
+
...r ? { source: r } : {}
|
|
2119
2128
|
});
|
|
2120
2129
|
}
|
|
2121
2130
|
clearAuthState() {
|
|
@@ -2136,7 +2145,7 @@ class pr {
|
|
|
2136
2145
|
});
|
|
2137
2146
|
}
|
|
2138
2147
|
}
|
|
2139
|
-
class
|
|
2148
|
+
class xr {
|
|
2140
2149
|
constructor(e) {
|
|
2141
2150
|
this.deps = e;
|
|
2142
2151
|
}
|
|
@@ -2155,7 +2164,7 @@ class _r {
|
|
|
2155
2164
|
)).address, index: e };
|
|
2156
2165
|
}
|
|
2157
2166
|
}
|
|
2158
|
-
class
|
|
2167
|
+
class gr {
|
|
2159
2168
|
constructor(e) {
|
|
2160
2169
|
this.deps = e;
|
|
2161
2170
|
}
|
|
@@ -2174,7 +2183,7 @@ class hr {
|
|
|
2174
2183
|
);
|
|
2175
2184
|
}
|
|
2176
2185
|
}
|
|
2177
|
-
class
|
|
2186
|
+
class fr {
|
|
2178
2187
|
constructor(e) {
|
|
2179
2188
|
this.deps = e;
|
|
2180
2189
|
}
|
|
@@ -2234,11 +2243,11 @@ class ur {
|
|
|
2234
2243
|
}
|
|
2235
2244
|
}
|
|
2236
2245
|
}
|
|
2237
|
-
function
|
|
2246
|
+
function ot(i, e) {
|
|
2238
2247
|
const r = i.replace(/\/$/, ""), t = e.startsWith("/") ? e : `/${e}`;
|
|
2239
2248
|
return `${r}/cross-auth${t}`;
|
|
2240
2249
|
}
|
|
2241
|
-
class
|
|
2250
|
+
class wr {
|
|
2242
2251
|
constructor(e) {
|
|
2243
2252
|
this.deps = e;
|
|
2244
2253
|
}
|
|
@@ -2274,7 +2283,7 @@ class xr {
|
|
|
2274
2283
|
d.TX_INVALID_PARAMS,
|
|
2275
2284
|
"invalid param body"
|
|
2276
2285
|
);
|
|
2277
|
-
const o = this.deps.getApiBaseUrl(), n =
|
|
2286
|
+
const o = this.deps.getApiBaseUrl(), n = ot(o, `/v2/token-historical/${e}/${s}`), a = { clientVersion: t };
|
|
2278
2287
|
try {
|
|
2279
2288
|
c.log("[TokenHistory] Registering tx:", e, s);
|
|
2280
2289
|
const l = await this.deps.transport.request({
|
|
@@ -2304,7 +2313,7 @@ class xr {
|
|
|
2304
2313
|
*/
|
|
2305
2314
|
async getTokenHistory(e) {
|
|
2306
2315
|
var s;
|
|
2307
|
-
const r = this.deps.getApiBaseUrl(), t = new URL(
|
|
2316
|
+
const r = this.deps.getApiBaseUrl(), t = new URL(ot(r, "/v2/token-historical"));
|
|
2308
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());
|
|
2309
2318
|
try {
|
|
2310
2319
|
c.log("[TokenHistory] Fetching token history");
|
|
@@ -2379,85 +2388,90 @@ class xr {
|
|
|
2379
2388
|
throw new h(s.code, s.message);
|
|
2380
2389
|
}
|
|
2381
2390
|
}
|
|
2382
|
-
function
|
|
2391
|
+
function Te(i, e = "Apple account") {
|
|
2383
2392
|
if (i.endsWith("@privaterelay.appleid.com")) return e;
|
|
2384
2393
|
const r = i.indexOf("@");
|
|
2385
2394
|
if (r < 0) return "*".repeat(i.length || 3);
|
|
2386
2395
|
const t = i.substring(0, r), s = i.substring(r);
|
|
2387
2396
|
return t.length <= 1 ? `${t}${"*".repeat(Math.max(t.length, 1))}${s}` : `${t[0]}${"*".repeat(t.length - 1)}${s}`;
|
|
2388
2397
|
}
|
|
2389
|
-
const
|
|
2398
|
+
const oe = class oe extends Zt {
|
|
2390
2399
|
constructor(e, r, t, s, o, n, a, l, p, _, u) {
|
|
2391
2400
|
var x, g;
|
|
2392
|
-
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({
|
|
2393
2402
|
setState: (f) => {
|
|
2394
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);
|
|
2395
2404
|
},
|
|
2396
2405
|
getIsRecoveringSession: () => this._isRecoveringSession,
|
|
2397
2406
|
emitAddressChanged: ({ address: f, index: m, walletName: y }) => {
|
|
2398
|
-
const
|
|
2399
|
-
y !== void 0 && (
|
|
2407
|
+
const S = { address: f, index: m };
|
|
2408
|
+
y !== void 0 && (S.walletName = y), this.emit("addressChanged", S);
|
|
2400
2409
|
},
|
|
2401
|
-
emitAuthChanged: ({ isAuthenticated: f, address: m, userId: y }) => {
|
|
2402
|
-
this.emit("authChanged", {
|
|
2410
|
+
emitAuthChanged: ({ isAuthenticated: f, address: m, userId: y, source: S }) => {
|
|
2411
|
+
this.emit("authChanged", {
|
|
2412
|
+
isAuthenticated: f,
|
|
2413
|
+
address: m,
|
|
2414
|
+
userId: y,
|
|
2415
|
+
...S ? { source: S } : {}
|
|
2416
|
+
});
|
|
2403
2417
|
},
|
|
2404
2418
|
shouldPersistWalletPreference: () => this._config.persistWalletPreference !== !1,
|
|
2405
|
-
walletPreferenceKey:
|
|
2419
|
+
walletPreferenceKey: oe.WALLET_PREF_KEY,
|
|
2406
2420
|
storage: this.storage,
|
|
2407
2421
|
pinStore: this.pinStore
|
|
2408
|
-
}), this.pinOrchestrator = new
|
|
2422
|
+
}), this.pinOrchestrator = new pe({
|
|
2409
2423
|
confirmation: this.confirmation,
|
|
2410
2424
|
walletProvider: this.walletProvider,
|
|
2411
2425
|
pinStore: this.pinStore,
|
|
2412
2426
|
getLocale: () => this._config.locale,
|
|
2413
2427
|
getUserEmail: () => this.userEmail,
|
|
2414
|
-
maskEmail:
|
|
2428
|
+
maskEmail: Te,
|
|
2415
2429
|
signInAgain: () => this.signInAgain(),
|
|
2416
2430
|
// §12 native sign delegation: bridge 자동 로그인 세션이면 JS PIN 단계를 스킵한다.
|
|
2417
2431
|
// dApp 이 sdk.pinOrchestrator.ensureVerifiedPin() 을 직접 호출해도 (SigningOrchestrator 우회)
|
|
2418
2432
|
// WebView 안에서 embedded PIN 프롬프트가 뜨지 않도록 게이팅. SigningOrchestrator 와 동일 신호.
|
|
2419
2433
|
isRNBridgeMode: () => this._isAuthenticatedViaRNBridge
|
|
2420
|
-
}), this.signingOrchestrator = new
|
|
2434
|
+
}), this.signingOrchestrator = new nr({
|
|
2421
2435
|
confirmation: this.confirmation,
|
|
2422
2436
|
walletProvider: this.walletProvider,
|
|
2423
2437
|
pinOrchestrator: this.pinOrchestrator,
|
|
2424
2438
|
// §12 native sign delegation: 이 SDK 세션이 RN bridge 자동 로그인으로 인증된 경우만 활성.
|
|
2425
2439
|
// 자동 로그인 거부 / OAuth 로 별도 로그인한 세션에서는 native SDK 가 미인증이라 우회한다.
|
|
2426
2440
|
isRNBridgeMode: () => this._isAuthenticatedViaRNBridge
|
|
2427
|
-
}), this.walletLifecycleService = new
|
|
2441
|
+
}), this.walletLifecycleService = new lr({
|
|
2428
2442
|
walletProvider: this.walletProvider,
|
|
2429
2443
|
pinOrchestrator: this.pinOrchestrator,
|
|
2430
2444
|
getUserId: () => this.userId,
|
|
2431
2445
|
setActiveWallet: (f, m, y) => this.setActiveWallet(f, m, y)
|
|
2432
|
-
}), this.migrationOrchestrator = new
|
|
2446
|
+
}), this.migrationOrchestrator = new dr({
|
|
2433
2447
|
confirmation: this.confirmation,
|
|
2434
2448
|
walletProvider: this.walletProvider,
|
|
2435
2449
|
pinOrchestrator: this.pinOrchestrator,
|
|
2436
2450
|
executeMigrate: (f, m) => this.migrateWalletUseCase.execute(f, m),
|
|
2437
2451
|
getLocale: () => this._config.locale,
|
|
2438
2452
|
getUserEmail: () => this.userEmail,
|
|
2439
|
-
maskEmail:
|
|
2453
|
+
maskEmail: Te,
|
|
2440
2454
|
signInAgain: () => this.signInAgain(),
|
|
2441
2455
|
clearAuthState: () => this.clearAuthState(),
|
|
2442
2456
|
getAllowSkip: () => {
|
|
2443
2457
|
var f;
|
|
2444
2458
|
return ((f = this._config.migration) == null ? void 0 : f.allowSkip) ?? !0;
|
|
2445
2459
|
}
|
|
2446
|
-
}), this.transactionLifecycleService = new
|
|
2460
|
+
}), this.transactionLifecycleService = new pr({
|
|
2447
2461
|
getActiveAddress: () => this.address,
|
|
2448
2462
|
estimateGas: (f, m) => this.estimateGas(f, m),
|
|
2449
2463
|
getBaseFeePerGas: (f) => this.getBaseFeePerGas(f),
|
|
2450
2464
|
jsonRpcCall: (f, m, y) => this.jsonRpc.call(f, m, y)
|
|
2451
|
-
}), this.signatureVerifier = new
|
|
2465
|
+
}), this.signatureVerifier = new _r(this.crypto), this.addressResolverService = new xr({
|
|
2452
2466
|
walletProvider: this.walletProvider,
|
|
2453
2467
|
pinOrchestrator: this.pinOrchestrator,
|
|
2454
2468
|
getActiveAddress: () => this.address,
|
|
2455
2469
|
getActiveWalletIndex: () => this.activeWalletIndex,
|
|
2456
2470
|
getUserId: () => this.userId
|
|
2457
|
-
}), this.authGuardService = new
|
|
2471
|
+
}), this.authGuardService = new gr({
|
|
2458
2472
|
isInitialized: () => this.initialized,
|
|
2459
2473
|
isAuthenticated: () => this.authenticated
|
|
2460
|
-
}), this.walletCreationService = new
|
|
2474
|
+
}), this.walletCreationService = new fr({
|
|
2461
2475
|
walletProvider: this.walletProvider,
|
|
2462
2476
|
pinOrchestrator: this.pinOrchestrator,
|
|
2463
2477
|
migrationOrchestrator: this.migrationOrchestrator,
|
|
@@ -2469,10 +2483,10 @@ const ne = class ne extends Yt {
|
|
|
2469
2483
|
var f, m;
|
|
2470
2484
|
return ((m = (f = this.confirmation).showWalletCreatedPrompt) == null ? void 0 : m.call(f)) ?? Promise.resolve();
|
|
2471
2485
|
}
|
|
2472
|
-
}), this.tokenHistoryService = new
|
|
2486
|
+
}), this.tokenHistoryService = new wr({
|
|
2473
2487
|
transport: o,
|
|
2474
2488
|
getApiBaseUrl: () => this.internalConfig.authApiUrl
|
|
2475
|
-
}), this.sessionOrchestrator = new
|
|
2489
|
+
}), this.sessionOrchestrator = new cr({
|
|
2476
2490
|
ensureInitialized: () => this.ensureInitialized(),
|
|
2477
2491
|
getSessionSnapshot: () => ({
|
|
2478
2492
|
providerSub: this.providerSub,
|
|
@@ -2494,8 +2508,8 @@ const ne = class ne extends Yt {
|
|
|
2494
2508
|
applyAuthResult: (f) => this.applyAuthResult(f),
|
|
2495
2509
|
loadWalletAfterAuth: () => this.walletLifecycleService.loadWalletAfterAuth(),
|
|
2496
2510
|
getLocale: () => this._config.locale,
|
|
2497
|
-
maskEmail:
|
|
2498
|
-
}), this.chainRegistry = _, this.jsonRpc = new
|
|
2511
|
+
maskEmail: Te
|
|
2512
|
+
}), this.chainRegistry = _, this.jsonRpc = new Jt(_, o), this.signInUseCase = new De(
|
|
2499
2513
|
this.internalConfig,
|
|
2500
2514
|
t,
|
|
2501
2515
|
s,
|
|
@@ -2505,7 +2519,7 @@ const ne = class ne extends Yt {
|
|
|
2505
2519
|
l,
|
|
2506
2520
|
void 0,
|
|
2507
2521
|
() => this._config.locale
|
|
2508
|
-
), 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(
|
|
2509
2523
|
a,
|
|
2510
2524
|
() => this.signInUseCase.refreshAccessToken()
|
|
2511
2525
|
), e.autoDetectTheme && this._setupAutoDetectTheme();
|
|
@@ -2547,12 +2561,12 @@ const ne = class ne extends Yt {
|
|
|
2547
2561
|
}
|
|
2548
2562
|
async _doInitialize(e) {
|
|
2549
2563
|
var r, t;
|
|
2550
|
-
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));
|
|
2551
2565
|
try {
|
|
2552
|
-
const s =
|
|
2566
|
+
const s = He();
|
|
2553
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`);
|
|
2554
2568
|
const o = this._config.persistWalletPreference !== !1 ? await this.storage.get(
|
|
2555
|
-
|
|
2569
|
+
oe.WALLET_PREF_KEY
|
|
2556
2570
|
).catch(() => null) : null, n = (e == null ? void 0 : e.preferredWalletIndex) ?? (o == null ? void 0 : o.index);
|
|
2557
2571
|
let a = (e == null ? void 0 : e.preferredWalletAddress) ?? (o == null ? void 0 : o.address), l = await this.tryRNBridgeBootstrap();
|
|
2558
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) {
|
|
@@ -2583,7 +2597,7 @@ const ne = class ne extends Yt {
|
|
|
2583
2597
|
throw u;
|
|
2584
2598
|
}
|
|
2585
2599
|
}
|
|
2586
|
-
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;
|
|
2587
2601
|
} catch (s) {
|
|
2588
2602
|
throw new h(d.AUTH_NOT_INITIALIZED, "SDK 초기화에 실패했습니다", s);
|
|
2589
2603
|
}
|
|
@@ -2598,20 +2612,20 @@ const ne = class ne extends Yt {
|
|
|
2598
2612
|
* → 사용자가 signIn() 을 호출할 때 bridge 로그인을 시도한다.
|
|
2599
2613
|
*/
|
|
2600
2614
|
async tryRNBridgeBootstrap() {
|
|
2601
|
-
if (!
|
|
2615
|
+
if (!Y.isAvailable()) return null;
|
|
2602
2616
|
try {
|
|
2603
2617
|
c.log("[CROSSx] RN Bridge 감지 — Handshake 시도"), c.info("[CROSSx][RNBridge trace] Bootstrap config", {
|
|
2604
2618
|
appId: this._config.projectId,
|
|
2605
2619
|
appVersion: "1.0.0",
|
|
2606
|
-
sdkVersion: "2.3.10-beta.
|
|
2620
|
+
sdkVersion: "2.3.10-beta.6",
|
|
2607
2621
|
keyId: "key-id-1",
|
|
2608
2622
|
userIdHash: "user-hash-placeholder",
|
|
2609
2623
|
projectId: this._config.projectId
|
|
2610
2624
|
});
|
|
2611
|
-
const e = new
|
|
2625
|
+
const e = new Y({
|
|
2612
2626
|
appId: this._config.projectId,
|
|
2613
2627
|
appVersion: "1.0.0",
|
|
2614
|
-
sdkVersion: "2.3.10-beta.
|
|
2628
|
+
sdkVersion: "2.3.10-beta.6",
|
|
2615
2629
|
keyId: "key-id-1",
|
|
2616
2630
|
userIdHash: "user-hash-placeholder",
|
|
2617
2631
|
projectId: this._config.projectId
|
|
@@ -2710,7 +2724,7 @@ const ne = class ne extends Yt {
|
|
|
2710
2724
|
* @internal
|
|
2711
2725
|
*/
|
|
2712
2726
|
getRNBridge() {
|
|
2713
|
-
return
|
|
2727
|
+
return Y.getBridge();
|
|
2714
2728
|
}
|
|
2715
2729
|
async signIn(e) {
|
|
2716
2730
|
if (this.ensureInitialized(), this.authenticated)
|
|
@@ -2730,7 +2744,7 @@ const ne = class ne extends Yt {
|
|
|
2730
2744
|
let t = e;
|
|
2731
2745
|
if (!(e != null && e.provider)) {
|
|
2732
2746
|
const s = await this.confirmation.showLoginSelector({
|
|
2733
|
-
connectOtherWallets:
|
|
2747
|
+
connectOtherWallets: Ht(this._config)
|
|
2734
2748
|
});
|
|
2735
2749
|
if (s === null)
|
|
2736
2750
|
return { success: !1, error: "User cancelled login" };
|
|
@@ -2814,10 +2828,9 @@ const ne = class ne extends Yt {
|
|
|
2814
2828
|
d.ALREADY_AUTHENTICATED,
|
|
2815
2829
|
"이미 로그인된 상태입니다. signOut()을 먼저 호출하세요."
|
|
2816
2830
|
);
|
|
2817
|
-
(s = (t = this.oauth).cancelPending) == null || s.call(t, "signInWithOAuthToken으로 외부 인증이 도착했습니다");
|
|
2818
2831
|
let r;
|
|
2819
2832
|
try {
|
|
2820
|
-
r = await this.signInUseCase.executeWithOAuthToken(e), r.success && (this._isAuthenticatedViaRNBridge = !1, this.applyAuthResult(r));
|
|
2833
|
+
r = await this.signInUseCase.executeWithOAuthToken(e), r.success && (this._isAuthenticatedViaRNBridge = !1, this.applyAuthResult(r, "external"), (s = (t = this.oauth).cancelPending) == null || s.call(t, "signInWithOAuthToken으로 외부 인증이 도착했습니다"));
|
|
2821
2834
|
} catch (o) {
|
|
2822
2835
|
throw o instanceof h ? o : new h(d.AUTH_FAILED, "OAuth 토큰 로그인에 실패했습니다", o);
|
|
2823
2836
|
}
|
|
@@ -2867,7 +2880,7 @@ const ne = class ne extends Yt {
|
|
|
2867
2880
|
this.ensureInitialized();
|
|
2868
2881
|
try {
|
|
2869
2882
|
await this.signOutUseCase.execute(), this.clearAuthState();
|
|
2870
|
-
const e =
|
|
2883
|
+
const e = Y.getBridge();
|
|
2871
2884
|
if (e != null && e.signOut)
|
|
2872
2885
|
try {
|
|
2873
2886
|
await e.signOut(), c.log("[CROSSx] RN Bridge signOut 통보 완료 — native trust cache 무효화");
|
|
@@ -3207,7 +3220,7 @@ const ne = class ne extends Yt {
|
|
|
3207
3220
|
* sdk.applyLocale('ko');
|
|
3208
3221
|
*/
|
|
3209
3222
|
applyLocale(e = this._config.locale ?? "en") {
|
|
3210
|
-
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));
|
|
3211
3224
|
}
|
|
3212
3225
|
/**
|
|
3213
3226
|
* PIN 입력 모달의 키보드 방식을 런타임에 변경합니다.
|
|
@@ -3250,7 +3263,7 @@ const ne = class ne extends Yt {
|
|
|
3250
3263
|
return this.withSessionRecovery(() => this._signMessage(e, r, t));
|
|
3251
3264
|
}
|
|
3252
3265
|
async _signMessage(e, r, t) {
|
|
3253
|
-
const s =
|
|
3266
|
+
const s = Y.getBridge();
|
|
3254
3267
|
if (s != null && s.signMessage) {
|
|
3255
3268
|
const n = await s.signMessage({
|
|
3256
3269
|
chainId: e,
|
|
@@ -3329,7 +3342,7 @@ const ne = class ne extends Yt {
|
|
|
3329
3342
|
throw new h(d.AUTH_NOT_AUTHENTICATED, "사용자 ID를 찾을 수 없습니다");
|
|
3330
3343
|
if (!this.walletProvider.signTypedData)
|
|
3331
3344
|
throw new h(d.NOT_IMPLEMENTED, "signTypedData가 구현되어 있지 않습니다");
|
|
3332
|
-
|
|
3345
|
+
ir(e, r);
|
|
3333
3346
|
const s = await this.resolveAddress(t == null ? void 0 : t.index);
|
|
3334
3347
|
try {
|
|
3335
3348
|
const o = await this.signingOrchestrator.confirmAndExecuteWithPreparedPin({
|
|
@@ -3353,7 +3366,7 @@ const ne = class ne extends Yt {
|
|
|
3353
3366
|
s.address
|
|
3354
3367
|
)
|
|
3355
3368
|
});
|
|
3356
|
-
return
|
|
3369
|
+
return rr(o.signature), {
|
|
3357
3370
|
chainId: e,
|
|
3358
3371
|
signature: o.signature,
|
|
3359
3372
|
address: s.address
|
|
@@ -3382,7 +3395,7 @@ const ne = class ne extends Yt {
|
|
|
3382
3395
|
* });
|
|
3383
3396
|
*/
|
|
3384
3397
|
async signTypedDataOffchain(e, r) {
|
|
3385
|
-
return this.signTypedData(
|
|
3398
|
+
return this.signTypedData(oe.OFFCHAIN_CHAIN_ID, e, r);
|
|
3386
3399
|
}
|
|
3387
3400
|
// ============================================================================
|
|
3388
3401
|
// 트랜잭션
|
|
@@ -3401,7 +3414,7 @@ const ne = class ne extends Yt {
|
|
|
3401
3414
|
throw new h(d.AUTH_NOT_AUTHENTICATED, "사용자 ID를 찾을 수 없습니다");
|
|
3402
3415
|
const s = await this.transactionLifecycleService.withResolvedGasAndFee(r, e);
|
|
3403
3416
|
s.from || (s.from = (await this.resolveAddress(t == null ? void 0 : t.index)).address);
|
|
3404
|
-
const o =
|
|
3417
|
+
const o = ke(e);
|
|
3405
3418
|
try {
|
|
3406
3419
|
const n = await this.signingOrchestrator.confirmAndExecuteWithPreparedPin({
|
|
3407
3420
|
confirmation: {
|
|
@@ -3431,7 +3444,7 @@ const ne = class ne extends Yt {
|
|
|
3431
3444
|
a
|
|
3432
3445
|
)
|
|
3433
3446
|
});
|
|
3434
|
-
return
|
|
3447
|
+
return sr(n.signature), {
|
|
3435
3448
|
chainId: e,
|
|
3436
3449
|
signedTx: n.signature,
|
|
3437
3450
|
txHash: n.txHash ?? ""
|
|
@@ -3460,7 +3473,7 @@ const ne = class ne extends Yt {
|
|
|
3460
3473
|
throw new h(d.AUTH_NOT_AUTHENTICATED, "사용자 ID를 찾을 수 없습니다");
|
|
3461
3474
|
const s = await this.transactionLifecycleService.withResolvedGasAndFee(r, e);
|
|
3462
3475
|
s.from || (s.from = (await this.resolveAddress(t == null ? void 0 : t.index)).address);
|
|
3463
|
-
const o =
|
|
3476
|
+
const o = ke(e);
|
|
3464
3477
|
try {
|
|
3465
3478
|
const n = await this.signingOrchestrator.confirmAndExecuteWithPreparedPin({
|
|
3466
3479
|
confirmation: {
|
|
@@ -3500,7 +3513,7 @@ const ne = class ne extends Yt {
|
|
|
3500
3513
|
return u.txHash ?? u.signature;
|
|
3501
3514
|
}
|
|
3502
3515
|
}), a = (r.data ?? "").toLowerCase().replace(/^0x/, ""), l = a === "" || a === "00000000", p = a.startsWith("a9059cbb");
|
|
3503
|
-
return (l || p) && this.tokenHistoryService.registerHistoryFireAndForget(e, n,
|
|
3516
|
+
return (l || p) && this.tokenHistoryService.registerHistoryFireAndForget(e, n, Ft).catch(
|
|
3504
3517
|
(_) => c.log("[TokenHistory] register failed (non-critical):", _)
|
|
3505
3518
|
), { chainId: e, txHash: n, status: "pending" };
|
|
3506
3519
|
} catch (n) {
|
|
@@ -3532,7 +3545,7 @@ const ne = class ne extends Yt {
|
|
|
3532
3545
|
* @param opts.timeoutMs 최대 대기 시간 (기본 60000ms)
|
|
3533
3546
|
*/
|
|
3534
3547
|
async waitForTxAndGetReceipt(e, r, t = {}) {
|
|
3535
|
-
const s = t.intervalMs ??
|
|
3548
|
+
const s = t.intervalMs ?? Ot, o = Lt, n = t.timeoutMs ?? Xe, a = Date.now() + n;
|
|
3536
3549
|
let l = s;
|
|
3537
3550
|
for (; Date.now() < a; ) {
|
|
3538
3551
|
const p = await this.getTransactionReceipt(e, r);
|
|
@@ -3562,32 +3575,32 @@ const ne = class ne extends Yt {
|
|
|
3562
3575
|
async sendTransactionWithWaitForReceipt(e, r, t = {}) {
|
|
3563
3576
|
var m, y;
|
|
3564
3577
|
if (this._isAuthenticatedViaRNBridge) {
|
|
3565
|
-
const
|
|
3566
|
-
if (
|
|
3567
|
-
return this.bridgeSendTransactionWithWaitForReceipt(
|
|
3578
|
+
const S = Y.getBridge();
|
|
3579
|
+
if (S != null && S.sendTransactionWithWaitForReceipt)
|
|
3580
|
+
return this.bridgeSendTransactionWithWaitForReceipt(S, e, r, t);
|
|
3568
3581
|
}
|
|
3569
|
-
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 ?? "";
|
|
3570
3583
|
let x, g;
|
|
3571
|
-
const f = this.waitForTxAndGetReceipt(a, e, { intervalMs: l, timeoutMs: p }).then((
|
|
3572
|
-
x =
|
|
3573
|
-
const
|
|
3584
|
+
const f = this.waitForTxAndGetReceipt(a, e, { intervalMs: l, timeoutMs: p }).then((S) => {
|
|
3585
|
+
x = S;
|
|
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);
|
|
3574
3587
|
return {
|
|
3575
3588
|
chainId: e,
|
|
3576
3589
|
txHash: a,
|
|
3577
|
-
from:
|
|
3578
|
-
to:
|
|
3579
|
-
amount:
|
|
3580
|
-
fees:
|
|
3581
|
-
total:
|
|
3590
|
+
from: S.from,
|
|
3591
|
+
to: S.to ?? r.to,
|
|
3592
|
+
amount: k,
|
|
3593
|
+
fees: T,
|
|
3594
|
+
total: C,
|
|
3582
3595
|
nativeSymbol: _.symbol,
|
|
3583
|
-
status:
|
|
3596
|
+
status: S.status === "0x1" ? "success" : "reverted"
|
|
3584
3597
|
};
|
|
3585
|
-
}).catch((
|
|
3598
|
+
}).catch((S) => (g = S instanceof Error ? S : new Error(String(S)), {
|
|
3586
3599
|
chainId: e,
|
|
3587
3600
|
txHash: a,
|
|
3588
3601
|
from: u,
|
|
3589
3602
|
to: r.to,
|
|
3590
|
-
amount:
|
|
3603
|
+
amount: ye(r.value, _.symbol, _.decimals, this._config.displayDecimals),
|
|
3591
3604
|
nativeSymbol: _.symbol,
|
|
3592
3605
|
status: "timeout"
|
|
3593
3606
|
}));
|
|
@@ -3821,7 +3834,7 @@ const ne = class ne extends Yt {
|
|
|
3821
3834
|
return { wei: "0x0", formatted: "0", chainId: e };
|
|
3822
3835
|
try {
|
|
3823
3836
|
const s = await this.jsonRpc.call("eth_getBalance", [r, "latest"], e) ?? "0x0";
|
|
3824
|
-
return { wei: s, formatted:
|
|
3837
|
+
return { wei: s, formatted: tr(s, this._config.displayDecimals), chainId: e };
|
|
3825
3838
|
} catch (t) {
|
|
3826
3839
|
if (t instanceof h) throw t;
|
|
3827
3840
|
const s = t instanceof Error ? t.message : String(t);
|
|
@@ -3849,7 +3862,7 @@ const ne = class ne extends Yt {
|
|
|
3849
3862
|
getProvider(e) {
|
|
3850
3863
|
this.ensureAuthenticated();
|
|
3851
3864
|
let r = this._providers.get(e);
|
|
3852
|
-
return r || (r = new
|
|
3865
|
+
return r || (r = new Vt(this, e), this._providers.set(e, r)), r;
|
|
3853
3866
|
}
|
|
3854
3867
|
/**
|
|
3855
3868
|
* EIP-1193 `accountsChanged` 이벤트를 모든 활성 provider 인스턴스에 dispatch 한다.
|
|
@@ -3909,7 +3922,7 @@ const ne = class ne extends Yt {
|
|
|
3909
3922
|
* 보안: bridge.isActivated() 가 false 이거나 payload sanitize 실패 시 이벤트 무시.
|
|
3910
3923
|
*/
|
|
3911
3924
|
subscribeBridgeWalletChanged() {
|
|
3912
|
-
const e =
|
|
3925
|
+
const e = Y.getBridge();
|
|
3913
3926
|
if (!(e != null && e.onEvent)) {
|
|
3914
3927
|
c.warn("[CROSSx] bridge.onEvent 미지원 — walletChanged 구독 불가");
|
|
3915
3928
|
return;
|
|
@@ -3940,9 +3953,15 @@ const ne = class ne extends Yt {
|
|
|
3940
3953
|
this.address && this.address.toLowerCase() === s.toLowerCase() || (c.log("[CROSSx] Native walletChanged 수신", { address: s, walletId: t.walletId, source: t.source, walletName: n }), this.setActiveWallet(s, 0, { walletName: n }), this._rnBridgeWalletAddress = s, this._rnBridgeWalletName = n);
|
|
3941
3954
|
}), c.log("[CROSSx] bridge.onEvent walletChanged 구독 완료");
|
|
3942
3955
|
}
|
|
3943
|
-
/**
|
|
3944
|
-
|
|
3945
|
-
|
|
3956
|
+
/**
|
|
3957
|
+
* AuthResult를 내부 상태에 반영합니다.
|
|
3958
|
+
*
|
|
3959
|
+
* @param source 외부 경로(JS injection → signInWithOAuthToken) 인증이면
|
|
3960
|
+
* `'external'`. `authChanged` 구독자가 자기 호출의 결과와 구분할 수 있게
|
|
3961
|
+
* 그대로 전달된다(AuthChangedEvent.source 주석 참고).
|
|
3962
|
+
*/
|
|
3963
|
+
applyAuthResult(e, r) {
|
|
3964
|
+
this.stateManager.applyAuthResult(e, r);
|
|
3946
3965
|
}
|
|
3947
3966
|
/** 인증 상태를 초기화합니다. */
|
|
3948
3967
|
clearAuthState() {
|
|
@@ -4064,7 +4083,7 @@ const ne = class ne extends Yt {
|
|
|
4064
4083
|
*/
|
|
4065
4084
|
dispose() {
|
|
4066
4085
|
var e;
|
|
4067
|
-
(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);
|
|
4068
4087
|
}
|
|
4069
4088
|
/**
|
|
4070
4089
|
* @internal internal 패키지 전용 — 공개 문서에 기재하지 않음
|
|
@@ -4084,9 +4103,9 @@ const ne = class ne extends Yt {
|
|
|
4084
4103
|
};
|
|
4085
4104
|
}
|
|
4086
4105
|
};
|
|
4087
|
-
|
|
4088
|
-
let
|
|
4089
|
-
class
|
|
4106
|
+
oe.WALLET_PREF_KEY = "wallet_preference", oe.OFFCHAIN_CHAIN_ID = "0";
|
|
4107
|
+
let Me = oe;
|
|
4108
|
+
class mr {
|
|
4090
4109
|
constructor() {
|
|
4091
4110
|
this.prefix = "crossx_";
|
|
4092
4111
|
}
|
|
@@ -4123,8 +4142,8 @@ class gr {
|
|
|
4123
4142
|
}
|
|
4124
4143
|
}
|
|
4125
4144
|
}
|
|
4126
|
-
const
|
|
4127
|
-
class
|
|
4145
|
+
const Re = "crossx-sdk", yr = 1, j = "data", te = "keys", be = "aes-primary", br = 12;
|
|
4146
|
+
class nt {
|
|
4128
4147
|
constructor(e) {
|
|
4129
4148
|
this.db = null, this.cryptoKey = null, this.initPromise = null, this.dbName = `crossx-sdk-${e}`;
|
|
4130
4149
|
}
|
|
@@ -4133,10 +4152,10 @@ class it {
|
|
|
4133
4152
|
}
|
|
4134
4153
|
openDB(e = this.dbName) {
|
|
4135
4154
|
return new Promise((r, t) => {
|
|
4136
|
-
const s = indexedDB.open(e,
|
|
4155
|
+
const s = indexedDB.open(e, yr);
|
|
4137
4156
|
s.onupgradeneeded = () => {
|
|
4138
4157
|
const o = s.result;
|
|
4139
|
-
o.objectStoreNames.contains(
|
|
4158
|
+
o.objectStoreNames.contains(j) || o.createObjectStore(j), o.objectStoreNames.contains(te) || o.createObjectStore(te);
|
|
4140
4159
|
}, s.onsuccess = () => r(s.result), s.onerror = () => t(s.error);
|
|
4141
4160
|
});
|
|
4142
4161
|
}
|
|
@@ -4166,7 +4185,7 @@ class it {
|
|
|
4166
4185
|
}
|
|
4167
4186
|
async init() {
|
|
4168
4187
|
this.db = await this.openDB();
|
|
4169
|
-
const e = await this.idbGet(
|
|
4188
|
+
const e = await this.idbGet(te, be);
|
|
4170
4189
|
if (e) {
|
|
4171
4190
|
this.cryptoKey = e;
|
|
4172
4191
|
return;
|
|
@@ -4180,21 +4199,21 @@ class it {
|
|
|
4180
4199
|
{ name: "AES-GCM", length: 256 },
|
|
4181
4200
|
!1,
|
|
4182
4201
|
["encrypt", "decrypt"]
|
|
4183
|
-
), await this.idbPut(
|
|
4202
|
+
), await this.idbPut(te, be, this.cryptoKey);
|
|
4184
4203
|
}
|
|
4185
4204
|
/**
|
|
4186
4205
|
* 레거시 DB('crossx-sdk')에서 projectId 스코프 DB로 암호키·데이터 마이그레이션.
|
|
4187
4206
|
* 마이그레이션 성공 시 레거시 DB 삭제.
|
|
4188
4207
|
*/
|
|
4189
4208
|
async migrateFromLegacyDB() {
|
|
4190
|
-
if (this.dbName ===
|
|
4209
|
+
if (this.dbName === Re) return null;
|
|
4191
4210
|
try {
|
|
4192
|
-
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, _) => {
|
|
4193
4212
|
t.onsuccess = () => p(t.result), t.onerror = () => _(t.error);
|
|
4194
4213
|
});
|
|
4195
4214
|
if (!s)
|
|
4196
4215
|
return e.close(), null;
|
|
4197
|
-
const o = r.objectStore(
|
|
4216
|
+
const o = r.objectStore(j).getAll(), n = r.objectStore(j).getAllKeys(), [a, l] = await Promise.all([
|
|
4198
4217
|
new Promise((p, _) => {
|
|
4199
4218
|
o.onsuccess = () => p(o.result), o.onerror = () => _(o.error);
|
|
4200
4219
|
}),
|
|
@@ -4202,16 +4221,16 @@ class it {
|
|
|
4202
4221
|
n.onsuccess = () => p(n.result), n.onerror = () => _(n.error);
|
|
4203
4222
|
})
|
|
4204
4223
|
]);
|
|
4205
|
-
e.close(), await this.idbPut(
|
|
4224
|
+
e.close(), await this.idbPut(te, be, s);
|
|
4206
4225
|
for (let p = 0; p < l.length; p++)
|
|
4207
|
-
await this.idbPut(
|
|
4208
|
-
return indexedDB.deleteDatabase(
|
|
4226
|
+
await this.idbPut(j, String(l[p]), a[p]);
|
|
4227
|
+
return indexedDB.deleteDatabase(Re), c.log("[CROSSx] IndexedDB 레거시 DB 마이그레이션 완료"), s;
|
|
4209
4228
|
} catch (e) {
|
|
4210
4229
|
return c.warn("[CROSSx] IndexedDB 레거시 DB 마이그레이션 실패:", e), null;
|
|
4211
4230
|
}
|
|
4212
4231
|
}
|
|
4213
4232
|
async encrypt(e) {
|
|
4214
|
-
const r = new Uint8Array(
|
|
4233
|
+
const r = new Uint8Array(br);
|
|
4215
4234
|
crypto.getRandomValues(r);
|
|
4216
4235
|
const t = new TextEncoder().encode(e), s = await crypto.subtle.encrypt(
|
|
4217
4236
|
{ name: "AES-GCM", iv: r },
|
|
@@ -4232,7 +4251,7 @@ class it {
|
|
|
4232
4251
|
try {
|
|
4233
4252
|
await this.ensureReady();
|
|
4234
4253
|
const t = JSON.stringify(r), s = await this.encrypt(t);
|
|
4235
|
-
await this.idbPut(
|
|
4254
|
+
await this.idbPut(j, e, s);
|
|
4236
4255
|
} catch (t) {
|
|
4237
4256
|
throw c.error("[CROSSx] IndexedDB set error:", t), t;
|
|
4238
4257
|
}
|
|
@@ -4240,7 +4259,7 @@ class it {
|
|
|
4240
4259
|
async get(e) {
|
|
4241
4260
|
try {
|
|
4242
4261
|
await this.ensureReady();
|
|
4243
|
-
const r = await this.idbGet(
|
|
4262
|
+
const r = await this.idbGet(j, e);
|
|
4244
4263
|
if (!r) return null;
|
|
4245
4264
|
const t = await this.decrypt(r);
|
|
4246
4265
|
return JSON.parse(t);
|
|
@@ -4250,14 +4269,14 @@ class it {
|
|
|
4250
4269
|
}
|
|
4251
4270
|
async remove(e) {
|
|
4252
4271
|
try {
|
|
4253
|
-
await this.ensureReady(), await this.idbDelete(
|
|
4272
|
+
await this.ensureReady(), await this.idbDelete(j, e);
|
|
4254
4273
|
} catch (r) {
|
|
4255
4274
|
throw c.error("[CROSSx] IndexedDB remove error:", r), r;
|
|
4256
4275
|
}
|
|
4257
4276
|
}
|
|
4258
4277
|
async clear() {
|
|
4259
4278
|
try {
|
|
4260
|
-
await this.ensureReady(), await this.idbClear(
|
|
4279
|
+
await this.ensureReady(), await this.idbClear(j);
|
|
4261
4280
|
} catch (e) {
|
|
4262
4281
|
throw c.error("[CROSSx] IndexedDB clear error:", e), e;
|
|
4263
4282
|
}
|
|
@@ -4269,14 +4288,14 @@ class it {
|
|
|
4269
4288
|
return typeof indexedDB < "u" && typeof crypto < "u" && typeof crypto.subtle < "u";
|
|
4270
4289
|
}
|
|
4271
4290
|
}
|
|
4272
|
-
const
|
|
4273
|
-
class
|
|
4291
|
+
const vr = 60;
|
|
4292
|
+
class Sr {
|
|
4274
4293
|
constructor() {
|
|
4275
4294
|
this.jwks = null;
|
|
4276
4295
|
}
|
|
4277
4296
|
setJWKSEndpoint(e) {
|
|
4278
4297
|
try {
|
|
4279
|
-
this.jwks =
|
|
4298
|
+
this.jwks = kt(new URL(e)), c.log("[CROSSx] JWKS 엔드포인트 설정:", e);
|
|
4280
4299
|
} catch (r) {
|
|
4281
4300
|
c.warn("[CROSSx] JWKS 엔드포인트 URL 파싱 실패:", r);
|
|
4282
4301
|
}
|
|
@@ -4290,7 +4309,7 @@ class yr {
|
|
|
4290
4309
|
iat: t.iat
|
|
4291
4310
|
});
|
|
4292
4311
|
const s = Math.floor(Date.now() / 1e3);
|
|
4293
|
-
if (t.exp && t.exp +
|
|
4312
|
+
if (t.exp && t.exp + vr < s)
|
|
4294
4313
|
return c.warn("[CROSSx] 토큰 만료:", {
|
|
4295
4314
|
exp: t.exp,
|
|
4296
4315
|
now: s,
|
|
@@ -4300,7 +4319,7 @@ class yr {
|
|
|
4300
4319
|
return c.warn("[CROSSx] JWT에 sub(사용자ID) 없음"), { payload: t, valid: !1, signatureVerified: !1 };
|
|
4301
4320
|
if (this.jwks)
|
|
4302
4321
|
try {
|
|
4303
|
-
const { payload: o } = await
|
|
4322
|
+
const { payload: o } = await Tt(e, this.jwks, {
|
|
4304
4323
|
algorithms: ["RS256", "ES256"]
|
|
4305
4324
|
});
|
|
4306
4325
|
return c.log("[CROSSx] JWT 서명 검증 성공"), {
|
|
@@ -4319,7 +4338,7 @@ class yr {
|
|
|
4319
4338
|
}
|
|
4320
4339
|
}
|
|
4321
4340
|
decodeJWT(e) {
|
|
4322
|
-
return
|
|
4341
|
+
return Rt(e);
|
|
4323
4342
|
}
|
|
4324
4343
|
/**
|
|
4325
4344
|
* EIP-191 personal_sign 서명에서 서명자 Ethereum 주소를 복원합니다.
|
|
@@ -4334,29 +4353,29 @@ class yr {
|
|
|
4334
4353
|
${t.length}`
|
|
4335
4354
|
), o = new Uint8Array(s.length + t.length);
|
|
4336
4355
|
o.set(s, 0), o.set(t, s.length);
|
|
4337
|
-
const n =
|
|
4356
|
+
const n = Ye(o), a = r.startsWith("0x") ? r.slice(2) : r;
|
|
4338
4357
|
if (a.length !== 130)
|
|
4339
4358
|
throw new Error(`서명 길이가 유효하지 않습니다: 130 hex 문자 예상, 현재 ${a.length}`);
|
|
4340
|
-
const l =
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
).addRecoveryBit(x).recoverPublicKey(n).toBytes(!1).slice(1), y =
|
|
4344
|
-
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));
|
|
4345
4364
|
}
|
|
4346
4365
|
}
|
|
4347
|
-
function
|
|
4366
|
+
function Er(i) {
|
|
4348
4367
|
const e = new Uint8Array(i.length / 2);
|
|
4349
4368
|
for (let r = 0; r < e.length; r++)
|
|
4350
4369
|
e[r] = parseInt(i.substring(r * 2, r * 2 + 2), 16);
|
|
4351
4370
|
return e;
|
|
4352
4371
|
}
|
|
4353
|
-
function
|
|
4372
|
+
function at(i) {
|
|
4354
4373
|
let e = "0x";
|
|
4355
4374
|
for (const r of i) e += r.toString(16).padStart(2, "0");
|
|
4356
4375
|
return BigInt(e);
|
|
4357
4376
|
}
|
|
4358
|
-
const
|
|
4359
|
-
class
|
|
4377
|
+
const Ar = 3e4, Ir = 1e3;
|
|
4378
|
+
class kr {
|
|
4360
4379
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4361
4380
|
async request(e) {
|
|
4362
4381
|
const r = e.retries ?? 0;
|
|
@@ -4367,7 +4386,7 @@ class Er {
|
|
|
4367
4386
|
} catch (s) {
|
|
4368
4387
|
if (t === r) throw s;
|
|
4369
4388
|
}
|
|
4370
|
-
await new Promise((s) => setTimeout(s,
|
|
4389
|
+
await new Promise((s) => setTimeout(s, Ir * 2 ** t));
|
|
4371
4390
|
}
|
|
4372
4391
|
throw new Error("Unexpected: retry loop exited without result");
|
|
4373
4392
|
}
|
|
@@ -4375,7 +4394,7 @@ class Er {
|
|
|
4375
4394
|
async _doRequest(e) {
|
|
4376
4395
|
const r = new AbortController(), t = setTimeout(
|
|
4377
4396
|
() => r.abort(),
|
|
4378
|
-
e.timeoutMs ??
|
|
4397
|
+
e.timeoutMs ?? Ar
|
|
4379
4398
|
);
|
|
4380
4399
|
try {
|
|
4381
4400
|
const s = await fetch(e.url, {
|
|
@@ -4402,15 +4421,75 @@ class Er {
|
|
|
4402
4421
|
}
|
|
4403
4422
|
}
|
|
4404
4423
|
}
|
|
4405
|
-
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([
|
|
4406
4485
|
"https://cross-wallet-oauth.crosstoken.io",
|
|
4407
4486
|
"https://stg-cross-wallet-oauth.crosstoken.io",
|
|
4408
4487
|
"https://dev-cross-wallet-oauth.crosstoken.io",
|
|
4409
4488
|
"https://one-wallet-oauth.onechain.nexus",
|
|
4410
4489
|
"https://stg-one-wallet-oauth.onechain.nexus",
|
|
4411
4490
|
"https://dev-one-wallet-oauth.onechain.nexus"
|
|
4412
|
-
]),
|
|
4413
|
-
class
|
|
4491
|
+
]), Or = "crossx://oauth-callback";
|
|
4492
|
+
class se {
|
|
4414
4493
|
constructor() {
|
|
4415
4494
|
this.abortPending = null;
|
|
4416
4495
|
}
|
|
@@ -4445,7 +4524,7 @@ class ie {
|
|
|
4445
4524
|
* - Google 및 기타: originalNonce === jwt.nonce
|
|
4446
4525
|
*/
|
|
4447
4526
|
static async verifyIdTokenNonce(e, r) {
|
|
4448
|
-
const t =
|
|
4527
|
+
const t = se.parseJwtPayload(e), s = t.nonce, o = typeof t.iss == "string" ? t.iss : "(unknown)";
|
|
4449
4528
|
if (c.log("[CROSSx] nonce 검증 시작 —", {
|
|
4450
4529
|
iss: o,
|
|
4451
4530
|
nonceClaimType: typeof s,
|
|
@@ -4467,7 +4546,7 @@ class ie {
|
|
|
4467
4546
|
return;
|
|
4468
4547
|
}
|
|
4469
4548
|
if (o.includes("appleid.apple.com")) {
|
|
4470
|
-
const n = await
|
|
4549
|
+
const n = await se.sha256Hex(r);
|
|
4471
4550
|
if (c.log("[CROSSx] Apple nonce 검증 —", {
|
|
4472
4551
|
expectedHashLength: n.length,
|
|
4473
4552
|
receivedHashLength: s.length,
|
|
@@ -4484,91 +4563,96 @@ class ie {
|
|
|
4484
4563
|
}
|
|
4485
4564
|
openAuth(e) {
|
|
4486
4565
|
return new Promise((r, t) => {
|
|
4487
|
-
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);
|
|
4488
4567
|
let x = `${e.authUrl}${_}state=${l}&nonce=${p}&origin=${u}`;
|
|
4489
|
-
|
|
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 생성 완료:", {
|
|
4490
4574
|
stateLength: l.length,
|
|
4491
4575
|
nonceLength: p.length,
|
|
4492
4576
|
authUrlBase: e.authUrl
|
|
4493
4577
|
});
|
|
4494
|
-
const
|
|
4578
|
+
const f = window.open(
|
|
4495
4579
|
x,
|
|
4496
4580
|
"CROSSx OAuth",
|
|
4497
4581
|
`width=${s},height=${o},left=${n},top=${a}`
|
|
4498
4582
|
);
|
|
4499
|
-
if (!
|
|
4583
|
+
if (!f) {
|
|
4500
4584
|
t(new Error("팝업 창을 열 수 없습니다. 팝업 차단을 해제해 주세요."));
|
|
4501
4585
|
return;
|
|
4502
4586
|
}
|
|
4503
|
-
const
|
|
4504
|
-
c.warn("[CROSSx] OAuth 타임아웃 (5분) — postMessage를 수신하지 못했습니다"),
|
|
4505
|
-
}, 5 * 60 * 1e3),
|
|
4506
|
-
let
|
|
4507
|
-
const
|
|
4508
|
-
clearInterval(T), c.warn("[CROSSx] COOP 감지 — OAuth 서버 응답을 " +
|
|
4509
|
-
|
|
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(
|
|
4510
4594
|
"OAuth 서버로부터 응답을 받지 못했습니다. 브라우저 보안 정책(COOP)으로 인해 팝업 통신이 차단되었을 수 있습니다. 다시 시도해 주세요."
|
|
4511
4595
|
));
|
|
4512
|
-
},
|
|
4596
|
+
}, S * 1e3);
|
|
4513
4597
|
}, T = setInterval(() => {
|
|
4514
|
-
|
|
4598
|
+
A++;
|
|
4515
4599
|
try {
|
|
4516
|
-
if (!
|
|
4600
|
+
if (!f.closed) return;
|
|
4517
4601
|
const M = typeof document < "u" && document.hasFocus();
|
|
4518
|
-
|
|
4602
|
+
A <= y && !M ? k() : (C(), t(new Error("로그인이 취소되었습니다")));
|
|
4519
4603
|
} catch {
|
|
4520
|
-
|
|
4604
|
+
k();
|
|
4521
4605
|
}
|
|
4522
|
-
}, 1e3),
|
|
4523
|
-
this.abortPending = null, clearTimeout(
|
|
4524
|
-
},
|
|
4525
|
-
if (!
|
|
4526
|
-
|
|
4527
|
-
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;
|
|
4528
4612
|
c.log("[CROSSx] OAuth postMessage 수신 —", {
|
|
4529
|
-
format:
|
|
4530
|
-
status:
|
|
4613
|
+
format: H ? "wrapped" : "flat",
|
|
4614
|
+
status: H ? M.data.status : "(flat)"
|
|
4531
4615
|
});
|
|
4532
|
-
const
|
|
4533
|
-
if (!
|
|
4616
|
+
const P = (O == null ? void 0 : O.state) ?? M.data.state;
|
|
4617
|
+
if (!P || P !== l) {
|
|
4534
4618
|
t(new Error("OAuth state mismatch — possible CSRF attack"));
|
|
4535
4619
|
return;
|
|
4536
4620
|
}
|
|
4537
|
-
if (
|
|
4538
|
-
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"));
|
|
4539
4623
|
return;
|
|
4540
4624
|
}
|
|
4541
|
-
if (!
|
|
4542
|
-
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"));
|
|
4543
4627
|
return;
|
|
4544
4628
|
}
|
|
4545
|
-
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;
|
|
4546
4630
|
if (c.log("[CROSSx] OAuth 토큰 수신:", {
|
|
4547
|
-
hasAccessToken: !!
|
|
4548
|
-
hasIdToken: !!
|
|
4549
|
-
hasEmail: !!
|
|
4550
|
-
}), !
|
|
4631
|
+
hasAccessToken: !!B,
|
|
4632
|
+
hasIdToken: !!L,
|
|
4633
|
+
hasEmail: !!he
|
|
4634
|
+
}), !ne) {
|
|
4551
4635
|
c.error("[CROSSx] 토큰을 찾을 수 없음:", M.data), t(new Error("Token not found in response"));
|
|
4552
4636
|
return;
|
|
4553
4637
|
}
|
|
4554
|
-
const
|
|
4555
|
-
|
|
4556
|
-
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"));
|
|
4557
4641
|
});
|
|
4558
4642
|
};
|
|
4559
|
-
|
|
4643
|
+
B ? B.split(".").length === 3 ? ae(B) : L ? ae(L) : (c.warn(
|
|
4560
4644
|
"[CROSSx] opaque accessToken만 수신 (idToken 없음) — nonce 검증 불가.",
|
|
4561
4645
|
"서버 측 nonce 검증이 필요합니다."
|
|
4562
|
-
), r(
|
|
4646
|
+
), r(we)) : L ? ae(L) : t(new Error("Token not found in response"));
|
|
4563
4647
|
};
|
|
4564
4648
|
this.abortPending = (M) => {
|
|
4565
|
-
|
|
4566
|
-
}, window.addEventListener("message",
|
|
4649
|
+
C(), t(new Error(M));
|
|
4650
|
+
}, window.addEventListener("message", z);
|
|
4567
4651
|
});
|
|
4568
4652
|
}
|
|
4569
4653
|
}
|
|
4570
|
-
const xe = "crossx_wallet_data",
|
|
4571
|
-
class
|
|
4654
|
+
const xe = "crossx_wallet_data", de = "crossx_mock_pin_hash";
|
|
4655
|
+
class Lr {
|
|
4572
4656
|
constructor(e, r) {
|
|
4573
4657
|
this.storage = e, this.pinStore = r ?? null;
|
|
4574
4658
|
}
|
|
@@ -4597,7 +4681,7 @@ class Tr {
|
|
|
4597
4681
|
};
|
|
4598
4682
|
await this.storage.set(xe, s);
|
|
4599
4683
|
const o = (r = this.pinStore) == null ? void 0 : r.get();
|
|
4600
|
-
return o && (await this.storage.set(
|
|
4684
|
+
return o && (await this.storage.set(de, o), c.log("[Mock] 지갑 생성 — PIN 저장됨")), s;
|
|
4601
4685
|
} catch (t) {
|
|
4602
4686
|
throw new h(d.WALLET_CREATION_FAILED, "지갑 생성에 실패했습니다", t);
|
|
4603
4687
|
}
|
|
@@ -4639,8 +4723,8 @@ class Tr {
|
|
|
4639
4723
|
var t;
|
|
4640
4724
|
if (c.log("[Mock] verifyPin"), this.pinScenario === "wrong")
|
|
4641
4725
|
return !1;
|
|
4642
|
-
const r = await this.storage.get(
|
|
4643
|
-
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);
|
|
4644
4728
|
}
|
|
4645
4729
|
/**
|
|
4646
4730
|
* POST /mnemonic/change-password 모킹
|
|
@@ -4650,10 +4734,10 @@ class Tr {
|
|
|
4650
4734
|
var o;
|
|
4651
4735
|
if (c.log("[Mock] changePin"), this.pinScenario === "wrong")
|
|
4652
4736
|
throw new h(d.PIN_WRONG, "Incorrect PIN.");
|
|
4653
|
-
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);
|
|
4654
4738
|
if (s && t && s !== t)
|
|
4655
4739
|
throw new h(d.PIN_WRONG, "Incorrect PIN.");
|
|
4656
|
-
await this.storage.set(
|
|
4740
|
+
await this.storage.set(de, r), c.log("[Mock] changePin 완료");
|
|
4657
4741
|
}
|
|
4658
4742
|
async migrateWallet(e, r) {
|
|
4659
4743
|
var o;
|
|
@@ -4686,7 +4770,7 @@ class Tr {
|
|
|
4686
4770
|
};
|
|
4687
4771
|
await this.storage.set(xe, t);
|
|
4688
4772
|
const s = (o = this.pinStore) == null ? void 0 : o.get();
|
|
4689
|
-
return s && (await this.storage.set(
|
|
4773
|
+
return s && (await this.storage.set(de, s), c.log("[Mock] 마이그레이션 — PIN 저장됨")), t;
|
|
4690
4774
|
}
|
|
4691
4775
|
/**
|
|
4692
4776
|
* POST /mnemonic/share-c 모킹
|
|
@@ -4713,7 +4797,7 @@ class Tr {
|
|
|
4713
4797
|
).join("");
|
|
4714
4798
|
}
|
|
4715
4799
|
}
|
|
4716
|
-
class
|
|
4800
|
+
class ie {
|
|
4717
4801
|
constructor(e, r, t, s, o) {
|
|
4718
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;
|
|
4719
4803
|
}
|
|
@@ -4740,9 +4824,9 @@ class oe {
|
|
|
4740
4824
|
*/
|
|
4741
4825
|
async ensureValidToken() {
|
|
4742
4826
|
const e = this.tokenStore.get();
|
|
4743
|
-
if (e && !this.tokenStore.isExpiringSoon(
|
|
4827
|
+
if (e && !this.tokenStore.isExpiringSoon(et))
|
|
4744
4828
|
return e;
|
|
4745
|
-
const r = !e || this.tokenStore.isExpiringSoon(
|
|
4829
|
+
const r = !e || this.tokenStore.isExpiringSoon(et);
|
|
4746
4830
|
if (this._onTokenRefresh) {
|
|
4747
4831
|
if (await this.deduplicatedRefresh()) {
|
|
4748
4832
|
const s = this.tokenStore.get();
|
|
@@ -4790,7 +4874,7 @@ class oe {
|
|
|
4790
4874
|
url: n,
|
|
4791
4875
|
method: e
|
|
4792
4876
|
});
|
|
4793
|
-
const m =
|
|
4877
|
+
const m = ie.mapGatewayError(g.code, g.data);
|
|
4794
4878
|
if (m === d.AUTH_NOT_AUTHENTICATED && !s && this._onTokenRefresh) {
|
|
4795
4879
|
if (c.warn("[CROSSx] Gateway -10002 감지 — 토큰 갱신 후 재시도"), await this.deduplicatedRefresh())
|
|
4796
4880
|
return this.request(e, r, t, !0);
|
|
@@ -4799,11 +4883,11 @@ class oe {
|
|
|
4799
4883
|
if (m === d.USER_NOT_FOUND)
|
|
4800
4884
|
throw c.warn("[CROSSx] Gateway -10033 감지 — 유저 미존재, 강제 로그아웃"), (l = this._onUnauthorized) == null || l.call(this), new h(
|
|
4801
4885
|
d.USER_NOT_FOUND,
|
|
4802
|
-
|
|
4886
|
+
ie.getGatewayErrorMessage(g.code, f)
|
|
4803
4887
|
);
|
|
4804
|
-
const y = m === d.AUTH_NOT_AUTHENTICATED ? d.SESSION_EXPIRED : m,
|
|
4805
|
-
let
|
|
4806
|
-
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);
|
|
4807
4891
|
}
|
|
4808
4892
|
return c.log("[CROSSx] Wallet Gateway API 성공:", { code: g.code, url: n, method: e }), g.data ?? g;
|
|
4809
4893
|
}
|
|
@@ -5120,7 +5204,7 @@ class oe {
|
|
|
5120
5204
|
case -10025:
|
|
5121
5205
|
return d.INVALID_APP_TYPE;
|
|
5122
5206
|
case -10028:
|
|
5123
|
-
return
|
|
5207
|
+
return ie.hasLockInfo(r) ? d.PIN_LOCKED : d.PIN_WRONG;
|
|
5124
5208
|
case -10029:
|
|
5125
5209
|
return d.PIN_INVALID;
|
|
5126
5210
|
case -10031:
|
|
@@ -5191,7 +5275,7 @@ class oe {
|
|
|
5191
5275
|
case -10033:
|
|
5192
5276
|
return "User not found. You have been signed out.";
|
|
5193
5277
|
case -10036:
|
|
5194
|
-
return `Account limit reached. Maximum ${
|
|
5278
|
+
return `Account limit reached. Maximum ${Le} accounts allowed.`;
|
|
5195
5279
|
case -10040:
|
|
5196
5280
|
return "HMAC signature header is required.";
|
|
5197
5281
|
case -10041:
|
|
@@ -5201,7 +5285,7 @@ class oe {
|
|
|
5201
5285
|
}
|
|
5202
5286
|
}
|
|
5203
5287
|
}
|
|
5204
|
-
class
|
|
5288
|
+
class Dr {
|
|
5205
5289
|
constructor(e, r, t, s = () => {
|
|
5206
5290
|
}, o = () => {
|
|
5207
5291
|
}) {
|
|
@@ -5352,7 +5436,7 @@ class fe {
|
|
|
5352
5436
|
}
|
|
5353
5437
|
isCacheValid() {
|
|
5354
5438
|
if (this.loadedAt === 0) return !1;
|
|
5355
|
-
const e = this.usingFallback ?
|
|
5439
|
+
const e = this.usingFallback ? $t : Mt;
|
|
5356
5440
|
return e === 0 ? !0 : Date.now() - this.loadedAt < e;
|
|
5357
5441
|
}
|
|
5358
5442
|
populateCache(e, r) {
|
|
@@ -5390,7 +5474,7 @@ class fe {
|
|
|
5390
5474
|
);
|
|
5391
5475
|
}
|
|
5392
5476
|
static fallbackChains() {
|
|
5393
|
-
return Object.values(
|
|
5477
|
+
return Object.values(Ae).map((e) => ({
|
|
5394
5478
|
chainId: e.caipId,
|
|
5395
5479
|
rpcUrl: e.rpcUrl
|
|
5396
5480
|
}));
|
|
@@ -5414,7 +5498,7 @@ class fe {
|
|
|
5414
5498
|
}
|
|
5415
5499
|
}
|
|
5416
5500
|
}
|
|
5417
|
-
const
|
|
5501
|
+
const lt = "__crossx-confirm-style", F = "__crossx-confirm-overlay", Mr = {
|
|
5418
5502
|
light: {
|
|
5419
5503
|
bg: "#FFFFFF",
|
|
5420
5504
|
border: "rgba(0,0,0,0.07)",
|
|
@@ -5482,8 +5566,8 @@ const nt = "__crossx-confirm-style", F = "__crossx-confirm-overlay", Cr = {
|
|
|
5482
5566
|
onPrimary: "#000000"
|
|
5483
5567
|
}
|
|
5484
5568
|
};
|
|
5485
|
-
function
|
|
5486
|
-
const r =
|
|
5569
|
+
function dt(i, e) {
|
|
5570
|
+
const r = Mr[i], t = e == null ? void 0 : e[i];
|
|
5487
5571
|
return t ? {
|
|
5488
5572
|
...r,
|
|
5489
5573
|
// ── Brand
|
|
@@ -5517,7 +5601,7 @@ function at(i, e) {
|
|
|
5517
5601
|
...t.error !== void 0 && { errorColor: t.error }
|
|
5518
5602
|
} : r;
|
|
5519
5603
|
}
|
|
5520
|
-
const
|
|
5604
|
+
const $r = `
|
|
5521
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');
|
|
5522
5606
|
|
|
5523
5607
|
#${F} {
|
|
@@ -8119,10 +8203,10 @@ button.__crossx-connect-other-block:active {
|
|
|
8119
8203
|
}
|
|
8120
8204
|
`;
|
|
8121
8205
|
function K() {
|
|
8122
|
-
let i = document.getElementById(
|
|
8123
|
-
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;
|
|
8124
8208
|
}
|
|
8125
|
-
function
|
|
8209
|
+
function Fr() {
|
|
8126
8210
|
const i = `#${F}`, e = (t) => {
|
|
8127
8211
|
var s, o;
|
|
8128
8212
|
(o = (s = t.target) == null ? void 0 : s.closest) != null && o.call(s, i) && t.stopImmediatePropagation();
|
|
@@ -8134,7 +8218,7 @@ function Nr() {
|
|
|
8134
8218
|
document.removeEventListener("focusin", e, !0), document.removeEventListener("focusout", r, !0);
|
|
8135
8219
|
};
|
|
8136
8220
|
}
|
|
8137
|
-
function
|
|
8221
|
+
function V(i) {
|
|
8138
8222
|
const e = i.querySelector(".__crossx-card");
|
|
8139
8223
|
if (e) {
|
|
8140
8224
|
const a = (e.getAttribute("style") ?? "").match(/--cx-bg:\s*([^;]+)/);
|
|
@@ -8162,12 +8246,12 @@ function z(i) {
|
|
|
8162
8246
|
}
|
|
8163
8247
|
n.preventDefault();
|
|
8164
8248
|
}, { passive: !1 });
|
|
8165
|
-
const t =
|
|
8249
|
+
const t = Fr(), s = Br(i), o = i.remove.bind(i);
|
|
8166
8250
|
i.remove = () => {
|
|
8167
8251
|
s(), t(), o();
|
|
8168
8252
|
}, document.body.appendChild(i);
|
|
8169
8253
|
}
|
|
8170
|
-
function
|
|
8254
|
+
function Br(i) {
|
|
8171
8255
|
if (typeof window > "u") return () => {
|
|
8172
8256
|
};
|
|
8173
8257
|
const e = window.visualViewport;
|
|
@@ -8182,7 +8266,7 @@ function Or(i) {
|
|
|
8182
8266
|
e.removeEventListener("resize", t), e.removeEventListener("scroll", t), i.style.removeProperty("--cx-keyboard-inset");
|
|
8183
8267
|
};
|
|
8184
8268
|
}
|
|
8185
|
-
function
|
|
8269
|
+
function Wr(i) {
|
|
8186
8270
|
const e = Array.from(i.querySelectorAll(".__crossx-amount-tip"));
|
|
8187
8271
|
if (!e.length) return;
|
|
8188
8272
|
const r = document.createElement("div");
|
|
@@ -8206,9 +8290,9 @@ function Lr(i) {
|
|
|
8206
8290
|
n.target.closest(".__crossx-amount-tip") || o();
|
|
8207
8291
|
}, { passive: !0 });
|
|
8208
8292
|
}
|
|
8209
|
-
const
|
|
8210
|
-
function
|
|
8211
|
-
if (
|
|
8293
|
+
const Ur = () => /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
|
|
8294
|
+
function re() {
|
|
8295
|
+
if (Ur()) {
|
|
8212
8296
|
const e = window.scrollY;
|
|
8213
8297
|
return document.body.style.position = "fixed", document.body.style.top = `-${e}px`, document.body.style.left = "0", document.body.style.right = "0", () => {
|
|
8214
8298
|
document.body.style.position = "", document.body.style.top = "", document.body.style.left = "", document.body.style.right = "", window.scrollTo(0, e);
|
|
@@ -8219,26 +8303,26 @@ function se() {
|
|
|
8219
8303
|
document.body.style.overflow = i;
|
|
8220
8304
|
};
|
|
8221
8305
|
}
|
|
8222
|
-
function
|
|
8306
|
+
function Q(i) {
|
|
8223
8307
|
return i ? i.length <= 13 ? i : `${i.slice(0, 6)}…${i.slice(-4)}` : "—";
|
|
8224
8308
|
}
|
|
8225
|
-
function
|
|
8309
|
+
function gt(i) {
|
|
8226
8310
|
return i ? i.length <= 13 ? i : `${i.slice(0, 6)}...${i.slice(-4)}` : "—";
|
|
8227
8311
|
}
|
|
8228
|
-
function
|
|
8312
|
+
function ft(i, e = "ONE", r = 18, t = 6) {
|
|
8229
8313
|
if (!i || i === "0x" || i === "0x0") return null;
|
|
8230
8314
|
try {
|
|
8231
8315
|
const s = BigInt(i);
|
|
8232
8316
|
if (s === 0n) return null;
|
|
8233
|
-
const o =
|
|
8317
|
+
const o = Be(s, r, t);
|
|
8234
8318
|
if (o === "0") return null;
|
|
8235
|
-
const n =
|
|
8236
|
-
return
|
|
8319
|
+
const n = $e(s, r);
|
|
8320
|
+
return Fe(`${o} ${e}`, `${n} ${e}`);
|
|
8237
8321
|
} catch {
|
|
8238
8322
|
return null;
|
|
8239
8323
|
}
|
|
8240
8324
|
}
|
|
8241
|
-
const
|
|
8325
|
+
const pt = {
|
|
8242
8326
|
1: "Ethereum Mainnet",
|
|
8243
8327
|
5: "Goerli Testnet",
|
|
8244
8328
|
11155111: "Ethereum Sepolia",
|
|
@@ -8260,60 +8344,60 @@ const ct = {
|
|
|
8260
8344
|
202601: "Ronin Saigon",
|
|
8261
8345
|
612044: "ONEchain Testnet",
|
|
8262
8346
|
612055: "CROSS Mainnet"
|
|
8263
|
-
},
|
|
8264
|
-
let
|
|
8265
|
-
function
|
|
8266
|
-
if (
|
|
8267
|
-
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;
|
|
8268
8352
|
i && fetch(`${i}/chains.json`, { cache: "no-store" }).then((e) => e.ok ? e.json() : null).then((e) => {
|
|
8269
8353
|
const r = e == null ? void 0 : e.chains;
|
|
8270
8354
|
if (r)
|
|
8271
8355
|
for (const [t, s] of Object.entries(r)) {
|
|
8272
8356
|
const o = Number(t);
|
|
8273
|
-
!Number.isNaN(o) && s &&
|
|
8357
|
+
!Number.isNaN(o) && s && Ke.set(o, s);
|
|
8274
8358
|
}
|
|
8275
8359
|
}).catch(() => {
|
|
8276
|
-
|
|
8360
|
+
Ce = !1;
|
|
8277
8361
|
});
|
|
8278
8362
|
}
|
|
8279
|
-
function
|
|
8363
|
+
function wt(i) {
|
|
8280
8364
|
return parseInt(i.split(":")[1] ?? "", 10);
|
|
8281
8365
|
}
|
|
8282
|
-
function
|
|
8366
|
+
function mt(i) {
|
|
8283
8367
|
var r;
|
|
8284
|
-
const e =
|
|
8368
|
+
const e = wt(i);
|
|
8285
8369
|
if (!isNaN(e)) {
|
|
8286
|
-
const t = (r =
|
|
8370
|
+
const t = (r = Ke.get(e)) == null ? void 0 : r.name;
|
|
8287
8371
|
if (t) return t;
|
|
8288
|
-
if (
|
|
8372
|
+
if (pt[e]) return pt[e];
|
|
8289
8373
|
}
|
|
8290
8374
|
return i;
|
|
8291
8375
|
}
|
|
8292
|
-
function
|
|
8376
|
+
function Ve(i, e) {
|
|
8293
8377
|
var r;
|
|
8294
8378
|
if (i) {
|
|
8295
|
-
const t =
|
|
8379
|
+
const t = wt(i);
|
|
8296
8380
|
if (!isNaN(t)) {
|
|
8297
|
-
const s = (r =
|
|
8381
|
+
const s = (r = Ke.get(t)) == null ? void 0 : r.nativeSymbol;
|
|
8298
8382
|
if (s) return s;
|
|
8299
8383
|
}
|
|
8300
8384
|
}
|
|
8301
8385
|
return e;
|
|
8302
8386
|
}
|
|
8303
|
-
function
|
|
8387
|
+
function $e(i, e) {
|
|
8304
8388
|
if (i === 0n) return "0";
|
|
8305
8389
|
const r = 10n ** BigInt(e), t = i / r, o = (i % r).toString().padStart(e, "0").replace(/0+$/, "");
|
|
8306
8390
|
return o ? `${t}.${o}` : `${t}`;
|
|
8307
8391
|
}
|
|
8308
|
-
function
|
|
8392
|
+
function Fe(i, e) {
|
|
8309
8393
|
return i === e ? w(i) : `<span class="__crossx-amount-tip" data-full="${w(e)}">${w(i)}</span>`;
|
|
8310
8394
|
}
|
|
8311
|
-
function
|
|
8395
|
+
function Be(i, e, r) {
|
|
8312
8396
|
if (i === 0n) return "0";
|
|
8313
8397
|
const t = 10n ** BigInt(e), s = i / t, a = (i % t).toString().padStart(e, "0").slice(0, r).replace(/0+$/, "");
|
|
8314
8398
|
return a ? `${s}.${a}` : `${s}`;
|
|
8315
8399
|
}
|
|
8316
|
-
function
|
|
8400
|
+
function Pe(i) {
|
|
8317
8401
|
try {
|
|
8318
8402
|
const e = BigInt(i), r = e / 1000000000n, s = (e % 1000000000n).toString().padStart(9, "0").slice(0, 2).replace(/0+$/, "");
|
|
8319
8403
|
return s ? `${r}.${s}` : `${r}`;
|
|
@@ -8321,28 +8405,28 @@ function Re(i) {
|
|
|
8321
8405
|
return i;
|
|
8322
8406
|
}
|
|
8323
8407
|
}
|
|
8324
|
-
function
|
|
8408
|
+
function Gr(i) {
|
|
8325
8409
|
try {
|
|
8326
8410
|
return BigInt(i).toLocaleString();
|
|
8327
8411
|
} catch {
|
|
8328
8412
|
return i;
|
|
8329
8413
|
}
|
|
8330
8414
|
}
|
|
8331
|
-
function
|
|
8332
|
-
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");
|
|
8333
8417
|
if (!r) return null;
|
|
8334
8418
|
try {
|
|
8335
|
-
const l = BigInt(r), p =
|
|
8419
|
+
const l = BigInt(r), p = Gr(r);
|
|
8336
8420
|
if (s) {
|
|
8337
8421
|
const _ = l * BigInt(s);
|
|
8338
8422
|
return {
|
|
8339
8423
|
isDynamic: !0,
|
|
8340
|
-
estTxFee:
|
|
8341
|
-
`${
|
|
8342
|
-
`${
|
|
8424
|
+
estTxFee: Fe(
|
|
8425
|
+
`${Be(_, n, e)} ${a}`,
|
|
8426
|
+
`${$e(_, n)} ${a}`
|
|
8343
8427
|
),
|
|
8344
|
-
maxFeeGwei:
|
|
8345
|
-
maxPriorityFeeGwei: o ?
|
|
8428
|
+
maxFeeGwei: Pe(s),
|
|
8429
|
+
maxPriorityFeeGwei: o ? Pe(o) : void 0,
|
|
8346
8430
|
gasLimitFormatted: p
|
|
8347
8431
|
};
|
|
8348
8432
|
}
|
|
@@ -8350,11 +8434,11 @@ function Fr(i, e) {
|
|
|
8350
8434
|
const _ = l * BigInt(t);
|
|
8351
8435
|
return {
|
|
8352
8436
|
isDynamic: !1,
|
|
8353
|
-
estTxFee:
|
|
8354
|
-
`${
|
|
8355
|
-
`${
|
|
8437
|
+
estTxFee: Fe(
|
|
8438
|
+
`${Be(_, n, e)} ${a}`,
|
|
8439
|
+
`${$e(_, n)} ${a}`
|
|
8356
8440
|
),
|
|
8357
|
-
gasPriceGwei:
|
|
8441
|
+
gasPriceGwei: Pe(t),
|
|
8358
8442
|
gasLimitFormatted: p
|
|
8359
8443
|
};
|
|
8360
8444
|
}
|
|
@@ -8363,33 +8447,33 @@ function Fr(i, e) {
|
|
|
8363
8447
|
return null;
|
|
8364
8448
|
}
|
|
8365
8449
|
}
|
|
8366
|
-
function
|
|
8367
|
-
const t =
|
|
8450
|
+
function yt(i, e, r) {
|
|
8451
|
+
const t = Kr(i, e);
|
|
8368
8452
|
if (!t) return D((r == null ? void 0 : r.label_estimated_fee) ?? "Estimated fee", "<span>—</span>");
|
|
8369
8453
|
let s = D((r == null ? void 0 : r.label_est_tx_fee) ?? "Est. Tx Fee", `<span>${t.estTxFee}</span>`);
|
|
8370
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;
|
|
8371
8455
|
}
|
|
8372
|
-
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">
|
|
8373
8457
|
<rect x="9" y="9" width="13" height="13" rx="2"/>
|
|
8374
8458
|
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/>
|
|
8375
|
-
</svg>`,
|
|
8459
|
+
</svg>`, U = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
|
|
8376
8460
|
<line x1="18" y1="6" x2="6" y2="18"/>
|
|
8377
8461
|
<line x1="6" y1="6" x2="18" y2="18"/>
|
|
8378
|
-
</svg>`,
|
|
8462
|
+
</svg>`, Vr = `<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
8379
8463
|
<circle cx="20" cy="20" r="20" fill="#00D5AA"/>
|
|
8380
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"/>
|
|
8381
|
-
</svg>`,
|
|
8382
|
-
[ge.MetaMask]:
|
|
8383
|
-
[ge.Binance]:
|
|
8384
|
-
[ge.CROSSx]:
|
|
8385
|
-
},
|
|
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">
|
|
8386
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)"/>
|
|
8387
|
-
</svg>`,
|
|
8471
|
+
</svg>`, Jr = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
8388
8472
|
<circle cx="12" cy="12" r="12" fill="var(--cx-error)"/>
|
|
8389
8473
|
<circle cx="12" cy="12" r="5.5" stroke="white" stroke-width="1.5"/>
|
|
8390
8474
|
<path d="M12 9.5v3l2 1.5" stroke="white" stroke-width="1.5" stroke-linecap="round"/>
|
|
8391
8475
|
</svg>`;
|
|
8392
|
-
function
|
|
8476
|
+
function G(i) {
|
|
8393
8477
|
return [
|
|
8394
8478
|
`--cx-bg:${i.bg}`,
|
|
8395
8479
|
`--cx-border:${i.border}`,
|
|
@@ -8422,7 +8506,7 @@ function H(i) {
|
|
|
8422
8506
|
`--cx-on-primary:${i.onPrimary}`
|
|
8423
8507
|
].join(";");
|
|
8424
8508
|
}
|
|
8425
|
-
function
|
|
8509
|
+
function Zr(i, e) {
|
|
8426
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);
|
|
8427
8511
|
}
|
|
8428
8512
|
function D(i, e) {
|
|
@@ -8432,14 +8516,14 @@ function D(i, e) {
|
|
|
8432
8516
|
<div class="__crossx-row-value">${e}</div>
|
|
8433
8517
|
</div>`;
|
|
8434
8518
|
}
|
|
8435
|
-
function
|
|
8436
|
-
const s = e, o =
|
|
8437
|
-
<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");
|
|
8438
8522
|
return g.id = F, g.innerHTML = `
|
|
8439
|
-
<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">
|
|
8440
8524
|
<div class="__crossx-header">
|
|
8441
8525
|
<p class="__crossx-title" id="__crossx-ttl">${w((t == null ? void 0 : t.sign_transaction_title) ?? "Signature Request")}</p>
|
|
8442
|
-
<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>
|
|
8443
8527
|
</div>
|
|
8444
8528
|
<hr class="__crossx-divider">
|
|
8445
8529
|
<div class="__crossx-body">
|
|
@@ -8449,8 +8533,8 @@ function qr(i, e, r, t) {
|
|
|
8449
8533
|
<span class="__crossx-sig-origin">${w(a)}</span>${w((t == null ? void 0 : t.signature_requesting) ?? " is requesting a Signature")}
|
|
8450
8534
|
</p>
|
|
8451
8535
|
<div class="__crossx-addr-pill">
|
|
8452
|
-
${
|
|
8453
|
-
<span class="__crossx-addr-pill-text">${
|
|
8536
|
+
${ze}
|
|
8537
|
+
<span class="__crossx-addr-pill-text">${Q(i.from)}</span>
|
|
8454
8538
|
</div>
|
|
8455
8539
|
<p class="__crossx-warning">${w((t == null ? void 0 : t.signature_warning) ?? "After you sign, changes or cancellations are not possible.")}</p>
|
|
8456
8540
|
</div>
|
|
@@ -8458,7 +8542,7 @@ function qr(i, e, r, t) {
|
|
|
8458
8542
|
<div class="__crossx-col-right-sign">
|
|
8459
8543
|
<div class="__crossx-rows">
|
|
8460
8544
|
${D((t == null ? void 0 : t.label_to) ?? "To", l)}
|
|
8461
|
-
${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>`)}
|
|
8462
8546
|
${u}
|
|
8463
8547
|
${p}
|
|
8464
8548
|
</div>
|
|
@@ -8473,7 +8557,7 @@ function qr(i, e, r, t) {
|
|
|
8473
8557
|
</div>
|
|
8474
8558
|
`, g;
|
|
8475
8559
|
}
|
|
8476
|
-
const
|
|
8560
|
+
const es = /* @__PURE__ */ new Set([
|
|
8477
8561
|
"0x095ea7b3",
|
|
8478
8562
|
// approve(address,uint256) — ERC20 / ERC721
|
|
8479
8563
|
"0xa22cb465",
|
|
@@ -8483,17 +8567,17 @@ const jr = /* @__PURE__ */ new Set([
|
|
|
8483
8567
|
"0x8fcbaf0c"
|
|
8484
8568
|
// permit(address,address,uint256,uint256,bool,uint8,bytes32,bytes32) — DAI 스타일
|
|
8485
8569
|
]);
|
|
8486
|
-
function
|
|
8487
|
-
return i ?
|
|
8570
|
+
function ts(i) {
|
|
8571
|
+
return i ? es.has(i.slice(0, 10).toLowerCase()) : !1;
|
|
8488
8572
|
}
|
|
8489
|
-
function
|
|
8490
|
-
const s = e, o =
|
|
8491
|
-
<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");
|
|
8492
8576
|
return g.id = F, g.innerHTML = `
|
|
8493
|
-
<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">
|
|
8494
8578
|
<div class="__crossx-header">
|
|
8495
8579
|
<p class="__crossx-title" id="__crossx-ttl">${w((t == null ? void 0 : t.send_transaction_title) ?? "Approve transaction")}</p>
|
|
8496
|
-
<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>
|
|
8497
8581
|
</div>
|
|
8498
8582
|
<hr class="__crossx-divider">
|
|
8499
8583
|
<div class="__crossx-body">
|
|
@@ -8503,11 +8587,11 @@ function Xr(i, e, r, t) {
|
|
|
8503
8587
|
<div class="__crossx-body-cols">
|
|
8504
8588
|
<div class="__crossx-rows">
|
|
8505
8589
|
${D((t == null ? void 0 : t.label_to) ?? "To", l)}
|
|
8506
|
-
${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>`)}
|
|
8507
8591
|
${p}
|
|
8508
8592
|
</div>
|
|
8509
8593
|
<div class="__crossx-pill">
|
|
8510
|
-
<span class="__crossx-pill-from">${
|
|
8594
|
+
<span class="__crossx-pill-from">${Q(i.from)}</span>
|
|
8511
8595
|
<span class="__crossx-pill-amount">${u}</span>
|
|
8512
8596
|
</div>
|
|
8513
8597
|
</div>
|
|
@@ -8516,7 +8600,7 @@ function Xr(i, e, r, t) {
|
|
|
8516
8600
|
</div>
|
|
8517
8601
|
`, g;
|
|
8518
8602
|
}
|
|
8519
|
-
function
|
|
8603
|
+
function Ie(i) {
|
|
8520
8604
|
var e;
|
|
8521
8605
|
if (i) return i;
|
|
8522
8606
|
try {
|
|
@@ -8528,10 +8612,10 @@ function Ee(i) {
|
|
|
8528
8612
|
function w(i) {
|
|
8529
8613
|
return i.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
8530
8614
|
}
|
|
8531
|
-
function
|
|
8615
|
+
function ss(i) {
|
|
8532
8616
|
return typeof i == "string" && /^0x[0-9a-fA-F]{40}$/i.test(i);
|
|
8533
8617
|
}
|
|
8534
|
-
function
|
|
8618
|
+
function is(i) {
|
|
8535
8619
|
if (typeof i == "string") return w(i);
|
|
8536
8620
|
if (typeof i == "number" || typeof i == "bigint" || typeof i == "boolean") return String(i);
|
|
8537
8621
|
try {
|
|
@@ -8540,40 +8624,40 @@ function Zr(i) {
|
|
|
8540
8624
|
return String(i);
|
|
8541
8625
|
}
|
|
8542
8626
|
}
|
|
8543
|
-
function
|
|
8627
|
+
function os(i) {
|
|
8544
8628
|
return i.includes(":") ? i.split(":")[1] ?? i : i;
|
|
8545
8629
|
}
|
|
8546
|
-
function
|
|
8630
|
+
function ns(i) {
|
|
8547
8631
|
return `https://www.crossscan.io/address/${i}?tab=txs`;
|
|
8548
8632
|
}
|
|
8549
|
-
function
|
|
8550
|
-
return `https://explorer.crosstoken.io/${
|
|
8633
|
+
function as(i, e) {
|
|
8634
|
+
return `https://explorer.crosstoken.io/${os(i)}/tx/${e}`;
|
|
8551
8635
|
}
|
|
8552
|
-
function
|
|
8636
|
+
function vt(i, e) {
|
|
8553
8637
|
return `<a class="__crossx-addr-text __crossx-row-link" href="${w(e)}" target="_blank" rel="noopener noreferrer">${w(i)}</a>`;
|
|
8554
8638
|
}
|
|
8555
|
-
function
|
|
8556
|
-
return
|
|
8639
|
+
function Se(i) {
|
|
8640
|
+
return vt(Q(i), ns(i));
|
|
8557
8641
|
}
|
|
8558
|
-
function
|
|
8559
|
-
return
|
|
8642
|
+
function St(i, e) {
|
|
8643
|
+
return vt(Q(e), as(i, e));
|
|
8560
8644
|
}
|
|
8561
|
-
function
|
|
8645
|
+
function cs(i, e, r) {
|
|
8562
8646
|
const t = D(
|
|
8563
8647
|
(r == null ? void 0 : r.label_from) ?? "From",
|
|
8564
|
-
`${
|
|
8565
|
-
<button class="__crossx-copy-btn" data-copy="${w(i.from)}" title="Copy address">${
|
|
8566
|
-
), s = i.to ? D((r == null ? void 0 : r.label_to) ?? "To", `${
|
|
8567
|
-
<button class="__crossx-copy-btn" data-copy="${w(i.to)}" title="Copy address">${
|
|
8568
|
-
<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">
|
|
8569
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>
|
|
8570
8654
|
<span class="__crossx-total-amount">${w(i.total)}</span>
|
|
8571
8655
|
</div>` : "", p = document.createElement("div");
|
|
8572
8656
|
return p.id = F, p.innerHTML = `
|
|
8573
|
-
<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">
|
|
8574
8658
|
<div class="__crossx-header">
|
|
8575
8659
|
<p class="__crossx-title" id="__crossx-ttl">${w((r == null ? void 0 : r.tx_success) ?? "Transaction complete")}</p>
|
|
8576
|
-
<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>
|
|
8577
8661
|
</div>
|
|
8578
8662
|
<hr class="__crossx-divider">
|
|
8579
8663
|
<div class="__crossx-body">
|
|
@@ -8590,10 +8674,10 @@ function rs(i, e, r) {
|
|
|
8590
8674
|
</div>
|
|
8591
8675
|
`, p;
|
|
8592
8676
|
}
|
|
8593
|
-
function
|
|
8677
|
+
function ls(i, e, r) {
|
|
8594
8678
|
const t = document.createElement("div");
|
|
8595
8679
|
return t.id = F, t.innerHTML = `
|
|
8596
|
-
<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">
|
|
8597
8681
|
<div class="__crossx-header">
|
|
8598
8682
|
<p class="__crossx-title" id="__crossx-ttl">${w((r == null ? void 0 : r.tx_progress_waiting_title) ?? "Waiting for confirmation")}</p>
|
|
8599
8683
|
</div>
|
|
@@ -8607,22 +8691,22 @@ function ss(i, e, r) {
|
|
|
8607
8691
|
</div>
|
|
8608
8692
|
`, t;
|
|
8609
8693
|
}
|
|
8610
|
-
function
|
|
8694
|
+
function ds(i, e, r, t) {
|
|
8611
8695
|
const s = e.status !== "reverted" && e.status !== "timeout", o = e.status === "timeout", n = i.querySelector("#__crossx-ttl"), a = i.querySelector(".__crossx-header");
|
|
8612
8696
|
if (n) {
|
|
8613
|
-
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";
|
|
8614
8698
|
m ? (n.style.display = "flex", n.style.alignItems = "center", n.style.gap = "8px", n.innerHTML = `${m}<span>${w(y)}</span>`) : n.textContent = y;
|
|
8615
8699
|
}
|
|
8616
8700
|
if (a && !i.querySelector("#__crossx-close-btn")) {
|
|
8617
8701
|
const m = document.createElement("button");
|
|
8618
|
-
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);
|
|
8619
8703
|
}
|
|
8620
8704
|
const l = i.querySelector("#__crossx-progress-body");
|
|
8621
8705
|
if (!l) return;
|
|
8622
|
-
const p = e.from ? D((t == null ? void 0 : t.label_from) ?? "From", `${
|
|
8623
|
-
<button class="__crossx-copy-btn" data-copy="${w(e.from)}" title="Copy address">${
|
|
8624
|
-
<button class="__crossx-copy-btn" data-copy="${w(e.to)}" title="Copy address">${
|
|
8625
|
-
<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">
|
|
8626
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>
|
|
8627
8711
|
<span class="__crossx-total-amount">${w(e.total)}</span>
|
|
8628
8712
|
</div>` : "";
|
|
@@ -8638,21 +8722,21 @@ function is(i, e, r, t) {
|
|
|
8638
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>
|
|
8639
8723
|
`, l.querySelectorAll(".__crossx-copy-btn").forEach((m) => {
|
|
8640
8724
|
m.addEventListener("click", (y) => {
|
|
8641
|
-
var
|
|
8725
|
+
var A;
|
|
8642
8726
|
y.stopPropagation();
|
|
8643
|
-
const
|
|
8644
|
-
|
|
8727
|
+
const S = m.dataset.copy;
|
|
8728
|
+
S && ((A = navigator.clipboard) == null || A.writeText(S).catch(() => {
|
|
8645
8729
|
}));
|
|
8646
8730
|
});
|
|
8647
8731
|
});
|
|
8648
8732
|
}
|
|
8649
|
-
function
|
|
8650
|
-
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");
|
|
8651
8735
|
return n.id = F, n.innerHTML = `
|
|
8652
|
-
<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">
|
|
8653
8737
|
<div class="__crossx-header">
|
|
8654
8738
|
<p class="__crossx-title" id="__crossx-ttl">${w((r == null ? void 0 : r.sign_message_title) ?? "Signature Request")}</p>
|
|
8655
|
-
<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>
|
|
8656
8740
|
</div>
|
|
8657
8741
|
<hr class="__crossx-divider">
|
|
8658
8742
|
<div class="__crossx-body">
|
|
@@ -8662,8 +8746,8 @@ function os(i, e, r) {
|
|
|
8662
8746
|
<span class="__crossx-sig-origin">${w(s)}</span>${w((r == null ? void 0 : r.signature_requesting) ?? " is requesting a Signature")}
|
|
8663
8747
|
</p>
|
|
8664
8748
|
<div class="__crossx-addr-pill">
|
|
8665
|
-
${
|
|
8666
|
-
<span class="__crossx-addr-pill-text">${
|
|
8749
|
+
${ze}
|
|
8750
|
+
<span class="__crossx-addr-pill-text">${Q(i.from)}</span>
|
|
8667
8751
|
</div>
|
|
8668
8752
|
<p class="__crossx-warning">${w((r == null ? void 0 : r.signature_warning) ?? "After you sign, changes or cancellations are not possible.")}</p>
|
|
8669
8753
|
</div>
|
|
@@ -8678,8 +8762,8 @@ function os(i, e, r) {
|
|
|
8678
8762
|
</div>
|
|
8679
8763
|
`, n;
|
|
8680
8764
|
}
|
|
8681
|
-
function
|
|
8682
|
-
const t = e, s =
|
|
8765
|
+
function _s(i, e, r) {
|
|
8766
|
+
const t = e, s = Ie(i.dappName);
|
|
8683
8767
|
let o = {};
|
|
8684
8768
|
if (typeof i.typedData == "string")
|
|
8685
8769
|
try {
|
|
@@ -8694,8 +8778,8 @@ function ns(i, e, r) {
|
|
|
8694
8778
|
<span class="__crossx-td-value">${w(n)}</span>
|
|
8695
8779
|
</div>`;
|
|
8696
8780
|
for (const [_, u] of Object.entries(a)) {
|
|
8697
|
-
const x =
|
|
8698
|
-
<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>`;
|
|
8699
8783
|
l += `
|
|
8700
8784
|
<div class="__crossx-td-row">
|
|
8701
8785
|
<span class="__crossx-td-label">${w(_)}</span>
|
|
@@ -8704,10 +8788,10 @@ function ns(i, e, r) {
|
|
|
8704
8788
|
}
|
|
8705
8789
|
const p = document.createElement("div");
|
|
8706
8790
|
return p.id = F, p.innerHTML = `
|
|
8707
|
-
<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">
|
|
8708
8792
|
<div class="__crossx-header">
|
|
8709
8793
|
<p class="__crossx-title" id="__crossx-ttl">${w((r == null ? void 0 : r.sign_typed_data_title) ?? "Signature Request")}</p>
|
|
8710
|
-
<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>
|
|
8711
8795
|
</div>
|
|
8712
8796
|
<hr class="__crossx-divider">
|
|
8713
8797
|
<div class="__crossx-body">
|
|
@@ -8717,8 +8801,8 @@ function ns(i, e, r) {
|
|
|
8717
8801
|
<span class="__crossx-sig-origin">${w(s)}</span>${w((r == null ? void 0 : r.signature_requesting) ?? " is requesting a Signature")}
|
|
8718
8802
|
</p>
|
|
8719
8803
|
<div class="__crossx-addr-pill">
|
|
8720
|
-
${
|
|
8721
|
-
<span class="__crossx-addr-pill-text">${
|
|
8804
|
+
${ze}
|
|
8805
|
+
<span class="__crossx-addr-pill-text">${Q(i.from)}</span>
|
|
8722
8806
|
</div>
|
|
8723
8807
|
<p class="__crossx-warning">${w((r == null ? void 0 : r.signature_warning) ?? "After you sign, changes or cancellations are not possible.")}</p>
|
|
8724
8808
|
</div>
|
|
@@ -8733,41 +8817,41 @@ function ns(i, e, r) {
|
|
|
8733
8817
|
</div>
|
|
8734
8818
|
`, p;
|
|
8735
8819
|
}
|
|
8736
|
-
const
|
|
8820
|
+
const hs = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
|
|
8737
8821
|
<line x1="12" y1="5" x2="12" y2="19"/>
|
|
8738
8822
|
<line x1="5" y1="12" x2="19" y2="12"/>
|
|
8739
|
-
</svg>`,
|
|
8740
|
-
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) {
|
|
8741
8825
|
return i.name || `Account ${i.index + 1}`;
|
|
8742
8826
|
}
|
|
8743
|
-
function
|
|
8744
|
-
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>`;
|
|
8745
8829
|
}
|
|
8746
|
-
const
|
|
8747
|
-
function
|
|
8830
|
+
const gs = He().portraitBaseUrl;
|
|
8831
|
+
function fs(i, e) {
|
|
8748
8832
|
const r = e.replace("#", "");
|
|
8749
|
-
return `${
|
|
8833
|
+
return `${gs}/portrait/evm/${i}.png?size=256&bg=${r}`;
|
|
8750
8834
|
}
|
|
8751
|
-
function
|
|
8752
|
-
const t =
|
|
8835
|
+
function At(i, e, r) {
|
|
8836
|
+
const t = fs(i, r), o = xs().replace(/"/g, """);
|
|
8753
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>`;
|
|
8754
8838
|
}
|
|
8755
|
-
function
|
|
8839
|
+
function ws(i, e, r, t) {
|
|
8756
8840
|
const s = r == null ? void 0 : r.toLowerCase(), o = i.map((a) => {
|
|
8757
|
-
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>` : "";
|
|
8758
8842
|
return `<button class="__crossx-wallet-item${p}" data-wallet-index="${a.index}" data-wallet-address="${w(a.address)}">
|
|
8759
|
-
${
|
|
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>${_}
|
|
8760
8844
|
</button>`;
|
|
8761
8845
|
}).join(""), n = document.createElement("div");
|
|
8762
8846
|
return n.id = F, n.className = "__crossx-overlay--wallet-selector", n.innerHTML = `
|
|
8763
|
-
<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">
|
|
8764
8848
|
<div class="__crossx-header">
|
|
8765
8849
|
<span class="__crossx-wallet-sheet-handle" aria-hidden="true"></span>
|
|
8766
8850
|
<div class="__crossx-wallet-header-copy">
|
|
8767
8851
|
<p class="__crossx-title" id="__crossx-ttl">${w((t == null ? void 0 : t.wallet_selector_title) ?? "Select Connected Wallet")}</p>
|
|
8768
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>
|
|
8769
8853
|
</div>
|
|
8770
|
-
<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>
|
|
8771
8855
|
</div>
|
|
8772
8856
|
<hr class="__crossx-divider">
|
|
8773
8857
|
<div class="__crossx-body __crossx-wallet-selector-body">
|
|
@@ -8776,7 +8860,7 @@ function _s(i, e, r, t) {
|
|
|
8776
8860
|
${o}
|
|
8777
8861
|
</div>
|
|
8778
8862
|
<button class="__crossx-wallet-add" id="__crossx-add-wallet-btn" type="button">
|
|
8779
|
-
<span class="__crossx-wallet-add-icon">${
|
|
8863
|
+
<span class="__crossx-wallet-add-icon">${hs}</span>
|
|
8780
8864
|
<span class="__crossx-wallet-add-label">${w((t == null ? void 0 : t.wallet_selector_add_button) ?? "Add Wallet")}</span>
|
|
8781
8865
|
</button>
|
|
8782
8866
|
<p class="__crossx-wallet-add-error" id="__crossx-add-wallet-error" role="alert" aria-live="polite" hidden></p>
|
|
@@ -8791,11 +8875,11 @@ function _s(i, e, r, t) {
|
|
|
8791
8875
|
</div>
|
|
8792
8876
|
`, n;
|
|
8793
8877
|
}
|
|
8794
|
-
function
|
|
8878
|
+
function ms(i, e) {
|
|
8795
8879
|
const r = document.createElement("div");
|
|
8796
8880
|
r.id = F;
|
|
8797
8881
|
const t = document.createElement("div");
|
|
8798
|
-
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");
|
|
8799
8883
|
const s = document.createElement("div");
|
|
8800
8884
|
s.className = "__crossx-header";
|
|
8801
8885
|
const o = document.createElement("span");
|
|
@@ -8803,7 +8887,7 @@ function hs(i, e) {
|
|
|
8803
8887
|
const n = document.createElement("p");
|
|
8804
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!";
|
|
8805
8889
|
const a = document.createElement("button");
|
|
8806
|
-
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);
|
|
8807
8891
|
const l = document.createElement("hr");
|
|
8808
8892
|
l.className = "__crossx-divider";
|
|
8809
8893
|
const p = document.createElement("div");
|
|
@@ -8832,22 +8916,22 @@ function hs(i, e) {
|
|
|
8832
8916
|
const f = document.createElement("button");
|
|
8833
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;
|
|
8834
8918
|
}
|
|
8835
|
-
const
|
|
8919
|
+
const ys = `<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
8836
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"/>
|
|
8837
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"/>
|
|
8838
|
-
</svg>`,
|
|
8922
|
+
</svg>`, bs = `<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
8839
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"/>
|
|
8840
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"/>
|
|
8841
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"/>
|
|
8842
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"/>
|
|
8843
8927
|
</svg>`;
|
|
8844
|
-
function
|
|
8845
|
-
const e =
|
|
8846
|
-
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>`;
|
|
8847
8931
|
}
|
|
8848
|
-
function
|
|
8932
|
+
function Ss(i) {
|
|
8849
8933
|
if (i.length === 0) return "";
|
|
8850
|
-
const e = (s) =>
|
|
8934
|
+
const e = (s) => vs(i[s]), r = "Supported wallets include ";
|
|
8851
8935
|
if (i.length === 1)
|
|
8852
8936
|
return `${r}${e(0)}.`;
|
|
8853
8937
|
if (i.length === 2)
|
|
@@ -8857,7 +8941,7 @@ function fs(i) {
|
|
|
8857
8941
|
const t = i.length - 3;
|
|
8858
8942
|
return `${r}${e(0)}, ${e(1)}, ${e(2)}, and ${t} more.`;
|
|
8859
8943
|
}
|
|
8860
|
-
function
|
|
8944
|
+
function Es(i, e = [], r) {
|
|
8861
8945
|
const t = i, s = w(String(e[0])), o = w((r == null ? void 0 : r.login_selector_or) ?? "or"), n = e.length > 0 ? `
|
|
8862
8946
|
<div class="__crossx-login-or-divider">
|
|
8863
8947
|
<hr><span>${o}</span><hr>
|
|
@@ -8865,27 +8949,27 @@ function ws(i, e = [], r) {
|
|
|
8865
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">
|
|
8866
8950
|
<span class="__crossx-connect-other-text">
|
|
8867
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>
|
|
8868
|
-
<span class="__crossx-connect-other-desc __crossx-connect-other-summary">${
|
|
8952
|
+
<span class="__crossx-connect-other-desc __crossx-connect-other-summary">${Ss(e)}</span>
|
|
8869
8953
|
</span>
|
|
8870
8954
|
</button>` : "", a = document.createElement("div");
|
|
8871
8955
|
return a.id = F, a.innerHTML = `
|
|
8872
|
-
<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">
|
|
8873
8957
|
<div class="__crossx-header">
|
|
8874
8958
|
<div style="display:flex;flex-direction:column;gap:4px;padding-right:36px;">
|
|
8875
|
-
<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>
|
|
8876
8960
|
<p class="__crossx-subtitle">${w((r == null ? void 0 : r.login_selector_subtitle) ?? "Sign in instantly with your social account")}</p>
|
|
8877
8961
|
</div>
|
|
8878
|
-
<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>
|
|
8879
8963
|
</div>
|
|
8880
8964
|
<hr class="__crossx-divider">
|
|
8881
8965
|
<div class="__crossx-body">
|
|
8882
8966
|
<div class="__crossx-login-btn-row">
|
|
8883
8967
|
<button class="__crossx-login-btn" id="__crossx-apple-btn" type="button">
|
|
8884
|
-
<span class="__crossx-login-icon" style="color:var(--cx-value);">${
|
|
8968
|
+
<span class="__crossx-login-icon" style="color:var(--cx-value);">${ys}</span>
|
|
8885
8969
|
<span class="__crossx-login-btn-label">${w((r == null ? void 0 : r.login_selector_apple) ?? "Sign in with Apple")}</span>
|
|
8886
8970
|
</button>
|
|
8887
8971
|
<button class="__crossx-login-btn" id="__crossx-google-btn" type="button">
|
|
8888
|
-
<span class="__crossx-login-icon">${
|
|
8972
|
+
<span class="__crossx-login-icon">${bs}</span>
|
|
8889
8973
|
<span class="__crossx-login-btn-label">${w((r == null ? void 0 : r.login_selector_google) ?? "Sign in with Google")}</span>
|
|
8890
8974
|
</button>
|
|
8891
8975
|
</div>${n}
|
|
@@ -8896,7 +8980,7 @@ function ws(i, e = [], r) {
|
|
|
8896
8980
|
</div>
|
|
8897
8981
|
`, a;
|
|
8898
8982
|
}
|
|
8899
|
-
function
|
|
8983
|
+
function As(i, e) {
|
|
8900
8984
|
const r = i, t = document.createElement("div");
|
|
8901
8985
|
t.id = F;
|
|
8902
8986
|
const s = w(e.message).replace(/\n/g, "<br>"), o = e.email ? `<div class="__crossx-session-account-card">
|
|
@@ -8904,10 +8988,10 @@ function ms(i, e) {
|
|
|
8904
8988
|
<p class="__crossx-session-account-email">${w(e.email)}</p>
|
|
8905
8989
|
</div>` : "";
|
|
8906
8990
|
return t.innerHTML = `
|
|
8907
|
-
<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">
|
|
8908
8992
|
<div class="__crossx-header">
|
|
8909
8993
|
<p class="__crossx-title" id="__crossx-session-header-title">${w(e.title)}</p>
|
|
8910
|
-
<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>
|
|
8911
8995
|
</div>
|
|
8912
8996
|
<hr class="__crossx-divider">
|
|
8913
8997
|
<div class="__crossx-body" style="padding:20px 24px 24px;display:flex;flex-direction:column;gap:16px;">
|
|
@@ -8924,10 +9008,10 @@ function ms(i, e) {
|
|
|
8924
9008
|
</div>
|
|
8925
9009
|
`, t;
|
|
8926
9010
|
}
|
|
8927
|
-
function
|
|
8928
|
-
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");
|
|
8929
9013
|
return o.id = F, o.innerHTML = `
|
|
8930
|
-
<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">
|
|
8931
9015
|
<div class="__crossx-header">
|
|
8932
9016
|
<p class="__crossx-title" id="__crossx-ttl">Wallet Found on Social Account 🎉</p>
|
|
8933
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>
|
|
@@ -8940,7 +9024,7 @@ function ys(i, e = !0) {
|
|
|
8940
9024
|
<p class="__crossx-mig-info-desc">It safely restores and integrates all your previous assets. Simply verify your PIN to get started.</p>
|
|
8941
9025
|
</div>
|
|
8942
9026
|
<button class="__crossx-recover-btn" id="__crossx-recover-btn">
|
|
8943
|
-
<span class="__crossx-recover-icon">${
|
|
9027
|
+
<span class="__crossx-recover-icon">${Vr}</span>
|
|
8944
9028
|
<span class="__crossx-recover-label">Import from Social Backup</span>
|
|
8945
9029
|
</button>
|
|
8946
9030
|
${s}
|
|
@@ -8948,13 +9032,13 @@ function ys(i, e = !0) {
|
|
|
8948
9032
|
</div>
|
|
8949
9033
|
`, o;
|
|
8950
9034
|
}
|
|
8951
|
-
function
|
|
9035
|
+
function ks(i, e) {
|
|
8952
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");
|
|
8953
9037
|
return u.id = F, u.innerHTML = `
|
|
8954
|
-
<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">
|
|
8955
9039
|
<div class="__crossx-header">
|
|
8956
9040
|
<p class="__crossx-title" id="__crossx-ttl">Import from Social Backup</p>
|
|
8957
|
-
<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>
|
|
8958
9042
|
</div>
|
|
8959
9043
|
<hr class="__crossx-divider">
|
|
8960
9044
|
<div class="__crossx-pin-center">
|
|
@@ -8972,17 +9056,17 @@ function bs(i, e) {
|
|
|
8972
9056
|
</div>
|
|
8973
9057
|
`, u;
|
|
8974
9058
|
}
|
|
8975
|
-
function
|
|
9059
|
+
function Ts(i) {
|
|
8976
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");
|
|
8977
9061
|
return `${s}, ${o} ${n} ${a}:${l}`;
|
|
8978
9062
|
}
|
|
8979
|
-
function
|
|
8980
|
-
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");
|
|
8981
9065
|
return a.id = F, a.innerHTML = `
|
|
8982
|
-
<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">
|
|
8983
9067
|
<div class="__crossx-header">
|
|
8984
9068
|
<p class="__crossx-title" id="__crossx-ttl">Import from Social Backup</p>
|
|
8985
|
-
<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>
|
|
8986
9070
|
</div>
|
|
8987
9071
|
<hr class="__crossx-divider">
|
|
8988
9072
|
<div class="__crossx-pin-center">
|
|
@@ -9007,10 +9091,10 @@ function vs(i, e, r) {
|
|
|
9007
9091
|
return () => clearInterval(u);
|
|
9008
9092
|
} };
|
|
9009
9093
|
}
|
|
9010
|
-
function
|
|
9094
|
+
function Cs(i) {
|
|
9011
9095
|
const r = [i.check1, i.check2].map((t, s) => `
|
|
9012
9096
|
<div class="__crossx-pw-notice-item" data-check-index="${s}" role="checkbox" aria-checked="false" tabindex="0">
|
|
9013
|
-
<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>
|
|
9014
9098
|
<span class="__crossx-pw-notice-item-text">${w(t)}</span>
|
|
9015
9099
|
</div>
|
|
9016
9100
|
`).join("");
|
|
@@ -9019,14 +9103,14 @@ function Es(i) {
|
|
|
9019
9103
|
<span class="__crossx-pin6-sheet-handle" aria-hidden="true"></span>
|
|
9020
9104
|
<p class="__crossx-title" id="__crossx-ttl" style="padding-right:48px;">${w(i.title)}</p>
|
|
9021
9105
|
<p class="__crossx-pw-subtitle">${w(i.headerSubtitle)}</p>
|
|
9022
|
-
<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>
|
|
9023
9107
|
</div>
|
|
9024
9108
|
<hr class="__crossx-divider">
|
|
9025
9109
|
<div class="__crossx-pw-body">
|
|
9026
9110
|
<div class="__crossx-pw-fields __crossx-pw-fields--notice">
|
|
9027
9111
|
<div class="__crossx-pw-notice-header">
|
|
9028
9112
|
<div class="__crossx-pw-notice-title-row">
|
|
9029
|
-
<span class="__crossx-pw-notice-icon">${
|
|
9113
|
+
<span class="__crossx-pw-notice-icon">${Ds}</span>
|
|
9030
9114
|
<p class="__crossx-pw-notice-title">${w(i.noticeTitle)}</p>
|
|
9031
9115
|
</div>
|
|
9032
9116
|
<p class="__crossx-pw-notice-desc">${w(i.noticeDesc)}</p>
|
|
@@ -9046,9 +9130,9 @@ function Es(i) {
|
|
|
9046
9130
|
<div class="__crossx-home-indicator"></div>
|
|
9047
9131
|
`;
|
|
9048
9132
|
}
|
|
9049
|
-
function
|
|
9133
|
+
function Ne(i) {
|
|
9050
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">
|
|
9051
|
-
${
|
|
9135
|
+
${It}
|
|
9052
9136
|
<span id="__crossx-pin6-lock-countdown"></span>
|
|
9053
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(
|
|
9054
9138
|
{ length: 6 },
|
|
@@ -9076,7 +9160,7 @@ function Ce(i) {
|
|
|
9076
9160
|
<div class="__crossx-pin6-numpad-row">
|
|
9077
9161
|
<button type="button" class="__crossx-pin6-numpad-key --empty" aria-hidden="true"></button>
|
|
9078
9162
|
<button type="button" class="__crossx-pin6-numpad-key${g}" data-key="0">0</button>
|
|
9079
|
-
<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>
|
|
9080
9164
|
</div>
|
|
9081
9165
|
</div>`;
|
|
9082
9166
|
return `
|
|
@@ -9084,7 +9168,7 @@ function Ce(i) {
|
|
|
9084
9168
|
<span class="__crossx-pin6-sheet-handle" aria-hidden="true"></span>
|
|
9085
9169
|
<p class="__crossx-title" id="__crossx-ttl" style="padding-right:48px;">${w(i.title)}</p>
|
|
9086
9170
|
${t}
|
|
9087
|
-
<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>
|
|
9088
9172
|
</div>
|
|
9089
9173
|
<hr class="__crossx-divider">
|
|
9090
9174
|
<div class="__crossx-pin6-body"${r}>
|
|
@@ -9103,212 +9187,212 @@ function Ce(i) {
|
|
|
9103
9187
|
${f}
|
|
9104
9188
|
`;
|
|
9105
9189
|
}
|
|
9106
|
-
function
|
|
9190
|
+
function _t(i, e) {
|
|
9107
9191
|
const r = document.createElement("div");
|
|
9108
9192
|
return r.id = F, r.innerHTML = `
|
|
9109
|
-
<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">
|
|
9110
9194
|
${e}
|
|
9111
9195
|
</div>
|
|
9112
9196
|
`, r;
|
|
9113
9197
|
}
|
|
9114
|
-
function
|
|
9198
|
+
function Ps(i, e) {
|
|
9115
9199
|
if (i.length !== 6) return e.tooShort;
|
|
9116
9200
|
if (!/^\d+$/.test(i)) return e.numbersOnly;
|
|
9117
9201
|
if (/(.)\1{2}/.test(i)) return e.repeatingDigit;
|
|
9118
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);
|
|
9119
9203
|
return t || s ? e.sequential : i[0] !== i[1] && i === i.slice(0, 2).repeat(3) ? e.alternatingPattern : null;
|
|
9120
9204
|
}
|
|
9121
|
-
function
|
|
9205
|
+
function Ns(i) {
|
|
9122
9206
|
const e = Math.max(0, Math.ceil(i / 1e3)), r = Math.floor(e / 3600), t = Math.floor(e % 3600 / 60), s = e % 60;
|
|
9123
9207
|
return r > 0 ? `${r}h ${String(t).padStart(2, "0")}m` : `${String(t).padStart(2, "0")}:${String(s).padStart(2, "0")}`;
|
|
9124
9208
|
}
|
|
9125
|
-
function
|
|
9126
|
-
var
|
|
9209
|
+
function Oe(i, e, r, t, s, o, n) {
|
|
9210
|
+
var qe, je;
|
|
9127
9211
|
let a = !!(o && o > Date.now()), l = !1;
|
|
9128
|
-
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,
|
|
9129
|
-
b.dataset.digit =
|
|
9130
|
-
},
|
|
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) => {
|
|
9213
|
+
b.dataset.digit = v, b.value = m;
|
|
9214
|
+
}, S = (b) => {
|
|
9131
9215
|
delete b.dataset.digit, b.value = "";
|
|
9132
|
-
},
|
|
9216
|
+
}, A = (b) => b.dataset.digit ?? "", E = () => p().map(A).join(""), k = () => Array.from(i.querySelectorAll(".__crossx-pin6-dot")), T = () => {
|
|
9133
9217
|
var I;
|
|
9134
|
-
const b = p(),
|
|
9135
|
-
if (
|
|
9136
|
-
const $ = !!(b[N] &&
|
|
9218
|
+
const b = p(), v = k();
|
|
9219
|
+
if (v.length && (v.forEach((R, N) => {
|
|
9220
|
+
const $ = !!(b[N] && A(b[N]));
|
|
9137
9221
|
R.classList.toggle("--filled", $), R.classList.toggle("--active", !1);
|
|
9138
9222
|
}), !a && !l)) {
|
|
9139
|
-
const R = b.findIndex(($) => !
|
|
9140
|
-
(I =
|
|
9141
|
-
}
|
|
9142
|
-
},
|
|
9143
|
-
i.querySelectorAll(".__crossx-pin6-numpad-key[data-key]").forEach((
|
|
9144
|
-
},
|
|
9145
|
-
a = b, p().forEach((
|
|
9146
|
-
|
|
9223
|
+
const R = b.findIndex(($) => !A($));
|
|
9224
|
+
(I = v[R === -1 ? 5 : R]) == null || I.classList.add("--active");
|
|
9225
|
+
}
|
|
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) => {
|
|
9229
|
+
a = b, p().forEach((v) => {
|
|
9230
|
+
v.disabled = b, v.classList.toggle("--locked", b);
|
|
9147
9231
|
});
|
|
9148
|
-
},
|
|
9232
|
+
}, M = () => i.querySelector("#__crossx-pin6-attempt"), H = () => {
|
|
9149
9233
|
const b = u();
|
|
9150
9234
|
b && (b.textContent = "");
|
|
9151
|
-
},
|
|
9235
|
+
}, O = () => n ?? "Your account will be locked after further failures.", P = () => i.querySelector("#__crossx-pin6-warning"), L = (b) => {
|
|
9152
9236
|
var I;
|
|
9153
|
-
let
|
|
9154
|
-
if (!
|
|
9155
|
-
|
|
9237
|
+
let v = P();
|
|
9238
|
+
if (!v) {
|
|
9239
|
+
v = document.createElement("p"), v.className = "__crossx-pin6-warning", v.id = "__crossx-pin6-warning";
|
|
9156
9240
|
const R = u();
|
|
9157
|
-
R ? R.insertAdjacentElement("afterend",
|
|
9241
|
+
R ? R.insertAdjacentElement("afterend", v) : (I = f()) == null || I.appendChild(v);
|
|
9158
9242
|
}
|
|
9159
|
-
|
|
9160
|
-
},
|
|
9161
|
-
const b =
|
|
9243
|
+
v.textContent = b;
|
|
9244
|
+
}, B = () => {
|
|
9245
|
+
const b = P();
|
|
9162
9246
|
b && (b.textContent = "");
|
|
9163
|
-
},
|
|
9247
|
+
}, ne = (b, v) => {
|
|
9164
9248
|
var R;
|
|
9165
|
-
let I =
|
|
9249
|
+
let I = M();
|
|
9166
9250
|
if (!I) {
|
|
9167
9251
|
I = document.createElement("p"), I.className = "__crossx-pin6-attempt", I.id = "__crossx-pin6-attempt";
|
|
9168
|
-
const N =
|
|
9252
|
+
const N = P() ?? u();
|
|
9169
9253
|
N ? N.insertAdjacentElement("afterend", I) : (R = f()) == null || R.appendChild(I);
|
|
9170
9254
|
}
|
|
9171
|
-
I.textContent = `${b}/${
|
|
9172
|
-
},
|
|
9173
|
-
const b =
|
|
9255
|
+
I.textContent = `${b}/${v}`;
|
|
9256
|
+
}, he = () => {
|
|
9257
|
+
const b = M();
|
|
9174
9258
|
b && (b.textContent = "");
|
|
9175
|
-
},
|
|
9176
|
-
const
|
|
9177
|
-
|
|
9259
|
+
}, we = (b) => {
|
|
9260
|
+
const v = u();
|
|
9261
|
+
v && (v.textContent = b);
|
|
9178
9262
|
const I = _();
|
|
9179
|
-
I == null || I.classList.add("--shake"), setTimeout(() => I == null ? void 0 : I.classList.remove("--shake"), 500), p().forEach(
|
|
9263
|
+
I == null || I.classList.add("--shake"), setTimeout(() => I == null ? void 0 : I.classList.remove("--shake"), 500), p().forEach(S), setTimeout(() => {
|
|
9180
9264
|
var R;
|
|
9181
|
-
(R = p()[0]) == null || R.focus(),
|
|
9265
|
+
(R = p()[0]) == null || R.focus(), T();
|
|
9182
9266
|
}, 50);
|
|
9183
|
-
},
|
|
9267
|
+
}, ae = (b) => {
|
|
9184
9268
|
var $;
|
|
9185
|
-
|
|
9186
|
-
const
|
|
9187
|
-
if (
|
|
9188
|
-
const
|
|
9189
|
-
|
|
9190
|
-
const
|
|
9191
|
-
|
|
9269
|
+
z(!0), p().forEach(S), C();
|
|
9270
|
+
const v = u();
|
|
9271
|
+
if (v && (v.textContent = "Too many failed attempts. Please wait."), !x()) {
|
|
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);
|
|
9192
9276
|
}
|
|
9193
9277
|
const I = () => {
|
|
9194
|
-
var
|
|
9195
|
-
const
|
|
9196
|
-
|
|
9197
|
-
var
|
|
9198
|
-
return (
|
|
9199
|
-
}, 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)}`);
|
|
9200
9284
|
}, R = setInterval(I, 1e3);
|
|
9201
9285
|
I();
|
|
9202
9286
|
const N = new MutationObserver(() => {
|
|
9203
9287
|
document.contains(i) || (clearInterval(R), N.disconnect());
|
|
9204
9288
|
});
|
|
9205
9289
|
N.observe(document.body, { childList: !0, subtree: !1 });
|
|
9206
|
-
},
|
|
9290
|
+
}, ce = async () => {
|
|
9207
9291
|
if (a || l) return;
|
|
9208
|
-
const b =
|
|
9292
|
+
const b = E();
|
|
9209
9293
|
if (b.length === 6) {
|
|
9210
|
-
l = !0, p().forEach((
|
|
9211
|
-
|
|
9294
|
+
l = !0, p().forEach((v) => {
|
|
9295
|
+
v.disabled = !0;
|
|
9212
9296
|
});
|
|
9213
9297
|
try {
|
|
9214
9298
|
if (s) {
|
|
9215
|
-
const
|
|
9216
|
-
|
|
9299
|
+
const v = await s(b);
|
|
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()));
|
|
9217
9301
|
} else
|
|
9218
9302
|
e(b);
|
|
9219
|
-
} catch (
|
|
9220
|
-
t && t(
|
|
9303
|
+
} catch (v) {
|
|
9304
|
+
t && t(v);
|
|
9221
9305
|
} finally {
|
|
9222
|
-
l = !1, a || p().forEach((
|
|
9223
|
-
|
|
9224
|
-
}),
|
|
9306
|
+
l = !1, a || p().forEach((v) => {
|
|
9307
|
+
v.disabled = !1;
|
|
9308
|
+
}), T();
|
|
9225
9309
|
}
|
|
9226
9310
|
}
|
|
9227
9311
|
};
|
|
9228
|
-
o && o > Date.now() ?
|
|
9312
|
+
o && o > Date.now() ? ae(o) : setTimeout(() => {
|
|
9229
9313
|
var b;
|
|
9230
9314
|
return (b = p()[0]) == null ? void 0 : b.focus();
|
|
9231
9315
|
}, 100);
|
|
9232
|
-
const
|
|
9316
|
+
const le = () => {
|
|
9233
9317
|
if (a || l) return;
|
|
9234
|
-
const b = p(),
|
|
9235
|
-
|
|
9318
|
+
const b = p(), v = b.find((I) => !A(I)) ?? b[b.length - 1];
|
|
9319
|
+
v == null || v.focus();
|
|
9236
9320
|
};
|
|
9237
|
-
(
|
|
9238
|
-
b.target.classList.contains("__crossx-pin6-box") ||
|
|
9239
|
-
}), (
|
|
9240
|
-
const
|
|
9241
|
-
|
|
9242
|
-
}), p().forEach((b,
|
|
9321
|
+
(qe = _()) == null || qe.addEventListener("click", (b) => {
|
|
9322
|
+
b.target.classList.contains("__crossx-pin6-box") || le();
|
|
9323
|
+
}), (je = f()) == null || je.addEventListener("click", (b) => {
|
|
9324
|
+
const v = b.target;
|
|
9325
|
+
v.classList.contains("__crossx-pin6-box") || v.closest("button") || le();
|
|
9326
|
+
}), p().forEach((b, v) => {
|
|
9243
9327
|
b.addEventListener("input", () => {
|
|
9244
9328
|
var R;
|
|
9245
9329
|
const I = b.value.replace(/\D/g, "").slice(-1);
|
|
9246
|
-
I ? y(b, I) :
|
|
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);
|
|
9247
9331
|
}), b.addEventListener("keydown", (I) => {
|
|
9248
9332
|
var R, N;
|
|
9249
9333
|
if (I.key === "Backspace") {
|
|
9250
|
-
if (I.preventDefault(),
|
|
9251
|
-
|
|
9252
|
-
else if (
|
|
9253
|
-
const $ = p()[
|
|
9254
|
-
|
|
9334
|
+
if (I.preventDefault(), A(b))
|
|
9335
|
+
S(b);
|
|
9336
|
+
else if (v > 0) {
|
|
9337
|
+
const $ = p()[v - 1];
|
|
9338
|
+
S($), $.focus();
|
|
9255
9339
|
}
|
|
9256
|
-
|
|
9257
|
-
} else I.key === "ArrowLeft" &&
|
|
9340
|
+
T();
|
|
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();
|
|
9258
9342
|
}), b.addEventListener("paste", (I) => {
|
|
9259
|
-
var $,
|
|
9343
|
+
var $, W;
|
|
9260
9344
|
I.preventDefault();
|
|
9261
9345
|
const R = ((($ = I.clipboardData) == null ? void 0 : $.getData("text")) ?? "").replace(/\D/g, "").slice(0, 6);
|
|
9262
9346
|
if (!R) return;
|
|
9263
9347
|
const N = p();
|
|
9264
|
-
R.split("").forEach((
|
|
9265
|
-
N[
|
|
9266
|
-
}), (
|
|
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);
|
|
9267
9351
|
}), b.addEventListener("focus", () => b.select());
|
|
9268
9352
|
});
|
|
9269
9353
|
const ue = i.querySelector("#__crossx-pin6-numpad");
|
|
9270
9354
|
if (ue) {
|
|
9271
9355
|
let b = null;
|
|
9272
|
-
const
|
|
9356
|
+
const v = () => {
|
|
9273
9357
|
b && (b.classList.remove("--pressed"), b = null);
|
|
9274
9358
|
};
|
|
9275
9359
|
ue.addEventListener("pointerdown", (R) => {
|
|
9276
9360
|
const N = R.target.closest(".__crossx-pin6-numpad-key");
|
|
9277
|
-
!N || a || l || (
|
|
9361
|
+
!N || a || l || (v(), b = N, N.classList.add("--pressed"), N.setPointerCapture(R.pointerId));
|
|
9278
9362
|
});
|
|
9279
9363
|
const I = (R) => {
|
|
9280
9364
|
const N = R.dataset.key;
|
|
9281
9365
|
if (!N) return;
|
|
9282
9366
|
if (N === "backspace") {
|
|
9283
|
-
const
|
|
9284
|
-
|
|
9367
|
+
const ee = [...p()].reverse().find((me) => A(me));
|
|
9368
|
+
ee && (S(ee), H()), T();
|
|
9285
9369
|
return;
|
|
9286
9370
|
}
|
|
9287
9371
|
if (!/^\d$/.test(N)) return;
|
|
9288
|
-
const
|
|
9289
|
-
|
|
9372
|
+
const W = p().find((q) => !A(q));
|
|
9373
|
+
W && (y(W, N), H(), T(), E().length === 6 && setTimeout(ce, 80));
|
|
9290
9374
|
};
|
|
9291
9375
|
ue.addEventListener("pointerup", (R) => {
|
|
9292
9376
|
if (!b) return;
|
|
9293
9377
|
const N = b;
|
|
9294
|
-
|
|
9378
|
+
v();
|
|
9295
9379
|
const $ = N.getBoundingClientRect();
|
|
9296
9380
|
R.clientX >= $.left && R.clientX <= $.right && R.clientY >= $.top && R.clientY <= $.bottom && !a && !l && I(N);
|
|
9297
|
-
}), ue.addEventListener("pointercancel",
|
|
9381
|
+
}), ue.addEventListener("pointercancel", v), ue.addEventListener("pointerleave", v, !0), T(), o && o > Date.now() && C();
|
|
9298
9382
|
}
|
|
9299
9383
|
}
|
|
9300
|
-
const
|
|
9384
|
+
const Os = `<svg width="22" height="17" viewBox="0 0 22 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
9301
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"/>
|
|
9302
9386
|
<line x1="10" y1="5.5" x2="16" y2="11.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
|
9303
9387
|
<line x1="16" y1="5.5" x2="10" y2="11.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
|
9304
|
-
</svg>`,
|
|
9388
|
+
</svg>`, It = `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
9305
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"/>
|
|
9306
|
-
</svg>`,
|
|
9390
|
+
</svg>`, Ls = `<svg width="11" height="9" viewBox="0 0 11 9" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
9307
9391
|
<path d="M1 4.5L4 7.5L10 1" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
9308
|
-
</svg>`,
|
|
9392
|
+
</svg>`, Ds = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
9309
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"/>
|
|
9310
9394
|
</svg>`;
|
|
9311
|
-
function
|
|
9395
|
+
function Ms(i, e, r) {
|
|
9312
9396
|
var o;
|
|
9313
9397
|
const t = i.querySelectorAll(".__crossx-pin-input");
|
|
9314
9398
|
t.forEach((n, a) => {
|
|
@@ -9341,9 +9425,9 @@ function Cs(i, e, r) {
|
|
|
9341
9425
|
}
|
|
9342
9426
|
}), (o = t[0]) == null || o.focus();
|
|
9343
9427
|
}
|
|
9344
|
-
class
|
|
9345
|
-
constructor(e = "light", r, t =
|
|
9346
|
-
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();
|
|
9347
9431
|
}
|
|
9348
9432
|
setPinKeyboard(e) {
|
|
9349
9433
|
this.pinKeyboard = e;
|
|
@@ -9363,7 +9447,7 @@ class Ps {
|
|
|
9363
9447
|
e && e.classList.toggle("--native-keypad", this.resolvePinKeyboardMode() === "native");
|
|
9364
9448
|
}
|
|
9365
9449
|
setTheme(e, r) {
|
|
9366
|
-
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);
|
|
9367
9451
|
}
|
|
9368
9452
|
setMessages(e) {
|
|
9369
9453
|
this.messages = e;
|
|
@@ -9384,25 +9468,25 @@ class Ps {
|
|
|
9384
9468
|
*/
|
|
9385
9469
|
showWalletSelector(e, r, t) {
|
|
9386
9470
|
return new Promise((s, o) => {
|
|
9387
|
-
var
|
|
9471
|
+
var A;
|
|
9388
9472
|
K();
|
|
9389
|
-
const n = [...e], a =
|
|
9390
|
-
|
|
9473
|
+
const n = [...e], a = ws(n, this.tokens, t, this.messages), l = re();
|
|
9474
|
+
V(a);
|
|
9391
9475
|
let p = !1;
|
|
9392
9476
|
const _ = () => {
|
|
9393
9477
|
p || (p = !0, a.remove(), l());
|
|
9394
9478
|
};
|
|
9395
9479
|
let u = null;
|
|
9396
|
-
const x = (
|
|
9397
|
-
_(), s(
|
|
9480
|
+
const x = (E) => {
|
|
9481
|
+
_(), s(E);
|
|
9398
9482
|
}, g = () => {
|
|
9399
9483
|
_(), u ? o(u) : s(null);
|
|
9400
9484
|
};
|
|
9401
9485
|
(() => {
|
|
9402
|
-
a.querySelectorAll(".__crossx-wallet-item").forEach((
|
|
9403
|
-
|
|
9404
|
-
const
|
|
9405
|
-
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 });
|
|
9406
9490
|
});
|
|
9407
9491
|
});
|
|
9408
9492
|
})();
|
|
@@ -9410,37 +9494,37 @@ class Ps {
|
|
|
9410
9494
|
y && y.addEventListener("click", async () => {
|
|
9411
9495
|
y.disabled = !0, m && (m.hidden = !0, m.textContent = "");
|
|
9412
9496
|
try {
|
|
9413
|
-
const
|
|
9414
|
-
n.push(
|
|
9415
|
-
const
|
|
9416
|
-
if (
|
|
9417
|
-
const
|
|
9418
|
-
|
|
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);
|
|
9419
9503
|
try {
|
|
9420
|
-
|
|
9504
|
+
T.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
9421
9505
|
} catch {
|
|
9422
9506
|
}
|
|
9423
9507
|
}
|
|
9424
9508
|
y.disabled = !1;
|
|
9425
|
-
} catch (
|
|
9426
|
-
const
|
|
9427
|
-
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;
|
|
9428
9512
|
}
|
|
9429
|
-
}), (
|
|
9430
|
-
|
|
9513
|
+
}), (A = a.querySelector("#__crossx-close-btn")) == null || A.addEventListener("click", g), a.addEventListener("click", (E) => {
|
|
9514
|
+
E.target === a && g();
|
|
9431
9515
|
});
|
|
9432
|
-
const
|
|
9433
|
-
|
|
9516
|
+
const S = (E) => {
|
|
9517
|
+
E.key === "Escape" && (document.removeEventListener("keydown", S), g());
|
|
9434
9518
|
};
|
|
9435
|
-
document.addEventListener("keydown",
|
|
9519
|
+
document.addEventListener("keydown", S);
|
|
9436
9520
|
});
|
|
9437
9521
|
}
|
|
9438
9522
|
showWalletCreatedPrompt() {
|
|
9439
9523
|
return new Promise((e) => {
|
|
9440
9524
|
var a, l;
|
|
9441
9525
|
K();
|
|
9442
|
-
const r =
|
|
9443
|
-
|
|
9526
|
+
const r = ms(this.tokens, this.messages), t = re();
|
|
9527
|
+
V(r);
|
|
9444
9528
|
let s = !1, o = null;
|
|
9445
9529
|
const n = () => {
|
|
9446
9530
|
s || (s = !0, o && document.removeEventListener("keydown", o), r.remove(), t(), e());
|
|
@@ -9462,7 +9546,7 @@ class Ps {
|
|
|
9462
9546
|
resolveAddWalletErrorMessage(e) {
|
|
9463
9547
|
const r = this.messages;
|
|
9464
9548
|
if (e instanceof h && e.code === d.ADDRESS_LIMIT_EXCEEDED) {
|
|
9465
|
-
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;
|
|
9466
9550
|
return ((r == null ? void 0 : r.wallet_selector_add_error_limit_exceeded) ?? "Account limit reached. Maximum {limit} accounts allowed.").replace("{limit}", String(o));
|
|
9467
9551
|
}
|
|
9468
9552
|
return (r == null ? void 0 : r.wallet_selector_add_error_generic) ?? "Failed to add a new account. Please try again.";
|
|
@@ -9480,8 +9564,8 @@ class Ps {
|
|
|
9480
9564
|
return new Promise((s) => {
|
|
9481
9565
|
var x, g, f, m;
|
|
9482
9566
|
K();
|
|
9483
|
-
const o =
|
|
9484
|
-
|
|
9567
|
+
const o = Es(this.tokens, r, this.messages), n = re();
|
|
9568
|
+
V(o);
|
|
9485
9569
|
const a = () => {
|
|
9486
9570
|
o.remove(), n();
|
|
9487
9571
|
}, l = (y) => {
|
|
@@ -9492,12 +9576,12 @@ class Ps {
|
|
|
9492
9576
|
a(), s(null);
|
|
9493
9577
|
};
|
|
9494
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) => {
|
|
9495
|
-
const
|
|
9496
|
-
|
|
9579
|
+
const A = y.currentTarget.dataset.walletId ?? "";
|
|
9580
|
+
A && p(A);
|
|
9497
9581
|
}), (m = o.querySelector("#__crossx-close-btn")) == null || m.addEventListener("click", _), o.addEventListener("click", (y) => {
|
|
9498
9582
|
y.target === o && _();
|
|
9499
9583
|
}), o.querySelectorAll(".__crossx-login-terms-link").forEach((y) => {
|
|
9500
|
-
y.addEventListener("click", (
|
|
9584
|
+
y.addEventListener("click", (S) => S.stopPropagation());
|
|
9501
9585
|
});
|
|
9502
9586
|
const u = (y) => {
|
|
9503
9587
|
y.key === "Escape" && (document.removeEventListener("keydown", u), _());
|
|
@@ -9509,15 +9593,15 @@ class Ps {
|
|
|
9509
9593
|
return new Promise((r) => {
|
|
9510
9594
|
var _, u, x;
|
|
9511
9595
|
K();
|
|
9512
|
-
const t = this.messages, s =
|
|
9596
|
+
const t = this.messages, s = As(this.tokens, {
|
|
9513
9597
|
title: e.title,
|
|
9514
9598
|
message: e.message,
|
|
9515
9599
|
email: e.email,
|
|
9516
9600
|
accountLabel: (t == null ? void 0 : t.session_alert_account_label) ?? "Account",
|
|
9517
9601
|
signOutLabel: (t == null ? void 0 : t.session_alert_sign_out_button) ?? "Sign out",
|
|
9518
9602
|
signInAgainLabel: (t == null ? void 0 : t.session_alert_sign_in_again_button) ?? "Sign in again"
|
|
9519
|
-
}), o =
|
|
9520
|
-
|
|
9603
|
+
}), o = re();
|
|
9604
|
+
V(s);
|
|
9521
9605
|
let n = !1;
|
|
9522
9606
|
const a = () => {
|
|
9523
9607
|
n || (n = !0, s.remove(), o());
|
|
@@ -9539,8 +9623,8 @@ class Ps {
|
|
|
9539
9623
|
return new Promise((t) => {
|
|
9540
9624
|
var a, l, p;
|
|
9541
9625
|
K();
|
|
9542
|
-
const s =
|
|
9543
|
-
|
|
9626
|
+
const s = Is(this.tokens, r);
|
|
9627
|
+
V(s);
|
|
9544
9628
|
const o = () => s.remove(), n = () => {
|
|
9545
9629
|
o(), t("recover");
|
|
9546
9630
|
};
|
|
@@ -9586,13 +9670,13 @@ class Ps {
|
|
|
9586
9670
|
title: (t == null ? void 0 : t.pin_setup_confirm_title) ?? "Confirm PIN",
|
|
9587
9671
|
headerSubtitle: (t == null ? void 0 : t.pin_setup_header_subtitle) ?? "This PIN is used to authorize your transactions.",
|
|
9588
9672
|
subtitle: (t == null ? void 0 : t.pin_setup_confirm_subtitle) ?? "Confirm your 6-digit PIN"
|
|
9589
|
-
}, a =
|
|
9590
|
-
|
|
9673
|
+
}, a = _t(this.tokens, Cs(s)), l = re();
|
|
9674
|
+
V(a);
|
|
9591
9675
|
let p = !1;
|
|
9592
9676
|
const _ = () => {
|
|
9593
9677
|
p || (p = !0, a.remove(), l());
|
|
9594
|
-
}, u = (
|
|
9595
|
-
_(), r(
|
|
9678
|
+
}, u = (A) => {
|
|
9679
|
+
_(), r(A);
|
|
9596
9680
|
}, x = () => {
|
|
9597
9681
|
_(), r(null);
|
|
9598
9682
|
}, g = a.querySelector(".__crossx-card"), f = {
|
|
@@ -9601,67 +9685,67 @@ class Ps {
|
|
|
9601
9685
|
repeatingDigit: (t == null ? void 0 : t.pin_validation_repeating_digit) ?? "Cannot use the same number 3+ times in a row.",
|
|
9602
9686
|
sequential: (t == null ? void 0 : t.pin_validation_sequential) ?? "Sequential numbers (e.g., 123456) are not allowed.",
|
|
9603
9687
|
alternatingPattern: (t == null ? void 0 : t.pin_validation_alternating_pattern) ?? "Repeating patterns (e.g., 121212) are not allowed."
|
|
9604
|
-
}, m = (
|
|
9605
|
-
var
|
|
9606
|
-
g.innerHTML =
|
|
9688
|
+
}, m = (A) => {
|
|
9689
|
+
var E;
|
|
9690
|
+
g.innerHTML = Ne({
|
|
9607
9691
|
title: n.title,
|
|
9608
9692
|
headerSubtitle: n.headerSubtitle,
|
|
9609
9693
|
subtitle: n.subtitle
|
|
9610
|
-
}), this.applyPinKeyboardMode(g), (
|
|
9611
|
-
|
|
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);
|
|
9612
9696
|
}, x);
|
|
9613
|
-
}, y = (
|
|
9614
|
-
var
|
|
9615
|
-
g.innerHTML =
|
|
9697
|
+
}, y = (A) => {
|
|
9698
|
+
var E;
|
|
9699
|
+
g.innerHTML = Ne({
|
|
9616
9700
|
title: o.title,
|
|
9617
9701
|
headerSubtitle: o.headerSubtitle,
|
|
9618
9702
|
subtitle: o.subtitle,
|
|
9619
|
-
errorMessage:
|
|
9620
|
-
}), this.applyPinKeyboardMode(g), (
|
|
9621
|
-
const
|
|
9622
|
-
|
|
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);
|
|
9623
9707
|
}, x);
|
|
9624
9708
|
};
|
|
9625
9709
|
(() => {
|
|
9626
|
-
var
|
|
9627
|
-
const
|
|
9628
|
-
|
|
9629
|
-
const
|
|
9630
|
-
const
|
|
9631
|
-
|
|
9632
|
-
},
|
|
9633
|
-
if (
|
|
9634
|
-
const
|
|
9635
|
-
|
|
9636
|
-
},
|
|
9637
|
-
if (!
|
|
9638
|
-
const
|
|
9639
|
-
|
|
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();
|
|
9640
9724
|
};
|
|
9641
|
-
|
|
9642
|
-
const L = parseInt(
|
|
9643
|
-
|
|
9644
|
-
|
|
9645
|
-
}),
|
|
9646
|
-
(
|
|
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));
|
|
9647
9731
|
});
|
|
9648
|
-
}),
|
|
9649
|
-
if (
|
|
9732
|
+
}), E.addEventListener("click", () => {
|
|
9733
|
+
if (k.size === A.length) {
|
|
9650
9734
|
y(e == null ? void 0 : e.errorMessage);
|
|
9651
9735
|
return;
|
|
9652
9736
|
}
|
|
9653
|
-
const
|
|
9654
|
-
const
|
|
9655
|
-
return !
|
|
9737
|
+
const P = A.find((B) => {
|
|
9738
|
+
const ne = parseInt(B.dataset.checkIndex ?? "0", 10);
|
|
9739
|
+
return !k.has(ne);
|
|
9656
9740
|
});
|
|
9657
|
-
if (!
|
|
9658
|
-
const L = parseInt(
|
|
9659
|
-
|
|
9660
|
-
|
|
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);
|
|
9661
9745
|
}, 400);
|
|
9662
|
-
}), (
|
|
9663
|
-
})(), a.addEventListener("click", (
|
|
9664
|
-
|
|
9746
|
+
}), (O = g.querySelector("#__crossx-close-btn")) == null || O.addEventListener("click", x);
|
|
9747
|
+
})(), a.addEventListener("click", (A) => {
|
|
9748
|
+
A.target === a && x();
|
|
9665
9749
|
});
|
|
9666
9750
|
});
|
|
9667
9751
|
}
|
|
@@ -9672,11 +9756,11 @@ class Ps {
|
|
|
9672
9756
|
*/
|
|
9673
9757
|
showPinInputPrompt(e) {
|
|
9674
9758
|
return new Promise((r, t) => {
|
|
9675
|
-
var
|
|
9759
|
+
var S;
|
|
9676
9760
|
K();
|
|
9677
|
-
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(
|
|
9678
9762
|
this.tokens,
|
|
9679
|
-
|
|
9763
|
+
Ne({
|
|
9680
9764
|
title: n,
|
|
9681
9765
|
headerSubtitle: a,
|
|
9682
9766
|
errorMessage: e == null ? void 0 : e.errorMessage,
|
|
@@ -9685,20 +9769,20 @@ class Ps {
|
|
|
9685
9769
|
attemptCount: e == null ? void 0 : e.attemptCount,
|
|
9686
9770
|
maxAttempts: e == null ? void 0 : e.maxAttempts
|
|
9687
9771
|
})
|
|
9688
|
-
), _ =
|
|
9689
|
-
|
|
9772
|
+
), _ = re();
|
|
9773
|
+
V(p);
|
|
9690
9774
|
let u = !1;
|
|
9691
9775
|
const x = () => {
|
|
9692
9776
|
u || (u = !0, p.remove(), _());
|
|
9693
|
-
}, g = (
|
|
9694
|
-
x(), r(
|
|
9777
|
+
}, g = (A) => {
|
|
9778
|
+
x(), r(A);
|
|
9695
9779
|
}, f = () => {
|
|
9696
9780
|
x(), r(null);
|
|
9697
|
-
}, m = (
|
|
9698
|
-
x(), t(
|
|
9781
|
+
}, m = (A) => {
|
|
9782
|
+
x(), t(A);
|
|
9699
9783
|
}, y = p.querySelector(".__crossx-card");
|
|
9700
|
-
this.applyPinKeyboardMode(y), (
|
|
9701
|
-
|
|
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();
|
|
9702
9786
|
});
|
|
9703
9787
|
});
|
|
9704
9788
|
}
|
|
@@ -9713,14 +9797,14 @@ class Ps {
|
|
|
9713
9797
|
return new Promise((r) => {
|
|
9714
9798
|
var l;
|
|
9715
9799
|
K();
|
|
9716
|
-
const t =
|
|
9717
|
-
|
|
9800
|
+
const t = ks(this.tokens, e);
|
|
9801
|
+
V(t);
|
|
9718
9802
|
const s = () => t.remove(), o = (p) => {
|
|
9719
9803
|
s(), r(p);
|
|
9720
9804
|
}, n = () => {
|
|
9721
9805
|
s(), r(null);
|
|
9722
9806
|
}, a = t.querySelector(".__crossx-card");
|
|
9723
|
-
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) => {
|
|
9724
9808
|
p.target === t && n();
|
|
9725
9809
|
});
|
|
9726
9810
|
});
|
|
@@ -9735,8 +9819,8 @@ class Ps {
|
|
|
9735
9819
|
return new Promise((t) => {
|
|
9736
9820
|
var p;
|
|
9737
9821
|
K();
|
|
9738
|
-
const { overlay: s, startCountdown: o } =
|
|
9739
|
-
|
|
9822
|
+
const { overlay: s, startCountdown: o } = Rs(this.tokens, e, r);
|
|
9823
|
+
V(s);
|
|
9740
9824
|
const n = () => {
|
|
9741
9825
|
l(), s.remove();
|
|
9742
9826
|
}, a = () => {
|
|
@@ -9755,8 +9839,8 @@ class Ps {
|
|
|
9755
9839
|
return new Promise((r) => {
|
|
9756
9840
|
var a, l;
|
|
9757
9841
|
K();
|
|
9758
|
-
const t =
|
|
9759
|
-
|
|
9842
|
+
const t = cs(e, this.tokens, this.messages);
|
|
9843
|
+
V(t);
|
|
9760
9844
|
const s = () => t.remove(), o = () => {
|
|
9761
9845
|
s(), r();
|
|
9762
9846
|
};
|
|
@@ -9784,8 +9868,8 @@ class Ps {
|
|
|
9784
9868
|
showTransactionProgress(e, r) {
|
|
9785
9869
|
return new Promise((t) => {
|
|
9786
9870
|
K();
|
|
9787
|
-
const s =
|
|
9788
|
-
|
|
9871
|
+
const s = ls(e, this.tokens, this.messages);
|
|
9872
|
+
V(s);
|
|
9789
9873
|
const o = () => s.remove();
|
|
9790
9874
|
let n = !1;
|
|
9791
9875
|
const a = () => {
|
|
@@ -9801,7 +9885,7 @@ class Ps {
|
|
|
9801
9885
|
document.addEventListener("keydown", p);
|
|
9802
9886
|
};
|
|
9803
9887
|
r.then((p) => {
|
|
9804
|
-
n || (
|
|
9888
|
+
n || (ds(s, p, this.tokens, this.messages), l());
|
|
9805
9889
|
});
|
|
9806
9890
|
});
|
|
9807
9891
|
}
|
|
@@ -9810,9 +9894,9 @@ class Ps {
|
|
|
9810
9894
|
var p, _, u;
|
|
9811
9895
|
K();
|
|
9812
9896
|
let t;
|
|
9813
|
-
e.type === "sign-message" ? t =
|
|
9814
|
-
const s =
|
|
9815
|
-
|
|
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);
|
|
9816
9900
|
const o = () => {
|
|
9817
9901
|
t.remove(), s();
|
|
9818
9902
|
}, n = () => {
|
|
@@ -9828,7 +9912,7 @@ class Ps {
|
|
|
9828
9912
|
f && ((m = navigator.clipboard) == null || m.writeText(f).catch(() => {
|
|
9829
9913
|
}));
|
|
9830
9914
|
});
|
|
9831
|
-
}),
|
|
9915
|
+
}), Wr(t), t.addEventListener("click", (x) => {
|
|
9832
9916
|
x.target === t && a();
|
|
9833
9917
|
});
|
|
9834
9918
|
const l = (x) => {
|
|
@@ -9838,7 +9922,7 @@ class Ps {
|
|
|
9838
9922
|
});
|
|
9839
9923
|
}
|
|
9840
9924
|
}
|
|
9841
|
-
class
|
|
9925
|
+
class Fs {
|
|
9842
9926
|
constructor(e, r, t, s = () => !1) {
|
|
9843
9927
|
this.browserConfirmation = e, this.getBridge = r, this.getOrigin = t, this.isAuthenticatedViaRNBridge = s;
|
|
9844
9928
|
}
|
|
@@ -10008,7 +10092,7 @@ class Ns {
|
|
|
10008
10092
|
(t = (r = this.browserConfirmation).setPinKeyboard) == null || t.call(r, e);
|
|
10009
10093
|
}
|
|
10010
10094
|
}
|
|
10011
|
-
class
|
|
10095
|
+
class Bs {
|
|
10012
10096
|
constructor() {
|
|
10013
10097
|
this._accessToken = null, this._expiresAt = 0;
|
|
10014
10098
|
}
|
|
@@ -10040,7 +10124,7 @@ class Os {
|
|
|
10040
10124
|
return !this._accessToken || this._expiresAt <= 0 ? !0 : Date.now() >= this._expiresAt - e;
|
|
10041
10125
|
}
|
|
10042
10126
|
}
|
|
10043
|
-
function
|
|
10127
|
+
function Js(i, e) {
|
|
10044
10128
|
if (!i.projectId)
|
|
10045
10129
|
throw new Error(
|
|
10046
10130
|
`[CROSSx] Fatal: projectId is required but was not provided.
|
|
@@ -10048,7 +10132,7 @@ Set the projectId field in SDKConfig when calling createCROSSxSDK().
|
|
|
10048
10132
|
Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
|
|
10049
10133
|
);
|
|
10050
10134
|
i.debug;
|
|
10051
|
-
const r =
|
|
10135
|
+
const r = _e.production, t = {
|
|
10052
10136
|
...i,
|
|
10053
10137
|
oauthServiceUrl: r.oauthServiceUrl,
|
|
10054
10138
|
authApiUrl: r.authApiUrl,
|
|
@@ -10056,15 +10140,15 @@ Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
|
|
|
10056
10140
|
}, s = {
|
|
10057
10141
|
gatewayUrl: r.walletGatewayUrl,
|
|
10058
10142
|
projectId: i.projectId
|
|
10059
|
-
}, o = t.authMode !== "cookie" &&
|
|
10143
|
+
}, o = t.authMode !== "cookie" && nt.isAvailable();
|
|
10060
10144
|
!o && t.authMode !== "cookie" && c.warn(
|
|
10061
10145
|
"[CROSSx] IndexedDB 사용 불가 — LocalStorage fallback 사용 중.",
|
|
10062
10146
|
"refresh_token이 평문 저장되지 않도록 세션 영속성이 제한됩니다.",
|
|
10063
10147
|
"IndexedDB를 지원하는 브라우저 사용을 권장합니다."
|
|
10064
10148
|
), t.secureStorageAvailable = o;
|
|
10065
|
-
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();
|
|
10066
10150
|
let x;
|
|
10067
|
-
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(
|
|
10068
10152
|
s,
|
|
10069
10153
|
n,
|
|
10070
10154
|
l,
|
|
@@ -10073,36 +10157,36 @@ Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
|
|
|
10073
10157
|
));
|
|
10074
10158
|
let g = null;
|
|
10075
10159
|
const f = () => {
|
|
10076
|
-
var
|
|
10077
|
-
return ((
|
|
10160
|
+
var C;
|
|
10161
|
+
return ((C = g == null ? void 0 : g.isAuthenticatedViaRNBridge) == null ? void 0 : C.call(g)) ?? !1;
|
|
10078
10162
|
}, m = () => {
|
|
10079
|
-
var
|
|
10080
|
-
return (
|
|
10163
|
+
var C;
|
|
10164
|
+
return (C = g == null ? void 0 : g.assertRNBridgeSessionActive) == null ? void 0 : C.call(g);
|
|
10081
10165
|
};
|
|
10082
|
-
x = new
|
|
10166
|
+
x = new Dr(
|
|
10083
10167
|
x,
|
|
10084
10168
|
() => {
|
|
10085
|
-
var
|
|
10086
|
-
return (
|
|
10169
|
+
var C;
|
|
10170
|
+
return (C = g == null ? void 0 : g.getRNBridge) == null ? void 0 : C.call(g);
|
|
10087
10171
|
},
|
|
10088
10172
|
f,
|
|
10089
10173
|
m,
|
|
10090
10174
|
() => i.appName
|
|
10091
10175
|
);
|
|
10092
|
-
const y = new fe(s, l),
|
|
10176
|
+
const y = new fe(s, l), S = new $s(
|
|
10093
10177
|
i.theme ?? "light",
|
|
10094
10178
|
i.themeTokens,
|
|
10095
10179
|
i.displayDecimals,
|
|
10096
10180
|
i.pinKeyboard
|
|
10097
|
-
),
|
|
10098
|
-
|
|
10181
|
+
), A = new Fs(
|
|
10182
|
+
S,
|
|
10099
10183
|
() => {
|
|
10100
|
-
var
|
|
10101
|
-
return (
|
|
10184
|
+
var C;
|
|
10185
|
+
return (C = g == null ? void 0 : g.getRNBridge) == null ? void 0 : C.call(g);
|
|
10102
10186
|
},
|
|
10103
10187
|
() => typeof window < "u" ? window.location.origin : "http://localhost",
|
|
10104
10188
|
f
|
|
10105
|
-
),
|
|
10189
|
+
), E = e != null && e.wrapConfirmation ? e.wrapConfirmation(A) : A, k = new Me(
|
|
10106
10190
|
t,
|
|
10107
10191
|
s,
|
|
10108
10192
|
n,
|
|
@@ -10111,17 +10195,17 @@ Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
|
|
|
10111
10195
|
p,
|
|
10112
10196
|
x,
|
|
10113
10197
|
_,
|
|
10114
|
-
|
|
10198
|
+
E,
|
|
10115
10199
|
y,
|
|
10116
10200
|
u
|
|
10117
10201
|
);
|
|
10118
|
-
g =
|
|
10119
|
-
const
|
|
10120
|
-
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;
|
|
10121
10205
|
}
|
|
10122
|
-
function
|
|
10123
|
-
const e =
|
|
10124
|
-
|
|
10206
|
+
function Zs(i) {
|
|
10207
|
+
const e = Ws(i), r = Us(e), t = JSON.parse(r);
|
|
10208
|
+
Gs(t);
|
|
10125
10209
|
const { data: s } = t;
|
|
10126
10210
|
return {
|
|
10127
10211
|
status: t.status,
|
|
@@ -10135,7 +10219,7 @@ function Ks(i) {
|
|
|
10135
10219
|
raw: t
|
|
10136
10220
|
};
|
|
10137
10221
|
}
|
|
10138
|
-
function
|
|
10222
|
+
function Ws(i) {
|
|
10139
10223
|
if (i.includes("://") && i.includes("?")) {
|
|
10140
10224
|
const e = new URL(i), r = e.searchParams.get("crossx_oauth_result");
|
|
10141
10225
|
if (r) return r;
|
|
@@ -10145,22 +10229,22 @@ function Ls(i) {
|
|
|
10145
10229
|
}
|
|
10146
10230
|
return i;
|
|
10147
10231
|
}
|
|
10148
|
-
function
|
|
10232
|
+
function Us(i) {
|
|
10149
10233
|
if (i.startsWith("{"))
|
|
10150
10234
|
return i;
|
|
10151
10235
|
if (i.startsWith("%7B") || i.startsWith("%7b"))
|
|
10152
10236
|
return decodeURIComponent(i);
|
|
10153
|
-
const e =
|
|
10237
|
+
const e = Hs(i);
|
|
10154
10238
|
return decodeURIComponent(e);
|
|
10155
10239
|
}
|
|
10156
|
-
function
|
|
10240
|
+
function Hs(i) {
|
|
10157
10241
|
if (typeof atob == "function")
|
|
10158
10242
|
return atob(i);
|
|
10159
10243
|
if (typeof Buffer < "u")
|
|
10160
10244
|
return Buffer.from(i, "base64").toString("utf-8");
|
|
10161
10245
|
throw new Error("Base64 디코딩을 지원하는 환경이 아닙니다");
|
|
10162
10246
|
}
|
|
10163
|
-
function
|
|
10247
|
+
function Gs(i) {
|
|
10164
10248
|
if (typeof i != "object" || i === null)
|
|
10165
10249
|
throw new Error("Deeplink payload가 유효한 객체가 아닙니다");
|
|
10166
10250
|
const e = i;
|
|
@@ -10177,18 +10261,21 @@ function $s(i) {
|
|
|
10177
10261
|
throw new Error("Deeplink data에 accessToken 필드가 없습니다");
|
|
10178
10262
|
}
|
|
10179
10263
|
export {
|
|
10180
|
-
|
|
10264
|
+
Wt as CONNECT_OTHER_WALLET_DISPLAY_ORDER,
|
|
10181
10265
|
h as CROSSxError,
|
|
10182
|
-
|
|
10183
|
-
|
|
10184
|
-
|
|
10266
|
+
Vt as CROSSxEthereumProvider,
|
|
10267
|
+
Me as CROSSxSDK,
|
|
10268
|
+
js as ChainId,
|
|
10185
10269
|
ge as ConnectOtherWalletItem,
|
|
10186
10270
|
d as ErrorCode,
|
|
10187
|
-
|
|
10188
|
-
|
|
10189
|
-
|
|
10190
|
-
|
|
10191
|
-
|
|
10192
|
-
|
|
10193
|
-
|
|
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
|
|
10194
10281
|
};
|