@capxul/sdk 4.1.0 → 4.1.2

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.
@@ -1306,7 +1306,20 @@ const QuickPayExternalAddressAcknowledgedProps = Schema.Struct({
1306
1306
  external_address_acknowledged: Schema.Literal(true),
1307
1307
  organization_id: OptionalOrgId
1308
1308
  });
1309
- const DepositInitiatedProps = Schema.Struct({ ...TelemetryEnvelopeProps });
1309
+ const DepositInitiatedProps = Schema.Struct({
1310
+ ...TelemetryEnvelopeProps,
1311
+ scope_kind: Schema.optional(Schema.Literals(["account", "organization"])),
1312
+ account_kind: Schema.optional(Schema.Literals(["personalSafe", "orgTreasury"])),
1313
+ chain_id: Schema.optional(Schema.Number),
1314
+ network: Schema.optional(Schema.Literal("base-sepolia")),
1315
+ organization_id: OptionalOrgId,
1316
+ $groups: Schema.optional(Schema.Struct({ organization: OptionalOrgId })),
1317
+ actor_id: OptionalString,
1318
+ actor_kind: Schema.optional(Schema.Literal("authenticated")),
1319
+ distinct_id: OptionalString,
1320
+ trace_id: OptionalString,
1321
+ span_id: OptionalString
1322
+ });
1310
1323
  const DepositSettledProps = Schema.Struct({
1311
1324
  ...TelemetryEnvelopeProps,
1312
1325
  chain_id: Schema.Number,
@@ -4325,6 +4338,23 @@ function observationOnlyControls(controls) {
4325
4338
  const { signal: _signal, timeoutMs: _timeoutMs, deadlineMs: _deadlineMs, ...observation } = controls ?? {};
4326
4339
  return copyInvocationObservation(controls, observation);
4327
4340
  }
4341
+ /** Project only SDK-owned facts. A caller Organization hint is not authority. */
4342
+ function verifiedOperationFields(attributes) {
4343
+ const domain = {};
4344
+ const organizationId = attributes.get("verified_organization_id");
4345
+ if (typeof organizationId === "string" && safeEngineeringIdentifier(organizationId) !== void 0) domain.organization_id = organizationId;
4346
+ for (const [key, allowed] of [
4347
+ ["scope_kind", ["account", "organization"]],
4348
+ ["account_kind", ["personalSafe", "orgTreasury"]],
4349
+ ["network", ["base-sepolia"]]
4350
+ ]) {
4351
+ const value = attributes.get(key);
4352
+ if (typeof value === "string" && allowed.some((candidate) => candidate === value)) domain[key] = value;
4353
+ }
4354
+ const chainId = attributes.get("chain_id");
4355
+ if (typeof chainId === "number" && Number.isSafeInteger(chainId) && chainId > 0) domain.chain_id = chainId;
4356
+ return domain;
4357
+ }
4328
4358
  /** Observe a public Effect that already uses the canonical CapxulError channel. */
4329
4359
  async function runCapxulEffect(effect, controls, operation = CAPXUL_OPERATIONS.runtime.port, runPromise = Effect.runPromise) {
4330
4360
  const invocation = readInvocationObservation(controls);
@@ -4353,8 +4383,10 @@ async function runCapxulEffect(effect, controls, operation = CAPXUL_OPERATIONS.r
4353
4383
  const error = Exit.isFailure(exit) ? Cause.squash(exit.cause) : void 0;
4354
4384
  const failure = error instanceof CapxulError ? error : void 0;
4355
4385
  const outcome = Exit.isSuccess(exit) ? "succeeded" : failure?.code === "CANCELLED" ? "cancelled" : failure !== void 0 && EXPECTED_OPERATION_OUTCOMES.has(failure.code) ? "refused" : "failed";
4386
+ const span = yield* Effect.currentSpan.pipe(Effect.orDie);
4356
4387
  const completion = {
4357
4388
  ...fields,
4389
+ ...verifiedOperationFields(span.attributes),
4358
4390
  duration_ms,
4359
4391
  outcome,
4360
4392
  ...failure === void 0 ? {} : { failure_code: failure.code },
@@ -5187,7 +5219,7 @@ const moneyExecutionContract = {
5187
5219
  };
5188
5220
  //#endregion
5189
5221
  //#region package.json
5190
- var version = "4.1.0";
5222
+ var version = "4.1.2";
5191
5223
  //#endregion
5192
5224
  //#region src/telemetry/exception-projection.ts
5193
5225
  /** Fixed fallback for failures that have no safe message. */
@@ -5898,11 +5930,50 @@ function emitAccountBalanceFailed(telemetry, error) {
5898
5930
  }
5899
5931
  });
5900
5932
  }
5901
- function emitDepositInitiated(telemetry) {
5902
- return emitMoneyTelemetry(telemetry, {
5903
- name: "deposit_initiated",
5904
- props: {}
5905
- });
5933
+ /** A successful authorized instruction read, not an incoming transfer. */
5934
+ function emitDepositInitiated(telemetry, instructions, source, verifiedOrganizationId) {
5935
+ return Effect.gen(function* () {
5936
+ const organizationId = safeEngineeringIdentifier(verifiedOrganizationId);
5937
+ const fields = {
5938
+ scope_kind: organizationId === void 0 ? "account" : "organization",
5939
+ account_kind: organizationId === void 0 ? "personalSafe" : "orgTreasury",
5940
+ ...Number.isSafeInteger(instructions.chainId) && instructions.chainId > 0 ? { chain_id: instructions.chainId } : {},
5941
+ ...instructions.network === "base-sepolia" ? { network: instructions.network } : {},
5942
+ ...organizationId === void 0 ? {} : { verified_organization_id: organizationId }
5943
+ };
5944
+ yield* Effect.annotateCurrentSpan(fields);
5945
+ if (telemetry === void 0) return;
5946
+ const span = yield* Effect.currentSpan;
5947
+ const snapshot = readInvocationObservation(source);
5948
+ const { organizationId: _hint, ...context } = snapshot?.context ?? {};
5949
+ const event = {
5950
+ name: "deposit_initiated",
5951
+ props: {
5952
+ scope_kind: fields.scope_kind,
5953
+ account_kind: fields.account_kind,
5954
+ ...fields.chain_id === void 0 ? {} : { chain_id: fields.chain_id },
5955
+ ...fields.network === void 0 ? {} : { network: fields.network },
5956
+ $groups: organizationId === void 0 ? {} : { organization: organizationId },
5957
+ ...safeEngineeringIdentifier(snapshot?.actorId) === void 0 ? {} : {
5958
+ actor_id: snapshot.actorId,
5959
+ actor_kind: "authenticated",
5960
+ distinct_id: snapshot.actorId
5961
+ },
5962
+ trace_id: span.traceId,
5963
+ span_id: span.spanId,
5964
+ ...organizationId === void 0 ? {} : { organization_id: organizationId }
5965
+ }
5966
+ };
5967
+ yield* telemetry.emit(snapshot === void 0 ? event : attachInvocationObservation(event, {
5968
+ active: snapshot.active,
5969
+ ...snapshot?.actorId === void 0 ? {} : { actorId: snapshot.actorId },
5970
+ context: {
5971
+ ...context,
5972
+ ...organizationId === void 0 ? {} : { organizationId },
5973
+ traceparent: `00-${span.traceId}-${span.spanId}-01`
5974
+ }
5975
+ }));
5976
+ }).pipe(Effect.catchCause(() => Effect.void));
5906
5977
  }
5907
5978
  function emitPaymentInitiated(telemetry, input) {
5908
5979
  return emitMoneyTelemetry(telemetry, {
@@ -6518,7 +6589,10 @@ function makeFinancialOpsMethods(deps) {
6518
6589
  return {
6519
6590
  me: {
6520
6591
  get: (options) => runIfActive(options?.signal, CAPXUL_OPERATIONS.me.get, () => deps.convexCall.query(fns.me, {})),
6521
- depositInstructions: (options) => runIfActive(options?.signal, CAPXUL_OPERATIONS.me.depositInstructions, () => deps.convexCall.query(fns.depositInstructions, {}).pipe(Effect.tap(() => Effect.promise(() => emitDepositInitiated(deps.telemetry)))))
6592
+ depositInstructions: (options) => {
6593
+ const controls = deps.invocationControls?.(options) ?? options;
6594
+ return runPortEffect(Effect.suspend(() => deps.convexCall.query(fns.depositInstructions, copyInvocationObservation(controls, {}))).pipe(Effect.tap((instructions) => emitDepositInitiated(deps.telemetry, instructions, controls))), controls, CAPXUL_OPERATIONS.me.depositInstructions, deps.runPromise);
6595
+ }
6522
6596
  },
6523
6597
  targets: { resolve: async (reference, options) => {
6524
6598
  const recipient = normalizeTargetForBackend(reference, "reference");
@@ -6526,43 +6600,57 @@ function makeFinancialOpsMethods(deps) {
6526
6600
  return mapOk(await runIfActive(options?.signal, CAPXUL_OPERATIONS.recipient.resolve, () => deps.convexCall.query(fns.resolveRecipient, { recipient: recipient.value })), resolvedTargetFromResolution);
6527
6601
  } },
6528
6602
  destinations: {
6529
- add: async (input, options) => {
6530
- const scope = normalizeDestinationInputScope(input, "target");
6531
- if (!scope.ok) return {
6532
- ok: false,
6533
- error: scope.error
6534
- };
6535
- const scopeValue = scope.value;
6536
- if (scopeValue === void 0) return {
6537
- ok: false,
6538
- error: Errors.invalidInput("target", DESTINATION_SCOPE_MESSAGE)
6603
+ add: (input, options) => {
6604
+ const controls = deps.invocationControls?.(options) ?? options;
6605
+ const actor = actorReferenceToBackend(input.actor);
6606
+ const verifiedScope = {
6607
+ scope_kind: actor?.kind === "org" ? "organization" : "account",
6608
+ ...actor?.kind === "org" ? { verified_organization_id: actor.orgId } : {}
6539
6609
  };
6540
- const backendActor = actorReferenceToBackend(input.actor);
6541
- return mapOk(await runIfActive(options?.signal, CAPXUL_OPERATIONS.destinations.add, () => deps.convexCall.mutation(fns.addDestination, {
6542
- ...backendActor === void 0 ? {} : { actor: backendActor },
6543
- ...isSelfTarget(scopeValue) ? { self: true } : { ref: scopeValue },
6544
- kind: destinationKindToBackend(input.kind),
6545
- ...input.label === void 0 ? {} : { label: input.label },
6546
- payload: input.payload
6547
- })), destinationFromBackend);
6610
+ return runPortEffect(Effect.suspend(() => {
6611
+ const scope = normalizeDestinationInputScope(input, "target");
6612
+ if (!scope.ok) return Effect.fail({ publicError: scope.error });
6613
+ const scopeValue = scope.value;
6614
+ if (scopeValue === void 0) return Effect.fail({ publicError: Errors.invalidInput("target", DESTINATION_SCOPE_MESSAGE) });
6615
+ return deps.convexCall.mutation(fns.addDestination, copyInvocationObservation(controls, {
6616
+ ...actor === void 0 ? {} : { actor },
6617
+ ...isSelfTarget(scopeValue) ? { self: true } : { ref: scopeValue },
6618
+ kind: destinationKindToBackend(input.kind),
6619
+ ...input.label === void 0 ? {} : { label: input.label },
6620
+ payload: input.payload
6621
+ })).pipe(Effect.map(destinationFromBackend), Effect.tap(() => Effect.annotateCurrentSpan(verifiedScope)));
6622
+ }), controls, CAPXUL_OPERATIONS.destinations.add, deps.runPromise);
6548
6623
  },
6549
- list: async (input, options) => {
6550
- const scope = normalizeDestinationInputScope(input, "target");
6551
- if (!scope.ok) return {
6552
- ok: false,
6553
- error: scope.error
6624
+ list: (input, options) => {
6625
+ const controls = deps.invocationControls?.(options) ?? options;
6626
+ const actor = actorReferenceToBackend(input.actor);
6627
+ const verifiedScope = {
6628
+ scope_kind: actor?.kind === "org" ? "organization" : "account",
6629
+ ...actor?.kind === "org" ? { verified_organization_id: actor.orgId } : {}
6554
6630
  };
6555
- const scopeValue = scope.value;
6556
- return mapOk(await runIfActive(options?.signal, CAPXUL_OPERATIONS.destinations.list, () => deps.convexCall.query(fns.listDestinations, {
6557
- ...input.actor === void 0 ? {} : { actor: actorReferenceToBackend(input.actor) },
6558
- ...scopeValue !== void 0 && isSelfTarget(scopeValue) ? { self: true } : {},
6559
- ...scopeValue !== void 0 && !isSelfTarget(scopeValue) ? { ref: scopeValue } : {}
6560
- })), (destinations) => destinations.map(destinationFromBackend).filter((destination) => input.kind === void 0 || destination.kind === input.kind));
6631
+ return runPortEffect(Effect.suspend(() => {
6632
+ const scope = normalizeDestinationInputScope(input, "target");
6633
+ if (!scope.ok) return Effect.fail({ publicError: scope.error });
6634
+ const scopeValue = scope.value;
6635
+ return deps.convexCall.query(fns.listDestinations, copyInvocationObservation(controls, {
6636
+ ...actor === void 0 ? {} : { actor },
6637
+ ...scopeValue !== void 0 && isSelfTarget(scopeValue) ? { self: true } : {},
6638
+ ...scopeValue !== void 0 && !isSelfTarget(scopeValue) ? { ref: scopeValue } : {}
6639
+ })).pipe(Effect.map((destinations) => destinations.map(destinationFromBackend).filter((destination) => input.kind === void 0 || destination.kind === input.kind)), Effect.tap(() => Effect.annotateCurrentSpan(verifiedScope)));
6640
+ }), controls, CAPXUL_OPERATIONS.destinations.list, deps.runPromise);
6561
6641
  },
6562
- remove: (input, options) => runIfActive(options?.signal, CAPXUL_OPERATIONS.destinations.remove, () => deps.convexCall.mutation(fns.removeDestination, {
6563
- ...input.actor === void 0 ? {} : { actor: actorReferenceToBackend(input.actor) },
6564
- destinationId: input.destinationId
6565
- }))
6642
+ remove: (input, options) => {
6643
+ const controls = deps.invocationControls?.(options) ?? options;
6644
+ const actor = actorReferenceToBackend(input.actor);
6645
+ const verifiedScope = {
6646
+ scope_kind: actor?.kind === "org" ? "organization" : "account",
6647
+ ...actor?.kind === "org" ? { verified_organization_id: actor.orgId } : {}
6648
+ };
6649
+ return runPortEffect(Effect.suspend(() => deps.convexCall.mutation(fns.removeDestination, copyInvocationObservation(controls, {
6650
+ ...actor === void 0 ? {} : { actor },
6651
+ destinationId: input.destinationId
6652
+ })).pipe(Effect.tap(() => Effect.annotateCurrentSpan(verifiedScope)))), controls, CAPXUL_OPERATIONS.destinations.remove, deps.runPromise);
6653
+ }
6566
6654
  },
6567
6655
  payments: {
6568
6656
  pay,
@@ -9170,7 +9258,7 @@ function readOrgDepositInstructionsProgram(orgId) {
9170
9258
  const deps = yield* OrgDepsTag;
9171
9259
  const org = findOrgById(yield* listOrgsProgram(), orgId);
9172
9260
  if (org === void 0) return yield* Effect.fail(orgNotFound(orgId));
9173
- return {
9261
+ const instructions = {
9174
9262
  accountKind: "orgTreasury",
9175
9263
  chainId: Number(deps.chainId ?? 84532),
9176
9264
  network: "base-sepolia",
@@ -9178,6 +9266,8 @@ function readOrgDepositInstructionsProgram(orgId) {
9178
9266
  address: String(org.safeAddress).toLowerCase(),
9179
9267
  label: "Capxul org treasury"
9180
9268
  };
9269
+ yield* emitDepositInitiated(deps.telemetry, instructions, deps.invocationSource, String(org.id));
9270
+ return instructions;
9181
9271
  });
9182
9272
  }
9183
9273
  function listRolesProgram(orgId) {
@@ -9412,12 +9502,12 @@ function makeOrgMethods(deps) {
9412
9502
  });
9413
9503
  return toCapxulResult(readOrgProfileProgram(orgId), layer);
9414
9504
  },
9415
- depositInstructions(_options) {
9416
- if (_options?.signal?.aborted) return Promise.resolve({
9417
- ok: false,
9418
- error: Errors.cancelled({ operation: CAPXUL_OPERATIONS.org.profile.depositInstructions })
9419
- });
9420
- return toCapxulResult(readOrgDepositInstructionsProgram(orgId), layer);
9505
+ depositInstructions(options) {
9506
+ const controls = deps.invocationControls?.(options) ?? options;
9507
+ return runCapxulEffect(readOrgDepositInstructionsProgram(orgId).pipe(Effect.provide(orgDepsLayer({
9508
+ ...orgDeps,
9509
+ ...controls === void 0 ? {} : { invocationSource: controls }
9510
+ }))), controls, CAPXUL_OPERATIONS.org.profile.depositInstructions, deps.runPromise);
9421
9511
  }
9422
9512
  },
9423
9513
  treasury(options) {
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { B as EVM_ADDRESS_RE, Ct as RevertSummary, E as Address, G as OrgId, I as CountryCode, J as PayrollGroupId, K as PartyId, M as AuthUserId, P as BudgetId, St as FailureMode, T as AccountId, U as Handle, W as Money, Y as PayrollRunId, _t as isCapxulError, a as SignerStatusStore, bt as ChainUpstream, c as AccountProviderSource, ct as toHandle, d as eip1193AccountProvider, dt as CAPXUL_ERROR_CODES, et as RoleKey, f as localPrivateKeyAccountProvider, ft as CapxulError, g as SmartAccount, h as Session, ht as Errors, i as SignerStatus, j as AuthSession, l as AccountRequirement, lt as toPartyId, m as Profile, mt as CapxulErrorDetails, n as CapxulSigner, o as injectedWalletSigner, ot as toAddress, p as CapxulResult, pt as CapxulErrorCode, r as Eip1193RequestProvider, rt as TesterKind, s as AccountProvider, st as toCountryCode, t as CapxulDigestSigner, u as Eip1193Provider, ut as CAPXUL_PAYMENTS_V2_ADDRESS, vt as CHAIN_UPSTREAMS, w as Account, xt as FAILURE_MODES, yt as ChainCause } from "./signer-C0hZ6Kiy.mjs";
2
- import { $ as OrganizationPaymentsMethods, $n as TelemetryPort, $t as DestinationListInput, A as OrgView, An as TargetsMethods, At as AddressBookMethods, B as PayrollGroupInput, Bn as OrgSetupStep, Bt as ActivityListParams, C as DetectPendingOrgInvitationsResult, Cn as PaymentType, Ct as ActorRelationshipMethods, D as OrgMethods, Dn as Ref, Dt as AddressBookAddInput, E as MemberView, En as RecipientResolution, Et as ActorRequestsMethods, F as RoleSpendCap, Fn as CompleteProfileInput, Ft as ActivityAnnotationInput, G as PayrollRun, Gn as InboxStatus, Gt as ActivitySummary, H as PayrollGroupsMethods, Hn as CurrentHoldings, Ht as ActivityPage, I as RoleView, In as IdentityMethods, It as ActivityDetail, J as PayrollRuns, Jn as PaymentStatus$1, Jt as ActorReference, K as PayrollRunItemInput, Kn as PAYMENT_DIRECTIONS, Kt as ActivitySummaryParams, L as AuthorizeRunInput, Ln as SmartAccountMethods, Lt as ActivityFilter, M as OrganizationAuditLogItem, Mn as AccountLifecycle, Mt as InboxItem, N as ResendInviteTokenInput, Nn as AccountSetupStep, Nt as InboxMethods, O as OrgScopedMethods, On as ResolvedTarget, Ot as AddressBookEntry, P as RoleDefinition, Pn as isSettingUpLifecycle, Pt as ActivityAnnotation, Q as OrganizationPaymentItemInput, Qt as DestinationKind, R as PayrollEngagementTerms, Rn as AuthMethods, Rt as ActivityItem, S as CreateOrgInput, Sn as PaymentTiming, St as ActorProfileMethods, T as MemberStatus, Tn as PaymentsPayInput, Tt as ActorRequestIssueInput, U as PayrollMethods, Un as Permission, Ut as ActivityRange, V as PayrollGroupMember, Vn as ActorRef, Vt as ActivityMethods, W as PayrollOptions, Wn as SubmittedPermissionExecution, Wt as ActivityReference, X as OrganizationPaymentBatchInput, Xt as Destination, Y as PayrollTermsUnit, Yn as RequestStatus, Yt as DepositInstructions, Z as OrganizationPaymentInput, Zt as DestinationAddInput, _ as SystemMethods, _n as PaymentDocumentRender, _t as PersonOnboarding, a as SdkFailureObservation, an as MeMethods, ar as StateLabel, at as PermissionReplaceInput, b as CurrentUserContext, bn as PaymentMoney, bt as AccountMethods, c as PostHogObservabilityOptions, cn as OfframpMethods, cr as isRestoring, ct as Budget, d as CreateCapxulClientInput, dn as OfframpStatus, dt as OrgMeOptions, en as DestinationPayload, er as Destination$1, et as PermissionAssignInput, f as IdentityProfileDetails, fn as Payment, ft as AccountsMethods, g as Holding, gn as PaymentDocumentRef, gt as OrganizationOnboardingInput, h as HoldingsMethods, hn as PaymentDocumentKind, ht as OrganizationOnboarding, i as ObservationDelivery, in as FinancialOpsMethods, ir as Readiness, it as PermissionOptions, j as OrganizationAccount, jn as fingerprintPaymentIntent, jt as InboxApproveInput, k as OrgTemplate, kn as TargetReference, kt as AddressBookLabelInput, l as postHogObservability, ln as OfframpQuote, lr as IdentityTransition, lt as OrgMe, m as IdentityRuntimeSendResult, mn as PaymentDirection, mt as OnboardingMethods, n as ObservationAdapter, nn as DestinationRemoveInput, nr as IdentityState, nt as PermissionCreateInput, o as HostObservability, on as MeProfile, or as destination, ot as PermissionRevokeInput, p as IdentityRuntime, pn as PaymentActivityEvidence, pt as CompletedPersonProfile, q as PayrollRunStatus, qn as PAYMENT_STATUSES, qt as ActivitySummaryTotal, r as ObservationContext, rn as DestinationsMethods, rr as OrgLane, rt as PermissionMethods, s as PostHogObservabilityClient, sn as MovementActivityEvidence, sr as isClaimed, st as PermissionReadResult, t as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, tn as DestinationRail, tr as IdentityEvent, tt as PermissionChangeInput, u as CapxulClient, un as OfframpQuoteInput, ur as InvocationControls, ut as OrgMeMethod, v as SystemHealth, vn as PaymentDocumentVerification, vt as PersonOnboardingInput, w as InviteMemberInput, wn as PaymentsMethods, wt as ActorRequest, x as CurrentUserMethods, xn as PaymentStatus, xt as ActorProfile, y as MediaMethods, yn as PaymentDocumentsMethods, yt as ReadyAccountLifecycle, z as PayrollGroup, zn as OrgLifecycle, zt as ActivityKind } from "./observation-Bcmb-GIA.mjs";
2
+ import { $ as OrganizationPaymentsMethods, $n as TelemetryPort, $t as DestinationListInput, A as OrgView, An as TargetsMethods, At as AddressBookMethods, B as PayrollGroupInput, Bn as OrgSetupStep, Bt as ActivityListParams, C as DetectPendingOrgInvitationsResult, Cn as PaymentType, Ct as ActorRelationshipMethods, D as OrgMethods, Dn as Ref, Dt as AddressBookAddInput, E as MemberView, En as RecipientResolution, Et as ActorRequestsMethods, F as RoleSpendCap, Fn as CompleteProfileInput, Ft as ActivityAnnotationInput, G as PayrollRun, Gn as InboxStatus, Gt as ActivitySummary, H as PayrollGroupsMethods, Hn as CurrentHoldings, Ht as ActivityPage, I as RoleView, In as IdentityMethods, It as ActivityDetail, J as PayrollRuns, Jn as PaymentStatus$1, Jt as ActorReference, K as PayrollRunItemInput, Kn as PAYMENT_DIRECTIONS, Kt as ActivitySummaryParams, L as AuthorizeRunInput, Ln as SmartAccountMethods, Lt as ActivityFilter, M as OrganizationAuditLogItem, Mn as AccountLifecycle, Mt as InboxItem, N as ResendInviteTokenInput, Nn as AccountSetupStep, Nt as InboxMethods, O as OrgScopedMethods, On as ResolvedTarget, Ot as AddressBookEntry, P as RoleDefinition, Pn as isSettingUpLifecycle, Pt as ActivityAnnotation, Q as OrganizationPaymentItemInput, Qt as DestinationKind, R as PayrollEngagementTerms, Rn as AuthMethods, Rt as ActivityItem, S as CreateOrgInput, Sn as PaymentTiming, St as ActorProfileMethods, T as MemberStatus, Tn as PaymentsPayInput, Tt as ActorRequestIssueInput, U as PayrollMethods, Un as Permission, Ut as ActivityRange, V as PayrollGroupMember, Vn as ActorRef, Vt as ActivityMethods, W as PayrollOptions, Wn as SubmittedPermissionExecution, Wt as ActivityReference, X as OrganizationPaymentBatchInput, Xt as Destination, Y as PayrollTermsUnit, Yn as RequestStatus, Yt as DepositInstructions, Z as OrganizationPaymentInput, Zt as DestinationAddInput, _ as SystemMethods, _n as PaymentDocumentRender, _t as PersonOnboarding, a as SdkFailureObservation, an as MeMethods, ar as StateLabel, at as PermissionReplaceInput, b as CurrentUserContext, bn as PaymentMoney, bt as AccountMethods, c as PostHogObservabilityOptions, cn as OfframpMethods, cr as isRestoring, ct as Budget, d as CreateCapxulClientInput, dn as OfframpStatus, dt as OrgMeOptions, en as DestinationPayload, er as Destination$1, et as PermissionAssignInput, f as IdentityProfileDetails, fn as Payment, ft as AccountsMethods, g as Holding, gn as PaymentDocumentRef, gt as OrganizationOnboardingInput, h as HoldingsMethods, hn as PaymentDocumentKind, ht as OrganizationOnboarding, i as ObservationDelivery, in as FinancialOpsMethods, ir as Readiness, it as PermissionOptions, j as OrganizationAccount, jn as fingerprintPaymentIntent, jt as InboxApproveInput, k as OrgTemplate, kn as TargetReference, kt as AddressBookLabelInput, l as postHogObservability, ln as OfframpQuote, lr as IdentityTransition, lt as OrgMe, m as IdentityRuntimeSendResult, mn as PaymentDirection, mt as OnboardingMethods, n as ObservationAdapter, nn as DestinationRemoveInput, nr as IdentityState, nt as PermissionCreateInput, o as HostObservability, on as MeProfile, or as destination, ot as PermissionRevokeInput, p as IdentityRuntime, pn as PaymentActivityEvidence, pt as CompletedPersonProfile, q as PayrollRunStatus, qn as PAYMENT_STATUSES, qt as ActivitySummaryTotal, r as ObservationContext, rn as DestinationsMethods, rr as OrgLane, rt as PermissionMethods, s as PostHogObservabilityClient, sn as MovementActivityEvidence, sr as isClaimed, st as PermissionReadResult, t as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, tn as DestinationRail, tr as IdentityEvent, tt as PermissionChangeInput, u as CapxulClient, un as OfframpQuoteInput, ur as InvocationControls, ut as OrgMeMethod, v as SystemHealth, vn as PaymentDocumentVerification, vt as PersonOnboardingInput, w as InviteMemberInput, wn as PaymentsMethods, wt as ActorRequest, x as CurrentUserMethods, xn as PaymentStatus, xt as ActorProfile, y as MediaMethods, yn as PaymentDocumentsMethods, yt as ReadyAccountLifecycle, z as PayrollGroup, zn as OrgLifecycle, zt as ActivityKind } from "./observation-D2JnjN2R.mjs";
3
3
  import "./OAuthBearerAuthClient-D-DLYlKj.mjs";
4
4
  import { Context, Effect, Layer } from "effect";
5
5
  import { Hex } from "viem";
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as stampTelemetryEnvelope, A as safeExceptionLabel, B as resolveFailureMode, C as observeFailedResult, D as normalizeExceptionErrorKind, E as SDK_VERSION$1, F as causeChain, G as sanitizeObservationContext, H as readInvocationObservation, I as injectedWalletSigner, J as CAPXUL_FUNCTIONS, K as PAYMENT_DIRECTIONS, L as isSignerNotReadySignal, M as fromWei, N as isSettingUpLifecycle, O as normalizeExceptionOperation, P as formatTraceparent, Q as redactTelemetryProps, R as openfortSignerNotReadyCode, S as observationContextProps, T as EXCEPTION_MESSAGE, U as OBSERVATION_CONTEXT_HEADER, V as copyInvocationObservation, W as encodeObservationContextHeader, X as EngineeringTelemetryBootstrapPolicy, Y as BootstrapEnvelope, _ as fingerprintPaymentIntent, a as AccountReadPortTag, at as isRestoring, b as failureDetail, c as retryIdempotentRead, d as IdentityPortTag, et as CAPXUL_OPERATIONS, f as identityErrorFromCapxul, g as bootstrapErrorFromCapxul, h as BootstrapPortTag, i as smartAccountErrorFromCapxul, it as isClaimed, j as version, k as projectSdkException, l as PRODUCT_INVOCATION, m as convexCallErrorFromCapxul, n as detectAuthCacheAdapter, nt as normalizeCapxulOperation, o as accountReadErrorFromCapxul, p as ConvexCallPortTag, q as PAYMENT_STATUSES, r as SmartAccountPortTag, rt as destination, s as TelemetryPortTag, t as assembleCapxulClient, tt as isCapxulOperation, u as wireChainId, v as toWei, w as postHogFailureObservation, x as failureEvidenceProps, y as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, z as signerFailure } from "./create-capxul-client-rpLwGwD-.mjs";
1
+ import { $ as stampTelemetryEnvelope, A as safeExceptionLabel, B as resolveFailureMode, C as observeFailedResult, D as normalizeExceptionErrorKind, E as SDK_VERSION$1, F as causeChain, G as sanitizeObservationContext, H as readInvocationObservation, I as injectedWalletSigner, J as CAPXUL_FUNCTIONS, K as PAYMENT_DIRECTIONS, L as isSignerNotReadySignal, M as fromWei, N as isSettingUpLifecycle, O as normalizeExceptionOperation, P as formatTraceparent, Q as redactTelemetryProps, R as openfortSignerNotReadyCode, S as observationContextProps, T as EXCEPTION_MESSAGE, U as OBSERVATION_CONTEXT_HEADER, V as copyInvocationObservation, W as encodeObservationContextHeader, X as EngineeringTelemetryBootstrapPolicy, Y as BootstrapEnvelope, _ as fingerprintPaymentIntent, a as AccountReadPortTag, at as isRestoring, b as failureDetail, c as retryIdempotentRead, d as IdentityPortTag, et as CAPXUL_OPERATIONS, f as identityErrorFromCapxul, g as bootstrapErrorFromCapxul, h as BootstrapPortTag, i as smartAccountErrorFromCapxul, it as isClaimed, j as version, k as projectSdkException, l as PRODUCT_INVOCATION, m as convexCallErrorFromCapxul, n as detectAuthCacheAdapter, nt as normalizeCapxulOperation, o as accountReadErrorFromCapxul, p as ConvexCallPortTag, q as PAYMENT_STATUSES, r as SmartAccountPortTag, rt as destination, s as TelemetryPortTag, t as assembleCapxulClient, tt as isCapxulOperation, u as wireChainId, v as toWei, w as postHogFailureObservation, x as failureEvidenceProps, y as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, z as signerFailure } from "./create-capxul-client-DGnNFym7.mjs";
2
2
  import { $ as CapxulError, A as toAuthUserId, B as toJwtToken, D as toAddress, E as toAccountId, F as toDurationMs, H as toOrgId, I as toEmail, J as toSessionToken, K as toPublishableKey, L as toEpochMs, M as toChainId, N as toCountryCode, O as toAllowedOrigin, P as toCurrencyCode, Q as CAPXUL_ERROR_CODES, R as toEpochSeconds, T as currencySymbolFor, U as toPartyId, V as toKycTier, X as HANDLE_RE, Y as toTesterKind, Z as decodeConvexError, d as AuthClientError, f as AuthClientPortTag, g as BASE_SEPOLIA_CHAIN_ID, h as normalizeBindingEmail, it as FAILURE_MODES, l as ClockPortTag, m as CAPXUL_PAYMENTS_V2_ADDRESS, nt as isCapxulError, q as toRoleKey, rt as CHAIN_UPSTREAMS, s as AuthCachePortTag, tt as Errors, u as authClientPortFromPromiseAdapter, x as EVM_ADDRESS_RE, z as toHandle } from "./clock-C2AUlq1V.mjs";
3
3
  import { n as SystemClockLayer } from "./OAuthBearerAuthClient-BHvDR8_0.mjs";
4
4
  import { Cause, Context, Data, Duration, Effect, Exit, Layer, Result, Schedule, SchemaIssue, SchemaParser, Scope, Tracer } from "effect";
@@ -1615,6 +1615,8 @@ const OBSERVED_CONVEX_QUERIES = /* @__PURE__ */ new Set([
1615
1615
  "movement/activity:list",
1616
1616
  "movement/activity:summary",
1617
1617
  "movement/activity:get",
1618
+ "financialOps/queries:depositInstructions",
1619
+ "financialOps/destinations:list",
1618
1620
  "financialOps/queries:verifyPaymentDocument",
1619
1621
  "financialOps/queries:renderStoredDocument",
1620
1622
  "financialOps/addressBook:list",
@@ -1632,6 +1634,8 @@ const OBSERVED_CONVEX_QUERIES = /* @__PURE__ */ new Set([
1632
1634
  ]);
1633
1635
  const OBSERVED_CONVEX_MUTATIONS = /* @__PURE__ */ new Set([
1634
1636
  "movement/activity:annotate",
1637
+ "financialOps/destinations:add",
1638
+ "financialOps/destinations:remove",
1635
1639
  "financialOps/addressBook:add",
1636
1640
  "financialOps/addressBook:hide",
1637
1641
  "financialOps/addressBook:unhide",
@@ -2289,7 +2289,7 @@ type RoleView = {
2289
2289
  type OrgTemplate = "Solo";
2290
2290
  /**
2291
2291
  * Input to `capxul.createOrg`. `name` is the display name.
2292
- * `handle` is the globally unique normalized handle (`^[a-z0-9-]{3,32}$`).
2292
+ * `handle` uses the shared global Handle grammar (`^[a-z0-9_-]{3,30}$`).
2293
2293
  * `template` seeds the initial role set. `country` is stored without validation.
2294
2294
  */
2295
2295
  type CreateOrgInput = {
@@ -1,4 +1,4 @@
1
- import { Qn as TelemetryIdentifyInput, Xn as TelemetryEvent, Zn as TelemetryGroupInput, lr as IdentityTransition, n as ObservationAdapter, u as CapxulClient } from "../observation-Bcmb-GIA.mjs";
1
+ import { Qn as TelemetryIdentifyInput, Xn as TelemetryEvent, Zn as TelemetryGroupInput, lr as IdentityTransition, n as ObservationAdapter, u as CapxulClient } from "../observation-D2JnjN2R.mjs";
2
2
  import { Effect, Layer } from "effect";
3
3
  //#region src/testing/telemetry/RecordingTelemetryAdapter.d.ts
4
4
  type RecordingTelemetryOperation = {
@@ -1,4 +1,4 @@
1
- import { M as fromWei, Z as redactTelemetryEvent, f as identityErrorFromCapxul, g as bootstrapErrorFromCapxul, i as smartAccountErrorFromCapxul, m as convexCallErrorFromCapxul, o as accountReadErrorFromCapxul, t as assembleCapxulClient, u as wireChainId, v as toWei } from "../create-capxul-client-rpLwGwD-.mjs";
1
+ import { M as fromWei, Z as redactTelemetryEvent, f as identityErrorFromCapxul, g as bootstrapErrorFromCapxul, i as smartAccountErrorFromCapxul, m as convexCallErrorFromCapxul, o as accountReadErrorFromCapxul, t as assembleCapxulClient, u as wireChainId, v as toWei } from "../create-capxul-client-DGnNFym7.mjs";
2
2
  import { $ as CapxulError, A as toAuthUserId, B as toJwtToken, D as toAddress, E as toAccountId, F as toDurationMs, I as toEmail, J as toSessionToken, K as toPublishableKey, L as toEpochMs, M as toChainId, N as toCountryCode, O as toAllowedOrigin, R as toEpochSeconds, V as toKycTier, _ as deriveCapxulSafeAddress, k as toAppId, n as InMemoryAuthCacheAdapter, t as readClockNow, tt as Errors, u as authClientPortFromPromiseAdapter, v as validateHandle, z as toHandle } from "../clock-C2AUlq1V.mjs";
3
3
  import { Effect, Result, Semaphore } from "effect";
4
4
  import { keccak256 } from "viem";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capxul/sdk",
3
- "version": "4.1.0",
3
+ "version": "4.1.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/Xelmar-tech/infrastructure.git",
@@ -48,11 +48,11 @@
48
48
  "vite-plus": "0.3.0",
49
49
  "vitest": "4.1.11",
50
50
  "@capxul/config": "0.3.0",
51
- "@capxul/errors": "0.3.0",
52
51
  "@capxul/typescript-config": "0.0.0",
52
+ "@capxul/errors": "0.3.0",
53
+ "@capxul/types": "0.3.0",
53
54
  "@capxul/wire": "0.7.0",
54
- "@capxul/observability": "4.1.0",
55
- "@capxul/types": "0.3.0"
55
+ "@capxul/observability": "4.1.2"
56
56
  },
57
57
  "_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.",
58
58
  "scripts": {