@capxul/sdk 1.2.3 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import { A as CurrencyCode, B as SessionToken, C as AnonymousDistinctId, D as BlockNumber, E as AuthUserId, F as Money, H as SubAccount, I as OrgId, J as CapxulErrorCode, L as Profile, M as DurationMs, N as Email, O as ChainId, P as EpochMs, R as PublishableKey, S as AllowedOrigin, T as AuthSession, U as SubAccountId, V as SmartAccount, W as TxHash, X as Failure, Y as CapxulErrorDetails, Z as FailureMode, b as AccountId, d as CapxulResult, f as Profile$1, g as AuthCachePort, j as DocumentHash, k as CountryCode, m as SmartAccount$1, n as CapxulSigner, o as AccountProviderSource, p as Session$1, q as CapxulError, s as AccountRequirement, v as CachedJwt, w as AppId, x as Address, y as Account$1, z as RoleKey } from "./signer-DgWAmtmi.mjs";
2
- import { Hex } from "viem";
1
+ import { $ as CapxulErrorDetails, A as CountryCode, B as PermissionAssignmentId, C as AllowedOrigin, D as AuthUserId, E as AuthSession, F as EpochMs, G as SessionToken, H as Profile, I as Money, J as WeiAmount, K as SmartAccount, L as MovementId, M as DocumentHash, N as DurationMs, O as BlockNumber, P as Email, Q as CapxulErrorCode, R as OrgId, S as AllowanceKey, T as AppId, U as PublishableKey, V as PermissionId, W as RoleKey, Z as CapxulError, d as CapxulResult, et as Failure, f as Profile$1, g as AuthCachePort, j as CurrencyCode, k as ChainId, m as SmartAccount$1, n as CapxulSigner, o as AccountProviderSource, p as Session$1, q as TxHash, s as AccountRequirement, tt as FailureMode, v as CachedJwt, w as AnonymousDistinctId, x as Address$1, y as Account$1, z as PaymentCommandId } from "./signer-ZijoFiUs.mjs";
2
+ import { Address, Hex } from "viem";
3
3
  import { Context, Effect, Layer, Schema, Scope, Tracer } from "effect";
4
4
  import { FunctionReference } from "convex/server";
5
5
 
