@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.
@@ -1,6 +1,16 @@
1
1
  import { OAuthPort, OAuthConfig, OAuthResult } from '../../core/ports';
2
2
 
3
3
  export declare class BrowserOAuthAdapter implements OAuthPort {
4
+ /**
5
+ * 진행 중인 openAuth 대기를 중단하기 위한 훅.
6
+ * openAuth가 시작되면 설정되고, 종료(성공/실패/취소)되면 null로 되돌린다.
7
+ */
8
+ private abortPending;
9
+ /**
10
+ * 외부 경로 인증이 들어와 대화형 OAuth 대기가 무의미해졌을 때 호출한다.
11
+ * 대기 중인 openAuth를 reject시켜 상위 connect() 흐름을 즉시 종료시킨다.
12
+ */
13
+ cancelPending(reason?: string): void;
4
14
  private static generateRandom16Hex;
5
15
  private static parseJwtPayload;
6
16
  private static sha256Hex;
@@ -8,6 +8,20 @@
8
8
  export type SDKEnvironment = 'production' | 'staging' | 'development';
9
9
  export interface CrossxConfigFile {
10
10
  environment?: SDKEnvironment;
11
+ /**
12
+ * 개별 엔드포인트 덮어쓰기 (내부 개발자 전용).
13
+ *
14
+ * `environment`로 고른 프리셋 위에 부분 적용된다. 로컬에서 OAuth 서비스나
15
+ * 게이트웨이를 직접 띄워 붙일 때 쓴다.
16
+ *
17
+ * SDKConfig/createCROSSxSDK 파라미터로는 절대 노출하지 않는다 —
18
+ * 엔드포인트 변경은 빌드 타임 crossx.config.json 경로로만 가능해야 한다
19
+ * (SDK_ENDPOINT_POLICY).
20
+ *
21
+ * @example crossx.config.json
22
+ * { "environment": "staging", "overrides": { "oauthServiceUrl": "http://localhost:2916" } }
23
+ */
24
+ overrides?: Partial<EnvironmentUrls>;
11
25
  }
12
26
  export interface EnvironmentUrls {
13
27
  oauthServiceUrl: string;
@@ -37,7 +37,7 @@ export declare const CHAIN_FALLBACK_RETRY_MS: number;
37
37
  */
38
38
  export declare const MNEMONIC_ADDRESS_LIMIT = 100;
39
39
  /** Token History API clientVersion (registerTokenHistory 호출 시 전송) */
40
- export declare const SDK_CLIENT_VERSION = "crossx-sdk-js/2.3.10-beta.3";
40
+ export declare const SDK_CLIENT_VERSION = "crossx-sdk-js/2.3.10-beta.5";
41
41
  /**
42
42
  * 사용자에게 노출되는 지갑 브랜드명 — 단일 소스(Single Source of Truth).
43
43
  *
@@ -8,6 +8,19 @@ export interface OAuthPort {
8
8
  * postMessage로 Firebase 토큰 및 사용자 정보를 수신하면 resolve합니다.
9
9
  */
10
10
  openAuth(config: OAuthConfig): Promise<OAuthResult>;
11
+ /**
12
+ * 진행 중인 `openAuth` 대기를 중단합니다. (선택 구현)
13
+ *
14
+ * 외부 경로(네이티브 앱의 JS injection → `signInWithOAuthToken`)로 인증이
15
+ * 들어오면 대화형 OAuth 시도는 의미를 잃는다. 그런데 그 대기가 계속 살아
16
+ * 있으면 `connect()`가 pending으로 남고, wagmi는 store 상태가 `connecting`인
17
+ * 동안 커넥터가 보내는 `connect` 이벤트를 무시하므로 로그인 성공이 UI에
18
+ * 반영되지 않는다(새로고침해야 복구됨).
19
+ *
20
+ * 그래서 외부 인증이 들어오는 순간 이 메서드로 대기를 끊어 `connect()`를
21
+ * 종료시킨다.
22
+ */
23
+ cancelPending?(reason?: string): void;
11
24
  }
12
25
  /**
13
26
  * OAuth 콜백 결과.
@@ -6,6 +6,18 @@ export interface AuthChangedEvent {
6
6
  isAuthenticated: boolean;
7
7
  address: string | null;
8
8
  userId: string | null;
9
+ /**
10
+ * 이 인증이 SDK **외부** 경로로 들어왔음을 뜻한다 — 네이티브 앱의 JS
11
+ * injection이 `signInWithOAuthToken()`을 직접 호출한 경우.
12
+ *
13
+ * 구독자(wagmi 커넥터)는 자기가 호출한 `signIn*`의 결과와 이 경우를 구분해야
14
+ * 한다. 전자는 호출의 반환값으로 계정을 받지만, 후자는 반환값이 갈 곳이 없어
15
+ * 이 이벤트가 유일한 전달 수단이다. 구분하지 않으면 진행 중인 로그인의 지갑
16
+ * 선택이 끝나기 전에 계정을 확정해 버릴 수 있다.
17
+ *
18
+ * 내부 경로(대화형 로그인·세션 복원·bridge)에서는 생략된다.
19
+ */
20
+ source?: 'external';
9
21
  }
10
22
  export interface AddressChangedEvent {
11
23
  address: string;