@nexus-cross/crossx-sdk-core 3.0.0-beta.8 → 3.0.0-beta.9

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.
@@ -754,6 +754,15 @@ export declare class CROSSxSDK extends TypedEventEmitter<SDKEventMap> {
754
754
  * await sdk.signMessage(chainId, message);
755
755
  */
756
756
  isPinRequired(): boolean;
757
+ /**
758
+ * PIN 변경 화면을 띄워 PIN 을 바꿉니다 (GASPQA-6804). 현재 PIN 확인 → 새 PIN 설정 · 재입력 → 지갑 서버 변경.
759
+ * PIN 을 인자로 받지 않으므로 보안 화면(대리 SDK)으로 내보내도 서비스 페이지가 PIN 을 보지 못합니다.
760
+ * 지금은 one-wallet 지갑 서버에서만 됩니다.
761
+ *
762
+ * @throws `PIN_CANCELLED` 사용자가 닫음(일시 잠금 안내를 보고 닫은 경우 포함) · `PIN_LOCKED` 영구 잠금 또는 변경 단계 잠금 ·
763
+ * `WALLET_OPERATION_UNSUPPORTED` 2.x 게이트웨이 · RN 브리지
764
+ */
765
+ changePinWithPrompt(): Promise<void>;
757
766
  /**
758
767
  * PIN을 변경합니다.
759
768
  *
@@ -1,10 +1,18 @@
1
- import { SDKLocale } from '../../core/i18n';
1
+ import { resolveMessages, SDKLocale } from '../../core/i18n';
2
2
  import { ConfirmationPort } from '../../core/ports/ConfirmationPort';
3
3
  import { WalletProviderPort } from '../../core/ports/WalletProviderPort';
4
4
  import { PinMemoryStore } from '../../core/services/PinMemoryStore';
5
5
  import { PinReusePolicy, PinSigningRequest } from '../../core/services/PinReusePolicy';
6
6
  import { AuthResult } from '../../core/types';
7
+ import { CROSSxError } from '../../core/types/errors';
7
8
 
9
+ type PinLockedResult = {
10
+ ok: false;
11
+ error: string;
12
+ lockExpiresAt?: number;
13
+ attemptCount?: number;
14
+ maxAttempts?: number;
15
+ };
8
16
  type PinOrchestratorDeps = {
9
17
  confirmation: ConfirmationPort;
10
18
  walletProvider: WalletProviderPort;
@@ -38,6 +46,22 @@ export declare class PinOrchestrator {
38
46
  hasReusePolicy(): boolean;
39
47
  ensurePinSetup(): Promise<void>;
40
48
  ensurePinForSigning(errorMessage?: string): Promise<void>;
49
+ /**
50
+ * PIN 변경 화면 흐름 (GASPQA-6804) — PIN 은 이 SDK(보안 화면) 밖으로 나가지 않는다.
51
+ * 1) 현재 PIN 입력: 지갑 서버로 확인하며, 틀리면 같은 화면에 오류 · 연속 오입력 횟수, 잠금이면 잠금 안내
52
+ * 2) 새 PIN 설정 · 재입력 (안내 동의 단계 없음). 지금 PIN 과 같으면 다시 받는다
53
+ * 3) 지갑 서버에 변경. 메모리에 둔 PIN 은 결과와 상관없이 지운다 — 다음 서명 때 PIN 을 한 번 묻는다
54
+ * @throws `WALLET_OPERATION_UNSUPPORTED` 지원하지 않는 지갑 서버 · RN 브리지 · `PIN_CANCELLED` 사용자가 닫음 ·
55
+ * `PIN_LOCKED` 영구 잠금(현재 PIN 확인 때) 또는 변경 단계 잠금 · 그 밖의 지갑 서버 오류
56
+ */
57
+ changePinWithPrompt(): Promise<void>;
58
+ /**
59
+ * PIN 변경의 현재 PIN 확인 오류 → 입력 화면 결과 (UID 11.17).
60
+ * 지갑 서버는 다음 잠금까지 남은 횟수만 주고 단계 크기(`max_attempts`)는 주지 않는다. 그래서 남은 횟수가 1~4 면
61
+ * `(5 - 남은)/5` 로 보인다 — "남은 횟수"는 언제나 맞고, 단계가 5회가 아닐 때(예시 설정의 10 → 20 단계)는 분모만 다르다.
62
+ * 서버가 `max_attempts` 를 주면 그 값으로 바꾼다. 영구 잠금은 화면에 두지 않고 `null` → 오류로 끝낸다.
63
+ */
64
+ static pinChangeErrorResult(err: CROSSxError, msgs: ReturnType<typeof resolveMessages>): PinLockedResult | null;
41
65
  ensureVerifiedPin(initialErrorMessage?: string, lockExpiresAt?: number, attemptCount?: number, maxAttempts?: number): Promise<void>;
42
66
  withPinRetry<T>(fn: () => Promise<T>): Promise<T>;
43
67
  private static parsePinError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexus-cross/crossx-sdk-core",
3
- "version": "3.0.0-beta.8",
3
+ "version": "3.0.0-beta.9",
4
4
  "description": "CROSSx Core SDK - Vanilla JavaScript Embedded Wallet SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",