@capxul/sdk 2.3.1 → 2.4.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.
package/dist/index.d.mts CHANGED
@@ -1,11 +1,46 @@
1
- import { $ as toAddress, C as Address, H as PartyId, J as RoleKey, N as CountryCode, O as AuthSession, S as AccountId, V as OrgId, a as SignerStatusStore, at as Errors, c as AccountProviderSource, ct as isCapxulError, d as eip1193AccountProvider, et as toCountryCode, f as localPrivateKeyAccountProvider, g as SmartAccount, h as Session, i as SignerStatus, it as CapxulErrorDetails, j as BudgetId, k as AuthUserId, l as AccountRequirement, m as Profile, n as CapxulSigner, nt as CapxulError, o as injectedWalletSigner, p as CapxulResult, r as Eip1193RequestProvider, rt as CapxulErrorCode, s as AccountProvider, st as FailureMode, t as CapxulDigestSigner, tt as CAPXUL_ERROR_CODES, u as Eip1193Provider, x as Account, z as Money } from "./signer-BejoR3bA.mjs";
2
- import { $ as AccountMethods, $t as RecipientResolution, A as OrganizationAccount, An as isClaimed, At as FinancialOpsMethods, B as PermissionAssignInput, Bt as Payment, C as InviteMemberInput, Cn as Destination$1, Ct as DestinationAddInput, D as OrgScopedMethods, Dn as Readiness, Dt as DestinationRail, E as OrgMethods, En as OrgLane, Et as DestinationPayload, F as RoleView, Ft as OfframpQuote, G as PermissionReplaceInput, Gt as PaymentDocumentVerification, H as PermissionCreateInput, Ht as PaymentDocumentKind, I as OrganizationPaymentBatchInput, It as OfframpQuoteInput, J as Budget, Jt as PaymentStatus, K as PermissionRevokeInput, Kt as PaymentDocumentsMethods, L as OrganizationPaymentInput, Lt as OfframpStatus, M as ResendInviteTokenInput, Mn as IdentityTransition, Mt as MeMethods, N as RoleDefinition, Nn as InvocationControls, Nt as MeProfile, O as OrgTemplate, On as StateLabel, Ot as DestinationRemoveInput, P as RoleSpendCap, Pt as OfframpMethods, Q as AccountsMethods, Qt as PaymentsPayInput, R as OrganizationPaymentItemInput, Rt as Payee, S as DetectPendingOrgInvitationsResult, Sn as CAPXUL_PAYMENTS_V2_ADDRESS, St as Destination, T as MemberView, Tn as IdentityState, Tt as DestinationListInput, U as PermissionMethods, Ut as PaymentDocumentRef, V as PermissionChangeInput, Vt as PaymentDirection, W as PermissionOptions, Wt as PaymentDocumentRender, X as OrgMeMethod, Xt as PaymentType, Y as OrgMe, Yt as PaymentTiming, Z as OrgMeOptions, Zt as PaymentsMethods, _ as SystemHealth, _n as SubmittedPermissionExecution, _t as ActivityMethods, a as SdkFailureObservation, an as fingerprintPaymentIntent, at as ActorRequestsMethods, b as CurrentUserMethods, bt as ActorReference, c as PostHogObservabilityOptions, cn as isSettingUpLifecycle, ct as AddressBookLabelInput, d as CreateCapxulClientInput, dn as AuthMethods, dt as InboxItem, en as RecipientResolutionKind, et as ActorProfile, f as IdentityProfileDetails, fn as OrgLifecycle, ft as InboxMethods, g as SystemMethods, gn as Permission, gt as ActivityListParams, h as HoldingsMethods, hn as MovementAnnotation, ht as ActivityItem, i as ObservationDelivery, in as TargetsMethods, it as ActorRequestIssueInput, j as OrganizationAuditLogItem, jn as isRestoring, jt as HandlesMethods, k as OrgView, kn as destination, kt as DestinationsMethods, l as postHogObservability, ln as IdentityMethods, lt as AddressBookMethods, m as IdentityRuntimeSendResult, mn as CurrentHoldings, mt as ActivityDetail, n as ObservationAdapter, nn as ResolvedTarget, nt as ActorRelationshipMethods, o as HostObservability, on as AccountLifecycle, ot as AddressBookAddInput, p as IdentityRuntime, pn as OrgSetupStep, pt as ActivityAnnotationInput, q as PermissionReadResult, qt as PaymentMoney, r as ObservationContext, rn as TargetReference, rt as ActorRequest, s as PostHogObservabilityClient, sn as AccountSetupStep, st as AddressBookEntry, t as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, tn as Ref, tt as ActorProfileMethods, u as CapxulClient, un as SmartAccountMethods, ut as InboxApproveInput, v as MediaMethods, vt as ActivityPage, w as MemberStatus, wn as IdentityEvent, wt as DestinationKind, x as CreateOrgInput, xn as TelemetryPort, xt as DepositInstructions, y as CurrentUserContext, yt as ActivityReference, z as OrganizationPaymentsMethods, zt as PayeesMethods } from "./observation-Ci8gIQjm.mjs";
1
+ import { $ as toCountryCode, B as OrgId, C as Address, N as CountryCode, O as AuthSession, Q as toAddress, S as AccountId, V as PartyId, a as SignerStatusStore, c as AccountProviderSource, d as eip1193AccountProvider, et as CAPXUL_ERROR_CODES, f as localPrivateKeyAccountProvider, g as SmartAccount, h as Session, i as SignerStatus, it as Errors, j as BudgetId, k as AuthUserId, l as AccountRequirement, m as Profile, n as CapxulSigner, nt as CapxulErrorCode, o as injectedWalletSigner, ot as FailureMode, p as CapxulResult, q as RoleKey, r as Eip1193RequestProvider, rt as CapxulErrorDetails, s as AccountProvider, st as isCapxulError, t as CapxulDigestSigner, tt as CapxulError, u as Eip1193Provider, x as Account, z as Money } from "./signer-BGTaqZqg.mjs";
2
+ import { $ as AccountsMethods, $t as PaymentDocumentRef, A as OrgView, An as PAYMENT_STATUSES, At as Destination, B as OrganizationPaymentsMethods, Bn as IdentityState, Bt as MeMethods, C as DetectPendingOrgInvitationsResult, Cn as OrgSetupStep, Ct as ActivityRange, D as OrgMethods, Dn as SubmittedPermissionExecution, Dt as ActivitySummaryTotal, E as MemberView, En as Permission, Et as ActivitySummaryParams, F as RoleSpendCap, Ft as DestinationRail, G as PermissionOptions, Gn as isClaimed, Gt as OfframpQuoteInput, H as PermissionChangeInput, Hn as Readiness, Ht as MovementActivityEvidence, I as RoleView, In as TelemetryPort, It as DestinationRemoveInput, J as PermissionReadResult, Jn as InvocationControls, Jt as PayeesMethods, K as PermissionReplaceInput, Kn as isRestoring, Kt as OfframpStatus, L as OrganizationPaymentBatchInput, Ln as CAPXUL_PAYMENTS_V2_ADDRESS, Lt as DestinationsMethods, M as OrganizationAuditLogItem, Mn as RequestStatus, Mt as DestinationKind, N as ResendInviteTokenInput, Nt as DestinationListInput, O as OrgScopedMethods, On as InboxStatus, Ot as ActorReference, P as RoleDefinition, Pt as DestinationPayload, Q as OrgMeOptions, Qt as PaymentDocumentKind, R as OrganizationPaymentInput, Rn as Destination$1, Rt as FinancialOpsMethods, S as CreateOrgInput, Sn as OrgLifecycle, St as ActivityPage, T as MemberStatus, Tn as CurrentHoldings, Tt as ActivitySummary, U as PermissionCreateInput, Un as StateLabel, Ut as OfframpMethods, V as PermissionAssignInput, Vn as OrgLane, Vt as MeProfile, W as PermissionMethods, Wn as destination, Wt as OfframpQuote, X as OrgMe, Xt as PaymentActivityEvidence, Y as Budget, Yt as Payment, Z as OrgMeMethod, Zt as PaymentDirection, _ as SystemMethods, _n as AccountSetupStep, _t as ActivityFilter, a as SdkFailureObservation, an as PaymentTiming, at as ActorRequestIssueInput, b as CurrentUserContext, bn as SmartAccountMethods, bt as ActivityListParams, c as PostHogObservabilityOptions, cn as PaymentsPayInput, ct as AddressBookEntry, d as CreateCapxulClientInput, dn as Ref, dt as InboxApproveInput, en as PaymentDocumentRender, et as AccountMethods, f as IdentityProfileDetails, fn as ResolvedTarget, ft as InboxItem, g as Holding, gn as AccountLifecycle, gt as ActivityDetail, h as HoldingsMethods, hn as fingerprintPaymentIntent, ht as ActivityAnnotationInput, i as ObservationDelivery, in as PaymentStatus, it as ActorRequest, j as OrganizationAccount, jn as PaymentStatus$1, jt as DestinationAddInput, k as OrgTemplate, kn as PAYMENT_DIRECTIONS, kt as DepositInstructions, l as postHogObservability, ln as RecipientResolution, lt as AddressBookLabelInput, m as IdentityRuntimeSendResult, mn as TargetsMethods, mt as ActivityAnnotation, n as ObservationAdapter, nn as PaymentDocumentsMethods, nt as ActorProfileMethods, o as HostObservability, on as PaymentType, ot as ActorRequestsMethods, p as IdentityRuntime, pn as TargetReference, pt as InboxMethods, q as PermissionRevokeInput, qn as IdentityTransition, qt as Payee, r as ObservationContext, rn as PaymentMoney, rt as ActorRelationshipMethods, s as PostHogObservabilityClient, sn as PaymentsMethods, st as AddressBookAddInput, t as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, tn as PaymentDocumentVerification, tt as ActorProfile, u as CapxulClient, un as RecipientResolutionKind, ut as AddressBookMethods, v as SystemHealth, vn as isSettingUpLifecycle, vt as ActivityItem, w as InviteMemberInput, wn as ActorRef, wt as ActivityReference, x as CurrentUserMethods, xn as AuthMethods, xt as ActivityMethods, y as MediaMethods, yn as IdentityMethods, yt as ActivityKind, z as OrganizationPaymentItemInput, zn as IdentityEvent, zt as HandlesMethods } from "./observation-BfCkJY5z.mjs";
3
3
  import { Hex } from "viem";
