@dexterai/connect 0.25.2 → 0.26.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.
@@ -43,6 +43,41 @@ interface SignInResult {
43
43
  * challenge → passkey (the OS prompt) → verifying → finalizing (create only).
44
44
  */
45
45
  type CeremonyPhase = 'challenge' | 'passkey' | 'verifying' | 'finalizing';
46
+ /**
47
+ * Controls whether a successful sign-in/recovery immediately changes the
48
+ * browser's active-wallet store.
49
+ *
50
+ * `commit` preserves the historical SDK behavior. `provisional` returns the
51
+ * verified session/vault without writing either the active handle or wallet
52
+ * roster, so a caller can finish an account-level approval first and then
53
+ * explicitly commit the approved wallet with `setActiveHandle`.
54
+ */
55
+ type WalletStoreMode = 'commit' | 'provisional';
56
+ /** Exact action the hosted Dexter consent window is being asked to perform. */
57
+ type CeremonyOperation = 'signin' | 'create' | 'continue' | 'recover' | 'sign';
58
+ /** Minimal vault identity transferred to Dexter's hosted signing window. */
59
+ interface HostedSignVaultIdentity {
60
+ vaultPda: string;
61
+ publicKey: string;
62
+ userHandle: string;
63
+ credentialId: string;
64
+ walletLabel?: string | null;
65
+ }
66
+ /**
67
+ * Sensitive signing input. This is structured-cloned to the pinned Dexter
68
+ * popup only after the browser-stamped hello/ack; it is never serialized into
69
+ * the popup URL.
70
+ */
71
+ interface HostedSignRequestPayload {
72
+ operationMessage: Uint8Array;
73
+ vault: HostedSignVaultIdentity;
74
+ }
75
+ /** On-chain-ready assertion bytes returned by the hosted Dexter popup. */
76
+ interface HostedSignResult {
77
+ signature: Uint8Array;
78
+ clientDataJSON: Uint8Array;
79
+ authenticatorData: Uint8Array;
80
+ }
46
81
  /**
47
82
  * Vault identity on the wallet-only recover leg, as reported by
48
83
  * /api/passkey-vault-anon/status. Narrower than ConnectVault on purpose —
@@ -82,10 +117,25 @@ interface RecoverWalletConfig extends DexterConnectConfig {
82
117
  * discoverable passkey (no empty account-picker sheet). Falls back to the
83
118
  * normal modal wherever unsupported. */
84
119
  preferImmediate?: boolean;
120
+ /** See `PasskeyLoginConfig.walletStore`. */
121
+ walletStore?: WalletStoreMode;
85
122
  onPhase?: (phase: CeremonyPhase) => void;
86
123
  }
