@nexus-cross/crossx-sdk-core 1.2.0 → 1.2.3
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/confirmation/BrowserConfirmationAdapter.d.ts.map +1 -1
- package/dist/adapters/wallet/types.d.ts +1 -1
- package/dist/adapters/wallet/types.d.ts.map +1 -1
- package/dist/core/types/index.d.ts +13 -4
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/crossx.global +130 -53
- package/dist/index.cjs +121 -44
- package/dist/index.js +288 -210
- package/dist/sdk/CROSSxSDK.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -327,7 +327,7 @@ const u = {
|
|
|
327
327
|
function St(r = "en", e) {
|
|
328
328
|
return Us[r] ?? Zt;
|
|
329
329
|
}
|
|
330
|
-
const $e = "crossx_access_token",
|
|
330
|
+
const $e = "crossx_access_token", Ne = "crossx_refresh_token", Re = "crossx_user_info";
|
|
331
331
|
class Hs {
|
|
332
332
|
constructor(e, s, t, n, o, i, a) {
|
|
333
333
|
this.config = e, this.storage = s, this.crypto = t, this.oauth = n, this.transport = o, this.walletProvider = i, this.tokenStore = a, this._refreshPromise = null;
|
|
@@ -392,7 +392,7 @@ class Hs {
|
|
|
392
392
|
email: P.email,
|
|
393
393
|
signInProvider: S,
|
|
394
394
|
providerSub: y
|
|
395
|
-
}, this.tokenStore.set(w), this.useCookieAuth || (await this.storage.set($e, w), E && await this.storage.set(
|
|
395
|
+
}, this.tokenStore.set(w), this.useCookieAuth || (await this.storage.set($e, w), E && await this.storage.set(Ne, E));
|
|
396
396
|
} else {
|
|
397
397
|
const B = this.crypto.decodeJWT(x);
|
|
398
398
|
s = {
|
|
@@ -404,7 +404,7 @@ class Hs {
|
|
|
404
404
|
}
|
|
405
405
|
u.log("[CROSSx] 사용자 정보 — id:", s.id);
|
|
406
406
|
const O = this.useCookieAuth ? { id: s.id, signInProvider: s.signInProvider, providerSub: s.providerSub } : s;
|
|
407
|
-
await this.storage.set(
|
|
407
|
+
await this.storage.set(Re, O), u.log("[CROSSx] 사용자 정보 저장 완료 (authMode:", this.useCookieAuth ? "cookie" : "token", ")");
|
|
408
408
|
} catch (c) {
|
|
409
409
|
return u.error("[CROSSx] SignIn 에러 (OAuth/토큰 교환 단계):", c), {
|
|
410
410
|
success: !1,
|
|
@@ -499,7 +499,7 @@ class Hs {
|
|
|
499
499
|
if (e) {
|
|
500
500
|
const t = await this.crypto.verifyJWT(e);
|
|
501
501
|
if (t.valid) {
|
|
502
|
-
const n = await this.storage.get(
|
|
502
|
+
const n = await this.storage.get(Re);
|
|
503
503
|
if (n)
|
|
504
504
|
return u.log("[CROSSx] restoreSession — 메모리 토큰 유효, 세션 복원"), this.loadWallet(n, t.signatureVerified);
|
|
505
505
|
}
|
|
@@ -510,7 +510,7 @@ class Hs {
|
|
|
510
510
|
const t = await this.silentRefresh();
|
|
511
511
|
t && this.tokenStore.set(t);
|
|
512
512
|
} else {
|
|
513
|
-
const t = await this.storage.get($e), n = await this.storage.get(
|
|
513
|
+
const t = await this.storage.get($e), n = await this.storage.get(Ne);
|
|
514
514
|
if (u.log(
|
|
515
515
|
"[CROSSx] restoreSession — access_token:",
|
|
516
516
|
t ? "있음" : "없음",
|
|
@@ -522,7 +522,7 @@ class Hs {
|
|
|
522
522
|
const o = await this.silentRefresh(n);
|
|
523
523
|
u.log("[CROSSx] restoreSession — silentRefresh 결과:", o ? "토큰 발급 성공" : "토큰 없음"), o && this.tokenStore.set(o);
|
|
524
524
|
}
|
|
525
|
-
const s = await this.storage.get(
|
|
525
|
+
const s = await this.storage.get(Re);
|
|
526
526
|
if (u.log("[CROSSx] restoreSession — userInfo 조회:", s ? `있음 (id: ${s.id})` : "없음"), !s)
|
|
527
527
|
return null;
|
|
528
528
|
u.log("[CROSSx] restoreSession — silentRefresh 성공, 세션 복원 — userId:", s.id);
|
|
@@ -532,7 +532,7 @@ class Hs {
|
|
|
532
532
|
return u.warn("[CROSSx] restoreSession — 지갑 로드 실패 (세션은 유지):", t), { success: !0, user: s, tokenSignatureVerified: !1 };
|
|
533
533
|
}
|
|
534
534
|
} catch (e) {
|
|
535
|
-
return u.log("[CROSSx] restoreSession — 세션 복원 실패, 스토리지 정리:", e), this.tokenStore.clear(), this.useCookieAuth || await this.storage.remove(
|
|
535
|
+
return u.log("[CROSSx] restoreSession — 세션 복원 실패, 스토리지 정리:", e), this.tokenStore.clear(), this.useCookieAuth || await this.storage.remove(Ne), await this.storage.remove(Re), null;
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
538
|
/**
|
|
@@ -571,7 +571,7 @@ class Hs {
|
|
|
571
571
|
if (this.tokenStore.set(c), !t) {
|
|
572
572
|
await this.storage.set($e, c);
|
|
573
573
|
const l = this.extractRefreshToken(a);
|
|
574
|
-
l && await this.storage.set(
|
|
574
|
+
l && await this.storage.set(Ne, l);
|
|
575
575
|
}
|
|
576
576
|
return u.log("[CROSSx] silentRefresh 성공"), c;
|
|
577
577
|
}
|
|
@@ -603,7 +603,7 @@ class Hs {
|
|
|
603
603
|
u.log("[CROSSx] signInWithJWT — sub:", i.sub, "signatureVerified:", n), t = {
|
|
604
604
|
id: i.sub,
|
|
605
605
|
email: i.email
|
|
606
|
-
}, this.tokenStore.set(e), this.useCookieAuth || (await this.storage.set($e, e), s && await this.storage.set(
|
|
606
|
+
}, this.tokenStore.set(e), this.useCookieAuth || (await this.storage.set($e, e), s && await this.storage.set(Ne, s)), await this.storage.set(Re, t), u.log("[CROSSx] signInWithJWT — 토큰 및 사용자 정보 저장 완료");
|
|
607
607
|
} catch (o) {
|
|
608
608
|
return u.error("[CROSSx] signInWithJWT 에러:", o), {
|
|
609
609
|
success: !1,
|
|
@@ -836,7 +836,7 @@ const Js = 2e3, It = 6e4, Zs = 1e3, Xs = 1e4, Qs = "0x77359400", Et = "0x3B9ACA0
|
|
|
836
836
|
}), this._initPromise);
|
|
837
837
|
}
|
|
838
838
|
async _doInitialize(e) {
|
|
839
|
-
console.log("[CROSSx SDK] v1.2.
|
|
839
|
+
console.log("[CROSSx SDK] v1.2.3 초기화 중..."), this.confirmation.setMessages(St(this._config.locale));
|
|
840
840
|
try {
|
|
841
841
|
const s = Ys();
|
|
842
842
|
this.internalConfig.oauthServiceUrl = s.oauthServiceUrl, this.internalConfig.authApiUrl = s.authApiUrl, this.internalConfig.walletGatewayUrl = s.walletGatewayUrl, this.adapterConfig.gatewayUrl = s.walletGatewayUrl;
|
|
@@ -1276,37 +1276,36 @@ const Js = 2e3, It = 6e4, Zs = 1e3, Xs = 1e4, Qs = "0x77359400", Et = "0x3B9ACA0
|
|
|
1276
1276
|
async signMessage(e, s, t) {
|
|
1277
1277
|
if (this.ensureAuthenticated(), !this.userId)
|
|
1278
1278
|
throw new g(p.AUTH_NOT_AUTHENTICATED, "사용자 ID를 찾을 수 없습니다");
|
|
1279
|
-
await this.ensurePinForSigning();
|
|
1280
1279
|
const n = await this.resolveAddress(t == null ? void 0 : t.index);
|
|
1281
|
-
|
|
1282
|
-
if (this.walletProvider.prepare && (o = (await this.walletProvider.prepare("sign-message", { message: s, from: n.address })).uuid), !await this.confirmation.requestConfirmation({
|
|
1280
|
+
if (!await this.confirmation.requestConfirmation({
|
|
1283
1281
|
type: "sign-message",
|
|
1284
1282
|
chainId: e,
|
|
1285
1283
|
from: n.address,
|
|
1286
1284
|
message: s,
|
|
1287
|
-
dappName: t == null ? void 0 : t.dappName,
|
|
1285
|
+
dappName: (t == null ? void 0 : t.dappName) ?? this._config.appName,
|
|
1288
1286
|
accountName: t == null ? void 0 : t.accountName
|
|
1289
1287
|
}))
|
|
1290
1288
|
throw new g(p.USER_REJECTED, "사용자가 메시지 서명을 거부했습니다");
|
|
1291
1289
|
try {
|
|
1292
|
-
const
|
|
1293
|
-
|
|
1290
|
+
const i = await this.withPinRetry(async () => {
|
|
1291
|
+
let a;
|
|
1292
|
+
return this.walletProvider.prepare && (a = (await this.walletProvider.prepare("sign-message", { message: s, from: n.address })).uuid), await this.ensureVerifiedPin(), this.walletProvider.signMessage(
|
|
1294
1293
|
this.userId,
|
|
1295
1294
|
e,
|
|
1296
1295
|
s,
|
|
1297
1296
|
t == null ? void 0 : t.index,
|
|
1298
|
-
|
|
1297
|
+
a,
|
|
1299
1298
|
n.address
|
|
1300
|
-
)
|
|
1301
|
-
);
|
|
1302
|
-
return this.verifySignatureSigner(s,
|
|
1299
|
+
);
|
|
1300
|
+
});
|
|
1301
|
+
return this.verifySignatureSigner(s, i.signature, n.address), {
|
|
1303
1302
|
chainId: e,
|
|
1304
|
-
signature:
|
|
1303
|
+
signature: i.signature,
|
|
1305
1304
|
message: s,
|
|
1306
1305
|
address: n.address
|
|
1307
1306
|
};
|
|
1308
|
-
} catch (
|
|
1309
|
-
throw
|
|
1307
|
+
} catch (i) {
|
|
1308
|
+
throw i instanceof g ? i : new g(p.SIGNATURE_FAILED, `메시지 서명에 실패했습니다 (${e})`, i);
|
|
1310
1309
|
}
|
|
1311
1310
|
}
|
|
1312
1311
|
/**
|
|
@@ -1335,36 +1334,36 @@ const Js = 2e3, It = 6e4, Zs = 1e3, Xs = 1e4, Qs = "0x77359400", Et = "0x3B9ACA0
|
|
|
1335
1334
|
throw new g(p.AUTH_NOT_AUTHENTICATED, "사용자 ID를 찾을 수 없습니다");
|
|
1336
1335
|
if (!this.walletProvider.signTypedData)
|
|
1337
1336
|
throw new g(p.NOT_IMPLEMENTED, "signTypedData가 구현되어 있지 않습니다");
|
|
1338
|
-
|
|
1337
|
+
re.validateTypedDataChainId(e, s);
|
|
1339
1338
|
const n = await this.resolveAddress(t == null ? void 0 : t.index);
|
|
1340
|
-
|
|
1341
|
-
if (this.walletProvider.prepare && (o = (await this.walletProvider.prepare("sign-typed-data", { typedData: s, from: n.address })).uuid), !await this.confirmation.requestConfirmation({
|
|
1339
|
+
if (!await this.confirmation.requestConfirmation({
|
|
1342
1340
|
type: "sign-typed-data",
|
|
1343
1341
|
chainId: e,
|
|
1344
1342
|
from: n.address,
|
|
1345
1343
|
typedData: s,
|
|
1346
|
-
dappName: t == null ? void 0 : t.dappName,
|
|
1344
|
+
dappName: (t == null ? void 0 : t.dappName) ?? this._config.appName,
|
|
1347
1345
|
accountName: t == null ? void 0 : t.accountName
|
|
1348
1346
|
}))
|
|
1349
1347
|
throw new g(p.USER_REJECTED, "사용자가 타입 데이터 서명을 거부했습니다");
|
|
1350
1348
|
try {
|
|
1351
|
-
const
|
|
1352
|
-
|
|
1349
|
+
const i = await this.withPinRetry(async () => {
|
|
1350
|
+
let a;
|
|
1351
|
+
return this.walletProvider.prepare && (a = (await this.walletProvider.prepare("sign-typed-data", { typedData: s, from: n.address })).uuid), await this.ensureVerifiedPin(), this.walletProvider.signTypedData(
|
|
1353
1352
|
this.userId,
|
|
1354
1353
|
e,
|
|
1355
1354
|
s,
|
|
1356
1355
|
t == null ? void 0 : t.index,
|
|
1357
|
-
|
|
1356
|
+
a,
|
|
1358
1357
|
n.address
|
|
1359
|
-
)
|
|
1360
|
-
);
|
|
1361
|
-
return re.validateSignatureFormat(
|
|
1358
|
+
);
|
|
1359
|
+
});
|
|
1360
|
+
return re.validateSignatureFormat(i.signature), {
|
|
1362
1361
|
chainId: e,
|
|
1363
|
-
signature:
|
|
1362
|
+
signature: i.signature,
|
|
1364
1363
|
address: n.address
|
|
1365
1364
|
};
|
|
1366
|
-
} catch (
|
|
1367
|
-
throw
|
|
1365
|
+
} catch (i) {
|
|
1366
|
+
throw i instanceof g ? i : new g(p.SIGNATURE_FAILED, `타입 데이터 서명에 실패했습니다 (${e})`, i);
|
|
1368
1367
|
}
|
|
1369
1368
|
}
|
|
1370
1369
|
/**
|
|
@@ -1401,12 +1400,9 @@ const Js = 2e3, It = 6e4, Zs = 1e3, Xs = 1e4, Qs = "0x77359400", Et = "0x3B9ACA0
|
|
|
1401
1400
|
async signTransaction(e, s, t) {
|
|
1402
1401
|
if (this.ensureAuthenticated(), !this.userId)
|
|
1403
1402
|
throw new g(p.AUTH_NOT_AUTHENTICATED, "사용자 ID를 찾을 수 없습니다");
|
|
1404
|
-
await this.ensurePinForSigning();
|
|
1405
1403
|
const n = await this.withResolvedGasAndFee(s, e);
|
|
1406
1404
|
n.from || (n.from = (await this.resolveAddress(t == null ? void 0 : t.index)).address);
|
|
1407
|
-
|
|
1408
|
-
this.walletProvider.prepare && (o = (await this.walletProvider.prepare("sign", { tx: n })).uuid);
|
|
1409
|
-
const i = Ze(e);
|
|
1405
|
+
const o = Ze(e);
|
|
1410
1406
|
if (!await this.confirmation.requestConfirmation({
|
|
1411
1407
|
type: "sign",
|
|
1412
1408
|
chainId: e,
|
|
@@ -1418,34 +1414,35 @@ const Js = 2e3, It = 6e4, Zs = 1e3, Xs = 1e4, Qs = "0x77359400", Et = "0x3B9ACA0
|
|
|
1418
1414
|
gasPrice: n.gasPrice,
|
|
1419
1415
|
maxFeePerGas: n.maxFeePerGas,
|
|
1420
1416
|
maxPriorityFeePerGas: n.maxPriorityFeePerGas,
|
|
1421
|
-
nativeSymbol:
|
|
1422
|
-
nativeDecimals:
|
|
1423
|
-
dappName: t == null ? void 0 : t.dappName,
|
|
1417
|
+
nativeSymbol: o.symbol,
|
|
1418
|
+
nativeDecimals: o.decimals,
|
|
1419
|
+
dappName: (t == null ? void 0 : t.dappName) ?? this._config.appName,
|
|
1424
1420
|
accountName: t == null ? void 0 : t.accountName
|
|
1425
1421
|
}))
|
|
1426
1422
|
throw new g(p.USER_REJECTED, "사용자가 트랜잭션 서명을 거부했습니다");
|
|
1427
1423
|
try {
|
|
1428
|
-
const
|
|
1429
|
-
|
|
1424
|
+
const a = await this.withPinRetry(async () => {
|
|
1425
|
+
let c;
|
|
1426
|
+
return this.walletProvider.prepare && (c = (await this.walletProvider.prepare("sign", { tx: n })).uuid), await this.ensureVerifiedPin(), this.walletProvider.signTransaction(
|
|
1430
1427
|
this.userId,
|
|
1431
1428
|
e,
|
|
1432
1429
|
n,
|
|
1433
1430
|
t == null ? void 0 : t.index,
|
|
1434
|
-
|
|
1435
|
-
)
|
|
1436
|
-
);
|
|
1437
|
-
return re.validateSignedTxFormat(
|
|
1431
|
+
c
|
|
1432
|
+
);
|
|
1433
|
+
});
|
|
1434
|
+
return re.validateSignedTxFormat(a.signature), {
|
|
1438
1435
|
chainId: e,
|
|
1439
|
-
signedTx:
|
|
1440
|
-
txHash:
|
|
1436
|
+
signedTx: a.signature,
|
|
1437
|
+
txHash: a.txHash ?? ""
|
|
1441
1438
|
};
|
|
1442
|
-
} catch (
|
|
1443
|
-
if (
|
|
1444
|
-
const
|
|
1439
|
+
} catch (a) {
|
|
1440
|
+
if (a instanceof g) throw a;
|
|
1441
|
+
const c = a instanceof Error ? a.message : String(a);
|
|
1445
1442
|
throw new g(
|
|
1446
1443
|
p.SIGNATURE_FAILED,
|
|
1447
|
-
`트랜잭션 서명에 실패했습니다 (${e}): ${
|
|
1448
|
-
|
|
1444
|
+
`트랜잭션 서명에 실패했습니다 (${e}): ${c}`,
|
|
1445
|
+
a
|
|
1449
1446
|
);
|
|
1450
1447
|
}
|
|
1451
1448
|
}
|
|
@@ -1458,12 +1455,9 @@ const Js = 2e3, It = 6e4, Zs = 1e3, Xs = 1e4, Qs = "0x77359400", Et = "0x3B9ACA0
|
|
|
1458
1455
|
async sendTransaction(e, s, t) {
|
|
1459
1456
|
if (this.ensureAuthenticated(), !this.userId)
|
|
1460
1457
|
throw new g(p.AUTH_NOT_AUTHENTICATED, "사용자 ID를 찾을 수 없습니다");
|
|
1461
|
-
await this.ensurePinForSigning();
|
|
1462
1458
|
const n = await this.withResolvedGasAndFee(s, e);
|
|
1463
1459
|
n.from || (n.from = (await this.resolveAddress(t == null ? void 0 : t.index)).address);
|
|
1464
|
-
|
|
1465
|
-
this.walletProvider.prepare && (o = (await this.walletProvider.prepare("send", { tx: n })).uuid);
|
|
1466
|
-
const i = Ze(e);
|
|
1460
|
+
const o = Ze(e);
|
|
1467
1461
|
if (!await this.confirmation.requestConfirmation({
|
|
1468
1462
|
type: "send",
|
|
1469
1463
|
chainId: e,
|
|
@@ -1475,38 +1469,39 @@ const Js = 2e3, It = 6e4, Zs = 1e3, Xs = 1e4, Qs = "0x77359400", Et = "0x3B9ACA0
|
|
|
1475
1469
|
gasPrice: n.gasPrice,
|
|
1476
1470
|
maxFeePerGas: n.maxFeePerGas,
|
|
1477
1471
|
maxPriorityFeePerGas: n.maxPriorityFeePerGas,
|
|
1478
|
-
nativeSymbol:
|
|
1479
|
-
nativeDecimals:
|
|
1480
|
-
dappName: t == null ? void 0 : t.dappName,
|
|
1472
|
+
nativeSymbol: o.symbol,
|
|
1473
|
+
nativeDecimals: o.decimals,
|
|
1474
|
+
dappName: (t == null ? void 0 : t.dappName) ?? this._config.appName,
|
|
1481
1475
|
accountName: t == null ? void 0 : t.accountName
|
|
1482
1476
|
}))
|
|
1483
1477
|
throw new g(p.USER_REJECTED, "사용자가 트랜잭션을 거부했습니다");
|
|
1484
1478
|
try {
|
|
1485
|
-
const
|
|
1486
|
-
|
|
1479
|
+
const a = await this.withPinRetry(async () => {
|
|
1480
|
+
let c;
|
|
1481
|
+
if (this.walletProvider.prepare && (c = (await this.walletProvider.prepare("send", { tx: n })).uuid), await this.ensureVerifiedPin(), this.walletProvider.sendTransaction)
|
|
1487
1482
|
return (await this.walletProvider.sendTransaction(
|
|
1488
1483
|
this.userId,
|
|
1489
1484
|
e,
|
|
1490
1485
|
n,
|
|
1491
|
-
|
|
1486
|
+
c
|
|
1492
1487
|
)).txHash;
|
|
1493
1488
|
const l = await this.walletProvider.signTransaction(
|
|
1494
1489
|
this.userId,
|
|
1495
1490
|
e,
|
|
1496
1491
|
n,
|
|
1497
1492
|
t == null ? void 0 : t.index,
|
|
1498
|
-
|
|
1493
|
+
c
|
|
1499
1494
|
);
|
|
1500
1495
|
return l.txHash ?? l.signature;
|
|
1501
1496
|
});
|
|
1502
|
-
return { chainId: e, txHash:
|
|
1503
|
-
} catch (
|
|
1504
|
-
if (
|
|
1505
|
-
const
|
|
1497
|
+
return { chainId: e, txHash: a, status: "pending" };
|
|
1498
|
+
} catch (a) {
|
|
1499
|
+
if (a instanceof g) throw a;
|
|
1500
|
+
const c = a instanceof Error ? a.message : String(a);
|
|
1506
1501
|
throw new g(
|
|
1507
1502
|
p.TRANSACTION_FAILED,
|
|
1508
|
-
`트랜잭션 전송에 실패했습니다 (${e}): ${
|
|
1509
|
-
|
|
1503
|
+
`트랜잭션 전송에 실패했습니다 (${e}): ${c}`,
|
|
1504
|
+
a
|
|
1510
1505
|
);
|
|
1511
1506
|
}
|
|
1512
1507
|
}
|
|
@@ -1562,7 +1557,7 @@ const Js = 2e3, It = 6e4, Zs = 1e3, Xs = 1e4, Qs = "0x77359400", Et = "0x3B9ACA0
|
|
|
1562
1557
|
let m, x;
|
|
1563
1558
|
const w = this.waitForTxAndGetReceipt(a, e, { intervalMs: c, timeoutMs: l }).then((S) => {
|
|
1564
1559
|
m = S;
|
|
1565
|
-
const O = BigInt(S.gasUsed) * BigInt(S.effectiveGasPrice), B = s.value ? BigInt(s.value) : 0n, v = re.formatTxAmount(s.value, d.symbol, d.decimals), P = re.formatTxAmount("0x" + O.toString(16), d.symbol, d.decimals),
|
|
1560
|
+
const O = BigInt(S.gasUsed) * BigInt(S.effectiveGasPrice), B = s.value ? BigInt(s.value) : 0n, v = re.formatTxAmount(s.value, d.symbol, d.decimals), P = re.formatTxAmount("0x" + O.toString(16), d.symbol, d.decimals), R = re.formatTxAmount("0x" + (B + O).toString(16), d.symbol, d.decimals);
|
|
1566
1561
|
return {
|
|
1567
1562
|
chainId: e,
|
|
1568
1563
|
txHash: a,
|
|
@@ -1570,7 +1565,7 @@ const Js = 2e3, It = 6e4, Zs = 1e3, Xs = 1e4, Qs = "0x77359400", Et = "0x3B9ACA0
|
|
|
1570
1565
|
to: S.to ?? s.to,
|
|
1571
1566
|
amount: v,
|
|
1572
1567
|
fees: P,
|
|
1573
|
-
total:
|
|
1568
|
+
total: R,
|
|
1574
1569
|
nativeSymbol: d.symbol,
|
|
1575
1570
|
status: S.status === "0x1" ? "success" : "reverted"
|
|
1576
1571
|
};
|
|
@@ -2113,7 +2108,7 @@ const Js = 2e3, It = 6e4, Zs = 1e3, Xs = 1e4, Qs = "0x77359400", Et = "0x3B9ACA0
|
|
|
2113
2108
|
this.pinStore.set(i), u.log("[CROSSx] PIN 캐시 완료 (verifyPin 미지원, 로컬 전용)"), t();
|
|
2114
2109
|
return;
|
|
2115
2110
|
}
|
|
2116
|
-
|
|
2111
|
+
const o = await this.confirmation.showPinInputPrompt({
|
|
2117
2112
|
verifyMode: !0,
|
|
2118
2113
|
errorMessage: e,
|
|
2119
2114
|
lockExpiresAt: s,
|
|
@@ -2126,15 +2121,18 @@ const Js = 2e3, It = 6e4, Zs = 1e3, Xs = 1e4, Qs = "0x77359400", Et = "0x3B9ACA0
|
|
|
2126
2121
|
if (this.pinStore.clear(), c instanceof g) {
|
|
2127
2122
|
if (c.code === p.PIN_WRONG)
|
|
2128
2123
|
return { ok: !1, error: "Incorrect PIN. Please try again." };
|
|
2124
|
+
if (c.code === p.PIN_INVALID)
|
|
2125
|
+
return { ok: !1, error: c.message };
|
|
2129
2126
|
if (c.code === p.PIN_LOCKED)
|
|
2130
2127
|
return { ok: !1, error: "Too many failed attempts. Your account is temporarily locked.", lockExpiresAt: (a = c.details) == null ? void 0 : a.lockExpiresAt };
|
|
2131
2128
|
}
|
|
2132
2129
|
throw c;
|
|
2133
2130
|
}
|
|
2134
2131
|
}
|
|
2135
|
-
})
|
|
2132
|
+
});
|
|
2133
|
+
if (!o)
|
|
2136
2134
|
throw new g(p.PIN_CANCELLED, "사용자가 PIN 입력을 취소했습니다");
|
|
2137
|
-
t();
|
|
2135
|
+
this.pinStore.set(o), u.log("[CROSSx] PIN 갱신 완료 (verify 모달 닫힘)"), t();
|
|
2138
2136
|
} catch (o) {
|
|
2139
2137
|
throw n(o), o;
|
|
2140
2138
|
} finally {
|
|
@@ -2183,6 +2181,8 @@ const Js = 2e3, It = 6e4, Zs = 1e3, Xs = 1e4, Qs = "0x77359400", Et = "0x3B9ACA0
|
|
|
2183
2181
|
if (n instanceof g)
|
|
2184
2182
|
if (n.code === p.PIN_WRONG)
|
|
2185
2183
|
s = "Incorrect PIN. Please enter your current PIN.";
|
|
2184
|
+
else if (n.code === p.PIN_INVALID)
|
|
2185
|
+
s = n.message;
|
|
2186
2186
|
else if (n.code === p.PIN_LOCKED) {
|
|
2187
2187
|
const o = n.details;
|
|
2188
2188
|
t = o == null ? void 0 : o.lockExpiresAt, s = "Too many failed attempts. Your account is temporarily locked.";
|
|
@@ -2201,6 +2201,10 @@ const Js = 2e3, It = 6e4, Zs = 1e3, Xs = 1e4, Qs = "0x77359400", Et = "0x3B9ACA0
|
|
|
2201
2201
|
s = "Incorrect PIN. Please try again.";
|
|
2202
2202
|
continue;
|
|
2203
2203
|
}
|
|
2204
|
+
if (n.code === p.PIN_INVALID) {
|
|
2205
|
+
s = n.message;
|
|
2206
|
+
continue;
|
|
2207
|
+
}
|
|
2204
2208
|
if (n.code === p.PIN_LOCKED) {
|
|
2205
2209
|
const o = n.details;
|
|
2206
2210
|
t = o == null ? void 0 : o.lockExpiresAt, s = "Too many failed attempts. Your account is temporarily locked.";
|
|
@@ -2289,7 +2293,7 @@ class sr {
|
|
|
2289
2293
|
}
|
|
2290
2294
|
}
|
|
2291
2295
|
const rr = "crossx-sdk", nr = 1, Ie = "data", Be = "keys", Pt = "aes-primary", or = 12;
|
|
2292
|
-
class
|
|
2296
|
+
class Nt {
|
|
2293
2297
|
constructor() {
|
|
2294
2298
|
this.db = null, this.cryptoKey = null, this.initPromise = null;
|
|
2295
2299
|
}
|
|
@@ -2458,7 +2462,7 @@ function lr(r) {
|
|
|
2458
2462
|
r[e] = cr(r[e]);
|
|
2459
2463
|
return r;
|
|
2460
2464
|
}
|
|
2461
|
-
const
|
|
2465
|
+
const Rt = ar ? (r) => r : lr, ts = /* @ts-ignore */ typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", dr = /* @__PURE__ */ Array.from({ length: 256 }, (r, e) => e.toString(16).padStart(2, "0"));
|
|
2462
2466
|
function Me(r) {
|
|
2463
2467
|
if (z(r), ts)
|
|
2464
2468
|
return r.toHex();
|
|
@@ -2843,7 +2847,7 @@ function Lt(r) {
|
|
|
2843
2847
|
};
|
|
2844
2848
|
}
|
|
2845
2849
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
2846
|
-
const ne = /* @__PURE__ */ BigInt(0), ee = /* @__PURE__ */ BigInt(1), ve = /* @__PURE__ */ BigInt(2), cs = /* @__PURE__ */ BigInt(3), ls = /* @__PURE__ */ BigInt(4), ds = /* @__PURE__ */ BigInt(5),
|
|
2850
|
+
const ne = /* @__PURE__ */ BigInt(0), ee = /* @__PURE__ */ BigInt(1), ve = /* @__PURE__ */ BigInt(2), cs = /* @__PURE__ */ BigInt(3), ls = /* @__PURE__ */ BigInt(4), ds = /* @__PURE__ */ BigInt(5), Nr = /* @__PURE__ */ BigInt(7), us = /* @__PURE__ */ BigInt(8), Rr = /* @__PURE__ */ BigInt(9), hs = /* @__PURE__ */ BigInt(16);
|
|
2847
2851
|
function le(r, e) {
|
|
2848
2852
|
const s = r % e;
|
|
2849
2853
|
return s >= ne ? s : e + s;
|
|
@@ -2881,7 +2885,7 @@ function Cr(r, e) {
|
|
|
2881
2885
|
return xt(r, a, e), a;
|
|
2882
2886
|
}
|
|
2883
2887
|
function Or(r) {
|
|
2884
|
-
const e = Ye(r), s = fs(r), t = s(e, e.neg(e.ONE)), n = s(e, t), o = s(e, e.neg(t)), i = (r +
|
|
2888
|
+
const e = Ye(r), s = fs(r), t = s(e, e.neg(e.ONE)), n = s(e, t), o = s(e, e.neg(t)), i = (r + Nr) / hs;
|
|
2885
2889
|
return (a, c) => {
|
|
2886
2890
|
let l = a.pow(c, i), d = a.mul(l, t);
|
|
2887
2891
|
const h = a.mul(l, n), m = a.mul(l, o), x = a.eql(a.sqr(d), c), w = a.eql(a.sqr(h), c);
|
|
@@ -2925,7 +2929,7 @@ function fs(r) {
|
|
|
2925
2929
|
};
|
|
2926
2930
|
}
|
|
2927
2931
|
function Lr(r) {
|
|
2928
|
-
return r % ls === cs ? ps : r % us === ds ? Cr : r % hs ===
|
|
2932
|
+
return r % ls === cs ? ps : r % us === ds ? Cr : r % hs === Rr ? Or(r) : fs(r);
|
|
2929
2933
|
}
|
|
2930
2934
|
const Dr = [
|
|
2931
2935
|
"create",
|
|
@@ -3456,7 +3460,7 @@ function jr(r, e = {}) {
|
|
|
3456
3460
|
if (!t.isOdd)
|
|
3457
3461
|
throw new Error("compression is not supported: Field does not have .isOdd()");
|
|
3458
3462
|
}
|
|
3459
|
-
function h(
|
|
3463
|
+
function h(N, f, _) {
|
|
3460
3464
|
const { x: b, y: A } = f.toAffine(), L = t.toBytes(b);
|
|
3461
3465
|
if (Ve(_, "isCompressed"), _) {
|
|
3462
3466
|
d();
|
|
@@ -3465,9 +3469,9 @@ function jr(r, e = {}) {
|
|
|
3465
3469
|
} else
|
|
3466
3470
|
return ye(Uint8Array.of(4), L, t.toBytes(A));
|
|
3467
3471
|
}
|
|
3468
|
-
function m(
|
|
3469
|
-
z(
|
|
3470
|
-
const { publicKey: f, publicKeyUncompressed: _ } = l, b =
|
|
3472
|
+
function m(N) {
|
|
3473
|
+
z(N, void 0, "Point");
|
|
3474
|
+
const { publicKey: f, publicKeyUncompressed: _ } = l, b = N.length, A = N[0], L = N.subarray(1);
|
|
3471
3475
|
if (b === f && (A === 2 || A === 3)) {
|
|
3472
3476
|
const C = t.fromBytes(L);
|
|
3473
3477
|
if (!t.isValid(C))
|
|
@@ -3492,12 +3496,12 @@ function jr(r, e = {}) {
|
|
|
3492
3496
|
throw new Error(`bad point: got length ${b}, expected compressed=${f} or uncompressed=${_}`);
|
|
3493
3497
|
}
|
|
3494
3498
|
const x = e.toBytes || h, w = e.fromBytes || m;
|
|
3495
|
-
function E(
|
|
3496
|
-
const f = t.sqr(
|
|
3497
|
-
return t.add(t.add(_, t.mul(
|
|
3499
|
+
function E(N) {
|
|
3500
|
+
const f = t.sqr(N), _ = t.mul(f, N);
|
|
3501
|
+
return t.add(t.add(_, t.mul(N, o.a)), o.b);
|
|
3498
3502
|
}
|
|
3499
|
-
function y(
|
|
3500
|
-
const _ = t.sqr(f), b = E(
|
|
3503
|
+
function y(N, f) {
|
|
3504
|
+
const _ = t.sqr(f), b = E(N);
|
|
3501
3505
|
return t.eql(_, b);
|
|
3502
3506
|
}
|
|
3503
3507
|
if (!y(o.Gx, o.Gy))
|
|
@@ -3505,25 +3509,25 @@ function jr(r, e = {}) {
|
|
|
3505
3509
|
const S = t.mul(t.pow(o.a, Fe), Kr), O = t.mul(t.sqr(o.b), BigInt(27));
|
|
3506
3510
|
if (t.is0(t.add(S, O)))
|
|
3507
3511
|
throw new Error("bad curve params: a or b");
|
|
3508
|
-
function B(
|
|
3512
|
+
function B(N, f, _ = !1) {
|
|
3509
3513
|
if (!t.isValid(f) || _ && t.is0(f))
|
|
3510
|
-
throw new Error(`bad point coordinate ${
|
|
3514
|
+
throw new Error(`bad point coordinate ${N}`);
|
|
3511
3515
|
return f;
|
|
3512
3516
|
}
|
|
3513
|
-
function v(
|
|
3514
|
-
if (!(
|
|
3517
|
+
function v(N) {
|
|
3518
|
+
if (!(N instanceof W))
|
|
3515
3519
|
throw new Error("Weierstrass Point expected");
|
|
3516
3520
|
}
|
|
3517
|
-
function P(
|
|
3521
|
+
function P(N) {
|
|
3518
3522
|
if (!c || !c.basises)
|
|
3519
3523
|
throw new Error("no endo");
|
|
3520
|
-
return Vr(
|
|
3524
|
+
return Vr(N, c.basises, n.ORDER);
|
|
3521
3525
|
}
|
|
3522
|
-
const
|
|
3523
|
-
const { X: _, Y: b, Z: A } =
|
|
3526
|
+
const R = Lt((N, f) => {
|
|
3527
|
+
const { X: _, Y: b, Z: A } = N;
|
|
3524
3528
|
if (t.eql(A, t.ONE))
|
|
3525
3529
|
return { x: _, y: b };
|
|
3526
|
-
const L =
|
|
3530
|
+
const L = N.is0();
|
|
3527
3531
|
f == null && (f = L ? t.ONE : t.inv(A));
|
|
3528
3532
|
const C = t.mul(_, f), M = t.mul(b, f), T = t.mul(A, f);
|
|
3529
3533
|
if (L)
|
|
@@ -3531,23 +3535,23 @@ function jr(r, e = {}) {
|
|
|
3531
3535
|
if (!t.eql(T, t.ONE))
|
|
3532
3536
|
throw new Error("invZ was invalid");
|
|
3533
3537
|
return { x: C, y: M };
|
|
3534
|
-
}), G = Lt((
|
|
3535
|
-
if (
|
|
3536
|
-
if (e.allowInfinityPoint && !t.is0(
|
|
3538
|
+
}), G = Lt((N) => {
|
|
3539
|
+
if (N.is0()) {
|
|
3540
|
+
if (e.allowInfinityPoint && !t.is0(N.Y))
|
|
3537
3541
|
return;
|
|
3538
3542
|
throw new Error("bad point: ZERO");
|
|
3539
3543
|
}
|
|
3540
|
-
const { x: f, y: _ } =
|
|
3544
|
+
const { x: f, y: _ } = N.toAffine();
|
|
3541
3545
|
if (!t.isValid(f) || !t.isValid(_))
|
|
3542
3546
|
throw new Error("bad point: x or y not field elements");
|
|
3543
3547
|
if (!y(f, _))
|
|
3544
3548
|
throw new Error("bad point: equation left != right");
|
|
3545
|
-
if (!
|
|
3549
|
+
if (!N.isTorsionFree())
|
|
3546
3550
|
throw new Error("bad point: not in prime-order subgroup");
|
|
3547
3551
|
return !0;
|
|
3548
3552
|
});
|
|
3549
|
-
function K(
|
|
3550
|
-
return _ = new W(t.mul(_.X,
|
|
3553
|
+
function K(N, f, _, b, A) {
|
|
3554
|
+
return _ = new W(t.mul(_.X, N), _.Y, _.Z), f = ze(b, f), _ = ze(A, _), f.add(_);
|
|
3551
3555
|
}
|
|
3552
3556
|
const k = class k {
|
|
3553
3557
|
/** Does NOT validate if the point is valid. Use `.assertValidity()`. */
|
|
@@ -3691,7 +3695,7 @@ function jr(r, e = {}) {
|
|
|
3691
3695
|
* @param invertedZ Z^-1 (inverted zero) - optional, precomputation is useful for invertBatch
|
|
3692
3696
|
*/
|
|
3693
3697
|
toAffine(f) {
|
|
3694
|
-
return
|
|
3698
|
+
return R(this, f);
|
|
3695
3699
|
}
|
|
3696
3700
|
/**
|
|
3697
3701
|
* Checks whether Point is free of torsion elements (is in prime subgroup).
|
|
@@ -3858,7 +3862,7 @@ function Jr(r, e, s = {}) {
|
|
|
3858
3862
|
const { r: b, s: A } = this, L = this.assertRecovery(), C = L === 2 || L === 3 ? b + a : b;
|
|
3859
3863
|
if (!o.isValid(C))
|
|
3860
3864
|
throw new Error("invalid recovery id: sig.r+curve.n != R.x");
|
|
3861
|
-
const M = o.toBytes(C), T = r.fromBytes(ye(Ss((L & 1) === 0), M)), $ = i.inv(C), F =
|
|
3865
|
+
const M = o.toBytes(C), T = r.fromBytes(ye(Ss((L & 1) === 0), M)), $ = i.inv(C), F = R(z(_, void 0, "msgHash")), J = i.create(-F * $), V = i.create(A * $), H = r.BASE.multiplyUnsafe(J).add(T.multiplyUnsafe(V));
|
|
3862
3866
|
if (H.is0())
|
|
3863
3867
|
throw new Error("invalid recovery: point at infinify");
|
|
3864
3868
|
return H.assertValidity(), H;
|
|
@@ -3882,7 +3886,7 @@ function Jr(r, e, s = {}) {
|
|
|
3882
3886
|
throw new Error("input is too large");
|
|
3883
3887
|
const b = je(_), A = _.length * 8 - c;
|
|
3884
3888
|
return A > 0 ? b >> BigInt(A) : b;
|
|
3885
|
-
},
|
|
3889
|
+
}, R = s.bits2int_modN || function(_) {
|
|
3886
3890
|
return i.create(P(_));
|
|
3887
3891
|
}, G = ft(c);
|
|
3888
3892
|
function K(f) {
|
|
@@ -3894,7 +3898,7 @@ function Jr(r, e, s = {}) {
|
|
|
3894
3898
|
function q(f, _, b) {
|
|
3895
3899
|
const { lowS: A, prehash: L, extraEntropy: C } = st(b, w);
|
|
3896
3900
|
f = W(f, L);
|
|
3897
|
-
const M =
|
|
3901
|
+
const M = R(f), T = i.fromBytes(_);
|
|
3898
3902
|
if (!i.isValidNot0(T))
|
|
3899
3903
|
throw new Error("invalid private key");
|
|
3900
3904
|
const $ = [K(T), K(M)];
|
|
@@ -3933,13 +3937,13 @@ function Jr(r, e, s = {}) {
|
|
|
3933
3937
|
const T = v.fromBytes(f, M), $ = r.fromBytes(b);
|
|
3934
3938
|
if (L && T.hasHighS())
|
|
3935
3939
|
return !1;
|
|
3936
|
-
const { r: F, s: J } = T, V =
|
|
3940
|
+
const { r: F, s: J } = T, V = R(_), H = i.inv(J), Z = i.create(V * H), X = i.create(F * H), oe = r.BASE.multiplyUnsafe(Z).add($.multiplyUnsafe(X));
|
|
3937
3941
|
return oe.is0() ? !1 : i.create(oe.x) === F;
|
|
3938
3942
|
} catch {
|
|
3939
3943
|
return !1;
|
|
3940
3944
|
}
|
|
3941
3945
|
}
|
|
3942
|
-
function
|
|
3946
|
+
function N(f, _, b = {}) {
|
|
3943
3947
|
const { prehash: A } = st(b, w);
|
|
3944
3948
|
return _ = W(_, A), v.fromBytes(f, "recovered").recoverPublicKey(_).toBytes();
|
|
3945
3949
|
}
|
|
@@ -3952,7 +3956,7 @@ function Jr(r, e, s = {}) {
|
|
|
3952
3956
|
Point: r,
|
|
3953
3957
|
sign: D,
|
|
3954
3958
|
verify: k,
|
|
3955
|
-
recoverPublicKey:
|
|
3959
|
+
recoverPublicKey: N,
|
|
3956
3960
|
Signature: v,
|
|
3957
3961
|
hash: e
|
|
3958
3962
|
});
|
|
@@ -3974,10 +3978,10 @@ const gt = {
|
|
|
3974
3978
|
]
|
|
3975
3979
|
}, Gt = /* @__PURE__ */ BigInt(2);
|
|
3976
3980
|
function Xr(r) {
|
|
3977
|
-
const e = gt.p, s = BigInt(3), t = BigInt(6), n = BigInt(11), o = BigInt(22), i = BigInt(23), a = BigInt(44), c = BigInt(88), l = r * r * r % e, d = l * l * r % e, h = ae(d, s, e) * d % e, m = ae(h, s, e) * d % e, x = ae(m, Gt, e) * l % e, w = ae(x, n, e) * x % e, E = ae(w, o, e) * w % e, y = ae(E, a, e) * E % e, S = ae(y, c, e) * y % e, O = ae(S, a, e) * E % e, B = ae(O, s, e) * d % e, v = ae(B, i, e) * w % e, P = ae(v, t, e) * l % e,
|
|
3978
|
-
if (!lt.eql(lt.sqr(
|
|
3981
|
+
const e = gt.p, s = BigInt(3), t = BigInt(6), n = BigInt(11), o = BigInt(22), i = BigInt(23), a = BigInt(44), c = BigInt(88), l = r * r * r % e, d = l * l * r % e, h = ae(d, s, e) * d % e, m = ae(h, s, e) * d % e, x = ae(m, Gt, e) * l % e, w = ae(x, n, e) * x % e, E = ae(w, o, e) * w % e, y = ae(E, a, e) * E % e, S = ae(y, c, e) * y % e, O = ae(S, a, e) * E % e, B = ae(O, s, e) * d % e, v = ae(B, i, e) * w % e, P = ae(v, t, e) * l % e, R = ae(P, Gt, e);
|
|
3982
|
+
if (!lt.eql(lt.sqr(R), r))
|
|
3979
3983
|
throw new Error("Cannot find square root");
|
|
3980
|
-
return
|
|
3984
|
+
return R;
|
|
3981
3985
|
}
|
|
3982
3986
|
const lt = Ye(gt.p, { sqrt: Xr }), Qr = /* @__PURE__ */ jr(gt, {
|
|
3983
3987
|
Fp: lt,
|
|
@@ -4038,7 +4042,7 @@ class mt {
|
|
|
4038
4042
|
return this._cloneInto();
|
|
4039
4043
|
}
|
|
4040
4044
|
keccak() {
|
|
4041
|
-
|
|
4045
|
+
Rt(this.state32), ln(this.state32, this.rounds), Rt(this.state32), this.posOut = 0, this.pos = 0;
|
|
4042
4046
|
}
|
|
4043
4047
|
update(e) {
|
|
4044
4048
|
Ae(this), z(e);
|
|
@@ -4280,27 +4284,27 @@ class we {
|
|
|
4280
4284
|
}
|
|
4281
4285
|
}, 1e3), v = () => {
|
|
4282
4286
|
clearTimeout(x), clearInterval(B), S && clearTimeout(S), window.removeEventListener("message", P);
|
|
4283
|
-
}, P = (
|
|
4287
|
+
}, P = (R) => {
|
|
4284
4288
|
var K, W, q, D, k;
|
|
4285
|
-
if (
|
|
4286
|
-
v(), u.log("[CROSSx] OAuth postMessage 수신 — status:",
|
|
4287
|
-
const G =
|
|
4289
|
+
if (R.origin !== e.expectedOrigin) return;
|
|
4290
|
+
v(), u.log("[CROSSx] OAuth postMessage 수신 — status:", R.data.status);
|
|
4291
|
+
const G = R.data.state ?? ((K = R.data.data) == null ? void 0 : K.state);
|
|
4288
4292
|
if (!G || G !== c) {
|
|
4289
4293
|
t(new Error("OAuth state mismatch — possible CSRF attack"));
|
|
4290
4294
|
return;
|
|
4291
4295
|
}
|
|
4292
|
-
if (
|
|
4293
|
-
const
|
|
4296
|
+
if (R.data.status === "success") {
|
|
4297
|
+
const N = (W = R.data.data) == null ? void 0 : W.idToken, f = (q = R.data.data) == null ? void 0 : q.accessToken, _ = f ?? N;
|
|
4294
4298
|
if (u.log("[CROSSx] OAuth 토큰 수신:", {
|
|
4295
4299
|
hasAccessToken: !!f,
|
|
4296
|
-
hasIdToken: !!
|
|
4300
|
+
hasIdToken: !!N
|
|
4297
4301
|
}), !_) {
|
|
4298
|
-
u.error("[CROSSx] 토큰을 찾을 수 없음:",
|
|
4302
|
+
u.error("[CROSSx] 토큰을 찾을 수 없음:", R.data), t(new Error("Token not found in response"));
|
|
4299
4303
|
return;
|
|
4300
4304
|
}
|
|
4301
|
-
if (
|
|
4305
|
+
if (N) {
|
|
4302
4306
|
try {
|
|
4303
|
-
const b = we.parseJwtPayload(
|
|
4307
|
+
const b = we.parseJwtPayload(N);
|
|
4304
4308
|
u.log("[CROSSx] idToken JWT payload 요약:", {
|
|
4305
4309
|
iss: b.iss,
|
|
4306
4310
|
sub: typeof b.sub == "string" ? `${b.sub.slice(0, 6)}...` : "(absent)",
|
|
@@ -4311,13 +4315,13 @@ class we {
|
|
|
4311
4315
|
} catch {
|
|
4312
4316
|
u.warn("[CROSSx] idToken JWT payload 파싱 실패 — 토큰 형식을 확인하세요");
|
|
4313
4317
|
}
|
|
4314
|
-
we.verifyIdTokenNonce(
|
|
4318
|
+
we.verifyIdTokenNonce(N, l).then(() => s(_)).catch((b) => {
|
|
4315
4319
|
u.error("[CROSSx] nonce 검증 실패:", b), t(b instanceof Error ? b : new Error("nonce verification failed"));
|
|
4316
4320
|
});
|
|
4317
4321
|
} else
|
|
4318
4322
|
s(_);
|
|
4319
4323
|
} else
|
|
4320
|
-
u.error("[CROSSx] OAuth 실패:", (D =
|
|
4324
|
+
u.error("[CROSSx] OAuth 실패:", (D = R.data.data) == null ? void 0 : D.error), t(new Error(((k = R.data.data) == null ? void 0 : k.error) || "Authentication failed"));
|
|
4321
4325
|
};
|
|
4322
4326
|
window.addEventListener("message", P);
|
|
4323
4327
|
});
|
|
@@ -4696,7 +4700,7 @@ class Le {
|
|
|
4696
4700
|
*/
|
|
4697
4701
|
async verifyPin(e) {
|
|
4698
4702
|
const s = { password: e };
|
|
4699
|
-
return (await this.request("POST", "/mnemonic/verify-password", s)).
|
|
4703
|
+
return (await this.request("POST", "/mnemonic/verify-password", s)).valid;
|
|
4700
4704
|
}
|
|
4701
4705
|
/**
|
|
4702
4706
|
* POST /mnemonic/change-password — PIN 변경
|
|
@@ -5561,6 +5565,19 @@ const gn = `
|
|
|
5561
5565
|
filter: none !important;
|
|
5562
5566
|
transform: none !important;
|
|
5563
5567
|
}
|
|
5568
|
+
.__crossx-recover-icon {
|
|
5569
|
+
display: flex;
|
|
5570
|
+
align-items: center;
|
|
5571
|
+
justify-content: center;
|
|
5572
|
+
flex-shrink: 0;
|
|
5573
|
+
width: 40px;
|
|
5574
|
+
height: 40px;
|
|
5575
|
+
}
|
|
5576
|
+
.__crossx-recover-icon svg {
|
|
5577
|
+
width: 40px;
|
|
5578
|
+
height: 40px;
|
|
5579
|
+
display: block;
|
|
5580
|
+
}
|
|
5564
5581
|
.__crossx-recover-label {
|
|
5565
5582
|
font-size: 18px;
|
|
5566
5583
|
font-weight: 700;
|
|
@@ -5819,7 +5836,7 @@ const gn = `
|
|
|
5819
5836
|
.__crossx-approve-btn {
|
|
5820
5837
|
width: 100%;
|
|
5821
5838
|
padding: 16px;
|
|
5822
|
-
border: 1px solid
|
|
5839
|
+
border: 1px solid var(--cx-border);
|
|
5823
5840
|
border-radius: 12px;
|
|
5824
5841
|
background: var(--cx-primary);
|
|
5825
5842
|
color: var(--cx-on-primary);
|
|
@@ -5872,7 +5889,7 @@ const gn = `
|
|
|
5872
5889
|
.__crossx-confirm-btn {
|
|
5873
5890
|
flex: 1;
|
|
5874
5891
|
padding: 16px;
|
|
5875
|
-
border: 1px solid
|
|
5892
|
+
border: 1px solid var(--cx-border);
|
|
5876
5893
|
border-radius: 12px;
|
|
5877
5894
|
background: var(--cx-primary);
|
|
5878
5895
|
color: var(--cx-on-primary);
|
|
@@ -5894,6 +5911,52 @@ const gn = `
|
|
|
5894
5911
|
color: var(--cx-on-primary) !important;
|
|
5895
5912
|
}
|
|
5896
5913
|
|
|
5914
|
+
/* ── Sign/Send modals: max-height + sticky buttons ─────────── */
|
|
5915
|
+
.__crossx-card--send-tx,
|
|
5916
|
+
.__crossx-card--sign-tx,
|
|
5917
|
+
.__crossx-card--sign-msg,
|
|
5918
|
+
.__crossx-card--sign-typed {
|
|
5919
|
+
display: flex;
|
|
5920
|
+
flex-direction: column;
|
|
5921
|
+
max-height: 90vh;
|
|
5922
|
+
}
|
|
5923
|
+
/* sign-tx: col-right-sign이 스크롤 담당, raw-tx는 자연 높이 */
|
|
5924
|
+
.__crossx-card--sign-tx .__crossx-col-right-sign {
|
|
5925
|
+
flex: 1;
|
|
5926
|
+
min-height: 0;
|
|
5927
|
+
overflow-y: auto;
|
|
5928
|
+
}
|
|
5929
|
+
.__crossx-card--sign-tx .__crossx-col-right-sign .__crossx-rows { flex-shrink: 0; }
|
|
5930
|
+
.__crossx-card--sign-tx .__crossx-raw-tx { max-height: none; overflow-y: visible; }
|
|
5931
|
+
.__crossx-card--send-tx .__crossx-body,
|
|
5932
|
+
.__crossx-card--sign-tx .__crossx-body,
|
|
5933
|
+
.__crossx-card--sign-msg .__crossx-body,
|
|
5934
|
+
.__crossx-card--sign-typed .__crossx-body {
|
|
5935
|
+
flex: 1;
|
|
5936
|
+
min-height: 0;
|
|
5937
|
+
display: flex;
|
|
5938
|
+
flex-direction: column;
|
|
5939
|
+
overflow: hidden;
|
|
5940
|
+
}
|
|
5941
|
+
.__crossx-card--send-tx .__crossx-body-cols,
|
|
5942
|
+
.__crossx-card--sign-tx .__crossx-body-cols,
|
|
5943
|
+
.__crossx-card--sign-msg .__crossx-body-cols,
|
|
5944
|
+
.__crossx-card--sign-typed .__crossx-body-cols {
|
|
5945
|
+
flex: 1;
|
|
5946
|
+
min-height: 0;
|
|
5947
|
+
overflow-y: auto;
|
|
5948
|
+
}
|
|
5949
|
+
.__crossx-card--send-tx .__crossx-btn-row,
|
|
5950
|
+
.__crossx-card--sign-tx .__crossx-btn-row,
|
|
5951
|
+
.__crossx-card--sign-msg .__crossx-btn-row,
|
|
5952
|
+
.__crossx-card--sign-typed .__crossx-btn-row,
|
|
5953
|
+
.__crossx-card--send-tx .__crossx-body > .__crossx-approve-btn,
|
|
5954
|
+
.__crossx-card--sign-tx .__crossx-body > .__crossx-approve-btn,
|
|
5955
|
+
.__crossx-card--sign-msg .__crossx-body > .__crossx-approve-btn,
|
|
5956
|
+
.__crossx-card--sign-typed .__crossx-body > .__crossx-approve-btn {
|
|
5957
|
+
flex-shrink: 0;
|
|
5958
|
+
}
|
|
5959
|
+
|
|
5897
5960
|
/* ── Transaction Progress / Complete Modal ─────────────────── */
|
|
5898
5961
|
@keyframes __crossx-spinner {
|
|
5899
5962
|
to { transform: rotate(360deg); }
|
|
@@ -6153,6 +6216,10 @@ const gn = `
|
|
|
6153
6216
|
overflow: hidden !important;
|
|
6154
6217
|
}
|
|
6155
6218
|
.__crossx-card--wallet-selector .__crossx-wallet-list { max-height: 203px; }
|
|
6219
|
+
.__crossx-card--send-tx,
|
|
6220
|
+
.__crossx-card--sign-tx,
|
|
6221
|
+
.__crossx-card--sign-msg,
|
|
6222
|
+
.__crossx-card--sign-typed { overflow: hidden; max-height: 92vh; }
|
|
6156
6223
|
.__crossx-login-btn-row {
|
|
6157
6224
|
flex-direction: column;
|
|
6158
6225
|
}
|
|
@@ -6164,7 +6231,7 @@ const gn = `
|
|
|
6164
6231
|
width: 100% !important;
|
|
6165
6232
|
max-width: 100% !important;
|
|
6166
6233
|
border-radius: 20px 20px 0 0 !important;
|
|
6167
|
-
border: 1px solid
|
|
6234
|
+
border: 1px solid var(--cx-border) !important;
|
|
6168
6235
|
border-bottom: none !important;
|
|
6169
6236
|
max-height: 92vh;
|
|
6170
6237
|
overflow: hidden;
|
|
@@ -6200,7 +6267,7 @@ const gn = `
|
|
|
6200
6267
|
width: 100% !important;
|
|
6201
6268
|
max-width: 100% !important;
|
|
6202
6269
|
border-radius: 20px 20px 0 0 !important;
|
|
6203
|
-
border: 1px solid
|
|
6270
|
+
border: 1px solid var(--cx-border) !important;
|
|
6204
6271
|
border-bottom: none !important;
|
|
6205
6272
|
max-height: 92vh;
|
|
6206
6273
|
overflow: hidden;
|
|
@@ -6266,6 +6333,11 @@ const gn = `
|
|
|
6266
6333
|
flex-direction: column;
|
|
6267
6334
|
gap: 8px;
|
|
6268
6335
|
}
|
|
6336
|
+
.__crossx-col-right-sign {
|
|
6337
|
+
display: flex;
|
|
6338
|
+
flex-direction: column;
|
|
6339
|
+
gap: 16px;
|
|
6340
|
+
}
|
|
6269
6341
|
|
|
6270
6342
|
/* ── Landscape for signing/transaction modals ──────────── */
|
|
6271
6343
|
@media (orientation: landscape) and (max-height: 500px) {
|
|
@@ -6280,7 +6352,7 @@ const gn = `
|
|
|
6280
6352
|
border-radius: 24px;
|
|
6281
6353
|
border-bottom: 4px solid var(--cx-border);
|
|
6282
6354
|
max-height: calc(100vh - 32px);
|
|
6283
|
-
overflow
|
|
6355
|
+
overflow: hidden;
|
|
6284
6356
|
animation: __crossx-slide-up 0.18s ease;
|
|
6285
6357
|
}
|
|
6286
6358
|
.__crossx-card--send-tx .__crossx-header,
|
|
@@ -6305,7 +6377,8 @@ const gn = `
|
|
|
6305
6377
|
.__crossx-card--wallet-selector .__crossx-body-cols {
|
|
6306
6378
|
flex-direction: row;
|
|
6307
6379
|
gap: 24px;
|
|
6308
|
-
align-items:
|
|
6380
|
+
align-items: stretch;
|
|
6381
|
+
overflow: hidden;
|
|
6309
6382
|
}
|
|
6310
6383
|
.__crossx-body-cols > * { flex: 1; min-width: 0; }
|
|
6311
6384
|
.__crossx-col-left { gap: 8px; }
|
|
@@ -6314,10 +6387,16 @@ const gn = `
|
|
|
6314
6387
|
flex-direction: column;
|
|
6315
6388
|
align-items: flex-end;
|
|
6316
6389
|
}
|
|
6317
|
-
.__crossx-card--
|
|
6390
|
+
.__crossx-card--send-tx .__crossx-col-left,
|
|
6391
|
+
.__crossx-card--sign-tx .__crossx-col-left,
|
|
6392
|
+
.__crossx-card--sign-msg .__crossx-col-left,
|
|
6393
|
+
.__crossx-card--sign-typed .__crossx-col-left,
|
|
6394
|
+
.__crossx-card--sign-tx .__crossx-col-right-sign { overflow-y: auto; }
|
|
6395
|
+
.__crossx-card--sign-tx .__crossx-col-right-sign .__crossx-rows { flex-shrink: 0; }
|
|
6396
|
+
.__crossx-card--sign-tx .__crossx-raw-tx { max-height: none; overflow-y: visible; }
|
|
6318
6397
|
.__crossx-card--sign-msg .__crossx-msg-raw,
|
|
6319
|
-
.__crossx-card--sign-msg .__crossx-msg-box { max-height:
|
|
6320
|
-
.__crossx-card--sign-typed .__crossx-td-rows { max-height:
|
|
6398
|
+
.__crossx-card--sign-msg .__crossx-msg-box { max-height: none; overflow-y: auto; }
|
|
6399
|
+
.__crossx-card--sign-typed .__crossx-td-rows { max-height: none; overflow-y: auto; }
|
|
6321
6400
|
.__crossx-col-left > .__crossx-divider { display: none; }
|
|
6322
6401
|
.__crossx-card--wallet-selector {
|
|
6323
6402
|
overflow: hidden !important;
|
|
@@ -6467,7 +6546,7 @@ const gn = `
|
|
|
6467
6546
|
.__crossx-pin6-header-sub {
|
|
6468
6547
|
font-size: 14px;
|
|
6469
6548
|
font-weight: 400;
|
|
6470
|
-
color:
|
|
6549
|
+
color: var(--cx-subtitle);
|
|
6471
6550
|
line-height: 1.3;
|
|
6472
6551
|
margin: 2px 0 0;
|
|
6473
6552
|
}
|
|
@@ -6482,7 +6561,7 @@ const gn = `
|
|
|
6482
6561
|
.__crossx-pin6-subtitle {
|
|
6483
6562
|
font-size: 16px;
|
|
6484
6563
|
font-weight: 500;
|
|
6485
|
-
color:
|
|
6564
|
+
color: var(--cx-label);
|
|
6486
6565
|
text-align: center;
|
|
6487
6566
|
margin: 0;
|
|
6488
6567
|
line-height: 1.5;
|
|
@@ -6501,11 +6580,11 @@ const gn = `
|
|
|
6501
6580
|
height: 48px;
|
|
6502
6581
|
border-radius: 12px;
|
|
6503
6582
|
border: none;
|
|
6504
|
-
background:
|
|
6583
|
+
background: var(--cx-input-bg);
|
|
6505
6584
|
font-size: 24px;
|
|
6506
6585
|
font-weight: 600;
|
|
6507
6586
|
text-align: center;
|
|
6508
|
-
color: var(--cx-
|
|
6587
|
+
color: var(--cx-value);
|
|
6509
6588
|
outline: none;
|
|
6510
6589
|
caret-color: transparent;
|
|
6511
6590
|
letter-spacing: 0;
|
|
@@ -6513,8 +6592,8 @@ const gn = `
|
|
|
6513
6592
|
transition: background 0.12s, box-shadow 0.12s;
|
|
6514
6593
|
}
|
|
6515
6594
|
.__crossx-pin6-box:focus {
|
|
6516
|
-
background:
|
|
6517
|
-
box-shadow: 0 0 0 2px var(--
|
|
6595
|
+
background: var(--cx-input-border);
|
|
6596
|
+
box-shadow: 0 0 0 2px var(--cx-primary-glow);
|
|
6518
6597
|
}
|
|
6519
6598
|
.__crossx-pin6-box.--error {
|
|
6520
6599
|
/* 에러 시 박스 자체에는 별도 스타일 없음 — 에러 텍스트로만 표시 */
|
|
@@ -6537,7 +6616,7 @@ const gn = `
|
|
|
6537
6616
|
.__crossx-pin6-error {
|
|
6538
6617
|
font-size: 14px;
|
|
6539
6618
|
font-weight: 400;
|
|
6540
|
-
color: var(--cx-error
|
|
6619
|
+
color: var(--cx-error);
|
|
6541
6620
|
text-align: center;
|
|
6542
6621
|
margin: 0;
|
|
6543
6622
|
min-height: 20px;
|
|
@@ -6551,20 +6630,20 @@ const gn = `
|
|
|
6551
6630
|
gap: 6px;
|
|
6552
6631
|
font-size: 13px;
|
|
6553
6632
|
font-weight: 500;
|
|
6554
|
-
color: var(--
|
|
6633
|
+
color: var(--cx-error);
|
|
6555
6634
|
text-align: center;
|
|
6556
6635
|
margin: 0;
|
|
6557
6636
|
}
|
|
6558
6637
|
.__crossx-pin6-lock-msg svg {
|
|
6559
6638
|
flex-shrink: 0;
|
|
6560
|
-
color: var(--
|
|
6639
|
+
color: var(--cx-error);
|
|
6561
6640
|
}
|
|
6562
6641
|
/* Next 버튼 */
|
|
6563
6642
|
.__crossx-pin6-next {
|
|
6564
6643
|
width: 100%;
|
|
6565
6644
|
padding: 16px;
|
|
6566
|
-
background: var(--
|
|
6567
|
-
color:
|
|
6645
|
+
background: var(--cx-primary);
|
|
6646
|
+
color: var(--cx-on-primary);
|
|
6568
6647
|
border: none;
|
|
6569
6648
|
border-radius: 12px;
|
|
6570
6649
|
font-size: 18px;
|
|
@@ -6674,7 +6753,7 @@ function yn(r) {
|
|
|
6674
6753
|
return null;
|
|
6675
6754
|
}
|
|
6676
6755
|
}
|
|
6677
|
-
function
|
|
6756
|
+
function Ns(r) {
|
|
6678
6757
|
const e = yn(r);
|
|
6679
6758
|
if (!e) return Y("Estimated fee", "<span>—</span>");
|
|
6680
6759
|
let s = Y("Est. Tx Fee", `<span>${e.estTxFee}</span>`);
|
|
@@ -6686,14 +6765,10 @@ const fe = `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="
|
|
|
6686
6765
|
</svg>`, ie = `<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round">
|
|
6687
6766
|
<line x1="18" y1="6" x2="6" y2="18"/>
|
|
6688
6767
|
<line x1="6" y1="6" x2="18" y2="18"/>
|
|
6689
|
-
</svg
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
|
|
6693
|
-
<path d="M14 7.5L19.2 10.5V16.5L14 19.5L8.8 16.5V10.5L14 7.5Z" fill="white" opacity="0.9"/>
|
|
6694
|
-
</svg>`;
|
|
6695
|
-
}
|
|
6696
|
-
const wt = `<svg width="20" height="20" viewBox="0 0 20 20" fill="none">
|
|
6768
|
+
</svg>`, bn = `<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6769
|
+
<circle cx="20" cy="20" r="20" fill="#00D5AA"/>
|
|
6770
|
+
<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"/>
|
|
6771
|
+
</svg>`, wt = `<svg width="20" height="20" viewBox="0 0 20 20" fill="none">
|
|
6697
6772
|
<rect x="2" y="5" width="16" height="12" rx="2" stroke="currentColor" stroke-width="1.5"/>
|
|
6698
6773
|
<path d="M2 9h16" stroke="currentColor" stroke-width="1.5"/>
|
|
6699
6774
|
<rect x="12.5" y="11.5" width="3.5" height="2.5" rx="0.75" fill="currentColor"/>
|
|
@@ -6738,8 +6813,8 @@ function Y(r, e) {
|
|
|
6738
6813
|
</div>`;
|
|
6739
6814
|
}
|
|
6740
6815
|
function In(r, e) {
|
|
6741
|
-
const s = e, t = Je(), n = r.to ? `<span class="__crossx-addr-text">${se(r.to)}</span>
|
|
6742
|
-
<button class="__crossx-copy-btn" data-copy="${U(r.to)}" title="Copy address">${fe}</button>` : "<span>—</span>", o =
|
|
6816
|
+
const s = e, t = Je(r.dappName), n = r.to ? `<span class="__crossx-addr-text">${se(r.to)}</span>
|
|
6817
|
+
<button class="__crossx-copy-btn" data-copy="${U(r.to)}" title="Copy address">${fe}</button>` : "<span>—</span>", o = Ns(r), i = r.data ?? "0x", a = document.createElement("div");
|
|
6743
6818
|
return a.id = te, a.innerHTML = `
|
|
6744
6819
|
<div class="__crossx-card __crossx-card--migration __crossx-card--sign-tx" style="${ce(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
6745
6820
|
<div class="__crossx-header">
|
|
@@ -6758,14 +6833,16 @@ function In(r, e) {
|
|
|
6758
6833
|
<span class="__crossx-addr-pill-text">${se(r.from)}</span>
|
|
6759
6834
|
</div>
|
|
6760
6835
|
<p class="__crossx-warning">After you sign, changes or cancellations are not possible.</p>
|
|
6761
|
-
|
|
6836
|
+
</div>
|
|
6837
|
+
<hr class="__crossx-divider __crossx-divider--cols">
|
|
6838
|
+
<div class="__crossx-col-right-sign">
|
|
6762
6839
|
<div class="__crossx-rows">
|
|
6763
6840
|
${Y("To", n)}
|
|
6764
6841
|
${Y("Network", `<span>${Ps(r.chainId)}</span>`)}
|
|
6765
6842
|
${o}
|
|
6766
6843
|
</div>
|
|
6844
|
+
<pre class="__crossx-raw-tx">${U(i)}</pre>
|
|
6767
6845
|
</div>
|
|
6768
|
-
<pre class="__crossx-raw-tx">${U(i)}</pre>
|
|
6769
6846
|
</div>
|
|
6770
6847
|
<div class="__crossx-btn-row">
|
|
6771
6848
|
<button class="__crossx-cancel-btn" id="__crossx-cancel-btn">Cancel</button>
|
|
@@ -6776,8 +6853,8 @@ function In(r, e) {
|
|
|
6776
6853
|
`, a;
|
|
6777
6854
|
}
|
|
6778
6855
|
function En(r, e) {
|
|
6779
|
-
const s = e, t = r.nativeSymbol ?? "ETH", n = r.nativeDecimals ?? 18, o = Je(), i = r.to ? `<span class="__crossx-addr-text">${se(r.to)}</span>
|
|
6780
|
-
<button class="__crossx-copy-btn" data-copy="${U(r.to)}" title="Copy address">${fe}</button>` : "<span>—</span>", a =
|
|
6856
|
+
const s = e, t = r.nativeSymbol ?? "ETH", n = r.nativeDecimals ?? 18, o = Je(r.dappName), i = r.to ? `<span class="__crossx-addr-text">${se(r.to)}</span>
|
|
6857
|
+
<button class="__crossx-copy-btn" data-copy="${U(r.to)}" title="Copy address">${fe}</button>` : "<span>—</span>", a = Ns(r), l = mn(r.value, t, n) ?? "—", d = document.createElement("div");
|
|
6781
6858
|
return d.id = te, d.innerHTML = `
|
|
6782
6859
|
<div class="__crossx-card __crossx-card--migration __crossx-card--send-tx" style="${ce(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
6783
6860
|
<div class="__crossx-header">
|
|
@@ -6805,10 +6882,11 @@ function En(r, e) {
|
|
|
6805
6882
|
</div>
|
|
6806
6883
|
`, d;
|
|
6807
6884
|
}
|
|
6808
|
-
function Je() {
|
|
6809
|
-
var
|
|
6885
|
+
function Je(r) {
|
|
6886
|
+
var e;
|
|
6887
|
+
if (r) return r;
|
|
6810
6888
|
try {
|
|
6811
|
-
return ((
|
|
6889
|
+
return ((e = window.location) == null ? void 0 : e.hostname) || "This site";
|
|
6812
6890
|
} catch {
|
|
6813
6891
|
return "This site";
|
|
6814
6892
|
}
|
|
@@ -6877,7 +6955,7 @@ function Pn(r, e) {
|
|
|
6877
6955
|
</div>
|
|
6878
6956
|
`, s;
|
|
6879
6957
|
}
|
|
6880
|
-
function
|
|
6958
|
+
function Nn(r, e, s) {
|
|
6881
6959
|
const t = e.status !== "reverted" && e.status !== "timeout", n = e.status === "timeout", o = r.querySelector("#__crossx-ttl"), i = r.querySelector(".__crossx-header");
|
|
6882
6960
|
if (o) {
|
|
6883
6961
|
const w = n ? Sn : t ? "" : vn, E = n ? "Transaction timeout" : t ? "Transaction complete" : "Transaction failed";
|
|
@@ -6916,8 +6994,8 @@ function Rn(r, e, s) {
|
|
|
6916
6994
|
});
|
|
6917
6995
|
});
|
|
6918
6996
|
}
|
|
6919
|
-
function
|
|
6920
|
-
const s = e, t = Je(), n = U(r.message), o = document.createElement("div");
|
|
6997
|
+
function Rn(r, e) {
|
|
6998
|
+
const s = e, t = Je(r.dappName), n = U(r.message), o = document.createElement("div");
|
|
6921
6999
|
return o.id = te, o.innerHTML = `
|
|
6922
7000
|
<div class="__crossx-card __crossx-card--migration __crossx-card--sign-msg" style="${ce(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
6923
7001
|
<div class="__crossx-header">
|
|
@@ -6949,7 +7027,7 @@ function Nn(r, e) {
|
|
|
6949
7027
|
`, o;
|
|
6950
7028
|
}
|
|
6951
7029
|
function Cn(r, e) {
|
|
6952
|
-
const s = e, t = Je();
|
|
7030
|
+
const s = e, t = Je(r.dappName);
|
|
6953
7031
|
let n = {};
|
|
6954
7032
|
if (typeof r.typedData == "string")
|
|
6955
7033
|
try {
|
|
@@ -7103,8 +7181,8 @@ function Bn(r) {
|
|
|
7103
7181
|
<p class="__crossx-mig-info-desc">It safely restores and integrates all your previous assets. Simply verify your PIN to get started.</p>
|
|
7104
7182
|
</div>
|
|
7105
7183
|
<button class="__crossx-recover-btn" id="__crossx-recover-btn">
|
|
7106
|
-
<span>${bn
|
|
7107
|
-
<span class="__crossx-recover-label">
|
|
7184
|
+
<span class="__crossx-recover-icon">${bn}</span>
|
|
7185
|
+
<span class="__crossx-recover-label">Import from Social Backup</span>
|
|
7108
7186
|
</button>
|
|
7109
7187
|
<button class="__crossx-skip-btn" id="__crossx-skip-btn">Skip for Now</button>
|
|
7110
7188
|
</div>
|
|
@@ -7116,7 +7194,7 @@ function Un(r, e) {
|
|
|
7116
7194
|
return h.id = te, h.innerHTML = `
|
|
7117
7195
|
<div class="__crossx-card __crossx-card--migration" style="${ce(s)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
7118
7196
|
<div class="__crossx-header">
|
|
7119
|
-
<p class="__crossx-title" id="__crossx-ttl">
|
|
7197
|
+
<p class="__crossx-title" id="__crossx-ttl">Import from Social Backup</p>
|
|
7120
7198
|
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${ie}</button>
|
|
7121
7199
|
</div>
|
|
7122
7200
|
<hr class="__crossx-divider">
|
|
@@ -7144,7 +7222,7 @@ function Fn(r, e, s) {
|
|
|
7144
7222
|
return a.id = te, a.innerHTML = `
|
|
7145
7223
|
<div class="__crossx-card __crossx-card--migration" style="${ce(t)}" role="dialog" aria-modal="true" aria-labelledby="__crossx-ttl">
|
|
7146
7224
|
<div class="__crossx-header">
|
|
7147
|
-
<p class="__crossx-title" id="__crossx-ttl">
|
|
7225
|
+
<p class="__crossx-title" id="__crossx-ttl">Import from Social Backup</p>
|
|
7148
7226
|
<button class="__crossx-close" id="__crossx-close-btn" aria-label="Close">${ie}</button>
|
|
7149
7227
|
</div>
|
|
7150
7228
|
<hr class="__crossx-divider">
|
|
@@ -7208,7 +7286,7 @@ function Gn(r) {
|
|
|
7208
7286
|
}
|
|
7209
7287
|
function nt(r) {
|
|
7210
7288
|
const e = !!r.lockExpiresAt && r.lockExpiresAt > Date.now(), s = r.lockExpiresAt ? ` data-lock-expires="${r.lockExpiresAt}"` : "", t = r.headerSubtitle ? `<p class="__crossx-pin6-header-sub">${U(r.headerSubtitle)}</p>` : "", n = r.subtitle ? `<p class="__crossx-pin6-subtitle">${U(r.subtitle)}</p>` : "", o = r.errorMessage ? `<p class="__crossx-pin6-error" id="__crossx-pin6-error">${U(r.errorMessage)}</p>` : '<p class="__crossx-pin6-error" id="__crossx-pin6-error"></p>', i = e ? `<p class="__crossx-pin6-lock-msg" id="__crossx-pin6-lock-msg">
|
|
7211
|
-
${
|
|
7289
|
+
${Rs}
|
|
7212
7290
|
<span id="__crossx-pin6-lock-countdown"></span>
|
|
7213
7291
|
</p>` : "", a = e ? " --locked" : "", c = Array.from(
|
|
7214
7292
|
{ length: 6 },
|
|
@@ -7263,8 +7341,8 @@ function ot(r, e, s, t, n, o) {
|
|
|
7263
7341
|
}, S = (v) => {
|
|
7264
7342
|
const P = d();
|
|
7265
7343
|
P && (P.textContent = v);
|
|
7266
|
-
const
|
|
7267
|
-
|
|
7344
|
+
const R = l();
|
|
7345
|
+
R == null || R.classList.add("--shake"), setTimeout(() => R == null ? void 0 : R.classList.remove("--shake"), 500), c().forEach((G) => {
|
|
7268
7346
|
G.value = "";
|
|
7269
7347
|
}), setTimeout(() => {
|
|
7270
7348
|
var G;
|
|
@@ -7278,19 +7356,19 @@ function ot(r, e, s, t, n, o) {
|
|
|
7278
7356
|
const P = d();
|
|
7279
7357
|
if (P && (P.textContent = "Too many failed attempts. Please wait."), !h()) {
|
|
7280
7358
|
const q = document.createElement("p");
|
|
7281
|
-
q.className = "__crossx-pin6-lock-msg", q.id = "__crossx-pin6-lock-msg", q.innerHTML = `${
|
|
7359
|
+
q.className = "__crossx-pin6-lock-msg", q.id = "__crossx-pin6-lock-msg", q.innerHTML = `${Rs}<span id="__crossx-pin6-lock-countdown"></span>`;
|
|
7282
7360
|
const D = d();
|
|
7283
7361
|
D ? D.insertAdjacentElement("afterend", q) : (W = x()) == null || W.appendChild(q);
|
|
7284
7362
|
}
|
|
7285
|
-
const
|
|
7363
|
+
const R = () => {
|
|
7286
7364
|
var k;
|
|
7287
7365
|
const q = v - Date.now(), D = m();
|
|
7288
7366
|
q <= 0 ? (clearInterval(G), E(!1), (k = h()) == null || k.remove(), P && (P.textContent = ""), setTimeout(() => {
|
|
7289
|
-
var
|
|
7290
|
-
return (
|
|
7367
|
+
var N;
|
|
7368
|
+
return (N = c()[0]) == null ? void 0 : N.focus();
|
|
7291
7369
|
}, 50)) : D && (D.textContent = ` ${qn(q)}`);
|
|
7292
|
-
}, G = setInterval(
|
|
7293
|
-
|
|
7370
|
+
}, G = setInterval(R, 1e3);
|
|
7371
|
+
R();
|
|
7294
7372
|
const K = new MutationObserver(() => {
|
|
7295
7373
|
document.contains(r) || (clearInterval(G), K.disconnect());
|
|
7296
7374
|
});
|
|
@@ -7323,22 +7401,22 @@ function ot(r, e, s, t, n, o) {
|
|
|
7323
7401
|
}, 100), c().forEach((v, P) => {
|
|
7324
7402
|
v.addEventListener("input", () => {
|
|
7325
7403
|
var G;
|
|
7326
|
-
const
|
|
7327
|
-
v.value =
|
|
7328
|
-
}), v.addEventListener("keydown", (
|
|
7404
|
+
const R = v.value.replace(/\D/g, "").slice(-1);
|
|
7405
|
+
v.value = R, y(), R && P < 5 && ((G = c()[P + 1]) == null || G.focus()), w().length === 6 && setTimeout(B, 80);
|
|
7406
|
+
}), v.addEventListener("keydown", (R) => {
|
|
7329
7407
|
var G, K;
|
|
7330
|
-
if (
|
|
7331
|
-
if (
|
|
7408
|
+
if (R.key === "Backspace") {
|
|
7409
|
+
if (R.preventDefault(), v.value)
|
|
7332
7410
|
v.value = "";
|
|
7333
7411
|
else if (P > 0) {
|
|
7334
7412
|
const W = c()[P - 1];
|
|
7335
7413
|
W.value = "", W.focus();
|
|
7336
7414
|
}
|
|
7337
|
-
} else
|
|
7338
|
-
}), v.addEventListener("paste", (
|
|
7415
|
+
} else R.key === "ArrowLeft" && P > 0 ? (R.preventDefault(), (G = c()[P - 1]) == null || G.focus()) : R.key === "ArrowRight" && P < 5 ? (R.preventDefault(), (K = c()[P + 1]) == null || K.focus()) : R.key === "Escape" && s();
|
|
7416
|
+
}), v.addEventListener("paste", (R) => {
|
|
7339
7417
|
var W, q;
|
|
7340
|
-
|
|
7341
|
-
const G = (((W =
|
|
7418
|
+
R.preventDefault();
|
|
7419
|
+
const G = (((W = R.clipboardData) == null ? void 0 : W.getData("text")) ?? "").replace(/\D/g, "").slice(0, 6);
|
|
7342
7420
|
if (!G) return;
|
|
7343
7421
|
const K = c();
|
|
7344
7422
|
G.split("").forEach((D, k) => {
|
|
@@ -7347,7 +7425,7 @@ function ot(r, e, s, t, n, o) {
|
|
|
7347
7425
|
}), v.addEventListener("focus", () => v.select());
|
|
7348
7426
|
});
|
|
7349
7427
|
}
|
|
7350
|
-
const
|
|
7428
|
+
const Rs = `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
7351
7429
|
<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"/>
|
|
7352
7430
|
</svg>`, Vn = `<svg width="11" height="9" viewBox="0 0 11 9" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
7353
7431
|
<path d="M1 4.5L4 7.5L10 1" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
@@ -7561,32 +7639,32 @@ class jn {
|
|
|
7561
7639
|
var q;
|
|
7562
7640
|
const O = Array.from(x.querySelectorAll(".__crossx-pw-notice-item")), B = x.querySelector("#__crossx-pin-notice-next"), v = /* @__PURE__ */ new Set();
|
|
7563
7641
|
B.removeAttribute("disabled");
|
|
7564
|
-
const P = B.dataset.nextLabel ?? "Next",
|
|
7642
|
+
const P = B.dataset.nextLabel ?? "Next", R = B.dataset.submitLabel ?? "I Understand", G = () => {
|
|
7565
7643
|
const D = v.size === O.length;
|
|
7566
|
-
B.classList.toggle("--disabled", !D), B.textContent = D ?
|
|
7644
|
+
B.classList.toggle("--disabled", !D), B.textContent = D ? R : P;
|
|
7567
7645
|
}, K = (D, k) => {
|
|
7568
7646
|
if (v.has(k)) return;
|
|
7569
|
-
const
|
|
7570
|
-
v.add(k),
|
|
7647
|
+
const N = D.querySelector(`#__crossx-notice-check-${k}`);
|
|
7648
|
+
v.add(k), N.classList.add("--checked"), D.setAttribute("aria-checked", "true"), G();
|
|
7571
7649
|
}, W = (D, k) => {
|
|
7572
7650
|
if (!v.has(k)) return;
|
|
7573
|
-
const
|
|
7574
|
-
v.delete(k),
|
|
7651
|
+
const N = D.querySelector(`#__crossx-notice-check-${k}`);
|
|
7652
|
+
v.delete(k), N.classList.remove("--checked"), D.setAttribute("aria-checked", "false"), G();
|
|
7575
7653
|
};
|
|
7576
7654
|
O.forEach((D) => {
|
|
7577
7655
|
const k = parseInt(D.dataset.checkIndex ?? "0", 10);
|
|
7578
7656
|
D.addEventListener("click", () => {
|
|
7579
7657
|
v.has(k) ? W(D, k) : K(D, k);
|
|
7580
|
-
}), D.addEventListener("keydown", (
|
|
7581
|
-
(
|
|
7658
|
+
}), D.addEventListener("keydown", (N) => {
|
|
7659
|
+
(N.key === " " || N.key === "Enter") && (N.preventDefault(), v.has(k) ? W(D, k) : K(D, k));
|
|
7582
7660
|
});
|
|
7583
7661
|
}), B.addEventListener("click", () => {
|
|
7584
7662
|
if (v.size === O.length) {
|
|
7585
7663
|
y(e == null ? void 0 : e.errorMessage);
|
|
7586
7664
|
return;
|
|
7587
7665
|
}
|
|
7588
|
-
const D = O.find((
|
|
7589
|
-
const f = parseInt(
|
|
7666
|
+
const D = O.find((N) => {
|
|
7667
|
+
const f = parseInt(N.dataset.checkIndex ?? "0", 10);
|
|
7590
7668
|
return !v.has(f);
|
|
7591
7669
|
});
|
|
7592
7670
|
if (!D) return;
|
|
@@ -7733,7 +7811,7 @@ class jn {
|
|
|
7733
7811
|
document.addEventListener("keydown", l);
|
|
7734
7812
|
};
|
|
7735
7813
|
s.then((l) => {
|
|
7736
|
-
i || (
|
|
7814
|
+
i || (Nn(n, l, this.tokens), c());
|
|
7737
7815
|
});
|
|
7738
7816
|
});
|
|
7739
7817
|
}
|
|
@@ -7742,7 +7820,7 @@ class jn {
|
|
|
7742
7820
|
var c, l, d;
|
|
7743
7821
|
ue();
|
|
7744
7822
|
let t;
|
|
7745
|
-
e.type === "sign-message" ? t =
|
|
7823
|
+
e.type === "sign-message" ? t = Rn(e, this.tokens) : e.type === "sign-typed-data" ? t = Cn(e, this.tokens) : e.type === "sign" ? t = In(e, this.tokens) : t = En(e, this.tokens), document.body.appendChild(t);
|
|
7746
7824
|
const n = () => t.remove(), o = () => {
|
|
7747
7825
|
n(), s(!0);
|
|
7748
7826
|
}, i = () => {
|
|
@@ -7793,7 +7871,7 @@ function Qn(r) {
|
|
|
7793
7871
|
}, t = {
|
|
7794
7872
|
gatewayUrl: e.walletGatewayUrl,
|
|
7795
7873
|
projectId: r.projectId
|
|
7796
|
-
}, o = s.authMode !== "cookie" &&
|
|
7874
|
+
}, o = s.authMode !== "cookie" && Nt.isAvailable() ? new Nt() : new sr(), i = new un(), a = new fn(), c = new we(), l = new Yn(), d = new Xt();
|
|
7797
7875
|
let h;
|
|
7798
7876
|
r.useMockWallet ? (u.log("[CROSSx] Mock Wallet Provider 사용"), h = new _n(o, d)) : (u.log("[CROSSx] Remote Wallet Provider 사용"), h = new Le(
|
|
7799
7877
|
t,
|