@capxul/sdk 0.2.0-alpha.4 → 1.0.0-alpha.6

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.
Files changed (45) hide show
  1. package/README.md +5 -308
  2. package/dist/InMemoryAuthCacheAdapter-BK-B_ERB.mjs +113 -0
  3. package/dist/InMemoryAuthCacheAdapter-BK-B_ERB.mjs.map +1 -0
  4. package/dist/index.d.mts +1362 -0
  5. package/dist/index.d.mts.map +1 -0
  6. package/dist/index.mjs +5393 -0
  7. package/dist/index.mjs.map +1 -0
  8. package/dist/node/index.d.mts +55 -0
  9. package/dist/node/index.d.mts.map +1 -0
  10. package/dist/node/index.mjs +159 -0
  11. package/dist/node/index.mjs.map +1 -0
  12. package/dist/ports/safe-deployment.d.mts +2 -0
  13. package/dist/ports/safe-deployment.mjs +38 -0
  14. package/dist/ports/safe-deployment.mjs.map +1 -0
  15. package/dist/safe-deployment-Vni46k3t.d.mts +137 -0
  16. package/dist/safe-deployment-Vni46k3t.d.mts.map +1 -0
  17. package/dist/signer-3-awyCio.d.mts +145 -0
  18. package/dist/signer-3-awyCio.d.mts.map +1 -0
  19. package/package.json +39 -70
  20. package/CHANGELOG.md +0 -274
  21. package/LICENSE +0 -44
  22. package/dist/client-CbUeJoM9.d.ts +0 -1335
  23. package/dist/client-UEm2oZbZ.d.cts +0 -1335
  24. package/dist/client.cjs +0 -4042
  25. package/dist/client.d.cts +0 -6
  26. package/dist/client.d.ts +0 -6
  27. package/dist/client.js +0 -4040
  28. package/dist/errors-CwhCWGxm.d.ts +0 -70
  29. package/dist/errors-rqxuUhQP.d.cts +0 -70
  30. package/dist/errors.cjs +0 -35
  31. package/dist/errors.d.cts +0 -2
  32. package/dist/errors.d.ts +0 -2
  33. package/dist/errors.js +0 -31
  34. package/dist/index.cjs +0 -4273
  35. package/dist/index.d.cts +0 -461
  36. package/dist/index.d.ts +0 -461
  37. package/dist/index.js +0 -4234
  38. package/dist/next-action-CTGl8wpy.d.cts +0 -177
  39. package/dist/next-action-CTGl8wpy.d.ts +0 -177
  40. package/dist/types-BD4VAQb5.d.ts +0 -1205
  41. package/dist/types-HlwCIjgQ.d.cts +0 -1205
  42. package/dist/webhooks.cjs +0 -118
  43. package/dist/webhooks.d.cts +0 -33
  44. package/dist/webhooks.d.ts +0 -33
  45. package/dist/webhooks.js +0 -116
