@capxul/sdk 2.5.5 → 2.6.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/{InMemoryAuthCacheAdapter-uOcqpqu8.mjs → InMemoryAuthCacheAdapter-VZBv1fOH.mjs} +158 -6
- package/dist/{create-capxul-client-CpBVKg10.mjs → create-capxul-client-BuEjwJS6.mjs} +4589 -4470
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +3 -3
- package/dist/node/index.d.mts +1 -1
- package/dist/node/index.mjs +1 -1
- package/dist/{observation-E28xIx4S.d.mts → observation-Desw1A8U.d.mts} +96 -61
- package/dist/{signer-DIZRkFHh.d.mts → signer-tokSaxrJ.d.mts} +45 -20
- package/dist/testing/index.d.mts +1 -1
- package/dist/testing/index.mjs +2 -2
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as OrgId, C as Address, N as CountryCode, O as AuthSession, S as AccountId, U as PayrollGroupId, V as PartyId, W as PayrollRunId, Y as RoleKey, a as SignerStatusStore, at as CapxulErrorDetails, c as AccountProviderSource, ct as
|
|
2
|
-
import { $ as
|
|
1
|
+
import { B as OrgId, C as Address, N as CountryCode, O as AuthSession, S as AccountId, U as PayrollGroupId, V as PartyId, W as PayrollRunId, Y as RoleKey, a as SignerStatusStore, at as CapxulErrorDetails, c as AccountProviderSource, ct as isCapxulError, d as eip1193AccountProvider, dt as ChainUpstream, et as toAddress, f as localPrivateKeyAccountProvider, ft as FAILURE_MODES, g as SmartAccount, h as Session, i as SignerStatus, it as CapxulErrorCode, j as BudgetId, k as AuthUserId, l as AccountRequirement, lt as CHAIN_UPSTREAMS, m as Profile, mt as RevertSummary, n as CapxulSigner, nt as CAPXUL_ERROR_CODES, o as injectedWalletSigner, ot as Errors, p as CapxulResult, pt as FailureMode, r as Eip1193RequestProvider, rt as CapxulError, s as AccountProvider, t as CapxulDigestSigner, tt as toCountryCode, u as Eip1193Provider, ut as ChainCause, x as Account, z as Money } from "./signer-tokSaxrJ.mjs";
|
|
2
|
+
import { $ as OrganizationPaymentsMethods, $n as IdentityState, $t as MeMethods, A as OrgView, An as AccountSetupStep, At as ActivityFilter, B as PayrollGroupInput, Bn as SubmittedPermissionExecution, Bt as ActivitySummaryTotal, C as DetectPendingOrgInvitationsResult, Cn as RecipientResolutionKind, Ct as AddressBookMethods, D as OrgMethods, Dn as TargetsMethods, Dt as ActivityAnnotation, E as MemberView, En as TargetReference, Et as InboxMethods, F as RoleSpendCap, Fn as OrgLifecycle, Ft as ActivityPage, G as PayrollRun, Gn as RequestStatus, Gt as DestinationKind, H as PayrollGroupsMethods, Hn as PAYMENT_DIRECTIONS, Ht as DepositInstructions, I as RoleView, In as OrgSetupStep, It as ActivityRange, J as PayrollRuns, Jt as DestinationRail, K as PayrollRunItemInput, Kn as CAPXUL_PAYMENTS_V2_ADDRESS, Kt as DestinationListInput, L as AuthorizeRunInput, Ln as ActorRef, Lt as ActivityReference, M as OrganizationAuditLogItem, Mn as IdentityMethods, Mt as ActivityKind, N as ResendInviteTokenInput, Nn as SmartAccountMethods, Nt as ActivityListParams, O as OrgScopedMethods, On as fingerprintPaymentIntent, Ot as ActivityAnnotationInput, P as RoleDefinition, Pn as AuthMethods, Pt as ActivityMethods, Q as OrganizationPaymentItemInput, Qn as IdentityEvent, Qt as HandlesMethods, R as PayrollEngagementTerms, Rn as CurrentHoldings, Rt as ActivitySummary, S as CreateOrgInput, Sn as RecipientResolution, St as AddressBookLabelInput, T as MemberStatus, Tn as ResolvedTarget, Tt as InboxItem, U as PayrollMethods, Un as PAYMENT_STATUSES, Ut as Destination, V as PayrollGroupMember, Vn as InboxStatus, Vt as ActorReference, W as PayrollOptions, Wn as PaymentStatus$1, Wt as DestinationAddInput, X as OrganizationPaymentBatchInput, Xn as TelemetryPort, Xt as DestinationsMethods, Y as PayrollTermsUnit, Yt as DestinationRemoveInput, Z as OrganizationPaymentInput, Zn as Destination$1, Zt as FinancialOpsMethods, _ as SystemMethods, _n as PaymentStatus, _t as ActorRequest, a as SdkFailureObservation, an as OfframpStatus, ar as isRestoring, at as PermissionReplaceInput, b as CurrentUserContext, bn as PaymentsMethods, bt as AddressBookAddInput, c as PostHogObservabilityOptions, cn as Payment, ct as Budget, d as CreateCapxulClientInput, dn as PaymentDocumentKind, dt as OrgMeOptions, en as MeProfile, er as OrgLane, et as PermissionAssignInput, f as IdentityProfileDetails, fn as PaymentDocumentRef, ft as AccountsMethods, g as Holding, gn as PaymentMoney, gt as ActorRelationshipMethods, h as HoldingsMethods, hn as PaymentDocumentsMethods, ht as ActorProfileMethods, i as ObservationDelivery, in as OfframpQuoteInput, ir as isClaimed, it as PermissionOptions, j as OrganizationAccount, jn as isSettingUpLifecycle, jt as ActivityItem, k as OrgTemplate, kn as AccountLifecycle, kt as ActivityDetail, l as postHogObservability, ln as PaymentActivityEvidence, lt as OrgMe, m as IdentityRuntimeSendResult, mn as PaymentDocumentVerification, mt as ActorProfile, n as ObservationAdapter, nn as OfframpMethods, nr as StateLabel, nt as PermissionCreateInput, o as HostObservability, on as Payee, or as IdentityTransition, ot as PermissionRevokeInput, p as IdentityRuntime, pn as PaymentDocumentRender, pt as AccountMethods, q as PayrollRunStatus, qt as DestinationPayload, r as ObservationContext, rn as OfframpQuote, rr as destination, rt as PermissionMethods, s as PostHogObservabilityClient, sn as PayeesMethods, sr as InvocationControls, st as PermissionReadResult, t as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, tn as MovementActivityEvidence, tr as Readiness, tt as PermissionChangeInput, u as CapxulClient, un as PaymentDirection, ut as OrgMeMethod, v as SystemHealth, vn as PaymentTiming, vt as ActorRequestIssueInput, w as InviteMemberInput, wn as Ref, wt as InboxApproveInput, x as CurrentUserMethods, xn as PaymentsPayInput, xt as AddressBookEntry, y as MediaMethods, yn as PaymentType, yt as ActorRequestsMethods, z as PayrollGroup, zn as Permission, zt as ActivitySummaryParams } from "./observation-Desw1A8U.mjs";
|
|
3
3
|
import { Hex } from "viem";
|
|
4
4
|
import { Context, Effect, Layer } from "effect";
|
|
5
5
|
import { FunctionReference } from "convex/server";
|
|
@@ -203,4 +203,4 @@ declare function captureException(telemetry: TelemetryPort, error: unknown, cont
|
|
|
203
203
|
*/
|
|
204
204
|
declare function captureExceptionSync(telemetry: TelemetryPort, error: unknown, context?: HandledErrorReportContext): void;
|
|
205
205
|
//#endregion
|
|
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 AuthorizeRunInput, 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 PayrollGroup, type PayrollGroupId, type PayrollGroupInput, type PayrollGroupMember, type PayrollGroupsMethods, type PayrollMethods, type PayrollOptions, type PayrollRun, type PayrollRunId, type PayrollRunItemInput, type PayrollRunStatus, type PayrollRuns, 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 };
|
|
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 AuthorizeRunInput, type Budget, type BudgetId, CAPXUL_ERROR_CODES, CAPXUL_PAYMENTS_V2_ADDRESS, CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, CHAIN_UPSTREAMS, type CapxulClient, type CapxulClientInput, type CapxulDigestSigner, CapxulError, type CapxulErrorCode, type CapxulErrorDetails, type CapxulResult, type CapxulSigner, type ChainCause, type ChainUpstream, 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, FAILURE_MODES, type FailureMode, 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 PayrollEngagementTerms, type PayrollGroup, type PayrollGroupId, type PayrollGroupInput, type PayrollGroupMember, type PayrollGroupsMethods, type PayrollMethods, type PayrollOptions, type PayrollRun, type PayrollRunId, type PayrollRunItemInput, type PayrollRunStatus, type PayrollRuns, type PayrollTermsUnit, 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 RevertSummary, 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,5 +1,5 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { B as Errors, C as toDurationMs, D as toJwtToken, E as toEpochSeconds, F as toSessionToken, I as decodeConvexError, L as CAPXUL_ERROR_CODES, N as toPublishableKey, O as toKycTier, P as toRoleKey, R as CapxulError, S as toCurrencyCode, T as toEpochMs, V as isCapxulError, b as toChainId, g as toAllowedOrigin, h as toAddress, k as toOrgId, m as toAccountId, o as AuthCachePortTag, p as currencySymbolFor, v as toAuthUserId, w as toEmail, x as toCountryCode } from "./InMemoryAuthCacheAdapter-
|
|
1
|
+
import { A as postHogFailureObservation, B as injectedWalletSigner, C as fingerprintPaymentIntent, D as failureEvidenceProps, E as failureDetail, F as isSettingUpLifecycle, G as PAYMENT_DIRECTIONS, H as OBSERVATION_CONTEXT_HEADER, I as formatTraceparent, J as BootstrapEnvelope, K as PAYMENT_STATUSES, L as copyInvocationObservation, M as captureExceptionSync, N as version, O as observationContextProps, P as fromWei, Q as BASE_SEPOLIA_CHAIN_ID, R as readInvocationObservation, S as AuthClientPortTag, T as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, U as encodeObservationContextHeader, V as signerFailure, W as sanitizeObservationContext, X as CAPXUL_PAYMENTS_V2_ADDRESS, Y as EngineeringTelemetryBootstrapPolicy, Z as normalizeBindingEmail, _ as ClockPortTag, a as TelemetryPortTag, b as authClientPortFromPromiseAdapter, c as smartAccountErrorFromCapxul, d as wireChainId, et as destination, f as IdentityPortTag, g as ClockError, h as convexCallErrorFromCapxul, i as PostHogTelemetryLayer, j as captureException, k as observeFailedResult, l as AccountReadPortTag, m as ConvexCallPortTag, n as postHogProductTelemetry, nt as isRestoring, p as identityErrorFromCapxul, q as CAPXUL_FUNCTIONS, r as detectAuthCacheAdapter, s as SmartAccountPortTag, t as assembleCapxulClient, tt as isClaimed, u as accountReadErrorFromCapxul, v as BootstrapPortTag, w as toWei, x as AuthClientError, y as bootstrapErrorFromCapxul, z as causeChain } from "./create-capxul-client-BuEjwJS6.mjs";
|
|
2
|
+
import { B as Errors, C as toDurationMs, D as toJwtToken, E as toEpochSeconds, F as toSessionToken, H as CHAIN_UPSTREAMS, I as decodeConvexError, L as CAPXUL_ERROR_CODES, N as toPublishableKey, O as toKycTier, P as toRoleKey, R as CapxulError, S as toCurrencyCode, T as toEpochMs, U as FAILURE_MODES, V as isCapxulError, b as toChainId, g as toAllowedOrigin, h as toAddress, k as toOrgId, m as toAccountId, o as AuthCachePortTag, p as currencySymbolFor, v as toAuthUserId, w as toEmail, x as toCountryCode } from "./InMemoryAuthCacheAdapter-VZBv1fOH.mjs";
|
|
3
3
|
import { keccak256, recoverAddress, stringToHex } from "viem";
|
|
4
4
|
import { Cause, Context, Data, Duration, Effect, Exit, Layer, Result, Schedule, SchemaIssue, SchemaParser, Scope, Tracer } from "effect";
|
|
5
5
|
import { getFunctionName, makeFunctionReference } from "convex/server";
|
|
@@ -3203,4 +3203,4 @@ async function createCapxulClient(input) {
|
|
|
3203
3203
|
return createCapxulClient$1(input);
|
|
3204
3204
|
}
|
|
3205
3205
|
//#endregion
|
|
3206
|
-
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 };
|
|
3206
|
+
export { CAPXUL_ERROR_CODES, CAPXUL_PAYMENTS_V2_ADDRESS, CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, CHAIN_UPSTREAMS, CapxulError, Errors, FAILURE_MODES, 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 };
|
package/dist/node/index.d.mts
CHANGED
|
@@ -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-
|
|
1
|
+
import { O as AuthSession, _ as AuthCacheError, b as CachedJwt, n as CapxulSigner, v as AuthCachePort, y as AuthCachePortTag } from "../signer-tokSaxrJ.mjs";
|
|
2
2
|
import { Hex } from "viem";
|
|
3
3
|
import { Effect, FileSystem, Layer, Path } from "effect";
|
|
4
4
|
|
package/dist/node/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as AuthCacheError, h as toAddress, i as parseCachedJwt, n as BrowserAuthCacheAdapter, o as AuthCachePortTag, r as parseAuthSession, t as InMemoryAuthCacheAdapter } from "../InMemoryAuthCacheAdapter-
|
|
1
|
+
import { a as AuthCacheError, h as toAddress, i as parseCachedJwt, n as BrowserAuthCacheAdapter, o as AuthCachePortTag, r as parseAuthSession, t as InMemoryAuthCacheAdapter } from "../InMemoryAuthCacheAdapter-VZBv1fOH.mjs";
|
|
2
2
|
import { Effect, FileSystem, Layer, Path } from "effect";
|
|
3
3
|
import { privateKeyToAccount } from "viem/accounts";
|
|
4
4
|
import * as os from "node:os";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as WeiAmount, A as BlockNumber, B as OrgId, C as Address$1, D as AppId, E as AnonymousDistinctId, F as DocumentHash, G as PermissionAssignmentId, H as PaymentCommandId, I as DurationMs, J as PublishableKey, K as PermissionId, L as Email, M as ChainId, N as CountryCode, O as AuthSession, P as CurrencyCode, Q as TxHash, R as EpochMs, T as AllowedOrigin, U as PayrollGroupId, V as PartyId, W as PayrollRunId, X as SessionToken, Y as RoleKey, Z as SmartAccount, a as SignerStatusStore, at as CapxulErrorDetails, b as CachedJwt, c as AccountProviderSource,
|
|
1
|
+
import { $ as WeiAmount, A as BlockNumber, B as OrgId, C as Address$1, D as AppId, E as AnonymousDistinctId, F as DocumentHash, G as PermissionAssignmentId, H as PaymentCommandId, I as DurationMs, J as PublishableKey, K as PermissionId, L as Email, M as ChainId, N as CountryCode, O as AuthSession, P as CurrencyCode, Q as TxHash, R as EpochMs, T as AllowedOrigin, U as PayrollGroupId, V as PartyId, W as PayrollRunId, X as SessionToken, Y as RoleKey, Z as SmartAccount, a as SignerStatusStore, at as CapxulErrorDetails, b as CachedJwt, c as AccountProviderSource, g as SmartAccount$1, h as Session$1, it as CapxulErrorCode, j as BudgetId, k as AuthUserId, l as AccountRequirement, m as Profile$1, n as CapxulSigner, p as CapxulResult, pt as FailureMode, q as Profile, rt as CapxulError, st as Failure, v as AuthCachePort, w as AllowanceKey, x as Account$1, z as Money } from "./signer-tokSaxrJ.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";
|
|
@@ -253,6 +253,65 @@ declare const isRestoring: (state: IdentityState) => boolean;
|
|
|
253
253
|
* it in #1521; this ticket ships the selector they move onto. */
|
|
254
254
|
declare const isClaimed: (state: IdentityState) => boolean;
|
|
255
255
|
//#endregion
|
|
256
|
+
//#region ../observability/src/telemetry-port.d.ts
|
|
257
|
+
/**
|
|
258
|
+
* Context for reporting handled errors via `reportHandledError`.
|
|
259
|
+
* Carries structured metadata extracted from the error context.
|
|
260
|
+
*/
|
|
261
|
+
interface HandledErrorReportContext {
|
|
262
|
+
readonly layer?: string;
|
|
263
|
+
readonly operation?: string;
|
|
264
|
+
readonly failure_mode?: FailureMode;
|
|
265
|
+
readonly provider?: string;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Canonical TelemetryPort interface. Every adapter (production, test, in-memory)
|
|
269
|
+
* implements this contract. All methods return `Effect<void, never>` —
|
|
270
|
+
* fire-and-forget, defects are caught and traced.
|
|
271
|
+
*/
|
|
272
|
+
interface TelemetryPort {
|
|
273
|
+
readonly emit: (event: TelemetryEvent) => Effect.Effect<void, never>;
|
|
274
|
+
readonly identify: (input: TelemetryIdentifyInput) => Effect.Effect<void, never>;
|
|
275
|
+
readonly group: (input: TelemetryGroupInput) => Effect.Effect<void, never>;
|
|
276
|
+
readonly reset: () => Effect.Effect<void, never>;
|
|
277
|
+
readonly reportHandledError?: (error: CapxulError, context?: HandledErrorReportContext) => Effect.Effect<void, never>;
|
|
278
|
+
}
|
|
279
|
+
//#endregion
|
|
280
|
+
//#region ../observability/src/index.d.ts
|
|
281
|
+
declare const TELEMETRY_EVENT_NAMES: readonly ["auth_otp_requested", "auth_otp_delivered", "auth_otp_expired", "auth_verified", "auth_failed", "auth_signed_out", "onboarding_intent_selected", "onboarding_profile_submitted", "onboarding_organization_submitted", "onboarding_dashboard_reached", "provisioning_safe_created", "provisioning_safe_confirmed", "bootstrap_resolved", "bootstrap_failed", "member_activation_started", "member_activation_ready", "member_activation_failed", "organization_creation_started", "organization_creation_ready", "organization_creation_failed", "chain_upstream_fallback", "bundler_error", "receipt_pending", "operation_retried", "account_balance_read", "account_balance_failed", "faucet_requested", "faucet_confirmed", "faucet_failed", "org_create_started", "org_safe_created", "org_safe_confirmed", "org_roles_seeded", "org_created", "org_create_failed", "org_invite_sent", "org_invite_accepted", "org_invite_expired", "payment_initiated", "payment_settled", "payment_failed", "payment_verification_retry", "deposit_initiated", "deposit_settled", "permission_mirror_verification", "movement_scan_window", "movement_scan_checkpoint", "movement_scan_incident"];
|
|
282
|
+
type TelemetryEventName = (typeof TELEMETRY_EVENT_NAMES)[number];
|
|
283
|
+
type TelemetryProps = Record<string, unknown>;
|
|
284
|
+
type TelemetryEvent = {
|
|
285
|
+
readonly name: TelemetryEventName;
|
|
286
|
+
readonly props?: TelemetryProps | undefined;
|
|
287
|
+
};
|
|
288
|
+
/**
|
|
289
|
+
* Environment discriminator (ADR-0020 A1 amendment, 2026-08-07). PostHog
|
|
290
|
+
* project 368736 is the SINGLE sink for every environment, so `capxul_env` —
|
|
291
|
+
* not project isolation — is what keeps a production surface from reading dev
|
|
292
|
+
* traffic. It is REQUIRED on every catalog event and every synced artifact
|
|
293
|
+
* filters on it.
|
|
294
|
+
*
|
|
295
|
+
* `unknown` is a defect marker, not an environment: it means a producer
|
|
296
|
+
* reached the transport without declaring where it runs. It is in the union so
|
|
297
|
+
* the property is never ABSENT (an absent property is invisible to a filter,
|
|
298
|
+
* a present `unknown` is loud), and sync v2 never synthesizes an artifact for
|
|
299
|
+
* it.
|
|
300
|
+
*/
|
|
301
|
+
declare const CAPXUL_ENVS: readonly ["development", "staging", "production", "unknown", "local"];
|
|
302
|
+
type CapxulEnv = (typeof CAPXUL_ENVS)[number];
|
|
303
|
+
interface TelemetryIdentifyInput {
|
|
304
|
+
readonly distinctId: string;
|
|
305
|
+
readonly anonDistinctId?: AnonymousDistinctId;
|
|
306
|
+
readonly traits?: TelemetryProps;
|
|
307
|
+
readonly properties?: TelemetryProps;
|
|
308
|
+
}
|
|
309
|
+
interface TelemetryGroupInput {
|
|
310
|
+
readonly groupType: string;
|
|
311
|
+
readonly groupKey: string;
|
|
312
|
+
readonly properties?: TelemetryProps;
|
|
313
|
+
}
|
|
314
|
+
//#endregion
|
|
256
315
|
//#region ../config/src/capxul-payments-v2.d.ts
|
|
257
316
|
/** Immutable CapxulPaymentsV2 deployment on Base Sepolia. */
|
|
258
317
|
declare const CAPXUL_PAYMENTS_V2_ADDRESS: Address;
|
|
@@ -315,65 +374,6 @@ declare class ClockError extends ClockError_base<{
|
|
|
315
374
|
readonly cause: unknown;
|
|
316
375
|
}> {}
|
|
317
376
|
//#endregion
|
|
318
|
-
//#region ../observability/src/telemetry-port.d.ts
|
|
319
|
-
/**
|
|
320
|
-
* Context for reporting handled errors via `reportHandledError`.
|
|
321
|
-
* Carries structured metadata extracted from the error context.
|
|
322
|
-
*/
|
|
323
|
-
interface HandledErrorReportContext {
|
|
324
|
-
readonly layer?: string;
|
|
325
|
-
readonly operation?: string;
|
|
326
|
-
readonly failure_mode?: FailureMode;
|
|
327
|
-
readonly provider?: string;
|
|
328
|
-
}
|
|
329
|
-
/**
|
|
330
|
-
* Canonical TelemetryPort interface. Every adapter (production, test, in-memory)
|
|
331
|
-
* implements this contract. All methods return `Effect<void, never>` —
|
|
332
|
-
* fire-and-forget, defects are caught and traced.
|
|
333
|
-
*/
|
|
334
|
-
interface TelemetryPort {
|
|
335
|
-
readonly emit: (event: TelemetryEvent) => Effect.Effect<void, never>;
|
|
336
|
-
readonly identify: (input: TelemetryIdentifyInput) => Effect.Effect<void, never>;
|
|
337
|
-
readonly group: (input: TelemetryGroupInput) => Effect.Effect<void, never>;
|
|
338
|
-
readonly reset: () => Effect.Effect<void, never>;
|
|
339
|
-
readonly reportHandledError?: (error: CapxulError, context?: HandledErrorReportContext) => Effect.Effect<void, never>;
|
|
340
|
-
}
|
|
341
|
-
//#endregion
|
|
342
|
-
//#region ../observability/src/index.d.ts
|
|
343
|
-
declare const TELEMETRY_EVENT_NAMES: readonly ["auth_otp_requested", "auth_otp_delivered", "auth_otp_expired", "auth_verified", "auth_failed", "auth_signed_out", "onboarding_intent_selected", "onboarding_profile_submitted", "onboarding_organization_submitted", "onboarding_dashboard_reached", "provisioning_safe_created", "provisioning_safe_confirmed", "bootstrap_resolved", "bootstrap_failed", "member_activation_started", "member_activation_ready", "member_activation_failed", "organization_creation_started", "organization_creation_ready", "organization_creation_failed", "aa_gateway_upstream_fallback", "account_balance_read", "account_balance_failed", "faucet_requested", "faucet_confirmed", "faucet_failed", "org_create_started", "org_safe_created", "org_safe_confirmed", "org_roles_seeded", "org_created", "org_create_failed", "org_invite_sent", "org_invite_accepted", "org_invite_expired", "payment_initiated", "payment_settled", "payment_failed", "deposit_initiated", "deposit_settled", "permission_mirror_verification", "movement_scan_window", "movement_scan_checkpoint", "movement_scan_incident"];
|
|
344
|
-
type TelemetryEventName = (typeof TELEMETRY_EVENT_NAMES)[number];
|
|
345
|
-
type TelemetryProps = Record<string, unknown>;
|
|
346
|
-
type TelemetryEvent = {
|
|
347
|
-
readonly name: TelemetryEventName;
|
|
348
|
-
readonly props?: TelemetryProps | undefined;
|
|
349
|
-
};
|
|
350
|
-
/**
|
|
351
|
-
* Environment discriminator (ADR-0020 A1 amendment, 2026-08-07). PostHog
|
|
352
|
-
* project 368736 is the SINGLE sink for every environment, so `capxul_env` —
|
|
353
|
-
* not project isolation — is what keeps a production surface from reading dev
|
|
354
|
-
* traffic. It is REQUIRED on every catalog event and every synced artifact
|
|
355
|
-
* filters on it.
|
|
356
|
-
*
|
|
357
|
-
* `unknown` is a defect marker, not an environment: it means a producer
|
|
358
|
-
* reached the transport without declaring where it runs. It is in the union so
|
|
359
|
-
* the property is never ABSENT (an absent property is invisible to a filter,
|
|
360
|
-
* a present `unknown` is loud), and sync v2 never synthesizes an artifact for
|
|
361
|
-
* it.
|
|
362
|
-
*/
|
|
363
|
-
declare const CAPXUL_ENVS: readonly ["development", "staging", "production", "unknown", "local"];
|
|
364
|
-
type CapxulEnv = (typeof CAPXUL_ENVS)[number];
|
|
365
|
-
interface TelemetryIdentifyInput {
|
|
366
|
-
readonly distinctId: string;
|
|
367
|
-
readonly anonDistinctId?: AnonymousDistinctId;
|
|
368
|
-
readonly traits?: TelemetryProps;
|
|
369
|
-
readonly properties?: TelemetryProps;
|
|
370
|
-
}
|
|
371
|
-
interface TelemetryGroupInput {
|
|
372
|
-
readonly groupType: string;
|
|
373
|
-
readonly groupKey: string;
|
|
374
|
-
readonly properties?: TelemetryProps;
|
|
375
|
-
}
|
|
376
|
-
//#endregion
|
|
377
377
|
//#region ../wire/src/bootstrap.d.ts
|
|
378
378
|
declare const EngineeringTelemetryBootstrapPolicy: Schema.Struct<{
|
|
379
379
|
readonly host: Schema.refine<string, Schema.String>;
|
|
@@ -617,6 +617,8 @@ declare const SubmittedPermissionExecutionSchema: Schema.Struct<{
|
|
|
617
617
|
type SubmittedPermissionExecution = Schema.Schema.Type<typeof SubmittedPermissionExecutionSchema>;
|
|
618
618
|
declare const PayrollRunStatusSchema: Schema.Literals<readonly ["draft", "authorized", "settled"]>;
|
|
619
619
|
type PayrollRunStatus$1 = Schema.Schema.Type<typeof PayrollRunStatusSchema>;
|
|
620
|
+
declare const PayrollTermsUnitSchema: Schema.Literals<readonly ["hour", "week", "month", "year", "paycheck"]>;
|
|
621
|
+
type PayrollTermsUnit$1 = Schema.Schema.Type<typeof PayrollTermsUnitSchema>;
|
|
620
622
|
//#endregion
|
|
621
623
|
//#region ../wire/src/observation-context.d.ts
|
|
622
624
|
/**
|
|
@@ -2118,6 +2120,27 @@ interface PayrollGroup {
|
|
|
2118
2120
|
readonly tone: string;
|
|
2119
2121
|
readonly members: readonly PayrollGroupMember[];
|
|
2120
2122
|
}
|
|
2123
|
+
/** What a rate is counted PER (ADR-0022 R7). The substrate holds no cadence. */
|
|
2124
|
+
type PayrollTermsUnit = PayrollTermsUnit$1;
|
|
2125
|
+
/**
|
|
2126
|
+
* The rate in force for one open engagement, read at the moment of the call.
|
|
2127
|
+
*
|
|
2128
|
+
* Terms are versioned and insert-only, so this is a snapshot of a history: a
|
|
2129
|
+
* raise inserts a later row and the next read states the new rate. The SDK
|
|
2130
|
+
* derives NOTHING from it — ruling Q3 puts the prefill rule (which unit applies
|
|
2131
|
+
* over which period) in the run composer, and Capxul computes no pay.
|
|
2132
|
+
*/
|
|
2133
|
+
interface PayrollEngagementTerms {
|
|
2134
|
+
/** The EMPLOYEE's `PartyId` — the key an `.Amounts` row is found by. */
|
|
2135
|
+
readonly partyId: string;
|
|
2136
|
+
/** Minor units counted in `decimals`; never a float. */
|
|
2137
|
+
readonly rate: string;
|
|
2138
|
+
readonly unit: PayrollTermsUnit;
|
|
2139
|
+
readonly currency: CurrencyCode;
|
|
2140
|
+
readonly decimals: number;
|
|
2141
|
+
/** Epoch milliseconds — when this rate took effect. */
|
|
2142
|
+
readonly effectiveFrom: number;
|
|
2143
|
+
}
|
|
2121
2144
|
/** `id` absent creates a group; `id` present replaces that group in place. */
|
|
2122
2145
|
interface PayrollGroupInput {
|
|
2123
2146
|
readonly id?: PayrollGroupId;
|
|
@@ -2179,6 +2202,8 @@ interface PayrollGroupsMethods {
|
|
|
2179
2202
|
interface PayrollMethods {
|
|
2180
2203
|
runs(options?: PayrollOptions): Promise<CapxulResult<PayrollRuns>>;
|
|
2181
2204
|
authorizeRun(input: AuthorizeRunInput, options?: PayrollOptions): Promise<CapxulResult<PayrollRun>>;
|
|
2205
|
+
/** The active engagement terms of the org's employed people (ruling Q3). */
|
|
2206
|
+
terms(options?: PayrollOptions): Promise<CapxulResult<readonly PayrollEngagementTerms[]>>;
|
|
2182
2207
|
readonly groups: PayrollGroupsMethods;
|
|
2183
2208
|
}
|
|
2184
2209
|
//#endregion
|
|
@@ -2745,6 +2770,16 @@ interface SdkFailureDetail {
|
|
|
2745
2770
|
readonly failure_mode?: string;
|
|
2746
2771
|
readonly reason?: string;
|
|
2747
2772
|
readonly http_status?: number;
|
|
2773
|
+
/** ADR-0023 R7: the chain cause, flat, same keys as every other producer. */
|
|
2774
|
+
readonly chain_upstream?: string;
|
|
2775
|
+
readonly chain_method?: string;
|
|
2776
|
+
readonly chain_retryable?: boolean;
|
|
2777
|
+
readonly chain_http_status?: number;
|
|
2778
|
+
readonly chain_rpc_code?: number;
|
|
2779
|
+
readonly chain_revert_name?: string;
|
|
2780
|
+
readonly chain_revert_selector?: string;
|
|
2781
|
+
readonly chain_revert_args?: Readonly<Record<string, string>>;
|
|
2782
|
+
readonly chain_provider_message?: string;
|
|
2748
2783
|
}
|
|
2749
2784
|
type ObservationDelivery = void | PromiseLike<void>;
|
|
2750
2785
|
/**
|
|
@@ -2765,4 +2800,4 @@ interface ObservationAdapter {
|
|
|
2765
2800
|
/** Stable PostHog event used for typed failures that are expected product outcomes. */
|
|
2766
2801
|
declare const CAPXUL_SDK_EXPECTED_OUTCOME_EVENT = "capxul_sdk_expected_outcome";
|
|
2767
2802
|
//#endregion
|
|
2768
|
-
export {
|
|
2803
|
+
export { OrganizationPaymentsMethods as $, IdentityState as $n, MeMethods as $t, OrgView as A, AccountSetupStep as An, ActivityFilter as At, PayrollGroupInput as B, SubmittedPermissionExecution as Bn, ActivitySummaryTotal as Bt, DetectPendingOrgInvitationsResult as C, RecipientResolutionKind as Cn, AddressBookMethods as Ct, OrgMethods as D, TargetsMethods as Dn, ActivityAnnotation as Dt, MemberView as E, TargetReference as En, InboxMethods as Et, RoleSpendCap as F, OrgLifecycle as Fn, ActivityPage as Ft, PayrollRun as G, RequestStatus as Gn, DestinationKind as Gt, PayrollGroupsMethods as H, PAYMENT_DIRECTIONS as Hn, DepositInstructions as Ht, RoleView as I, OrgSetupStep as In, ActivityRange as It, PayrollRuns as J, TelemetryGroupInput as Jn, DestinationRail as Jt, PayrollRunItemInput as K, CAPXUL_PAYMENTS_V2_ADDRESS as Kn, DestinationListInput as Kt, AuthorizeRunInput as L, ActorRef as Ln, ActivityReference as Lt, OrganizationAuditLogItem as M, IdentityMethods as Mn, ActivityKind as Mt, ResendInviteTokenInput as N, SmartAccountMethods as Nn, ActivityListParams as Nt, OrgScopedMethods as O, fingerprintPaymentIntent as On, ActivityAnnotationInput as Ot, RoleDefinition as P, AuthMethods as Pn, ActivityMethods as Pt, OrganizationPaymentItemInput as Q, IdentityEvent as Qn, HandlesMethods as Qt, PayrollEngagementTerms as R, CurrentHoldings as Rn, ActivitySummary as Rt, CreateOrgInput as S, RecipientResolution as Sn, AddressBookLabelInput as St, MemberStatus as T, ResolvedTarget as Tn, InboxItem as Tt, PayrollMethods as U, PAYMENT_STATUSES as Un, Destination as Ut, PayrollGroupMember as V, InboxStatus as Vn, ActorReference as Vt, PayrollOptions as W, PaymentStatus$1 as Wn, DestinationAddInput as Wt, OrganizationPaymentBatchInput as X, TelemetryPort as Xn, DestinationsMethods as Xt, PayrollTermsUnit as Y, TelemetryIdentifyInput as Yn, DestinationRemoveInput as Yt, OrganizationPaymentInput as Z, Destination$1 as Zn, FinancialOpsMethods as Zt, SystemMethods as _, PaymentStatus as _n, ActorRequest as _t, SdkFailureObservation as a, OfframpStatus as an, isRestoring as ar, PermissionReplaceInput as at, CurrentUserContext as b, PaymentsMethods as bn, AddressBookAddInput as bt, PostHogObservabilityOptions as c, Payment as cn, Budget as ct, CreateCapxulClientInput as d, PaymentDocumentKind as dn, OrgMeOptions as dt, MeProfile as en, OrgLane as er, PermissionAssignInput as et, IdentityProfileDetails as f, PaymentDocumentRef as fn, AccountsMethods as ft, Holding as g, PaymentMoney as gn, ActorRelationshipMethods as gt, HoldingsMethods as h, PaymentDocumentsMethods as hn, ActorProfileMethods as ht, ObservationDelivery as i, OfframpQuoteInput as in, isClaimed as ir, PermissionOptions as it, OrganizationAccount as j, isSettingUpLifecycle as jn, ActivityItem as jt, OrgTemplate as k, AccountLifecycle as kn, ActivityDetail as kt, postHogObservability as l, PaymentActivityEvidence as ln, OrgMe as lt, IdentityRuntimeSendResult as m, PaymentDocumentVerification as mn, ActorProfile as mt, ObservationAdapter as n, OfframpMethods as nn, StateLabel as nr, PermissionCreateInput as nt, HostObservability as o, Payee as on, IdentityTransition as or, PermissionRevokeInput as ot, IdentityRuntime as p, PaymentDocumentRender as pn, AccountMethods as pt, PayrollRunStatus as q, TelemetryEvent as qn, DestinationPayload as qt, ObservationContext as r, OfframpQuote as rn, destination as rr, PermissionMethods as rt, PostHogObservabilityClient as s, PayeesMethods as sn, InvocationControls as sr, PermissionReadResult as st, CAPXUL_SDK_EXPECTED_OUTCOME_EVENT as t, MovementActivityEvidence as tn, Readiness as tr, PermissionChangeInput as tt, CapxulClient as u, PaymentDirection as un, OrgMeMethod as ut, SystemHealth as v, PaymentTiming as vn, ActorRequestIssueInput as vt, InviteMemberInput as w, Ref$1 as wn, InboxApproveInput as wt, CurrentUserMethods as x, PaymentsPayInput as xn, AddressBookEntry as xt, MediaMethods as y, PaymentType as yn, ActorRequestsMethods as yt, PayrollGroup as z, Permission as zn, ActivitySummaryParams as zt };
|
|
@@ -1,27 +1,45 @@
|
|
|
1
1
|
import { Account, Hex } from "viem";
|
|
2
2
|
import { Context, Effect } from "effect";
|
|
3
3
|
|
|
4
|
+
//#region ../errors/src/chain-cause.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Why an operation failed — the one flat vocabulary. The first four are the
|
|
7
|
+
* auth/provider diagnoses that predate this file. The rest name the chain
|
|
8
|
+
* path. `FailureMode` is derived from this list so a runtime membership check
|
|
9
|
+
* (the SDK's `$exception` projection, the observability schema) and the type
|
|
10
|
+
* can never drift apart.
|
|
11
|
+
*/
|
|
12
|
+
declare const FAILURE_MODES: readonly [/** OTP cookies live on `localhost:PORT` but OpenFort hits the Convex host. */"auth-origin-mismatch", /** An old `userId` in scoped storage makes the SDK skip re-auth → 401. */"stale-openfort-cache", /** The selected app/deployment origin is not allowlisted → 401. */"app-env-allowlist", /** Sandboxed/headless browser with no Web Crypto. */"no-secure-context", /** One upstream answered HTTP 429 or JSON-RPC -32005. Retryable. */"rate-limited", /** No answer inside the budget. Retryable. */"timeout", /** HTTP 5xx, a connection failure, or a malformed envelope. Retryable. */"upstream-down", /** Simulation or execution reverted; `chain.revert` names it when decodable. */"revert", /** A balance pre-flight shortfall or a decoded `ERC20InsufficientBalance`. */"insufficient-balance", /** A decoded `ERC20InsufficientAllowance`. */"insufficient-allowance", /** The bundler's validation refused the operation (AA2x/AA3x); its text is carried. */"rejected", /** The gateway refused the token. */"unauthorized", /** No cause could be determined. */"unknown"];
|
|
13
|
+
type FailureMode = (typeof FAILURE_MODES)[number];
|
|
14
|
+
/** Who answered. `alto` is the bundler; `gateway` is the AA gateway's own logic. */
|
|
15
|
+
declare const CHAIN_UPSTREAMS: readonly ["alchemy", "infura", "public", "alto", "gateway"];
|
|
16
|
+
type ChainUpstream = (typeof CHAIN_UPSTREAMS)[number];
|
|
17
|
+
/** A decoded revert. `name` is null when the selector is unknown or the data was empty. */
|
|
18
|
+
type RevertSummary = {
|
|
19
|
+
readonly name: string | null;
|
|
20
|
+
readonly selector: string;
|
|
21
|
+
readonly args: Readonly<Record<string, string>>;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* The structured cause of a chain-path failure. Built once by the layer that
|
|
25
|
+
* saw the failure and passed on unchanged. `providerMessage` is the provider's
|
|
26
|
+
* own words, bounded and secret-masked by the producer; it is evidence, never
|
|
27
|
+
* something a consumer routes on.
|
|
28
|
+
*/
|
|
29
|
+
type ChainCause = {
|
|
30
|
+
readonly mode: FailureMode;
|
|
31
|
+
readonly upstream: ChainUpstream;
|
|
32
|
+
readonly method: string;
|
|
33
|
+
readonly retryable: boolean;
|
|
34
|
+
readonly httpStatus?: number;
|
|
35
|
+
readonly rpcCode?: number;
|
|
36
|
+
readonly revert?: RevertSummary;
|
|
37
|
+
readonly providerMessage?: string;
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
4
40
|
//#region ../errors/src/errors.d.ts
|
|
5
41
|
declare const CAPXUL_ERROR_CODES: readonly ["NOT_AUTHENTICATED", "EMAIL_DELIVERY_FAILED", "PROFILE_NOT_FOUND", "SMART_ACCOUNT_MISSING", "PLAYER_NOT_FOUND", "ACCOUNT_NOT_FOUND", "PROVIDER_ERROR", "CAPABILITY_UNAVAILABLE", "INVALID_INPUT", "ENV_MISSING", "NOT_IMPLEMENTED", "VERIFICATION_REQUIRED", "INSUFFICIENT_BALANCE", "INVALID_RECIPIENT", "ROLE_PERMISSION_DENIED", "TRANSACTION_FAILED", "RATE_LIMITED", "NETWORK_ERROR", "UNKNOWN", "OTP_EXPIRED", "SIGNER_REJECTED", "CANCELLED", "WRONG_STATE", "STALE_EPOCH", "SUPERSEDED", "WORK_DIED", "ACTOR_STOPPED"];
|
|
6
42
|
type CapxulErrorCode = (typeof CAPXUL_ERROR_CODES)[number];
|
|
7
|
-
/**
|
|
8
|
-
* Why an auth/provider call failed — a flat CAUSE enum. The *where* (which
|
|
9
|
-
* OpenFort operation) stays in the separate `operation` detail field; this
|
|
10
|
-
* names the root cause so a single `$exception` can be triaged without
|
|
11
|
-
* parsing the message. Five members, no free strings:
|
|
12
|
-
*
|
|
13
|
-
* - `auth-origin-mismatch`: OTP cookies live on `localhost:PORT` but OpenFort
|
|
14
|
-
* hits the Convex host → no session reaches the provider.
|
|
15
|
-
* - `stale-openfort-cache`: an old `userId` in scoped storage makes the SDK
|
|
16
|
-
* skip re-auth → 401 on `v2/accounts`.
|
|
17
|
-
* - `app-env-allowlist`: the selected app/deployment origin is not allowlisted
|
|
18
|
-
* → 401.
|
|
19
|
-
* - `no-secure-context`: sandboxed/headless browser with no Web Crypto, so
|
|
20
|
-
* `getAddress`/`configure` can never produce an address. Previously vanished
|
|
21
|
-
* into `unknown`; the signer's secure-context probe now names it.
|
|
22
|
-
* - `unknown`: catch-all when no cause could be determined.
|
|
23
|
-
*/
|
|
24
|
-
type FailureMode = "auth-origin-mismatch" | "stale-openfort-cache" | "app-env-allowlist" | "no-secure-context" /** #1684: an upstream RPC provider throttled the call (HTTP 429 or JSON-RPC -32005). Retryable. */ | "rate-limited" | "unknown";
|
|
25
43
|
/**
|
|
26
44
|
* The one failure representation carried by domain state, actor work, and
|
|
27
45
|
* public error projection. Keeping it beside the canonical error catalog
|
|
@@ -46,12 +64,18 @@ type CapxulErrorOptions = {
|
|
|
46
64
|
readonly details?: CapxulErrorDetails;
|
|
47
65
|
readonly correlationId?: string;
|
|
48
66
|
readonly layer?: string;
|
|
67
|
+
readonly mode?: FailureMode;
|
|
68
|
+
readonly chain?: ChainCause;
|
|
49
69
|
};
|
|
50
70
|
declare class CapxulError extends Error {
|
|
51
71
|
readonly code: CapxulErrorCode;
|
|
52
72
|
readonly details?: CapxulErrorDetails;
|
|
53
73
|
readonly correlationId?: string;
|
|
54
74
|
readonly layer?: string;
|
|
75
|
+
/** The one-word cause (`FailureMode`). `chain.mode` when a chain cause is set. */
|
|
76
|
+
readonly mode?: FailureMode;
|
|
77
|
+
/** The structured chain-path cause. Never rewritten by a later layer. */
|
|
78
|
+
readonly chain?: ChainCause;
|
|
55
79
|
constructor(code: CapxulErrorCode, message: string, options?: CapxulErrorOptions);
|
|
56
80
|
}
|
|
57
81
|
declare function isCapxulError(value: unknown): value is CapxulError;
|
|
@@ -67,7 +91,8 @@ declare const Errors: {
|
|
|
67
91
|
readonly providerError: (provider: string, operation: string, cause: unknown, opts?: {
|
|
68
92
|
readonly failure_mode?: FailureMode;
|
|
69
93
|
readonly httpStatus?: number; /** Extra evidence for the operator (response body, edge error code). */
|
|
70
|
-
readonly details?: Readonly<Record<string, unknown>>;
|
|
94
|
+
readonly details?: Readonly<Record<string, unknown>>; /** The structured chain-path cause; sets `mode` and `details.failure_mode` too. */
|
|
95
|
+
readonly chain?: ChainCause;
|
|
71
96
|
}) => CapxulError;
|
|
72
97
|
readonly capabilityUnavailable: (provider: string, operation: string) => CapxulError;
|
|
73
98
|
readonly invalidInput: (field: string, reason: string) => CapxulError;
|
|
@@ -418,4 +443,4 @@ interface Eip1193RequestProvider {
|
|
|
418
443
|
*/
|
|
419
444
|
declare function injectedWalletSigner(provider: Eip1193RequestProvider): CapxulSigner;
|
|
420
445
|
//#endregion
|
|
421
|
-
export { WeiAmount as $, BlockNumber as A, OrgId as B, Address$1 as C, AppId as D, AnonymousDistinctId as E, DocumentHash as F, PermissionAssignmentId as G, PaymentCommandId as H, DurationMs as I, PublishableKey as J, PermissionId as K, Email as L, ChainId as M, CountryCode as N, AuthSession as O, CurrencyCode as P, TxHash as Q, EpochMs as R, AccountId as S, AllowedOrigin as T, PayrollGroupId as U, PartyId as V, PayrollRunId as W, SessionToken as X, RoleKey as Y, SmartAccount$1 as Z, AuthCacheError as _, SignerStatusStore as a, CapxulErrorDetails as at, CachedJwt as b, AccountProviderSource as c,
|
|
446
|
+
export { WeiAmount as $, BlockNumber as A, OrgId as B, Address$1 as C, AppId as D, AnonymousDistinctId as E, DocumentHash as F, PermissionAssignmentId as G, PaymentCommandId as H, DurationMs as I, PublishableKey as J, PermissionId as K, Email as L, ChainId as M, CountryCode as N, AuthSession as O, CurrencyCode as P, TxHash as Q, EpochMs as R, AccountId as S, AllowedOrigin as T, PayrollGroupId as U, PartyId as V, PayrollRunId as W, SessionToken as X, RoleKey as Y, SmartAccount$1 as Z, AuthCacheError as _, SignerStatusStore as a, CapxulErrorDetails as at, CachedJwt as b, AccountProviderSource as c, isCapxulError as ct, eip1193AccountProvider as d, ChainUpstream as dt, toAddress as et, localPrivateKeyAccountProvider as f, FAILURE_MODES as ft, SmartAccount as g, Session as h, SignerStatus as i, CapxulErrorCode as it, BudgetId as j, AuthUserId as k, AccountRequirement as l, CHAIN_UPSTREAMS as lt, Profile as m, RevertSummary as mt, CapxulSigner as n, CAPXUL_ERROR_CODES as nt, injectedWalletSigner as o, Errors as ot, CapxulResult as p, FailureMode as pt, Profile$1 as q, Eip1193RequestProvider as r, CapxulError as rt, AccountProvider as s, Failure as st, CapxulDigestSigner as t, toCountryCode as tt, Eip1193Provider as u, ChainCause as ut, AuthCachePort as v, AllowanceKey as w, Account$1 as x, AuthCachePortTag as y, Money as z };
|
package/dist/testing/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Jn as TelemetryGroupInput, Yn as TelemetryIdentifyInput, n as ObservationAdapter, or as IdentityTransition, qn as TelemetryEvent, u as CapxulClient } from "../observation-Desw1A8U.mjs";
|
|
2
2
|
import { Effect, Layer } from "effect";
|
|
3
3
|
|
|
4
4
|
//#region src/testing/telemetry/RecordingTelemetryAdapter.d.ts
|
package/dist/testing/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as deriveCapxulSafeAddress,
|
|
2
|
-
import { B as Errors, C as toDurationMs, D as toJwtToken, E as toEpochSeconds, F as toSessionToken, N as toPublishableKey, O as toKycTier, R as CapxulError, T as toEpochMs, _ as toAppId, b as toChainId, g as toAllowedOrigin, h as toAddress, m as toAccountId, t as InMemoryAuthCacheAdapter, v as toAuthUserId, w as toEmail, x as toCountryCode } from "../InMemoryAuthCacheAdapter-
|
|
1
|
+
import { $ as deriveCapxulSafeAddress, P as fromWei, b as authClientPortFromPromiseAdapter, c as smartAccountErrorFromCapxul, d as wireChainId, h as convexCallErrorFromCapxul, o as redactTelemetryEvent, p as identityErrorFromCapxul, t as assembleCapxulClient, u as accountReadErrorFromCapxul, w as toWei, y as bootstrapErrorFromCapxul } from "../create-capxul-client-BuEjwJS6.mjs";
|
|
2
|
+
import { B as Errors, C as toDurationMs, D as toJwtToken, E as toEpochSeconds, F as toSessionToken, N as toPublishableKey, O as toKycTier, R as CapxulError, T as toEpochMs, _ as toAppId, b as toChainId, g as toAllowedOrigin, h as toAddress, m as toAccountId, t as InMemoryAuthCacheAdapter, v as toAuthUserId, w as toEmail, x as toCountryCode } from "../InMemoryAuthCacheAdapter-VZBv1fOH.mjs";
|
|
3
3
|
import { keccak256 } from "viem";
|
|
4
4
|
import { Effect, Result, Semaphore } from "effect";
|
|
5
5
|
import { getFunctionName } from "convex/server";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capxul/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/Xelmar-tech/infrastructure.git",
|
|
@@ -47,11 +47,11 @@
|
|
|
47
47
|
"vite-plus": "0.1.23",
|
|
48
48
|
"vitest": "npm:@voidzero-dev/vite-plus-test@0.1.23",
|
|
49
49
|
"@capxul/errors": "0.0.2",
|
|
50
|
-
"@capxul/
|
|
51
|
-
"@capxul/types": "0.2.1",
|
|
52
|
-
"@capxul/wire": "0.5.1",
|
|
50
|
+
"@capxul/observability": "2.6.0",
|
|
53
51
|
"@capxul/typescript-config": "0.0.0",
|
|
54
|
-
"@capxul/
|
|
52
|
+
"@capxul/wire": "0.5.1",
|
|
53
|
+
"@capxul/config": "0.2.1",
|
|
54
|
+
"@capxul/types": "0.2.1"
|
|
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": {
|