@capxul/sdk 2.1.1 → 2.2.0

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,4 +1,4 @@
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-Bj4F-RwT.mjs";
1
+ import { $ as CapxulError, A as CountryCode, B as PaymentCommandId, C as AllowedOrigin, D as AuthUserId, E as AuthSession, F as EpochMs, G as RoleKey, H as PermissionId, I as Money, J as TxHash, K as SessionToken, L as MovementId, M as DocumentHash, N as DurationMs, O as BlockNumber, P as Email, R as OrgId, S as AllowanceKey, T as AppId, U as Profile, V as PermissionAssignmentId, W as PublishableKey, Y as WeiAmount, d as CapxulResult, et as CapxulErrorCode, f as Profile$1, g as AuthCachePort, it as FailureMode, j as CurrencyCode, k as ChainId, m as SmartAccount$1, n as CapxulSigner, o as AccountProviderSource, p as Session$1, q as SmartAccount, rt as Failure, s as AccountRequirement, tt as CapxulErrorDetails, v as CachedJwt, w as AnonymousDistinctId, x as Address$1, y as Account$1, z as PartyId } from "./signer-D4roBkcX.mjs";
2
2
  import { Address, Hex } from "viem";
3
3
  import { Context, Effect, Layer, Schema, Scope, Tracer } from "effect";
4
4
  import { FunctionReference } from "convex/server";
