@bluxcc/core 0.3.2 → 0.3.4

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,9 +1,2 @@
1
- export type PasskeyFlowResult = {
2
- step: 'login';
3
- credential: PublicKeyCredential;
4
- } | {
5
- step: 'register';
6
- credential: PublicKeyCredential;
7
- };
8
1
  declare const PasskeyOnboardingPage: () => import("react/jsx-runtime").JSX.Element;
9
2
  export default PasskeyOnboardingPage;
@@ -1,4 +1,12 @@
1
1
  import { IWallet } from '../../types';
2
- import { IStore } from '../../store';
3
- declare const connectWalletProcess: (store: IStore, wallet: IWallet) => Promise<void>;
2
+ import { IStore, IUser } from '../../store';
3
+ export type ConnectWalletProcessOptions = {
4
+ /**
5
+ * Skip Blux waiting/success/failed screens and persist the session as soon
6
+ * as the wallet returns a signed challenge. Wallet extension / hardware
7
+ * prompts still appear.
8
+ */
9
+ headless?: boolean;
10
+ };
11
+ declare const connectWalletProcess: (store: IStore, wallet: IWallet, options?: ConnectWalletProcessOptions) => Promise<IUser | void>;
4
12
  export default connectWalletProcess;
@@ -0,0 +1,8 @@
1
+ import { IUser } from '../../store';
2
+ /**
3
+ * Loads the user for a freshly issued session JWT and writes them into the
4
+ * store without persisting the session. Callers then either show the terms /
5
+ * success UI ({@link continueLoginProcess}) or persist immediately
6
+ * ({@link completeLoginProcess}) for headless / whitelabel logins.
7
+ */
8
+ export declare const hydrateUserFromJwt: (jwt: string, authMethod: string, authValue?: string) => Promise<IUser>;
package/dist/store.d.ts CHANGED
@@ -67,6 +67,11 @@ export interface IStoreProperties {
67
67
  };
68
68
  };
69
69
  showAllWallets: boolean;
70
+ /**
71
+ * When true, onboarding shows only the scrollable wallet list (no email /
72
+ * SMS / social / passkey). Set by loginWallet() with no wallet name.
73
+ */
74
+ walletOnlyOnboarding: boolean;
70
75
  waitingStatus: WaitingStatus;
71
76
  wallets: IWallet[];
72
77
  stellar?: IStellarConfig;
@@ -98,10 +103,13 @@ export interface IStoreMethods {
98
103
  connectWalletSuccessful: (publicKey: string, passphrase: string) => void;
99
104
  closeModal: () => void;
100
105
  logoutAction: () => void;
101
- openModal: (route: Route) => void;
106
+ openModal: (route: Route, options?: {
107
+ walletOnly?: boolean;
108
+ }) => void;
102
109
  setConfig: (config: IInternalConfig) => void;
103
110
  setIsReady: (isReady: boolean) => void;
104
111
  setShowAllWallets: (showAllWallets: boolean) => void;
112
+ setWalletOnlyOnboarding: (walletOnlyOnboarding: boolean) => void;
105
113
  setRoute: (route: Route) => void;
106
114
  setSendTransaction: (sendTransaction: ISendTransaction, isOpen: boolean, route?: Route) => void;
107
115
  setSignMessage: (messageDetails: ISignMessage, isOpen: boolean, route?: Route) => void;
package/dist/types.d.ts CHANGED
@@ -58,7 +58,13 @@ export interface IConfig {
58
58
  explorer?: IExplorer;
59
59
  /** Persist the session across page reloads. Defaults to `false` and should remain `false` in most scenarios. */
60
60
  isPersistent?: boolean;
61
- /** Show Blux's built-in signing/approval UIs. When `false`, signing happens headlessly. Defaults to `true`. */
61
+ /**
62
+ * Show Blux's built-in signing/approval UIs. When `false`, signing happens
63
+ * headlessly so you can render your own confirmation UI. Login is independent:
64
+ * `login()` still opens the Blux modal, while `loginEmail` / `loginSms` /
65
+ * `loginOAuth` / `loginPasskey` / `loginWallet(name)` never do (WalletConnect
66
+ * still uses the Blux QR). Defaults to `true`.
67
+ */
62
68
  showWalletUIs?: boolean;
63
69
  /** Login methods to offer. Defaults to `['wallet']`. `'sms'` is shown only when `/auth/validate` reports a paid plan. */
64
70
  loginMethods?: Array<ILoginMethods[number] | LooseString>;
@@ -1,6 +1,6 @@
1
1
  import { IUser } from '../store';
2
2
  import { AuthenticateApiResponse, WalletProofType } from '../types';
3
- import { PasskeyFlowResult } from '../pages/Onboarding/Passkey';
3
+ import type { PasskeyFlowResult } from './passkey';
4
4
  type ApiPasskeyChallenge = {
5
5
  user_id: string;
6
6
  challenge: string;
@@ -0,0 +1,14 @@
1
+ export type PasskeyFlowResult = {
2
+ step: 'login';
3
+ credential: PublicKeyCredential;
4
+ } | {
5
+ step: 'register';
6
+ credential: PublicKeyCredential;
7
+ };
8
+ export declare function ensurePasskeySupport(): Promise<void>;
9
+ export declare function runPasskeyCeremony(challenge: string, userId: string, mode: 'login' | 'register', credentialId?: string): Promise<PasskeyFlowResult>;
10
+ /**
11
+ * Runs the full passkey register-or-login ceremony and returns a session JWT.
12
+ * Does not persist the session; the caller hydrates the user and completes login.
13
+ */
14
+ export declare function authenticateWithPasskey(appId: string): Promise<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bluxcc/core",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "homepage": "https://blux.cc",
5
5
  "description": "Blux is a wallet infra for the Stellar network",
6
6
  "type": "module",