124
+ /** Configuration for `passkeyLogin`. */
125
+ interface PasskeyLoginConfig extends DexterConnectConfig {
126
+ /**
127
+ * Wallet-store behavior after a successful passkey ceremony. Defaults to
128
+ * `commit` for backward compatibility. Use `provisional` when the returned
129
+ * wallet must pass a separate approval before becoming active.
130
+ */
131
+ walletStore?: WalletStoreMode;
132
+ }
87
133
  interface DexterConnectConfig {
88
- /** dexter-api base. Default https://api.dexter.cash. */
134
+ /**
135
+ * Compatibility-only Dexter API base. Omit it or pass exactly
136
+ * https://api.dexter.cash. Noncanonical values fail before WebAuthn and this
137
+ * value is never propagated into the hosted popup.
138
+ */
89
139
  apiBase?: string;
90
140
  /**
91
141
  * Where the WebAuthn ceremony runs:
@@ -172,7 +222,7 @@ declare function createWallet(config?: CreateWalletConfig): Promise<CreateWallet
172
222
  * Relays to dexter-api's ANON router — a first-time third-party user has no
173
223
  * Supabase session, so the Supabase-gated router would 401.
174
224
  */
175
- declare function passkeyLogin(config?: DexterConnectConfig, onPhase?: (phase: CeremonyPhase) => void): Promise<SignInResult>;
225
+ declare function passkeyLogin(config?: PasskeyLoginConfig, onPhase?: (phase: CeremonyPhase) => void): Promise<SignInResult>;
176
226
  type ContinueResult = ({
177
227
  kind: 'signin';
178
228
  } & SignInResult) | ({
@@ -322,4 +372,4 @@ declare function syncAcceptedPasskeys(args: {
322
372
  rpId?: string;
323
373
  }): Promise<boolean>;
324
374
 
325
- export { ACTIVE_WALLET_STORAGE_KEY as A, setActiveHandle as B, type ConnectVault as C, type DexterConnectConfig as D, subscribe as E, switchWallet as F, syncAcceptedPasskeys as G, usdToAtomic as H, type IdentityKind as I, type PasskeyLoginTokens as P, type RecoverWalletConfig as R, SESSION_TTL_30D as S, type RecoverOutcome as a, type CeremonyPhase as b, ConnectError as c, type ContinueResult as d, type CreateWalletConfig as e, type CreateWalletResult as f, type IdentityInput as g, type PasskeySignalSupport as h, type RecoverVault as i, type ResolvedIdentity as j, type SignInResult as k, type SpendPolicy as l, type StoredWallet as m, authoredPolicy as n, continueWithDexter as o, createWallet as p, ejectActiveWallet as q, forgetWallet as r, getActiveHandle as s, getCredentialId as t, listWallets as u, passkeyLogin as v, passkeySignalSupport as w, prunePasskey as x, renamePasskey as y, resolveIdentity as z };
375
+ export { ACTIVE_WALLET_STORAGE_KEY as A, passkeySignalSupport as B, type ConnectVault as C, type DexterConnectConfig as D, prunePasskey as E, renamePasskey as F, resolveIdentity as G, type HostedSignRequestPayload as H, type IdentityKind as I, setActiveHandle as J, subscribe as K, switchWallet as L, syncAcceptedPasskeys as M, usdToAtomic as N, type PasskeyLoginConfig as P, type RecoverWalletConfig as R, SESSION_TTL_30D as S, type WalletStoreMode as W, type RecoverOutcome as a, type CeremonyPhase as b, type CeremonyOperation as c, ConnectError as d, type ContinueResult as e, type CreateWalletConfig as f, type CreateWalletResult as g, type HostedSignResult as h, type HostedSignVaultIdentity as i, type IdentityInput as j, type PasskeyLoginTokens as k, type PasskeySignalSupport as l, type RecoverVault as m, type ResolvedIdentity as n, type SignInResult as o, type SpendPolicy as p, type StoredWallet as q, authoredPolicy as r, continueWithDexter as s, createWallet as t, ejectActiveWallet as u, forgetWallet as v, getActiveHandle as w, getCredentialId as x, listWallets as y, passkeyLogin as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dexterai/connect",
3
- "version": "0.25.2",
3
+ "version": "0.26.3",
4
4
  "description": "Sign in with Dexter — passkey connector. Composes @dexterai/vault.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -30,7 +30,7 @@
30
30
  "typecheck": "tsc --noEmit"
31
31
  },
32
32
  "peerDependencies": {
33
- "@dexterai/vault": ">=0.30.0",
33
+ "@dexterai/vault": "^0.43.0",
34
34
  "@solana/web3.js": "^1.98.0",
35
35
  "@worldcoin/idkit": "^4.1.8",
36
36
  "react": ">=18"
@@ -44,7 +44,7 @@
44
44
  }
45
45
  },
46
46
  "devDependencies": {
47
- "@dexterai/vault": "^0.37.0",
47
+ "@dexterai/vault": "0.43.0",
48
48
  "@solana/web3.js": "^1.98.4",
49
49
  "@types/react": "^19.1.12",
50
50
  "@types/react-dom": "^19.2.3",