@capxul/sdk 0.2.0-alpha.5 → 1.0.0-alpha.7

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/dist/index.d.mts CHANGED
@@ -1,13 +1,11 @@
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-oaYGfjDe.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";
1
+ import { A as SubAccount, C as PublishableKey, D as RunId, E as RoleKey, F as CapxulErrorDetails, I as FailureMode, N as CapxulError, O as SessionToken, P as CapxulErrorCode, S as Profile$1, T as PublishableKeyRecord, _ as EpochMs, a as AnonymousDistinctId, b as Money, c as AuthUserId, d as CountryCode, f as CurrencyCode, g as Email, h as DurationMs, i as AllowedOrigin, j as SubAccountId, k as SmartAccount$1, m as DocumentHash, n as AccountId, o as AppId, p as DeveloperApplication, r as Address, s as AuthSession, t as Account, u as ChainId, w as PublishableKeyId, x as OrgId } from "./index-CTXgQ_xR.mjs";
2
+ import { _ as CachedJwt, a as AccountProviderSource, c as eip1193AccountProvider, d as Profile, f as Session, h as AuthCachePort, i as AccountProvider, l as localPrivateKeyAccountProvider, n as Eip1193RequestProvider, o as AccountRequirement, p as SmartAccount, r as injectedWalletSigner, s as Eip1193Provider, t as CapxulSigner, u as CapxulResult } from "./signer-DqDtJU1l.mjs";
3
+ import { a as SafeDeploymentEvidence, n as SafeDeploymentConfig } from "./safe-deployment-D3k9yndM.mjs";
8
4
  import { Hex } from "viem";
5
+ import { Context, Effect, Layer, Request } from "effect";
9
6
  import { Schema } from "@effect/schema";
10
7
  import { FunctionReference } from "convex/server";
8
+ import { Machine } from "@effect/experimental";
11
9
 
12
10
  //#region src/ports/auth-client.d.ts
