@nexus-cross/crossx-sdk-core 2.3.10-beta.3 → 2.3.10-beta.5
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/adapters/oauth/BrowserOAuthAdapter.d.ts +10 -0
- package/dist/core/config/environments.d.ts +14 -0
- package/dist/core/constants.d.ts +1 -1
- package/dist/core/ports/OAuthPort.d.ts +13 -0
- package/dist/core/types/events.d.ts +12 -0
- package/dist/crossx.global +6 -6
- package/dist/index.cjs +7 -7
- package/dist/index.js +189 -155
- 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
|
@@ -16,7 +16,7 @@ class h extends Error {
|
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
const Rt = 2e3, je = 6e4, Ct = 1e3, Pt = 1e4, Nt = "0x77359400", Ye = "0x3B9ACA00", Xe = 130, Fe = 6, Je = 18, Ze = 3e4, Ot = 5 * 60 * 1e3, Lt = 30 * 1e3, Ne = 100, Dt = "crossx-sdk-js/2.3.10-beta.
|
|
19
|
+
const Rt = 2e3, je = 6e4, Ct = 1e3, Pt = 1e4, Nt = "0x77359400", Ye = "0x3B9ACA00", Xe = 130, Fe = 6, Je = 18, Ze = 3e4, Ot = 5 * 60 * 1e3, Lt = 30 * 1e3, Ne = 100, Dt = "crossx-sdk-js/2.3.10-beta.5", Be = "ONEwallet";
|
|
20
20
|
var ge = /* @__PURE__ */ ((i) => (i.MetaMask = "io.metamask", i.Binance = "com.binance.wallet", i.CROSSx = "crossx", i))(ge || {});
|
|
21
21
|
const Mt = {
|
|
22
22
|
"io.metamask": "MetaMask",
|
|
@@ -677,20 +677,20 @@ 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 E = ((n = S.firebase) == null ? void 0 : n.identities) ?? {};
|
|
683
|
+
m = S.email ?? ((a = E.email) == null ? void 0 : a[0]), f === "google.com" ? g = (l = E["google.com"]) == null ? void 0 : l[0] : f === "apple.com" && (g = (p = E["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 E = await this.crypto.verifyJWT(u);
|
|
691
|
+
if (s = E.signatureVerified ?? !1, !E.valid)
|
|
692
692
|
throw c.error("[CROSSx] access_token 검증 실패"), new Error("유효하지 않은 access token");
|
|
693
|
-
const A =
|
|
693
|
+
const A = E.payload, T = A.email ?? m ?? r;
|
|
694
694
|
c.log(
|
|
695
695
|
"[CROSSx] email 소스 — CROSSx JWT:",
|
|
696
696
|
A.email ?? "(없음)",
|
|
@@ -699,18 +699,18 @@ const et = "crossx_access_token", tt = "crossx_refresh_token", rt = "crossx_user
|
|
|
699
699
|
"/ OAuth 콜백:",
|
|
700
700
|
r ?? "(없음)",
|
|
701
701
|
"→",
|
|
702
|
-
|
|
702
|
+
T ?? "(없음)"
|
|
703
703
|
), t = {
|
|
704
704
|
id: A.sub,
|
|
705
|
-
email:
|
|
705
|
+
email: T,
|
|
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);
|
|
@@ -1435,8 +1435,16 @@ const de = {
|
|
|
1435
1435
|
}
|
|
1436
1436
|
};
|
|
1437
1437
|
function Jt(i) {
|
|
1438
|
-
const e = i.environment;
|
|
1439
|
-
|
|
1438
|
+
const e = i.environment, r = e && e in de ? de[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;
|
|
1440
1448
|
}
|
|
1441
1449
|
function We() {
|
|
1442
1450
|
try {
|
|
@@ -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: ((
|
|
2116
|
+
userEmail: ((o = e.user) == null ? void 0 : o.email) ?? null,
|
|
2117
|
+
providerSub: ((n = e.user) == null ? void 0 : n.providerSub) ?? null,
|
|
2110
2118
|
loginType: dr(
|
|
2111
|
-
(
|
|
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() {
|
|
@@ -2395,11 +2404,16 @@ const ne = class ne extends Yt {
|
|
|
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
2419
|
walletPreferenceKey: ne.WALLET_PREF_KEY,
|
|
@@ -2547,7 +2561,7 @@ 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.5 초기화 중..."), this.confirmation.setMessages(X(this._config.locale));
|
|
2551
2565
|
try {
|
|
2552
2566
|
const s = We();
|
|
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`);
|
|
@@ -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.5 초기화 완료"), 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
|
}
|
|
@@ -2603,7 +2617,7 @@ const ne = class ne extends Yt {
|
|
|
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.5",
|
|
2607
2621
|
keyId: "key-id-1",
|
|
2608
2622
|
userIdHash: "user-hash-placeholder",
|
|
2609
2623
|
projectId: this._config.projectId
|
|
@@ -2611,7 +2625,7 @@ const ne = class ne extends Yt {
|
|
|
2611
2625
|
const e = new j({
|
|
2612
2626
|
appId: this._config.projectId,
|
|
2613
2627
|
appVersion: "1.0.0",
|
|
2614
|
-
sdkVersion: "2.3.10-beta.
|
|
2628
|
+
sdkVersion: "2.3.10-beta.5",
|
|
2615
2629
|
keyId: "key-id-1",
|
|
2616
2630
|
userIdHash: "user-hash-placeholder",
|
|
2617
2631
|
projectId: this._config.projectId
|
|
@@ -2808,6 +2822,7 @@ const ne = class ne extends Yt {
|
|
|
2808
2822
|
* }
|
|
2809
2823
|
*/
|
|
2810
2824
|
async signInWithOAuthToken(e) {
|
|
2825
|
+
var t, s;
|
|
2811
2826
|
if (this.ensureInitialized(), this.authenticated)
|
|
2812
2827
|
throw new h(
|
|
2813
2828
|
d.ALREADY_AUTHENTICATED,
|
|
@@ -2815,22 +2830,22 @@ const ne = class ne extends Yt {
|
|
|
2815
2830
|
);
|
|
2816
2831
|
let r;
|
|
2817
2832
|
try {
|
|
2818
|
-
r = await this.signInUseCase.executeWithOAuthToken(e), r.success && (this._isAuthenticatedViaRNBridge = !1, this.applyAuthResult(r));
|
|
2819
|
-
} catch (
|
|
2820
|
-
throw
|
|
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으로 외부 인증이 도착했습니다"));
|
|
2834
|
+
} catch (o) {
|
|
2835
|
+
throw o instanceof h ? o : new h(d.AUTH_FAILED, "OAuth 토큰 로그인에 실패했습니다", o);
|
|
2821
2836
|
}
|
|
2822
2837
|
if (!r.success) return { ...r, addresses: [] };
|
|
2823
2838
|
try {
|
|
2824
2839
|
if (r.needsMigration || !r.address) {
|
|
2825
|
-
const { address:
|
|
2826
|
-
return { ...r, address: (
|
|
2840
|
+
const { address: a } = await this.createWallet(), l = await this.getAddresses(), p = await this.selectWalletIfMultiple(l);
|
|
2841
|
+
return { ...r, address: (p == null ? void 0 : p.address) ?? a, needsMigration: !1, addresses: l };
|
|
2827
2842
|
}
|
|
2828
|
-
const
|
|
2829
|
-
return { ...r, address: (
|
|
2830
|
-
} catch (
|
|
2831
|
-
throw
|
|
2832
|
-
(
|
|
2833
|
-
)),
|
|
2843
|
+
const o = await this.getAddresses(), n = await this.selectWalletIfMultiple(o);
|
|
2844
|
+
return { ...r, address: (n == null ? void 0 : n.address) ?? r.address, addresses: o };
|
|
2845
|
+
} catch (o) {
|
|
2846
|
+
throw o instanceof h && o.code === d.PIN_CANCELLED && (c.log("[CROSSx] signInWithOAuthToken: 비밀번호 설정 취소 — 자동 로그아웃 진행"), await this.signOut().catch(
|
|
2847
|
+
(n) => c.warn("[CROSSx] signInWithOAuthToken: 자동 로그아웃 실패", n)
|
|
2848
|
+
)), o;
|
|
2834
2849
|
}
|
|
2835
2850
|
}
|
|
2836
2851
|
/**
|
|
@@ -3560,27 +3575,27 @@ const ne = class ne extends Yt {
|
|
|
3560
3575
|
async sendTransactionWithWaitForReceipt(e, r, t = {}) {
|
|
3561
3576
|
var m, y;
|
|
3562
3577
|
if (this._isAuthenticatedViaRNBridge) {
|
|
3563
|
-
const
|
|
3564
|
-
if (
|
|
3565
|
-
return this.bridgeSendTransactionWithWaitForReceipt(
|
|
3578
|
+
const S = j.getBridge();
|
|
3579
|
+
if (S != null && S.sendTransactionWithWaitForReceipt)
|
|
3580
|
+
return this.bridgeSendTransactionWithWaitForReceipt(S, e, r, t);
|
|
3566
3581
|
}
|
|
3567
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) ?? Rt, p = o ?? ((y = this._config.receiptPolling) == null ? void 0 : y.timeoutMs) ?? je, _ = Ae(e), u = r.from ?? "";
|
|
3568
3583
|
let x, g;
|
|
3569
|
-
const f = this.waitForTxAndGetReceipt(a, e, { intervalMs: l, timeoutMs: p }).then((
|
|
3570
|
-
x =
|
|
3571
|
-
const
|
|
3584
|
+
const f = this.waitForTxAndGetReceipt(a, e, { intervalMs: l, timeoutMs: p }).then((S) => {
|
|
3585
|
+
x = S;
|
|
3586
|
+
const E = BigInt(S.gasUsed) * BigInt(S.effectiveGasPrice), A = r.value ? BigInt(r.value) : 0n, T = me(r.value, _.symbol, _.decimals, this._config.displayDecimals), k = me("0x" + E.toString(16), _.symbol, _.decimals, this._config.displayDecimals), O = me("0x" + (A + E).toString(16), _.symbol, _.decimals, this._config.displayDecimals);
|
|
3572
3587
|
return {
|
|
3573
3588
|
chainId: e,
|
|
3574
3589
|
txHash: a,
|
|
3575
|
-
from:
|
|
3576
|
-
to:
|
|
3577
|
-
amount:
|
|
3578
|
-
fees:
|
|
3590
|
+
from: S.from,
|
|
3591
|
+
to: S.to ?? r.to,
|
|
3592
|
+
amount: T,
|
|
3593
|
+
fees: k,
|
|
3579
3594
|
total: O,
|
|
3580
3595
|
nativeSymbol: _.symbol,
|
|
3581
|
-
status:
|
|
3596
|
+
status: S.status === "0x1" ? "success" : "reverted"
|
|
3582
3597
|
};
|
|
3583
|
-
}).catch((
|
|
3598
|
+
}).catch((S) => (g = S instanceof Error ? S : new Error(String(S)), {
|
|
3584
3599
|
chainId: e,
|
|
3585
3600
|
txHash: a,
|
|
3586
3601
|
from: u,
|
|
@@ -3938,9 +3953,15 @@ const ne = class ne extends Yt {
|
|
|
3938
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);
|
|
3939
3954
|
}), c.log("[CROSSx] bridge.onEvent walletChanged 구독 완료");
|
|
3940
3955
|
}
|
|
3941
|
-
/**
|
|
3942
|
-
|
|
3943
|
-
|
|
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);
|
|
3944
3965
|
}
|
|
3945
3966
|
/** 인증 상태를 초기화합니다. */
|
|
3946
3967
|
clearAuthState() {
|
|
@@ -4409,6 +4430,17 @@ const Ar = /* @__PURE__ */ new Set([
|
|
|
4409
4430
|
"https://dev-one-wallet-oauth.onechain.nexus"
|
|
4410
4431
|
]), Ir = /CROSSx\/[\d.]+/i, kr = "crossx://oauth-callback";
|
|
4411
4432
|
class ie {
|
|
4433
|
+
constructor() {
|
|
4434
|
+
this.abortPending = null;
|
|
4435
|
+
}
|
|
4436
|
+
/**
|
|
4437
|
+
* 외부 경로 인증이 들어와 대화형 OAuth 대기가 무의미해졌을 때 호출한다.
|
|
4438
|
+
* 대기 중인 openAuth를 reject시켜 상위 connect() 흐름을 즉시 종료시킨다.
|
|
4439
|
+
*/
|
|
4440
|
+
cancelPending(e = "외부 경로 인증으로 OAuth 대기를 중단했습니다") {
|
|
4441
|
+
const r = this.abortPending;
|
|
4442
|
+
r && (c.log("[CROSSx] OAuth 대기 중단 —", e), r(e));
|
|
4443
|
+
}
|
|
4412
4444
|
static generateRandom16Hex() {
|
|
4413
4445
|
const e = new Uint8Array(16);
|
|
4414
4446
|
return crypto.getRandomValues(e), Array.from(e, (r) => r.toString(16).padStart(2, "0")).join("");
|
|
@@ -4488,29 +4520,29 @@ class ie {
|
|
|
4488
4520
|
return;
|
|
4489
4521
|
}
|
|
4490
4522
|
const f = setTimeout(() => {
|
|
4491
|
-
c.warn("[CROSSx] OAuth 타임아웃 (5분) — postMessage를 수신하지 못했습니다"),
|
|
4523
|
+
c.warn("[CROSSx] OAuth 타임아웃 (5분) — postMessage를 수신하지 못했습니다"), k(), t(new Error("Authentication timeout"));
|
|
4492
4524
|
}, 5 * 60 * 1e3), m = 10, y = 30;
|
|
4493
|
-
let
|
|
4525
|
+
let S = 0, E = null;
|
|
4494
4526
|
const A = () => {
|
|
4495
|
-
clearInterval(
|
|
4496
|
-
|
|
4527
|
+
clearInterval(T), c.warn("[CROSSx] COOP 감지 — OAuth 서버 응답을 " + y + "초간 대기합니다"), E = setTimeout(() => {
|
|
4528
|
+
k(), t(new Error(
|
|
4497
4529
|
"OAuth 서버로부터 응답을 받지 못했습니다. 브라우저 보안 정책(COOP)으로 인해 팝업 통신이 차단되었을 수 있습니다. 다시 시도해 주세요."
|
|
4498
4530
|
));
|
|
4499
4531
|
}, y * 1e3);
|
|
4500
|
-
},
|
|
4501
|
-
|
|
4532
|
+
}, T = setInterval(() => {
|
|
4533
|
+
S++;
|
|
4502
4534
|
try {
|
|
4503
4535
|
if (!g.closed) return;
|
|
4504
4536
|
const M = typeof document < "u" && document.hasFocus();
|
|
4505
|
-
|
|
4537
|
+
S <= m && !M ? A() : (k(), t(new Error("로그인이 취소되었습니다")));
|
|
4506
4538
|
} catch {
|
|
4507
4539
|
A();
|
|
4508
4540
|
}
|
|
4509
|
-
}, 1e3),
|
|
4510
|
-
clearTimeout(f), clearInterval(
|
|
4541
|
+
}, 1e3), k = () => {
|
|
4542
|
+
this.abortPending = null, clearTimeout(f), clearInterval(T), E && clearTimeout(E), window.removeEventListener("message", O);
|
|
4511
4543
|
}, O = (M) => {
|
|
4512
4544
|
if (!Ar.has(M.origin)) return;
|
|
4513
|
-
|
|
4545
|
+
k();
|
|
4514
4546
|
const G = typeof M.data.status == "string", P = G ? M.data.data ?? {} : M.data;
|
|
4515
4547
|
c.log("[CROSSx] OAuth postMessage 수신 —", {
|
|
4516
4548
|
format: G ? "wrapped" : "flat",
|
|
@@ -4548,7 +4580,9 @@ class ie {
|
|
|
4548
4580
|
"서버 측 nonce 검증이 필요합니다."
|
|
4549
4581
|
), r(pe)) : C ? _e(C) : t(new Error("Token not found in response"));
|
|
4550
4582
|
};
|
|
4551
|
-
|
|
4583
|
+
this.abortPending = (M) => {
|
|
4584
|
+
k(), t(new Error(M));
|
|
4585
|
+
}, window.addEventListener("message", O);
|
|
4552
4586
|
});
|
|
4553
4587
|
}
|
|
4554
4588
|
}
|
|
@@ -4786,9 +4820,9 @@ class oe {
|
|
|
4786
4820
|
d.USER_NOT_FOUND,
|
|
4787
4821
|
oe.getGatewayErrorMessage(g.code, f)
|
|
4788
4822
|
);
|
|
4789
|
-
const y = m === d.AUTH_NOT_AUTHENTICATED ? d.SESSION_EXPIRED : m,
|
|
4823
|
+
const y = m === d.AUTH_NOT_AUTHENTICATED ? d.SESSION_EXPIRED : m, S = y === d.SESSION_EXPIRED ? "인증 세션이 만료되었습니다. 다시 로그인해 주세요." : oe.getGatewayErrorMessage(g.code, f), E = g.data;
|
|
4790
4824
|
let A;
|
|
4791
|
-
throw m === d.PIN_LOCKED ? A = oe.extractLockDetails(
|
|
4825
|
+
throw m === d.PIN_LOCKED ? A = oe.extractLockDetails(E) : m === d.ADDRESS_LIMIT_EXCEEDED ? A = { limit: Ne, raw: E } : A = E ?? void 0, new h(y, S, A);
|
|
4792
4826
|
}
|
|
4793
4827
|
return c.log("[CROSSx] Wallet Gateway API 성공:", { code: g.code, url: n, method: e }), g.data ?? g;
|
|
4794
4828
|
}
|
|
@@ -8623,10 +8657,10 @@ function is(i, e, r, t) {
|
|
|
8623
8657
|
<button class="__crossx-approve-btn" id="__crossx-done-btn">${w((t == null ? void 0 : t.tx_complete_done_button) ?? (s ? "All Done" : "Done"))}</button>
|
|
8624
8658
|
`, l.querySelectorAll(".__crossx-copy-btn").forEach((m) => {
|
|
8625
8659
|
m.addEventListener("click", (y) => {
|
|
8626
|
-
var
|
|
8660
|
+
var E;
|
|
8627
8661
|
y.stopPropagation();
|
|
8628
|
-
const
|
|
8629
|
-
|
|
8662
|
+
const S = m.dataset.copy;
|
|
8663
|
+
S && ((E = navigator.clipboard) == null || E.writeText(S).catch(() => {
|
|
8630
8664
|
}));
|
|
8631
8665
|
});
|
|
8632
8666
|
});
|
|
@@ -9112,20 +9146,20 @@ function Pe(i, e, r, t, s, o, n) {
|
|
|
9112
9146
|
let a = !!(o && o > Date.now()), l = !1;
|
|
9113
9147
|
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) => {
|
|
9114
9148
|
b.dataset.digit = v, b.value = m;
|
|
9115
|
-
},
|
|
9149
|
+
}, S = (b) => {
|
|
9116
9150
|
delete b.dataset.digit, b.value = "";
|
|
9117
|
-
},
|
|
9151
|
+
}, E = (b) => b.dataset.digit ?? "", A = () => p().map(E).join(""), T = () => Array.from(i.querySelectorAll(".__crossx-pin6-dot")), k = () => {
|
|
9118
9152
|
var I;
|
|
9119
|
-
const b = p(), v =
|
|
9153
|
+
const b = p(), v = T();
|
|
9120
9154
|
if (v.length && (v.forEach((R, N) => {
|
|
9121
|
-
const $ = !!(b[N] &&
|
|
9155
|
+
const $ = !!(b[N] && E(b[N]));
|
|
9122
9156
|
R.classList.toggle("--filled", $), R.classList.toggle("--active", !1);
|
|
9123
9157
|
}), !a && !l)) {
|
|
9124
|
-
const R = b.findIndex(($) => !
|
|
9158
|
+
const R = b.findIndex(($) => !E($));
|
|
9125
9159
|
(I = v[R === -1 ? 5 : R]) == null || I.classList.add("--active");
|
|
9126
9160
|
}
|
|
9127
9161
|
}, O = () => {
|
|
9128
|
-
i.querySelectorAll(".__crossx-pin6-numpad-key[data-key]").forEach((v) => v.classList.toggle("--disabled", a)),
|
|
9162
|
+
i.querySelectorAll(".__crossx-pin6-numpad-key[data-key]").forEach((v) => v.classList.toggle("--disabled", a)), T().forEach((v) => v.classList.toggle("--locked", a)), k();
|
|
9129
9163
|
}, M = (b) => {
|
|
9130
9164
|
a = b, p().forEach((v) => {
|
|
9131
9165
|
v.disabled = b, v.classList.toggle("--locked", b);
|
|
@@ -9161,13 +9195,13 @@ function Pe(i, e, r, t, s, o, n) {
|
|
|
9161
9195
|
const v = u();
|
|
9162
9196
|
v && (v.textContent = b);
|
|
9163
9197
|
const I = _();
|
|
9164
|
-
I == null || I.classList.add("--shake"), setTimeout(() => I == null ? void 0 : I.classList.remove("--shake"), 500), p().forEach(
|
|
9198
|
+
I == null || I.classList.add("--shake"), setTimeout(() => I == null ? void 0 : I.classList.remove("--shake"), 500), p().forEach(S), setTimeout(() => {
|
|
9165
9199
|
var R;
|
|
9166
|
-
(R = p()[0]) == null || R.focus(),
|
|
9200
|
+
(R = p()[0]) == null || R.focus(), k();
|
|
9167
9201
|
}, 50);
|
|
9168
9202
|
}, he = (b) => {
|
|
9169
9203
|
var $;
|
|
9170
|
-
M(!0), p().forEach(
|
|
9204
|
+
M(!0), p().forEach(S), O();
|
|
9171
9205
|
const v = u();
|
|
9172
9206
|
if (v && (v.textContent = "Too many failed attempts. Please wait."), !x()) {
|
|
9173
9207
|
const B = document.createElement("p");
|
|
@@ -9206,7 +9240,7 @@ function Pe(i, e, r, t, s, o, n) {
|
|
|
9206
9240
|
} finally {
|
|
9207
9241
|
l = !1, a || p().forEach((v) => {
|
|
9208
9242
|
v.disabled = !1;
|
|
9209
|
-
}),
|
|
9243
|
+
}), k();
|
|
9210
9244
|
}
|
|
9211
9245
|
}
|
|
9212
9246
|
};
|
|
@@ -9216,7 +9250,7 @@ function Pe(i, e, r, t, s, o, n) {
|
|
|
9216
9250
|
}, 100);
|
|
9217
9251
|
const Ke = () => {
|
|
9218
9252
|
if (a || l) return;
|
|
9219
|
-
const b = p(), v = b.find((I) => !
|
|
9253
|
+
const b = p(), v = b.find((I) => !E(I)) ?? b[b.length - 1];
|
|
9220
9254
|
v == null || v.focus();
|
|
9221
9255
|
};
|
|
9222
9256
|
(ze = _()) == null || ze.addEventListener("click", (b) => {
|
|
@@ -9228,17 +9262,17 @@ function Pe(i, e, r, t, s, o, n) {
|
|
|
9228
9262
|
b.addEventListener("input", () => {
|
|
9229
9263
|
var R;
|
|
9230
9264
|
const I = b.value.replace(/\D/g, "").slice(-1);
|
|
9231
|
-
I ? y(b, I) :
|
|
9265
|
+
I ? y(b, I) : S(b), P(), I && v < 5 && ((R = p()[v + 1]) == null || R.focus()), k(), A().length === 6 && setTimeout(te, 80);
|
|
9232
9266
|
}), b.addEventListener("keydown", (I) => {
|
|
9233
9267
|
var R, N;
|
|
9234
9268
|
if (I.key === "Backspace") {
|
|
9235
|
-
if (I.preventDefault(),
|
|
9236
|
-
|
|
9269
|
+
if (I.preventDefault(), E(b))
|
|
9270
|
+
S(b);
|
|
9237
9271
|
else if (v > 0) {
|
|
9238
9272
|
const $ = p()[v - 1];
|
|
9239
|
-
|
|
9273
|
+
S($), $.focus();
|
|
9240
9274
|
}
|
|
9241
|
-
|
|
9275
|
+
k();
|
|
9242
9276
|
} 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();
|
|
9243
9277
|
}), b.addEventListener("paste", (I) => {
|
|
9244
9278
|
var $, B;
|
|
@@ -9248,7 +9282,7 @@ function Pe(i, e, r, t, s, o, n) {
|
|
|
9248
9282
|
const N = p();
|
|
9249
9283
|
R.split("").forEach((V, Q) => {
|
|
9250
9284
|
N[Q] && y(N[Q], V);
|
|
9251
|
-
}), (B = N[Math.min(R.length - 1, 5)]) == null || B.focus(), P(),
|
|
9285
|
+
}), (B = N[Math.min(R.length - 1, 5)]) == null || B.focus(), P(), k(), A().length === 6 && setTimeout(te, 80);
|
|
9252
9286
|
}), b.addEventListener("focus", () => b.select());
|
|
9253
9287
|
});
|
|
9254
9288
|
const ue = i.querySelector("#__crossx-pin6-numpad");
|
|
@@ -9265,13 +9299,13 @@ function Pe(i, e, r, t, s, o, n) {
|
|
|
9265
9299
|
const N = R.dataset.key;
|
|
9266
9300
|
if (!N) return;
|
|
9267
9301
|
if (N === "backspace") {
|
|
9268
|
-
const Q = [...p()].reverse().find((we) =>
|
|
9269
|
-
Q && (
|
|
9302
|
+
const Q = [...p()].reverse().find((we) => E(we));
|
|
9303
|
+
Q && (S(Q), P()), k();
|
|
9270
9304
|
return;
|
|
9271
9305
|
}
|
|
9272
9306
|
if (!/^\d$/.test(N)) return;
|
|
9273
|
-
const B = p().find((V) => !
|
|
9274
|
-
B && (y(B, N), P(),
|
|
9307
|
+
const B = p().find((V) => !E(V));
|
|
9308
|
+
B && (y(B, N), P(), k(), A().length === 6 && setTimeout(te, 80));
|
|
9275
9309
|
};
|
|
9276
9310
|
ue.addEventListener("pointerup", (R) => {
|
|
9277
9311
|
if (!b) return;
|
|
@@ -9279,7 +9313,7 @@ function Pe(i, e, r, t, s, o, n) {
|
|
|
9279
9313
|
v();
|
|
9280
9314
|
const $ = N.getBoundingClientRect();
|
|
9281
9315
|
R.clientX >= $.left && R.clientX <= $.right && R.clientY >= $.top && R.clientY <= $.bottom && !a && !l && I(N);
|
|
9282
|
-
}), ue.addEventListener("pointercancel", v), ue.addEventListener("pointerleave", v, !0),
|
|
9316
|
+
}), ue.addEventListener("pointercancel", v), ue.addEventListener("pointerleave", v, !0), k(), o && o > Date.now() && O();
|
|
9283
9317
|
}
|
|
9284
9318
|
}
|
|
9285
9319
|
const ks = `<svg width="22" height="17" viewBox="0 0 22 17" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -9369,7 +9403,7 @@ class Ps {
|
|
|
9369
9403
|
*/
|
|
9370
9404
|
showWalletSelector(e, r, t) {
|
|
9371
9405
|
return new Promise((s, o) => {
|
|
9372
|
-
var
|
|
9406
|
+
var E;
|
|
9373
9407
|
K();
|
|
9374
9408
|
const n = [...e], a = _s(n, this.tokens, t, this.messages), l = se();
|
|
9375
9409
|
z(a);
|
|
@@ -9386,8 +9420,8 @@ class Ps {
|
|
|
9386
9420
|
(() => {
|
|
9387
9421
|
a.querySelectorAll(".__crossx-wallet-item").forEach((A) => {
|
|
9388
9422
|
A.addEventListener("click", () => {
|
|
9389
|
-
const
|
|
9390
|
-
x({ address:
|
|
9423
|
+
const T = A.dataset.walletAddress ?? "", k = parseInt(A.dataset.walletIndex ?? "0", 10), O = n.find((M) => M.index === k);
|
|
9424
|
+
x({ address: T, index: k, name: O == null ? void 0 : O.name });
|
|
9391
9425
|
});
|
|
9392
9426
|
});
|
|
9393
9427
|
})();
|
|
@@ -9397,27 +9431,27 @@ class Ps {
|
|
|
9397
9431
|
try {
|
|
9398
9432
|
const A = await r();
|
|
9399
9433
|
n.push(A);
|
|
9400
|
-
const
|
|
9401
|
-
if (
|
|
9402
|
-
const
|
|
9403
|
-
|
|
9434
|
+
const T = a.querySelector("#__crossx-wallet-list");
|
|
9435
|
+
if (T) {
|
|
9436
|
+
const k = document.createElement("button");
|
|
9437
|
+
k.className = "__crossx-wallet-item", k.dataset.walletIndex = String(A.index), k.dataset.walletAddress = A.address, k.innerHTML = `${vt(A.address, A.index, this.tokens.bg)}<span class="__crossx-wallet-info"><span class="__crossx-wallet-idx">${w(bt(A))}</span><span class="__crossx-wallet-addr">${ht(A.address)}</span></span>`, k.addEventListener("click", () => x(A)), T.appendChild(k);
|
|
9404
9438
|
try {
|
|
9405
|
-
|
|
9439
|
+
k.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
9406
9440
|
} catch {
|
|
9407
9441
|
}
|
|
9408
9442
|
}
|
|
9409
9443
|
y.disabled = !1;
|
|
9410
9444
|
} catch (A) {
|
|
9411
|
-
const
|
|
9412
|
-
m && (m.textContent =
|
|
9445
|
+
const T = A instanceof h && A.code === d.ADDRESS_LIMIT_EXCEEDED, k = this.resolveAddWalletErrorMessage(A);
|
|
9446
|
+
m && (m.textContent = k, m.hidden = !1), T ? (y.disabled = !0, y.setAttribute("aria-disabled", "true")) : y.disabled = !1, u = A;
|
|
9413
9447
|
}
|
|
9414
|
-
}), (
|
|
9448
|
+
}), (E = a.querySelector("#__crossx-close-btn")) == null || E.addEventListener("click", g), a.addEventListener("click", (A) => {
|
|
9415
9449
|
A.target === a && g();
|
|
9416
9450
|
});
|
|
9417
|
-
const
|
|
9418
|
-
A.key === "Escape" && (document.removeEventListener("keydown",
|
|
9451
|
+
const S = (A) => {
|
|
9452
|
+
A.key === "Escape" && (document.removeEventListener("keydown", S), g());
|
|
9419
9453
|
};
|
|
9420
|
-
document.addEventListener("keydown",
|
|
9454
|
+
document.addEventListener("keydown", S);
|
|
9421
9455
|
});
|
|
9422
9456
|
}
|
|
9423
9457
|
showWalletCreatedPrompt() {
|
|
@@ -9477,12 +9511,12 @@ class Ps {
|
|
|
9477
9511
|
a(), s(null);
|
|
9478
9512
|
};
|
|
9479
9513
|
(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) => {
|
|
9480
|
-
const
|
|
9481
|
-
|
|
9514
|
+
const E = y.currentTarget.dataset.walletId ?? "";
|
|
9515
|
+
E && p(E);
|
|
9482
9516
|
}), (m = o.querySelector("#__crossx-close-btn")) == null || m.addEventListener("click", _), o.addEventListener("click", (y) => {
|
|
9483
9517
|
y.target === o && _();
|
|
9484
9518
|
}), o.querySelectorAll(".__crossx-login-terms-link").forEach((y) => {
|
|
9485
|
-
y.addEventListener("click", (
|
|
9519
|
+
y.addEventListener("click", (S) => S.stopPropagation());
|
|
9486
9520
|
});
|
|
9487
9521
|
const u = (y) => {
|
|
9488
9522
|
y.key === "Escape" && (document.removeEventListener("keydown", u), _());
|
|
@@ -9576,8 +9610,8 @@ class Ps {
|
|
|
9576
9610
|
let p = !1;
|
|
9577
9611
|
const _ = () => {
|
|
9578
9612
|
p || (p = !0, a.remove(), l());
|
|
9579
|
-
}, u = (
|
|
9580
|
-
_(), r(
|
|
9613
|
+
}, u = (E) => {
|
|
9614
|
+
_(), r(E);
|
|
9581
9615
|
}, x = () => {
|
|
9582
9616
|
_(), r(null);
|
|
9583
9617
|
}, g = a.querySelector(".__crossx-card"), f = {
|
|
@@ -9586,58 +9620,58 @@ class Ps {
|
|
|
9586
9620
|
repeatingDigit: (t == null ? void 0 : t.pin_validation_repeating_digit) ?? "Cannot use the same number 3+ times in a row.",
|
|
9587
9621
|
sequential: (t == null ? void 0 : t.pin_validation_sequential) ?? "Sequential numbers (e.g., 123456) are not allowed.",
|
|
9588
9622
|
alternatingPattern: (t == null ? void 0 : t.pin_validation_alternating_pattern) ?? "Repeating patterns (e.g., 121212) are not allowed."
|
|
9589
|
-
}, m = (
|
|
9623
|
+
}, m = (E) => {
|
|
9590
9624
|
var A;
|
|
9591
9625
|
g.innerHTML = Ce({
|
|
9592
9626
|
title: n.title,
|
|
9593
9627
|
headerSubtitle: n.headerSubtitle,
|
|
9594
9628
|
subtitle: n.subtitle
|
|
9595
|
-
}), this.applyPinKeyboardMode(g), (A = g.querySelector("#__crossx-close-btn")) == null || A.addEventListener("click", x), Pe(g, (
|
|
9596
|
-
|
|
9629
|
+
}), this.applyPinKeyboardMode(g), (A = g.querySelector("#__crossx-close-btn")) == null || A.addEventListener("click", x), Pe(g, (T) => {
|
|
9630
|
+
T === E ? u(E) : y(o.mismatchError);
|
|
9597
9631
|
}, x);
|
|
9598
|
-
}, y = (
|
|
9632
|
+
}, y = (E) => {
|
|
9599
9633
|
var A;
|
|
9600
9634
|
g.innerHTML = Ce({
|
|
9601
9635
|
title: o.title,
|
|
9602
9636
|
headerSubtitle: o.headerSubtitle,
|
|
9603
9637
|
subtitle: o.subtitle,
|
|
9604
|
-
errorMessage:
|
|
9605
|
-
}), this.applyPinKeyboardMode(g), (A = g.querySelector("#__crossx-close-btn")) == null || A.addEventListener("click", x), Pe(g, (
|
|
9606
|
-
const
|
|
9607
|
-
|
|
9638
|
+
errorMessage: E
|
|
9639
|
+
}), this.applyPinKeyboardMode(g), (A = g.querySelector("#__crossx-close-btn")) == null || A.addEventListener("click", x), Pe(g, (T) => {
|
|
9640
|
+
const k = As(T, f);
|
|
9641
|
+
k ? y(k) : m(T);
|
|
9608
9642
|
}, x);
|
|
9609
9643
|
};
|
|
9610
9644
|
(() => {
|
|
9611
9645
|
var ee;
|
|
9612
|
-
const
|
|
9646
|
+
const E = Array.from(g.querySelectorAll(".__crossx-pw-notice-item")), A = g.querySelector("#__crossx-pin-notice-next"), T = /* @__PURE__ */ new Set();
|
|
9613
9647
|
A.removeAttribute("disabled");
|
|
9614
|
-
const
|
|
9615
|
-
const C =
|
|
9616
|
-
A.classList.toggle("--disabled", !C), A.textContent = O ||
|
|
9648
|
+
const k = A.dataset.nextLabel ?? "Next", O = A.dataset.submitLabel ?? "I Understand", M = () => {
|
|
9649
|
+
const C = T.size === E.length;
|
|
9650
|
+
A.classList.toggle("--disabled", !C), A.textContent = O || k;
|
|
9617
9651
|
}, G = (C, L) => {
|
|
9618
|
-
if (
|
|
9652
|
+
if (T.has(L)) return;
|
|
9619
9653
|
const U = C.querySelector(`#__crossx-notice-check-${L}`);
|
|
9620
|
-
|
|
9654
|
+
T.add(L), U.classList.add("--checked"), C.setAttribute("aria-checked", "true"), M();
|
|
9621
9655
|
}, P = (C, L) => {
|
|
9622
|
-
if (!
|
|
9656
|
+
if (!T.has(L)) return;
|
|
9623
9657
|
const U = C.querySelector(`#__crossx-notice-check-${L}`);
|
|
9624
|
-
|
|
9658
|
+
T.delete(L), U.classList.remove("--checked"), C.setAttribute("aria-checked", "false"), M();
|
|
9625
9659
|
};
|
|
9626
|
-
|
|
9660
|
+
E.forEach((C) => {
|
|
9627
9661
|
const L = parseInt(C.dataset.checkIndex ?? "0", 10);
|
|
9628
9662
|
C.addEventListener("click", () => {
|
|
9629
|
-
|
|
9663
|
+
T.has(L) ? P(C, L) : G(C, L);
|
|
9630
9664
|
}), C.addEventListener("keydown", (U) => {
|
|
9631
|
-
(U.key === " " || U.key === "Enter") && (U.preventDefault(),
|
|
9665
|
+
(U.key === " " || U.key === "Enter") && (U.preventDefault(), T.has(L) ? P(C, L) : G(C, L));
|
|
9632
9666
|
});
|
|
9633
9667
|
}), A.addEventListener("click", () => {
|
|
9634
|
-
if (
|
|
9668
|
+
if (T.size === E.length) {
|
|
9635
9669
|
y(e == null ? void 0 : e.errorMessage);
|
|
9636
9670
|
return;
|
|
9637
9671
|
}
|
|
9638
|
-
const C =
|
|
9672
|
+
const C = E.find((U) => {
|
|
9639
9673
|
const ae = parseInt(U.dataset.checkIndex ?? "0", 10);
|
|
9640
|
-
return !
|
|
9674
|
+
return !T.has(ae);
|
|
9641
9675
|
});
|
|
9642
9676
|
if (!C) return;
|
|
9643
9677
|
const L = parseInt(C.dataset.checkIndex ?? "0", 10);
|
|
@@ -9645,8 +9679,8 @@ class Ps {
|
|
|
9645
9679
|
C.classList.remove("--highlight"), G(C, L);
|
|
9646
9680
|
}, 400);
|
|
9647
9681
|
}), (ee = g.querySelector("#__crossx-close-btn")) == null || ee.addEventListener("click", x);
|
|
9648
|
-
})(), a.addEventListener("click", (
|
|
9649
|
-
|
|
9682
|
+
})(), a.addEventListener("click", (E) => {
|
|
9683
|
+
E.target === a && x();
|
|
9650
9684
|
});
|
|
9651
9685
|
});
|
|
9652
9686
|
}
|
|
@@ -9657,7 +9691,7 @@ class Ps {
|
|
|
9657
9691
|
*/
|
|
9658
9692
|
showPinInputPrompt(e) {
|
|
9659
9693
|
return new Promise((r, t) => {
|
|
9660
|
-
var
|
|
9694
|
+
var S;
|
|
9661
9695
|
K();
|
|
9662
9696
|
const s = this.messages, o = (e == null ? void 0 : e.verifyMode) === !0, n = o ? (s == null ? void 0 : s.verify_pin_title) ?? "Verify Your PIN" : (s == null ? void 0 : s.pin_input_title) ?? "Enter PIN", a = o ? (s == null ? void 0 : s.verify_pin_subtitle) ?? "Enter your PIN to authorize this transaction." : (s == null ? void 0 : s.pin_input_subtitle) ?? "Enter your 6-digit PIN to continue.", l = (s == null ? void 0 : s.pin_locked_failure_warning) ?? "Your account will be locked after further failures.", p = lt(
|
|
9663
9697
|
this.tokens,
|
|
@@ -9675,15 +9709,15 @@ class Ps {
|
|
|
9675
9709
|
let u = !1;
|
|
9676
9710
|
const x = () => {
|
|
9677
9711
|
u || (u = !0, p.remove(), _());
|
|
9678
|
-
}, g = (
|
|
9679
|
-
x(), r(
|
|
9712
|
+
}, g = (E) => {
|
|
9713
|
+
x(), r(E);
|
|
9680
9714
|
}, f = () => {
|
|
9681
9715
|
x(), r(null);
|
|
9682
|
-
}, m = (
|
|
9683
|
-
x(), t(
|
|
9716
|
+
}, m = (E) => {
|
|
9717
|
+
x(), t(E);
|
|
9684
9718
|
}, y = p.querySelector(".__crossx-card");
|
|
9685
|
-
this.applyPinKeyboardMode(y), (
|
|
9686
|
-
|
|
9719
|
+
this.applyPinKeyboardMode(y), (S = y.querySelector("#__crossx-close-btn")) == null || S.addEventListener("click", f), Pe(y, g, f, m, e == null ? void 0 : e.onSubmit, e == null ? void 0 : e.lockExpiresAt, l), p.addEventListener("click", (E) => {
|
|
9720
|
+
E.target === p && f();
|
|
9687
9721
|
});
|
|
9688
9722
|
});
|
|
9689
9723
|
}
|
|
@@ -10074,20 +10108,20 @@ Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
|
|
|
10074
10108
|
m,
|
|
10075
10109
|
() => i.appName
|
|
10076
10110
|
);
|
|
10077
|
-
const y = new fe(s, l),
|
|
10111
|
+
const y = new fe(s, l), S = new Ps(
|
|
10078
10112
|
i.theme ?? "light",
|
|
10079
10113
|
i.themeTokens,
|
|
10080
10114
|
i.displayDecimals,
|
|
10081
10115
|
i.pinKeyboard
|
|
10082
|
-
),
|
|
10083
|
-
|
|
10116
|
+
), E = new Ns(
|
|
10117
|
+
S,
|
|
10084
10118
|
() => {
|
|
10085
10119
|
var O;
|
|
10086
10120
|
return (O = g == null ? void 0 : g.getRNBridge) == null ? void 0 : O.call(g);
|
|
10087
10121
|
},
|
|
10088
10122
|
() => typeof window < "u" ? window.location.origin : "http://localhost",
|
|
10089
10123
|
f
|
|
10090
|
-
), A = e != null && e.wrapConfirmation ? e.wrapConfirmation(
|
|
10124
|
+
), A = e != null && e.wrapConfirmation ? e.wrapConfirmation(E) : E, T = new Le(
|
|
10091
10125
|
t,
|
|
10092
10126
|
s,
|
|
10093
10127
|
n,
|
|
@@ -10100,9 +10134,9 @@ Example: createCROSSxSDK({ projectId: "your-project-id", ... })`
|
|
|
10100
10134
|
y,
|
|
10101
10135
|
u
|
|
10102
10136
|
);
|
|
10103
|
-
g =
|
|
10104
|
-
const
|
|
10105
|
-
return
|
|
10137
|
+
g = T;
|
|
10138
|
+
const k = T.signInUseCase;
|
|
10139
|
+
return k && typeof k.setFreshTokenCallback == "function" && k.setFreshTokenCallback(() => T.requestFreshFirebaseIdTokenFromBridge()), typeof window < "u" && (window.__crossxSDK = T), T;
|
|
10106
10140
|
}
|
|
10107
10141
|
function Ks(i) {
|
|
10108
10142
|
const e = Ls(i), r = Ds(e), t = JSON.parse(r);
|