4
4
  import { Context, Effect, Layer } from "effect";
5
5
  import { FunctionReference } from "convex/server";
6
6
 
7
+ //#region src/domain/activity/phase.d.ts
8
+ interface ActivityPhase {
9
+ /** The row is in a final state. No subsequent status change occurs. */
10
+ readonly terminal: boolean;
11
+ /**
12
+ * The result of the final state. It is `null` when `terminal` is false.
13
+ *
14
+ * - `good` — the row completed as intended (settled, paid).
15
+ * - `bad` — the row ended, but it did not complete (failed, declined,
16
+ * expired).
17
+ * - `neutral` — a participant stopped the row on purpose (cancelled).
18
+ */
19
+ readonly outcome: "good" | "bad" | "neutral" | null;
20
+ /** The actor who reads this row must do the next step. */
21
+ readonly needsAction: boolean;
22
+ }
23
+ /** Interpret a Payment status. `pending_claim` waits for the actor who reads it. */
24
+ declare function paymentPhase(status: PaymentStatus$1): ActivityPhase;
25
+ /** Interpret a payment Request as its ISSUER sees it. An issuer does not wait for itself. */
26
+ declare function requestPhase(status: RequestStatus): ActivityPhase;
27
+ /** Interpret the same request as its RECIPIENT sees it. `open` waits for the recipient. */
28
+ declare function inboxPhase(status: InboxStatus): ActivityPhase;
29
+ //#endregion
7
30
  //#region src/domain/money/format-money.d.ts