@@ -0,0 +1,1362 @@
1
+ import { a as AccountProviderSource, c as eip1193AccountProvider, d as CapxulResult, f as Profile, g as AuthCachePort, i as AccountProvider, l as localPrivateKeyAccountProvider, m as SmartAccount, n as Eip1193RequestProvider, o as AccountRequirement, p as Session, r as injectedWalletSigner, s as Eip1193Provider, t as CapxulSigner, u as openfortEmbeddedAccountProvider, v as CachedJwt } from "./signer-3-awyCio.mjs";
2
+ import { a as SafeDeploymentEvidence, n as SafeDeploymentConfig } from "./safe-deployment-Vni46k3t.mjs";
3
+ import { Context, Effect, Layer, Request } from "effect";
4
+ import { Machine } from "@effect/experimental";
5
+ import { CapxulError, CapxulErrorCode, CapxulErrorDetails } from "@capxul/config";
6
+ import { Account, Account as Account$1, AccountId, Address, Address as Address$1, AllowedOrigin, AnonymousDistinctId, AppId, AuthSession, AuthSession as AuthSession$1, AuthUserId, AuthUserId as AuthUserId$1, ChainId, CountryCode, DeveloperApplication, DurationMs, Email, EpochMs, Money, Money as Money$1, OrgId, OrgId as OrgId$1, Profile as Profile$1, PublishableKey, PublishableKeyId, PublishableKeyRecord, RoleKey, RoleKey as RoleKey$1, RunId, SessionToken, SmartAccount as SmartAccount$1, SubAccount, SubAccount as SubAccount$1, SubAccountId, SubAccountId as SubAccountId$1 } from "@capxul/types";
7
+ import { TelemetryEvent, TelemetryGroupInput, TelemetryIdentifyInput } from "@capxul/observability";
8
+ import { Hex } from "viem";
9
+ import { Schema } from "@effect/schema";
10
+ import { FunctionReference } from "convex/server";
11
+
12
+ //#region src/ports/auth-client.d.ts
13
+ type AuthClientOperationOptions = {
14
+ readonly signal?: AbortSignal;
15
+ };
16
+ type SendOtpInput = {
17
+ readonly email: Email;
18
+ };
19
+ type CanSendOtpInput = {
20
+ readonly email: Email;
21
+ };
22
+ type CanSendOtpStatus = {
23
+ readonly allowed: boolean;
24
+ readonly cooldownMs: DurationMs;
25
+ };
26
+ type VerifyOtpInput = {
27
+ readonly email: Email;
28
+ readonly otp: string;
29
+ };
30
+ type GetConvexJwtOptions = AuthClientOperationOptions & {
31
+ readonly forceRefresh?: boolean;
32
+ };
33
+ declare const AuthClientError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
34
+ readonly _tag: "AuthClientError";
35
+ } & Readonly<A>;
36
+ declare class AuthClientError extends AuthClientError_base<{
37
+ readonly operation: string;
38
+ readonly kind: string;
39
+ readonly cause: unknown;
40
+ }> {}
41
+ interface AuthClientPort {
42
+ canSendOtp(input: CanSendOtpInput, options?: AuthClientOperationOptions): Effect.Effect<CanSendOtpStatus, AuthClientError>;
43
+ sendOtp(input: SendOtpInput, options?: AuthClientOperationOptions): Effect.Effect<void, AuthClientError>;
44
+ verifyOtp(input: VerifyOtpInput, options?: AuthClientOperationOptions): Effect.Effect<AuthSession$1, AuthClientError>;
45
+ getSession(options?: AuthClientOperationOptions): Effect.Effect<AuthSession$1 | null, AuthClientError>;
46
+ signOut(options?: AuthClientOperationOptions): Effect.Effect<void, AuthClientError>;
47
+ /**
48
+ * Fetches a Convex-aud JWT from `/api/auth/convex/token` (W7). Server mints
49
+ * a fresh JWT on every call per Probe A's 2026-05-19 finding (RS256, 900 s
50
+ * lifetime, `iss = <site-url>`, `aud = convex`). The caller (the SDK's
51
+ * `tokenProvider` wired into ConvexCallPort) is responsible for the
52
+ * `exp - 30s` proactive cache + `forceRefresh` callback handshake.
53
+ */
54
+ getConvexJwt(options?: GetConvexJwtOptions): Effect.Effect<CachedJwt, AuthClientError>;
55
+ }
56
+ //#endregion
57
+ //#region src/ports/clock.d.ts
58
+ interface ClockPort {
59
+ readonly now: Effect.Effect<EpochMs, ClockError>;
60
+ readonly sleep: (duration: DurationMs) => Effect.Effect<void, ClockError>;
61
+ }
62
+ declare const ClockError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
63
+ readonly _tag: "ClockError";
64
+ } & Readonly<A>;
65
+ declare class ClockError extends ClockError_base<{
66
+ readonly operation: "now" | "sleep" | "initialize";
67
+ readonly cause: unknown;
68
+ }> {}
69
+ //#endregion
70
+ //#region src/ports/telemetry.d.ts
71
+ interface TelemetryPort {
72
+ readonly emit: (event: TelemetryEvent) => Effect.Effect<void, never>;
73
+ readonly identify: (input: TelemetryIdentifyInput) => Effect.Effect<void, never>;
74
+ readonly group: (input: TelemetryGroupInput) => Effect.Effect<void, never>;
75
+ readonly reset: () => Effect.Effect<void, never>;
76
+ }
77
+ //#endregion
78
+ //#region src/flows/auth.d.ts
79
+ interface AuthFlowInput {
80
+ readonly otpTtlMs?: number;
81
+ }
82
+ type AuthFlowState = "idle" | "sending_otp" | "otp_requested" | "verifying" | "authenticated" | "signing_out" | "error";
83
+ interface AuthFlowContext {
84
+ readonly state: AuthFlowState;
85
+ readonly email: Email | null;
86
+ readonly session: AuthSession$1 | null;
87
+ readonly otpRequestedAt: EpochMs | null;
88
+ readonly anonDistinctId?: AnonymousDistinctId;
89
+ readonly error: CapxulError | null;
90
+ }
91
+ interface AuthFlowObserver {
92
+ readonly input: AuthFlowInput;
93
+ readonly getSnapshot: () => {
94
+ readonly value: AuthFlowState;
95
+ readonly context: AuthFlowContext;
96
+ readonly status: "active" | "stopped";
97
+ };
98
+ readonly stop: () => void;
99
+ }
100
+ //#endregion
101
+ //#region src/env/_internal.d.ts
102
+ declare const envShapeSchema: Schema.Struct<{
103
+ [k: string]: Schema.Schema<string, string, never> | Schema.optional<Schema.Schema<string, string, never>>;
104
+ }>;
105
+ type EnvShape = Schema.Schema.Type<typeof envShapeSchema>;
106
+ type EnvKey = keyof EnvShape & string;
107
+ //#endregion
108
+ //#region src/env/index.d.ts
109
+ type RequiredEnvKey = EnvKey;
110
+ type OptionalEnvKey = EnvKey;
111
+ //#endregion
112
+ //#region src/ports/env.d.ts
113
+ declare const EnvError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
114
+ readonly _tag: "EnvError";
115
+ } & Readonly<A>;
116
+ declare class EnvError extends EnvError_base<{
117
+ readonly publicError: CapxulError;
118
+ readonly publicCode?: CapxulErrorCode;
119
+ readonly key?: string;
120
+ readonly details?: CapxulErrorDetails;
121
+ readonly cause?: unknown;
122
+ }> {}
123
+ interface EnvPort {
124
+ readonly require: <K extends RequiredEnvKey>(key: K) => Effect.Effect<EnvShape[K], EnvError, never>;
125
+ readonly optional: <K extends OptionalEnvKey>(key: K) => Effect.Effect<EnvShape[K] | undefined, EnvError, never>;
126
+ readonly has: (key: EnvKey) => Effect.Effect<boolean, EnvError, never>;
127
+ }
128
+ //#endregion
129
+ //#region src/ports/evm-signer.d.ts
130
+ type HexString = `0x${string}`;
131
+ type UserOperationRequest = {
132
+ readonly sender: Address$1;
133
+ readonly chainId: ChainId;
134
+ readonly callData: HexString;
135
+ readonly nonce?: HexString;
136
+ readonly maxFeePerGas?: HexString;
137
+ readonly maxPriorityFeePerGas?: HexString;
138
+ readonly callGasLimit?: HexString;
139
+ readonly verificationGasLimit?: HexString;
140
+ readonly preVerificationGas?: HexString;
141
+ readonly paymasterAndData?: HexString;
142
+ };
143
+ type SignedUserOperation = UserOperationRequest & {
144
+ readonly sender: Address$1;
145
+ readonly signature: HexString;
146
+ readonly userOpHash: HexString;
147
+ };
148
+ declare const EvmSignerError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
149
+ readonly _tag: "EvmSignerError";
150
+ } & Readonly<A>;
151
+ declare class EvmSignerError extends EvmSignerError_base<{
152
+ readonly publicError: CapxulError;
153
+ readonly publicCode?: CapxulErrorCode;
154
+ readonly operation?: string;
155
+ readonly details?: CapxulErrorDetails;
156
+ readonly cause?: unknown;
157
+ }> {}
158
+ interface EvmSignerPort {
159
+ readonly getAddress: Effect.Effect<Address$1, EvmSignerError, never>;
160
+ readonly signMessage: (message: string | Uint8Array) => Effect.Effect<HexString, EvmSignerError, never>;
161
+ readonly signUserOp: (userOperation: UserOperationRequest) => Effect.Effect<SignedUserOperation, EvmSignerError, never>;
162
+ }
163
+ //#endregion
164
+ //#region src/ports/transport.d.ts
165
+ type TransportOperationKind = "query" | "mutation" | "action";
166
+ type TransportRequest<TArgs = unknown> = {
167
+ readonly name: string;
168
+ readonly args: TArgs;
169
+ readonly correlationId?: string;
170
+ };
171
+ declare const TransportError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
172
+ readonly _tag: "TransportError";
173
+ } & Readonly<A>;
174
+ declare class TransportError extends TransportError_base<{
175
+ readonly operation: TransportOperationKind;
176
+ readonly name: string;
177
+ readonly publicCode: CapxulErrorCode;
178
+ readonly publicError: CapxulError;
179
+ readonly cause: unknown;
180
+ readonly correlationId?: string;
181
+ readonly details?: CapxulErrorDetails;
182
+ }> {}
183
+ interface TransportPort {
184
+ readonly runQuery: <TOutput = unknown, TArgs = unknown>(request: TransportRequest<TArgs>) => Effect.Effect<TOutput, TransportError>;
185
+ readonly runMutation: <TOutput = unknown, TArgs = unknown>(request: TransportRequest<TArgs>) => Effect.Effect<TOutput, TransportError>;
186
+ readonly runAction: <TOutput = unknown, TArgs = unknown>(request: TransportRequest<TArgs>) => Effect.Effect<TOutput, TransportError>;
187
+ }
188
+ //#endregion
189
+ //#region src/ports/bootstrap.d.ts
190
+ type BootstrapInput = {
191
+ readonly publishableKey: PublishableKey;
192
+ /**
193
+ * Browser callers send the App origin so bootstrap can enforce the
194
+ * publishable-key allowlist. Node/server callers may omit it; the backend
195
+ * only applies the origin allowlist when an origin is present.
196
+ */
197
+ readonly origin?: AllowedOrigin;
198
+ };
199
+ type BootstrapResolution = {
200
+ readonly applicationId: AppId;
201
+ readonly chainId: ChainId;
202
+ /**
203
+ * SDK-handshake session token — distinct from the user-auth `AuthSession`
204
+ * token issued by `AuthClientPort`. Both use the `SessionToken` brand for
205
+ * opaque-string discipline; the issuance source distinguishes them.
206
+ */
207
+ readonly sessionToken: SessionToken;
208
+ readonly issuedAt: EpochMs;
209
+ readonly expiresIn: DurationMs;
210
+ readonly authBaseUrl: string;
211
+ readonly convexUrl: string;
212
+ readonly siteBaseUrl: string;
213
+ readonly openfortPublishableKey: string;
214
+ readonly shieldPublishableKey: string;
215
+ };
216
+ type BootstrapErrorKind = "notAuthenticated" | "network" | "provider" | "malformedBody" | "invalidInput" | "rateLimited";
217
+ declare const BootstrapError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
218
+ readonly _tag: "BootstrapError";
219
+ } & Readonly<A>;
220
+ declare class BootstrapError extends BootstrapError_base<{
221
+ readonly operation: "resolve";
222
+ readonly kind: BootstrapErrorKind;
223
+ readonly publicCode: CapxulErrorCode;
224
+ readonly cause: unknown;
225
+ readonly details?: CapxulErrorDetails;
226
+ }> {}
227
+ interface BootstrapPort {
228
+ readonly resolve: (input: BootstrapInput) => Effect.Effect<BootstrapResolution, BootstrapError>;
229
+ }
230
+ //#endregion
231
+ //#region src/ports/subscription.d.ts
232
+ /**
233
+ * Canonical teardown handle for substrate-level reactive callbacks.
234
+ *
235
+ * Calling it stops the subscription; no further snapshots will be delivered
236
+ * to the callback after the first invocation. Calling more than once is a
237
+ * no-op (idempotent).
238
+ *
239
+ * @internal-use
240
+ */
241
+ type Unsubscribe = () => void;
242
+ /**
243
+ * Snapshot is the substrate discriminated union for reactive callbacks over
244
+ * `ConvexCallPort.subscribe`. The public SDK surface is imperative
245
+ * (`Promise<CapxulResult>`). This type is reachable for internal XState
246
+ * `fromCallback` actor wiring,
247
+ * property-based `crossAdapterSubscriptionProperty` harness consumers, and
248
+ * genuinely non-React advanced consumers.
249
+ *
250
+ * - `loading` · initial state before any value arrives from the substrate
251
+ * - `ok` · a successful snapshot carrying `value`
252
+ * - `error` · a failed snapshot carrying a typed error (defaults to
253
+ * `CapxulError`)
254
+ *
255
+ * Generic over the value type `T`. The error type `E` is parameterised but
256
+ * defaults to `CapxulError` — every shipped port today uses the default. A
257
+ * narrower or wider `E` is reserved for future ports that need a different
258
+ * error vocabulary.
259
+ *
260
+ * The substrate guarantees the first snapshot is `loading` (CC8 in the
261
+ * `ConvexCallPort` contract); subsequent snapshots carry `ok` or `error`
262
+ * per the underlying transport.
263
+ *
264
+ * Per ARCH-LOCK-1 (`docs/decisions/stage-4-reactivity-pivot.html`), domain
265
+ * ports do not expose reactive callback methods.
266
+ *
267
+ * @internal-use
268
+ */
269
+ type Snapshot<T, E = CapxulError> = {
270
+ readonly status: "loading";
271
+ } | {
272
+ readonly status: "ok";
273
+ readonly value: T;
274
+ } | {
275
+ readonly status: "error";
276
+ readonly error: E;
277
+ };
278
+ //#endregion
279
+ //#region src/ports/convex-call.d.ts
280
+ declare const ConvexCallError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
281
+ readonly _tag: "ConvexCallError";
282
+ } & Readonly<A>;
283
+ declare class ConvexCallError extends ConvexCallError_base<{
284
+ readonly operation: string;
285
+ readonly publicCode: CapxulErrorCode;
286
+ readonly publicError: CapxulError;
287
+ readonly cause: unknown;
288
+ readonly details?: CapxulErrorDetails;
289
+ }> {}
290
+ interface ConvexCallPort {
291
+ query<TArgs extends Record<string, unknown>, TOutput>(fn: FunctionReference<"query", "public", TArgs, TOutput>, args: TArgs): Effect.Effect<TOutput, ConvexCallError>;
292
+ mutation<TArgs extends Record<string, unknown>, TOutput>(fn: FunctionReference<"mutation", "public", TArgs, TOutput>, args: TArgs): Effect.Effect<TOutput, ConvexCallError>;
293
+ action<TArgs extends Record<string, unknown>, TOutput>(fn: FunctionReference<"action", "public", TArgs, TOutput>, args: TArgs): Effect.Effect<TOutput, ConvexCallError>;
294
+ /**
295
+ * Substrate-level reactive transport over Convex's `onUpdate`.
296
+ *
297
+ * @internal-use — substrate only; see `ports/subscription.ts`. Domain
298
+ * ports do not expose reactive callback methods to consumers (ARCH-LOCK-1).
299
+ */
300
+ subscribe<TArgs extends Record<string, unknown>, TOutput>(fn: FunctionReference<"query", "public", TArgs, TOutput>, args: TArgs, callback: (snapshot: Snapshot<TOutput>) => void): Effect.Effect<Unsubscribe, ConvexCallError>;
301
+ }
302
+ //#endregion
303
+ //#region src/ports/credentials.d.ts
304
+ type CreateApplicationInput = {
305
+ readonly authUserId: AuthUserId$1;
306
+ readonly name: string;
307
+ readonly allowedOrigins: readonly AllowedOrigin[];
308
+ };
309
+ type MintKeyInput = {
310
+ readonly applicationId: AppId;
311
+ readonly authUserId: AuthUserId$1;
312
+ };
313
+ type RotateKeyInput = {
314
+ readonly keyId: PublishableKeyId;
315
+ readonly authUserId: AuthUserId$1;
316
+ readonly graceMs: DurationMs;
317
+ };
318
+ type RevokeKeyInput = {
319
+ readonly keyId: PublishableKeyId;
320
+ readonly authUserId: AuthUserId$1;
321
+ };
322
+ type RotateKeyResult = {
323
+ readonly active: PublishableKeyRecord;
324
+ readonly retired: PublishableKeyRecord;
325
+ };
326
+ declare const CredentialsError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
327
+ readonly _tag: "CredentialsError";
328
+ } & Readonly<A>;
329
+ declare class CredentialsError extends CredentialsError_base<{
330
+ readonly operation: string;
331
+ readonly publicCode: CapxulErrorCode;
332
+ readonly publicError: CapxulError;
333
+ readonly cause: unknown;
334
+ readonly details?: CapxulErrorDetails;
335
+ }> {}
336
+ interface CredentialsPort {
337
+ listApplications(authUserId: AuthUserId$1): Effect.Effect<readonly DeveloperApplication[], CredentialsError>;
338
+ createApplication(input: CreateApplicationInput): Effect.Effect<DeveloperApplication, CredentialsError>;
339
+ mintPublishableKey(input: MintKeyInput): Effect.Effect<PublishableKeyRecord, CredentialsError>;
340
+ rotatePublishableKey(input: RotateKeyInput): Effect.Effect<RotateKeyResult, CredentialsError>;
341
+ revokePublishableKey(input: RevokeKeyInput): Effect.Effect<void, CredentialsError>;
342
+ }
343
+ //#endregion
344
+ //#region src/ports/identity.d.ts
345
+ type CreateIdentityInput = {
346
+ readonly authUserId: AuthUserId$1;
347
+ readonly email: Email;
348
+ readonly displayName?: string;
349
+ readonly country?: CountryCode;
350
+ };
351
+ type UpdateIdentityInput = {
352
+ readonly authUserId: AuthUserId$1;
353
+ readonly displayName?: string;
354
+ readonly country?: CountryCode;
355
+ };
356
+ declare const IdentityError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
357
+ readonly _tag: "IdentityError";
358
+ } & Readonly<A>;
359
+ declare class IdentityError extends IdentityError_base<{
360
+ readonly operation: string;
361
+ readonly publicCode: CapxulErrorCode;
362
+ readonly publicError: CapxulError;
363
+ readonly cause: unknown;
364
+ readonly details?: CapxulErrorDetails;
365
+ }> {}
366
+ interface IdentityPort {
367
+ loadByAuthUserId(authUserId: AuthUserId$1): Effect.Effect<Profile$1 | null, IdentityError, never>;
368
+ create(input: CreateIdentityInput): Effect.Effect<Profile$1, IdentityError, never>;
369
+ update(input: UpdateIdentityInput): Effect.Effect<Profile$1, IdentityError, never>;
370
+ }
371
+ //#endregion
372
+ //#region src/ports/smart-account.d.ts
373
+ type ProvisionInput = {
374
+ readonly authUserId: AuthUserId$1;
375
+ readonly chainId: ChainId;
376
+ };
377
+ /**
378
+ * Input to `SmartAccountPort.confirmDeployment` (#161 · γ-B).
379
+ *
380
+ * The SDK provides evidence pointers; the backend is the oracle for
381
+ * `deployedAt`. `evidence.deployedAt` does NOT exist by schema (see
382
+ * `SafeDeploymentEvidence`) — the backend derives `deployedAt` from
383
+ * the on-chain receipt block via `eth_getBlockByNumber`.
384
+ *
385
+ * Precheck path: `evidence.userOpHash` omitted; backend scans
386
+ * `SafeProxyFactory.ProxyCreation(safeAddress, _)` via `eth_getLogs`.
387
+ *
388
+ * Real-userOp path: `evidence.userOpHash` populated; backend calls
389
+ * `eth_getUserOperationReceipt(userOpHash)` to re-verify and derive.
390
+ */
391
+ type ConfirmDeploymentInput = {
392
+ readonly authUserId: AuthUserId$1;
393
+ readonly chainId: ChainId;
394
+ readonly safeAddress: Address$1;
395
+ readonly evidence: SafeDeploymentEvidence;
396
+ /**
397
+ * Optional live-E2E correlation id. This does not prove deployment; the
398
+ * backend still re-verifies chain evidence and only mirrors this branded
399
+ * id onto telemetry for PostHog run joins.
400
+ */
401
+ readonly telemetryRunId?: RunId;
402
+ };
403
+ /** Opaque wire form of the backend-built deployment UserOperation (hex strings). */
404
+ type DeploymentUserOpFields = {
405
+ readonly sender: string;
406
+ readonly nonce: string;
407
+ readonly factory: string;
408
+ readonly factoryData: string;
409
+ readonly callData: string;
410
+ readonly callGasLimit: string;
411
+ readonly verificationGasLimit: string;
412
+ readonly preVerificationGas: string;
413
+ readonly maxFeePerGas: string;
414
+ readonly maxPriorityFeePerGas: string;
415
+ readonly paymaster: string;
416
+ readonly paymasterVerificationGasLimit?: string | undefined;
417
+ readonly paymasterPostOpGasLimit?: string | undefined;
418
+ readonly paymasterData: string;
419
+ };
420
+ /** Input to `SmartAccountPort.deployPrepare` (backend-orchestrated-deploy.md · #289). */
421
+ type DeployPrepareInput = {
422
+ readonly authUserId: AuthUserId$1;
423
+ readonly chainId: ChainId;
424
+ readonly telemetryRunId?: RunId;
425
+ };
426
+ /** Backend-built deployment UserOp + the EIP-712 SafeOp digest the CapxulSigner signs. */
427
+ type DeployPrepareResult = {
428
+ readonly digest: Hex;
429
+ readonly safeAddress: Address$1;
430
+ readonly userOp: DeploymentUserOpFields;
431
+ };
432
+ /** Input to `SmartAccountPort.deploySubmit` — the consumer-signed deployment UserOp. */
433
+ type DeploySubmitInput = {
434
+ readonly authUserId: AuthUserId$1;
435
+ readonly chainId: ChainId;
436
+ readonly userOp: DeploymentUserOpFields;
437
+ readonly signature: Hex;
438
+ readonly telemetryRunId?: RunId;
439
+ };
440
+ declare const SmartAccountError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
441
+ readonly _tag: "SmartAccountError";
442
+ } & Readonly<A>;
443
+ declare class SmartAccountError extends SmartAccountError_base<{
444
+ readonly operation: string;
445
+ readonly publicCode: CapxulErrorCode;
446
+ readonly publicError: CapxulError;
447
+ readonly cause: unknown;
448
+ readonly details?: CapxulErrorDetails;
449
+ }> {}
450
+ interface SmartAccountPort {
451
+ loadByAuthUserId(authUserId: AuthUserId$1): Effect.Effect<SmartAccount$1 | null, SmartAccountError, never>;
452
+ loadBySmartAccountAddress(address: Address$1): Effect.Effect<SmartAccount$1 | null, SmartAccountError, never>;
453
+ provision(input: ProvisionInput): Effect.Effect<SmartAccount$1, SmartAccountError, never>;
454
+ /**
455
+ * Persist on-chain Safe-deployment evidence. The backend re-verifies
456
+ * the evidence against chain state and derives `deployedAt` from the
457
+ * receipt block's timestamp. Returns the updated `SmartAccount` row.
458
+ *
459
+ * γ-B trust model: the SDK supplies evidence pointers only. The
460
+ * backend is the SOLE oracle for `deployedAt` — see
461
+ * `docs/canon/ports/smart-account.md`.
462
+ */
463
+ confirmDeployment(input: ConfirmDeploymentInput): Effect.Effect<SmartAccount$1, SmartAccountError, never>;
464
+ /**
465
+ * Build + gas-fill + paymaster-sponsor the deployment UserOperation
466
+ * server-side and return the EIP-712 `SafeOp` digest for the consumer's
467
+ * `CapxulSigner` to sign. The client never holds RPC, a gas policy, or a
468
+ * bundler — see `docs/canon/decisions/backend-orchestrated-deploy.md`.
469
+ */
470
+ deployPrepare(input: DeployPrepareInput): Effect.Effect<DeployPrepareResult, SmartAccountError, never>;
471
+ /**
472
+ * Submit the signed deployment UserOperation through the bundler and confirm
473
+ * `deployedAt` on-chain (absorbing the `confirmDeployment` verify path).
474
+ * Returns the updated `SmartAccount` row.
475
+ */
476
+ deploySubmit(input: DeploySubmitInput): Effect.Effect<SmartAccount$1, SmartAccountError, never>;
477
+ }
478
+ //#endregion
479
+ //#region src/ports/binding.d.ts
480
+ type EmailBinding = {
481
+ readonly bindingId: string;
482
+ readonly signerAddress: Address$1;
483
+ readonly safeAddress: Address$1;
484
+ };
485
+ type EnsureBindingResolvedInput = {
486
+ readonly email: Email; /** Browser embedded wallet EOA when the client already configured Openfort Shield. */
487
+ readonly signerAddress?: Address$1;
488
+ };
489
+ declare const BindingError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
490
+ readonly _tag: "BindingError";
491
+ } & Readonly<A>;
492
+ declare class BindingError extends BindingError_base<{
493
+ readonly operation: string;
494
+ readonly publicCode: CapxulErrorCode;
495
+ readonly publicError: CapxulError;
496
+ readonly cause: unknown;
497
+ readonly details?: CapxulErrorDetails;
498
+ }> {}
499
+ interface BindingPort {
500
+ readonly ensureResolved: (input: EnsureBindingResolvedInput) => Effect.Effect<EmailBinding, BindingError>;
501
+ }
502
+ //#endregion
503
+ //#region src/ports/account-read.d.ts
504
+ type ReadAccountBalanceInput = {
505
+ readonly chainId: ChainId;
506
+ };
507
+ type FundFromFaucetInput = {
508
+ readonly chainId: ChainId;
509
+ readonly amount: Money$1;
510
+ };
511
+ type FundFromFaucetResult = {
512
+ readonly txHash: string;
513
+ };
514
+ declare const AccountReadError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
515
+ readonly _tag: "AccountReadError";
516
+ } & Readonly<A>;
517
+ declare class AccountReadError extends AccountReadError_base<{
518
+ readonly operation: string;
519
+ readonly publicCode: CapxulErrorCode;
520
+ readonly publicError: CapxulError;
521
+ readonly cause: unknown;
522
+ readonly details?: CapxulErrorDetails;
523
+ }> {}
524
+ /**
525
+ * Logical Account money read (M2 Slice S1a). Joins the `accounts` row with a
526
+ * live RPC `balanceOf` pull; the adapter lifts wire integers to `Money`.
527
+ */
528
+ interface AccountReadPort {
529
+ readBalance(input: ReadAccountBalanceInput): Effect.Effect<Account$1, AccountReadError, never>;
530
+ fundFromFaucet(input: FundFromFaucetInput): Effect.Effect<FundFromFaucetResult, AccountReadError, never>;
531
+ }
532
+ //#endregion
533
+ //#region src/ports/sub-account.d.ts
534
+ declare const SubAccountError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
535
+ readonly _tag: "SubAccountError";
536
+ } & Readonly<A>;
537
+ declare class SubAccountError extends SubAccountError_base<{
538
+ readonly operation: string;
539
+ readonly publicCode: CapxulErrorCode;
540
+ readonly publicError: CapxulError;
541
+ readonly cause: unknown;
542
+ readonly details?: CapxulErrorDetails;
543
+ }> {}
544
+ type CreateSubAccountInput = {
545
+ readonly accountId: AccountId;
546
+ readonly name: string;
547
+ };
548
+ type SubAccountIdInput = {
549
+ readonly subAccountId: SubAccountId$1;
550
+ };
551
+ type RenameSubAccountInput = {
552
+ readonly subAccountId: SubAccountId$1;
553
+ readonly name: string;
554
+ };
555
+ /**
556
+ * A `transfer` endpoint is either the Account's MAIN balance (the remainder
557
+ * left over after every sub-account is funded — never a stored row) or a
558
+ * specific sub-account, addressed by its `SubAccountId` (canon
559
+ * `account-balance-model.md` §5, §12).
560
+ */
561
+ type TransferEndpoint = "main" | SubAccountId$1;
562
+ /**
563
+ * Move money between two of the SAME Account's balances (canon §12). The
564
+ * backend resolves the Account from auth (v1 = one Account per user), so the
565
+ * input carries no `accountId` — only the from/to endpoints and the `Money`
566
+ * amount. One verb covers money in (`main → sub`), money out (`sub → main`),
567
+ * and `sub → sub`.
568
+ */
569
+ type TransferInput = {
570
+ readonly from: TransferEndpoint;
571
+ readonly to: TransferEndpoint;
572
+ readonly amount: Money$1;
573
+ };
574
+ /**
575
+ * Result of a `transfer`: the recomputed `available` (`balanceOf − Σ`), plus
576
+ * the updated source/destination sub-account rows. An endpoint that is `"main"`
577
+ * has no stored row, so its slot is `null`.
578
+ */
579
+ type TransferResult = {
580
+ readonly available: Money$1;
581
+ readonly from: SubAccount$1 | null;
582
+ readonly to: SubAccount$1 | null;
583
+ };
584
+ interface SubAccountPort {
585
+ create(input: CreateSubAccountInput): Effect.Effect<SubAccount$1, SubAccountError, never>;
586
+ get(input: SubAccountIdInput): Effect.Effect<SubAccount$1 | null, SubAccountError, never>;
587
+ list(input: {
588
+ readonly accountId: AccountId;
589
+ }): Effect.Effect<readonly SubAccount$1[], SubAccountError, never>;
590
+ rename(input: RenameSubAccountInput): Effect.Effect<SubAccount$1, SubAccountError, never>;
591
+ delete(input: SubAccountIdInput): Effect.Effect<void, SubAccountError, never>;
592
+ transfer(input: TransferInput): Effect.Effect<TransferResult, SubAccountError, never>;
593
+ }
594
+ //#endregion
595
+ //#region src/flows/types.d.ts
596
+ /**
597
+ * The full 14-port bundle that `assembleCapxulClient` (slice 5) consumes.
598
+ *
599
+ * Each per-flow factory in slices 2-4 takes a narrowed subset, e.g.
600
+ * `AuthFlowPorts = Pick<FlowPorts, "authClient" | "authCache" | "clock" | "telemetry">`.
601
+ * Slice 1 ships only the union; per Q6 each per-flow slice declares its
602
+ * own narrowed `Pick<FlowPorts, ...>` inside its flow file.
603
+ */
604
+ interface FlowPorts {
605
+ readonly authClient: AuthClientPort;
606
+ readonly authCache: AuthCachePort;
607
+ readonly identity: IdentityPort;
608
+ readonly smartAccount: SmartAccountPort;
609
+ readonly binding: BindingPort;
610
+ readonly accountRead: AccountReadPort;
611
+ readonly subAccount: SubAccountPort;
612
+ readonly credentials: CredentialsPort;
613
+ readonly bootstrap: BootstrapPort;
614
+ readonly evmSigner: EvmSignerPort;
615
+ readonly clock: ClockPort;
616
+ readonly env: EnvPort;
617
+ readonly telemetry: TelemetryPort;
618
+ readonly transport: TransportPort;
619
+ readonly convexCall: ConvexCallPort;
620
+ }
621
+ /**
622
+ * Pre-resolved external signer + signed proof. The UI obtains this
623
+ * BEFORE prompting the user to verify (MetaMask popup, hardware-wallet
624
+ * confirm, etc.), then the consumer sends it to AuthFlow via the
625
+ * `SET_SIGNER` event between `idle` and `verifying`. AuthFlow assigns
626
+ * to `context.externalSigner` on the SET_SIGNER self-loop in either
627
+ * `idle` or `otp_requested`, then flows the value through to the
628
+ * invoked ProvisioningFlow child via `invoke.input.externalSigner`.
629
+ * The child's `branching` state inspects `context.signerAddress`
630
+ * (derived from `input.externalSigner?.address`) to route through
631
+ * `register_external` instead of `mint_openfort` when present.
632
+ *
633
+ * The signer's lifetime is the authenticated session — `clearAuthContext`
634
+ * (on SIGN_OUT → idle) and `clearErrorAndContext` (on error → RESET →
635
+ * idle) both wipe `context.externalSigner`. A subsequent sign-in cycle
636
+ * begins fresh; the consumer re-sends SET_SIGNER (or omits it for the
637
+ * Openfort fallback path). Reference:
638
+ * `docs/decisions/stage-3-external-signer-lifecycle.html` (Option C,
639
+ * locked 2026-05-17, supersedes the earlier factory-input shape).
640
+ *
641
+ * `signedProof` is an EIP-191 signed message proving the user controls
642
+ * the address. ProvisioningFlow does not verify the proof itself —
643
+ * verification is delegated to the indexer registration in Stage 4 when
644
+ * `IndexerPort.registerSafe` lands. For Stage 3 the field is recorded
645
+ * verbatim for trace fidelity.
646
+ *
647
+ * The type lives in this flows/types module (not in `@capxul/types`)
648
+ * because it is a flow-shape composite — `Address` + a freeform proof
649
+ * string — not a primitive brand. Per the Stage 3 plan's vocabulary
650
+ * convention, flow-shape composites stay co-located with their flow.
651
+ */
652
+ interface ExternalSigner {
653
+ readonly address: Address$1;
654
+ readonly signedProof: string;
655
+ }
656
+ //#endregion
657
+ //#region src/client/auth.d.ts
658
+ interface SignInOptions {
659
+ readonly signal?: AbortSignal;
660
+ }
661
+ type AuthMethodOptions = SignInOptions;
662
+ interface AuthMethods {
663
+ canSendOtp(input: {
664
+ readonly email: string;
665
+ }, options?: AuthMethodOptions): Promise<CapxulResult<CanSendOtpStatus>>;
666
+ signIn(input: {
667
+ readonly email: string;
668
+ }, options?: SignInOptions): Promise<CapxulResult<{
669
+ readonly sessionId: string;
670
+ readonly expiresAt: number;
671
+ }>>;
672
+ verifyOtp(input: {
673
+ readonly email: string;
674
+ readonly code: string;
675
+ readonly signer?: ExternalSigner;
676
+ }, options?: AuthMethodOptions): Promise<CapxulResult<Session>>;
677
+ signOut(options?: AuthMethodOptions): Promise<CapxulResult<void>>;
678
+ getSession(options?: AuthMethodOptions): Promise<CapxulResult<Session | null>>;
679
+ }
680
+ //#endregion
681
+ //#region src/client/smart-account.d.ts
682
+ interface SmartAccountMethods {
683
+ loadCurrent(options?: {
684
+ readonly signal?: AbortSignal;
685
+ }): Promise<CapxulResult<SmartAccount | null>>;
686
+ provision(input?: {
687
+ readonly externalSigner?: ExternalSigner;
688
+ }): Promise<CapxulResult<SmartAccount>>;
689
+ }
690
+ //#endregion
691
+ //#region src/client/identity.d.ts
692
+ interface IdentityMethods {
693
+ loadCurrent(options?: {
694
+ readonly signal?: AbortSignal;
695
+ }): Promise<CapxulResult<Profile | null>>;
696
+ }
697
+ //#endregion
698
+ //#region src/client/account-lane.d.ts
699
+ type ProvisioningFailureStep = "wallet" | "binding" | "identity" | "provision" | "deploy";
700
+ type ProvisioningPhase = {
701
+ readonly status: "idle";
702
+ } | {
703
+ readonly status: "wallet";
704
+ } | {
705
+ readonly status: "binding";
706
+ } | {
707
+ readonly status: "identity";
708
+ } | {
709
+ readonly status: "provision";
710
+ } | {
711
+ readonly status: "deploy";
712
+ } | {
713
+ readonly status: "ready";
714
+ } | {
715
+ readonly status: "failed";
716
+ readonly at: ProvisioningFailureStep;
717
+ readonly error: CapxulError;
718
+ };
719
+ //#endregion
720
+ //#region src/client/account-lifecycle.d.ts
721
+ type AccountSetupStep = "connecting" | "confirmingIdentity" | "registering" | "activating";
722
+ type AccountLifecycle = {
723
+ readonly status: "loading";
724
+ } | {
725
+ readonly status: "settingUp";
726
+ readonly step: AccountSetupStep;
727
+ } | {
728
+ readonly status: "ready";
729
+ readonly accountId: string;
730
+ readonly canTransact: boolean;
731
+ } | {
732
+ readonly status: "failed";
733
+ readonly at: AccountSetupStep;
734
+ readonly error: CapxulError;
735
+ };
736
+ declare function isSettingUpLifecycle(lifecycle: AccountLifecycle): boolean;
737
+ //#endregion
738
+ //#region src/client/account.d.ts
739
+ type AccountStatus = {
740
+ readonly status: "notAuthenticated";
741
+ } | {
742
+ readonly status: "accountRequired";
743
+ readonly requirement: AccountRequirement;
744
+ readonly chainId: number;
745
+ } | {
746
+ readonly status: "accountProviderReady";
747
+ readonly requirement: AccountRequirement;
748
+ readonly chainId: number;
749
+ readonly source: AccountProviderSource;
750
+ readonly signerAddress: Address$1;
751
+ } | {
752
+ readonly status: "accountPrepared";
753
+ readonly requirement: AccountRequirement;
754
+ readonly account: SmartAccount$1;
755
+ readonly deployment: {
756
+ readonly status: "counterfactual";
757
+ };
758
+ } | {
759
+ readonly status: "accountReady";
760
+ readonly requirement: AccountRequirement;
761
+ readonly account: SmartAccount$1 | null;
762
+ readonly deployment: {
763
+ readonly status: "counterfactual";
764
+ } | {
765
+ readonly status: "deployed";
766
+ readonly deployedAt: SmartAccount$1["deployedAt"];
767
+ };
768
+ };
769
+ /**
770
+ * Public consumer-facing surface (issue #159 · AC1+AC3). Exactly two
771
+ * methods. `provision` and `deploySafe` are intentionally NOT here —
772
+ * they are advanced/testing-only and will live on
773
+ * `client._internal.account` when sibling issue #161 lands. Per
774
+ * `docs/canon/rules/public-surface.md`, the narrowing is enforced at
775
+ * both the type level (the `keyof AccountMethods` extract is exactly
776
+ * `"getStatus" | "ensureReady"`) and at runtime (the bundle returned
777
+ * here has those two own-keys and nothing else).
778
+ *
779
+ * Per `docs/canon/conventions/flow-internal-substrate.md`, the
780
+ * `AccountStatus` discriminant — including the variants this slice can
781
+ * only reach via `getStatus` (e.g. `accountPrepared`) — is the durable
782
+ * shape consumers depend on. Sibling #161 will extend `ensureReady` to
783
+ * advance the ladder past `accountProviderReady` and from
784
+ * `accountPrepared` to `accountReady(deployed)`; until then, the type
785
+ * surface is stable and the runtime fixed-point is documented.
786
+ */
787
+ interface AccountMethods {
788
+ /**
789
+ * Post-auth account setup lifecycle — domain vocabulary over the internal
790
+ * readiness ladder + provisioning lane (#356).
791
+ */
792
+ getLifecycle(): Promise<CapxulResult<AccountLifecycle>>;
793
+ /** Resume setup after `failed` and return the updated lifecycle snapshot. */
794
+ retrySetup(): Promise<CapxulResult<AccountLifecycle>>;
795
+ /**
796
+ * Internal advanced surface (#161 · AC1). Reserved for the rebuild's
797
+ * own `ensureReady` upward transitions and for testing harnesses;
798
+ * consumers MUST NOT depend on this in production. Tagged
799
+ * `@internal-use` per `.claude/rules/flow-internal-substrate.md`.
800
+ *
801
+ * @internal-use
802
+ */
803
+ readonly _internal: AccountInternalSurface;
804
+ }
805
+ /**
806
+ * Internal `provision` + `deploySafe` arms exposed at
807
+ * `client._internal.account` (#161). Each returns `Promise<CapxulResult<T>>`
808
+ * with the same error catalog the public methods use.
809
+ *
810
+ * @internal-use
811
+ */
812
+ interface AccountInternalSurface {
813
+ provision(): Promise<CapxulResult<SmartAccount$1>>;
814
+ deploySafe(): Promise<CapxulResult<SmartAccount$1>>;
815
+ /** @internal-use Substrate readiness ladder — tests and e2e only. */
816
+ getStatus(): Promise<CapxulResult<AccountStatus>>;
817
+ /** @internal-use Lane runner — tests and e2e only. */
818
+ ensureReady(): Promise<CapxulResult<AccountStatus>>;
819
+ /** @internal-use Provisioning lane phase — tests and e2e only. */
820
+ getProvisioningPhase(): Promise<CapxulResult<ProvisioningPhase>>;
821
+ /** @internal-use Lane retry — tests and e2e only. */
822
+ retryProvisioning(): Promise<CapxulResult<ProvisioningPhase>>;
823
+ }
824
+ //#endregion
825
+ //#region src/client/binding.d.ts
826
+ interface BindingMethods {
827
+ readonly ensureResolved: (input: {
828
+ readonly email: string;
829
+ }) => Promise<CapxulResult<EmailBinding>>;
830
+ }
831
+ //#endregion
832
+ //#region src/client/accounts.d.ts
833
+ interface AccountsMethods {
834
+ read(options?: {
835
+ readonly signal?: AbortSignal;
836
+ }): Promise<CapxulResult<Account$1>>;
837
+ }
838
+ /**
839
+ * Faucet surface (dev-only). Deliberately OFF the public `AccountsMethods`;
840
+ * reachable only via `client._internal.accounts` (production-surface-policy.md).
841
+ * The reference CLI uses it behind a test-env gate — consumers never see `fund`.
842
+ */
843
+ interface AccountsFaucetMethods {
844
+ fund(amount: Money$1, options?: {
845
+ readonly signal?: AbortSignal;
846
+ }): Promise<CapxulResult<{
847
+ readonly txHash: string;
848
+ }>>;
849
+ }
850
+ //#endregion
851
+ //#region src/client/sub-accounts.d.ts
852
+ interface SubAccountsMethods {
853
+ create(accountId: AccountId, input: {
854
+ readonly name: string;
855
+ }, options?: {
856
+ readonly signal?: AbortSignal;
857
+ }): Promise<CapxulResult<SubAccount$1>>;
858
+ get(subAccountId: SubAccountId$1, options?: {
859
+ readonly signal?: AbortSignal;
860
+ }): Promise<CapxulResult<SubAccount$1 | null>>;
861
+ list(accountId: AccountId, options?: {
862
+ readonly signal?: AbortSignal;
863
+ }): Promise<CapxulResult<readonly SubAccount$1[]>>;
864
+ rename(subAccountId: SubAccountId$1, name: string, options?: {
865
+ readonly signal?: AbortSignal;
866
+ }): Promise<CapxulResult<SubAccount$1>>;
867
+ delete(subAccountId: SubAccountId$1, options?: {
868
+ readonly signal?: AbortSignal;
869
+ }): Promise<CapxulResult<void>>;
870
+ transfer(input: TransferInput, options?: {
871
+ readonly signal?: AbortSignal;
872
+ }): Promise<CapxulResult<TransferResult>>;
873
+ }
874
+ //#endregion
875
+ //#region src/client/org-spend-gate.d.ts
876
+ type SpendGateRecipients = "anyone" | readonly Address$1[];
877
+ type SpendGateSubAccountScope = {
878
+ readonly scope: "all";
879
+ } | {
880
+ readonly scope: "only";
881
+ readonly subAccountIds: readonly SubAccountId$1[];
882
+ };
883
+ //#endregion
884
+ //#region src/ports/org.d.ts
885
+ type CreateOrgPortInput = {
886
+ readonly input: CreateOrgInput;
887
+ };
888
+ type ReadOrgTreasuryInput = {
889
+ readonly orgId: OrgId$1;
890
+ };
891
+ type ListOrgsInput = Record<never, never>;
892
+ type ListOrgRolesInput = {
893
+ readonly orgId: OrgId$1;
894
+ };
895
+ type ListOrgMembersInput = {
896
+ readonly orgId: OrgId$1;
897
+ };
898
+ type InviteOrgMemberInput = {
899
+ readonly orgId: OrgId$1;
900
+ readonly input: InviteMemberInput;
901
+ };
902
+ type DetectPendingOrgInvitationsInput = Record<never, never>;
903
+ type DetectPendingOrgInvitationsResult$1 = {
904
+ readonly matched: readonly OrgId$1[];
905
+ };
906
+ type DeployOrgRolesInput = {
907
+ readonly orgId: OrgId$1;
908
+ };
909
+ type OrgRolesDeploymentResult = {
910
+ readonly orgId: OrgId$1;
911
+ readonly roles: readonly RoleView[];
912
+ };
913
+ type GrantOrgRoleInput = {
914
+ readonly orgId: OrgId$1;
915
+ readonly input: AssignRoleInput;
916
+ };
917
+ type RevokeOrgRoleInput = {
918
+ readonly orgId: OrgId$1;
919
+ readonly input: RemoveMemberInput;
920
+ };
921
+ type OrgSpendAuthority = {
922
+ readonly activeMember: boolean;
923
+ readonly subAccountBalanceRaw: string;
924
+ readonly recipients: SpendGateRecipients;
925
+ readonly subAccounts: SpendGateSubAccountScope;
926
+ readonly perTxCapRaw?: string | null;
927
+ readonly perDayCapRaw?: string | null;
928
+ readonly spentTodayRaw?: string | null;
929
+ readonly role?: string;
930
+ };
931
+ type ReadOrgSpendAuthorityInput = {
932
+ readonly orgId: OrgId$1;
933
+ readonly input: OrgSpendInput;
934
+ readonly amountRaw: string;
935
+ };
936
+ type SubmitOrgSpendInput = {
937
+ readonly orgId: OrgId$1;
938
+ readonly input: OrgSpendInput;
939
+ readonly amountRaw: string;
940
+ readonly authority: OrgSpendAuthority;
941
+ };
942
+ declare const OrgError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
943
+ readonly _tag: "OrgError";
944
+ } & Readonly<A>;
945
+ declare class OrgError extends OrgError_base<{
946
+ readonly operation: string;
947
+ readonly publicCode: CapxulErrorCode;
948
+ readonly publicError: CapxulError;
949
+ readonly cause: unknown;
950
+ readonly details?: CapxulErrorDetails;
951
+ }> {}
952
+ /**
953
+ * Live org seam. `createOrg` runs the SDK-orchestrated deploy (D10) and returns
954
+ * the created `OrgView` (its treasury is the real M2 `Account` over the Org
955
+ * Safe — $0 at creation, D3). `readTreasury` pulls the org's Account via RPC
956
+ * `balanceOf` (D3). `listOrgs` lists the orgs the authenticated user belongs to.
957
+ */
958
+ interface OrgPort {
959
+ createOrg(input: CreateOrgPortInput): Effect.Effect<OrgView, OrgError, never>;
960
+ readTreasury(input: ReadOrgTreasuryInput): Effect.Effect<Account$1, OrgError, never>;
961
+ listOrgs(input: ListOrgsInput): Effect.Effect<readonly OrgView[], OrgError, never>;
962
+ listRoles(input: ListOrgRolesInput): Effect.Effect<readonly RoleView[], OrgError, never>;
963
+ listMembers(input: ListOrgMembersInput): Effect.Effect<readonly MemberView[], OrgError, never>;
964
+ inviteMember(input: InviteOrgMemberInput): Effect.Effect<MemberView, OrgError, never>;
965
+ detectAndAcceptPendingInvitations(input: DetectPendingOrgInvitationsInput): Effect.Effect<DetectPendingOrgInvitationsResult$1, OrgError, never>;
966
+ }
967
+ interface OrgRolesDeploymentPort {
968
+ deployRoles(input: DeployOrgRolesInput): Effect.Effect<OrgRolesDeploymentResult, OrgError, never>;
969
+ grantRole(input: GrantOrgRoleInput): Effect.Effect<MemberView, OrgError, never>;
970
+ revokeRole(input: RevokeOrgRoleInput): Effect.Effect<void, OrgError, never>;
971
+ }
972
+ interface OrgSpendPort {
973
+ readSpendAuthority(input: ReadOrgSpendAuthorityInput): Effect.Effect<OrgSpendAuthority, OrgError, never>;
974
+ submitSpend(input: SubmitOrgSpendInput): Effect.Effect<OrgSpendResult, OrgError, never>;
975
+ }
976
+ //#endregion
977
+ //#region src/client/org.d.ts
978
+ /**
979
+ * A member's lifecycle status (D9 — unified `Member` with status
980
+ * `pending | active | revoked | expired`). `pending` = invited (incl. a
981
+ * non-user emailed into existence) but not yet a provisioned member with an
982
+ * on-chain grant; `active` = on-chain role granted; `revoked` = offboarded
983
+ * (on-chain REVOKE fired); `expired` = pending invitation timed out.
984
+ */
985
+ type MemberStatus = "pending" | "pending_safe" | "pending_grant" | "active" | "revoked" | "expired";
986
+ /**
987
+ * One Org you belong to (canon §C1 "Org list" — name, role, balance).
988
+ * `role` is the member's role label within THIS org. `treasury` is the M2
989
+ * `Account` over the Org Safe (D3). `handle` is the globally-unique,
990
+ * normalized org handle (D10a). Pure record of brand-typed fields — not a
991
+ * brand.
992
+ */
993
+ type OrgView = {
994
+ readonly id: OrgId$1;
995
+ readonly name: string;
996
+ readonly handle: string;
997
+ readonly safeAddress: Address$1; /** The viewing member's own role label within this org. */
998
+ readonly role: string; /** The Org treasury — the real M2 Account over the Org Safe (D3). */
999
+ readonly treasury: Account$1;
1000
+ };
1001
+ /**
1002
+ * One member of an Org (canon §C1 "Members" — name/email, role, status; D7/D8).
1003
+ * `personalSafeAddress` is the member-identity key (D7 — Safe-as-identity); it
1004
+ * is `null` while the member is still `pending` (emailed into existence but not
1005
+ * yet provisioned a personal Safe). `email` is the universal entry point (D8).
1006
+ */
1007
+ type MemberView = {
1008
+ readonly orgId: OrgId$1;
1009
+ readonly email: Email;
1010
+ readonly name: string | null; /** Member-identity key (D7). `null` until the invitee provisions a Safe. */
1011
+ readonly personalSafeAddress: Address$1 | null; /** The member's role label (maps deterministically to the on-chain `roleKey`, D9). */
1012
+ readonly role: string;
1013
+ readonly roleKey: RoleKey$1 | null;
1014
+ readonly status: MemberStatus;
1015
+ readonly grantTxHash: string | null;
1016
+ readonly revokeTxHash: string | null;
1017
+ };
1018
+ /**
1019
+ * A role's on-chain Level-1 spend cap (D4/D5 — physically enforced via Zodiac
1020
+ * Roles + Allowance). `perTx` / `perDay` are `Money`; `toRecipients` scopes the
1021
+ * allowed recipient set. Omitting a field means "unbounded on that axis"
1022
+ * (the Owner role).
1023
+ */
1024
+ type RoleSpendCap = {
1025
+ readonly perTx?: Money$1;
1026
+ readonly perDay?: Money$1;
1027
+ readonly toRecipients?: "anyone" | readonly Address$1[];
1028
+ };
1029
+ /**
1030
+ * The Capxul-owned Role DSL definition (D4). `label` becomes the sticky
1031
+ * bytes32 `roleKey` on-chain. `spend` compiles to Level-1 on-chain Zodiac
1032
+ * conditions; `subAccounts` + `canManage*` compile to Level-2 off-chain Convex
1033
+ * guards (D5).
1034
+ */
1035
+ type RoleDefinition = {
1036
+ readonly label: string;
1037
+ readonly spend?: RoleSpendCap;
1038
+ readonly subAccounts?: {
1039
+ readonly scope: "all" | readonly SubAccountId$1[];
1040
+ };
1041
+ readonly canManageMembers?: boolean;
1042
+ readonly canManageRoles?: boolean;
1043
+ };
1044
+ /**
1045
+ * One role seeded on an Org (canon §C1 "Roles" — label + caps; D4/D6).
1046
+ * `roleKey` is the on-chain bytes32 role key derived from the label. `definition`
1047
+ * is the full Role DSL entry.
1048
+ */
1049
+ type RoleView = {
1050
+ readonly orgId: OrgId$1;
1051
+ readonly label: string;
1052
+ readonly roleKey: RoleKey$1;
1053
+ readonly definition: RoleDefinition;
1054
+ };
1055
+ /** Built-in role templates that seed a new Org at creation (D6). */
1056
+ type OrgTemplate = "Solo" | "Startup" | "Custom";
1057
+ /**
1058
+ * Input to `capxul.createOrg` (S1, D10a, D14). `name` is the display name;
1059
+ * `handle` is the globally-unique normalized handle (`^[a-z0-9-]{3,32}$`, D10a);
1060
+ * `template` seeds the initial role set (D6); `country` is stored unvalidated
1061
+ * (D14 — KYB deferred). For `template: "Custom"`, `roles` carries the authored
1062
+ * `RoleDefinition[]`.
1063
+ */
1064
+ type CreateOrgInput = {
1065
+ readonly name: string;
1066
+ readonly handle: string;
1067
+ readonly template: OrgTemplate;
1068
+ readonly country?: string;
1069
+ readonly roles?: readonly RoleDefinition[];
1070
+ };
1071
+ /**
1072
+ * Input to `org(orgId).invite` (S3, D8). Email is the universal entry point —
1073
+ * inviting an address that is not yet a Capxul user auto-creates a `pending`
1074
+ * membership that resolves on sign-in (the virality loop). `role` names the
1075
+ * role label the invitee is granted on accept.
1076
+ */
1077
+ type InviteMemberInput = {
1078
+ readonly email: string;
1079
+ readonly role: string;
1080
+ };
1081
+ /**
1082
+ * Input to `org(orgId).removeMember` (S3, D8). Keyed on the member's personal
1083
+ * Safe address (D7 — Safe-as-identity). Drives the on-chain REVOKE + Convex
1084
+ * mirror.
1085
+ */
1086
+ type RemoveMemberInput = {
1087
+ readonly memberSafeAddress: Address$1;
1088
+ };
1089
+ /**
1090
+ * Input to `org(orgId).assignRole` (S3, D7/D9). Keyed on the member's personal
1091
+ * Safe address (D7). Drives the on-chain GRANT + Convex mirror; the `role`
1092
+ * label maps deterministically to the on-chain `roleKey`.
1093
+ */
1094
+ type AssignRoleInput = {
1095
+ readonly memberSafeAddress: Address$1;
1096
+ readonly role: string;
1097
+ };
1098
+ /**
1099
+ * Input to `org(orgId).spend` (S4, capstone, D5). A member spends `amount` from
1100
+ * a scoped sub-account `from` to `to`, gated Level 1 (Zodiac cap) + Level 2
1101
+ * (envelope scope/balance). One UserOp: signer → personal Safe → Org Roles
1102
+ * modifier → `CapxulPayments.send`.
1103
+ */
1104
+ type OrgSpendInput = {
1105
+ /** The sub-account (envelope) the spend draws from (Level-2 scope, D5). */readonly from: SubAccountId$1;
1106
+ readonly to: Address$1;
1107
+ readonly amount: Money$1;
1108
+ };
1109
+ /** Result of a settled Org spend — the settling transaction hash (S4). */
1110
+ type OrgSpendResult = {
1111
+ readonly txHash: string;
1112
+ };
1113
+ type DetectPendingOrgInvitationsResult = {
1114
+ readonly matched: readonly OrgId$1[];
1115
+ };
1116
+ /**
1117
+ * Entity-scoped Org method bundle, returned by `capxul.org(orgId)`. Every
1118
+ * method names the entity implicitly via the closed-over `orgId` (D13 — no
1119
+ * stateful active context). `treasury()` returns the real M2 `Account` over
1120
+ * the Org Safe (D3).
1121
+ */
1122
+ interface OrgScopedMethods {
1123
+ /** The Org treasury — the real M2 Account over the Org Safe (D3). */
1124
+ treasury(options?: {
1125
+ readonly signal?: AbortSignal;
1126
+ }): Promise<CapxulResult<Account$1>>;
1127
+ members(options?: {
1128
+ readonly signal?: AbortSignal;
1129
+ }): Promise<CapxulResult<readonly MemberView[]>>;
1130
+ roles(options?: {
1131
+ readonly signal?: AbortSignal;
1132
+ }): Promise<CapxulResult<readonly RoleView[]>>;
1133
+ deployRoles(options?: {
1134
+ readonly signal?: AbortSignal;
1135
+ }): Promise<CapxulResult<readonly RoleView[]>>;
1136
+ invite(input: InviteMemberInput, options?: {
1137
+ readonly signal?: AbortSignal;
1138
+ }): Promise<CapxulResult<MemberView>>;
1139
+ removeMember(input: RemoveMemberInput, options?: {
1140
+ readonly signal?: AbortSignal;
1141
+ }): Promise<CapxulResult<void>>;
1142
+ assignRole(input: AssignRoleInput, options?: {
1143
+ readonly signal?: AbortSignal;
1144
+ }): Promise<CapxulResult<MemberView>>;
1145
+ spend(input: OrgSpendInput, options?: {
1146
+ readonly signal?: AbortSignal;
1147
+ }): Promise<CapxulResult<OrgSpendResult>>;
1148
+ }
1149
+ type OrgsMethod = {
1150
+ (options?: {
1151
+ readonly signal?: AbortSignal;
1152
+ }): Promise<CapxulResult<readonly OrgView[]>>;
1153
+ detectAndAcceptPendingInvitations(options?: {
1154
+ readonly signal?: AbortSignal;
1155
+ }): Promise<CapxulResult<DetectPendingOrgInvitationsResult>>;
1156
+ };
1157
+ /**
1158
+ * Top-level Org method bundle, exposed at `client.org` / `client.orgs` /
1159
+ * `client.createOrg`. `org(orgId)` resolves the entity-scoped bundle (D13).
1160
+ */
1161
+ interface OrgMethods {
1162
+ createOrg(input: CreateOrgInput, options?: {
1163
+ readonly signal?: AbortSignal;
1164
+ }): Promise<CapxulResult<OrgView>>;
1165
+ readonly orgs: OrgsMethod;
1166
+ /** Resolve the entity-scoped bundle for a specific Org (D13). */
1167
+ org(orgId: OrgId$1): OrgScopedMethods;
1168
+ }
1169
+ //#endregion
1170
+ //#region src/client/create-capxul-client.d.ts
1171
+ interface CapxulClient {
1172
+ readonly auth: AuthMethods;
1173
+ readonly smartAccount: SmartAccountMethods;
1174
+ readonly identity: IdentityMethods;
1175
+ /**
1176
+ * Consumer-facing account readiness surface (issue #159 · AC1+AC3).
1177
+ * Exactly `getStatus` + `ensureReady`; the `_internal.account`
1178
+ * namespace with `provision` + `deploySafe` lands in sibling #161.
1179
+ */
1180
+ readonly account: AccountMethods;
1181
+ /** Email address binding resolution (#338). */
1182
+ readonly binding: BindingMethods;
1183
+ /**
1184
+ * Consumer-facing logical Account money read (M2 Slice S1a · #265).
1185
+ * Returns `{ balance, available }` as `Money` — never wei or token units.
1186
+ */
1187
+ readonly accounts: AccountsMethods;
1188
+ /** Sub-account lifecycle (M2 Slice S2a · #267). Transfer lands in S2b. */
1189
+ readonly subAccounts: SubAccountsMethods;
1190
+ /**
1191
+ * Organization domain surface (canon `org-domain-model.md` §C2/§C3, D13).
1192
+ * `createOrg(input)` creates an Org; `orgs()` lists the Orgs you belong to;
1193
+ * `org(orgId)` resolves the entity-scoped bundle (treasury / members / roles
1194
+ * / invite / removeMember / assignRole / spend). Explicit entity scoping —
1195
+ * NO stateful active context (D13). RED until the S1→S4 slices fill it.
1196
+ */
1197
+ readonly createOrg: OrgMethods["createOrg"];
1198
+ readonly orgs: OrgMethods["orgs"];
1199
+ readonly org: OrgMethods["org"];
1200
+ /** Resolved bootstrap for this client instance (chain, auth URLs, etc.). */
1201
+ readonly bootstrap: BootstrapResolution;
1202
+ /**
1203
+ * Internal observation namespace. Consumers MUST NOT drive the actor
1204
+ * directly — use the method bundles instead.
1205
+ *
1206
+ * @internal-use
1207
+ */
1208
+ readonly _internal: {
1209
+ readonly authActor: AuthFlowObserver;
1210
+ /**
1211
+ * Dev-only faucet bundle (production-surface-policy.md). `fund` lives here,
1212
+ * NOT on the public `client.accounts` surface.
1213
+ */
1214
+ readonly accounts: AccountsFaucetMethods;
1215
+ readonly close?: () => Promise<void>;
1216
+ };
1217
+ }
1218
+ interface CreateCapxulClientInput {
1219
+ /**
1220
+ * The 12-port `FlowPorts` bundle. The factory narrows this to the
1221
+ * 3-port AuthFlow subset (`authClient`, `clock`, `telemetry`) for
1222
+ * the flow internally, and uses additional ports (`identity`,
1223
+ * `smartAccount`) for the method bundles.
1224
+ */
1225
+ readonly ports: FlowPorts;
1226
+ /**
1227
+ * Bootstrap resolution for this client instance. The factory closes over
1228
+ * `bootstrap.chainId` internally; consumers do not pass a standalone
1229
+ * chainId and no method boundary accepts one.
1230
+ */
1231
+ readonly bootstrap: BootstrapResolution;
1232
+ /**
1233
+ * Optional AuthCachePort. When omitted, `detectAuthCacheAdapter()` selects
1234
+ * the appropriate per-environment adapter (Browser/FileSystem/InMemory).
1235
+ */
1236
+ readonly authCache?: AuthCachePort;
1237
+ /**
1238
+ * Optional AbortSignal reserved for callers that coordinate client lifetime.
1239
+ */
1240
+ readonly signal?: AbortSignal;
1241
+ /**
1242
+ * OTP TTL window in ms. Default 300_000 (5 min).
1243
+ */
1244
+ readonly otpTtlMs?: number;
1245
+ /**
1246
+ * Optional per-call timeout for invoked auth requests.
1247
+ */
1248
+ readonly invokeTimeoutMs?: number;
1249
+ /**
1250
+ * Init-time account readiness target (issue #159 · AC4). The factory
1251
+ * closes over this so `client.account.{getStatus,ensureReady}` don't
1252
+ * need to take a per-call requirement arg. REQUIRED — there is no
1253
+ * hidden default. Consumers building flows that never need a smart
1254
+ * account pass `"none"`; flows that want a counterfactual deposit
1255
+ * address pass `"counterfactual"`; flows that need an on-chain Safe
1256
+ * pass `"deployed"` (deploy path lands in sibling #161).
1257
+ */
1258
+ readonly requirement: AccountRequirement;
1259
+ /**
1260
+ * Consumer-held signer (backend-orchestrated-deploy.md). Required for
1261
+ * `requirement: "deployed"` flows: `provision` reads `getAddress()` and the
1262
+ * deploy path signs the backend's SafeOp digest via `signUserOpHash()`. The
1263
+ * backend orchestrates build + gas + paymaster + submit — the client never
1264
+ * holds an RPC URL, a gas-sponsorship policy, or a bundler.
1265
+ */
1266
+ readonly signer?: CapxulSigner;
1267
+ /**
1268
+ * Optional live Org-deploy lane (canon D10 SDK-orchestrated Org Safe deploy +
1269
+ * D3 RPC treasury). When supplied, `client.createOrg` / `org(id).treasury`
1270
+ * run the live path (real deploy + on-chain balance); when omitted, the
1271
+ * hermetic `$0` path runs (a fresh Org has no on-chain funds). The adapter
1272
+ * that CONSTRUCTS this port (deployer key + RPC + authenticated Convex seam)
1273
+ * is wired by the CLI deploy-stack; the factory only threads it through.
1274
+ */
1275
+ readonly orgDeploymentPort?: OrgPort;
1276
+ /** Locked D6 data-port name. Prefer over `orgDeploymentPort` in new code. */
1277
+ readonly orgPort?: OrgPort;
1278
+ /** S2 deploy/grant/revoke port. S2 uses deploy; S3 adds grant/revoke. */
1279
+ readonly orgRolesDeploymentPort?: OrgRolesDeploymentPort;
1280
+ /** S4 treasury-spend authority + submit port. */
1281
+ readonly orgSpendPort?: OrgSpendPort;
1282
+ readonly orgDeploymentConfig?: SafeDeploymentConfig;
1283
+ }
1284
+ declare function assembleCapxulClient(input: CreateCapxulClientInput): CapxulClient;
1285
+ //#endregion
1286
+ //#region src/adapters/openfort/embedded-wallet-port.d.ts
1287
+ /**
1288
+ * Minimal Openfort embedded-wallet surface for hermetic tests and
1289
+ * `openfortEmbeddedSigner`. Keeps Convex / Shield secrets out of the SDK.
1290
+ */
1291
+ interface OpenfortEmbeddedWalletPort {
1292
+ /** Owner EOA address — must stay stable for the lifetime of this port. */
1293
+ getAddress(): Promise<string>;
1294
+ /**
1295
+ * Sign a 32-byte SafeOp digest without EIP-191 prefixing (backend-orchestrated
1296
+ * deploy contract).
1297
+ */
1298
+ signRawDigest(hash: Hex): Promise<Hex>;
1299
+ }
1300
+ /** Openfort `embeddedWallet` subset used by `openfortEmbeddedWalletPort`. */
1301
+ interface OpenfortEmbeddedWalletApi {
1302
+ get(): Promise<{
1303
+ readonly address: string;
1304
+ }>;
1305
+ signMessage(message: string | Uint8Array, options?: {
1306
+ readonly hashMessage?: boolean;
1307
+ readonly arrayifyMessage?: boolean;
1308
+ }): Promise<string>;
1309
+ }
1310
+ declare function openfortEmbeddedWalletPort(input: {
1311
+ readonly embeddedWallet: OpenfortEmbeddedWalletApi;
1312
+ readonly ensureReady?: () => Promise<void>;
1313
+ }): OpenfortEmbeddedWalletPort;
1314
+ //#endregion
1315
+ //#region src/openfort-embedded-signer.d.ts
1316
+ interface OpenfortEmbeddedSignerInput {
1317
+ readonly wallet: OpenfortEmbeddedWalletPort;
1318
+ }
1319
+ /** Browser helper: wrap an initialized Openfort `embeddedWallet` API. */
1320
+ declare function openfortEmbeddedSignerFromWallet(input: {
1321
+ readonly embeddedWallet: OpenfortEmbeddedWalletApi;
1322
+ readonly ensureWalletReady?: () => Promise<void>;
1323
+ }): CapxulSigner;
1324
+ /**
1325
+ * Browser `CapxulSigner` backed by an Openfort embedded wallet (#335).
1326
+ * Signs the backend's SafeOp digest via raw `signMessage` (no EIP-191 prefix)
1327
+ * and verifies recovery before the backend submits.
1328
+ */
1329
+ declare function openfortEmbeddedSigner(input: OpenfortEmbeddedSignerInput): CapxulSigner;
1330
+ //#endregion
1331
+ //#region src/production.d.ts
1332
+ /**
1333
+ * Consumer-facing `createCapxulClient` input (SDK DX public surface · #326).
1334
+ * The publishable key is the primary input; bootstrap host, invoke timeout,
1335
+ * runtime detection, and auth-cache selection are SDK-owned defaults.
1336
+ */
1337
+ interface CapxulClientInput {
1338
+ readonly publishableKey: string;
1339
+ /**
1340
+ * Init-time account readiness target (issue #159 · AC4). Threaded into
1341
+ * `assembleCapxulClient` so `client.account.{getStatus,ensureReady}` reflect
1342
+ * the consumer's chosen requirement. Optional — defaults to `"none"` (SDK
1343
+ * publish readiness · I3) so `createCapxulClient({ publishableKey })` works
1344
+ * with no account lane.
1345
+ */
1346
+ readonly requirement?: AccountRequirement;
1347
+ /**
1348
+ * Consumer-held signer (backend-orchestrated-deploy.md). Required for
1349
+ * `requirement: "deployed"` flows: `provision` reads `getAddress()` and the
1350
+ * deploy path signs the backend's SafeOp digest via `signUserOpHash()`. The
1351
+ * backend orchestrates build + gas + paymaster + submit — the client never
1352
+ * holds an RPC URL, a gas-sponsorship policy, or a bundler.
1353
+ */
1354
+ readonly signer?: CapxulSigner;
1355
+ }
1356
+ //#endregion
1357
+ //#region src/client/create-capxul-client-from-production.d.ts
1358
+ /** Consumer-facing factory — accepts only production-meaningful inputs (#326). */
1359
+ declare function createCapxulClient(input: CapxulClientInput): Promise<CapxulResult<CapxulClient>>;
1360
+ //#endregion
1361
+ export { type Account, type AccountLifecycle, type AccountMethods, type AccountProvider, type AccountProviderSource, type AccountRequirement, type AccountSetupStep, type AccountsMethods, type Address, type AssignRoleInput, type AuthMethods, type AuthSession, type AuthUserId, type BindingMethods, type CapxulClient, type CapxulClientInput, type CapxulResult, type CapxulSigner, type CreateCapxulClientInput, type CreateOrgInput, type DetectPendingOrgInvitationsResult, type Eip1193Provider, type Eip1193RequestProvider, type EmailBinding, type IdentityMethods, type InviteMemberInput, type MemberStatus, type MemberView, type Money, type OpenfortEmbeddedSignerInput, type OpenfortEmbeddedWalletApi, type OpenfortEmbeddedWalletPort, type OrgId, type OrgMethods, type OrgScopedMethods, type OrgSpendInput, type OrgSpendResult, type OrgTemplate, type OrgView, type Profile, type RemoveMemberInput, type RoleDefinition, type RoleKey, type RoleSpendCap, type RoleView, type Session, type SmartAccount, type SmartAccountMethods, type SubAccount, type SubAccountId, type SubAccountsMethods, type TransferEndpoint, type TransferInput, type TransferResult, assembleCapxulClient, createCapxulClient, eip1193AccountProvider, injectedWalletSigner, isSettingUpLifecycle, localPrivateKeyAccountProvider, openfortEmbeddedAccountProvider, openfortEmbeddedSigner, openfortEmbeddedSignerFromWallet, openfortEmbeddedWalletPort };
1362
+ //# sourceMappingURL=index.d.mts.map