@@ -224,6 +224,10 @@ type Destination$1 = {
224
224
  */
225
225
  declare const destination: (state: IdentityState) => Destination$1 | null;
226
226
  //#endregion
227
+ //#region ../config/src/capxul-payments-v2.d.ts
228
+ /** Immutable CapxulPaymentsV2 deployment on Base Sepolia. */
229
+ declare const CAPXUL_PAYMENTS_V2_ADDRESS: Address;
230
+ //#endregion
227
231
  //#region src/ports/auth-client.d.ts
228
232
  type AuthClientOperationOptions = {
229
233
  readonly signal?: AbortSignal;
@@ -307,7 +311,7 @@ interface TelemetryPort {
307
311
  }
308
312
  //#endregion
309
313
  //#region ../observability/src/index.d.ts
310
- declare const TELEMETRY_EVENT_NAMES: readonly ["auth_otp_requested", "auth_otp_delivered", "auth_otp_expired", "auth_verified", "auth_failed", "auth_signed_out", "onboarding_intent_selected", "onboarding_profile_submitted", "onboarding_organization_submitted", "onboarding_dashboard_reached", "provisioning_safe_created", "provisioning_safe_confirmed", "bootstrap_resolved", "bootstrap_failed", "member_activation_started", "member_activation_ready", "member_activation_failed", "organization_creation_started", "organization_creation_ready", "organization_creation_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_backend_received", "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"];
314
+ declare const TELEMETRY_EVENT_NAMES: readonly ["auth_otp_requested", "auth_otp_delivered", "auth_otp_expired", "auth_verified", "auth_failed", "auth_signed_out", "onboarding_intent_selected", "onboarding_profile_submitted", "onboarding_organization_submitted", "onboarding_dashboard_reached", "provisioning_safe_created", "provisioning_safe_confirmed", "bootstrap_resolved", "bootstrap_failed", "member_activation_started", "member_activation_ready", "member_activation_failed", "organization_creation_started", "organization_creation_ready", "organization_creation_failed", "account_balance_read", "account_balance_failed", "faucet_requested", "faucet_confirmed", "faucet_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_invite_expired", "payment_initiated", "payment_settled", "payment_failed", "deposit_initiated", "deposit_settled", "permission_mirror_verification", "movement_scan_window", "movement_scan_checkpoint", "movement_scan_incident"];
311
315
  type TelemetryEventName = (typeof TELEMETRY_EVENT_NAMES)[number];
312
316
  type TelemetryProps = Record<string, unknown>;
313
317
  type TelemetryEvent = {
@@ -350,9 +354,9 @@ declare const EngineeringTelemetryBootstrapPolicy: Schema.Struct<{
350
354
  type EngineeringTelemetryBootstrapPolicyV1 = Schema.Schema.Type<typeof EngineeringTelemetryBootstrapPolicy>;
351
355
  //#endregion
352
356
  //#region ../wire/src/status.d.ts
353
- /** Payment lifecycle states carried on the wire (ADR-0018 P1). */
354
- declare const PAYMENT_STATUSES: readonly ["pending", "submitted", "pending_claim", "scheduled", "streaming", "settled", "cancelled", "redirected", "expired", "failed"];
355
- type PaymentStatus$1 = (typeof PAYMENT_STATUSES)[number];
357
+ /** The closed L2 Payment status authority. */
358
+ declare const L2_PAYMENT_STATUSES: readonly ["pending", "settling", "scheduled", "streaming", "pending_claim", "settled", "cancelled", "failed"];
359
+ type L2PaymentStatus = (typeof L2_PAYMENT_STATUSES)[number];
356
360
  /** What a payment is FOR. Pairs with `PAYMENT_DOCUMENT_KINDS`. */
357
361
  declare const PAYMENT_TYPES: readonly ["unspecified", "invoice", "payroll", "reimbursement"];
358
362
  type PaymentType$1 = (typeof PAYMENT_TYPES)[number];
@@ -446,130 +450,6 @@ declare const AttachablePaymentDocumentEnvelope: Schema.Union<readonly [Schema.S
446
450
  readonly note: Schema.String;
447
451
  }>;
448
452
  }>]>;
449
- declare const WithdrawalDocumentEnvelope: Schema.Struct<{
450
- readonly protocol: Schema.Literal<"capxul.payment-document">;
451
- readonly version: Schema.Literal<1>;
452
- readonly domain: Schema.Struct<{
453
- readonly name: Schema.Literal<"CapxulPayments">;
454
- readonly version: Schema.Literal<"1">;
455
- readonly chainId: Schema.Codec<ChainId, number, never, never>;
456
- readonly verifyingContract: Schema.Literal<"0xe740ea65521edc9bef0ea75d30b5334711db99f4">;
457
- }>;
458
- readonly primaryType: Schema.Literal<"Withdrawal">;
459
- readonly message: Schema.Struct<{
460
- readonly kind: Schema.Literal<4>;
461
- readonly reference: Schema.String;
462
- readonly amount: Schema.String;
463
- readonly currency: Schema.Codec<CurrencyCode, string, never, never>;
464
- readonly decimals: Schema.Number;
465
- readonly destChain: Schema.Codec<ChainId, number, never, never>;
466
- readonly destAddress: Schema.String;
467
- readonly settledAt: Schema.Number;
468
- readonly provider: Schema.String;
469
- readonly note: Schema.String;
470
- }>;
471
- }>;
472
- declare const PaymentDocumentEnvelope: Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
473
- readonly protocol: Schema.Literal<"capxul.payment-document">;
474
- readonly version: Schema.Literal<1>;
475
- readonly domain: Schema.Struct<{
476
- readonly name: Schema.Literal<"CapxulPayments">;
477
- readonly version: Schema.Literal<"1">;
478
- readonly chainId: Schema.Codec<ChainId, number, never, never>;
479
- readonly verifyingContract: Schema.Literal<"0xe740ea65521edc9bef0ea75d30b5334711db99f4">;
480
- }>;
481
- readonly primaryType: Schema.Literal<"Memo">;
482
- readonly message: Schema.Struct<{
483
- readonly kind: Schema.Literal<0>;
484
- readonly reference: Schema.String;
485
- readonly note: Schema.String;
486
- readonly issuedAt: Schema.Number;
487
- }>;
488
- }>, Schema.Struct<{
489
- readonly protocol: Schema.Literal<"capxul.payment-document">;
490
- readonly version: Schema.Literal<1>;
491
- readonly domain: Schema.Struct<{
492
- readonly name: Schema.Literal<"CapxulPayments">;
493
- readonly version: Schema.Literal<"1">;
494
- readonly chainId: Schema.Codec<ChainId, number, never, never>;
495
- readonly verifyingContract: Schema.Literal<"0xe740ea65521edc9bef0ea75d30b5334711db99f4">;
496
- }>;
497
- readonly primaryType: Schema.Literal<"Invoice">;
498
- readonly message: Schema.Struct<{
499
- readonly kind: Schema.Literal<1>;
500
- readonly invoiceNumber: Schema.String;
501
- readonly payerRef: Schema.String;
502
- readonly payeeRef: Schema.String;
503
- readonly amount: Schema.String;
504
- readonly currency: Schema.Codec<CurrencyCode, string, never, never>;
505
- readonly decimals: Schema.Number;
506
- readonly issuedAt: Schema.Number;
507
- readonly dueAt: Schema.Number;
508
- readonly lineItemsHash: Schema.Codec<DocumentHash, string, never, never>;
509
- }>;
510
- }>, Schema.Struct<{
511
- readonly protocol: Schema.Literal<"capxul.payment-document">;
512
- readonly version: Schema.Literal<1>;
513
- readonly domain: Schema.Struct<{
514
- readonly name: Schema.Literal<"CapxulPayments">;
515
- readonly version: Schema.Literal<"1">;
516
- readonly chainId: Schema.Codec<ChainId, number, never, never>;
517
- readonly verifyingContract: Schema.Literal<"0xe740ea65521edc9bef0ea75d30b5334711db99f4">;
518
- }>;
519
- readonly primaryType: Schema.Literal<"Payslip">;
520
- readonly message: Schema.Struct<{
521
- readonly kind: Schema.Literal<2>;
522
- readonly employerRef: Schema.String;
523
- readonly employeeRef: Schema.String;
524
- readonly period: Schema.String;
525
- readonly gross: Schema.String;
526
- readonly net: Schema.String;
527
- readonly currency: Schema.Codec<CurrencyCode, string, never, never>;
528
- readonly decimals: Schema.Number;
529
- readonly issuedAt: Schema.Number;
530
- }>;
531
- }>, Schema.Struct<{
532
- readonly protocol: Schema.Literal<"capxul.payment-document">;
533
- readonly version: Schema.Literal<1>;
534
- readonly domain: Schema.Struct<{
535
- readonly name: Schema.Literal<"CapxulPayments">;
536
- readonly version: Schema.Literal<"1">;
537
- readonly chainId: Schema.Codec<ChainId, number, never, never>;
538
- readonly verifyingContract: Schema.Literal<"0xe740ea65521edc9bef0ea75d30b5334711db99f4">;
539
- }>;
540
- readonly primaryType: Schema.Literal<"Receipt">;
541
- readonly message: Schema.Struct<{
542
- readonly kind: Schema.Literal<3>;
543
- readonly reference: Schema.String;
544
- readonly amount: Schema.String;
545
- readonly currency: Schema.Codec<CurrencyCode, string, never, never>;
546
- readonly decimals: Schema.Number;
547
- readonly paidAt: Schema.Number;
548
- readonly note: Schema.String;
549
- }>;
550
- }>]>, Schema.Struct<{
551
- readonly protocol: Schema.Literal<"capxul.payment-document">;
552
- readonly version: Schema.Literal<1>;
553
- readonly domain: Schema.Struct<{
554
- readonly name: Schema.Literal<"CapxulPayments">;
555
- readonly version: Schema.Literal<"1">;
556
- readonly chainId: Schema.Codec<ChainId, number, never, never>;
557
- readonly verifyingContract: Schema.Literal<"0xe740ea65521edc9bef0ea75d30b5334711db99f4">;
558
- }>;
559
- readonly primaryType: Schema.Literal<"Withdrawal">;
560
- readonly message: Schema.Struct<{
561
- readonly kind: Schema.Literal<4>;
562
- readonly reference: Schema.String;
563
- readonly amount: Schema.String;
564
- readonly currency: Schema.Codec<CurrencyCode, string, never, never>;
565
- readonly decimals: Schema.Number;
566
- readonly destChain: Schema.Codec<ChainId, number, never, never>;
567
- readonly destAddress: Schema.String;
568
- readonly settledAt: Schema.Number;
569
- readonly provider: Schema.String;
570
- readonly note: Schema.String;
571
- }>;
572
- }>]>;
573
453
  /**
574
454
  * #592 invoice line item. `quantity` is a positive integer; `unitMinor` is the
575
455
  * per-unit price in integer minor units. The list is canonically hashed by
@@ -584,24 +464,139 @@ declare const LineItem: Schema.Struct<{
584
464
  readonly unitMinor: Schema.String;
585
465
  }>;
586
466
  type AttachablePaymentDocumentEnvelopeV1 = Schema.Schema.Type<typeof AttachablePaymentDocumentEnvelope>;
587
- type PaymentDocumentEnvelopeV1 = Schema.Schema.Type<typeof PaymentDocumentEnvelope>;
588
- type WithdrawalDocumentEnvelopeV1 = Schema.Schema.Type<typeof WithdrawalDocumentEnvelope>;
589
467
  type LineItemV1 = Schema.Schema.Type<typeof LineItem>;
590
468
  //#endregion
591
- //#region ../wire/src/leak-safety.d.ts
592
- declare const OnchainEvidenceBrand: unique symbol;
593
- /**
594
- * The branded `{ userOpHash, txHash }` pair. On-chain settlement evidence is
595
- * INTERNAL — it flows on the server-internal channel only, never onto a wire
596
- * Payment or any MCP tool output. The brand makes "this is internal evidence"
597
- * a type, so a loose pair can't be passed where a wire field is expected.
598
- */
599
- type OnchainEvidence = {
600
- readonly userOpHash: string;
601
- readonly txHash: string;
602
- } & {
603
- readonly [OnchainEvidenceBrand]: "OnchainEvidence";
604
- };
469
+ //#region ../wire/src/l2-money.d.ts
470
+ declare const MovementAnnotationSchema: Schema.Struct<{
471
+ readonly movementId: Schema.Codec<MovementId, string, never, never>;
472
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
473
+ readonly kind: Schema.Literal<"account">;
474
+ readonly accountId: Schema.refine<string, Schema.String>;
475
+ }>, Schema.Struct<{
476
+ readonly kind: Schema.Literal<"organization">;
477
+ readonly orgId: Schema.refine<string, Schema.String>;
478
+ }>]>;
479
+ readonly counterpartyLabel: Schema.optional<Schema.String>;
480
+ readonly accountingCategory: Schema.optional<Schema.String>;
481
+ readonly memo: Schema.optional<Schema.String>;
482
+ readonly lastEditor: Schema.Union<readonly [Schema.Struct<{
483
+ readonly kind: Schema.Literal<"account">;
484
+ readonly accountId: Schema.refine<string, Schema.String>;
485
+ }>, Schema.Struct<{
486
+ readonly kind: Schema.Literal<"organization">;
487
+ readonly orgId: Schema.refine<string, Schema.String>;
488
+ }>]>;
489
+ readonly updatedAt: Schema.refine<number, Schema.Number>;
490
+ }>;
491
+ type MovementAnnotation = Schema.Schema.Type<typeof MovementAnnotationSchema>;
492
+ declare const PermissionSchema: Schema.Struct<{
493
+ readonly permissionId: Schema.Codec<PermissionId, string, never, never>;
494
+ readonly orgId: Schema.refine<string, Schema.String>;
495
+ readonly type: Schema.Literals<readonly ["budget", "managePeople"]>;
496
+ readonly state: Schema.Literals<readonly ["pending", "active", "suspended", "revoked", "superseded", "quarantined"]>;
497
+ readonly revision: Schema.refine<number, Schema.Number>;
498
+ readonly roleKey: Schema.Codec<RoleKey, string, never, never>;
499
+ readonly tokenAddress: Schema.optional<Schema.Codec<Address$1, string, never, never>>;
500
+ readonly limitRaw: Schema.optional<Schema.Codec<WeiAmount, string, never, never>>;
501
+ readonly allowanceKey: Schema.optional<Schema.Codec<AllowanceKey, string, never, never>>;
502
+ }>;
503
+ type Permission = Schema.Schema.Type<typeof PermissionSchema>;
504
+ declare const PermissionAssignmentSchema: Schema.Struct<{
505
+ readonly permissionAssignmentId: Schema.Codec<PermissionAssignmentId, string, never, never>;
506
+ readonly permissionId: Schema.Codec<PermissionId, string, never, never>;
507
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
508
+ readonly kind: Schema.Literal<"account">;
509
+ readonly accountId: Schema.refine<string, Schema.String>;
510
+ }>, Schema.Struct<{
511
+ readonly kind: Schema.Literal<"organization">;
512
+ readonly orgId: Schema.refine<string, Schema.String>;
513
+ }>]>;
514
+ readonly state: Schema.Literals<readonly ["pending", "active", "suspended", "revoked", "superseded", "quarantined"]>;
515
+ }>;
516
+ type PermissionAssignment = Schema.Schema.Type<typeof PermissionAssignmentSchema>;
517
+ declare const CurrentHoldingsSchema: Schema.Struct<{
518
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
519
+ readonly kind: Schema.Literal<"account">;
520
+ readonly accountId: Schema.refine<string, Schema.String>;
521
+ }>, Schema.Struct<{
522
+ readonly kind: Schema.Literal<"organization">;
523
+ readonly orgId: Schema.refine<string, Schema.String>;
524
+ }>]>;
525
+ readonly chainId: Schema.Codec<ChainId, number, never, never>;
526
+ readonly observedAt: Schema.refine<number, Schema.Number>;
527
+ readonly stale: Schema.Boolean;
528
+ readonly rows: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
529
+ readonly assetKind: Schema.Literal<"native">;
530
+ readonly symbol: Schema.optional<Schema.String>;
531
+ readonly decimals: Schema.optional<Schema.refine<number, Schema.Number>>;
532
+ readonly rawBalance: Schema.Codec<WeiAmount, string, never, never>;
533
+ }>, Schema.Struct<{
534
+ readonly assetKind: Schema.Literal<"erc20">;
535
+ readonly tokenAddress: Schema.Codec<Address$1, string, never, never>;
536
+ readonly symbol: Schema.optional<Schema.String>;
537
+ readonly decimals: Schema.optional<Schema.refine<number, Schema.Number>>;
538
+ readonly rawBalance: Schema.Codec<WeiAmount, string, never, never>;
539
+ }>]>>;
540
+ }>;
541
+ type CurrentHoldings = Schema.Schema.Type<typeof CurrentHoldingsSchema>;
542
+ declare const PaymentCommandLineageSchema: Schema.Union<readonly [Schema.Struct<{
543
+ readonly kind: Schema.Literal<"payroll">;
544
+ readonly runId: Schema.refine<string, Schema.String>;
545
+ }>, Schema.Struct<{
546
+ readonly kind: Schema.Literal<"payment_request">;
547
+ readonly requestId: Schema.refine<string, Schema.String>;
548
+ }>]>;
549
+ type PaymentCommandLineage = Schema.Schema.Type<typeof PaymentCommandLineageSchema>;
550
+ declare const PermissionIntentSchema: Schema.Union<readonly [Schema.Struct<{
551
+ readonly type: Schema.Literal<"budget">;
552
+ readonly limit: Schema.Struct<{
553
+ readonly currency: Schema.Codec<CurrencyCode, string, never, never>;
554
+ readonly value: Schema.String;
555
+ readonly decimals: Schema.Number;
556
+ }>;
557
+ }>, Schema.Struct<{
558
+ readonly type: Schema.Literal<"managePeople">;
559
+ }>]>;
560
+ type PermissionIntent = Schema.Schema.Type<typeof PermissionIntentSchema>;
561
+ declare const SubmittedPermissionExecutionSchema: Schema.Struct<{
562
+ readonly status: Schema.Literal<"submitted">;
563
+ readonly executionId: Schema.refine<string, Schema.String>;
564
+ readonly commandId: Schema.Codec<PaymentCommandId, string, never, never>;
565
+ readonly userOpHash: Schema.Codec<string, string, never, never>;
566
+ readonly value: Schema.Union<readonly [Schema.Struct<{
567
+ readonly permissionId: Schema.Codec<PermissionId, string, never, never>;
568
+ readonly orgId: Schema.refine<string, Schema.String>;
569
+ readonly type: Schema.Literals<readonly ["budget", "managePeople"]>;
570
+ readonly state: Schema.Literals<readonly ["pending", "active", "suspended", "revoked", "superseded", "quarantined"]>;
571
+ readonly revision: Schema.refine<number, Schema.Number>;
572
+ readonly roleKey: Schema.Codec<RoleKey, string, never, never>;
573
+ readonly tokenAddress: Schema.optional<Schema.Codec<Address$1, string, never, never>>;
574
+ readonly limitRaw: Schema.optional<Schema.Codec<WeiAmount, string, never, never>>;
575
+ readonly allowanceKey: Schema.optional<Schema.Codec<AllowanceKey, string, never, never>>;
576
+ }>, Schema.Struct<{
577
+ readonly permissionAssignmentId: Schema.Codec<PermissionAssignmentId, string, never, never>;
578
+ readonly permissionId: Schema.Codec<PermissionId, string, never, never>;
579
+ readonly actor: Schema.Union<readonly [Schema.Struct<{
580
+ readonly kind: Schema.Literal<"account">;
581
+ readonly accountId: Schema.refine<string, Schema.String>;
582
+ }>, Schema.Struct<{
583
+ readonly kind: Schema.Literal<"organization">;
584
+ readonly orgId: Schema.refine<string, Schema.String>;
585
+ }>]>;
586
+ readonly state: Schema.Literals<readonly ["pending", "active", "suspended", "revoked", "superseded", "quarantined"]>;
587
+ }>, Schema.$Array<Schema.Struct<{
588
+ readonly permissionId: Schema.Codec<PermissionId, string, never, never>;
589
+ readonly orgId: Schema.refine<string, Schema.String>;
590
+ readonly type: Schema.Literals<readonly ["budget", "managePeople"]>;
591
+ readonly state: Schema.Literals<readonly ["pending", "active", "suspended", "revoked", "superseded", "quarantined"]>;
592
+ readonly revision: Schema.refine<number, Schema.Number>;
593
+ readonly roleKey: Schema.Codec<RoleKey, string, never, never>;
594
+ readonly tokenAddress: Schema.optional<Schema.Codec<Address$1, string, never, never>>;
595
+ readonly limitRaw: Schema.optional<Schema.Codec<WeiAmount, string, never, never>>;
596
+ readonly allowanceKey: Schema.optional<Schema.Codec<AllowanceKey, string, never, never>>;
597
+ }>>]>;
598
+ }>;
599
+ type SubmittedPermissionExecution = Schema.Schema.Type<typeof SubmittedPermissionExecutionSchema>;
605
600
  //#endregion