8
- declare function formatMoney(money: Money, options?: {
31
+ /**
32
+ * `Money` and the wire-shaped money the activity surface carries
33
+ * (`PaymentMoney`, whose `currency` is an unbranded string) are the same three
34
+ * facts. Accepting both lets an activity row format without a cast; the
35
+ * currency is validated here instead, so an unsupported code fails with the
36
+ * same `INVALID_INPUT` it always did.
37
+ */
38
+ interface FormattableMoney {
39
+ readonly currency: string;
40
+ readonly value: string;
41
+ readonly decimals: number;
42
+ }
43
+ declare function formatMoney(money: FormattableMoney, options?: {
9
44
  readonly grammar?: "symbol" | "code";
10
45
  }): string;
11
46
  //#endregion
@@ -168,4 +203,4 @@ declare function captureException(telemetry: TelemetryPort, error: unknown, cont
168
203
  */
169
204
  declare function captureExceptionSync(telemetry: TelemetryPort, error: unknown, context?: HandledErrorReportContext): void;
170
205
  //#endregion
171
- export { type Account, type AccountId, type AccountLifecycle, type AccountMethods, type AccountProvider, type AccountProviderSource, type AccountRequirement, type AccountSetupStep, type AccountsMethods, type ActivityAnnotationInput, type ActivityDetail, type ActivityItem, type ActivityListParams, type ActivityMethods, type ActivityPage, type ActivityReference, type ActorProfile, type ActorProfileMethods, type ActorReference, type ActorRelationshipMethods, type ActorRequest, type ActorRequestIssueInput, type ActorRequestsMethods, type Address, type AddressBookAddInput, type AddressBookEntry, type AddressBookLabelInput, type AddressBookMethods, type AuthMethods, type AuthSession, type AuthUserId, type Budget, type BudgetId, CAPXUL_ERROR_CODES, CAPXUL_PAYMENTS_V2_ADDRESS, CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, type CapxulClient, type CapxulClientInput, type CapxulDigestSigner, CapxulError, type CapxulErrorCode, type CapxulErrorDetails, type CapxulResult, type CapxulSigner, type CountryCode, type CreateCapxulClientInput, type CreateOrgInput, type CurrentHoldings, type CurrentUserContext, type CurrentUserMethods, type DepositInstructions, type Destination, type DestinationAddInput, type DestinationKind, type DestinationListInput, type DestinationPayload, type DestinationRail, type DestinationRemoveInput, type DestinationsMethods, type DetectPendingOrgInvitationsResult, type DevPrivateKeySignerInput, type Eip1193Provider, type Eip1193RequestProvider, Errors, type FinancialOpsMethods, type HandledErrorReportContext, type HandlesMethods, type HoldingsMethods, type HostObservability, type Destination$1 as IdentityDestination, type IdentityEvent, type IdentityMethods, type IdentityProfileDetails, type IdentityRuntime, type IdentityRuntimeSendResult, type IdentityState, type IdentityTransition, type InboxApproveInput, type InboxItem, type InboxMethods, type InviteMemberInput, type InvocationControls, type MeMethods, type MeProfile, type MediaMethods, type MemberStatus, type MemberView, type Money, type MoneyParseError, type MoneyParseErrorReason, type MovementAnnotation, type ObservationAdapter, type ObservationContext, type ObservationDelivery, type OfframpMethods, type OfframpQuote, type OfframpQuoteInput, type OfframpStatus, type OpenfortEmbeddedSignerInput, type OpenfortEmbeddedWalletApi, type OpenfortEmbeddedWalletPort, type OrgId, type OrgLane, type OrgLifecycle, type OrgMe, type OrgMeMethod, type OrgMeOptions, type OrgMethods, type OrgScopedMethods, type OrgSetupStep, type OrgTemplate, type OrgView, type OrganizationAccount, type OrganizationAuditLogItem, type OrganizationPaymentBatchInput, type OrganizationPaymentInput, type OrganizationPaymentItemInput, type OrganizationPaymentsMethods, type PartyId, type Payee, type PayeesMethods, type Payment, type PaymentDirection, type PaymentDocumentKind, type PaymentDocumentRef, type PaymentDocumentRender, type PaymentDocumentVerification, type PaymentDocumentsMethods, type PaymentMoney, type PaymentStatus, type PaymentTiming, type PaymentType, type PaymentsMethods, type PaymentsPayInput, type Permission, type PermissionAssignInput, type PermissionChangeInput, type PermissionCreateInput, type PermissionMethods, type PermissionOptions, type PermissionReadResult, type PermissionReplaceInput, type PermissionRevokeInput, type PostHogObservabilityClient, type PostHogObservabilityOptions, type Profile, type Readiness, type RecipientResolution, type RecipientResolutionKind, type Ref, type ResendInviteTokenInput, type ResolvedTarget, type RoleDefinition, type RoleKey, type RoleSpendCap, type RoleView, type SdkFailureObservation, type Session, type SignerStatus, type SignerStatusStore, type SmartAccount, type SmartAccountMethods, type StateLabel, type SubmittedPermissionExecution, type SystemHealth, type SystemMethods, type TargetReference, type TargetsMethods, type TelemetryPort, captureException, captureExceptionSync, createCapxulClient, deriveDevPrivateKey, devPrivateKeySigner, eip1193AccountProvider, embeddedSigner, fingerprintPaymentIntent, formatMoney, injectedWalletSigner, isCapxulError, isClaimed, isMoneyParseError, isRestoring, isSettingUpLifecycle, localPrivateKeyAccountProvider, openfortEmbeddedSigner, openfortEmbeddedSignerFromWallet, openfortEmbeddedWalletPort, parseMoney, postHogObservability, destination as resolveIdentityDestination, toCountryCode, toAddress as toEvmAddress };
206
+ export { type Account, type AccountId, type AccountLifecycle, type AccountMethods, type AccountProvider, type AccountProviderSource, type AccountRequirement, type AccountSetupStep, type AccountsMethods, type ActivityAnnotation, type ActivityAnnotationInput, type ActivityDetail, type ActivityFilter, type ActivityItem, type ActivityKind, type ActivityListParams, type ActivityMethods, type ActivityPage, type ActivityPhase, type ActivityRange, type ActivityReference, type ActivitySummary, type ActivitySummaryParams, type ActivitySummaryTotal, type ActorProfile, type ActorProfileMethods, type ActorRef, type ActorReference, type ActorRelationshipMethods, type ActorRequest, type ActorRequestIssueInput, type ActorRequestsMethods, type Address, type AddressBookAddInput, type AddressBookEntry, type AddressBookLabelInput, type AddressBookMethods, type AuthMethods, type AuthSession, type AuthUserId, type Budget, type BudgetId, CAPXUL_ERROR_CODES, CAPXUL_PAYMENTS_V2_ADDRESS, CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, type CapxulClient, type CapxulClientInput, type CapxulDigestSigner, CapxulError, type CapxulErrorCode, type CapxulErrorDetails, type CapxulResult, type CapxulSigner, type CountryCode, type CreateCapxulClientInput, type CreateOrgInput, type CurrentHoldings, type CurrentUserContext, type CurrentUserMethods, type DepositInstructions, type Destination, type DestinationAddInput, type DestinationKind, type DestinationListInput, type DestinationPayload, type DestinationRail, type DestinationRemoveInput, type DestinationsMethods, type DetectPendingOrgInvitationsResult, type DevPrivateKeySignerInput, type Eip1193Provider, type Eip1193RequestProvider, Errors, type FinancialOpsMethods, type HandledErrorReportContext, type HandlesMethods, type Holding, type HoldingsMethods, type HostObservability, type Destination$1 as IdentityDestination, type IdentityEvent, type IdentityMethods, type IdentityProfileDetails, type IdentityRuntime, type IdentityRuntimeSendResult, type IdentityState, type IdentityTransition, type InboxApproveInput, type InboxItem, type InboxMethods, type InviteMemberInput, type InvocationControls, type MeMethods, type MeProfile, type MediaMethods, type MemberStatus, type MemberView, type Money, type MoneyParseError, type MoneyParseErrorReason, type MovementActivityEvidence, type ObservationAdapter, type ObservationContext, type ObservationDelivery, type OfframpMethods, type OfframpQuote, type OfframpQuoteInput, type OfframpStatus, type OpenfortEmbeddedSignerInput, type OpenfortEmbeddedWalletApi, type OpenfortEmbeddedWalletPort, type OrgId, type OrgLane, type OrgLifecycle, type OrgMe, type OrgMeMethod, type OrgMeOptions, type OrgMethods, type OrgScopedMethods, type OrgSetupStep, type OrgTemplate, type OrgView, type OrganizationAccount, type OrganizationAuditLogItem, type OrganizationPaymentBatchInput, type OrganizationPaymentInput, type OrganizationPaymentItemInput, type OrganizationPaymentsMethods, PAYMENT_DIRECTIONS, PAYMENT_STATUSES, type PartyId, type Payee, type PayeesMethods, type Payment, type PaymentActivityEvidence, type PaymentDirection, type PaymentDocumentKind, type PaymentDocumentRef, type PaymentDocumentRender, type PaymentDocumentVerification, type PaymentDocumentsMethods, type PaymentMoney, type PaymentStatus, type PaymentTiming, type PaymentType, type PaymentsMethods, type PaymentsPayInput, type Permission, type PermissionAssignInput, type PermissionChangeInput, type PermissionCreateInput, type PermissionMethods, type PermissionOptions, type PermissionReadResult, type PermissionReplaceInput, type PermissionRevokeInput, type PostHogObservabilityClient, type PostHogObservabilityOptions, type Profile, type Readiness, type RecipientResolution, type RecipientResolutionKind, type Ref, type ResendInviteTokenInput, type ResolvedTarget, type RoleDefinition, type RoleKey, type RoleSpendCap, type RoleView, type SdkFailureObservation, type Session, type SignerStatus, type SignerStatusStore, type SmartAccount, type SmartAccountMethods, type StateLabel, type SubmittedPermissionExecution, type SystemHealth, type SystemMethods, type TargetReference, type TargetsMethods, type TelemetryPort, captureException, captureExceptionSync, createCapxulClient, deriveDevPrivateKey, devPrivateKeySigner, eip1193AccountProvider, embeddedSigner, fingerprintPaymentIntent, formatMoney, inboxPhase, injectedWalletSigner, isCapxulError, isClaimed, isMoneyParseError, isRestoring, isSettingUpLifecycle, localPrivateKeyAccountProvider, openfortEmbeddedSigner, openfortEmbeddedSignerFromWallet, openfortEmbeddedWalletPort, parseMoney, paymentPhase, postHogObservability, requestPhase, destination as resolveIdentityDestination, toCountryCode, toAddress as toEvmAddress };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { A as fingerprintPaymentIntent, B as formatTraceparent, C as ClockPortTag, D as AuthClientError, E as authClientPortFromPromiseAdapter, F as sanitizeObservationContext, G as signerFailure, H as readInvocationObservation, I as CAPXUL_FUNCTIONS, J as BASE_SEPOLIA_CHAIN_ID, K as CAPXUL_PAYMENTS_V2_ADDRESS, L as BootstrapEnvelope, M as fromWei, N as OBSERVATION_CONTEXT_HEADER, O as AuthClientPortTag, P as encodeObservationContextHeader, Q as isRestoring, R as EngineeringTelemetryBootstrapPolicy, S as ClockError, T as bootstrapErrorFromCapxul, U as causeChain, V as copyInvocationObservation, W as injectedWalletSigner, X as destination, Z as isClaimed, _ as wireChainId, a as observeFailedResult, b as ConvexCallPortTag, c as captureExceptionSync, d as TelemetryPortTag, g as accountReadErrorFromCapxul, h as AccountReadPortTag, i as observationContextProps, j as toWei, k as version, l as detectAuthCacheAdapter, m as smartAccountErrorFromCapxul, n as postHogProductTelemetry, o as postHogFailureObservation, p as SmartAccountPortTag, q as normalizeBindingEmail, r as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, s as captureException, t as assembleCapxulClient, u as PostHogTelemetryLayer, v as IdentityPortTag, w as BootstrapPortTag, x as convexCallErrorFromCapxul, y as identityErrorFromCapxul, z as isSettingUpLifecycle } from "./create-capxul-client-DTQDSOvO.mjs";
1
+ import { $ as isClaimed, A as fingerprintPaymentIntent, B as OBSERVATION_CONTEXT_HEADER, C as ClockPortTag, D as AuthClientError, E as authClientPortFromPromiseAdapter, F as copyInvocationObservation, G as CAPXUL_FUNCTIONS, H as sanitizeObservationContext, I as readInvocationObservation, J as CAPXUL_PAYMENTS_V2_ADDRESS, K as BootstrapEnvelope, L as causeChain, M as fromWei, N as isSettingUpLifecycle, O as AuthClientPortTag, P as formatTraceparent, Q as destination, R as injectedWalletSigner, S as ClockError, T as bootstrapErrorFromCapxul, U as PAYMENT_DIRECTIONS, V as encodeObservationContextHeader, W as PAYMENT_STATUSES, X as BASE_SEPOLIA_CHAIN_ID, Y as normalizeBindingEmail, _ as wireChainId, a as observeFailedResult, b as ConvexCallPortTag, c as captureExceptionSync, d as TelemetryPortTag, et as isRestoring, g as accountReadErrorFromCapxul, h as AccountReadPortTag, i as observationContextProps, j as toWei, k as version, l as detectAuthCacheAdapter, m as smartAccountErrorFromCapxul, n as postHogProductTelemetry, o as postHogFailureObservation, p as SmartAccountPortTag, q as EngineeringTelemetryBootstrapPolicy, r as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, s as captureException, t as assembleCapxulClient, u as PostHogTelemetryLayer, v as IdentityPortTag, w as BootstrapPortTag, x as convexCallErrorFromCapxul, y as identityErrorFromCapxul, z as signerFailure } from "./create-capxul-client-BrE6tLg6.mjs";
2
2
  import { C as toDurationMs, D as toJwtToken, E as toEpochSeconds, F as CAPXUL_ERROR_CODES, I as CapxulError, M as toRoleKey, N as toSessionToken, O as toKycTier, P as decodeConvexError, R as Errors, S as toCurrencyCode, T as toEpochMs, b as toChainId, g as toAllowedOrigin, h as toAddress, j as toPublishableKey, k as toOrgId, m as toAccountId, o as AuthCachePortTag, p as currencySymbolFor, v as toAuthUserId, w as toEmail, x as toCountryCode, z as isCapxulError } from "./InMemoryAuthCacheAdapter-qMpBOGb3.mjs";
3
3
  import { keccak256, recoverAddress, stringToHex } from "viem";
4
4
  import { Cause, Context, Data, Effect, Exit, Layer, Result, SchemaIssue, SchemaParser, Scope, Tracer } from "effect";
@@ -8,10 +8,92 @@ import { FetchHttpClient, Headers, HttpClient } from "effect/unstable/http";
8
8
  import { OtlpExporter, OtlpLogger, OtlpSerialization, OtlpTracer } from "effect/unstable/observability";
9
9
  import { ConvexClient } from "convex/browser";
10
10
  import { AccountTypeEnum, ChainTypeEnum, EmbeddedState, Openfort, RecoveryMethod, ThirdPartyOAuthProvider } from "@openfort/openfort-js";
11
+ //#region src/domain/activity/phase.ts
12
+ const PENDING = Object.freeze({
13
+ terminal: false,
14
+ outcome: null,
15
+ needsAction: false
16
+ });
17
+ const AWAITING_ACTOR = Object.freeze({
18
+ terminal: false,
19
+ outcome: null,
20
+ needsAction: true
21
+ });
22
+ const COMPLETED = Object.freeze({
23
+ terminal: true,
24
+ outcome: "good",
25
+ needsAction: false
26
+ });
27
+ const FAILED = Object.freeze({
28
+ terminal: true,
29
+ outcome: "bad",
30
+ needsAction: false
31
+ });
32
+ const WITHDRAWN = Object.freeze({
33
+ terminal: true,
34
+ outcome: "neutral",
35
+ needsAction: false
36
+ });
37
+ /**
38
+ * The `default` arm of each interpreter below.
39
+ *
40
+ * The `never` parameter keeps the compile-time guarantee: a status that you add
41
+ * to a wire vocabulary and do not add to a switch does not fit here, and the
42
+ * package does not build.
43
+ *
44
+ * The refusal covers run time. A wire status is a type claim about a string
45
+ * that no code narrows, so an unknown status can arrive. This function refuses
46
+ * it. It does not let an `undefined` typed `ActivityPhase` reach a screen,
47
+ * where the first property read fails.
48
+ */
49
+ function unknownStatus(status) {
50
+ throw Errors.invalidInput("status", "unknown activity status");
51
+ }
52
+ /** Interpret a Payment status. `pending_claim` waits for the actor who reads it. */
53
+ function paymentPhase(status) {
54
+ switch (status) {
55
+ case "pending":
56
+ case "settling":
57
+ case "scheduled":
58
+ case "streaming": return PENDING;
59
+ case "pending_claim": return AWAITING_ACTOR;
60
+ case "settled": return COMPLETED;
61
+ case "cancelled": return WITHDRAWN;
62
+ case "failed": return FAILED;
63
+ default: return unknownStatus(status);
64
+ }
65
+ }
66
+ /** Interpret a payment Request as its ISSUER sees it. An issuer does not wait for itself. */
67
+ function requestPhase(status) {
68
+ switch (status) {
69
+ case "draft":
70
+ case "sent":
71
+ case "viewed":
72
+ case "pending_settlement": return PENDING;
73
+ case "paid": return COMPLETED;
74
+ case "declined":
75
+ case "expired": return FAILED;
76
+ case "cancelled": return WITHDRAWN;
77
+ default: return unknownStatus(status);
78
+ }
79
+ }
80
+ /** Interpret the same request as its RECIPIENT sees it. `open` waits for the recipient. */
81
+ function inboxPhase(status) {
82
+ switch (status) {
83
+ case "open": return AWAITING_ACTOR;
84
+ case "approved": return PENDING;
85
+ case "paid": return COMPLETED;
86
+ case "declined":
87
+ case "expired": return FAILED;
88
+ case "cancelled": return WITHDRAWN;
89
+ default: return unknownStatus(status);
90
+ }
91
+ }
92
+ //#endregion
11
93
  //#region src/domain/money/format-money.ts
12
94
  function formatMoney(money, options = {}) {
13
95
  if (!Number.isInteger(money.decimals) || money.decimals < 0) throw Errors.invalidInput("money.decimals", "must be a non-negative integer");
14
- const symbol = currencySymbolFor(money.currency);
96
+ const symbol = currencySymbolFor(toCurrencyCode(money.currency));
15
97
  const maximumFractionDigits = options.grammar === "code" ? 4 : 2;
16
98
  const rounded = roundDecimal(money.value, money.decimals, maximumFractionDigits);
17
99
  const grouped = rounded.integer.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
@@ -334,6 +416,12 @@ async function recoverRawDigestSigner(input) {
334
416
  }
335
417
  //#endregion
336
418
  //#region ../observability/src/engineering.ts
419
+ const ENGINEERING_CAPXUL_ENVS = [
420
+ "development",
421
+ "staging",
422
+ "production",
423
+ "local"
424
+ ];
337
425
  const SAFE_TRACED_HEADER_NAMES = [
338
426
  "content-length",
339
427
  "content-type",
@@ -356,11 +444,7 @@ const postHogOtlpEndpoints = (host) => {
356
444
  traces: `${base}/i/v1/traces`
357
445
  };
358
446
  };
359
- const ENGINEERING_CAPXUL_ENVS = new Set([
360
- "development",
361
- "staging",
362
- "production"
363
- ]);
447
+ const ENGINEERING_CAPXUL_ENV_SET = new Set(ENGINEERING_CAPXUL_ENVS);
364
448
  const ENGINEERING_PRODUCERS = new Set(["browser", "server"]);
365
449
  const PUBLIC_POSTHOG_AUTHORIZATION = /^Bearer phc_[A-Za-z0-9_-]{1,191}$/u;
366
450
  const SAFE_RESOURCE_VALUE = /^[A-Za-z0-9][A-Za-z0-9._+@/-]{0,127}$/u;
@@ -372,7 +456,7 @@ const validateEngineeringTelemetryConfig = (config) => {
372
456
  throw new TypeError("engineering telemetry host must be an absolute HTTPS URL");
373
457
  }
374
458
  if (url.protocol !== "https:" || url.username.length > 0 || url.password.length > 0 || url.pathname !== "/" || url.search.length > 0 || url.hash.length > 0 || !(url.hostname === "posthog.com" || url.hostname.endsWith(".posthog.com"))) throw new TypeError("engineering telemetry host must be a credential-free HTTPS origin");
375
- if (!ENGINEERING_CAPXUL_ENVS.has(config.capxulEnv)) throw new TypeError("engineering telemetry capxulEnv is not canonical");
459
+ if (!ENGINEERING_CAPXUL_ENV_SET.has(config.capxulEnv)) throw new TypeError("engineering telemetry capxulEnv is not canonical");
376
460
  if (!ENGINEERING_PRODUCERS.has(config.producer)) throw new TypeError("engineering telemetry producer is not canonical");
377
461
  if (!SAFE_RESOURCE_VALUE.test(config.sdkVersion)) throw new TypeError("engineering telemetry sdkVersion must be a bounded safe value");
378
462
  if (config.serviceName !== void 0 && !SAFE_RESOURCE_VALUE.test(config.serviceName)) throw new TypeError("engineering telemetry serviceName must be a bounded safe value");
@@ -3069,4 +3153,4 @@ async function createCapxulClient(input) {
3069
3153
  return createCapxulClient$1(input);
3070
3154
  }
3071
3155
  //#endregion
3072
- export { CAPXUL_ERROR_CODES, CAPXUL_PAYMENTS_V2_ADDRESS, CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, CapxulError, Errors, captureException, captureExceptionSync, createCapxulClient, deriveDevPrivateKey, devPrivateKeySigner, eip1193AccountProvider, embeddedSigner, fingerprintPaymentIntent, formatMoney, injectedWalletSigner, isCapxulError, isClaimed, isMoneyParseError, isRestoring, isSettingUpLifecycle, localPrivateKeyAccountProvider, openfortEmbeddedSigner, openfortEmbeddedSignerFromWallet, openfortEmbeddedWalletPort, parseMoney, postHogObservability, destination as resolveIdentityDestination, toCountryCode, toAddress as toEvmAddress };
3156
+ export { CAPXUL_ERROR_CODES, CAPXUL_PAYMENTS_V2_ADDRESS, CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, CapxulError, Errors, PAYMENT_DIRECTIONS, PAYMENT_STATUSES, captureException, captureExceptionSync, createCapxulClient, deriveDevPrivateKey, devPrivateKeySigner, eip1193AccountProvider, embeddedSigner, fingerprintPaymentIntent, formatMoney, inboxPhase, injectedWalletSigner, isCapxulError, isClaimed, isMoneyParseError, isRestoring, isSettingUpLifecycle, localPrivateKeyAccountProvider, openfortEmbeddedSigner, openfortEmbeddedSignerFromWallet, openfortEmbeddedWalletPort, parseMoney, paymentPhase, postHogObservability, requestPhase, destination as resolveIdentityDestination, toCountryCode, toAddress as toEvmAddress };
@@ -1,4 +1,4 @@
1
- import { O as AuthSession, _ as AuthCacheError, b as CachedJwt, n as CapxulSigner, v as AuthCachePort, y as AuthCachePortTag } from "../signer-BejoR3bA.mjs";
1
+ import { O as AuthSession, _ as AuthCacheError, b as CachedJwt, n as CapxulSigner, v as AuthCachePort, y as AuthCachePortTag } from "../signer-BGTaqZqg.mjs";
2
2
  import { Hex } from "viem";
3
3
  import { Effect, FileSystem, Layer, Path } from "effect";
4
4
 
@@ -1,4 +1,4 @@
1
- import { A as BlockNumber, B as MovementId, C as Address$1, D as AppId, E as AnonymousDistinctId, F as DocumentHash, G as PermissionId, H as PartyId, I as DurationMs, J as RoleKey, K as Profile, L as Email, M as ChainId, N as CountryCode, O as AuthSession, P as CurrencyCode, Q as WeiAmount, R as EpochMs, T as AllowedOrigin, U as PaymentCommandId, V as OrgId, W as PermissionAssignmentId, X as SmartAccount, Y as SessionToken, Z as TxHash, a as SignerStatusStore, b as CachedJwt, c as AccountProviderSource, g as SmartAccount$1, h as Session$1, it as CapxulErrorDetails, j as BudgetId, k as AuthUserId, l as AccountRequirement, m as Profile$1, n as CapxulSigner, nt as CapxulError, ot as Failure, p as CapxulResult, q as PublishableKey, rt as CapxulErrorCode, st as FailureMode, v as AuthCachePort, w as AllowanceKey, x as Account$1, z as Money } from "./signer-BejoR3bA.mjs";
1
+ import { A as BlockNumber, B as OrgId, C as Address$1, D as AppId, E as AnonymousDistinctId, F as DocumentHash, G as Profile, H as PaymentCommandId, I as DurationMs, J as SessionToken, K as PublishableKey, L as Email, M as ChainId, N as CountryCode, O as AuthSession, P as CurrencyCode, R as EpochMs, T as AllowedOrigin, U as PermissionAssignmentId, V as PartyId, W as PermissionId, X as TxHash, Y as SmartAccount, Z as WeiAmount, a as SignerStatusStore, at as Failure, b as CachedJwt, c as AccountProviderSource, g as SmartAccount$1, h as Session$1, j as BudgetId, k as AuthUserId, l as AccountRequirement, m as Profile$1, n as CapxulSigner, nt as CapxulErrorCode, ot as FailureMode, p as CapxulResult, q as RoleKey, rt as CapxulErrorDetails, tt as CapxulError, v as AuthCachePort, w as AllowanceKey, x as Account$1, z as Money } from "./signer-BGTaqZqg.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";
@@ -359,7 +359,7 @@ type TelemetryEvent = {
359
359
  * a present `unknown` is loud), and sync v2 never synthesizes an artifact for
360
360
  * it.
361
361
  */
362
- declare const CAPXUL_ENVS: readonly ["development", "staging", "production", "unknown"];
362
+ declare const CAPXUL_ENVS: readonly ["development", "staging", "production", "unknown", "local"];
363
363
  type CapxulEnv = (typeof CAPXUL_ENVS)[number];
364
364
  interface TelemetryIdentifyInput {
365
365
  readonly distinctId: string;
@@ -377,7 +377,7 @@ interface TelemetryGroupInput {
377
377
  declare const EngineeringTelemetryBootstrapPolicy: Schema.Struct<{
378
378
  readonly host: Schema.refine<string, Schema.String>;
379
379
  readonly projectToken: Schema.refine<string, Schema.String>;
380
- readonly capxulEnv: Schema.Union<readonly [Schema.Literal<"development">, Schema.Literal<"staging">, Schema.Literal<"production">]>;
380
+ readonly capxulEnv: Schema.Union<readonly [Schema.Literal<"development">, Schema.Literal<"staging">, Schema.Literal<"production">, Schema.Literal<"local">]>;
381
381
  }>;
382
382
  type EngineeringTelemetryBootstrapPolicyV1 = Schema.Schema.Type<typeof EngineeringTelemetryBootstrapPolicy>;
383
383
  //#endregion
@@ -498,33 +498,19 @@ type AttachablePaymentDocumentEnvelopeV1 = Schema.Schema.Type<typeof AttachableP
498
498
  type LineItemV1 = Schema.Schema.Type<typeof LineItem>;
499
499
  //#endregion
500
500
  //#region ../wire/src/money.d.ts
501
- declare const MovementAnnotationSchema: Schema.Struct<{
502
- readonly movementId: Schema.Codec<MovementId, string, never, never>;
503
- readonly actor: Schema.Union<readonly [Schema.Struct<{
504
- readonly kind: Schema.Literal<"account">;
505
- readonly accountId: Schema.refine<string, Schema.String>;
506
- }>, Schema.Struct<{
507
- readonly kind: Schema.Literal<"organization">;
508
- readonly orgId: Schema.refine<string, Schema.String>;
509
- }>]>;
510
- readonly counterpartyLabel: Schema.optional<Schema.String>;
511
- readonly accountingCategory: Schema.optional<Schema.String>;
512
- readonly memo: Schema.optional<Schema.String>;
513
- readonly lastEditor: Schema.Union<readonly [Schema.Struct<{
514
- readonly kind: Schema.Literal<"account">;
515
- readonly accountId: Schema.refine<string, Schema.String>;
516
- }>, Schema.Struct<{
517
- readonly kind: Schema.Literal<"organization">;
518
- readonly orgId: Schema.refine<string, Schema.String>;
519
- }>]>;
520
- readonly updatedAt: Schema.refine<number, Schema.Number>;
521
- }>;
522
- type MovementAnnotation = Schema.Schema.Type<typeof MovementAnnotationSchema>;
501
+ declare const ActorRefSchema: Schema.Union<readonly [Schema.Struct<{
502
+ readonly kind: Schema.Literal<"account">;
503
+ readonly accountId: Schema.refine<string, Schema.String>;
504
+ }>, Schema.Struct<{
505
+ readonly kind: Schema.Literal<"organization">;
506
+ readonly orgId: Schema.refine<string, Schema.String>;
507
+ }>]>;
508
+ type ActorRef = Schema.Schema.Type<typeof ActorRefSchema>;
523
509
  declare const PermissionSchema: Schema.Struct<{
524
510
  readonly permissionId: Schema.Codec<PermissionId, string, never, never>;
525
511
  readonly orgId: Schema.refine<string, Schema.String>;
526
512
  readonly type: Schema.Literals<readonly ["budget", "managePeople"]>;
527
- readonly state: Schema.Literals<readonly ["pending", "active", "suspended", "revoked", "superseded", "quarantined"]>;
513
+ readonly state: Schema.Literals<readonly ["pending", "active", "suspended", "revoked", "superseded"]>;
528
514
  readonly revision: Schema.refine<number, Schema.Number>;
529
515
  readonly roleKey: Schema.Codec<RoleKey, string, never, never>;
530
516
  readonly tokenAddress: Schema.optional<Schema.Codec<Address$1, string, never, never>>;
@@ -542,7 +528,7 @@ declare const PermissionAssignmentSchema: Schema.Struct<{
542
528
  readonly kind: Schema.Literal<"organization">;
543
529
  readonly orgId: Schema.refine<string, Schema.String>;
544
530
  }>]>;
545
- readonly state: Schema.Literals<readonly ["pending", "active", "suspended", "revoked", "superseded", "quarantined"]>;
531
+ readonly state: Schema.Literals<readonly ["pending", "active", "suspended", "revoked", "superseded"]>;
546
532
  }>;
547
533
  type PermissionAssignment = Schema.Schema.Type<typeof PermissionAssignmentSchema>;
548
534
  declare const CurrentHoldingsSchema: Schema.Struct<{
@@ -598,7 +584,7 @@ declare const SubmittedPermissionExecutionSchema: Schema.Struct<{
598
584
  readonly permissionId: Schema.Codec<PermissionId, string, never, never>;
599
585
  readonly orgId: Schema.refine<string, Schema.String>;
600
586
  readonly type: Schema.Literals<readonly ["budget", "managePeople"]>;
601
- readonly state: Schema.Literals<readonly ["pending", "active", "suspended", "revoked", "superseded", "quarantined"]>;
587
+ readonly state: Schema.Literals<readonly ["pending", "active", "suspended", "revoked", "superseded"]>;
602
588
  readonly revision: Schema.refine<number, Schema.Number>;
603
589
  readonly roleKey: Schema.Codec<RoleKey, string, never, never>;
604
590
  readonly tokenAddress: Schema.optional<Schema.Codec<Address$1, string, never, never>>;
@@ -614,12 +600,12 @@ declare const SubmittedPermissionExecutionSchema: Schema.Struct<{
614
600
  readonly kind: Schema.Literal<"organization">;
615
601
  readonly orgId: Schema.refine<string, Schema.String>;
616
602
  }>]>;
617
- readonly state: Schema.Literals<readonly ["pending", "active", "suspended", "revoked", "superseded", "quarantined"]>;
603
+ readonly state: Schema.Literals<readonly ["pending", "active", "suspended", "revoked", "superseded"]>;
618
604
  }>, Schema.$Array<Schema.Struct<{
619
605
  readonly permissionId: Schema.Codec<PermissionId, string, never, never>;
620
606
  readonly orgId: Schema.refine<string, Schema.String>;
621
607
  readonly type: Schema.Literals<readonly ["budget", "managePeople"]>;
622
- readonly state: Schema.Literals<readonly ["pending", "active", "suspended", "revoked", "superseded", "quarantined"]>;
608
+ readonly state: Schema.Literals<readonly ["pending", "active", "suspended", "revoked", "superseded"]>;
623
609
  readonly revision: Schema.refine<number, Schema.Number>;
624
610
  readonly roleKey: Schema.Codec<RoleKey, string, never, never>;
625
611
  readonly tokenAddress: Schema.optional<Schema.Codec<Address$1, string, never, never>>;
@@ -1402,10 +1388,26 @@ interface DestinationsMethods {
1402
1388
  readonly id: string;
1403
1389
  }>>;
1404
1390
  }
1391
+ /** The one name for what an activity row IS. */
1392
+ type ActivityKind = "payment" | "movement";
1393
+ /** `createdAt` bounds in epoch milliseconds. Both ends are inclusive. */
1394
+ interface ActivityRange {
1395
+ readonly from?: number;
1396
+ readonly to?: number;
1397
+ }
1398
+ interface ActivityFilter {
1399
+ readonly kind?: ActivityKind;
1400
+ readonly direction?: PaymentDirection;
1401
+ /** Payment rows only. A status filter therefore excludes Movements, which have none. */
1402
+ readonly status?: readonly PaymentStatus[];
1403
+ }
1405
1404
  interface ActivityListParams {
1406
1405
  readonly actor?: ActorReference;
1407
1406
  readonly cursor?: string;
1407
+ /** 1..100, default 25. The backend rejects anything outside that band. */
1408
1408
  readonly limit?: number;
1409
+ readonly range?: ActivityRange;
1410
+ readonly filter?: ActivityFilter;
1409
1411
  }
1410
1412
  type ActivityReference = {
1411
1413
  readonly kind: "payment";
@@ -1419,7 +1421,8 @@ type ActivityItem = {
1419
1421
  readonly kind: "payment";
1420
1422
  readonly id: string;
1421
1423
  readonly ledgerKind: "Payment" | "Payout" | "Deposit";
1422
- readonly status: PaymentStatus;
1424
+ readonly status: PaymentStatus; /** What the payment is FOR. On the list row so a title needs no second read. */
1425
+ readonly paymentType: PaymentType;
1423
1426
  readonly amount: PaymentMoney;
1424
1427
  readonly direction: PaymentDirection;
1425
1428
  readonly counterpartyLabel: string;
@@ -1433,6 +1436,13 @@ type ActivityItem = {
1433
1436
  readonly kind: "movement";
1434
1437
  readonly id: string;
1435
1438
  readonly classification: "movement_only_outflow";
1439
+ readonly amount: PaymentMoney;
1440
+ readonly direction: PaymentDirection; /** Short-form counterparty address today. */
1441
+ readonly counterpartyLabel: string;
1442
+ readonly receipt: {
1443
+ readonly chainId: number;
1444
+ readonly transactionHash: string;
1445
+ };
1436
1446
  readonly createdAt: number;
1437
1447
  readonly updatedAt: number;
1438
1448
  };
@@ -1440,6 +1450,37 @@ interface ActivityPage {
1440
1450
  readonly items: readonly ActivityItem[];
1441
1451
  readonly cursor: string | null;
1442
1452
  readonly checkpoint: number;
1453
+ /** Server read time, so a consumer can say which of two reads is older. */
1454
+ readonly observedAt: number;
1455
+ }
1456
+ interface ActivitySummaryParams {
1457
+ readonly actor?: ActorReference;
1458
+ readonly window?: ActivityRange;
1459
+ }
1460
+ interface ActivitySummaryTotal {
1461
+ readonly currency: string;
1462
+ readonly decimals: number;
1463
+ /** Integer raw-unit strings. `net` is `in - out` and may be negative. */
1464
+ readonly in: string;
1465
+ readonly out: string;
1466
+ readonly net: string;
1467
+ /** The `in` share that is not yet terminal. */
1468
+ readonly pendingIn: string;
1469
+ }
1470
+ interface ActivitySummary {
1471
+ readonly window: {
1472
+ readonly from: number | null;
1473
+ readonly to: number | null;
1474
+ };
1475
+ /** One bucket per currency, and EMPTY when the window holds no activity. */
1476
+ readonly totals: readonly ActivitySummaryTotal[];
1477
+ /**
1478
+ * Every activity row in the window, whatever its direction or status. It
1479
+ * therefore counts rows that move no money into the totals — a payment the
1480
+ * actor sent to itself, and a cancelled one.
1481
+ */
1482
+ readonly count: number;
1483
+ readonly observedAt: number;
1443
1484
  }
1444
1485
  interface PaymentActivityEvidence {
1445
1486
  readonly chainId: 84532;
@@ -1478,19 +1519,35 @@ interface MovementActivityEvidence {
1478
1519
  readonly depositPaymentId: string | null;
1479
1520
  };
1480
1521
  }
1522
+ /**
1523
+ * The overlay one actor keeps over one activity row. `actor` and `lastEditor`
1524
+ * are the backend's own `ActorRef`, the same shape `MovementAnnotation` carried
1525
+ * before the overlay generalized past Movements.
1526
+ */
1527
+ interface ActivityAnnotation {
1528
+ readonly reference: ActivityReference;
1529
+ readonly actor: ActorRef;
1530
+ readonly counterpartyLabel?: string;
1531
+ readonly accountingCategory?: string;
1532
+ readonly memo?: string;
1533
+ readonly lastEditor: ActorRef;
1534
+ readonly updatedAt: number;
1535
+ }
1481
1536
  type ActivityDetail = {
1482
1537
  readonly kind: "payment";
1483
1538
  readonly payment: Payment;
1484
- readonly evidence: PaymentActivityEvidence;
1539
+ readonly annotation: ActivityAnnotation | null;
1540
+ readonly evidence: PaymentActivityEvidence | null;
1485
1541
  } | {
1486
1542
  readonly kind: "movement";
1487
1543
  readonly movementId: string;
1488
- readonly annotation: MovementAnnotation | null;
1544
+ readonly annotation: ActivityAnnotation | null;
1489
1545
  readonly evidence: MovementActivityEvidence;
1490
1546
  };
1491
1547
  interface ActivityAnnotationInput {
1492
1548
  readonly actor?: ActorReference;
1493
- readonly movementId: string;
1549
+ /** Any activity row, not only a Movement. */
1550
+ readonly reference: ActivityReference;
1494
1551
  readonly counterpartyLabel?: string;
1495
1552
  readonly accountingCategory?: string;
1496
1553
  readonly memo?: string;
@@ -1499,12 +1556,16 @@ interface ActivityMethods {
1499
1556
  list(params?: ActivityListParams, options?: {
1500
1557
  readonly signal?: AbortSignal;
1501
1558
  }): Promise<CapxulResult<ActivityPage>>;
1559
+ summary(params?: ActivitySummaryParams, options?: {
1560
+ readonly signal?: AbortSignal;
1561
+ }): Promise<CapxulResult<ActivitySummary>>;
1502
1562
  get(reference: ActivityReference, options?: {
1503
1563
  readonly signal?: AbortSignal;
1564
+ readonly actor?: ActorReference;
1504
1565
  }): Promise<CapxulResult<ActivityDetail | null>>;
1505
1566
  annotate(input: ActivityAnnotationInput, options?: {
1506
1567
  readonly signal?: AbortSignal;
1507
- }): Promise<CapxulResult<MovementAnnotation>>;
1568
+ }): Promise<CapxulResult<ActivityAnnotation>>;
1508
1569
  }
1509
1570
  interface OfframpQuoteInput {
1510
1571
  readonly actor?: ActorReference;
@@ -2253,6 +2314,19 @@ interface SystemMethods {
2253
2314
  }): Promise<CapxulResult<SystemHealth>>;
2254
2315
  }
2255
2316
  //#endregion
2317
+ //#region src/domain/money/primary-holding.d.ts
2318
+ /**
2319
+ * The one asset a screen shows when it can show only one. `symbol` is the
2320
+ * TOKEN symbol the chain reported (`"USDX"`); `available.currency` is the
2321
+ * consumer `CurrencyCode` that token stands for (`"USD"`). They are separate
2322
+ * fields because they are separate facts.
2323
+ */
2324
+ interface Holding {
2325
+ readonly id: string;
2326
+ readonly symbol: string;
2327
+ readonly available: Money;
2328
+ }
2329
+ //#endregion
2256
2330
  //#region src/surface/holdings.d.ts
2257
2331
  interface HoldingsMethods {
2258
2332
  current(input?: {
@@ -2260,6 +2334,17 @@ interface HoldingsMethods {
2260
2334
  }, options?: {
2261
2335
  readonly signal?: AbortSignal;
2262
2336
  }): Promise<CapxulResult<CurrentHoldings>>;
2337
+ /**
2338
+ * The designated display asset — the payable row holding the most money, or
2339
+ * `null` when the snapshot carries no renderable row. Reads the same
2340
+ * snapshot as `current` and picks from it; an empty answer is a value, not
2341
+ * an error.
2342
+ */
2343
+ primary(input?: {
2344
+ readonly actor?: ActorReference;
2345
+ }, options?: {
2346
+ readonly signal?: AbortSignal;
2347
+ }): Promise<CapxulResult<Holding | null>>;
2263
2348
  }
2264
2349
  //#endregion
2265
2350
  //#region src/surface/_shared/effect-actor-bridge.d.ts
@@ -2530,4 +2615,4 @@ interface ObservationAdapter {
2530
2615
  /** Stable PostHog event used for typed failures that are expected product outcomes. */
2531
2616
  declare const CAPXUL_SDK_EXPECTED_OUTCOME_EVENT = "capxul_sdk_expected_outcome";
2532
2617
  //#endregion
2533
- export { AccountMethods as $, RecipientResolution as $t, OrganizationAccount as A, isClaimed as An, FinancialOpsMethods as At, PermissionAssignInput as B, Payment as Bt, InviteMemberInput as C, Destination$1 as Cn, DestinationAddInput as Ct, OrgScopedMethods as D, Readiness as Dn, DestinationRail as Dt, OrgMethods as E, OrgLane as En, DestinationPayload as Et, RoleView as F, OfframpQuote as Ft, PermissionReplaceInput as G, PaymentDocumentVerification as Gt, PermissionCreateInput as H, PaymentDocumentKind as Ht, OrganizationPaymentBatchInput as I, OfframpQuoteInput as It, Budget as J, PaymentStatus as Jt, PermissionRevokeInput as K, PaymentDocumentsMethods as Kt, OrganizationPaymentInput as L, OfframpStatus as Lt, ResendInviteTokenInput as M, IdentityTransition as Mn, MeMethods as Mt, RoleDefinition as N, InvocationControls as Nn, MeProfile as Nt, OrgTemplate as O, StateLabel as On, DestinationRemoveInput as Ot, RoleSpendCap as P, OfframpMethods as Pt, AccountsMethods as Q, PaymentsPayInput as Qt, OrganizationPaymentItemInput as R, Payee as Rt, DetectPendingOrgInvitationsResult as S, CAPXUL_PAYMENTS_V2_ADDRESS as Sn, Destination as St, MemberView as T, IdentityState as Tn, DestinationListInput as Tt, PermissionMethods as U, PaymentDocumentRef as Ut, PermissionChangeInput as V, PaymentDirection as Vt, PermissionOptions as W, PaymentDocumentRender as Wt, OrgMeMethod as X, PaymentType as Xt, OrgMe as Y, PaymentTiming as Yt, OrgMeOptions as Z, PaymentsMethods as Zt, SystemHealth as _, SubmittedPermissionExecution as _n, ActivityMethods as _t, SdkFailureObservation as a, fingerprintPaymentIntent as an, ActorRequestsMethods as at, CurrentUserMethods as b, TelemetryIdentifyInput as bn, ActorReference as bt, PostHogObservabilityOptions as c, isSettingUpLifecycle as cn, AddressBookLabelInput as ct, CreateCapxulClientInput as d, AuthMethods as dn, InboxItem as dt, RecipientResolutionKind as en, ActorProfile as et, IdentityProfileDetails as f, OrgLifecycle as fn, InboxMethods as ft, SystemMethods as g, Permission as gn, ActivityListParams as gt, HoldingsMethods as h, MovementAnnotation as hn, ActivityItem as ht, ObservationDelivery as i, TargetsMethods as in, ActorRequestIssueInput as it, OrganizationAuditLogItem as j, isRestoring as jn, HandlesMethods as jt, OrgView as k, destination as kn, DestinationsMethods as kt, postHogObservability as l, IdentityMethods as ln, AddressBookMethods as lt, IdentityRuntimeSendResult as m, CurrentHoldings as mn, ActivityDetail as mt, ObservationAdapter as n, ResolvedTarget as nn, ActorRelationshipMethods as nt, HostObservability as o, AccountLifecycle as on, AddressBookAddInput as ot, IdentityRuntime as p, OrgSetupStep as pn, ActivityAnnotationInput as pt, PermissionReadResult as q, PaymentMoney as qt, ObservationContext as r, TargetReference as rn, ActorRequest as rt, PostHogObservabilityClient as s, AccountSetupStep as sn, AddressBookEntry as st, CAPXUL_SDK_EXPECTED_OUTCOME_EVENT as t, Ref$1 as tn, ActorProfileMethods as tt, CapxulClient as u, SmartAccountMethods as un, InboxApproveInput as ut, MediaMethods as v, TelemetryEvent as vn, ActivityPage as vt, MemberStatus as w, IdentityEvent as wn, DestinationKind as wt, CreateOrgInput as x, TelemetryPort as xn, DepositInstructions as xt, CurrentUserContext as y, TelemetryGroupInput as yn, ActivityReference as yt, OrganizationPaymentsMethods as z, PayeesMethods as zt };
2618
+ export { AccountsMethods as $, PaymentDocumentRef as $t, OrgView as A, PAYMENT_STATUSES as An, Destination as At, OrganizationPaymentsMethods as B, IdentityState as Bn, MeMethods as Bt, DetectPendingOrgInvitationsResult as C, OrgSetupStep as Cn, ActivityRange as Ct, OrgMethods as D, SubmittedPermissionExecution as Dn, ActivitySummaryTotal as Dt, MemberView as E, Permission as En, ActivitySummaryParams as Et, RoleSpendCap as F, TelemetryIdentifyInput as Fn, DestinationRail as Ft, PermissionOptions as G, isClaimed as Gn, OfframpQuoteInput as Gt, PermissionChangeInput as H, Readiness as Hn, MovementActivityEvidence as Ht, RoleView as I, TelemetryPort as In, DestinationRemoveInput as It, PermissionReadResult as J, InvocationControls as Jn, PayeesMethods as Jt, PermissionReplaceInput as K, isRestoring as Kn, OfframpStatus as Kt, OrganizationPaymentBatchInput as L, CAPXUL_PAYMENTS_V2_ADDRESS as Ln, DestinationsMethods as Lt, OrganizationAuditLogItem as M, RequestStatus as Mn, DestinationKind as Mt, ResendInviteTokenInput as N, TelemetryEvent as Nn, DestinationListInput as Nt, OrgScopedMethods as O, InboxStatus as On, ActorReference as Ot, RoleDefinition as P, TelemetryGroupInput as Pn, DestinationPayload as Pt, OrgMeOptions as Q, PaymentDocumentKind as Qt, OrganizationPaymentInput as R, Destination$1 as Rn, FinancialOpsMethods as Rt, CreateOrgInput as S, OrgLifecycle as Sn, ActivityPage as St, MemberStatus as T, CurrentHoldings as Tn, ActivitySummary as Tt, PermissionCreateInput as U, StateLabel as Un, OfframpMethods as Ut, PermissionAssignInput as V, OrgLane as Vn, MeProfile as Vt, PermissionMethods as W, destination as Wn, OfframpQuote as Wt, OrgMe as X, PaymentActivityEvidence as Xt, Budget as Y, Payment as Yt, OrgMeMethod as Z, PaymentDirection as Zt, SystemMethods as _, AccountSetupStep as _n, ActivityFilter as _t, SdkFailureObservation as a, PaymentTiming as an, ActorRequestIssueInput as at, CurrentUserContext as b, SmartAccountMethods as bn, ActivityListParams as bt, PostHogObservabilityOptions as c, PaymentsPayInput as cn, AddressBookEntry as ct, CreateCapxulClientInput as d, Ref$1 as dn, InboxApproveInput as dt, PaymentDocumentRender as en, AccountMethods as et, IdentityProfileDetails as f, ResolvedTarget as fn, InboxItem as ft, Holding as g, AccountLifecycle as gn, ActivityDetail as gt, HoldingsMethods as h, fingerprintPaymentIntent as hn, ActivityAnnotationInput as ht, ObservationDelivery as i, PaymentStatus as in, ActorRequest as it, OrganizationAccount as j, PaymentStatus$1 as jn, DestinationAddInput as jt, OrgTemplate as k, PAYMENT_DIRECTIONS as kn, DepositInstructions as kt, postHogObservability as l, RecipientResolution as ln, AddressBookLabelInput as lt, IdentityRuntimeSendResult as m, TargetsMethods as mn, ActivityAnnotation as mt, ObservationAdapter as n, PaymentDocumentsMethods as nn, ActorProfileMethods as nt, HostObservability as o, PaymentType as on, ActorRequestsMethods as ot, IdentityRuntime as p, TargetReference as pn, InboxMethods as pt, PermissionRevokeInput as q, IdentityTransition as qn, Payee as qt, ObservationContext as r, PaymentMoney as rn, ActorRelationshipMethods as rt, PostHogObservabilityClient as s, PaymentsMethods as sn, AddressBookAddInput as st, CAPXUL_SDK_EXPECTED_OUTCOME_EVENT as t, PaymentDocumentVerification as tn, ActorProfile as tt, CapxulClient as u, RecipientResolutionKind as un, AddressBookMethods as ut, SystemHealth as v, isSettingUpLifecycle as vn, ActivityItem as vt, InviteMemberInput as w, ActorRef as wn, ActivityReference as wt, CurrentUserMethods as x, AuthMethods as xn, ActivityMethods as xt, MediaMethods as y, IdentityMethods as yn, ActivityKind as yt, OrganizationPaymentItemInput as z, IdentityEvent as zn, HandlesMethods as zt };
@@ -192,7 +192,6 @@ type AuthUserId = Brand<string, "AuthUserId">;
192
192
  type AnonymousDistinctId = Brand<string, "AnonymousDistinctId">;
193
193
  type AccountId = Brand<string, "AccountId">;
194
194
  type PartyId = Brand<string, "PartyId">;
195
- type MovementId = Brand<string, "MovementId">;
196
195
  type PermissionId = Brand<string, "PermissionId">;
197
196
  type PermissionAssignmentId = Brand<string, "PermissionAssignmentId">;
198
197
  type BudgetId = Brand<string, "BudgetId">;
@@ -407,4 +406,4 @@ interface Eip1193RequestProvider {
407
406
  */
408
407
  declare function injectedWalletSigner(provider: Eip1193RequestProvider): CapxulSigner;
409
408
  //#endregion
410
- export { toAddress as $, BlockNumber as A, MovementId as B, Address$1 as C, AppId as D, AnonymousDistinctId as E, DocumentHash as F, PermissionId as G, PartyId as H, DurationMs as I, RoleKey as J, Profile$1 as K, Email as L, ChainId as M, CountryCode as N, AuthSession as O, CurrencyCode as P, WeiAmount as Q, EpochMs as R, AccountId as S, AllowedOrigin as T, PaymentCommandId as U, OrgId as V, PermissionAssignmentId as W, SmartAccount$1 as X, SessionToken as Y, TxHash as Z, AuthCacheError as _, SignerStatusStore as a, Errors as at, CachedJwt as b, AccountProviderSource as c, isCapxulError as ct, eip1193AccountProvider as d, toCountryCode as et, localPrivateKeyAccountProvider as f, SmartAccount as g, Session as h, SignerStatus as i, CapxulErrorDetails as it, BudgetId as j, AuthUserId as k, AccountRequirement as l, Profile as m, CapxulSigner as n, CapxulError as nt, injectedWalletSigner as o, Failure as ot, CapxulResult as p, PublishableKey as q, Eip1193RequestProvider as r, CapxulErrorCode as rt, AccountProvider as s, FailureMode as st, CapxulDigestSigner as t, CAPXUL_ERROR_CODES as tt, Eip1193Provider as u, AuthCachePort as v, AllowanceKey as w, Account$1 as x, AuthCachePortTag as y, Money as z };
409
+ export { toCountryCode as $, BlockNumber as A, OrgId as B, Address$1 as C, AppId as D, AnonymousDistinctId as E, DocumentHash as F, Profile$1 as G, PaymentCommandId as H, DurationMs as I, SessionToken as J, PublishableKey as K, Email as L, ChainId as M, CountryCode as N, AuthSession as O, CurrencyCode as P, toAddress as Q, EpochMs as R, AccountId as S, AllowedOrigin as T, PermissionAssignmentId as U, PartyId as V, PermissionId as W, TxHash as X, SmartAccount$1 as Y, WeiAmount as Z, AuthCacheError as _, SignerStatusStore as a, Failure as at, CachedJwt as b, AccountProviderSource as c, eip1193AccountProvider as d, CAPXUL_ERROR_CODES as et, localPrivateKeyAccountProvider as f, SmartAccount as g, Session as h, SignerStatus as i, Errors as it, BudgetId as j, AuthUserId as k, AccountRequirement as l, Profile as m, CapxulSigner as n, CapxulErrorCode as nt, injectedWalletSigner as o, FailureMode as ot, CapxulResult as p, RoleKey as q, Eip1193RequestProvider as r, CapxulErrorDetails as rt, AccountProvider as s, isCapxulError as st, CapxulDigestSigner as t, CapxulError as tt, Eip1193Provider as u, AuthCachePort as v, AllowanceKey as w, Account$1 as x, AuthCachePortTag as y, Money as z };
@@ -1,4 +1,4 @@
1
- import { Mn as IdentityTransition, bn as TelemetryIdentifyInput, n as ObservationAdapter, u as CapxulClient, vn as TelemetryEvent, yn as TelemetryGroupInput } from "../observation-Ci8gIQjm.mjs";
1
+ import { Fn as TelemetryIdentifyInput, Nn as TelemetryEvent, Pn as TelemetryGroupInput, n as ObservationAdapter, qn as IdentityTransition, u as CapxulClient } from "../observation-BfCkJY5z.mjs";
2
2
  import { Effect, Layer } from "effect";
3
3
 
4
4
  //#region src/testing/telemetry/RecordingTelemetryAdapter.d.ts
@@ -1,4 +1,4 @@
1
- import { E as authClientPortFromPromiseAdapter, M as fromWei, T as bootstrapErrorFromCapxul, Y as deriveCapxulSafeAddress, _ 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-DTQDSOvO.mjs";
1
+ import { E as authClientPortFromPromiseAdapter, M as fromWei, T as bootstrapErrorFromCapxul, Z as deriveCapxulSafeAddress, _ 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-BrE6tLg6.mjs";
2
2
  import { C as toDurationMs, D as toJwtToken, E as toEpochSeconds, I as CapxulError, N as toSessionToken, O as toKycTier, R as Errors, T as toEpochMs, _ as toAppId, b as toChainId, g as toAllowedOrigin, h as toAddress, j as toPublishableKey, m as toAccountId, t as InMemoryAuthCacheAdapter, v as toAuthUserId, w as toEmail, x as toCountryCode } from "../InMemoryAuthCacheAdapter-qMpBOGb3.mjs";
3
3
  import { keccak256 } from "viem";
4
4
  import { Effect, Result, Semaphore } from "effect";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capxul/sdk",
3
- "version": "2.3.1",
3
+ "version": "2.4.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/types": "0.2.0",
52
- "@capxul/wire": "0.4.0",
53
- "@capxul/observability": "2.3.1",
54
- "@capxul/typescript-config": "0.0.0"
51
+ "@capxul/typescript-config": "0.0.0",
52
+ "@capxul/wire": "0.5.0",
53
+ "@capxul/observability": "2.4.0",
54
+ "@capxul/types": "0.2.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": {