13
11
  type AuthClientOperationOptions = {
@@ -41,8 +39,8 @@ declare class AuthClientError extends AuthClientError_base<{
41
39
  interface AuthClientPort {
42
40
  canSendOtp(input: CanSendOtpInput, options?: AuthClientOperationOptions): Effect.Effect<CanSendOtpStatus, AuthClientError>;
43
41
  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>;
42
+ verifyOtp(input: VerifyOtpInput, options?: AuthClientOperationOptions): Effect.Effect<AuthSession, AuthClientError>;
43
+ getSession(options?: AuthClientOperationOptions): Effect.Effect<AuthSession | null, AuthClientError>;
46
44
  signOut(options?: AuthClientOperationOptions): Effect.Effect<void, AuthClientError>;
47
45
  /**
48
46
  * Fetches a Convex-aud JWT from `/api/auth/convex/token` (W7). Server mints
@@ -67,12 +65,48 @@ declare class ClockError extends ClockError_base<{
67
65
  readonly cause: unknown;
68
66
  }> {}
69
67
  //#endregion
70
- //#region src/ports/telemetry.d.ts
68
+ //#region ../observability/src/telemetry-port.d.ts
69
+ /**
70
+ * Context for reporting handled errors via `reportHandledError`.
71
+ * Carries structured metadata extracted from the error context.
72
+ */
73
+ interface HandledErrorReportContext$1 {
74
+ readonly layer?: string;
75
+ readonly operation?: string;
76
+ readonly failure_mode?: FailureMode;
77
+ readonly provider?: string;
78
+ }
79
+ /**
80
+ * Canonical TelemetryPort interface. Every adapter (production, test, in-memory)
81
+ * implements this contract. All methods return `Effect<void, never>` —
82
+ * fire-and-forget, defects are caught and traced.
83
+ */
71
84
  interface TelemetryPort {
72
85
  readonly emit: (event: TelemetryEvent) => Effect.Effect<void, never>;
73
86
  readonly identify: (input: TelemetryIdentifyInput) => Effect.Effect<void, never>;
74
87
  readonly group: (input: TelemetryGroupInput) => Effect.Effect<void, never>;
75
88
  readonly reset: () => Effect.Effect<void, never>;
89
+ readonly reportHandledError?: (error: CapxulError, context?: HandledErrorReportContext$1) => Effect.Effect<void, never>;
90
+ }
91
+ //#endregion
92
+ //#region ../observability/src/index.d.ts
93
+ declare const TELEMETRY_EVENT_NAMES: readonly ["auth_otp_requested", "auth_otp_delivered", "auth_otp_expired", "auth_verified", "auth_failed", "auth_signed_out", "provisioning_safe_created", "provisioning_safe_confirmed", "bootstrap_resolved", "bootstrap_failed", "account_balance_read", "account_balance_failed", "faucet_requested", "faucet_confirmed", "faucet_failed", "subaccount_created", "subaccount_renamed", "subaccount_deleted", "subaccount_op_failed", "transfer_requested", "transfer_confirmed", "transfer_failed", "org_create_started", "org_safe_created", "org_safe_confirmed", "org_roles_seeded", "org_created", "org_create_failed", "org_invite_sent", "org_invite_accepted", "org_role_granted", "org_member_active", "org_member_removed", "org_invite_expired", "org_role_grant_failed", "payment_requested", "payment_resolved", "payment_document_attached", "payment_submitted", "payment_settled", "payment_claimed", "payment_cancelled", "payment_redirected", "payment_failed", "stream_created", "stream_claimed", "stream_cancelled", "stream_completed", "stream_failed", "withdrawal_requested", "withdrawal_submitted", "withdrawal_settled", "withdrawal_failed"];
94
+ type TelemetryEventName = (typeof TELEMETRY_EVENT_NAMES)[number];
95
+ type TelemetryProps = Record<string, unknown>;
96
+ type TelemetryEvent = {
97
+ readonly name: TelemetryEventName;
98
+ readonly props?: TelemetryProps | undefined;
99
+ };
100
+ interface TelemetryIdentifyInput {
101
+ readonly distinctId: string;
102
+ readonly anonDistinctId?: AnonymousDistinctId;
103
+ readonly traits?: TelemetryProps;
104
+ readonly properties?: TelemetryProps;
105
+ }
106
+ interface TelemetryGroupInput {
107
+ readonly groupType: string;
108
+ readonly groupKey: string;
109
+ readonly properties?: TelemetryProps;
76
110
  }
77
111
  //#endregion
78
112
  //#region src/flows/auth.d.ts
@@ -83,7 +117,7 @@ type AuthFlowState = "idle" | "sending_otp" | "otp_requested" | "verifying" | "a
83
117
  interface AuthFlowContext {
84
118
  readonly state: AuthFlowState;
85
119
  readonly email: Email | null;
86
- readonly session: AuthSession$1 | null;
120
+ readonly session: AuthSession | null;
87
121
  readonly otpRequestedAt: EpochMs | null;
88
122
  readonly anonDistinctId?: AnonymousDistinctId;
89
123
  readonly error: CapxulError | null;
@@ -126,41 +160,6 @@ interface EnvPort {
126
160
  readonly has: (key: EnvKey) => Effect.Effect<boolean, EnvError, never>;
127
161
  }
128
162
  //#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
163
  //#region src/ports/transport.d.ts
165
164
  type TransportOperationKind = "query" | "mutation" | "action";
166
165
  type TransportRequest<TArgs = unknown> = {
@@ -209,6 +208,9 @@ type BootstrapResolution = {
209
208
  readonly expiresIn: DurationMs;
210
209
  readonly authBaseUrl: string;
211
210
  readonly convexUrl: string;
211
+ readonly siteBaseUrl: string;
212
+ readonly openfortPublishableKey: string;
213
+ readonly shieldPublishableKey: string;
212
214
  };
213
215
  type BootstrapErrorKind = "notAuthenticated" | "network" | "provider" | "malformedBody" | "invalidInput" | "rateLimited";
214
216
  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 & {
@@ -299,22 +301,22 @@ interface ConvexCallPort {
299
301
  //#endregion
300
302
  //#region src/ports/credentials.d.ts
301
303
  type CreateApplicationInput = {
302
- readonly authUserId: AuthUserId$1;
304
+ readonly authUserId: AuthUserId;
303
305
  readonly name: string;
304
306
  readonly allowedOrigins: readonly AllowedOrigin[];
305
307
  };
306
308
  type MintKeyInput = {
307
309
  readonly applicationId: AppId;
308
- readonly authUserId: AuthUserId$1;
310
+ readonly authUserId: AuthUserId;
309
311
  };
310
312
  type RotateKeyInput = {
311
313
  readonly keyId: PublishableKeyId;
312
- readonly authUserId: AuthUserId$1;
314
+ readonly authUserId: AuthUserId;
313
315
  readonly graceMs: DurationMs;
314
316
  };
315
317
  type RevokeKeyInput = {
316
318
  readonly keyId: PublishableKeyId;
317
- readonly authUserId: AuthUserId$1;
319
+ readonly authUserId: AuthUserId;
318
320
  };
319
321
  type RotateKeyResult = {
320
322
  readonly active: PublishableKeyRecord;
@@ -331,7 +333,7 @@ declare class CredentialsError extends CredentialsError_base<{
331
333
  readonly details?: CapxulErrorDetails;
332
334
  }> {}
333
335
  interface CredentialsPort {
334
- listApplications(authUserId: AuthUserId$1): Effect.Effect<readonly DeveloperApplication[], CredentialsError>;
336
+ listApplications(authUserId: AuthUserId): Effect.Effect<readonly DeveloperApplication[], CredentialsError>;
335
337
  createApplication(input: CreateApplicationInput): Effect.Effect<DeveloperApplication, CredentialsError>;
336
338
  mintPublishableKey(input: MintKeyInput): Effect.Effect<PublishableKeyRecord, CredentialsError>;
337
339
  rotatePublishableKey(input: RotateKeyInput): Effect.Effect<RotateKeyResult, CredentialsError>;
@@ -340,13 +342,13 @@ interface CredentialsPort {
340
342
  //#endregion
341
343
  //#region src/ports/identity.d.ts
342
344
  type CreateIdentityInput = {
343
- readonly authUserId: AuthUserId$1;
345
+ readonly authUserId: AuthUserId;
344
346
  readonly email: Email;
345
347
  readonly displayName?: string;
346
348
  readonly country?: CountryCode;
347
349
  };
348
350
  type UpdateIdentityInput = {
349
- readonly authUserId: AuthUserId$1;
351
+ readonly authUserId: AuthUserId;
350
352
  readonly displayName?: string;
351
353
  readonly country?: CountryCode;
352
354
  };
@@ -361,15 +363,14 @@ declare class IdentityError extends IdentityError_base<{
361
363
  readonly details?: CapxulErrorDetails;
362
364
  }> {}
363
365
  interface IdentityPort {
364
- loadByAuthUserId(authUserId: AuthUserId$1): Effect.Effect<Profile$1 | null, IdentityError, never>;
366
+ loadByAuthUserId(authUserId: AuthUserId): Effect.Effect<Profile$1 | null, IdentityError, never>;
365
367
  create(input: CreateIdentityInput): Effect.Effect<Profile$1, IdentityError, never>;
366
368
  update(input: UpdateIdentityInput): Effect.Effect<Profile$1, IdentityError, never>;
367
369
  }
368
370
  //#endregion
369
371
  //#region src/ports/smart-account.d.ts
370
372
  type ProvisionInput = {
371
- readonly authUserId: AuthUserId$1;
372
- readonly signerAddress: Address$1;
373
+ readonly authUserId: AuthUserId;
373
374
  readonly chainId: ChainId;
374
375
  };
375
376
  /**
@@ -387,9 +388,9 @@ type ProvisionInput = {
387
388
  * `eth_getUserOperationReceipt(userOpHash)` to re-verify and derive.
388
389
  */
389
390
  type ConfirmDeploymentInput = {
390
- readonly authUserId: AuthUserId$1;
391
+ readonly authUserId: AuthUserId;
391
392
  readonly chainId: ChainId;
392
- readonly safeAddress: Address$1;
393
+ readonly safeAddress: Address;
393
394
  readonly evidence: SafeDeploymentEvidence;
394
395
  /**
395
396
  * Optional live-E2E correlation id. This does not prove deployment; the
@@ -398,41 +399,16 @@ type ConfirmDeploymentInput = {
398
399
  */
399
400
  readonly telemetryRunId?: RunId;
400
401
  };
401
- /** Opaque wire form of the backend-built deployment UserOperation (hex strings). */
402
- type DeploymentUserOpFields = {
403
- readonly sender: string;
404
- readonly nonce: string;
405
- readonly factory: string;
406
- readonly factoryData: string;
407
- readonly callData: string;
408
- readonly callGasLimit: string;
409
- readonly verificationGasLimit: string;
410
- readonly preVerificationGas: string;
411
- readonly maxFeePerGas: string;
412
- readonly maxPriorityFeePerGas: string;
413
- readonly paymaster: string;
414
- readonly paymasterVerificationGasLimit: string;
415
- readonly paymasterPostOpGasLimit: string;
416
- readonly paymasterData: string;
417
- };
418
- /** Input to `SmartAccountPort.deployPrepare` (backend-orchestrated-deploy.md · #289). */
419
- type DeployPrepareInput = {
420
- readonly authUserId: AuthUserId$1;
421
- readonly chainId: ChainId;
422
- readonly telemetryRunId?: RunId;
423
- };
424
- /** Backend-built deployment UserOp + the EIP-712 SafeOp digest the CapxulSigner signs. */
425
- type DeployPrepareResult = {
426
- readonly digest: Hex;
427
- readonly safeAddress: Address$1;
428
- readonly userOp: DeploymentUserOpFields;
429
- };
430
- /** Input to `SmartAccountPort.deploySubmit` — the consumer-signed deployment UserOp. */
431
- type DeploySubmitInput = {
432
- readonly authUserId: AuthUserId$1;
402
+ /**
403
+ * Input to `SmartAccountPort.claim` (PRD #462). The authenticated session
404
+ * reports the browser-created signer address; the BACKEND builds and
405
+ * bootstrap-signs the claim userOp (deploy + swapOwner) — the consumer signs
406
+ * nothing at claim.
407
+ */
408
+ type ClaimInput = {
409
+ readonly authUserId: AuthUserId;
433
410
  readonly chainId: ChainId;
434
- readonly userOp: DeploymentUserOpFields;
435
- readonly signature: Hex;
411
+ readonly signerAddress: Address;
436
412
  readonly telemetryRunId?: RunId;
437
413
  };
438
414
  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 & {
@@ -446,8 +422,8 @@ declare class SmartAccountError extends SmartAccountError_base<{
446
422
  readonly details?: CapxulErrorDetails;
447
423
  }> {}
448
424
  interface SmartAccountPort {
449
- loadByAuthUserId(authUserId: AuthUserId$1): Effect.Effect<SmartAccount$1 | null, SmartAccountError, never>;
450
- loadBySmartAccountAddress(address: Address$1): Effect.Effect<SmartAccount$1 | null, SmartAccountError, never>;
425
+ loadByAuthUserId(authUserId: AuthUserId): Effect.Effect<SmartAccount$1 | null, SmartAccountError, never>;
426
+ loadBySmartAccountAddress(address: Address): Effect.Effect<SmartAccount$1 | null, SmartAccountError, never>;
451
427
  provision(input: ProvisionInput): Effect.Effect<SmartAccount$1, SmartAccountError, never>;
452
428
  /**
453
429
  * Persist on-chain Safe-deployment evidence. The backend re-verifies
@@ -460,18 +436,13 @@ interface SmartAccountPort {
460
436
  */
461
437
  confirmDeployment(input: ConfirmDeploymentInput): Effect.Effect<SmartAccount$1, SmartAccountError, never>;
462
438
  /**
463
- * Build + gas-fill + paymaster-sponsor the deployment UserOperation
464
- * server-side and return the EIP-712 `SafeOp` digest for the consumer's
465
- * `CapxulSigner` to sign. The client never holds RPC, a gas policy, or a
466
- * bundler see `docs/canon/decisions/backend-orchestrated-deploy.md`.
467
- */
468
- deployPrepare(input: DeployPrepareInput): Effect.Effect<DeployPrepareResult, SmartAccountError, never>;
469
- /**
470
- * Submit the signed deployment UserOperation through the bundler and confirm
471
- * `deployedAt` on-chain (absorbing the `confirmDeployment` verify path).
472
- * Returns the updated `SmartAccount` row.
439
+ * Claim the account (PRD #462): the backend builds, bootstrap-signs, and
440
+ * submits ONE sponsored userOp deploy (when undeployed) + swapOwner
441
+ * (bootstrap → `signerAddress`). Idempotent; returns the updated row. When
442
+ * another claim is in flight the row comes back with `claimedAt: null` —
443
+ * callers poll lifecycle until the claim lands.
473
444
  */
474
- deploySubmit(input: DeploySubmitInput): Effect.Effect<SmartAccount$1, SmartAccountError, never>;
445
+ claim(input: ClaimInput): Effect.Effect<SmartAccount$1, SmartAccountError, never>;
475
446
  }
476
447
  //#endregion
477
448
  //#region src/ports/account-read.d.ts
@@ -480,7 +451,7 @@ type ReadAccountBalanceInput = {
480
451
  };
481
452
  type FundFromFaucetInput = {
482
453
  readonly chainId: ChainId;
483
- readonly amount: Money$1;
454
+ readonly amount: Money;
484
455
  };
485
456
  type FundFromFaucetResult = {
486
457
  readonly txHash: string;
@@ -500,7 +471,7 @@ declare class AccountReadError extends AccountReadError_base<{
500
471
  * live RPC `balanceOf` pull; the adapter lifts wire integers to `Money`.
501
472
  */
502
473
  interface AccountReadPort {
503
- readBalance(input: ReadAccountBalanceInput): Effect.Effect<Account$1, AccountReadError, never>;
474
+ readBalance(input: ReadAccountBalanceInput): Effect.Effect<Account, AccountReadError, never>;
504
475
  fundFromFaucet(input: FundFromFaucetInput): Effect.Effect<FundFromFaucetResult, AccountReadError, never>;
505
476
  }
506
477
  //#endregion
@@ -520,10 +491,10 @@ type CreateSubAccountInput = {
520
491
  readonly name: string;
521
492
  };
522
493
  type SubAccountIdInput = {
523
- readonly subAccountId: SubAccountId$1;
494
+ readonly subAccountId: SubAccountId;
524
495
  };
525
496
  type RenameSubAccountInput = {
526
- readonly subAccountId: SubAccountId$1;
497
+ readonly subAccountId: SubAccountId;
527
498
  readonly name: string;
528
499
  };
529
500
  /**
@@ -532,7 +503,7 @@ type RenameSubAccountInput = {
532
503
  * specific sub-account, addressed by its `SubAccountId` (canon
533
504
  * `account-balance-model.md` §5, §12).
534
505
  */
535
- type TransferEndpoint = "main" | SubAccountId$1;
506
+ type TransferEndpoint = "main" | SubAccountId;
536
507
  /**
537
508
  * Move money between two of the SAME Account's balances (canon §12). The
538
509
  * backend resolves the Account from auth (v1 = one Account per user), so the
@@ -543,7 +514,7 @@ type TransferEndpoint = "main" | SubAccountId$1;
543
514
  type TransferInput = {
544
515
  readonly from: TransferEndpoint;
545
516
  readonly to: TransferEndpoint;
546
- readonly amount: Money$1;
517
+ readonly amount: Money;
547
518
  };
548
519
  /**
549
520
  * Result of a `transfer`: the recomputed `available` (`balanceOf − Σ`), plus
@@ -551,27 +522,29 @@ type TransferInput = {
551
522
  * has no stored row, so its slot is `null`.
552
523
  */
553
524
  type TransferResult = {
554
- readonly available: Money$1;
555
- readonly from: SubAccount$1 | null;
556
- readonly to: SubAccount$1 | null;
525
+ readonly available: Money;
526
+ readonly from: SubAccount | null;
527
+ readonly to: SubAccount | null;
557
528
  };
558
529
  interface SubAccountPort {
559
- create(input: CreateSubAccountInput): Effect.Effect<SubAccount$1, SubAccountError, never>;
560
- get(input: SubAccountIdInput): Effect.Effect<SubAccount$1 | null, SubAccountError, never>;
530
+ create(input: CreateSubAccountInput): Effect.Effect<SubAccount, SubAccountError, never>;
531
+ get(input: SubAccountIdInput): Effect.Effect<SubAccount | null, SubAccountError, never>;
561
532
  list(input: {
562
533
  readonly accountId: AccountId;
563
- }): Effect.Effect<readonly SubAccount$1[], SubAccountError, never>;
564
- rename(input: RenameSubAccountInput): Effect.Effect<SubAccount$1, SubAccountError, never>;
534
+ }): Effect.Effect<readonly SubAccount[], SubAccountError, never>;
535
+ rename(input: RenameSubAccountInput): Effect.Effect<SubAccount, SubAccountError, never>;
565
536
  delete(input: SubAccountIdInput): Effect.Effect<void, SubAccountError, never>;
566
537
  transfer(input: TransferInput): Effect.Effect<TransferResult, SubAccountError, never>;
567
538
  }
568
539
  //#endregion
569
540
  //#region src/flows/types.d.ts
570
541
  /**
571
- * The full 14-port bundle that `assembleCapxulClient` (slice 5) consumes.
542
+ * The full 13-port bundle that `assembleCapxulClient` (slice 5) consumes.
543
+ * (Was 15 before the dead local-signer port was retired; the deploy path
544
+ * now signs exclusively through `CapxulSigner`.)
572
545
  *
573
546
  * Each per-flow factory in slices 2-4 takes a narrowed subset, e.g.
574
- * `AuthFlowPorts = Pick<FlowPorts, "authClient" | "authCache" | "clock" | "telemetry">`.
547
+ * `AuthFlowPorts = Pick<FlowPorts, "authClient" | "clock" | "telemetry">`.
575
548
  * Slice 1 ships only the union; per Q6 each per-flow slice declares its
576
549
  * own narrowed `Pick<FlowPorts, ...>` inside its flow file.
577
550
  */
@@ -584,7 +557,6 @@ interface FlowPorts {
584
557
  readonly subAccount: SubAccountPort;
585
558
  readonly credentials: CredentialsPort;
586
559
  readonly bootstrap: BootstrapPort;
587
- readonly evmSigner: EvmSignerPort;
588
560
  readonly clock: ClockPort;
589
561
  readonly env: EnvPort;
590
562
  readonly telemetry: TelemetryPort;
@@ -623,7 +595,7 @@ interface FlowPorts {
623
595
  * convention, flow-shape composites stay co-located with their flow.
624
596
  */
625
597
  interface ExternalSigner {
626
- readonly address: Address$1;
598
+ readonly address: Address;
627
599
  readonly signedProof: string;
628
600
  }
629
601
  //#endregion
@@ -668,6 +640,44 @@ interface IdentityMethods {
668
640
  }): Promise<CapxulResult<Profile | null>>;
669
641
  }
670
642
  //#endregion
643
+ //#region src/client/account-lane.d.ts
644
+ type ProvisioningFailureStep = "wallet" | "identity" | "provision" | "deploy";
645
+ type ProvisioningPhase = {
646
+ readonly status: "idle";
647
+ } | {
648
+ readonly status: "wallet";
649
+ } | {
650
+ readonly status: "identity";
651
+ } | {
652
+ readonly status: "provision";
653
+ } | {
654
+ readonly status: "deploy";
655
+ } | {
656
+ readonly status: "ready";
657
+ } | {
658
+ readonly status: "failed";
659
+ readonly at: ProvisioningFailureStep;
660
+ readonly error: CapxulError;
661
+ };
662
+ //#endregion
663
+ //#region src/client/account-lifecycle.d.ts
664
+ type AccountSetupStep = "connecting" | "confirmingIdentity" | "registering" | "activating";
665
+ type AccountLifecycle = {
666
+ readonly status: "loading";
667
+ } | {
668
+ readonly status: "settingUp";
669
+ readonly step: AccountSetupStep;
670
+ } | {
671
+ readonly status: "ready";
672
+ readonly accountId: string;
673
+ readonly canTransact: boolean;
674
+ } | {
675
+ readonly status: "failed";
676
+ readonly at: AccountSetupStep;
677
+ readonly error: CapxulError;
678
+ };
679
+ declare function isSettingUpLifecycle(lifecycle: AccountLifecycle): boolean;
680
+ //#endregion
671
681
  //#region src/client/account.d.ts
672
682
  type AccountStatus = {
673
683
  readonly status: "notAuthenticated";
@@ -680,7 +690,7 @@ type AccountStatus = {
680
690
  readonly requirement: AccountRequirement;
681
691
  readonly chainId: number;
682
692
  readonly source: AccountProviderSource;
683
- readonly signerAddress: Address$1;
693
+ readonly signerAddress: Address;
684
694
  } | {
685
695
  readonly status: "accountPrepared";
686
696
  readonly requirement: AccountRequirement;
@@ -719,19 +729,12 @@ type AccountStatus = {
719
729
  */
720
730
  interface AccountMethods {
721
731
  /**
722
- * Read-only status inspection. Safe to call anytime.
732
+ * Post-auth account setup lifecycle domain vocabulary over the internal
733
+ * readiness ladder + provisioning lane (#356).
723
734
  */
724
- getStatus(): Promise<CapxulResult<AccountStatus>>;
725
- /**
726
- * Normal app entry point. Idempotent.
727
- *
728
- * Per #161, `ensureReady` now advances the ladder upward:
729
- * - `accountProviderReady → accountReady` via `_internal.account.provision`
730
- * - `accountPrepared → accountReady(deployed)` via
731
- * `_internal.account.deploySafe` (when `requirement === "deployed"`
732
- * and deploy deps are configured).
733
- */
734
- ensureReady(): Promise<CapxulResult<AccountStatus>>;
735
+ getLifecycle(): Promise<CapxulResult<AccountLifecycle>>;
736
+ /** Resume setup after `failed` and return the updated lifecycle snapshot. */
737
+ retrySetup(): Promise<CapxulResult<AccountLifecycle>>;
735
738
  /**
736
739
  * Internal advanced surface (#161 · AC1). Reserved for the rebuild's
737
740
  * own `ensureReady` upward transitions and for testing harnesses;
@@ -752,13 +755,21 @@ interface AccountMethods {
752
755
  interface AccountInternalSurface {
753
756
  provision(): Promise<CapxulResult<SmartAccount$1>>;
754
757
  deploySafe(): Promise<CapxulResult<SmartAccount$1>>;
758
+ /** @internal-use Substrate readiness ladder — tests and e2e only. */
759
+ getStatus(): Promise<CapxulResult<AccountStatus>>;
760
+ /** @internal-use Lane runner — tests and e2e only. */
761
+ ensureReady(): Promise<CapxulResult<AccountStatus>>;
762
+ /** @internal-use Provisioning lane phase — tests and e2e only. */
763
+ getProvisioningPhase(): Promise<CapxulResult<ProvisioningPhase>>;
764
+ /** @internal-use Lane retry — tests and e2e only. */
765
+ retryProvisioning(): Promise<CapxulResult<ProvisioningPhase>>;
755
766
  }
756
767
  //#endregion
757
768
  //#region src/client/accounts.d.ts
758
769
  interface AccountsMethods {
759
770
  read(options?: {
760
771
  readonly signal?: AbortSignal;
761
- }): Promise<CapxulResult<Account$1>>;
772
+ }): Promise<CapxulResult<Account>>;
762
773
  }
763
774
  /**
764
775
  * Faucet surface (dev-only). Deliberately OFF the public `AccountsMethods`;
@@ -766,30 +777,658 @@ interface AccountsMethods {
766
777
  * The reference CLI uses it behind a test-env gate — consumers never see `fund`.
767
778
  */
768
779
  interface AccountsFaucetMethods {
769
- fund(amount: Money$1, options?: {
780
+ fund(amount: Money, options?: {
770
781
  readonly signal?: AbortSignal;
771
782
  }): Promise<CapxulResult<{
772
783
  readonly txHash: string;
773
784
  }>>;
774
785
  }
775
786
  //#endregion
787
+ //#region ../wire/src/financial-ops.d.ts
788
+ declare const PaymentDocumentEnvelope: Schema.Union<[Schema.Struct<{
789
+ protocol: Schema.Literal<["capxul.payment-document"]>;
790
+ version: Schema.Literal<[1]>;
791
+ domain: Schema.Struct<{
792
+ name: Schema.Literal<["CapxulPayments"]>;
793
+ version: Schema.Literal<["1"]>;
794
+ chainId: Schema.Schema<ChainId, number, never>;
795
+ verifyingContract: Schema.Literal<["0xe740ea65521edc9bef0ea75d30b5334711db99f4"]>;
796
+ }>;
797
+ primaryType: Schema.Literal<["Memo"]>;
798
+ message: Schema.Struct<{
799
+ kind: Schema.Literal<[0]>;
800
+ reference: typeof Schema.String;
801
+ note: typeof Schema.String;
802
+ issuedAt: Schema.refine<number, Schema.Schema<number, number, never>>;
803
+ }>;
804
+ }>, Schema.Struct<{
805
+ protocol: Schema.Literal<["capxul.payment-document"]>;
806
+ version: Schema.Literal<[1]>;
807
+ domain: Schema.Struct<{
808
+ name: Schema.Literal<["CapxulPayments"]>;
809
+ version: Schema.Literal<["1"]>;
810
+ chainId: Schema.Schema<ChainId, number, never>;
811
+ verifyingContract: Schema.Literal<["0xe740ea65521edc9bef0ea75d30b5334711db99f4"]>;
812
+ }>;
813
+ primaryType: Schema.Literal<["Invoice"]>;
814
+ message: Schema.Struct<{
815
+ kind: Schema.Literal<[1]>;
816
+ invoiceNumber: typeof Schema.String;
817
+ payerRef: typeof Schema.String;
818
+ payeeRef: typeof Schema.String;
819
+ amount: Schema.refine<string, Schema.Schema<string, string, never>>;
820
+ currency: Schema.Schema<CurrencyCode, string, never>;
821
+ decimals: Schema.refine<number, Schema.Schema<number, number, never>>;
822
+ issuedAt: Schema.refine<number, Schema.Schema<number, number, never>>;
823
+ dueAt: Schema.refine<number, Schema.Schema<number, number, never>>;
824
+ lineItemsHash: Schema.Schema<DocumentHash, string, never>;
825
+ }>;
826
+ }>, Schema.Struct<{
827
+ protocol: Schema.Literal<["capxul.payment-document"]>;
828
+ version: Schema.Literal<[1]>;
829
+ domain: Schema.Struct<{
830
+ name: Schema.Literal<["CapxulPayments"]>;
831
+ version: Schema.Literal<["1"]>;
832
+ chainId: Schema.Schema<ChainId, number, never>;
833
+ verifyingContract: Schema.Literal<["0xe740ea65521edc9bef0ea75d30b5334711db99f4"]>;
834
+ }>;
835
+ primaryType: Schema.Literal<["Payslip"]>;
836
+ message: Schema.Struct<{
837
+ kind: Schema.Literal<[2]>;
838
+ employerRef: typeof Schema.String;
839
+ employeeRef: typeof Schema.String;
840
+ period: typeof Schema.String;
841
+ gross: Schema.refine<string, Schema.Schema<string, string, never>>;
842
+ net: Schema.refine<string, Schema.Schema<string, string, never>>;
843
+ currency: Schema.Schema<CurrencyCode, string, never>;
844
+ decimals: Schema.refine<number, Schema.Schema<number, number, never>>;
845
+ issuedAt: Schema.refine<number, Schema.Schema<number, number, never>>;
846
+ }>;
847
+ }>, Schema.Struct<{
848
+ protocol: Schema.Literal<["capxul.payment-document"]>;
849
+ version: Schema.Literal<[1]>;
850
+ domain: Schema.Struct<{
851
+ name: Schema.Literal<["CapxulPayments"]>;
852
+ version: Schema.Literal<["1"]>;
853
+ chainId: Schema.Schema<ChainId, number, never>;
854
+ verifyingContract: Schema.Literal<["0xe740ea65521edc9bef0ea75d30b5334711db99f4"]>;
855
+ }>;
856
+ primaryType: Schema.Literal<["Receipt"]>;
857
+ message: Schema.Struct<{
858
+ kind: Schema.Literal<[3]>;
859
+ reference: typeof Schema.String;
860
+ amount: Schema.refine<string, Schema.Schema<string, string, never>>;
861
+ currency: Schema.Schema<CurrencyCode, string, never>;
862
+ decimals: Schema.refine<number, Schema.Schema<number, number, never>>;
863
+ paidAt: Schema.refine<number, Schema.Schema<number, number, never>>;
864
+ note: typeof Schema.String;
865
+ }>;
866
+ }>, Schema.Struct<{
867
+ protocol: Schema.Literal<["capxul.payment-document"]>;
868
+ version: Schema.Literal<[1]>;
869
+ domain: Schema.Struct<{
870
+ name: Schema.Literal<["CapxulPayments"]>;
871
+ version: Schema.Literal<["1"]>;
872
+ chainId: Schema.Schema<ChainId, number, never>;
873
+ verifyingContract: Schema.Literal<["0xe740ea65521edc9bef0ea75d30b5334711db99f4"]>;
874
+ }>;
875
+ primaryType: Schema.Literal<["Withdrawal"]>;
876
+ message: Schema.Struct<{
877
+ kind: Schema.Literal<[4]>;
878
+ reference: typeof Schema.String;
879
+ amount: Schema.refine<string, Schema.Schema<string, string, never>>;
880
+ currency: Schema.Schema<CurrencyCode, string, never>;
881
+ decimals: Schema.refine<number, Schema.Schema<number, number, never>>;
882
+ destChain: Schema.Schema<ChainId, number, never>;
883
+ destAddress: Schema.refine<string, Schema.Schema<string, string, never>>;
884
+ settledAt: Schema.refine<number, Schema.Schema<number, number, never>>;
885
+ provider: typeof Schema.String;
886
+ note: typeof Schema.String;
887
+ }>;
888
+ }>]>;
889
+ /**
890
+ * #592 invoice line item. `quantity` is a positive integer; `unitMinor` is the
891
+ * per-unit price in integer minor units. The list is canonically hashed by
892
+ * `hashLineItems` (payment-document-hash.ts) into the Invoice `lineItemsHash`,
893
+ * and Σ(quantity × unitMinor) MUST equal the invoice `amount`. The hash binds
894
+ * the documentHash to the exact items; the sum-check makes the items add up to
895
+ * the amount due. See the payment-document spec (canon/mcp/financial-ops.md).
896
+ */
897
+ declare const LineItem: Schema.Struct<{
898
+ description: typeof Schema.String;
899
+ quantity: Schema.refine<number, Schema.Schema<number, number, never>>;
900
+ unitMinor: Schema.refine<string, Schema.Schema<string, string, never>>;
901
+ }>;
902
+ type PaymentDocumentEnvelopeV1 = Schema.Schema.Type<typeof PaymentDocumentEnvelope>;
903
+ type LineItemV1 = Schema.Schema.Type<typeof LineItem>;
904
+ //#endregion
905
+ //#region ../wire/src/leak-safety.d.ts
906
+ declare const OnchainEvidenceBrand: unique symbol;
907
+ /**
908
+ * The branded `{ userOpHash, txHash }` pair. On-chain settlement evidence is
909
+ * INTERNAL — it flows on the server-internal channel only, never onto a wire
910
+ * Payment or any MCP tool output. The brand makes "this is internal evidence"
911
+ * a type, so a loose pair can't be passed where a wire field is expected.
912
+ */
913
+ type OnchainEvidence = {
914
+ readonly userOpHash: string;
915
+ readonly txHash: string;
916
+ } & {
917
+ readonly [OnchainEvidenceBrand]: "OnchainEvidence";
918
+ };
919
+ //#endregion
920
+ //#region src/client/financial-ops.d.ts
921
+ type RecipientResolutionKind = "email" | "org" | "payee";
922
+ interface MeProfile {
923
+ readonly authUserId: string;
924
+ readonly email: string;
925
+ readonly displayName: string | null;
926
+ readonly personalSafeAddress: string;
927
+ }
928
+ interface DepositInstructions {
929
+ readonly accountKind: "personalSafe";
930
+ readonly chainId: number;
931
+ readonly network: "base-sepolia";
932
+ readonly currency: "USD";
933
+ readonly address: string;
934
+ readonly label: string;
935
+ }
936
+ interface RecipientResolution {
937
+ readonly kind: RecipientResolutionKind;
938
+ readonly recipient: string;
939
+ readonly label: string;
940
+ readonly safeAddress: string;
941
+ readonly payeeId?: string;
942
+ readonly orgId?: string;
943
+ readonly handle?: string;
944
+ readonly email?: string;
945
+ }
946
+ interface Payee {
947
+ readonly payeeId: string;
948
+ readonly label: string;
949
+ readonly recipientRef: string;
950
+ readonly handle: string | null;
951
+ readonly destinationKind: "email" | "org" | "payeeHandle";
952
+ readonly safeAddress: string;
953
+ readonly createdAt: number;
954
+ readonly updatedAt: number;
955
+ }
956
+ interface MeMethods {
957
+ get(options?: {
958
+ readonly signal?: AbortSignal;
959
+ }): Promise<CapxulResult<MeProfile>>;
960
+ depositInstructions(options?: {
961
+ readonly signal?: AbortSignal;
962
+ }): Promise<CapxulResult<DepositInstructions>>;
963
+ }
964
+ interface HandlesMethods {
965
+ resolve(handle: string, options?: {
966
+ readonly signal?: AbortSignal;
967
+ }): Promise<CapxulResult<RecipientResolution>>;
968
+ }
969
+ interface PayeesMethods {
970
+ create(input: {
971
+ readonly label: string;
972
+ readonly recipient: string;
973
+ readonly handle?: string;
974
+ }, options?: {
975
+ readonly signal?: AbortSignal;
976
+ }): Promise<CapxulResult<Payee>>;
977
+ get(payeeId: string, options?: {
978
+ readonly signal?: AbortSignal;
979
+ }): Promise<CapxulResult<Payee | null>>;
980
+ resolve(recipient: string, options?: {
981
+ readonly signal?: AbortSignal;
982
+ }): Promise<CapxulResult<RecipientResolution>>;
983
+ }
984
+ interface PaymentMoney {
985
+ readonly currency: string;
986
+ readonly value: string;
987
+ readonly decimals: number;
988
+ }
989
+ type PaymentStatus = "pending" | "submitted" | "pending_claim" | "scheduled" | "streaming" | "settled" | "cancelled" | "redirected" | "expired" | "failed";
990
+ type PaymentType = "unspecified" | "invoice" | "payroll" | "reimbursement";
991
+ interface PaymentDocumentRef {
992
+ readonly documentHash: string;
993
+ readonly kind: "memo" | "invoice" | "payslip" | "receipt" | "withdrawal";
994
+ readonly title?: string;
995
+ readonly uri?: string;
996
+ readonly issuedAt?: number;
997
+ }
998
+ type PaymentRelease = {
999
+ readonly kind: "instant";
1000
+ } | {
1001
+ readonly kind: "scheduled";
1002
+ readonly at: number;
1003
+ } | {
1004
+ readonly kind: "stream";
1005
+ readonly startsAt: number;
1006
+ readonly endsAt: number;
1007
+ readonly cliffAt?: number;
1008
+ };
1009
+ interface Payment {
1010
+ readonly id: string;
1011
+ readonly status: PaymentStatus;
1012
+ readonly amount: PaymentMoney;
1013
+ readonly paymentType: PaymentType;
1014
+ readonly recipient: {
1015
+ readonly kind: "handle" | "email" | "payee" | "me" | "org" | "external_address";
1016
+ readonly label: string;
1017
+ readonly payeeId?: string;
1018
+ };
1019
+ readonly documents: readonly PaymentDocumentRef[];
1020
+ readonly release: PaymentRelease;
1021
+ readonly released: PaymentMoney;
1022
+ readonly availableToClaim: PaymentMoney;
1023
+ readonly createdAt: number;
1024
+ readonly updatedAt: number;
1025
+ }
1026
+ interface PaymentsPayInput {
1027
+ readonly to: string;
1028
+ readonly amount: PaymentMoney;
1029
+ /** Full EIP-712 document envelope; hashed + stored, committed on-chain. */
1030
+ readonly document?: PaymentDocumentEnvelopeV1;
1031
+ /**
1032
+ * Release clause (G3 · #546). Omitted ⇒ `instant` (the G2 direct-send path).
1033
+ * A `scheduled`/`stream` clause turns the payment into a Commitment
1034
+ * (escrow-vest-claim) backed by `CapxulPayments.createCommitment`.
1035
+ */
1036
+ readonly release?: PaymentRelease;
1037
+ /**
1038
+ * #592: itemized line items backing an Invoice `document`. The backend asserts
1039
+ * `hashLineItems(lineItems) === document.lineItemsHash` AND `Σ(quantity ×
1040
+ * unitMinor) === document.amount`, then persists the list for itemized render.
1041
+ */
1042
+ readonly lineItems?: readonly LineItemV1[];
1043
+ }
1044
+ /**
1045
+ * B3 withdraw / cash-out input. Stripe-shaped: `to` is the EXTERNAL 0x wallet
1046
+ * (the ONE place the SDK accepts a raw address — the pay lane never does),
1047
+ * `amount` is a Money, `document` is the REQUIRED kind:4 Withdrawal envelope
1048
+ * (carries the audit-visible destAddress). No chain / Safe / token / hash
1049
+ * custody substrate on the input. Returns a leak-safe `Payment` whose recipient
1050
+ * label is the redacted address — never the full 0x.
1051
+ */
1052
+ interface PaymentsWithdrawInput {
1053
+ readonly to: string;
1054
+ readonly amount: PaymentMoney;
1055
+ readonly document: PaymentDocumentEnvelopeV1;
1056
+ }
1057
+ interface PaymentSettlementInput {
1058
+ readonly paymentId: string;
1059
+ readonly evidence: OnchainEvidence;
1060
+ }
1061
+ /**
1062
+ * Host-execution callback recording the on-chain escrow of a commitment
1063
+ * (G3 · #546): `createCommitment` returned `onchainCommitmentId`, escrowing
1064
+ * the total. `onchainCommitmentId` + the userOp/tx hashes are internal evidence,
1065
+ * never on the wire (internal channel only).
1066
+ */
1067
+ interface CommitmentCreatedInput {
1068
+ readonly paymentId: string;
1069
+ readonly onchainCommitmentId: string;
1070
+ readonly evidence: OnchainEvidence;
1071
+ }
1072
+ /** Host-execution callback recording a recipient-side `claim` (G3 · #546). */
1073
+ interface CommitmentClaimInput {
1074
+ readonly paymentId: string;
1075
+ readonly evidence: OnchainEvidence;
1076
+ }
1077
+ /**
1078
+ * Host-execution callback recording a creator-side `cancel` (G3 · #546):
1079
+ * on-chain the unvested remainder returns to the creator; vested-unclaimed
1080
+ * stays the recipient's. An optional credit-note document is appended.
1081
+ */
1082
+ interface CommitmentCancelInput {
1083
+ readonly paymentId: string;
1084
+ readonly evidence: OnchainEvidence;
1085
+ readonly document?: PaymentDocumentEnvelopeV1;
1086
+ }
1087
+ /**
1088
+ * Host-execution callback recording a pre-claim `redirect` to a new validated
1089
+ * recipient (G3 · #546). `to` is a validated recipient (handle/email/payee id),
1090
+ * never a raw address.
1091
+ */
1092
+ interface CommitmentRedirectInput {
1093
+ readonly paymentId: string;
1094
+ readonly to: string;
1095
+ readonly evidence: OnchainEvidence;
1096
+ readonly document?: PaymentDocumentEnvelopeV1;
1097
+ }
1098
+ /**
1099
+ * Host-execution callback recording a settled ORG spend/payroll on the ONE
1100
+ * `payments` ledger (D3 · #565). An org spend is a KIND of Payment — it lands a
1101
+ * real `payments` row with `source:"org"` + `orgId` (no parallel `orgSpends`
1102
+ * table, no synthetic client-side fabrication). The signer-side host calls this
1103
+ * AFTER the on-chain Roles-modifier spend settles; `evidence` carries the
1104
+ * internal userOp/tx hashes (never wire fields). `recipient` is the validated
1105
+ * recipient ref label; `recipientSafeAddress` is internal evidence on the row.
1106
+ */
1107
+ interface OrgPaymentRecordInput {
1108
+ readonly orgId: string;
1109
+ readonly recipientLabel: string;
1110
+ readonly recipientSafeAddress: string;
1111
+ readonly amount: PaymentMoney;
1112
+ readonly paymentType: PaymentType;
1113
+ readonly document?: PaymentDocumentEnvelopeV1;
1114
+ /** The org Safe the spend debited — bound as the `from` of the settlement transfer. */
1115
+ readonly orgSafeAddress: string;
1116
+ /**
1117
+ * 0-based occurrence among batch runs with the same (recipient, amount), so
1118
+ * each run binds to + de-dupes on its own on-chain `Transfer` (D3 · #565).
1119
+ */
1120
+ readonly occurrenceIndex: number;
1121
+ readonly evidence: OnchainEvidence;
1122
+ }
1123
+ interface PaymentDocumentVerification {
1124
+ readonly documentHash: string;
1125
+ readonly ok: boolean;
1126
+ readonly derivedHash: string;
1127
+ readonly kind: "memo" | "invoice" | "payslip" | "receipt" | "withdrawal";
1128
+ }
1129
+ /**
1130
+ * #577 render-on-demand result. `html` is self-contained user-visible document
1131
+ * HTML (stylesheet + rendered document). The MCP `paymentDocuments.render` tool
1132
+ * exposes only `{documentHash, kind, ok}` to the model and returns `html` in an
1133
+ * audience:["user"] content block (#506 redaction matrix).
1134
+ */
1135
+ interface PaymentDocumentRender {
1136
+ readonly documentHash: string;
1137
+ readonly ok: boolean;
1138
+ readonly kind: "memo" | "invoice" | "payslip" | "receipt" | "withdrawal";
1139
+ readonly html: string;
1140
+ }
1141
+ /**
1142
+ * Internal commitment execution reference (G3 · #546). The on-chain
1143
+ * `onchainCommitmentId` is internal evidence (like userOp/tx hashes) — it never
1144
+ * appears on the wire `Payment` or any MCP tool output, but the signer-side host
1145
+ * needs it to build a claim/cancel/redirect UserOp. This is the server-internal
1146
+ * channel that carries it (and the recipient Safe address for an auto-claim
1147
+ * relayer), never a consumer-facing surface.
1148
+ */
1149
+ interface PaymentCommitmentRef {
1150
+ readonly paymentId: string;
1151
+ readonly onchainCommitmentId: string | null;
1152
+ readonly status: PaymentStatus;
1153
+ }
1154
+ /**
1155
+ * The host-execution + on-chain-evidence channel for Payments (D2 · #564).
1156
+ * SPLIT OFF the public `PaymentsMethods` so an external builder consuming
1157
+ * `@capxul/sdk` directly never sees the custody substrate. Reached only via
1158
+ * `client.payments._internal` (mirrors `client._internal.*`); the signer-side
1159
+ * host (the dev MCP edge / a self-custody integrator) drives it AFTER executing
1160
+ * a UserOp. Every input carries the `OnchainEvidence` brand — never a wire field.
1161
+ */
1162
+ interface PaymentsInternalMethods {
1163
+ /** Report on-chain settlement evidence for an instant payment. */
1164
+ markSettled(input: PaymentSettlementInput, options?: {
1165
+ readonly signal?: AbortSignal;
1166
+ }): Promise<CapxulResult<Payment>>;
1167
+ /**
1168
+ * B3: report on-chain settlement evidence for a withdraw/cash-out. The
1169
+ * backend binds the userOp to a matching external `Transfer` before settling.
1170
+ */
1171
+ markWithdrawalSettled(input: PaymentSettlementInput, options?: {
1172
+ readonly signal?: AbortSignal;
1173
+ }): Promise<CapxulResult<Payment>>;
1174
+ /**
1175
+ * Record the on-chain escrow of a commitment after `createCommitment` returns
1176
+ * its `onchainCommitmentId` (G3 · #546).
1177
+ */
1178
+ markCommitmentCreated(input: CommitmentCreatedInput, options?: {
1179
+ readonly signal?: AbortSignal;
1180
+ }): Promise<CapxulResult<Payment>>;
1181
+ /**
1182
+ * Record a settled ORG spend/payroll on the one `payments` ledger
1183
+ * (D3 · #565) — `source:"org"` + `orgId`, read back as a leak-safe Payment.
1184
+ */
1185
+ recordOrgPayment(input: OrgPaymentRecordInput, options?: {
1186
+ readonly signal?: AbortSignal;
1187
+ }): Promise<CapxulResult<Payment>>;
1188
+ /** Record a recipient-side `claim` after the on-chain claim UserOp settles. */
1189
+ claim(input: CommitmentClaimInput, options?: {
1190
+ readonly signal?: AbortSignal;
1191
+ }): Promise<CapxulResult<Payment>>;
1192
+ /** Record a creator-side `cancel` reclaiming only the unvested remainder. */
1193
+ cancel(input: CommitmentCancelInput, options?: {
1194
+ readonly signal?: AbortSignal;
1195
+ }): Promise<CapxulResult<Payment>>;
1196
+ /** Record a pre-claim `redirect` to a new validated recipient. */
1197
+ redirect(input: CommitmentRedirectInput, options?: {
1198
+ readonly signal?: AbortSignal;
1199
+ }): Promise<CapxulResult<Payment>>;
1200
+ /**
1201
+ * The on-chain commitment reference the signer-side host needs to build a
1202
+ * claim/cancel/redirect UserOp. `onchainCommitmentId` is internal evidence.
1203
+ */
1204
+ commitmentRef(paymentId: string, options?: {
1205
+ readonly signal?: AbortSignal;
1206
+ }): Promise<CapxulResult<PaymentCommitmentRef | null>>;
1207
+ }
1208
+ /**
1209
+ * The PUBLIC, Stripe-shaped Payments surface (D2 · #564). Genus verbs only —
1210
+ * `pay` / `list` / `get`. No `userOpHash` / `txHash` / `onchainCommitmentId` /
1211
+ * `chainId` / `safeAddress`. Host-execution + on-chain evidence live on the
1212
+ * `_internal` channel below; an external builder never touches custody substrate.
1213
+ */
1214
+ interface PaymentsMethods {
1215
+ pay(input: PaymentsPayInput, options?: {
1216
+ readonly signal?: AbortSignal;
1217
+ }): Promise<CapxulResult<Payment>>;
1218
+ /**
1219
+ * B3 withdraw / cash-out: send USDX from the user's custody Safe to an
1220
+ * external 0x wallet, minting a kind:4 Withdrawal document. Returns a
1221
+ * leak-safe `Payment` (recipient label is the redacted address).
1222
+ */
1223
+ withdraw(input: PaymentsWithdrawInput, options?: {
1224
+ readonly signal?: AbortSignal;
1225
+ }): Promise<CapxulResult<Payment>>;
1226
+ list(options?: {
1227
+ readonly signal?: AbortSignal;
1228
+ }): Promise<CapxulResult<readonly Payment[]>>;
1229
+ get(paymentId: string, options?: {
1230
+ readonly signal?: AbortSignal;
1231
+ }): Promise<CapxulResult<Payment | null>>;
1232
+ /**
1233
+ * Host-execution + on-chain-evidence channel — off the public surface
1234
+ * (production-surface-policy.md pattern). Self-custody integrators drive this;
1235
+ * a Stripe-shaped consumer never does.
1236
+ *
1237
+ * @internal-use
1238
+ */
1239
+ readonly _internal: PaymentsInternalMethods;
1240
+ }
1241
+ interface PaymentDocumentsMethods {
1242
+ verify(documentHash: string, options?: {
1243
+ readonly signal?: AbortSignal;
1244
+ }): Promise<CapxulResult<PaymentDocumentVerification>>;
1245
+ /**
1246
+ * #577: render-on-demand. Loads the owner's stored document by `documentHash`,
1247
+ * re-verifies its EIP-712 hash, and renders it to self-contained HTML using the
1248
+ * verified stored line items. Returns `{documentHash, kind, ok, html}`.
1249
+ */
1250
+ render(documentHash: string, options?: {
1251
+ readonly signal?: AbortSignal;
1252
+ }): Promise<CapxulResult<PaymentDocumentRender>>;
1253
+ }
1254
+ type PaymentRequestStatus = "draft" | "sent" | "viewed" | "paid" | "expired" | "cancelled";
1255
+ interface PaymentRequest {
1256
+ readonly id: string;
1257
+ readonly status: PaymentRequestStatus;
1258
+ readonly amount: PaymentMoney;
1259
+ readonly reference: string;
1260
+ readonly memo: string | null;
1261
+ /** Fixed-amount payment link token (HITL #519: basic, not replay-hardened). */
1262
+ readonly linkToken: string;
1263
+ /** Minimal entitlement (HITL #501): true once paid. */
1264
+ readonly entitlementGranted: boolean;
1265
+ /** The Payment this receivable settled into (set on collect). */
1266
+ readonly settledPaymentId: string | null;
1267
+ /** The receipt document committed for this receivable (set on collect). */
1268
+ readonly receiptDocumentHash: string | null;
1269
+ readonly expiresAt: number | null;
1270
+ readonly createdAt: number;
1271
+ readonly updatedAt: number;
1272
+ }
1273
+ interface ReconciliationEntry {
1274
+ readonly paymentRequestId: string;
1275
+ readonly reference: string;
1276
+ readonly status: "paid" | "exception";
1277
+ readonly settledPaymentId: string | null;
1278
+ readonly receiptDocumentHash: string | null;
1279
+ }
1280
+ interface PaymentRequestsCreateInput {
1281
+ readonly amount: PaymentMoney;
1282
+ readonly reference: string;
1283
+ readonly memo?: string;
1284
+ /** Optional expiry (epoch ms). HITL #519: expiry policy is a basic timestamp. */
1285
+ readonly expiresAt?: number;
1286
+ }
1287
+ interface PaymentRequestsMethods {
1288
+ /** Open a receivable in `draft` with a fixed-amount payment link. */
1289
+ create(input: PaymentRequestsCreateInput, options?: {
1290
+ readonly signal?: AbortSignal;
1291
+ }): Promise<CapxulResult<PaymentRequest>>;
1292
+ markSent(paymentRequestId: string, options?: {
1293
+ readonly signal?: AbortSignal;
1294
+ }): Promise<CapxulResult<PaymentRequest>>;
1295
+ markViewed(paymentRequestId: string, options?: {
1296
+ readonly signal?: AbortSignal;
1297
+ }): Promise<CapxulResult<PaymentRequest>>;
1298
+ cancel(paymentRequestId: string, options?: {
1299
+ readonly signal?: AbortSignal;
1300
+ }): Promise<CapxulResult<PaymentRequest>>;
1301
+ /**
1302
+ * Collect the receivable (HERMETIC until a live inbound path exists): settle
1303
+ * it into the Payment ledger and mint a receipt linked by `documentHash`.
1304
+ */
1305
+ collect(paymentRequestId: string, options?: {
1306
+ readonly signal?: AbortSignal;
1307
+ }): Promise<CapxulResult<PaymentRequest>>;
1308
+ list(options?: {
1309
+ readonly signal?: AbortSignal;
1310
+ }): Promise<CapxulResult<readonly PaymentRequest[]>>;
1311
+ get(paymentRequestId: string, options?: {
1312
+ readonly signal?: AbortSignal;
1313
+ }): Promise<CapxulResult<PaymentRequest | null>>;
1314
+ getByLink(linkToken: string, options?: {
1315
+ readonly signal?: AbortSignal;
1316
+ }): Promise<CapxulResult<PaymentRequest | null>>;
1317
+ /** Inbound reconciliation: paid / exception status per receivable. */
1318
+ reconcile(options?: {
1319
+ readonly signal?: AbortSignal;
1320
+ }): Promise<CapxulResult<readonly ReconciliationEntry[]>>;
1321
+ }
1322
+ type PaymentDraftStatus = "draft" | "simulated" | "approval_pending" | "approved" | "executed" | "cancelled" | "expired";
1323
+ /** The leak-safe, model-visible draft/approval (#506). */
1324
+ interface PaymentDraft {
1325
+ readonly id: string;
1326
+ readonly status: PaymentDraftStatus;
1327
+ readonly recipient: {
1328
+ readonly kind: string;
1329
+ readonly label: string;
1330
+ };
1331
+ readonly amount: PaymentMoney;
1332
+ readonly documentHash: string | null;
1333
+ /** The canonical-plan binding fingerprint (set at approvals.request). */
1334
+ readonly planHash: string | null;
1335
+ /** The opaque read-model version the draft was simulated against (stale-state). */
1336
+ readonly readModelVersion: string;
1337
+ readonly idempotencyKey: string;
1338
+ readonly policyDecision: "allow" | "deny";
1339
+ readonly expiresAt: number | null;
1340
+ readonly settledPaymentId: string | null;
1341
+ readonly createdAt: number;
1342
+ readonly updatedAt: number;
1343
+ }
1344
+ interface WorkbenchDraftInput {
1345
+ readonly clientId: string;
1346
+ readonly audience: string;
1347
+ readonly scopes: readonly string[];
1348
+ readonly to: string;
1349
+ readonly amount: PaymentMoney;
1350
+ readonly document?: PaymentDocumentEnvelopeV1;
1351
+ readonly idempotencyKey: string;
1352
+ /** Untrusted connector/model suggestion blob (default-deny taint). */
1353
+ readonly tainted?: Record<string, unknown>;
1354
+ }
1355
+ interface WorkbenchMintResult {
1356
+ readonly approvalToken: string;
1357
+ readonly planHash: string;
1358
+ readonly expiresAt: number;
1359
+ }
1360
+ interface WorkbenchExecuteInput {
1361
+ readonly draftId: string;
1362
+ readonly clientId: string;
1363
+ readonly approvalToken: string;
1364
+ readonly readModelVersion: string;
1365
+ readonly userOpHash: string;
1366
+ readonly txHash: string;
1367
+ }
1368
+ /**
1369
+ * The decomposed workbench (G6 · #549). The edge PROPOSES (draft → simulate →
1370
+ * request); the BACKEND mints the one-time plan-bound token via the human's
1371
+ * browser (`mint`); `execute` consumes it. `mint` is the human step — the edge
1372
+ * normally only reaches `request`, then hands the human a browser URL.
1373
+ */
1374
+ interface WorkbenchMethods {
1375
+ draft(input: WorkbenchDraftInput, options?: {
1376
+ readonly signal?: AbortSignal;
1377
+ }): Promise<CapxulResult<PaymentDraft>>;
1378
+ simulate(draftId: string, options?: {
1379
+ readonly signal?: AbortSignal;
1380
+ }): Promise<CapxulResult<PaymentDraft>>;
1381
+ requestApproval(draftId: string, options?: {
1382
+ readonly signal?: AbortSignal;
1383
+ }): Promise<CapxulResult<PaymentDraft>>;
1384
+ /**
1385
+ * THE HUMAN STEP: mint the one-time approval token (browser/approval app).
1386
+ * F2 (#549): the backend gates minting on a human-origin `capability` the
1387
+ * agent/edge does NOT possess (`CAPXUL_APPROVAL_CAPABILITY`); only the
1388
+ * apps/approve browser app passes it. The edge/SDK lane cannot self-approve.
1389
+ */
1390
+ mint(draftId: string, capability: string, options?: {
1391
+ readonly signal?: AbortSignal;
1392
+ }): Promise<CapxulResult<WorkbenchMintResult>>;
1393
+ execute(input: WorkbenchExecuteInput, options?: {
1394
+ readonly signal?: AbortSignal;
1395
+ }): Promise<CapxulResult<Payment>>;
1396
+ status(draftId: string, options?: {
1397
+ readonly signal?: AbortSignal;
1398
+ }): Promise<CapxulResult<PaymentDraft | null>>;
1399
+ cancel(draftId: string, options?: {
1400
+ readonly signal?: AbortSignal;
1401
+ }): Promise<CapxulResult<PaymentDraft>>;
1402
+ }
1403
+ interface FinancialOpsMethods {
1404
+ readonly me: MeMethods;
1405
+ readonly handles: HandlesMethods;
1406
+ readonly payees: PayeesMethods;
1407
+ readonly payments: PaymentsMethods;
1408
+ readonly paymentDocuments: PaymentDocumentsMethods;
1409
+ /** Receivables surface (G5 · #548). */
1410
+ readonly paymentRequests: PaymentRequestsMethods;
1411
+ /** Decomposed workbench + trust substrate (G6 · #549). */
1412
+ readonly workbench: WorkbenchMethods;
1413
+ }
1414
+ //#endregion
776
1415
  //#region src/client/sub-accounts.d.ts
777
1416
  interface SubAccountsMethods {
778
1417
  create(accountId: AccountId, input: {
779
1418
  readonly name: string;
780
1419
  }, options?: {
781
1420
  readonly signal?: AbortSignal;
782
- }): Promise<CapxulResult<SubAccount$1>>;
783
- get(subAccountId: SubAccountId$1, options?: {
1421
+ }): Promise<CapxulResult<SubAccount>>;
1422
+ get(subAccountId: SubAccountId, options?: {
784
1423
  readonly signal?: AbortSignal;
785
- }): Promise<CapxulResult<SubAccount$1 | null>>;
1424
+ }): Promise<CapxulResult<SubAccount | null>>;
786
1425
  list(accountId: AccountId, options?: {
787
1426
  readonly signal?: AbortSignal;
788
- }): Promise<CapxulResult<readonly SubAccount$1[]>>;
789
- rename(subAccountId: SubAccountId$1, name: string, options?: {
1427
+ }): Promise<CapxulResult<readonly SubAccount[]>>;
1428
+ rename(subAccountId: SubAccountId, name: string, options?: {
790
1429
  readonly signal?: AbortSignal;
791
- }): Promise<CapxulResult<SubAccount$1>>;
792
- delete(subAccountId: SubAccountId$1, options?: {
1430
+ }): Promise<CapxulResult<SubAccount>>;
1431
+ delete(subAccountId: SubAccountId, options?: {
793
1432
  readonly signal?: AbortSignal;
794
1433
  }): Promise<CapxulResult<void>>;
795
1434
  transfer(input: TransferInput, options?: {
@@ -798,49 +1437,68 @@ interface SubAccountsMethods {
798
1437
  }
799
1438
  //#endregion
800
1439
  //#region src/client/org-spend-gate.d.ts
801
- type SpendGateRecipients = "anyone" | readonly Address$1[];
1440
+ /**
1441
+ * The role's allowed recipients. The address form backs the S4 `spend` path
1442
+ * (recipient is a resolved `Address`); the string form backs the G4
1443
+ * `spendViaPayments` / `batchPayroll` path, whose recipient is a VALIDATED REF
1444
+ * (handle/email/payee/org) compared in the same ref space as the role's set.
1445
+ * Comparison is case-insensitive over the raw string value either way.
1446
+ */
1447
+ type SpendGateRecipients = "anyone" | readonly (Address | string)[];
802
1448
  type SpendGateSubAccountScope = {
803
1449
  readonly scope: "all";
804
1450
  } | {
805
1451
  readonly scope: "only";
806
- readonly subAccountIds: readonly SubAccountId$1[];
1452
+ readonly subAccountIds: readonly SubAccountId[];
807
1453
  };
808
1454
  //#endregion
809
1455
  //#region src/ports/org.d.ts
1456
+ /**
1457
+ * The minimal `{from, to, amount}` spend shape the authority read keys off
1458
+ * (D3 #565). The legacy address-keyed `OrgSpendInput`/`org.spend` lane was
1459
+ * hard-removed when `orgSpends` folded into the one `payments` ledger; the
1460
+ * leak-safe ref-based lane (`spendViaPayments`/`batchPayroll`) constructs this
1461
+ * internally and enforces the real validated recipient on the gate.
1462
+ */
1463
+ type OrgSpendShape = {
1464
+ readonly from: SubAccountId;
1465
+ readonly to: Address;
1466
+ readonly amount: Money;
1467
+ };
810
1468
  type CreateOrgPortInput = {
811
1469
  readonly input: CreateOrgInput;
812
1470
  };
813
1471
  type ReadOrgTreasuryInput = {
814
- readonly orgId: OrgId$1;
1472
+ readonly orgId: OrgId;
815
1473
  };
816
1474
  type ListOrgsInput = Record<never, never>;
817
1475
  type ListOrgRolesInput = {
818
- readonly orgId: OrgId$1;
1476
+ readonly orgId: OrgId;
819
1477
  };
820
1478
  type ListOrgMembersInput = {
821
- readonly orgId: OrgId$1;
1479
+ readonly orgId: OrgId;
822
1480
  };
823
1481
  type InviteOrgMemberInput = {
824
- readonly orgId: OrgId$1;
1482
+ readonly orgId: OrgId;
825
1483
  readonly input: InviteMemberInput;
826
1484
  };
827
1485
  type DetectPendingOrgInvitationsInput = Record<never, never>;
828
1486
  type DetectPendingOrgInvitationsResult$1 = {
829
- readonly matched: readonly OrgId$1[];
1487
+ readonly matched: readonly OrgId[];
830
1488
  };
831
1489
  type DeployOrgRolesInput = {
832
- readonly orgId: OrgId$1;
1490
+ readonly orgId: OrgId;
833
1491
  };
834
1492
  type OrgRolesDeploymentResult = {
835
- readonly orgId: OrgId$1;
1493
+ readonly orgId: OrgId;
836
1494
  readonly roles: readonly RoleView[];
837
1495
  };
838
1496
  type GrantOrgRoleInput = {
839
- readonly orgId: OrgId$1;
1497
+ readonly orgId: OrgId;
840
1498
  readonly input: AssignRoleInput;
841
1499
  };
842
1500
  type RevokeOrgRoleInput = {
843
- readonly orgId: OrgId$1;
1501
+ readonly orgId: OrgId;
844
1502
  readonly input: RemoveMemberInput;
845
1503
  };
846
1504
  type OrgSpendAuthority = {
@@ -854,15 +1512,9 @@ type OrgSpendAuthority = {
854
1512
  readonly role?: string;
855
1513
  };
856
1514
  type ReadOrgSpendAuthorityInput = {
857
- readonly orgId: OrgId$1;
858
- readonly input: OrgSpendInput;
859
- readonly amountRaw: string;
860
- };
861
- type SubmitOrgSpendInput = {
862
- readonly orgId: OrgId$1;
863
- readonly input: OrgSpendInput;
1515
+ readonly orgId: OrgId;
1516
+ readonly input: OrgSpendShape;
864
1517
  readonly amountRaw: string;
865
- readonly authority: OrgSpendAuthority;
866
1518
  };
867
1519
  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 & {
868
1520
  readonly _tag: "OrgError";
@@ -882,7 +1534,7 @@ declare class OrgError extends OrgError_base<{
882
1534
  */
883
1535
  interface OrgPort {
884
1536
  createOrg(input: CreateOrgPortInput): Effect.Effect<OrgView, OrgError, never>;
885
- readTreasury(input: ReadOrgTreasuryInput): Effect.Effect<Account$1, OrgError, never>;
1537
+ readTreasury(input: ReadOrgTreasuryInput): Effect.Effect<Account, OrgError, never>;
886
1538
  listOrgs(input: ListOrgsInput): Effect.Effect<readonly OrgView[], OrgError, never>;
887
1539
  listRoles(input: ListOrgRolesInput): Effect.Effect<readonly RoleView[], OrgError, never>;
888
1540
  listMembers(input: ListOrgMembersInput): Effect.Effect<readonly MemberView[], OrgError, never>;
@@ -894,9 +1546,34 @@ interface OrgRolesDeploymentPort {
894
1546
  grantRole(input: GrantOrgRoleInput): Effect.Effect<MemberView, OrgError, never>;
895
1547
  revokeRole(input: RevokeOrgRoleInput): Effect.Effect<void, OrgError, never>;
896
1548
  }
1549
+ type SubmitOrgSpendViaPaymentsInput = {
1550
+ readonly orgId: OrgId;
1551
+ readonly input: OrgSpendViaPaymentsInput;
1552
+ readonly amountRaw: string;
1553
+ readonly authority: OrgSpendAuthority;
1554
+ };
1555
+ type SubmitOrgBatchPayrollInput = {
1556
+ readonly orgId: OrgId;
1557
+ readonly from: OrgSpendViaPaymentsInput["from"];
1558
+ readonly runs: readonly {
1559
+ readonly run: OrgPayrollRun;
1560
+ readonly amountRaw: string;
1561
+ }[];
1562
+ readonly authorities: readonly OrgSpendAuthority[];
1563
+ };
897
1564
  interface OrgSpendPort {
898
1565
  readSpendAuthority(input: ReadOrgSpendAuthorityInput): Effect.Effect<OrgSpendAuthority, OrgError, never>;
899
- submitSpend(input: SubmitOrgSpendInput): Effect.Effect<OrgSpendResult, OrgError, never>;
1566
+ /**
1567
+ * Leak-safe org spend (G4 · #547; D3 #565 — the one ledger of record): execute
1568
+ * the spend through the payments engine (Roles modifier → CapxulPayments),
1569
+ * write a real `payments` row (`source:"org"`) and read it back as a `Payment`
1570
+ * — the wire carries no `txHash` / Safe / userOp internals. Optional so a
1571
+ * hermetic adapter without a payments-submit lane still compiles; absent ⇒ the
1572
+ * program falls back to a deterministic hermetic `Payment`.
1573
+ */
1574
+ submitSpendViaPayments?(input: SubmitOrgSpendViaPaymentsInput): Effect.Effect<Payment, OrgError, never>;
1575
+ /** Leak-safe org payroll batch (G4 · #547): one MultiSend, one Payment per run. */
1576
+ submitBatchPayroll?(input: SubmitOrgBatchPayrollInput): Effect.Effect<readonly Payment[], OrgError, never>;
900
1577
  }
901
1578
  //#endregion
902
1579
  //#region src/client/org.d.ts
@@ -916,12 +1593,12 @@ type MemberStatus = "pending" | "pending_safe" | "pending_grant" | "active" | "r
916
1593
  * brand.
917
1594
  */
918
1595
  type OrgView = {
919
- readonly id: OrgId$1;
1596
+ readonly id: OrgId;
920
1597
  readonly name: string;
921
1598
  readonly handle: string;
922
- readonly safeAddress: Address$1; /** The viewing member's own role label within this org. */
1599
+ readonly safeAddress: Address; /** The viewing member's own role label within this org. */
923
1600
  readonly role: string; /** The Org treasury — the real M2 Account over the Org Safe (D3). */
924
- readonly treasury: Account$1;
1601
+ readonly treasury: Account;
925
1602
  };
926
1603
  /**
927
1604
  * One member of an Org (canon §C1 "Members" — name/email, role, status; D7/D8).
@@ -930,12 +1607,12 @@ type OrgView = {
930
1607
  * yet provisioned a personal Safe). `email` is the universal entry point (D8).
931
1608
  */
932
1609
  type MemberView = {
933
- readonly orgId: OrgId$1;
1610
+ readonly orgId: OrgId;
934
1611
  readonly email: Email;
935
1612
  readonly name: string | null; /** Member-identity key (D7). `null` until the invitee provisions a Safe. */
936
- readonly personalSafeAddress: Address$1 | null; /** The member's role label (maps deterministically to the on-chain `roleKey`, D9). */
1613
+ readonly personalSafeAddress: Address | null; /** The member's role label (maps deterministically to the on-chain `roleKey`, D9). */
937
1614
  readonly role: string;
938
- readonly roleKey: RoleKey$1 | null;
1615
+ readonly roleKey: RoleKey | null;
939
1616
  readonly status: MemberStatus;
940
1617
  readonly grantTxHash: string | null;
941
1618
  readonly revokeTxHash: string | null;
@@ -947,9 +1624,9 @@ type MemberView = {
947
1624
  * (the Owner role).
948
1625
  */
949
1626
  type RoleSpendCap = {
950
- readonly perTx?: Money$1;
951
- readonly perDay?: Money$1;
952
- readonly toRecipients?: "anyone" | readonly Address$1[];
1627
+ readonly perTx?: Money;
1628
+ readonly perDay?: Money;
1629
+ readonly toRecipients?: "anyone" | readonly Address[];
953
1630
  };
954
1631
  /**
955
1632
  * The Capxul-owned Role DSL definition (D4). `label` becomes the sticky
@@ -961,7 +1638,7 @@ type RoleDefinition = {
961
1638
  readonly label: string;
962
1639
  readonly spend?: RoleSpendCap;
963
1640
  readonly subAccounts?: {
964
- readonly scope: "all" | readonly SubAccountId$1[];
1641
+ readonly scope: "all" | readonly SubAccountId[];
965
1642
  };
966
1643
  readonly canManageMembers?: boolean;
967
1644
  readonly canManageRoles?: boolean;
@@ -972,9 +1649,9 @@ type RoleDefinition = {
972
1649
  * is the full Role DSL entry.
973
1650
  */
974
1651
  type RoleView = {
975
- readonly orgId: OrgId$1;
1652
+ readonly orgId: OrgId;
976
1653
  readonly label: string;
977
- readonly roleKey: RoleKey$1;
1654
+ readonly roleKey: RoleKey;
978
1655
  readonly definition: RoleDefinition;
979
1656
  };
980
1657
  /** Built-in role templates that seed a new Org at creation (D6). */
@@ -1009,7 +1686,7 @@ type InviteMemberInput = {
1009
1686
  * mirror.
1010
1687
  */
1011
1688
  type RemoveMemberInput = {
1012
- readonly memberSafeAddress: Address$1;
1689
+ readonly memberSafeAddress: Address;
1013
1690
  };
1014
1691
  /**
1015
1692
  * Input to `org(orgId).assignRole` (S3, D7/D9). Keyed on the member's personal
@@ -1017,26 +1694,48 @@ type RemoveMemberInput = {
1017
1694
  * label maps deterministically to the on-chain `roleKey`.
1018
1695
  */
1019
1696
  type AssignRoleInput = {
1020
- readonly memberSafeAddress: Address$1;
1697
+ readonly memberSafeAddress: Address;
1021
1698
  readonly role: string;
1022
1699
  };
1023
1700
  /**
1024
- * Input to `org(orgId).spend` (S4, capstone, D5). A member spends `amount` from
1025
- * a scoped sub-account `from` to `to`, gated Level 1 (Zodiac cap) + Level 2
1026
- * (envelope scope/balance). One UserOp: signer personal Safe Org Roles
1027
- * modifier `CapxulPayments.send`.
1701
+ * Input to `org(orgId).spendViaPayments` (G4 · #547). The LEAK-SAFE org spend:
1702
+ * delegates `org.spend` to the payments engine WITH the member's org role
1703
+ * authority and returns a `Payment`, not a `txHash`. `to` is a VALIDATED
1704
+ * recipient ref (handle / email / payee id / org handle) — never a raw
1705
+ * `Address` (the legacy address-keyed `org.spend` lane was hard-removed in D3
1706
+ * #565 when `orgSpends` was folded into the one `payments` ledger).
1707
+ * `from` is the Level-2 sub-account envelope the spend draws from (D5).
1028
1708
  */
1029
- type OrgSpendInput = {
1030
- /** The sub-account (envelope) the spend draws from (Level-2 scope, D5). */readonly from: SubAccountId$1;
1031
- readonly to: Address$1;
1032
- readonly amount: Money$1;
1709
+ type OrgSpendViaPaymentsInput = {
1710
+ readonly from: SubAccountId; /** Validated recipient ref (handle/email/payee/org) never a raw address. */
1711
+ readonly to: string;
1712
+ readonly amount: Money; /** Full EIP-712 payment document; hashed + stored, committed on-chain. */
1713
+ readonly document?: PaymentDocumentEnvelopeV1;
1714
+ readonly paymentType?: PaymentType;
1033
1715
  };
1034
- /** Result of a settled Org spend — the settling transaction hash (S4). */
1035
- type OrgSpendResult = {
1036
- readonly txHash: string;
1716
+ /**
1717
+ * One run in an `org(orgId).batchPayroll` batch (G4 · #547): a validated
1718
+ * recipient, an amount, and an optional payslip document. Each run is gated
1719
+ * independently against the role's per-tx / per-day / recipient conditions.
1720
+ */
1721
+ type OrgPayrollRun = {
1722
+ /** Validated recipient ref (handle/email/payee/org) — never a raw address. */readonly to: string;
1723
+ readonly amount: Money; /** The payslip — an EIP-712 payment document, committed by `documentHash`. */
1724
+ readonly payslip?: PaymentDocumentEnvelopeV1;
1725
+ };
1726
+ /**
1727
+ * Input to `org(orgId).batchPayroll` (G4 · #547). Pays N employees in one
1728
+ * MultiSend through the Roles modifier; each carries a payslip and settles as
1729
+ * `paymentType = payroll`. Every run is gated; an over-cap run REJECTS the
1730
+ * whole batch (no partial treasury drain). Returns one leak-safe `Payment` per
1731
+ * run.
1732
+ */
1733
+ type OrgBatchPayrollInput = {
1734
+ readonly from: SubAccountId;
1735
+ readonly runs: readonly OrgPayrollRun[];
1037
1736
  };
1038
1737
  type DetectPendingOrgInvitationsResult = {
1039
- readonly matched: readonly OrgId$1[];
1738
+ readonly matched: readonly OrgId[];
1040
1739
  };
1041
1740
  /**
1042
1741
  * Entity-scoped Org method bundle, returned by `capxul.org(orgId)`. Every
@@ -1048,7 +1747,7 @@ interface OrgScopedMethods {
1048
1747
  /** The Org treasury — the real M2 Account over the Org Safe (D3). */
1049
1748
  treasury(options?: {
1050
1749
  readonly signal?: AbortSignal;
1051
- }): Promise<CapxulResult<Account$1>>;
1750
+ }): Promise<CapxulResult<Account>>;
1052
1751
  members(options?: {
1053
1752
  readonly signal?: AbortSignal;
1054
1753
  }): Promise<CapxulResult<readonly MemberView[]>>;
@@ -1067,9 +1766,23 @@ interface OrgScopedMethods {
1067
1766
  assignRole(input: AssignRoleInput, options?: {
1068
1767
  readonly signal?: AbortSignal;
1069
1768
  }): Promise<CapxulResult<MemberView>>;
1070
- spend(input: OrgSpendInput, options?: {
1769
+ /**
1770
+ * Leak-safe org spend (G4 · #547; D3 #565 — the one ledger of record): execute
1771
+ * the spend through the payments engine with the member's org role authority
1772
+ * and return a `Payment` (no `to: Address`, no `txHash`, no Safe / userOp
1773
+ * internals). Writes a real `payments` row (`source:"org"`).
1774
+ */
1775
+ spendViaPayments(input: OrgSpendViaPaymentsInput, options?: {
1776
+ readonly signal?: AbortSignal;
1777
+ }): Promise<CapxulResult<Payment>>;
1778
+ /**
1779
+ * Org payroll batch (G4 · #547): pay N employees in one MultiSend through the
1780
+ * Roles modifier, each with a payslip. Every run is gated; an over-cap run
1781
+ * rejects the whole batch. Returns one leak-safe `Payment` per run.
1782
+ */
1783
+ batchPayroll(input: OrgBatchPayrollInput, options?: {
1071
1784
  readonly signal?: AbortSignal;
1072
- }): Promise<CapxulResult<OrgSpendResult>>;
1785
+ }): Promise<CapxulResult<readonly Payment[]>>;
1073
1786
  }
1074
1787
  type OrgsMethod = {
1075
1788
  (options?: {
@@ -1089,7 +1802,7 @@ interface OrgMethods {
1089
1802
  }): Promise<CapxulResult<OrgView>>;
1090
1803
  readonly orgs: OrgsMethod;
1091
1804
  /** Resolve the entity-scoped bundle for a specific Org (D13). */
1092
- org(orgId: OrgId$1): OrgScopedMethods;
1805
+ org(orgId: OrgId): OrgScopedMethods;
1093
1806
  }
1094
1807
  //#endregion
1095
1808
  //#region src/client/create-capxul-client.d.ts
@@ -1108,6 +1821,32 @@ interface CapxulClient {
1108
1821
  * Returns `{ balance, available }` as `Money` — never wei or token units.
1109
1822
  */
1110
1823
  readonly accounts: AccountsMethods;
1824
+ readonly me: MeMethods;
1825
+ readonly handles: HandlesMethods;
1826
+ readonly payees: PayeesMethods;
1827
+ /**
1828
+ * Direct Payments surface (G2 · #545). `pay` records a validated-recipient
1829
+ * payment; `list`/`get` read the ledger; `markSettled` is the host-execution
1830
+ * callback. The MCP `draft → simulate → approve → execute` workbench is G6.
1831
+ */
1832
+ readonly payments: PaymentsMethods;
1833
+ /** Payment document verification (G2 · #545): re-derive the EIP-712 hash. */
1834
+ readonly paymentDocuments: PaymentDocumentsMethods;
1835
+ /**
1836
+ * Receivables surface (G5 · #548). `create` opens a `PaymentRequest` with a
1837
+ * fixed-amount link; `markSent`/`markViewed`/`cancel` move the funnel;
1838
+ * `collect` settles the receivable into the Payment ledger + mints a receipt
1839
+ * linked by `documentHash`; `list`/`get`/`getByLink`/`reconcile` read it.
1840
+ */
1841
+ readonly paymentRequests: PaymentRequestsMethods;
1842
+ /**
1843
+ * Decomposed workbench + trust substrate (G6 · #549). The MCP
1844
+ * `draft → simulate → approvals.request → execute` workbench: the edge
1845
+ * PROPOSES, the BACKEND mints a one-time plan-bound approval token via the
1846
+ * human's browser (#510), and `execute` consumes it. Taint / idempotency /
1847
+ * stale-state / scope guards are enforced backend-side.
1848
+ */
1849
+ readonly workbench: WorkbenchMethods;
1111
1850
  /** Sub-account lifecycle (M2 Slice S2a · #267). Transfer lands in S2b. */
1112
1851
  readonly subAccounts: SubAccountsMethods;
1113
1852
  /**
@@ -1120,8 +1859,6 @@ interface CapxulClient {
1120
1859
  readonly createOrg: OrgMethods["createOrg"];
1121
1860
  readonly orgs: OrgMethods["orgs"];
1122
1861
  readonly org: OrgMethods["org"];
1123
- /** Resolved bootstrap for this client instance (chain, auth URLs, etc.). */
1124
- readonly bootstrap: BootstrapResolution;
1125
1862
  /**
1126
1863
  * Internal observation namespace. Consumers MUST NOT drive the actor
1127
1864
  * directly — use the method bundles instead.
@@ -1130,17 +1867,23 @@ interface CapxulClient {
1130
1867
  */
1131
1868
  readonly _internal: {
1132
1869
  readonly authActor: AuthFlowObserver;
1870
+ /**
1871
+ * Resolved bootstrap for this client instance (chain, auth URLs, etc.).
1872
+ * Off the public surface per production-surface-policy.md (#31).
1873
+ */
1874
+ readonly bootstrap: BootstrapResolution;
1133
1875
  /**
1134
1876
  * Dev-only faucet bundle (production-surface-policy.md). `fund` lives here,
1135
1877
  * NOT on the public `client.accounts` surface.
1136
1878
  */
1137
- readonly accounts: AccountsFaucetMethods;
1879
+ readonly accounts: AccountsFaucetMethods; /** Telemetry port for error reporting. Used by React hooks to report errors before throwing. */
1880
+ readonly telemetry?: TelemetryPort;
1138
1881
  readonly close?: () => Promise<void>;
1139
1882
  };
1140
1883
  }
1141
1884
  interface CreateCapxulClientInput {
1142
1885
  /**
1143
- * The 12-port `FlowPorts` bundle. The factory narrows this to the
1886
+ * The 13-port `FlowPorts` bundle. The factory narrows this to the
1144
1887
  * 3-port AuthFlow subset (`authClient`, `clock`, `telemetry`) for
1145
1888
  * the flow internally, and uses additional ports (`identity`,
1146
1889
  * `smartAccount`) for the method bundles.
@@ -1204,23 +1947,97 @@ interface CreateCapxulClientInput {
1204
1947
  readonly orgSpendPort?: OrgSpendPort;
1205
1948
  readonly orgDeploymentConfig?: SafeDeploymentConfig;
1206
1949
  }
1207
- declare function assembleCapxulClient(input: CreateCapxulClientInput): CapxulClient;
1950
+ //#endregion
1951
+ //#region src/adapters/auth-cache/BrowserAuthCacheAdapter.d.ts
1952
+ interface BrowserStorageShape {
1953
+ getItem(key: string): string | null;
1954
+ setItem(key: string, value: string): void;
1955
+ removeItem(key: string): void;
1956
+ }
1957
+ //#endregion
1958
+ //#region src/dev-signer.d.ts
1959
+ interface DevPrivateKeySignerInput {
1960
+ /** Dev-only derivation seed (e.g. `VITE_CAPXUL_DEV_SIGNER_SEED`). Throwaway keys only. */
1961
+ readonly seed: string;
1962
+ /** Explicit email — skips the auth-cache lookup (tests, node harnesses). */
1963
+ readonly email?: string;
1964
+ /** Storage holding the cached session. Defaults to browser `localStorage`. */
1965
+ readonly storage?: BrowserStorageShape;
1966
+ }
1967
+ /** Deterministic dev private key for an email under a seed. Exported for probes. */
1968
+ declare function deriveDevPrivateKey(seed: string, email: string): Hex;
1969
+ /**
1970
+ * Browser-safe dev signer. Lazy: the email (and so the key) is resolved at
1971
+ * each `getAddress()` / `signUserOpHash()` from the cached session, so the
1972
+ * same signer instance follows whichever user is signed in.
1973
+ */
1974
+ declare function devPrivateKeySigner(input: DevPrivateKeySignerInput): CapxulSigner;
1975
+ //#endregion
1976
+ //#region src/adapters/openfort/embedded-wallet-port.d.ts
1977
+ /**
1978
+ * Minimal Openfort embedded-wallet surface for hermetic tests and
1979
+ * `openfortEmbeddedSigner`. Keeps Convex / Shield secrets out of the SDK.
1980
+ */
1981
+ interface OpenfortEmbeddedWalletPort {
1982
+ /** Owner EOA address — must stay stable for the lifetime of this port. */
1983
+ getAddress(): Promise<string>;
1984
+ /**
1985
+ * Sign a 32-byte SafeOp digest without EIP-191 prefixing (backend-orchestrated
1986
+ * deploy contract).
1987
+ */
1988
+ signRawDigest(hash: Hex): Promise<Hex>;
1989
+ }
1990
+ /** Openfort `embeddedWallet` subset used by `openfortEmbeddedWalletPort`. */
1991
+ interface OpenfortEmbeddedWalletApi {
1992
+ get(): Promise<{
1993
+ readonly address: string;
1994
+ }>;
1995
+ signMessage(message: string | Uint8Array, options?: {
1996
+ readonly hashMessage?: boolean;
1997
+ readonly arrayifyMessage?: boolean;
1998
+ }): Promise<string>;
1999
+ }
2000
+ declare function openfortEmbeddedWalletPort(input: {
2001
+ readonly embeddedWallet: OpenfortEmbeddedWalletApi;
2002
+ readonly ensureReady?: () => Promise<void>;
2003
+ }): OpenfortEmbeddedWalletPort;
2004
+ //#endregion
2005
+ //#region src/openfort-embedded-signer.d.ts
2006
+ interface OpenfortEmbeddedSignerInput {
2007
+ readonly wallet: OpenfortEmbeddedWalletPort;
2008
+ }
2009
+ /** Browser helper: wrap an initialized Openfort `embeddedWallet` API. */
2010
+ declare function openfortEmbeddedSignerFromWallet(input: {
2011
+ readonly embeddedWallet: OpenfortEmbeddedWalletApi;
2012
+ readonly ensureWalletReady?: () => Promise<void>;
2013
+ }): OpenfortEmbeddedSigner;
2014
+ /**
2015
+ * Browser `CapxulSigner` backed by an Openfort embedded wallet (#335).
2016
+ * Signs the backend's SafeOp digest via raw `signMessage` (no EIP-191 prefix)
2017
+ * and verifies recovery before the backend submits.
2018
+ */
2019
+ type OpenfortEmbeddedSigner = CapxulSigner & {
2020
+ /** Drop cached `getAddress()` so the next read hits the embedded wallet again. */readonly resetAddressCache: () => void;
2021
+ };
2022
+ declare function openfortEmbeddedSigner(input: OpenfortEmbeddedSignerInput): OpenfortEmbeddedSigner;
2023
+ /**
2024
+ * Canonical name for the embedded-wallet `CapxulSigner` constructor
2025
+ * (backend-orchestrated-deploy.md). The embedded-wallet (passkey / Openfort)
2026
+ * member of the named constructor trio `localPrivateKeySigner` /
2027
+ * `injectedWalletSigner` / `embeddedSigner`. Takes the provider-agnostic
2028
+ * `OpenfortEmbeddedWalletPort` (getAddress + signRawDigest); the Openfort-API
2029
+ * convenience wrapper is `openfortEmbeddedSignerFromWallet`.
2030
+ */
2031
+ declare const embeddedSigner: typeof openfortEmbeddedSigner;
1208
2032
  //#endregion
1209
2033
  //#region src/production.d.ts
1210
- type ProductionRuntime = "browser" | "node";
1211
- type ProductionAdapterClose = () => Promise<void>;
1212
- interface ProductionAdapterInput {
2034
+ /**
2035
+ * Consumer-facing `createCapxulClient` input (SDK DX public surface · #326).
2036
+ * The publishable key is the primary input; bootstrap host, invoke timeout,
2037
+ * runtime detection, and auth-cache selection are SDK-owned defaults.
2038
+ */
2039
+ interface CapxulClientInput {
1213
2040
  readonly publishableKey: string;
1214
- readonly origin?: string;
1215
- readonly bootstrapBaseUrl?: string;
1216
- readonly runtime?: ProductionRuntime;
1217
- readonly authCache?: AuthCachePort;
1218
- readonly telemetry?: TelemetryPort;
1219
- readonly evmSigner?: EvmSignerPort;
1220
- readonly fetch?: typeof fetch;
1221
- readonly signal?: AbortSignal;
1222
- readonly otpTtlMs?: number;
1223
- readonly invokeTimeoutMs?: number;
1224
2041
  /**
1225
2042
  * Init-time account readiness target (issue #159 · AC4). Threaded into
1226
2043
  * `assembleCapxulClient` so `client.account.{getStatus,ensureReady}` reflect
@@ -1237,27 +2054,38 @@ interface ProductionAdapterInput {
1237
2054
  * holds an RPC URL, a gas-sponsorship policy, or a bundler.
1238
2055
  */
1239
2056
  readonly signer?: CapxulSigner;
1240
- /**
1241
- * Optional live Org-deploy lane (canon D10 SDK-orchestrated Org Safe deploy +
1242
- * D3 RPC treasury). Supplied as a FACTORY rather than a pre-built port because
1243
- * the live `OrgPort` (`LiveOrgDeploymentAdapter`) talks to the backend
1244
- * `org.createOrg` mutation through the SAME authenticated Convex seam the rest
1245
- * of the client uses (`tokenProvider → getConvexJwt → ConvexCallAdapter`),
1246
- * which only exists AFTER `createProductionAdapters` resolves bootstrap. The
1247
- * factory receives that resolved `ConvexCallPort` and returns the port; the
1248
- * CLI deploy-stack builds the factory from the deployer key + RPC (the same
1249
- * env/signer as `safeDeploymentPort`). When omitted, the hermetic `$0` path
1250
- * runs (a fresh Org has no on-chain funds).
1251
- */
1252
- readonly orgDeploymentPortFactory?: (convex: ConvexCallPort) => OrgPort & OrgRolesDeploymentPort & OrgSpendPort;
1253
- readonly orgDeploymentConfig?: SafeDeploymentConfig;
1254
2057
  }
1255
- interface ProductionAdapters {
1256
- readonly ports: FlowPorts;
1257
- readonly bootstrap: BootstrapResolution;
1258
- readonly close: ProductionAdapterClose;
2058
+ //#endregion
2059
+ //#region src/client/create-capxul-client-from-production.d.ts
2060
+ /** Consumer-facing factory — accepts only production-meaningful inputs (#326). */
2061
+ declare function createCapxulClient(input: CapxulClientInput): Promise<CapxulResult<CapxulClient>>;
2062
+ //#endregion
2063
+ //#region src/telemetry/capture-exception.d.ts
2064
+ interface HandledErrorReportContext {
2065
+ readonly layer?: string;
2066
+ readonly operation?: string;
2067
+ readonly provider?: string;
2068
+ readonly capxul_error_code?: string;
2069
+ readonly failure_mode?: FailureMode;
1259
2070
  }
1260
- declare function createCapxulClient(input: ProductionAdapterInput): Promise<CapxulResult<CapxulClient>>;
2071
+ /**
2072
+ * Capture an error as a `$exception` event through the telemetry port,
2073
+ * formatted for PostHog Error Tracking.
2074
+ *
2075
+ * Parses stack traces into `$exception_list` format, extracts structured
2076
+ * metadata from CapxulError objects, and supplements with context props.
2077
+ * Fire-and-forget: telemetry defects are silently swallowed.
2078
+ * Returns `Effect<void, never>` for use in Effect pipelines; the underlying
2079
+ * adapter work is synchronous, so callers outside Effect contexts can
2080
+ * use `Effect.runSync`.
2081
+ */
2082
+ declare function captureException(telemetry: TelemetryPort, error: unknown, context?: HandledErrorReportContext): Effect.Effect<void, never>;
2083
+ /**
2084
+ * Synchronous fire-and-forget capture. Runs the Effect inline with
2085
+ * `Effect.runSync` so callers outside an Effect context (e.g. React
2086
+ * hooks before throwing) can report errors without awaiting.
2087
+ */
2088
+ declare function captureExceptionSync(telemetry: TelemetryPort, error: unknown, context?: HandledErrorReportContext): void;
1261
2089
  //#endregion
1262
- export { type Account, type AccountMethods, type AccountProvider, type AccountProviderSource, type AccountRequirement, type AccountStatus, type AccountsMethods, type Address, type AssignRoleInput, type AuthMethods, type AuthSession, type AuthUserId, type CapxulClient, type CapxulResult, type CapxulSigner, type CreateCapxulClientInput, type CreateOrgInput, type DetectPendingOrgInvitationsResult, type Eip1193Provider, type Eip1193RequestProvider, type IdentityMethods, type InviteMemberInput, type MemberStatus, type MemberView, type Money, type OrgId, type OrgMethods, type OrgScopedMethods, type OrgSpendInput, type OrgSpendResult, type OrgTemplate, type OrgView, type ProductionAdapterClose, type ProductionAdapterInput, type ProductionAdapters, type ProductionRuntime, 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, localPrivateKeyAccountProvider, openfortEmbeddedAccountProvider };
2090
+ 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 CapxulClient, type CapxulClientInput, type CapxulResult, type CapxulSigner, type CreateCapxulClientInput, type CreateOrgInput, type DepositInstructions, type DetectPendingOrgInvitationsResult, type DevPrivateKeySignerInput, type Eip1193Provider, type Eip1193RequestProvider, type FinancialOpsMethods, type HandledErrorReportContext, type HandlesMethods, type IdentityMethods, type InviteMemberInput, type MeMethods, type MeProfile, type MemberStatus, type MemberView, type Money, type OpenfortEmbeddedSignerInput, type OpenfortEmbeddedWalletApi, type OpenfortEmbeddedWalletPort, type OrgBatchPayrollInput, type OrgId, type OrgMethods, type OrgPayrollRun, type OrgScopedMethods, type OrgSpendViaPaymentsInput, type OrgTemplate, type OrgView, type Payee, type PayeesMethods, type Payment, type PaymentDocumentRef, type PaymentDocumentRender, type PaymentDocumentVerification, type PaymentDocumentsMethods, type PaymentDraft, type PaymentDraftStatus, type PaymentMoney, type PaymentRelease, type PaymentRequest, type PaymentRequestStatus, type PaymentRequestsCreateInput, type PaymentRequestsMethods, type PaymentSettlementInput, type PaymentStatus, type PaymentType, type PaymentsMethods, type PaymentsPayInput, type PaymentsWithdrawInput, type Profile, type RecipientResolution, type RecipientResolutionKind, type ReconciliationEntry, type RemoveMemberInput, type RoleDefinition, type RoleKey, type RoleSpendCap, type RoleView, type Session, type SmartAccount, type SmartAccountMethods, type SubAccount, type SubAccountId, type SubAccountsMethods, type TelemetryPort, type TransferEndpoint, type TransferInput, type TransferResult, type WorkbenchDraftInput, type WorkbenchExecuteInput, type WorkbenchMethods, type WorkbenchMintResult, captureException, captureExceptionSync, createCapxulClient, deriveDevPrivateKey, devPrivateKeySigner, eip1193AccountProvider, embeddedSigner, injectedWalletSigner, isSettingUpLifecycle, localPrivateKeyAccountProvider, openfortEmbeddedSigner, openfortEmbeddedSignerFromWallet, openfortEmbeddedWalletPort };
1263
2091
  //# sourceMappingURL=index.d.mts.map