606
601
  //#region ../wire/src/observation-context.d.ts
607
602
  /**
@@ -754,7 +749,7 @@ type CompleteOnboardingIdentityInput = {
754
749
  readonly email: Email;
755
750
  readonly displayName: string;
756
751
  readonly country: CountryCode;
757
- readonly withdrawalAddress?: Address; /** #1062: optional globally-unique handle — store-when-present, backend-normalized. */
752
+ readonly withdrawalAddress?: Address$1; /** #1062: optional globally-unique handle — store-when-present, backend-normalized. */
758
753
  readonly username?: string;
759
754
  };
760
755
  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 & {
@@ -817,15 +812,16 @@ type SafeDeploymentConfig = {
817
812
  */
818
813
  type SafeDeploymentEvidence = {
819
814
  readonly chainId: ChainId;
820
- readonly signerAddress: Address;
821
- readonly safeAddress: Address;
815
+ readonly signerAddress: Address$1;
816
+ readonly safeAddress: Address$1;
822
817
  readonly txHash?: TxHash;
823
818
  readonly userOpHash?: TxHash;
824
819
  readonly blockNumber?: BlockNumber;
825
820
  };
826
821
  type ProvisionInput = {
827
822
  readonly authUserId: AuthUserId;
828
- readonly chainId: ChainId;
823
+ readonly chainId: ChainId; /** Verified session email. The backend reads the same value from BetterAuth. */
824
+ readonly email: Email;
829
825
  };
830
826
  /**
831
827
  * Input to `SmartAccountPort.confirmDeployment` (#161 · γ-B).
@@ -844,7 +840,7 @@ type ProvisionInput = {
844
840
  type ConfirmDeploymentInput = {
845
841
  readonly authUserId: AuthUserId;
846
842
  readonly chainId: ChainId;
847
- readonly safeAddress: Address;
843
+ readonly safeAddress: Address$1;
848
844
  readonly evidence: SafeDeploymentEvidence;
849
845
  };
850
846
  /**
@@ -856,7 +852,7 @@ type ConfirmDeploymentInput = {
856
852
  type ClaimInput = {
857
853
  readonly authUserId: AuthUserId;
858
854
  readonly chainId: ChainId;
859
- readonly signerAddress: Address;
855
+ readonly signerAddress: Address$1;
860
856
  };
861
857
  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 & {
862
858
  readonly _tag: "SmartAccountError";
@@ -870,7 +866,7 @@ declare class SmartAccountError extends SmartAccountError_base<{
870
866
  }> {}
871
867
  interface SmartAccountPort {
872
868
  loadByAuthUserId(authUserId: AuthUserId): Effect.Effect<SmartAccount | null, SmartAccountError, never>;
873
- loadBySmartAccountAddress(address: Address): Effect.Effect<SmartAccount | null, SmartAccountError, never>;
869
+ loadBySmartAccountAddress(address: Address$1): Effect.Effect<SmartAccount | null, SmartAccountError, never>;
874
870
  provision(input: ProvisionInput): Effect.Effect<SmartAccount, SmartAccountError, never>;
875
871
  /**
876
872
  * Persist on-chain Safe-deployment evidence. The backend re-verifies
@@ -922,71 +918,9 @@ interface AccountReadPort {
922
918
  fundFromFaucet(input: FundFromFaucetInput): Effect.Effect<FundFromFaucetResult, AccountReadError, never>;
923
919
  }
924
920
  //#endregion
925
- //#region src/ports/sub-account.d.ts
926
- 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 & {
927
- readonly _tag: "SubAccountError";
928
- } & Readonly<A>;
929
- declare class SubAccountError extends SubAccountError_base<{
930
- readonly operation: string;
931
- readonly publicCode: CapxulErrorCode;
932
- readonly publicError: CapxulError;
933
- readonly cause: unknown;
934
- readonly details?: CapxulErrorDetails;
935
- }> {}
936
- type CreateSubAccountInput = {
937
- readonly accountId: AccountId;
938
- readonly name: string;
939
- };
940
- type SubAccountIdInput = {
941
- readonly subAccountId: SubAccountId;
942
- };
943
- type RenameSubAccountInput = {
944
- readonly subAccountId: SubAccountId;
945
- readonly name: string;
946
- };
947
- /**
948
- * A `transfer` endpoint is either the Account's MAIN balance (the remainder
949
- * left over after every sub-account is funded — never a stored row) or a
950
- * specific sub-account, addressed by its `SubAccountId` (canon
951
- * `account-balance-model.md` §5, §12).
952
- */
953
- type TransferEndpoint = "main" | SubAccountId;
954
- /**
955
- * Move money between two of the SAME Account's balances (canon §12). The
956
- * backend resolves the Account from auth (v1 = one Account per user), so the
957
- * input carries no `accountId` — only the from/to endpoints and the `Money`
958
- * amount. One verb covers money in (`main → sub`), money out (`sub → main`),
959
- * and `sub → sub`.
960
- */
961
- type TransferInput = {
962
- readonly from: TransferEndpoint;
963
- readonly to: TransferEndpoint;
964
- readonly amount: Money;
965
- };
966
- /**
967
- * Result of a `transfer`: the recomputed `available` (`balanceOf − Σ`), plus
968
- * the updated source/destination sub-account rows. An endpoint that is `"main"`
969
- * has no stored row, so its slot is `null`.
970
- */
971
- type TransferResult = {
972
- readonly available: Money;
973
- readonly from: SubAccount | null;
974
- readonly to: SubAccount | null;
975
- };
976
- interface SubAccountPort {
977
- create(input: CreateSubAccountInput): Effect.Effect<SubAccount, SubAccountError, never>;
978
- get(input: SubAccountIdInput): Effect.Effect<SubAccount | null, SubAccountError, never>;
979
- list(input: {
980
- readonly accountId: AccountId;
981
- }): Effect.Effect<readonly SubAccount[], SubAccountError, never>;
982
- rename(input: RenameSubAccountInput): Effect.Effect<SubAccount, SubAccountError, never>;
983
- delete(input: SubAccountIdInput): Effect.Effect<void, SubAccountError, never>;
984
- transfer(input: TransferInput): Effect.Effect<TransferResult, SubAccountError, never>;
985
- }
986
- //#endregion
987
921
  //#region src/flows/types.d.ts
988
922
  /**
989
- * The full 10-port bundle that `assembleCapxulClient` (slice 5) consumes.
923
+ * The full port bundle that `assembleCapxulClient` consumes.
990
924
  * (Was 13 before #1145 / DEMOLITION §D4 deleted the credentials, env and
991
925
  * transport ports — built by `production.ts`, read by nobody.)
992
926
  *
@@ -1000,7 +934,6 @@ interface FlowPorts {
1000
934
  readonly identity: IdentityPort;
1001
935
  readonly smartAccount: SmartAccountPort;
1002
936
  readonly accountRead: AccountReadPort;
1003
- readonly subAccount: SubAccountPort;
1004
937
  readonly bootstrap: BootstrapPort;
1005
938
  readonly clock: ClockPort;
1006
939
  readonly telemetry: TelemetryPort;
@@ -1008,7 +941,7 @@ interface FlowPorts {
1008
941
  }
1009
942
  /** Legacy method input retained by the imperative auth surface. */
1010
943
  interface ExternalSigner {
1011
- readonly address: Address;
944
+ readonly address: Address$1;
1012
945
  readonly signedProof: string;
1013
946
  }
1014
947
  //#endregion
@@ -1293,7 +1226,7 @@ interface PaymentMoney {
1293
1226
  readonly value: string;
1294
1227
  readonly decimals: number;
1295
1228
  }
1296
- type PaymentStatus = PaymentStatus$1;
1229
+ type PaymentStatus = L2PaymentStatus;
1297
1230
  type PaymentType = PaymentType$1;
1298
1231
  type PaymentDocumentKind = PaymentDocumentKind$1;
1299
1232
  interface PaymentDocumentRef {
@@ -1332,6 +1265,8 @@ interface Payment {
1332
1265
  readonly updatedAt: number;
1333
1266
  }
1334
1267
  interface PaymentsPayInput {
1268
+ /** Stable idempotency key for caller retries. Omit only for a one-shot payment. */
1269
+ readonly requestKey?: string;
1335
1270
  readonly actor?: ActorReference;
1336
1271
  readonly to: TargetReference;
1337
1272
  readonly amount: PaymentMoney;
@@ -1359,28 +1294,6 @@ interface PaymentsPayInput {
1359
1294
  */
1360
1295
  readonly lineItems?: readonly LineItemV1[];
1361
1296
  }
1362
- /**
1363
- * B3 withdraw / cash-out input. Stripe-shaped: `to` is the EXTERNAL 0x wallet
1364
- * (the ONE place the SDK accepts a raw address — the pay lane never does),
1365
- * `amount` is a Money, `document` is the REQUIRED kind:4 Withdrawal envelope
1366
- * (carries the audit-visible destAddress). No chain / Safe / token / hash
1367
- * custody substrate on the input. Returns a leak-safe `Payment` whose recipient
1368
- * label is the redacted address — never the full 0x.
1369
- */
1370
- interface PaymentsWithdrawInput {
1371
- readonly to: string;
1372
- readonly amount: PaymentMoney;
1373
- readonly document: WithdrawalDocumentEnvelopeV1;
1374
- }
1375
- /**
1376
- * Payout via a saved destination. The caller selects the destination by opaque
1377
- * id and never re-enters a raw wallet address on this path.
1378
- */
1379
- interface PaymentsPayoutInput {
1380
- readonly actor?: ActorReference;
1381
- readonly destinationId: string;
1382
- readonly amount: PaymentMoney;
1383
- }
1384
1297
  type DestinationKind = "bank_account" | "mobile_money" | "external_account";
1385
1298
  type DestinationRail = {
1386
1299
  readonly kind: "bank";
@@ -1471,31 +1384,98 @@ interface ActivityListParams {
1471
1384
  readonly actor?: ActorReference;
1472
1385
  readonly cursor?: string;
1473
1386
  readonly limit?: number;
1474
- readonly paymentType?: PaymentType;
1475
- readonly timing?: PaymentTiming["kind"];
1476
1387
  }
1477
- interface ActivityItem {
1388
+ type ActivityReference = {
1389
+ readonly kind: "payment";
1478
1390
  readonly id: string;
1479
- readonly actor: ActorReference;
1480
- readonly kind: "payment" | "payout" | "withdrawal" | "deposit" | "claim";
1481
- readonly direction: "in" | "out" | "internal";
1391
+ } | {
1392
+ readonly kind: "movement";
1393
+ readonly id: string;
1394
+ };
1395
+ type ActivityItem = {
1396
+ readonly kind: "payment";
1397
+ readonly id: string;
1398
+ readonly ledgerKind: "Payment" | "Payout" | "Deposit";
1482
1399
  readonly status: PaymentStatus;
1483
1400
  readonly amount: PaymentMoney;
1484
- readonly title: string;
1485
- readonly subtitle: string | null;
1486
- readonly target: TargetReference | null;
1487
- readonly paymentId: string | null;
1488
1401
  readonly createdAt: number;
1489
1402
  readonly updatedAt: number;
1490
- }
1403
+ } | {
1404
+ readonly kind: "movement";
1405
+ readonly id: string;
1406
+ readonly classification: "movement_only_outflow";
1407
+ readonly createdAt: number;
1408
+ readonly updatedAt: number;
1409
+ };
1491
1410
  interface ActivityPage {
1492
1411
  readonly items: readonly ActivityItem[];
1493
- readonly nextCursor: string | null;
1412
+ readonly cursor: string | null;
1413
+ readonly checkpoint: number;
1414
+ }
1415
+ interface PaymentActivityEvidence {
1416
+ readonly chainId: 84532;
1417
+ readonly contractAddress: string;
1418
+ readonly tokenAddress: string;
1419
+ readonly transactionHash: string;
1420
+ readonly blockNumber: number;
1421
+ readonly blockHash: string;
1422
+ readonly finality: "finalized";
1423
+ readonly paymentEventLogIndex: number | null;
1424
+ readonly transferLogIndex: number;
1425
+ readonly settlementId: string | null;
1426
+ readonly source: string;
1427
+ readonly destination: string;
1428
+ readonly rawAmount: string;
1429
+ readonly link: {
1430
+ readonly paymentId: string;
1431
+ readonly movementId: string | null;
1432
+ readonly transactionHash: string;
1433
+ };
1434
+ }
1435
+ interface MovementActivityEvidence {
1436
+ readonly chainId: number;
1437
+ readonly contractAddress: string;
1438
+ readonly tokenAddress: string;
1439
+ readonly transactionHash: string;
1440
+ readonly blockNumber: number;
1441
+ readonly blockHash: string;
1442
+ readonly canonicalState: "finalized";
1443
+ readonly transferLogIndex: number;
1444
+ readonly source: string;
1445
+ readonly destination: string;
1446
+ readonly rawAmount: string;
1447
+ readonly link: {
1448
+ readonly movementId: string;
1449
+ readonly depositPaymentId: string | null;
1450
+ };
1451
+ }
1452
+ type ActivityDetail = {
1453
+ readonly kind: "payment";
1454
+ readonly payment: Payment;
1455
+ readonly evidence: PaymentActivityEvidence;
1456
+ } | {
1457
+ readonly kind: "movement";
1458
+ readonly movementId: string;
1459
+ readonly annotation: MovementAnnotation | null;
1460
+ readonly evidence: MovementActivityEvidence;
1461
+ };
1462
+ interface ActivityAnnotationInput {
1463
+ readonly actor?: ActorReference;
1464
+ readonly movementId: string;
1465
+ readonly counterpartyLabel?: string;
1466
+ readonly accountingCategory?: string;
1467
+ readonly memo?: string;
1494
1468
  }
1495
1469
  interface ActivityMethods {
1496
1470
  list(params?: ActivityListParams, options?: {
1497
1471
  readonly signal?: AbortSignal;
1498
1472
  }): Promise<CapxulResult<ActivityPage>>;
1473
+ get(reference: ActivityReference, options?: {
1474
+ readonly signal?: AbortSignal;
1475
+ }): Promise<CapxulResult<ActivityDetail | null>>;
1476
+ annotate(input: ActivityAnnotationInput, options?: {
1477
+ readonly signal?: AbortSignal;
1478
+ }): Promise<CapxulResult<MovementAnnotation>>;
1499
1479
  }
1500
1480
  interface OfframpQuoteInput {
1501
1481
  readonly actor?: ActorReference;
@@ -1524,75 +1504,6 @@ interface OfframpMethods {
1524
1504
  readonly signal?: AbortSignal;
1525
1505
  }): Promise<CapxulResult<OfframpStatus>>;
1526
1506
  }
1527
- interface PaymentSettlementInput {
1528
- readonly paymentId: string;
1529
- readonly evidence: OnchainEvidence;
1530
- }
1531
- /**
1532
- * Host-execution callback recording the on-chain escrow of a commitment
1533
- * (G3 · #546): `createCommitment` returned `onchainCommitmentId`, escrowing
1534
- * the total. `onchainCommitmentId` + the userOp/tx hashes are internal evidence,
1535
- * never on the wire (internal channel only).
1536
- */
1537
- interface CommitmentCreatedInput {
1538
- readonly paymentId: string;
1539
- readonly onchainCommitmentId: string;
1540
- readonly evidence: OnchainEvidence;
1541
- }
1542
- /** Host-execution callback recording a recipient-side `claim` (G3 · #546). */
1543
- interface CommitmentClaimInput {
1544
- readonly paymentId: string;
1545
- readonly evidence: OnchainEvidence;
1546
- }
1547
- /**
1548
- * Host-execution callback recording a creator-side `cancel` (G3 · #546):
1549
- * on-chain the unvested remainder returns to the creator; vested-unclaimed
1550
- * stays the recipient's. An optional credit-note document is appended.
1551
- */
1552
- interface CommitmentCancelInput {
1553
- readonly paymentId: string;
1554
- readonly evidence: OnchainEvidence;
1555
- readonly document?: PaymentDocumentEnvelopeV1;
1556
- }
1557
- /**
1558
- * Host-execution callback recording a pre-claim `redirect` to a new validated
1559
- * recipient (G3 · #546). `to` is a validated recipient (handle/email/payee id),
1560
- * never a raw address.
1561
- */
1562
- interface CommitmentRedirectInput {
1563
- readonly paymentId: string;
1564
- readonly to: Ref$1;
1565
- readonly evidence: OnchainEvidence;
1566
- readonly document?: PaymentDocumentEnvelopeV1;
1567
- }
1568
- /**
1569
- * Host-execution callback recording a settled ORG spend/payroll on the ONE
1570
- * `payments` ledger (D3 · #565). An org spend is a KIND of Payment — it lands a
1571
- * real `payments` row with `source:"org"` + `orgId` (no parallel `orgSpends`
1572
- * table, no synthetic client-side fabrication). The signer-side host calls this
1573
- * AFTER the on-chain Roles-modifier spend settles; `evidence` carries the
1574
- * internal userOp/tx hashes (never wire fields). `recipient` is the validated
1575
- * recipient ref label; `recipientSafeAddress` is internal evidence on the row.
1576
- */
1577
- interface OrgPaymentRecordInput {
1578
- readonly orgId: string;
1579
- readonly recipientLabel: string;
1580
- readonly recipientKind?: "handle" | "email" | "payee" | "capxulUserId" | "me" | "org";
1581
- readonly recipientRef?: string;
1582
- readonly recipientPayeeId?: string;
1583
- readonly recipientSafeAddress: string;
1584
- readonly amount: PaymentMoney;
1585
- readonly paymentType: PaymentType;
1586
- readonly document?: PaymentDocumentEnvelopeV1;
1587
- /** The org Safe the spend debited — bound as the `from` of the settlement transfer. */
1588
- readonly orgSafeAddress: string;
1589
- /**
1590
- * 0-based occurrence among batch runs with the same (recipient, amount), so
1591
- * each run binds to + de-dupes on its own on-chain `Transfer` (D3 · #565).
1592
- */
1593
- readonly occurrenceIndex: number;
1594
- readonly evidence: OnchainEvidence;
1595
- }
1596
1507
  interface PaymentDocumentVerification {
1597
1508
  readonly documentHash: string;
1598
1509
  readonly ok: boolean;
@@ -1611,73 +1522,6 @@ interface PaymentDocumentRender {
1611
1522
  readonly kind: PaymentDocumentKind;
1612
1523
  readonly html: string;
1613
1524
  }
1614
- /**
1615
- * Internal commitment execution reference (G3 · #546). The on-chain
1616
- * `onchainCommitmentId` is internal evidence (like userOp/tx hashes) — it never
1617
- * appears on the wire `Payment` or any MCP tool output, but the signer-side host
1618
- * needs it to build a claim/cancel/redirect UserOp. This is the server-internal
1619
- * channel that carries it (and the recipient Safe address for an auto-claim
1620
- * relayer), never a consumer-facing surface.
1621
- */
1622
- interface PaymentCommitmentRef {
1623
- readonly paymentId: string;
1624
- readonly onchainCommitmentId: string | null;
1625
- readonly status: PaymentStatus;
1626
- }
1627
- /**
1628
- * The host-execution + on-chain-evidence channel for Payments (D2 · #564).
1629
- * SPLIT OFF the public `PaymentsMethods` so an external builder consuming
1630
- * `@capxul/sdk` directly never sees the custody substrate. Reached only via
1631
- * `client.payments._internal` (mirrors `client._internal.*`); the signer-side
1632
- * host (the dev MCP edge / a self-custody integrator) drives it AFTER executing
1633
- * a UserOp. Every input carries the `OnchainEvidence` brand — never a wire field.
1634
- */
1635
- interface PaymentsInternalMethods {
1636
- /** Report on-chain settlement evidence for an instant payment. */
1637
- markSettled(input: PaymentSettlementInput, options?: {
1638
- readonly signal?: AbortSignal;
1639
- }): Promise<CapxulResult<Payment>>;
1640
- /**
1641
- * B3: report on-chain settlement evidence for a withdraw/cash-out. The
1642
- * backend binds the userOp to a matching external `Transfer` before settling.
1643
- */
1644
- markWithdrawalSettled(input: PaymentSettlementInput, options?: {
1645
- readonly signal?: AbortSignal;
1646
- }): Promise<CapxulResult<Payment>>;
1647
- /**
1648
- * Record the on-chain escrow of a commitment after `createCommitment` returns
1649
- * its `onchainCommitmentId` (G3 · #546).
1650
- */
1651
- markCommitmentCreated(input: CommitmentCreatedInput, options?: {
1652
- readonly signal?: AbortSignal;
1653
- }): Promise<CapxulResult<Payment>>;
1654
- /**
1655
- * Record a settled ORG spend/payroll on the one `payments` ledger
1656
- * (D3 · #565) — `source:"org"` + `orgId`, read back as a leak-safe Payment.
1657
- */
1658
- recordOrgPayment(input: OrgPaymentRecordInput, options?: {
1659
- readonly signal?: AbortSignal;
1660
- }): Promise<CapxulResult<Payment>>;
1661
- /** Record a recipient-side `claim` after the on-chain claim UserOp settles. */
1662
- claim(input: CommitmentClaimInput, options?: {
1663
- readonly signal?: AbortSignal;
1664
- }): Promise<CapxulResult<Payment>>;
1665
- /** Record a creator-side `cancel` reclaiming only the unvested remainder. */
1666
- cancel(input: CommitmentCancelInput, options?: {
1667
- readonly signal?: AbortSignal;
1668
- }): Promise<CapxulResult<Payment>>;
1669
- /** Record a pre-claim `redirect` to a new validated recipient. */
1670
- redirect(input: CommitmentRedirectInput, options?: {
1671
- readonly signal?: AbortSignal;
1672
- }): Promise<CapxulResult<Payment>>;
1673
- /**
1674
- * The on-chain commitment reference the signer-side host needs to build a
1675
- * claim/cancel/redirect UserOp. `onchainCommitmentId` is internal evidence.
1676
- */
1677
- commitmentRef(paymentId: string, options?: {
1678
- readonly signal?: AbortSignal;
1679
- }): Promise<CapxulResult<PaymentCommitmentRef | null>>;
1680
- }
1681
1525
  /**
1682
1526
  * The PUBLIC, Stripe-shaped Payments surface (D2 · #564). Genus verbs only —
1683
1527
  * `pay` / `list` / `get`. No `userOpHash` / `txHash` / `onchainCommitmentId` /
@@ -1688,15 +1532,14 @@ interface PaymentsMethods {
1688
1532
  pay(input: PaymentsPayInput, options?: {
1689
1533
  readonly signal?: AbortSignal;
1690
1534
  }): Promise<CapxulResult<Payment>>;
1691
- payout(input: PaymentsPayoutInput, options?: {
1535
+ createCommitment(input: PaymentsPayInput & {
1536
+ readonly timing: Exclude<PaymentTiming, {
1537
+ readonly kind: "instant";
1538
+ }>;
1539
+ }, options?: {
1692
1540
  readonly signal?: AbortSignal;
1693
1541
  }): Promise<CapxulResult<Payment>>;
1694
- /**
1695
- * B3 withdraw / cash-out: send USDX from the user's custody Safe to an
1696
- * external 0x wallet, minting a kind:4 Withdrawal document. Returns a
1697
- * leak-safe `Payment` (recipient label is the redacted address).
1698
- */
1699
- withdraw(input: PaymentsWithdrawInput, options?: {
1542
+ claim(paymentId: string, options?: {
1700
1543
  readonly signal?: AbortSignal;
1701
1544
  }): Promise<CapxulResult<Payment>>;
1702
1545
  list(options?: {
@@ -1708,14 +1551,12 @@ interface PaymentsMethods {
1708
1551
  cancel(paymentId: string, options?: {
1709
1552
  readonly signal?: AbortSignal;
1710
1553
  }): Promise<CapxulResult<Payment>>;
1711
- /**
1712
- * Host-execution + on-chain-evidence channel — off the public surface
1713
- * (production-surface-policy.md pattern). Self-custody integrators drive this;
1714
- * a Stripe-shaped consumer never does.
1715
- *
1716
- * @internal-use
1717
- */
1718
- readonly _internal: PaymentsInternalMethods;
1554
+ redirect(input: {
1555
+ readonly paymentId: string;
1556
+ readonly to: TargetReference;
1557
+ }, options?: {
1558
+ readonly signal?: AbortSignal;
1559
+ }): Promise<CapxulResult<Payment>>;
1719
1560
  }
1720
1561
  interface PaymentDocumentsMethods {
1721
1562
  verify(documentHash: string, options?: {
@@ -1730,13 +1571,6 @@ interface PaymentDocumentsMethods {
1730
1571
  readonly signal?: AbortSignal;
1731
1572
  }): Promise<CapxulResult<PaymentDocumentRender>>;
1732
1573
  }
1733
- interface ReconciliationEntry {
1734
- readonly paymentRequestId: string;
1735
- readonly reference: string;
1736
- readonly status: "paid" | "exception";
1737
- readonly settledPaymentId: string | null;
1738
- readonly receiptDocumentHash: string | null;
1739
- }
1740
1574
  interface FinancialOpsMethods {
1741
1575
  readonly me: MeMethods;
1742
1576
  readonly handles: HandlesMethods;
@@ -1825,9 +1659,6 @@ interface ActorRequestsMethods {
1825
1659
  cancel(requestId: string, options?: {
1826
1660
  readonly signal?: AbortSignal;
1827
1661
  }): Promise<CapxulResult<ActorRequest>>;
1828
- reconcile(options?: {
1829
- readonly signal?: AbortSignal;
1830
- }): Promise<CapxulResult<readonly ReconciliationEntry[]>>;
1831
1662
  }
1832
1663
  interface InboxItem {
1833
1664
  readonly id: string;
@@ -1839,6 +1670,7 @@ interface InboxItem {
1839
1670
  interface InboxApproveInput {
1840
1671
  readonly requestId: string;
1841
1672
  readonly timing?: PaymentTiming;
1673
+ readonly permissionId?: string;
1842
1674
  }
1843
1675
  interface InboxMethods {
1844
1676
  list(options?: {
@@ -1851,31 +1683,6 @@ interface InboxMethods {
1851
1683
  readonly signal?: AbortSignal;
1852
1684
  }): Promise<CapxulResult<InboxItem>>;
1853
1685
  }
1854
- interface InsightsSummary {
1855
- readonly pending: {
1856
- readonly count: number;
1857
- readonly total: PaymentMoney;
1858
- };
1859
- readonly paidThisMonth: {
1860
- readonly count: number;
1861
- readonly total: PaymentMoney;
1862
- };
1863
- readonly drafts: {
1864
- readonly count: number;
1865
- };
1866
- readonly reconciliation: {
1867
- readonly open: number;
1868
- readonly exceptions: number;
1869
- };
1870
- }
1871
- interface InsightsMethods {
1872
- summary(options?: {
1873
- readonly signal?: AbortSignal;
1874
- }): Promise<CapxulResult<InsightsSummary>>;
1875
- history(options?: {
1876
- readonly signal?: AbortSignal;
1877
- }): Promise<CapxulResult<readonly Payment[]>>;
1878
- }
1879
1686
  interface ActorProfileMethods {
1880
1687
  get(options?: {
1881
1688
  readonly signal?: AbortSignal;
@@ -1888,7 +1695,6 @@ interface ActorRelationshipMethods {
1888
1695
  readonly addressBook: AddressBookMethods;
1889
1696
  readonly requests: ActorRequestsMethods;
1890
1697
  readonly inbox: InboxMethods;
1891
- readonly insights: InsightsMethods;
1892
1698
  readonly profile: ActorProfileMethods;
1893
1699
  }
1894
1700
  //#endregion
@@ -1904,7 +1710,7 @@ type AccountStatus = {
1904
1710
  readonly requirement: AccountRequirement;
1905
1711
  readonly chainId: number;
1906
1712
  readonly source: AccountProviderSource;
1907
- readonly signerAddress: Address;
1713
+ readonly signerAddress: Address$1;
1908
1714
  } | {
1909
1715
  readonly status: "accountPrepared";
1910
1716
  readonly requirement: AccountRequirement;
@@ -1998,35 +1804,7 @@ interface AccountsFaucetMethods {
1998
1804
  }>>;
1999
1805
  }
2000
1806
  //#endregion
2001
- //#region src/domain/org/spend-gate.d.ts
2002
- /**
2003
- * The role's allowed recipients. The address form backs the S4 `spend` path
2004
- * (recipient is a resolved `Address`); the string form backs the G4
2005
- * `spendViaPayments` / `batchPayroll` path, whose recipient is a VALIDATED REF
2006
- * (handle/email/payee/org) compared in the same ref space as the role's set.
2007
- * Comparison is case-insensitive over the raw string value either way.
2008
- */
2009
- type SpendGateRecipients = "anyone" | readonly (Address | string)[];
2010
- type SpendGateSubAccountScope = {
2011
- readonly scope: "all";
2012
- } | {
2013
- readonly scope: "only";
2014
- readonly subAccountIds: readonly SubAccountId[];
2015
- };
2016
- //#endregion
2017
1807
  //#region src/ports/org.d.ts
2018
- /**
2019
- * The minimal `{from, to, amount}` spend shape the authority read keys off
2020
- * (D3 #565). The legacy address-keyed `OrgSpendInput`/`org.spend` lane was
2021
- * hard-removed when `orgSpends` folded into the one `payments` ledger; the
2022
- * leak-safe ref-based lane (`spendViaPayments`/`batchPayroll`) constructs this
2023
- * internally and enforces the real validated recipient on the gate.
2024
- */
2025
- type OrgSpendShape = {
2026
- readonly from: SubAccountId;
2027
- readonly to: Address;
2028
- readonly amount: Money;
2029
- };
2030
1808
  type CreateOrgPortInput = {
2031
1809
  readonly input: CreateOrgInput;
2032
1810
  };
@@ -2052,36 +1830,6 @@ type DetectPendingOrgInvitationsInput = Record<never, never>;
2052
1830
  type DetectPendingOrgInvitationsResult$1 = {
2053
1831
  readonly matched: readonly OrgId[];
2054
1832
  };
2055
- type DeployOrgRolesInput = {
2056
- readonly orgId: OrgId;
2057
- };
2058
- type OrgRolesDeploymentResult = {
2059
- readonly orgId: OrgId;
2060
- readonly roles: readonly RoleView[];
2061
- };
2062
- type GrantOrgRoleInput = {
2063
- readonly orgId: OrgId;
2064
- readonly input: AssignRoleInput;
2065
- };
2066
- type RevokeOrgRoleInput = {
2067
- readonly orgId: OrgId;
2068
- readonly input: RemoveMemberInput;
2069
- };
2070
- type OrgSpendAuthority = {
2071
- readonly activeMember: boolean;
2072
- readonly subAccountBalanceRaw: string;
2073
- readonly recipients: SpendGateRecipients;
2074
- readonly subAccounts: SpendGateSubAccountScope;
2075
- readonly perTxCapRaw?: string | null;
2076
- readonly perDayCapRaw?: string | null;
2077
- readonly spentTodayRaw?: string | null;
2078
- readonly role?: string;
2079
- };
2080
- type ReadOrgSpendAuthorityInput = {
2081
- readonly orgId: OrgId;
2082
- readonly input: OrgSpendShape;
2083
- readonly amountRaw: string;
2084
- };
2085
1833
  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 & {
2086
1834
  readonly _tag: "OrgError";
2087
1835
  } & Readonly<A>;
@@ -2109,39 +1857,71 @@ interface OrgPort {
2109
1857
  resendInviteToken?(input: ResendOrgInviteTokenInput): Effect.Effect<MemberView, OrgError, never>;
2110
1858
  detectAndAcceptPendingInvitations(input: DetectPendingOrgInvitationsInput): Effect.Effect<DetectPendingOrgInvitationsResult$1, OrgError, never>;
2111
1859
  }
2112
- interface OrgRolesDeploymentPort {
2113
- deployRoles(input: DeployOrgRolesInput): Effect.Effect<OrgRolesDeploymentResult, OrgError, never>;
2114
- grantRole(input: GrantOrgRoleInput): Effect.Effect<MemberView, OrgError, never>;
2115
- revokeRole(input: RevokeOrgRoleInput): Effect.Effect<void, OrgError, never>;
1860
+ //#endregion
1861
+ //#region src/contract/permission.d.ts
1862
+ interface PermissionReadResult {
1863
+ readonly permissions: readonly Permission[];
1864
+ readonly assignments: readonly PermissionAssignment[];
2116
1865
  }
2117
- type SubmitOrgSpendViaPaymentsInput = {
2118
- readonly orgId: OrgId;
2119
- readonly input: OrgSpendViaPaymentsInput;
2120
- readonly amountRaw: string;
2121
- readonly authority: OrgSpendAuthority;
1866
+ //#endregion
1867
+ //#region src/surface/permissions.d.ts
1868
+ type PermissionOptions = {
1869
+ readonly signal?: AbortSignal;
2122
1870
  };
2123
- type SubmitOrgBatchPayrollInput = {
2124
- readonly orgId: OrgId;
2125
- readonly from: OrgSpendViaPaymentsInput["from"];
2126
- readonly runs: readonly {
2127
- readonly run: OrgPayrollRun;
2128
- readonly amountRaw: string;
2129
- }[];
2130
- readonly authorities: readonly OrgSpendAuthority[];
1871
+ type PermissionCreateInput = {
1872
+ readonly requestKey: string;
1873
+ readonly intent: PermissionIntent;
2131
1874
  };
2132
- interface OrgSpendPort {
2133
- readSpendAuthority(input: ReadOrgSpendAuthorityInput): Effect.Effect<OrgSpendAuthority, OrgError, never>;
2134
- /**
2135
- * Leak-safe org spend (G4 · #547; D3 #565 — the one ledger of record): execute
2136
- * the spend through the payments engine (Roles modifier → CapxulPayments),
2137
- * write a real `payments` row (`source:"org"`) and read it back as a `Payment`
2138
- * the wire carries no `txHash` / Safe / userOp internals. Optional so a
2139
- * hermetic adapter without a payments-submit lane still compiles; absent ⇒ the
2140
- * program falls back to a deterministic hermetic `Payment`.
2141
- */
2142
- submitSpendViaPayments?(input: SubmitOrgSpendViaPaymentsInput): Effect.Effect<Payment, OrgError, never>;
2143
- /** Leak-safe org payroll batch (G4 · #547): one MultiSend, one Payment per run. */
2144
- submitBatchPayroll?(input: SubmitOrgBatchPayrollInput): Effect.Effect<readonly Payment[], OrgError, never>;
1875
+ type PermissionChangeInput = PermissionCreateInput & {
1876
+ readonly permissionId: string;
1877
+ };
1878
+ type PermissionAssignInput = {
1879
+ readonly requestKey: string;
1880
+ readonly permissionId: string;
1881
+ readonly accountId: string;
1882
+ };
1883
+ type PermissionRevokeInput = {
1884
+ readonly requestKey: string;
1885
+ readonly permissionAssignmentId: string;
1886
+ };
1887
+ type PermissionReplaceInput = {
1888
+ readonly requestKey: string;
1889
+ };
1890
+ interface PermissionMethods {
1891
+ create(input: PermissionCreateInput, options?: PermissionOptions): Promise<CapxulResult<SubmittedPermissionExecution>>;
1892
+ change(input: PermissionChangeInput, options?: PermissionOptions): Promise<CapxulResult<SubmittedPermissionExecution>>;
1893
+ assign(input: PermissionAssignInput, options?: PermissionOptions): Promise<CapxulResult<SubmittedPermissionExecution>>;
1894
+ revoke(input: PermissionRevokeInput, options?: PermissionOptions): Promise<CapxulResult<SubmittedPermissionExecution>>;
1895
+ replace(input: PermissionReplaceInput, options?: PermissionOptions): Promise<CapxulResult<SubmittedPermissionExecution>>;
1896
+ list(options?: PermissionOptions): Promise<CapxulResult<PermissionReadResult>>;
1897
+ get(permissionId: string, options?: PermissionOptions): Promise<CapxulResult<Permission | null>>;
1898
+ }
1899
+ //#endregion
1900
+ //#region src/surface/organization-payments.d.ts
1901
+ interface OrganizationPaymentItemInput {
1902
+ readonly to: Ref$1;
1903
+ readonly amount: PaymentMoney;
1904
+ readonly paymentType?: PaymentType;
1905
+ readonly document?: AttachablePaymentDocumentEnvelopeV1;
1906
+ }
1907
+ interface OrganizationPaymentInput extends OrganizationPaymentItemInput {
1908
+ readonly permissionId: string;
1909
+ readonly requestKey: string;
1910
+ readonly lineage?: PaymentCommandLineage;
1911
+ }
1912
+ interface OrganizationPaymentBatchInput {
1913
+ readonly permissionId: string;
1914
+ readonly requestKey: string;
1915
+ readonly items: readonly OrganizationPaymentItemInput[];
1916
+ readonly lineage?: PaymentCommandLineage;
1917
+ }
1918
+ interface OrganizationPaymentsMethods {
1919
+ pay(input: OrganizationPaymentInput, options?: {
1920
+ readonly signal?: AbortSignal;
1921
+ }): Promise<CapxulResult<Payment>>;
1922
+ payBatch(input: OrganizationPaymentBatchInput, options?: {
1923
+ readonly signal?: AbortSignal;
1924
+ }): Promise<CapxulResult<readonly Payment[]>>;
2145
1925
  }
2146
1926
  //#endregion
2147
1927
  //#region src/surface/org.d.ts
@@ -2164,7 +1944,7 @@ type OrgView = {
2164
1944
  readonly id: OrgId;
2165
1945
  readonly name: string;
2166
1946
  readonly handle: string;
2167
- readonly safeAddress: Address; /** The viewing member's own role label within this org. */
1947
+ readonly safeAddress: Address$1; /** The viewing member's own role label within this org. */
2168
1948
  readonly role: string; /** The Org treasury — the real M2 Account over the Org Safe (D3). */
2169
1949
  readonly treasury: Account$1; /** #1064: onboarding-collected description + size bucket; null when unset. */
2170
1950
  readonly bio: string | null;
@@ -2196,7 +1976,7 @@ type MemberView = {
2196
1976
  readonly orgId: OrgId;
2197
1977
  readonly email: Email;
2198
1978
  readonly name: string | null; /** Member-identity key (D7). `null` until the invitee provisions a Safe. */
2199
- readonly personalSafeAddress: Address | null; /** The member's role label (maps deterministically to the on-chain `roleKey`, D9). */
1979
+ readonly personalSafeAddress: Address$1 | null; /** The member's role label (maps deterministically to the on-chain `roleKey`, D9). */
2200
1980
  readonly role: string;
2201
1981
  readonly roleKey: RoleKey | null;
2202
1982
  readonly status: MemberStatus;
@@ -2212,20 +1992,16 @@ type MemberView = {
2212
1992
  type RoleSpendCap = {
2213
1993
  readonly perTx?: Money;
2214
1994
  readonly perDay?: Money;
2215
- readonly toRecipients?: "anyone" | readonly Address[];
1995
+ readonly toRecipients?: "anyone" | readonly Address$1[];
2216
1996
  };
2217
1997
  /**
2218
1998
  * The Capxul-owned Role DSL definition (D4). `label` becomes the sticky
2219
1999
  * bytes32 `roleKey` on-chain. `spend` compiles to Level-1 on-chain Zodiac
2220
- * conditions; `subAccounts` + `canManage*` compile to Level-2 off-chain Convex
2221
- * guards (D5).
2000
+ * conditions. Management flags compile to off-chain guards.
2222
2001
  */
2223
2002
  type RoleDefinition = {
2224
2003
  readonly label: string;
2225
2004
  readonly spend?: RoleSpendCap;
2226
- readonly subAccounts?: {
2227
- readonly scope: "all" | readonly SubAccountId[];
2228
- };
2229
2005
  readonly canManageMembers?: boolean;
2230
2006
  readonly canManageRoles?: boolean;
2231
2007
  };
@@ -2259,8 +2035,8 @@ type CreateOrgInput = {
2259
2035
  /**
2260
2036
  * Input to `org(orgId).invite` (S3, D8). Email is the universal entry point —
2261
2037
  * inviting an address that is not yet a Capxul user auto-creates a `pending`
2262
- * membership that resolves on sign-in (the virality loop). `role` names the
2263
- * role label the invitee is granted on accept.
2038
+ * membership that resolves on sign-in. `role` is invitation metadata. It does
2039
+ * not grant an L2 Permission.
2264
2040
  */
2265
2041
  type InviteMemberInput = {
2266
2042
  readonly email: string;
@@ -2269,62 +2045,7 @@ type InviteMemberInput = {
2269
2045
  type ResendInviteTokenInput = {
2270
2046
  readonly email: string;
2271
2047
  };
2272
- /**
2273
- * Input to `org(orgId).removeMember` (S3, D8). Keyed on the member's personal
2274
- * Safe address (D7 — Safe-as-identity). Drives the on-chain REVOKE + Convex
2275
- * mirror.
2276
- */
2277
- type RemoveMemberInput = {
2278
- readonly memberSafeAddress: Address;
2279
- };
2280
- /**
2281
- * Input to `org(orgId).assignRole` (S3, D7/D9). Keyed on the member's personal
2282
- * Safe address (D7). Drives the on-chain GRANT + Convex mirror; the `role`
2283
- * label maps deterministically to the on-chain `roleKey`.
2284
- */
2285
- type AssignRoleInput = {
2286
- readonly memberSafeAddress: Address;
2287
- readonly role: string;
2288
- };
2289
- /**
2290
- * Input to `org(orgId).spendViaPayments` (G4 · #547). The LEAK-SAFE org spend:
2291
- * delegates `org.spend` to the payments engine WITH the member's org role
2292
- * authority and returns a `Payment`, not a `txHash`. `to` is a VALIDATED
2293
- * recipient ref (handle / email / payee id / org handle) — never a raw
2294
- * `Address` (the legacy address-keyed `org.spend` lane was hard-removed in D3
2295
- * #565 when `orgSpends` was folded into the one `payments` ledger).
2296
- * `from` is the Level-2 sub-account envelope the spend draws from (D5).
2297
- */
2298
- type OrgSpendViaPaymentsInput = {
2299
- readonly from: SubAccountId; /** Validated recipient ref (handle/email/payee/org) — never a raw address. */
2300
- readonly to: Ref$1;
2301
- readonly amount: Money; /** Full EIP-712 payment document; hashed + stored, committed on-chain. */
2302
- readonly document?: PaymentDocumentEnvelopeV1;
2303
- readonly timing?: PaymentTiming;
2304
- readonly paymentType?: PaymentType;
2305
- };
2306
- /**
2307
- * One run in an `org(orgId).batchPayroll` batch (G4 · #547): a validated
2308
- * recipient, an amount, and an optional payslip document. Each run is gated
2309
- * independently against the role's per-tx / per-day / recipient conditions.
2310
- */
2311
- type OrgPayrollRun = {
2312
- /** Validated recipient ref (handle/email/payee/org) — never a raw address. */readonly to: Ref$1;
2313
- readonly amount: Money;
2314
- readonly timing?: PaymentTiming; /** The payslip — an EIP-712 payment document, committed by `documentHash`. */
2315
- readonly payslip?: PaymentDocumentEnvelopeV1;
2316
- };
2317
- /**
2318
- * Input to `org(orgId).batchPayroll` (G4 · #547). Pays N employees in one
2319
- * MultiSend through the Roles modifier; each carries a payslip and settles as
2320
- * `paymentType = payroll`. Every run is gated; an over-cap run REJECTS the
2321
- * whole batch (no partial treasury drain). Returns one leak-safe `Payment` per
2322
- * run.
2323
- */
2324
- type OrgBatchPayrollInput = {
2325
- readonly from: SubAccountId;
2326
- readonly runs: readonly OrgPayrollRun[];
2327
- };
2048
+ /** Organization ids whose pending invitations match the current Account. */
2328
2049
  type DetectPendingOrgInvitationsResult = {
2329
2050
  readonly matched: readonly OrgId[];
2330
2051
  };
@@ -2334,46 +2055,6 @@ type DetectPendingOrgInvitationsResult = {
2334
2055
  * stateful active context). `treasury()` returns the real M2 `Account` over
2335
2056
  * the Org Safe (D3).
2336
2057
  */
2337
- interface PayrollRosterLine {
2338
- readonly id: string;
2339
- readonly employee: Ref$1;
2340
- readonly amount: Money;
2341
- readonly timing: PaymentTiming;
2342
- readonly status: "active" | "paused" | "ended";
2343
- }
2344
- interface PayrollPayslipTemplate {
2345
- readonly title: string;
2346
- readonly memo?: string;
2347
- }
2348
- interface PayrollRosterAddInput {
2349
- readonly employee: Ref$1;
2350
- readonly amount: Money;
2351
- readonly timing: PaymentTiming;
2352
- readonly payslipTemplate?: PaymentDocumentEnvelopeV1 | PayrollPayslipTemplate;
2353
- }
2354
- interface PayrollRunInput {
2355
- readonly from: SubAccountId;
2356
- readonly period: string;
2357
- }
2358
- interface PayrollMethods {
2359
- readonly roster: {
2360
- add(input: PayrollRosterAddInput, options?: {
2361
- readonly signal?: AbortSignal;
2362
- }): Promise<CapxulResult<PayrollRosterLine>>;
2363
- list(options?: {
2364
- readonly signal?: AbortSignal;
2365
- }): Promise<CapxulResult<readonly PayrollRosterLine[]>>;
2366
- update(rosterLineId: string, input: Partial<PayrollRosterAddInput>, options?: {
2367
- readonly signal?: AbortSignal;
2368
- }): Promise<CapxulResult<PayrollRosterLine>>;
2369
- remove(rosterLineId: string, options?: {
2370
- readonly signal?: AbortSignal;
2371
- }): Promise<CapxulResult<PayrollRosterLine>>;
2372
- };
2373
- run(input: PayrollRunInput, options?: {
2374
- readonly signal?: AbortSignal;
2375
- }): Promise<CapxulResult<readonly Payment[]>>;
2376
- }
2377
2058
  interface OrgScopedMethods extends ActorRelationshipMethods {
2378
2059
  /** Observe the durable, leak-safe lifecycle for this Organization only. */
2379
2060
  getLifecycle(options?: {
@@ -2398,36 +2079,17 @@ interface OrgScopedMethods extends ActorRelationshipMethods {
2398
2079
  roles(options?: {
2399
2080
  readonly signal?: AbortSignal;
2400
2081
  }): Promise<CapxulResult<readonly RoleView[]>>;
2401
- deployRoles(options?: {
2402
- readonly signal?: AbortSignal;
2403
- }): Promise<CapxulResult<readonly RoleView[]>>;
2404
2082
  invite(input: InviteMemberInput, options?: {
2405
2083
  readonly signal?: AbortSignal;
2406
2084
  }): Promise<CapxulResult<MemberView>>;
2407
- removeMember(input: RemoveMemberInput, options?: {
2408
- readonly signal?: AbortSignal;
2409
- }): Promise<CapxulResult<void>>;
2410
- assignRole(input: AssignRoleInput, options?: {
2411
- readonly signal?: AbortSignal;
2412
- }): Promise<CapxulResult<MemberView>>;
2413
2085
  /**
2414
- * Leak-safe org spend (G4 · #547; D3 #565 — the one ledger of record): execute
2415
- * the spend through the payments engine with the member's org role authority
2086
+ * Leak-safe Organization payment: execute through the payments engine with
2087
+ * the selected receipt-verified Budget Permission
2416
2088
  * and return a `Payment` (no `to: Address`, no `txHash`, no Safe / userOp
2417
2089
  * internals). Writes a real `payments` row (`source:"org"`).
2418
2090
  */
2419
- spendViaPayments(input: OrgSpendViaPaymentsInput, options?: {
2420
- readonly signal?: AbortSignal;
2421
- }): Promise<CapxulResult<Payment>>;
2422
- /**
2423
- * Org payroll batch (G4 · #547): pay N employees in one MultiSend through the
2424
- * Roles modifier, each with a payslip. Every run is gated; an over-cap run
2425
- * rejects the whole batch. Returns one leak-safe `Payment` per run.
2426
- */
2427
- batchPayroll(input: OrgBatchPayrollInput, options?: {
2428
- readonly signal?: AbortSignal;
2429
- }): Promise<CapxulResult<readonly Payment[]>>;
2430
- readonly payroll: PayrollMethods;
2091
+ readonly permissions: PermissionMethods;
2092
+ readonly payments: OrganizationPaymentsMethods;
2431
2093
  auditLog(options?: {
2432
2094
  readonly signal?: AbortSignal;
2433
2095
  }): Promise<CapxulResult<readonly OrganizationAuditLogItem[]>>;
@@ -2528,28 +2190,13 @@ interface SystemMethods {
2528
2190
  }): Promise<CapxulResult<SystemHealth>>;
2529
2191
  }
2530
2192
  //#endregion
2531
- //#region src/surface/sub-accounts.d.ts
2532
- interface SubAccountsMethods {
2533
- create(accountId: AccountId, input: {
2534
- readonly name: string;
2193
+ //#region src/surface/holdings.d.ts
2194
+ interface HoldingsMethods {
2195
+ current(input?: {
2196
+ readonly actor?: ActorReference;
2535
2197
  }, options?: {
2536
2198
  readonly signal?: AbortSignal;
2537
- }): Promise<CapxulResult<SubAccount>>;
2538
- get(subAccountId: SubAccountId, options?: {
2539
- readonly signal?: AbortSignal;
2540
- }): Promise<CapxulResult<SubAccount | null>>;
2541
- list(accountId: AccountId, options?: {
2542
- readonly signal?: AbortSignal;
2543
- }): Promise<CapxulResult<readonly SubAccount[]>>;
2544
- rename(subAccountId: SubAccountId, name: string, options?: {
2545
- readonly signal?: AbortSignal;
2546
- }): Promise<CapxulResult<SubAccount>>;
2547
- delete(subAccountId: SubAccountId, options?: {
2548
- readonly signal?: AbortSignal;
2549
- }): Promise<CapxulResult<void>>;
2550
- transfer(input: TransferInput, options?: {
2551
- readonly signal?: AbortSignal;
2552
- }): Promise<CapxulResult<TransferResult>>;
2199
+ }): Promise<CapxulResult<CurrentHoldings>>;
2553
2200
  }
2554
2201
  //#endregion
2555
2202
  //#region src/surface/_shared/effect-actor-bridge.d.ts
@@ -2644,6 +2291,7 @@ interface CapxulClient {
2644
2291
  */
2645
2292
  readonly payments: PaymentsMethods;
2646
2293
  readonly activity: ActivityMethods;
2294
+ readonly holdings: HoldingsMethods;
2647
2295
  readonly offramp: OfframpMethods;
2648
2296
  /** Payment document verification (G2 · #545): re-derive the EIP-712 hash. */
2649
2297
  readonly paymentDocuments: PaymentDocumentsMethods;
@@ -2651,13 +2299,11 @@ interface CapxulClient {
2651
2299
  * Media surface (#1061 / ADR-0014): profile-image + org-logo upload/record.
2652
2300
  */
2653
2301
  readonly media: MediaMethods;
2654
- /** Sub-account lifecycle (M2 Slice S2a · #267). Transfer lands in S2b. */
2655
- readonly subAccounts: SubAccountsMethods;
2656
2302
  /**
2657
2303
  * Organization domain surface (canon `org-domain-model.md` §C2/§C3, D13).
2658
2304
  * `createOrg(input)` creates an Org; `orgs()` lists the Orgs you belong to;
2659
- * `org(orgId)` resolves the entity-scoped bundle (treasury / members / roles
2660
- * / invite / removeMember / assignRole / spend). Explicit entity scoping —
2305
+ * `org(orgId)` resolves the entity-scoped bundle (treasury / members / roles,
2306
+ * invitations, Permissions, and payments). Explicit entity scoping —
2661
2307
  * NO stateful active context (D13). RED until the S1→S4 slices fill it.
2662
2308
  */
2663
2309
  readonly createOrg: OrgMethods["createOrg"];
@@ -2745,10 +2391,6 @@ interface CreateCapxulClientInput {
2745
2391
  readonly orgDeploymentPort?: OrgPort;
2746
2392
  /** Locked D6 data-port name. Prefer over `orgDeploymentPort` in new code. */
2747
2393
  readonly orgPort?: OrgPort;
2748
- /** S2 deploy/grant/revoke port. S2 uses deploy; S3 adds grant/revoke. */
2749
- readonly orgRolesDeploymentPort?: OrgRolesDeploymentPort;
2750
- /** S4 treasury-spend authority + submit port. */
2751
- readonly orgSpendPort?: OrgSpendPort;
2752
2394
  /**
2753
2395
  * Internal Organization lifecycle capability. The Core SDK owns its
2754
2396
  * choreography; production composition supplies the provider/backend steps.
@@ -2762,5 +2404,4 @@ interface CreateCapxulClientInput {
2762
2404
  };
2763
2405
  }
2764
2406
  //#endregion
2765
- export { InsightsSummary as $, OrgSetupStep as $t, PayrollRosterLine as A, PaymentMoney as At, ActorProfileMethods as B, RecipientResolutionKind as Bt, OrgTemplate as C, PayeesMethods as Ct, PayrollMethods as D, PaymentDocumentRender as Dt, OrganizationAuditLogItem as E, PaymentDocumentRef as Et, RoleSpendCap as F, PaymentsMethods as Ft, AddressBookAddInput as G, TargetsMethods as Gt, ActorRequest as H, Ref$1 as Ht, RoleView as I, PaymentsPayInput as It, AddressBookMethods as J, isSettingUpLifecycle as Jt, AddressBookEntry as K, AccountLifecycle as Kt, AccountsMethods as L, PaymentsPayoutInput as Lt, RemoveMemberInput as M, PaymentStatus as Mt, ResendInviteTokenInput as N, PaymentTiming as Nt, PayrollPayslipTemplate as O, PaymentDocumentVerification as Ot, RoleDefinition as P, PaymentType as Pt, InsightsMethods as Q, OrgLifecycle as Qt, AccountMethods as R, PaymentsWithdrawInput as Rt, OrgSpendViaPaymentsInput as S, Payee as St, OrganizationAccount as T, PaymentDocumentKind as Tt, ActorRequestIssueInput as U, ResolvedTarget as Ut, ActorRelationshipMethods as V, ReconciliationEntry as Vt, ActorRequestsMethods as W, TargetReference as Wt, InboxItem as X, SmartAccountMethods as Xt, InboxApproveInput as Y, IdentityMethods as Yt, InboxMethods as Z, AuthMethods as Zt, MemberView as _, InvocationControls as _n, MeProfile as _t, IdentityRuntimeSendResult as a, TelemetryEvent as an, DepositInstructions as at, OrgPayrollRun as b, OfframpQuoteInput as bt, SystemHealth as c, TelemetryPort as cn, DestinationKind as ct, CurrentUserMethods as d, IdentityState as dn, DestinationRail as dt, TransferEndpoint as en, ActivityItem as et, AssignRoleInput as f, OrgLane as fn, DestinationRemoveInput as ft, MemberStatus as g, IdentityTransition as gn, MeMethods as gt, InviteMemberInput as h, destination as hn, HandlesMethods as ht, IdentityRuntime as i, CapxulEnv as in, ActorReference as it, PayrollRunInput as j, PaymentSettlementInput as jt, PayrollRosterAddInput as k, PaymentDocumentsMethods as kt, MediaMethods as l, Destination$1 as ln, DestinationListInput as lt, DetectPendingOrgInvitationsResult as m, StateLabel as mn, FinancialOpsMethods as mt, CreateCapxulClientInput as n, TransferResult as nn, ActivityMethods as nt, SubAccountsMethods as o, TelemetryGroupInput as on, Destination as ot, CreateOrgInput as p, Readiness as pn, DestinationsMethods as pt, AddressBookLabelInput as q, AccountSetupStep as qt, IdentityProfileDetails as r, WireObservationContext as rn, ActivityPage as rt, SystemMethods as s, TelemetryIdentifyInput as sn, DestinationAddInput as st, CapxulClient as t, TransferInput as tn, ActivityListParams as tt, CurrentUserContext as u, IdentityEvent as un, DestinationPayload as ut, OrgBatchPayrollInput as v, OfframpMethods as vt, OrgView as w, Payment as wt, OrgScopedMethods as x, OfframpStatus as xt, OrgMethods as y, OfframpQuote as yt, ActorProfile as z, RecipientResolution as zt };
2766
- //# sourceMappingURL=create-capxul-client-BxTtXho7.d.mts.map
2407
+ export { InboxMethods as $, WireObservationContext as $t, OrganizationPaymentsMethods as A, PaymentDocumentRender as At, AccountMethods as B, RecipientResolutionKind as Bt, ResendInviteTokenInput as C, OfframpQuoteInput as Ct, OrganizationPaymentBatchInput as D, Payment as Dt, RoleView as E, PayeesMethods as Et, PermissionOptions as F, PaymentTiming as Ft, ActorRequestIssueInput as G, AccountLifecycle as Gt, ActorProfileMethods as H, ResolvedTarget as Ht, PermissionReplaceInput as I, PaymentType as It, AddressBookEntry as J, IdentityMethods as Jt, ActorRequestsMethods as K, AccountSetupStep as Kt, PermissionRevokeInput as L, PaymentsMethods as Lt, PermissionChangeInput as M, PaymentDocumentsMethods as Mt, PermissionCreateInput as N, PaymentMoney as Nt, OrganizationPaymentInput as O, PaymentDocumentKind as Ot, PermissionMethods as P, PaymentStatus as Pt, InboxItem as Q, OrgSetupStep as Qt, PermissionReadResult as R, PaymentsPayInput as Rt, OrganizationAuditLogItem as S, OfframpQuote as St, RoleSpendCap as T, Payee as Tt, ActorRelationshipMethods as U, TargetReference as Ut, ActorProfile as V, Ref$1 as Vt, ActorRequest as W, TargetsMethods as Wt, AddressBookMethods as X, AuthMethods as Xt, AddressBookLabelInput as Y, SmartAccountMethods as Yt, InboxApproveInput as Z, OrgLifecycle as Zt, OrgMethods as _, IdentityTransition as _n, FinancialOpsMethods as _t, IdentityRuntimeSendResult as a, TelemetryEvent as an, ActivityPage as at, OrgView as b, MeProfile as bt, SystemHealth as c, TelemetryPort as cn, DepositInstructions as ct, CurrentUserMethods as d, IdentityEvent as dn, DestinationKind as dt, CurrentHoldings as en, ActivityAnnotationInput as et, CreateOrgInput as f, IdentityState as fn, DestinationListInput as ft, MemberView as g, destination as gn, DestinationsMethods as gt, MemberStatus as h, StateLabel as hn, DestinationRemoveInput as ht, IdentityRuntime as i, CapxulEnv as in, ActivityMethods as it, PermissionAssignInput as j, PaymentDocumentVerification as jt, OrganizationPaymentItemInput as k, PaymentDocumentRef as kt, MediaMethods as l, CAPXUL_PAYMENTS_V2_ADDRESS as ln, Destination as lt, InviteMemberInput as m, Readiness as mn, DestinationRail as mt, CreateCapxulClientInput as n, Permission as nn, ActivityItem as nt, HoldingsMethods as o, TelemetryGroupInput as on, ActivityReference as ot, DetectPendingOrgInvitationsResult as p, OrgLane as pn, DestinationPayload as pt, AddressBookAddInput as q, isSettingUpLifecycle as qt, IdentityProfileDetails as r, SubmittedPermissionExecution as rn, ActivityListParams as rt, SystemMethods as s, TelemetryIdentifyInput as sn, ActorReference as st, CapxulClient as t, MovementAnnotation as tn, ActivityDetail as tt, CurrentUserContext as u, Destination$1 as un, DestinationAddInput as ut, OrgScopedMethods as v, InvocationControls as vn, HandlesMethods as vt, RoleDefinition as w, OfframpStatus as wt, OrganizationAccount as x, OfframpMethods as xt, OrgTemplate as y, MeMethods as yt, AccountsMethods as z, RecipientResolution as zt };