@dexterai/connect 0.26.4 → 0.29.1
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/README.md +201 -191
- package/dist/chunk-2BTS6DCR.js +618 -0
- package/dist/chunk-CZL7NGVV.js +1346 -0
- package/dist/chunk-EMCGL64H.js +59 -0
- package/dist/chunk-LHYU2EZQ.js +183 -0
- package/dist/{chunk-TLCQSAE5.js → chunk-T62F36N2.js} +2 -2
- package/dist/connectionContract-CR478cfF.d.ts +228 -0
- package/dist/enroll-DrgEW0X8.d.ts +245 -0
- package/dist/hosted.d.ts +72 -0
- package/dist/hosted.js +95 -0
- package/dist/index.d.ts +436 -10
- package/dist/index.js +655 -44
- package/dist/react.d.ts +71 -191
- package/dist/react.js +557 -494
- package/dist/server.d.ts +2 -1
- package/dist/server.js +80 -5
- package/dist/worldid.d.ts +2 -4
- package/dist/worldid.js +1 -1
- package/package.json +7 -2
- package/dist/chunk-H3NXC4S5.js +0 -1136
- package/dist/signals-dIHYwlPh.d.ts +0 -383
package/dist/react.d.ts
CHANGED
|
@@ -1,118 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { g as ConnectError, S as SignInResult, o as PasskeyLoginConfig, C as CreateWalletResult, A as AgentDelegationMode } from './enroll-DrgEW0X8.js';
|
|
2
|
+
export { c as ConnectVault, R as RecoverOutcome, k as RecoverVault, e as WalletIdentityProof } from './enroll-DrgEW0X8.js';
|
|
3
|
+
import { a as WalletAccountRelationSnapshot, i as DexterControlModel, g as DexterConnectionIntent, e as AccountSessionInstaller, d as AccountSessionClearer, B as BindingFetch } from './connectionContract-CR478cfF.js';
|
|
4
|
+
export { D as DexterConnectionCapability, h as DexterConnectionPermissions, j as DexterControlPrimaryAction, k as DexterControlStage } from './connectionContract-CR478cfF.js';
|
|
5
|
+
import { ButtonHTMLAttributes, ReactNode, ReactElement } from 'react';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
interface UseSignInWithDexterConfig {
|
|
8
|
-
/** Compatibility-only: omitted or exactly https://api.dexter.cash. */
|
|
9
|
-
apiBase?: string;
|
|
10
|
-
/** RPC for the connected-chip balance read. Default: Dexter's Helius proxy. */
|
|
11
|
-
rpcUrl?: string;
|
|
12
|
-
/** Ceremony transport (both verbs). 'auto' (default) = inline on dexter.cash,
|
|
13
|
-
* popup anywhere else. Exposed so tests/staging can force a leg —
|
|
14
|
-
* CreateWalletPanel already had this knob; the sign-in surface was the odd
|
|
15
|
-
* one out. */
|
|
16
|
-
transport?: 'auto' | 'popup' | 'inline';
|
|
17
|
-
/** Hosted ceremony page for the popup transport. Default dexter.cash/connect. */
|
|
18
|
-
connectHost?: string;
|
|
19
|
-
/** Chrome-149+ immediate UI mode for the wallet-only verb: instant fast-fail
|
|
20
|
-
* when this device holds no passkey. Ignored by signIn(). */
|
|
21
|
-
preferImmediate?: boolean;
|
|
22
|
-
}
|
|
23
|
-
interface UseSignInWithDexter {
|
|
24
|
-
status: ConnectStatus;
|
|
25
|
-
/** Live ceremony phase while status==='pending' (challenge → passkey →
|
|
26
|
-
* verifying); null otherwise. Drives the button's "connecting steps". */
|
|
27
|
-
phase: CeremonyPhase | null;
|
|
28
|
-
isVaultConnected: boolean;
|
|
29
|
-
/** Run the ceremony. Resolves with the result; throws ConnectError on failure
|
|
30
|
-
* (error is also captured in `error` + `status==='error'` for declarative UI). */
|
|
31
|
-
signIn: () => Promise<SignInResult>;
|
|
32
|
-
/** Wallet-only sign-in (P0c): re-points this browser at an existing wallet,
|
|
33
|
-
* mints NO session. Returns a discriminated outcome — cancel is a normal
|
|
34
|
-
* result, never a throw. Identity surfaces (useIdentity/useDexterWallet)
|
|
35
|
-
* light up via the wallet store; `session`/`vault` here stay null. Fire on
|
|
36
|
-
* tap only — never on mount (iOS gesture rule). */
|
|
37
|
-
recover: () => Promise<RecoverOutcome>;
|
|
38
|
-
/** One-button register-or-sign-in (keychain-first; see continueWithDexter).
|
|
39
|
-
* Terminal kinds update session/vault state; needs_create / needs_choice /
|
|
40
|
-
* cancelled return with status back at idle for the caller to route. */
|
|
41
|
-
continueWith: () => Promise<ContinueResult>;
|
|
42
|
-
/** Last recover outcome; null until recover() settles. */
|
|
43
|
-
recovered: RecoverOutcome | null;
|
|
44
|
-
disconnect: () => void;
|
|
45
|
-
session: PasskeyLoginTokens | null;
|
|
46
|
-
vault: ConnectVault | null;
|
|
47
|
-
/** Dexter Wallet address (swigAddress, base58). */
|
|
48
|
-
vaultAddress: string | null;
|
|
49
|
-
vaultPda: string | null;
|
|
50
|
-
credentialId: string | null;
|
|
51
|
-
/** Guest passkey signer for authorizing spends / opening x402 tabs. null until
|
|
52
|
-
* a vault is connected. Drive it via `passkeySigner.signOperation(op)`. */
|
|
53
|
-
passkeySigner: PasskeySignerWithPublicKey | null;
|
|
54
|
-
/** USD available. number once read; null = unknown → chip shows wallet only. */
|
|
55
|
-
usdcBalance: number | null;
|
|
56
|
-
refreshBalance: () => Promise<void>;
|
|
57
|
-
error: ConnectError | null;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* "Sign in with Dexter" — React surface over the login ceremony.
|
|
61
|
-
*
|
|
62
|
-
* Returns the Supabase session (always) plus the vault identity + USD balance
|
|
63
|
-
* (vault-review's login payload is live). dexter.cash login needs only
|
|
64
|
-
* `session`; the vault fields + balance drive the connected chip. The
|
|
65
|
-
* passkeySigner (for opening x402 tabs — dexter-agents) lands next, on the
|
|
66
|
-
* anon ServerPolicy bridge over the now-live publicKey/credentialId.
|
|
67
|
-
*/
|
|
68
|
-
declare function useSignInWithDexter(config?: UseSignInWithDexterConfig): UseSignInWithDexter;
|
|
69
|
-
|
|
70
|
-
interface SignInWithDexterProps extends UseSignInWithDexterConfig {
|
|
71
|
-
/** 'signin' (default) = full sign-in minting the account session.
|
|
72
|
-
* 'recover' = wallet-only: re-points this browser at an existing wallet and
|
|
73
|
-
* mints NOTHING else (the wallet IS the sign-in). After a successful
|
|
74
|
-
* recover the element renders null — identity display belongs to
|
|
75
|
-
* DexterWalletChip/useIdentity, which light up via the wallet store.
|
|
76
|
-
* 'continue' = the one-button register-or-sign-in (keychain-first): the
|
|
77
|
-
* hosted popup decides sign-in vs create; every settled outcome fires
|
|
78
|
-
* onContinue. */
|
|
79
|
-
mode?: 'signin' | 'recover' | 'continue';
|
|
80
|
-
/** Fired with the result the moment sign-in completes. */
|
|
81
|
-
onSuccess?: (result: SignInResult) => void;
|
|
82
|
-
/** Recover mode: fired with EVERY settled outcome (ok, no_credential,
|
|
83
|
-
* cancelled, error) — the single channel; onError is not used in this mode.
|
|
84
|
-
* Branch on `reason`: no_credential → offer create; cancelled → stay silent. */
|
|
85
|
-
onRecovered?: (outcome: RecoverOutcome) => void;
|
|
86
|
-
/** Continue mode: fired with EVERY settled ContinueResult (signin, create,
|
|
87
|
-
* needs_create, needs_choice, cancelled) — the single channel for routing.
|
|
88
|
-
* Real ceremony failures still go to onError. */
|
|
89
|
-
onContinue?: (result: ContinueResult) => void;
|
|
90
|
-
/** Fired with the typed error if the ceremony fails. */
|
|
91
|
-
onError?: (error: ConnectError) => void;
|
|
92
|
-
/** Button label when signed out. Default "Sign in with Dexter". */
|
|
93
|
-
label?: string;
|
|
94
|
-
/** 'primary' = filled ember (default), 'secondary' = outline. */
|
|
95
|
-
variant?: 'primary' | 'secondary';
|
|
96
|
-
/** Full-width button. */
|
|
97
|
-
block?: boolean;
|
|
98
|
-
/** 'md' (default) or 'sm' — the mini header variant of the button. */
|
|
99
|
-
size?: 'md' | 'sm';
|
|
100
|
-
/** Extra className composed after the brand classes. Prefer overriding the
|
|
101
|
-
* `--dx-*` CSS variables for theming. */
|
|
102
|
-
className?: string;
|
|
103
|
-
/** Render the built-in connected chip (wallet + balance). Default true. */
|
|
104
|
-
showConnectedChip?: boolean;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Turnkey "Sign in with Dexter" element. Signed out → the branded DexterButton
|
|
108
|
-
* (hover / focus / active / loading states, themeable via --dx-* CSS vars);
|
|
109
|
-
* signed in → a compact chip with the Dexter Wallet address + USD available.
|
|
110
|
-
* Wraps useSignInWithDexter; for the wallet CREATE flow use <DexterButton>
|
|
111
|
-
* wired to your create action. Brand voice: no emojis, "unlock" banned.
|
|
112
|
-
*/
|
|
113
|
-
declare function SignInWithDexter(props: SignInWithDexterProps): ReactElement | null;
|
|
114
|
-
|
|
115
|
-
/** The Dexter passkey mark — the brand glyph carried on the branded button. */
|
|
7
|
+
/** The Dexter passkey mark carried on the branded button. */
|
|
116
8
|
declare function DexterMark(): ReactElement;
|
|
117
9
|
interface DexterButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'onClick' | 'disabled' | 'className' | 'type'> {
|
|
118
10
|
/** Button content (e.g. "Sign in with Dexter", "Create your Dexter Wallet"). */
|
|
@@ -128,7 +20,7 @@ interface DexterButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
128
20
|
block?: boolean;
|
|
129
21
|
/** 'md' (default) = the standard CTA. 'sm' = the mini header/chip-row
|
|
130
22
|
* variant: tighter padding, smaller type and mark. Same states, same
|
|
131
|
-
* theming
|
|
23
|
+
* theming. Never hand-shrink the md button with a className. */
|
|
132
24
|
size?: 'md' | 'sm';
|
|
133
25
|
/** Render the Dexter mark before the children. Default true. */
|
|
134
26
|
withMark?: boolean;
|
|
@@ -141,85 +33,68 @@ interface DexterButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>
|
|
|
141
33
|
/** The branded Dexter button. Wire it to any action via `onClick`. */
|
|
142
34
|
declare function DexterButton(props: DexterButtonProps): ReactElement;
|
|
143
35
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
wallets: StoredWallet[];
|
|
153
|
-
/** What the WebAuthn Signal API supports in THIS browser (rename / prune). */
|
|
154
|
-
support: PasskeySignalSupport;
|
|
155
|
-
/**
|
|
156
|
-
* Eject the active wallet — "switch / start fresh". Clears the local binding
|
|
157
|
-
* and, where supported, prunes the old passkey from the OS manager so it
|
|
158
|
-
* disappears from the user's list. `{ forget: true }` also drops it from the
|
|
159
|
-
* roster.
|
|
160
|
-
*/
|
|
161
|
-
eject: (opts?: {
|
|
162
|
-
forget?: boolean;
|
|
163
|
-
}) => void;
|
|
164
|
-
/** Switch the active wallet to a known handle. No-op if unknown. */
|
|
165
|
-
switchTo: (handle: string) => boolean;
|
|
166
|
-
/** Record/activate a handle (after enroll or recover). Prefer over writing
|
|
167
|
-
* localStorage by hand so the roster + subscribers stay correct. */
|
|
168
|
-
setActive: (handle: string, label?: string, credentialId?: string) => void;
|
|
169
|
-
/**
|
|
170
|
-
* Rename the ACTIVE passkey in the OS keychain (post-creation). Returns true
|
|
171
|
-
* if the browser supported it and the signal fired; false otherwise (the
|
|
172
|
-
* keychain entry is then just left as-is).
|
|
173
|
-
*/
|
|
174
|
-
rename: (name: string, displayName?: string) => Promise<boolean>;
|
|
175
|
-
}
|
|
176
|
-
declare function useDexterWallet(): UseDexterWallet;
|
|
36
|
+
type DexterAccountSession = {
|
|
37
|
+
readonly status: 'loading';
|
|
38
|
+
} | {
|
|
39
|
+
readonly status: 'signed_out';
|
|
40
|
+
} | {
|
|
41
|
+
readonly status: 'authenticated';
|
|
42
|
+
readonly accessToken: string;
|
|
43
|
+
};
|
|
177
44
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
avatarUrl?: string | null;
|
|
185
|
-
/** Single-character avatar fallback (defaults to the first letter of `label`). */
|
|
186
|
-
avatarInitial?: string;
|
|
187
|
-
onClick?: () => void;
|
|
188
|
-
/** Extra className composed after the brand classes. */
|
|
189
|
-
className?: string;
|
|
190
|
-
/** Reflected to aria-expanded (when the chip toggles a menu). */
|
|
191
|
-
ariaExpanded?: boolean;
|
|
45
|
+
type DexterConnectionOperation = 'idle' | 'connecting' | 'disconnecting' | 'removing';
|
|
46
|
+
declare const REMOVE_DEXTER_FROM_DEVICE_CONFIRMATION: "remove-dexter-from-device";
|
|
47
|
+
type RemoveDexterFromDeviceConfirmation = typeof REMOVE_DEXTER_FROM_DEVICE_CONFIRMATION;
|
|
48
|
+
interface RemoveDexterFromDeviceResult {
|
|
49
|
+
readonly removedFromRoster: boolean;
|
|
50
|
+
readonly passkeyPruned: boolean;
|
|
192
51
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
onManageWallet?: () => void;
|
|
203
|
-
/** Eject row → the consumer ejects/resets (guard + perform on its side). Row hidden if omitted. */
|
|
204
|
-
onStartFresh?: () => void;
|
|
205
|
-
/** Label for the eject/reset row. Default "Eject wallet". */
|
|
206
|
-
startFreshLabel?: string;
|
|
207
|
-
/** Sign-in/save UI revealed when "Save your wallet" is tapped (e.g. <SignInWithDexter/>). Row hidden if omitted. */
|
|
208
|
-
saveSlot?: ReactNode;
|
|
209
|
-
/** Short hint shown above the save UI. */
|
|
210
|
-
saveHint?: string;
|
|
211
|
-
/** Extra className composed after the brand classes. */
|
|
212
|
-
className?: string;
|
|
52
|
+
interface DexterIdentityView {
|
|
53
|
+
readonly kind: WalletAccountRelationSnapshot['relation'];
|
|
54
|
+
readonly userHandle: string | null;
|
|
55
|
+
readonly walletLabel: string | null;
|
|
56
|
+
readonly hasPasskeyVault: boolean;
|
|
57
|
+
readonly hasAccount: boolean;
|
|
58
|
+
readonly hasWallet: boolean;
|
|
59
|
+
readonly hasAccountAccess: boolean;
|
|
60
|
+
readonly quarantined: boolean;
|
|
213
61
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
62
|
+
interface DexterWalletView {
|
|
63
|
+
readonly userHandle: string;
|
|
64
|
+
readonly label: string | null;
|
|
65
|
+
readonly vaultPda: string | null;
|
|
66
|
+
readonly swigAddress: string | null;
|
|
67
|
+
readonly walletAddress: string | null;
|
|
68
|
+
readonly receiveAddress: string | null;
|
|
69
|
+
readonly network: string | null;
|
|
70
|
+
}
|
|
71
|
+
interface UseDexterConnectionConfig {
|
|
72
|
+
readonly intent: DexterConnectionIntent;
|
|
73
|
+
readonly accountSession: DexterAccountSession;
|
|
74
|
+
readonly installAccountSession: AccountSessionInstaller;
|
|
75
|
+
readonly clearAccountSession: AccountSessionClearer;
|
|
76
|
+
readonly apiBase?: string;
|
|
77
|
+
readonly fetch?: BindingFetch;
|
|
78
|
+
readonly passkey?: Omit<PasskeyLoginConfig, 'apiBase' | 'walletStore'>;
|
|
79
|
+
}
|
|
80
|
+
interface UseDexterConnection {
|
|
81
|
+
readonly model: DexterControlModel;
|
|
82
|
+
readonly identity: DexterIdentityView;
|
|
83
|
+
readonly relation: WalletAccountRelationSnapshot;
|
|
84
|
+
readonly operation: DexterConnectionOperation;
|
|
85
|
+
readonly activeWallet: DexterWalletView | null;
|
|
86
|
+
readonly error: ConnectError | null;
|
|
87
|
+
connect(): Promise<SignInResult>;
|
|
88
|
+
useAnotherDexterWallet(): Promise<SignInResult>;
|
|
89
|
+
disconnectDexter(): Promise<boolean>;
|
|
90
|
+
removeFromThisDevice(confirmation: RemoveDexterFromDeviceConfirmation): Promise<RemoveDexterFromDeviceResult>;
|
|
91
|
+
retry(): Promise<void>;
|
|
221
92
|
}
|
|
222
|
-
|
|
93
|
+
/**
|
|
94
|
+
* Canonical React control for one active Dexter identity and Wallet.
|
|
95
|
+
* Consumers supply their account-session adapter and render from `model`.
|
|
96
|
+
*/
|
|
97
|
+
declare function useDexterConnection(config: UseDexterConnectionConfig): UseDexterConnection;
|
|
223
98
|
|
|
224
99
|
interface AllowanceChipsProps {
|
|
225
100
|
/** The authored USD amount as a raw string, or null when nothing is chosen.
|
|
@@ -247,6 +122,11 @@ interface CreateWalletPanelProps {
|
|
|
247
122
|
transport?: 'auto' | 'popup' | 'inline';
|
|
248
123
|
/** Render the optional "Name your wallet" field. Default true. */
|
|
249
124
|
showName?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* `deferred` is the default and omits the agent-allowance UI.
|
|
127
|
+
* `configure-now` is the explicit compatibility flow for an allowance.
|
|
128
|
+
*/
|
|
129
|
+
agentDelegation?: AgentDelegationMode;
|
|
250
130
|
/** Extra className composed after the brand classes. */
|
|
251
131
|
className?: string;
|
|
252
132
|
}
|
|
@@ -278,4 +158,4 @@ declare function hermesOpenUrl(name: string): string;
|
|
|
278
158
|
declare function claudeCodeInstallCommand(name: string, mcpUrl: string): string;
|
|
279
159
|
declare function AppInstallButtons(props: AppInstallButtonsProps): ReactElement;
|
|
280
160
|
|
|
281
|
-
export { AllowanceChips, type AllowanceChipsProps, AppInstallButtons, type AppInstallButtonsProps, type
|
|
161
|
+
export { AllowanceChips, type AllowanceChipsProps, AppInstallButtons, type AppInstallButtonsProps, CreateWalletPanel, type CreateWalletPanelProps, CreateWalletResult, type DexterAccountSession, DexterButton, type DexterButtonProps, DexterConnectionIntent, type DexterConnectionOperation, DexterControlModel, type DexterIdentityView, DexterMark, type DexterWalletView, type InstallApp, REMOVE_DEXTER_FROM_DEVICE_CONFIRMATION, type RemoveDexterFromDeviceConfirmation, type RemoveDexterFromDeviceResult, SignInResult, type UseDexterConnection, type UseDexterConnectionConfig, WalletAccountRelationSnapshot, chatgptPluginsUrl, claudeCodeInstallCommand, claudeWebConnectorUrl, cursorInstallUrl, hermesInstallCommand, hermesOpenUrl, useDexterConnection, vscodeInstallUrl };
|