@@ -1107,6 +1107,9 @@ type TargetReference = {
1107
1107
  } | {
1108
1108
  readonly kind: "payee";
1109
1109
  readonly id: string;
1110
+ } | {
1111
+ readonly kind: "party";
1112
+ readonly partyId: PartyId;
1110
1113
  } | {
1111
1114
  readonly kind: "destination";
1112
1115
  readonly id: string;
@@ -1142,6 +1145,9 @@ type Ref$1 = {
1142
1145
  } | {
1143
1146
  readonly kind: "payeeId";
1144
1147
  readonly payeeId: string;
1148
+ } | {
1149
+ readonly kind: "party";
1150
+ readonly partyId: PartyId;
1145
1151
  };
1146
1152
  interface MeProfile {
1147
1153
  readonly authUserId: string;
@@ -1243,7 +1249,7 @@ interface Payment {
1243
1249
  readonly transactionHash: string;
1244
1250
  } | null;
1245
1251
  readonly recipient: {
1246
- readonly kind: "handle" | "email" | "payee" | "capxulUserId" | "me" | "org" | "external_address";
1252
+ readonly kind: "handle" | "email" | "payee" | "capxulUserId" | "me" | "org" | "party" | "external_address";
1247
1253
  readonly label: string;
1248
1254
  readonly payeeId?: string;
1249
1255
  };
@@ -1589,35 +1595,54 @@ interface ActorProfile {
1589
1595
  readonly email?: string;
1590
1596
  readonly handle?: string;
1591
1597
  }
1598
+ /**
1599
+ * How a counterparty entered the book, and what they are to the actor today.
1600
+ *
1601
+ * The first six values are the backend edge provenance VERBATIM (ADR-0022 R2);
1602
+ * `employed` is projected from an open employment edge. The pre-substrate
1603
+ * union published `requested` (a value that collapsed two directions) and
1604
+ * `employee` (a value no backend path ever wrote).
1605
+ */
1606
+ type AddressBookRelationship = "paid" | "paidBy" | "invoiced" | "invoicedBy" | "member" | "manual" | "employed";
1592
1607
  interface AddressBookEntry {
1593
- readonly id: string;
1608
+ /**
1609
+ * The counterparty's `PartyId`. It is stable: the id you read before a
1610
+ * counterparty signs up is the id you read after (ADR-0022 R1). The old id
1611
+ * was a derived string that changed at signup.
1612
+ */
1613
+ readonly id: PartyId;
1594
1614
  readonly ref: Ref$1;
1595
1615
  readonly label: string;
1596
- readonly relationship: readonly ("paid" | "paidBy" | "requested" | "member" | "employee")[];
1616
+ readonly relationship: readonly AddressBookRelationship[];
1597
1617
  readonly hidden: boolean;
1618
+ /** Epoch milliseconds of the most recent activity with this counterparty. */
1619
+ readonly lastActivityAt: number;
1598
1620
  }
1599
1621
  interface AddressBookAddInput {
1600
1622
  readonly ref: Ref$1;
1601
1623
  readonly label?: string;
1602
1624
  }
1603
1625
  interface AddressBookLabelInput {
1604
- readonly entryId: string;
1626
+ readonly entryId: PartyId;
1605
1627
  readonly label: string;
1606
1628
  }
1629
+ interface AddressBookListInput {
1630
+ readonly includeHidden?: boolean;
1631
+ }
1607
1632
  interface AddressBookMethods {
1608
- list(options?: {
1633
+ list(input?: AddressBookListInput, options?: {
1609
1634
  readonly signal?: AbortSignal;
1610
1635
  }): Promise<CapxulResult<readonly AddressBookEntry[]>>;
1611
- get(entryId: string, options?: {
1636
+ get(entryId: PartyId, options?: {
1612
1637
  readonly signal?: AbortSignal;
1613
1638
  }): Promise<CapxulResult<AddressBookEntry | null>>;
1614
1639
  add(input: AddressBookAddInput, options?: {
1615
1640
  readonly signal?: AbortSignal;
1616
1641
  }): Promise<CapxulResult<AddressBookEntry>>;
1617
- hide(entryId: string, options?: {
1642
+ hide(entryId: PartyId, options?: {
1618
1643
  readonly signal?: AbortSignal;
1619
1644
  }): Promise<CapxulResult<AddressBookEntry>>;
1620
- unhide(entryId: string, options?: {
1645
+ unhide(entryId: PartyId, options?: {
1621
1646
  readonly signal?: AbortSignal;
1622
1647
  }): Promise<CapxulResult<AddressBookEntry>>;
1623
1648
  label(input: AddressBookLabelInput, options?: {
@@ -2281,7 +2306,7 @@ interface CapxulClient {
2281
2306
  * NOT on the public `client.accounts` surface.
2282
2307
  */
2283
2308
  readonly accounts: AccountsFaucetMethods; /** Quarantined Reference-harness evidence; never a product Organization method. */
2284
- readonly organizationSetup: OrganizationSetupProofMethods; /** Telemetry port for error reporting. Used by React hooks to report errors before throwing. */
2309
+ readonly organizationSetup: OrganizationSetupProofMethods; /** Product telemetry projection for internal composition and test harnesses. */
2285
2310
  readonly telemetry?: TelemetryPort;
2286
2311
  readonly close?: () => Promise<void>;
2287
2312
  };
@@ -2357,4 +2382,63 @@ interface CreateCapxulClientInput {
2357
2382
  };
2358
2383
  }
2359
2384
  //#endregion
2360
- export { InboxMethods as $, OrgLifecycle as $t, OrganizationPaymentsMethods as A, PaymentDocumentRef as At, AccountMethods as B, RecipientResolution as Bt, ResendInviteTokenInput as C, OfframpQuoteInput as Ct, OrganizationPaymentBatchInput as D, Payment as Dt, RoleView as E, PayeesMethods as Et, PermissionOptions as F, PaymentStatus as Ft, ActorRequestIssueInput as G, TargetsMethods as Gt, ActorProfileMethods as H, Ref$1 as Ht, PermissionReplaceInput as I, PaymentTiming as It, AddressBookEntry as J, AccountSetupStep as Jt, ActorRequestsMethods as K, fingerprintPaymentIntent as Kt, PermissionRevokeInput as L, PaymentType as Lt, PermissionChangeInput as M, PaymentDocumentVerification as Mt, PermissionCreateInput as N, PaymentDocumentsMethods as Nt, OrganizationPaymentInput as O, PaymentDirection as Ot, PermissionMethods as P, PaymentMoney as Pt, InboxItem as Q, AuthMethods as Qt, PermissionReadResult as R, PaymentsMethods as Rt, OrganizationAuditLogItem as S, OfframpQuote as St, RoleSpendCap as T, Payee as Tt, ActorRelationshipMethods as U, ResolvedTarget as Ut, ActorProfile as V, RecipientResolutionKind as Vt, ActorRequest as W, TargetReference as Wt, AddressBookMethods as X, IdentityMethods as Xt, AddressBookLabelInput as Y, isSettingUpLifecycle as Yt, InboxApproveInput as Z, SmartAccountMethods as Zt, OrgMethods as _, StateLabel as _n, FinancialOpsMethods as _t, IdentityRuntimeSendResult as a, SubmittedPermissionExecution as an, ActivityPage as at, OrgView as b, InvocationControls as bn, MeProfile as bt, SystemHealth as c, TelemetryGroupInput as cn, DepositInstructions as ct, CurrentUserMethods as d, CAPXUL_PAYMENTS_V2_ADDRESS as dn, DestinationKind as dt, OrgSetupStep as en, ActivityAnnotationInput as et, CreateOrgInput as f, Destination$1 as fn, DestinationListInput as ft, MemberView as g, Readiness as gn, DestinationsMethods as gt, MemberStatus as h, OrgLane as hn, DestinationRemoveInput as ht, IdentityRuntime as i, Permission as in, ActivityMethods as it, PermissionAssignInput as j, PaymentDocumentRender as jt, OrganizationPaymentItemInput as k, PaymentDocumentKind as kt, MediaMethods as l, TelemetryIdentifyInput as ln, Destination as lt, InviteMemberInput as m, IdentityState as mn, DestinationRail as mt, CreateCapxulClientInput as n, CurrentHoldings as nn, ActivityItem as nt, HoldingsMethods as o, CapxulEnv as on, ActivityReference as ot, DetectPendingOrgInvitationsResult as p, IdentityEvent as pn, DestinationPayload as pt, AddressBookAddInput as q, AccountLifecycle as qt, IdentityProfileDetails as r, MovementAnnotation as rn, ActivityListParams as rt, SystemMethods as s, TelemetryEvent as sn, ActorReference as st, CapxulClient as t, WireObservationContext as tn, ActivityDetail as tt, CurrentUserContext as u, TelemetryPort as un, DestinationAddInput as ut, OrgScopedMethods as v, destination as vn, HandlesMethods as vt, RoleDefinition as w, OfframpStatus as wt, OrganizationAccount as x, OfframpMethods as xt, OrgTemplate as y, IdentityTransition as yn, MeMethods as yt, AccountsMethods as z, PaymentsPayInput as zt };
2385
+ //#region src/host-observability.d.ts
2386
+ /** One host-owned observability module at the SDK consumer boundary. */
2387
+ interface HostObservability {
2388
+ readonly failures: ObservationAdapter;
2389
+ readonly product: TelemetryPort;
2390
+ }
2391
+ interface PostHogObservabilityClient {
2392
+ capture(event: string, properties?: Readonly<Record<string, unknown>>): unknown;
2393
+ captureException?(exception: Error, properties?: Readonly<Record<string, unknown>>): unknown;
2394
+ identify?(distinctId: string, properties?: Readonly<Record<string, unknown>>): unknown;
2395
+ group?(groupType: string, groupKey: string, properties?: Readonly<Record<string, unknown>>): unknown;
2396
+ reset?(): unknown;
2397
+ }
2398
+ interface PostHogObservabilityOptions {
2399
+ /** Consent / kill-switch seam. Defaults to enabled. */
2400
+ readonly enabled?: boolean | (() => boolean);
2401
+ /** Host environment stamped on every SDK-owned product event. */
2402
+ readonly capxulEnv?: CapxulEnv;
2403
+ /** Host-owned correlation context shared by product and failure delivery. */
2404
+ readonly context?: ObservationContext | (() => ObservationContext | undefined);
2405
+ }
2406
+ /** Build the SDK's one host module around an already-initialized PostHog client. */
2407
+ declare function postHogObservability(client: PostHogObservabilityClient | null | undefined, options?: PostHogObservabilityOptions): HostObservability;
2408
+ //#endregion
2409
+ //#region src/observation.d.ts
2410
+ /** Host-owned correlation fields that are safe to attach to an SDK failure. */
2411
+ interface ObservationContext extends Omit<WireObservationContext, "applicationId"> {}
2412
+ /**
2413
+ * The small, SDK-owned failure envelope delivered to observation adapters.
2414
+ * Method arguments, response bodies, wallet payloads, and arbitrary error
2415
+ * details are deliberately absent.
2416
+ */
2417
+ interface SdkFailureObservation {
2418
+ readonly exception: Error;
2419
+ readonly sdkVersion: string;
2420
+ readonly operation: string;
2421
+ readonly errorKind: string;
2422
+ /** Invocation snapshot; failure correlation wins over later host state. */
2423
+ readonly context?: ObservationContext;
2424
+ }
2425
+ type ObservationDelivery = void | PromiseLike<void>;
2426
+ /**
2427
+ * High-level host observation boundary. The SDK owns when each method is
2428
+ * called; the host owns the destination client, consent, and delivery policy.
2429
+ */
2430
+ interface ObservationAdapter {
2431
+ /**
2432
+ * Optional read-only invocation context. Transport adapters snapshot it once
2433
+ * at call start; implementations must not mutate global SDK state.
2434
+ */
2435
+ readonly resolveContext?: () => ObservationContext | undefined;
2436
+ /** A method returned the SDK's typed `{ ok: false, error }` result. */
2437
+ captureOperationFailure(failure: SdkFailureObservation): ObservationDelivery;
2438
+ /** A method unexpectedly threw or rejected instead of returning a typed result. */
2439
+ captureException(exception: SdkFailureObservation): ObservationDelivery;
2440
+ }
2441
+ /** Stable PostHog event used for typed failures that are expected product outcomes. */
2442
+ declare const CAPXUL_SDK_EXPECTED_OUTCOME_EVENT = "capxul_sdk_expected_outcome";
2443
+ //#endregion
2444
+ export { ActorRequest as $, TargetReference as $t, OrganizationAccount as A, OfframpMethods as At, PermissionAssignInput as B, PaymentDocumentRender as Bt, InviteMemberInput as C, Readiness as Cn, DestinationRail as Ct, OrgScopedMethods as D, InvocationControls as Dn, HandlesMethods as Dt, OrgMethods as E, IdentityTransition as En, FinancialOpsMethods as Et, RoleView as F, PayeesMethods as Ft, PermissionReplaceInput as G, PaymentTiming as Gt, PermissionCreateInput as H, PaymentDocumentsMethods as Ht, OrganizationPaymentBatchInput as I, Payment as It, AccountsMethods as J, PaymentsPayInput as Jt, PermissionRevokeInput as K, PaymentType as Kt, OrganizationPaymentInput as L, PaymentDirection as Lt, ResendInviteTokenInput as M, OfframpQuoteInput as Mt, RoleDefinition as N, OfframpStatus as Nt, OrgTemplate as O, MeMethods as Ot, RoleSpendCap as P, Payee as Pt, ActorRelationshipMethods as Q, ResolvedTarget as Qt, OrganizationPaymentItemInput as R, PaymentDocumentKind as Rt, DetectPendingOrgInvitationsResult as S, OrgLane as Sn, DestinationPayload as St, MemberView as T, destination as Tn, DestinationsMethods as Tt, PermissionMethods as U, PaymentMoney as Ut, PermissionChangeInput as V, PaymentDocumentVerification as Vt, PermissionOptions as W, PaymentStatus as Wt, ActorProfile as X, RecipientResolutionKind as Xt, AccountMethods as Y, RecipientResolution as Yt, ActorProfileMethods as Z, Ref$1 as Zt, SystemHealth as _, TelemetryPort as _n, DepositInstructions as _t, SdkFailureObservation as a, IdentityMethods as an, AddressBookMethods as at, CurrentUserMethods as b, IdentityEvent as bn, DestinationKind as bt, PostHogObservabilityOptions as c, OrgLifecycle as cn, InboxMethods as ct, CreateCapxulClientInput as d, MovementAnnotation as dn, ActivityItem as dt, TargetsMethods as en, ActorRequestIssueInput as et, IdentityProfileDetails as f, Permission as fn, ActivityListParams as ft, SystemMethods as g, TelemetryIdentifyInput as gn, ActorReference as gt, HoldingsMethods as h, TelemetryGroupInput as hn, ActivityReference as ht, ObservationDelivery as i, isSettingUpLifecycle as in, AddressBookLabelInput as it, OrganizationAuditLogItem as j, OfframpQuote as jt, OrgView as k, MeProfile as kt, postHogObservability as l, OrgSetupStep as ln, ActivityAnnotationInput as lt, IdentityRuntimeSendResult as m, TelemetryEvent as mn, ActivityPage as mt, ObservationAdapter as n, AccountLifecycle as nn, AddressBookAddInput as nt, HostObservability as o, SmartAccountMethods as on, InboxApproveInput as ot, IdentityRuntime as p, SubmittedPermissionExecution as pn, ActivityMethods as pt, PermissionReadResult as q, PaymentsMethods as qt, ObservationContext as r, AccountSetupStep as rn, AddressBookEntry as rt, PostHogObservabilityClient as s, AuthMethods as sn, InboxItem as st, CAPXUL_SDK_EXPECTED_OUTCOME_EVENT as t, fingerprintPaymentIntent as tn, ActorRequestsMethods as tt, CapxulClient as u, CurrentHoldings as un, ActivityDetail as ut, MediaMethods as v, CAPXUL_PAYMENTS_V2_ADDRESS as vn, Destination as vt, MemberStatus as w, StateLabel as wn, DestinationRemoveInput as wt, CreateOrgInput as x, IdentityState as xn, DestinationListInput as xt, CurrentUserContext as y, Destination$1 as yn, DestinationAddInput as yt, OrganizationPaymentsMethods as z, PaymentDocumentRef as zt };
@@ -34,6 +34,13 @@ interface Failure {
34
34
  readonly error?: CapxulError;
35
35
  }
36
36
  type CapxulErrorDetails = Record<string, unknown>;
37
+ type SignerSource = "openfort-embedded" | "injected-eip1193" | "local-private-key";
38
+ type VerificationRequiredDetails = {
39
+ readonly requiredTier: number;
40
+ } | {
41
+ readonly rail: string;
42
+ readonly currentKind: string;
43
+ };
37
44
  type CapxulErrorOptions = {
38
45
  readonly cause?: unknown;
39
46
  readonly details?: CapxulErrorDetails;
@@ -48,6 +55,91 @@ declare class CapxulError extends Error {
48
55
  constructor(code: CapxulErrorCode, message: string, options?: CapxulErrorOptions);
49
56
  }
50
57
  declare function isCapxulError(value: unknown): value is CapxulError;
58
+ declare const Errors: {
59
+ readonly notAuthenticated: (message?: string, opts?: {
60
+ readonly failure_mode?: FailureMode;
61
+ }) => CapxulError;
62
+ readonly emailDeliveryFailed: (detail: string) => CapxulError;
63
+ readonly profileNotFound: (authUserId: string) => CapxulError;
64
+ readonly smartAccountMissing: (authUserId: string) => CapxulError;
65
+ readonly playerNotFound: (playerId?: string) => CapxulError;
66
+ readonly accountNotFound: (accountId?: string) => CapxulError;
67
+ readonly providerError: (provider: string, operation: string, cause: unknown, opts?: {
68
+ readonly failure_mode?: FailureMode;
69
+ }) => CapxulError;
70
+ readonly capabilityUnavailable: (provider: string, operation: string) => CapxulError;
71
+ readonly invalidInput: (field: string, reason: string) => CapxulError;
72
+ readonly envMissing: (name: string) => CapxulError;
73
+ readonly notImplemented: (domain: string, method: string) => CapxulError;
74
+ /**
75
+ * Sibling factory to {@link Errors.providerError} for the per-state timeout
76
+ * path in flows. Same `PROVIDER_ERROR` code as
77
+ * `providerError`, plus a `details.reason: "timeout"` discriminator so
78
+ * downstream observers can distinguish failure modes without parsing the
79
+ * message string. The redacted message names the timeout budget; the
80
+ * native `cause` carries the same information for `reportError` fidelity.
81
+ */
82
+ readonly providerTimeout: (provider: string, operation: string, timeoutMs: number) => CapxulError;
83
+ readonly verificationRequired: (details: VerificationRequiredDetails) => CapxulError;
84
+ readonly insufficientBalance: (asset: string, available: string, required: string) => CapxulError;
85
+ readonly invalidRecipient: (reason: string) => CapxulError;
86
+ /**
87
+ * The org Zodiac Roles modifier REFUSED the spend on-chain (G4 · #547): the
88
+ * member's role condition (per-tx cap, per-day allowance, allowed recipient,
89
+ * or membership) was violated, so `execTransactionWithRole` reverted. This is
90
+ * a PERMISSION denial — explicitly NOT an `INSUFFICIENT_BALANCE` (the treasury
91
+ * held the funds; the role's authority is what bound). `reason` discriminates
92
+ * the violated condition (`over_cap` / `daily_cap` / `not_member` /
93
+ * `disallowed_recipient` / `condition_violation`); leak-safe — no on-chain
94
+ * identifiers ever enter the details.
95
+ */
96
+ readonly rolePermissionDenied: (details: {
97
+ readonly reason: "over_cap" | "daily_cap" | "not_member" | "disallowed_recipient" | "condition_violation";
98
+ readonly operation?: string;
99
+ }) => CapxulError;
100
+ /**
101
+ * A transaction (or sponsored UserOp) failed. `details.reason` discriminates
102
+ * the failure mode for callers that must distinguish a CONFIRMED on-chain
103
+ * revert (`"onchain_revert"` — the op executed and reverted, e.g. a Zodiac
104
+ * Roles condition violation) from an inconclusive infra failure. A confirmed
105
+ * revert is the ONLY mode the org spend port may map to a roles denial.
106
+ */
107
+ readonly transactionFailed: (operation: string, cause?: unknown, extra?: {
108
+ readonly reason?: string;
109
+ }) => CapxulError;
110
+ readonly rateLimited: (details?: {
111
+ readonly retryAfterMs?: number;
112
+ readonly resource?: string;
113
+ }) => CapxulError;
114
+ readonly networkError: (operation: string, cause?: unknown) => CapxulError;
115
+ readonly unknown: (cause?: unknown) => CapxulError;
116
+ readonly otpExpired: (details?: {
117
+ readonly email?: string;
118
+ readonly expiredAt?: number;
119
+ }) => CapxulError;
120
+ readonly signerRejected: (details: {
121
+ readonly source: SignerSource;
122
+ readonly reason?: string;
123
+ readonly cause?: unknown;
124
+ }) => CapxulError;
125
+ readonly cancelled: (details?: {
126
+ readonly operation?: string;
127
+ readonly reason?: string;
128
+ }) => CapxulError;
129
+ /**
130
+ * Method called from a flow state where its precondition fails (TA16). The
131
+ * SDK's method API short-circuits with this error before driving the
132
+ * internal state machine. `currentState` is the Effect-machine snapshot
133
+ * tag (stringified from the SDK's actor-shell snapshot; see
134
+ * `packages/errors/CONTEXT.md`); `validStates`
135
+ * enumerates the states the method accepts.
136
+ */
137
+ readonly wrongState: (details: {
138
+ readonly method: string;
139
+ readonly currentState: string;
140
+ readonly validStates: readonly string[];
141
+ }) => CapxulError;
142
+ };
51
143
  //#endregion
52
144
  //#region ../types/src/brand.d.ts
53
145
  /**
@@ -99,6 +191,7 @@ type Account$1 = {
99
191
  type AuthUserId = Brand<string, "AuthUserId">;
100
192
  type AnonymousDistinctId = Brand<string, "AnonymousDistinctId">;
101
193
  type AccountId = Brand<string, "AccountId">;
194
+ type PartyId = Brand<string, "PartyId">;
102
195
  type MovementId = Brand<string, "MovementId">;
103
196
  type PermissionId = Brand<string, "PermissionId">;
104
197
  type PermissionAssignmentId = Brand<string, "PermissionAssignmentId">;
@@ -292,4 +385,4 @@ interface Eip1193RequestProvider {
292
385
  */
293
386
  declare function injectedWalletSigner(provider: Eip1193RequestProvider): CapxulSigner;
294
387
  //#endregion
295
- export { CapxulErrorDetails as $, CountryCode as A, PermissionAssignmentId as B, AllowedOrigin as C, AuthUserId as D, AuthSession as E, EpochMs as F, SessionToken as G, Profile$1 as H, Money as I, WeiAmount as J, SmartAccount$1 as K, MovementId as L, DocumentHash as M, DurationMs as N, BlockNumber as O, Email as P, CapxulErrorCode as Q, OrgId as R, AllowanceKey as S, AppId as T, PublishableKey as U, PermissionId as V, RoleKey as W, toCountryCode as X, toAddress as Y, CapxulError as Z, AuthCachePortTag as _, AccountProvider as a, AccountId as b, Eip1193Provider as c, CapxulResult as d, Failure as et, Profile as f, AuthCachePort as g, AuthCacheError as h, injectedWalletSigner as i, CurrencyCode as j, ChainId as k, eip1193AccountProvider as l, SmartAccount as m, CapxulSigner as n, isCapxulError as nt, AccountProviderSource as o, Session as p, TxHash as q, Eip1193RequestProvider as r, AccountRequirement as s, CapxulDigestSigner as t, FailureMode as tt, localPrivateKeyAccountProvider as u, CachedJwt as v, AnonymousDistinctId as w, Address$1 as x, Account$1 as y, PaymentCommandId as z };
388
+ export { CapxulError as $, CountryCode as A, PaymentCommandId as B, AllowedOrigin as C, AuthUserId as D, AuthSession as E, EpochMs as F, RoleKey as G, PermissionId as H, Money as I, TxHash as J, SessionToken as K, MovementId as L, DocumentHash as M, DurationMs as N, BlockNumber as O, Email as P, CAPXUL_ERROR_CODES as Q, OrgId as R, AllowanceKey as S, AppId as T, Profile$1 as U, PermissionAssignmentId as V, PublishableKey as W, toAddress as X, WeiAmount as Y, toCountryCode as Z, AuthCachePortTag as _, AccountProvider as a, isCapxulError as at, AccountId as b, Eip1193Provider as c, CapxulResult as d, CapxulErrorCode as et, Profile as f, AuthCachePort as g, AuthCacheError as h, injectedWalletSigner as i, FailureMode as it, CurrencyCode as j, ChainId as k, eip1193AccountProvider as l, SmartAccount as m, CapxulSigner as n, Errors as nt, AccountProviderSource as o, Session as p, SmartAccount$1 as q, Eip1193RequestProvider as r, Failure as rt, AccountRequirement as s, CapxulDigestSigner as t, CapxulErrorDetails as tt, localPrivateKeyAccountProvider as u, CachedJwt as v, AnonymousDistinctId as w, Address$1 as x, Account$1 as y, PartyId as z };
@@ -1,4 +1,4 @@
1
- import { cn as TelemetryGroupInput, ln as TelemetryIdentifyInput, sn as TelemetryEvent, t as CapxulClient, yn as IdentityTransition } from "../create-capxul-client-BI-6Za6X.mjs";
1
+ import { En as IdentityTransition, gn as TelemetryIdentifyInput, hn as TelemetryGroupInput, mn as TelemetryEvent, n as ObservationAdapter, u as CapxulClient } from "../observation-BwPo8qeo.mjs";
2
2
  import { Effect, Layer } from "effect";
3
3
 
4
4
  //#region src/testing/telemetry/RecordingTelemetryAdapter.d.ts
@@ -18,6 +18,8 @@ type RecordingTelemetryOperation = {
18
18
  //#region src/testing/index.d.ts
19
19
  interface CreateCapxulTestClientOptions {
20
20
  readonly requirement?: "none" | "counterfactual" | "deployed";
21
+ /** Optional Core SDK failure adapter for packed consumer proofs. */
22
+ readonly failureObservation?: ObservationAdapter;
21
23
  }
22
24
  interface SeedTestIdentityInput {
23
25
  readonly authUserId: string;
@@ -1,5 +1,5 @@
1
- import { C as bootstrapErrorFromCapxul, G as deriveCapxulSafeAddress, O as toWei, _ as identityErrorFromCapxul, f as smartAccountErrorFromCapxul, h as wireChainId, k as fromWei, m as accountReadErrorFromCapxul, t as assembleCapxulClient, u as redactTelemetryEvent, w as authClientPortFromPromiseAdapter, y as convexCallErrorFromCapxul } from "../create-capxul-client-CPhTPz_9.mjs";
2
- import { A as toSessionToken, C as toEpochMs, E as toKycTier, M as CapxulError, O as toPublishableKey, P as Errors, S as toEmail, T as toJwtToken, _ as toAuthUserId, g as toAppId, h as toAllowedOrigin, m as toAddress, p as toAccountId, t as InMemoryAuthCacheAdapter, v as toChainId, w as toEpochSeconds, x as toDurationMs, y as toCountryCode } from "../InMemoryAuthCacheAdapter-Rc8tCtml.mjs";
1
+ import { E as authClientPortFromPromiseAdapter, J as deriveCapxulSafeAddress, M as fromWei, T as bootstrapErrorFromCapxul, _ as wireChainId, f as redactTelemetryEvent, g as accountReadErrorFromCapxul, j as toWei, m as smartAccountErrorFromCapxul, t as assembleCapxulClient, x as convexCallErrorFromCapxul, y as identityErrorFromCapxul } from "../create-capxul-client-B8qMV-_e.mjs";
2
+ import { A as toPublishableKey, C as toEmail, D as toKycTier, E as toJwtToken, F as CapxulError, L as Errors, M as toSessionToken, S as toDurationMs, T as toEpochSeconds, _ as toAppId, b as toCountryCode, g as toAllowedOrigin, h as toAddress, m as toAccountId, t as InMemoryAuthCacheAdapter, v as toAuthUserId, w as toEpochMs, y as toChainId } from "../InMemoryAuthCacheAdapter-PycLJWeW.mjs";
3
3
  import { keccak256 } from "viem";
4
4
  import { Effect, Result, Semaphore } from "effect";
5
5
  import { getFunctionName } from "convex/server";
@@ -884,7 +884,8 @@ function createCapxulTestClient(options = {}) {
884
884
  },
885
885
  bootstrap: TEST_BOOTSTRAP,
886
886
  authCache,
887
- requirement: options.requirement ?? "none"
887
+ requirement: options.requirement ?? "none",
888
+ ...options.failureObservation === void 0 ? {} : { failureObservation: options.failureObservation }
888
889
  });
889
890
  const transitions = [];
890
891
  const unsubscribe = client._internal.identity.subscribeTransitions((record) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capxul/sdk",
3
- "version": "2.1.1",
3
+ "version": "2.2.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/Xelmar-tech/infrastructure.git",
@@ -48,10 +48,10 @@
48
48
  "vitest": "npm:@voidzero-dev/vite-plus-test@0.1.23",
49
49
  "@capxul/config": "0.2.0",
50
50
  "@capxul/errors": "0.0.1",
51
- "@capxul/observability": "2.1.1",
52
- "@capxul/typescript-config": "0.0.0",
53
51
  "@capxul/types": "0.1.0",
54
- "@capxul/wire": "0.3.0"
52
+ "@capxul/wire": "0.3.0",
53
+ "@capxul/observability": "2.2.0",
54
+ "@capxul/typescript-config": "0.0.0"
55
55
  },
56
56
  "_permissionlessPinReason": "permissionless.toSafeSmartAccount is pinned to 0.3.4 for live Safe deployment E2E. Counterfactual address fixtures captured 2026-05-17 in packages/backend/convex/_shared/__tests__/counterfactual.test.ts and packages/config/tests/safe.test.ts must be re-verified before upgrading.",
57
57
  "scripts": {