@capxul/sdk 3.1.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,9 +1,427 @@
1
- import { $ as RoleKey, D as Address, E as AccountId, F as BudgetId, G as PartyId, J as PayrollRunId, L as CountryCode, M as AuthSession, N as AuthUserId, T as Account, U as Money, W as OrgId, _t as FailureMode, a as SignerStatusStore, at as toCountryCode, c as AccountProviderSource, ct as CapxulErrorCode, d as eip1193AccountProvider, f as localPrivateKeyAccountProvider, ft as isCapxulError, g as SmartAccount, gt as FAILURE_MODES, h as Session, ht as ChainUpstream, i as SignerStatus, it as toAddress, l as AccountRequirement, lt as CapxulErrorDetails, m as Profile, mt as ChainCause, n as CapxulSigner, o as injectedWalletSigner, ot as CAPXUL_ERROR_CODES, p as CapxulResult, pt as CHAIN_UPSTREAMS, q as PayrollGroupId, r as Eip1193RequestProvider, s as AccountProvider, st as CapxulError, t as CapxulDigestSigner, u as Eip1193Provider, ut as Errors, vt as RevertSummary, w as CAPXUL_PAYMENTS_V2_ADDRESS } from "./signer-BpjdawiY.mjs";
2
- import { $ as OrganizationPaymentsMethods, $n as OrgLane, $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, 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 IdentityState, 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 Destination$1, Xt as DestinationsMethods, Y as PayrollTermsUnit, Yn as TelemetryPort, Yt as DestinationRemoveInput, Z as OrganizationPaymentInput, Zn as IdentityEvent, Zt as FinancialOpsMethods, _ as SystemMethods, _n as PaymentStatus, _t as ActorRequest, a as SdkFailureObservation, an as OfframpStatus, ar as IdentityTransition, 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 Readiness, 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 isRestoring, 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 destination, nt as PermissionCreateInput, o as HostObservability, on as Payee, or as InvocationControls, 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 isClaimed, rt as PermissionMethods, s as PostHogObservabilityClient, sn as PayeesMethods, st as PermissionReadResult, t as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, tn as MovementActivityEvidence, tr as StateLabel, 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-B3PCugGC.mjs";
3
- import "./OAuthBearerAuthClient-BxTiv8dg.mjs";
4
- import { Hex } from "viem";
1
+ import { E as Address, H as Money, I as CountryCode, K as PayrollGroupId, M as AuthUserId, P as BudgetId, Q as RoleKey, T as AccountId, U as OrgId, W as PartyId, _t as FailureMode, a as SignerStatusStore, at as CAPXUL_PAYMENTS_V2_ADDRESS, c as AccountProviderSource, ct as CapxulErrorCode, d as eip1193AccountProvider, f as localPrivateKeyAccountProvider, ft as isCapxulError, g as SmartAccount, gt as FAILURE_MODES, h as Session, ht as ChainUpstream, i as SignerStatus, it as toCountryCode, j as AuthSession, l as AccountRequirement, lt as CapxulErrorDetails, m as Profile, mt as ChainCause, n as CapxulSigner, o as injectedWalletSigner, ot as CAPXUL_ERROR_CODES, p as CapxulResult, pt as CHAIN_UPSTREAMS, q as PayrollRunId, r as Eip1193RequestProvider, rt as toAddress, s as AccountProvider, st as CapxulError, t as CapxulDigestSigner, u as Eip1193Provider, ut as Errors, vt as RevertSummary, w as Account } from "./signer-DOqb8M1Y.mjs";
2
+ import { $ as OrganizationPaymentsMethods, $t as DestinationRail, A as OrgView, An as ResolvedTarget, At as InboxItem, B as PayrollGroupInput, Bn as AuthMethods, Bt as ActivityPage, C as DetectPendingOrgInvitationsResult, Cn as PaymentTiming, Ct as ActorRequestIssueInput, D as OrgMethods, Dn as RecipientResolution, Dt as AddressBookLabelInput, E as MemberView, En as PaymentsPayInput, Et as AddressBookEntry, F as RoleSpendCap, Fn as AccountSetupStep, Ft as ActivityFilter, G as PayrollRun, Gn as Permission, Gt as ActivitySummaryTotal, H as PayrollGroupsMethods, Hn as OrgSetupStep, Ht as ActivityReference, I as RoleView, In as isSettingUpLifecycle, It as ActivityItem, J as PayrollRuns, Jn as PAYMENT_DIRECTIONS, Jt as Destination, K as PayrollRunItemInput, Kn as SubmittedPermissionExecution, Kt as ActorReference, L as AuthorizeRunInput, Ln as CompleteProfileInput, Lt as ActivityKind, M as OrganizationAuditLogItem, Mn as TargetsMethods, Mt as ActivityAnnotation, N as ResendInviteTokenInput, Nn as fingerprintPaymentIntent, Nt as ActivityAnnotationInput, O as OrgScopedMethods, On as RecipientResolutionKind, Ot as AddressBookMethods, P as RoleDefinition, Pn as AccountLifecycle, Pt as ActivityDetail, Q as OrganizationPaymentItemInput, Qt as DestinationPayload, R as PayrollEngagementTerms, Rn as IdentityMethods, Rt as ActivityListParams, S as CreateOrgInput, Sn as PaymentStatus, St as ActorRequest, T as MemberStatus, Tn as PaymentsMethods, Tt as AddressBookAddInput, U as PayrollMethods, Un as ActorRef, Ut as ActivitySummary, V as PayrollGroupMember, Vn as OrgLifecycle, Vt as ActivityRange, W as PayrollOptions, Wn as CurrentHoldings, Wt as ActivitySummaryParams, X as OrganizationPaymentBatchInput, Xn as PaymentStatus$1, Xt as DestinationKind, Y as PayrollTermsUnit, Yn as PAYMENT_STATUSES, Yt as DestinationAddInput, Z as OrganizationPaymentInput, Zn as RequestStatus, Zt as DestinationListInput, _ as SystemMethods, _n as PaymentDocumentRef, _t as ReadyAccountLifecycle, a as SdkFailureObservation, an as MeProfile, ar as OrgLane, at as PermissionReplaceInput, b as CurrentUserContext, bn as PaymentDocumentsMethods, bt as ActorProfileMethods, c as PostHogObservabilityOptions, cn as OfframpQuote, cr as destination, ct as Budget, d as CreateCapxulClientInput, dn as Payee, dr as IdentityTransition, dt as OrgMeOptions, en as DestinationRemoveInput, et as PermissionAssignInput, f as IdentityProfileDetails, fn as PayeesMethods, fr as InvocationControls, ft as AccountsMethods, g as Holding, gn as PaymentDocumentKind, gt as PersonOnboardingInput, h as HoldingsMethods, hn as PaymentDirection, ht as PersonOnboarding, i as ObservationDelivery, in as MeMethods, ir as IdentityState, it as PermissionOptions, j as OrganizationAccount, jn as TargetReference, jt as InboxMethods, k as OrgTemplate, kn as Ref, kt as InboxApproveInput, l as postHogObservability, ln as OfframpQuoteInput, lr as isClaimed, lt as OrgMe, m as IdentityRuntimeSendResult, mn as PaymentActivityEvidence, mt as OnboardingMethods, n as ObservationAdapter, nn as FinancialOpsMethods, nr as Destination$1, nt as PermissionCreateInput, o as HostObservability, on as MovementActivityEvidence, or as Readiness, ot as PermissionRevokeInput, p as IdentityRuntime, pn as Payment, pt as CompletedPersonProfile, q as PayrollRunStatus, qn as InboxStatus, qt as DepositInstructions, r as ObservationContext, rn as HandlesMethods, rr as IdentityEvent, rt as PermissionMethods, s as PostHogObservabilityClient, sn as OfframpMethods, sr as StateLabel, st as PermissionReadResult, t as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, tn as DestinationsMethods, tr as TelemetryPort, tt as PermissionChangeInput, u as CapxulClient, un as OfframpStatus, ur as isRestoring, ut as OrgMeMethod, v as SystemHealth, vn as PaymentDocumentRender, vt as AccountMethods, w as InviteMemberInput, wn as PaymentType, wt as ActorRequestsMethods, x as CurrentUserMethods, xn as PaymentMoney, xt as ActorRelationshipMethods, y as MediaMethods, yn as PaymentDocumentVerification, yt as ActorProfile, z as PayrollGroup, zn as SmartAccountMethods, zt as ActivityMethods } from "./observation-B76zFxd6.mjs";
3
+ import "./OAuthBearerAuthClient-CsOgeeZa.mjs";
5
4
  import { Context, Effect, Layer } from "effect";
5
+ import { Hex } from "viem";
6
6
  import { FunctionReference } from "convex/server";
7
+ //#region ../observability/src/operations.d.ts
8
+ declare const CAPXUL_OPERATIONS: {
9
+ readonly account: {
10
+ readonly addressBook: {
11
+ readonly add: "account.addressBook.add";
12
+ readonly get: "account.addressBook.get";
13
+ readonly hide: "account.addressBook.hide";
14
+ readonly label: "account.addressBook.label";
15
+ readonly list: "account.addressBook.list";
16
+ readonly unhide: "account.addressBook.unhide";
17
+ };
18
+ readonly balance: "account.balance";
19
+ readonly faucetMint: "account.faucetMint";
20
+ readonly getLifecycle: "account.getLifecycle";
21
+ readonly readBalance: "account.readBalance";
22
+ readonly retrySetup: "account.retrySetup";
23
+ readonly status: "account.status";
24
+ readonly profile: {
25
+ readonly depositInstructions: "account.profile.depositInstructions";
26
+ readonly get: "account.profile.get";
27
+ };
28
+ readonly inbox: {
29
+ readonly approve: "account.inbox.approve";
30
+ readonly decline: "account.inbox.decline";
31
+ readonly list: "account.inbox.list";
32
+ };
33
+ readonly requests: {
34
+ readonly cancel: "account.requests.cancel";
35
+ readonly get: "account.requests.get";
36
+ readonly issue: "account.requests.issue";
37
+ readonly list: "account.requests.list";
38
+ };
39
+ };
40
+ readonly accounts: {
41
+ readonly fund: "accounts.fund";
42
+ readonly read: "accounts.read";
43
+ };
44
+ readonly activity: {
45
+ readonly annotate: "activity.annotate";
46
+ readonly get: "activity.get";
47
+ readonly list: "activity.list";
48
+ readonly summary: "activity.summary";
49
+ };
50
+ readonly addressBook: {
51
+ readonly add: "addressBook.add";
52
+ readonly get: "addressBook.get";
53
+ readonly hide: "addressBook.hide";
54
+ readonly label: "addressBook.label";
55
+ readonly list: "addressBook.list";
56
+ readonly unhide: "addressBook.unhide";
57
+ };
58
+ readonly applications: {
59
+ readonly create: "applications.create";
60
+ };
61
+ readonly auth: {
62
+ readonly canSendOtp: "auth.canSendOtp";
63
+ readonly getSession: "auth.getSession";
64
+ readonly signIn: "auth.signIn";
65
+ readonly signOut: "auth.signOut";
66
+ readonly sendVerificationOtp: "auth.sendVerificationOTP";
67
+ readonly verifyOtp: "auth.verifyOtp";
68
+ };
69
+ readonly client: {
70
+ readonly createOrg: "createOrg";
71
+ readonly orgs: "orgs";
72
+ };
73
+ readonly credentials: {
74
+ readonly bootstrapClient: "credentials.bootstrapClient";
75
+ readonly mintQuickstartKey: "credentials.mintQuickstartKey";
76
+ };
77
+ readonly currentUser: {
78
+ readonly get: "currentUser.get";
79
+ };
80
+ readonly devIdentity: {
81
+ readonly seedFinancialOpsOrg: "devIdentity.seedFinancialOpsOrg";
82
+ };
83
+ readonly dev: {
84
+ readonly browserSeed: "dev.browserSeed";
85
+ };
86
+ readonly destinations: {
87
+ readonly add: "destinations.add";
88
+ readonly list: "destinations.list";
89
+ readonly remove: "destinations.remove";
90
+ };
91
+ readonly faucetSafe: {
92
+ readonly deploy: "FaucetSafe.deploy";
93
+ };
94
+ readonly financialOps: {
95
+ readonly addDestination: "financialOps.addDestination";
96
+ readonly approveRequest: "financialOps.approveRequest";
97
+ readonly cancelRequest: "financialOps.cancelRequest";
98
+ readonly createPayee: "financialOps.createPayee";
99
+ readonly declineRequest: "financialOps.declineRequest";
100
+ readonly emitPaymentWriterTelemetry: "financialOps.emitPaymentWriterTelemetry";
101
+ readonly issueRequest: "financialOps.issueRequest";
102
+ readonly recoverSettlementVerification: "financialOps.recoverSettlementVerification";
103
+ readonly removeDestination: "financialOps.removeDestination";
104
+ readonly verifySettlement: "financialOps.verifySettlement";
105
+ };
106
+ readonly holdings: {
107
+ readonly current: "holdings.current";
108
+ readonly primary: "holdings.primary";
109
+ };
110
+ readonly handles: {
111
+ readonly resolve: "handles.resolve";
112
+ };
113
+ readonly identity: {
114
+ readonly accountAt: "identity.AccountAt";
115
+ readonly accountClaimed: "identity.AccountClaimed";
116
+ readonly accountClaiming: "identity.AccountClaiming";
117
+ readonly accountDerived: "identity.AccountDerived";
118
+ readonly accountFailed: "identity.AccountFailed";
119
+ readonly attachOrganization: "identity.AttachOrganization";
120
+ readonly claimAccount: "identity.ClaimAccount";
121
+ readonly completeOnboarding: "identity.completeOnboarding";
122
+ readonly completeProfile: "identity.completeProfile";
123
+ readonly create: "identity.create";
124
+ readonly createOrganization: "identity.CreateOrganization";
125
+ readonly ensureAccount: "identity.EnsureAccount";
126
+ readonly leaveOrganization: "identity.LeaveOrganization";
127
+ readonly loadCurrent: "identity.loadCurrent";
128
+ readonly orgAt: "identity.OrgAt";
129
+ readonly orgFailed: "identity.OrgFailed";
130
+ readonly orgReady: "identity.OrgReady";
131
+ readonly otpFailed: "identity.OtpFailed";
132
+ readonly otpSent: "identity.OtpSent";
133
+ readonly readSession: "identity.ReadSession";
134
+ readonly requestOtp: "identity.RequestOtp";
135
+ readonly reset: "identity.Reset";
136
+ readonly restoreSession: "identity.RestoreSession";
137
+ readonly resumeOtpEntry: "identity.ResumeOtpEntry";
138
+ readonly retryAccount: "identity.RetryAccount";
139
+ readonly retryOrganization: "identity.RetryOrganization";
140
+ readonly sessionAbsent: "identity.SessionAbsent";
141
+ readonly sessionRead: "identity.SessionRead";
142
+ readonly sessionReadFailed: "identity.SessionReadFailed";
143
+ readonly sessionRestored: "identity.SessionRestored";
144
+ readonly signedOut: "identity.SignedOut";
145
+ readonly signOut: "identity.SignOut";
146
+ readonly signOutFailed: "identity.SignOutFailed";
147
+ readonly update: "identity.update";
148
+ readonly usernameAvailable: "identity.usernameAvailable";
149
+ readonly verified: "identity.Verified";
150
+ readonly verifyFailed: "identity.VerifyFailed";
151
+ readonly verifyOtp: "identity.VerifyOtp";
152
+ };
153
+ readonly media: {
154
+ readonly generateUploadUrl: "media.generateUploadUrl";
155
+ readonly setOrgLogo: "media.setOrgLogo";
156
+ readonly setProfileImage: "media.setProfileImage";
157
+ readonly uploadImage: "media.uploadImage";
158
+ };
159
+ readonly me: {
160
+ readonly depositInstructions: "me.depositInstructions";
161
+ readonly get: "me.get";
162
+ };
163
+ readonly moneyExecution: {
164
+ readonly prepareOrganizationPaymentExecution: "moneyExecution.prepareOrganizationPaymentExecution";
165
+ readonly preparePaymentExecution: "moneyExecution.preparePaymentExecution";
166
+ readonly preparePaymentLifecycleExecution: "moneyExecution.preparePaymentLifecycleExecution";
167
+ readonly preparePermissionExecution: "moneyExecution.preparePermissionExecution";
168
+ readonly submit: "moneyExecution.submit";
169
+ readonly submitPaymentCommandExecution: "moneyExecution.submitPaymentCommandExecution";
170
+ readonly submitPaymentExecution: "moneyExecution.submitPaymentExecution";
171
+ readonly submitPermissionExecution: "moneyExecution.submitPermissionExecution";
172
+ };
173
+ readonly movement: {
174
+ readonly emitDepositSettled: "movement.emitDepositSettled";
175
+ readonly scan: "movement.scan";
176
+ };
177
+ readonly inbox: {
178
+ readonly approve: "inbox.approve";
179
+ readonly decline: "inbox.decline";
180
+ readonly list: "inbox.list";
181
+ };
182
+ readonly offramp: {
183
+ readonly quote: "offramp.quote";
184
+ readonly status: "offramp.status";
185
+ };
186
+ readonly onboarding: {
187
+ readonly completePerson: "onboarding.completePerson";
188
+ };
189
+ readonly org: {
190
+ readonly account: {
191
+ readonly get: "org.account.get";
192
+ };
193
+ readonly auditLog: "org.auditLog";
194
+ readonly confirmBootstrap: "org.confirmBootstrap";
195
+ readonly createOrg: "org.createOrg";
196
+ readonly create: "org.create";
197
+ readonly detectAndAcceptPendingInvitations: "org.detectAndAcceptPendingInvitations";
198
+ readonly expireInvitations: "org.expireInvitations";
199
+ readonly getLifecycle: "org.getLifecycle";
200
+ readonly getProofReceipt: "org.getProofReceipt";
201
+ readonly invite: "org.invite";
202
+ readonly inviteMember: "org.inviteMember";
203
+ readonly load: "org.load";
204
+ readonly me: "org.me";
205
+ readonly members: "org.members";
206
+ readonly orgs: "org.orgs";
207
+ readonly payment: "org.payment";
208
+ readonly permissions: {
209
+ readonly assign: "org.permissions.assign";
210
+ readonly change: "org.permissions.change";
211
+ readonly create: "org.permissions.create";
212
+ readonly get: "org.permissions.get";
213
+ readonly list: "org.permissions.list";
214
+ readonly replace: "org.permissions.replace";
215
+ readonly revoke: "org.permissions.revoke";
216
+ };
217
+ readonly payments: {
218
+ readonly pay: "org.payments.pay";
219
+ readonly payBatch: "org.payments.payBatch";
220
+ };
221
+ readonly payroll: {
222
+ readonly authorizeRun: "org.payroll.authorizeRun";
223
+ readonly groups: {
224
+ readonly list: "org.payroll.groups.list";
225
+ readonly remove: "org.payroll.groups.remove";
226
+ readonly save: "org.payroll.groups.save";
227
+ };
228
+ readonly runs: "org.payroll.runs";
229
+ readonly terms: "org.payroll.terms";
230
+ };
231
+ readonly addressBook: {
232
+ readonly add: "org.addressBook.add";
233
+ readonly get: "org.addressBook.get";
234
+ readonly hide: "org.addressBook.hide";
235
+ readonly label: "org.addressBook.label";
236
+ readonly list: "org.addressBook.list";
237
+ readonly unhide: "org.addressBook.unhide";
238
+ };
239
+ readonly inbox: {
240
+ readonly approve: "org.inbox.approve";
241
+ readonly decline: "org.inbox.decline";
242
+ readonly list: "org.inbox.list";
243
+ };
244
+ readonly lifecycle: {
245
+ readonly startOrResume: "org.lifecycle.startOrResume";
246
+ };
247
+ readonly prepareBootstrap: "org.prepareBootstrap";
248
+ readonly prepareFounderAccount: "org.prepareFounderAccount";
249
+ readonly profile: {
250
+ readonly depositInstructions: "org.profile.depositInstructions";
251
+ readonly get: "org.profile.get";
252
+ };
253
+ readonly readTreasury: "org.readTreasury";
254
+ readonly requests: {
255
+ readonly cancel: "org.requests.cancel";
256
+ readonly get: "org.requests.get";
257
+ readonly issue: "org.requests.issue";
258
+ readonly list: "org.requests.list";
259
+ };
260
+ readonly recordFailure: "org.recordFailure";
261
+ readonly recordProgress: "org.recordProgress";
262
+ readonly resendInviteToken: "org.resendInviteToken";
263
+ readonly resumeBootstrapSubmission: "org.resumeBootstrapSubmission";
264
+ readonly retry: "org.retry";
265
+ readonly retrySetup: "org.retrySetup";
266
+ readonly roles: "org.roles";
267
+ readonly startOrResume: "org.startOrResume";
268
+ readonly submitBootstrap: "org.submitBootstrap";
269
+ readonly treasury: "org.treasury";
270
+ };
271
+ readonly organization: {
272
+ readonly setup: "organization.setup";
273
+ };
274
+ readonly organizationPayments: {
275
+ readonly pay: "organizationPayments.pay";
276
+ readonly payBatch: "organizationPayments.payBatch";
277
+ readonly prepareExecution: "organizationPayments.prepareExecution";
278
+ };
279
+ readonly organizationSetup: {
280
+ readonly getProofReceipt: "organizationSetup.getProofReceipt";
281
+ };
282
+ readonly organizations: {
283
+ readonly detectAndAcceptPendingInvitations: "orgs.detectAndAcceptPendingInvitations";
284
+ };
285
+ readonly payments: {
286
+ readonly cancel: "payments.cancel";
287
+ readonly claim: "payments.claim";
288
+ readonly createCommitment: "payments.createCommitment";
289
+ readonly get: "payments.get";
290
+ readonly ledger: "payments";
291
+ readonly list: "payments.list";
292
+ readonly pay: "payments.pay";
293
+ readonly prepareExecution: "payments.prepareExecution";
294
+ readonly prepareLifecycleExecution: "payments.prepareLifecycleExecution";
295
+ readonly redirect: "payments.redirect";
296
+ readonly submitCommandExecution: "payments.submitCommandExecution";
297
+ readonly submitExecution: "payments.submitExecution";
298
+ };
299
+ readonly paymentDocuments: {
300
+ readonly render: "paymentDocuments.render";
301
+ readonly verify: "paymentDocuments.verify";
302
+ };
303
+ readonly payees: {
304
+ readonly create: "payees.create";
305
+ readonly get: "payees.get";
306
+ readonly resolve: "payees.resolve";
307
+ };
308
+ readonly payroll: {
309
+ readonly authorizeRun: "payroll.authorizeRun";
310
+ readonly groups: {
311
+ readonly access: "payroll.groups";
312
+ readonly list: "payroll.groups.list";
313
+ readonly remove: "payroll.groups.remove";
314
+ readonly save: "payroll.groups.save";
315
+ };
316
+ readonly removeGroup: "payroll.removeGroup";
317
+ readonly runs: "payroll.runs";
318
+ readonly saveGroup: "payroll.saveGroup";
319
+ readonly terms: "payroll.terms";
320
+ };
321
+ readonly permission: {
322
+ readonly command: "permission.command";
323
+ readonly retryVerification: "permission.retryVerification";
324
+ readonly verify: "permission.verify";
325
+ readonly verifySubmitted: "permission.verifySubmitted";
326
+ };
327
+ readonly permissions: {
328
+ readonly assign: "permissions.assign";
329
+ readonly change: "permissions.change";
330
+ readonly create: "permissions.create";
331
+ readonly get: "permissions.get";
332
+ readonly list: "permissions.list";
333
+ readonly prepareExecution: "permissions.prepareExecution";
334
+ readonly replace: "permissions.replace";
335
+ readonly revoke: "permissions.revoke";
336
+ readonly submitExecution: "permissions.submitExecution";
337
+ };
338
+ readonly publishableKeys: {
339
+ readonly mint: "publishableKeys.mint";
340
+ readonly revoke: "publishableKeys.revoke";
341
+ readonly rotate: "publishableKeys.rotate";
342
+ };
343
+ readonly requests: {
344
+ readonly cancel: "requests.cancel";
345
+ readonly get: "requests.get";
346
+ readonly issue: "requests.issue";
347
+ readonly list: "requests.list";
348
+ };
349
+ readonly runtime: {
350
+ readonly assign: "assign";
351
+ readonly canSendOtp: "canSendOtp";
352
+ readonly cancelCommitment: "cancel_commitment";
353
+ readonly change: "change";
354
+ readonly claimCommitment: "claim_commitment";
355
+ readonly create: "create";
356
+ readonly createCapxulClient: "createCapxulClient";
357
+ readonly createCapxulClientWithOrgDeploymentSeams: "createCapxulClientWithOrgDeploymentSeams";
358
+ readonly createCommitment: "create_commitment";
359
+ readonly getConvexJwt: "getConvexJwt";
360
+ readonly getSession: "getSession";
361
+ readonly initialize: "initialize";
362
+ readonly mutation: "mutation";
363
+ readonly now: "now";
364
+ readonly port: "port";
365
+ readonly query: "query";
366
+ readonly redirectCommitment: "redirect_commitment";
367
+ readonly replace: "replace";
368
+ readonly resolve: "resolve";
369
+ readonly revoke: "revoke";
370
+ readonly send: "send";
371
+ readonly sendOtp: "sendOtp";
372
+ readonly signIn: "signIn";
373
+ readonly signOut: "signOut";
374
+ readonly sleep: "sleep";
375
+ readonly verifyOtp: "verifyOtp";
376
+ readonly wallet: "wallet";
377
+ };
378
+ readonly smartAccount: {
379
+ readonly claim: "smartAccount.claim";
380
+ readonly confirmDeployment: "smartAccount.confirmDeployment";
381
+ readonly loadCurrent: "smartAccount.loadCurrent";
382
+ readonly provision: "smartAccount.provision";
383
+ };
384
+ readonly system: {
385
+ readonly health: "system.health";
386
+ readonly ping: "system.ping";
387
+ readonly runtimeChain: "system.runtimeChain";
388
+ };
389
+ readonly targets: {
390
+ readonly resolve: {
391
+ readonly email: "targets.resolve.email";
392
+ readonly handle: "targets.resolve.handle";
393
+ readonly organization: "targets.resolve.organization";
394
+ readonly payee: "targets.resolve.payee";
395
+ };
396
+ };
397
+ readonly testUsdc: {
398
+ readonly mint: "TestUSDC.mint";
399
+ };
400
+ readonly _internal: {
401
+ readonly accounts: {
402
+ readonly fund: "_internal.accounts.fund";
403
+ };
404
+ readonly close: "_internal.close";
405
+ readonly identity: {
406
+ readonly completeProfile: "_internal.identity.completeProfile";
407
+ readonly runFacade: "_internal.identity.runFacade";
408
+ readonly send: "_internal.identity.send";
409
+ };
410
+ readonly organizationSetup: {
411
+ readonly getProofReceipt: "_internal.organizationSetup.getProofReceipt";
412
+ };
413
+ };
414
+ readonly tenancy: {
415
+ readonly revokeBackendTenancyConsent: "tenancy.revokeBackendTenancyConsent";
416
+ readonly seedBackendTenancy: "tenancy.seedBackendTenancy";
417
+ };
418
+ };
419
+ type StringLeaves<T> = T extends string ? T : T extends Readonly<Record<string, unknown>> ? { readonly [K in keyof T]: StringLeaves<T[K]>; }[keyof T] : never;
420
+ type CapxulOperation = StringLeaves<typeof CAPXUL_OPERATIONS>;
421
+ type NormalizedCapxulOperation = CapxulOperation | "unknown";
422
+ declare function isCapxulOperation(value: unknown): value is CapxulOperation;
423
+ declare function normalizeCapxulOperation(value: unknown): NormalizedCapxulOperation;
424
+ //#endregion
7
425
  //#region src/domain/activity/phase.d.ts
8
426
  interface ActivityPhase {
9
427
  /** The row is in a final state. No subsequent status change occurs. */
@@ -179,6 +597,7 @@ declare function createCapxulClient(input: CapxulClientInput): Promise<CapxulRes
179
597
  //#region src/telemetry/capture-exception.d.ts
180
598
  interface HandledErrorReportContext {
181
599
  readonly layer?: string;
600
+ /** Host input is normalized at the reporting boundary. */
182
601
  readonly operation?: string;
183
602
  readonly provider?: string;
184
603
  readonly capxul_error_code?: string;
@@ -204,4 +623,4 @@ declare function captureException(telemetry: TelemetryPort, error: unknown, cont
204
623
  */
205
624
  declare function captureExceptionSync(telemetry: TelemetryPort, error: unknown, context?: HandledErrorReportContext): void;
206
625
  //#endregion
207
- 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 };
626
+ 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_OPERATIONS, CAPXUL_PAYMENTS_V2_ADDRESS, CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, CHAIN_UPSTREAMS, type CapxulClient, type CapxulClientInput, type CapxulDigestSigner, CapxulError, type CapxulErrorCode, type CapxulErrorDetails, type CapxulOperation, type CapxulResult, type CapxulSigner, type ChainCause, type ChainUpstream, type CompleteProfileInput, type CompletedPersonProfile, 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 NormalizedCapxulOperation, type ObservationAdapter, type ObservationContext, type ObservationDelivery, type OfframpMethods, type OfframpQuote, type OfframpQuoteInput, type OfframpStatus, type OnboardingMethods, 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 PersonOnboarding, type PersonOnboardingInput, type PostHogObservabilityClient, type PostHogObservabilityOptions, type Profile, type Readiness, type ReadyAccountLifecycle, 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, isCapxulOperation, isClaimed, isMoneyParseError, isRestoring, isSettingUpLifecycle, localPrivateKeyAccountProvider, normalizeCapxulOperation, openfortEmbeddedSigner, openfortEmbeddedSignerFromWallet, openfortEmbeddedWalletPort, parseMoney, paymentPhase, postHogObservability, requestPhase, destination as resolveIdentityDestination, toCountryCode, toAddress as toEvmAddress };
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { $ as EngineeringTelemetryBootstrapPolicy, A as normalizeExceptionErrorKind, B as isSignerNotReadySignal, C as failureDetail, D as postHogFailureObservation, E as observeFailedResult, F as fromWei, G as readInvocationObservation, H as signerFailure, I as isSettingUpLifecycle, J as sanitizeObservationContext, K as OBSERVATION_CONTEXT_HEADER, L as formatTraceparent, M as projectSdkException, N as safeExceptionLabel, O as EXCEPTION_MESSAGE, P as version, Q as BootstrapEnvelope, R as causeChain, S as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, T as observationContextProps, U as resolveFailureMode, V as openfortSignerNotReadyCode, W as copyInvocationObservation, X as PAYMENT_STATUSES, Y as PAYMENT_DIRECTIONS, Z as CAPXUL_FUNCTIONS, _ as convexCallErrorFromCapxul, a as AccountReadPortTag, b as fingerprintPaymentIntent, d as retryIdempotentRead, et as destination, f as PRODUCT_INVOCATION, g as ConvexCallPortTag, h as identityErrorFromCapxul, i as smartAccountErrorFromCapxul, j as normalizeExceptionOperation, k as SDK_VERSION$1, l as redactTelemetryProps, m as IdentityPortTag, n as detectAuthCacheAdapter, nt as isRestoring, o as accountReadErrorFromCapxul, p as wireChainId, q as encodeObservationContextHeader, r as SmartAccountPortTag, s as TelemetryPortTag, t as assembleCapxulClient, tt as isClaimed, u as stampTelemetryEnvelope, v as BootstrapPortTag, w as failureEvidenceProps, x as toWei, y as bootstrapErrorFromCapxul, z as injectedWalletSigner } from "./create-capxul-client-dk67qjlK.mjs";
2
- import { $ as CHAIN_UPSTREAMS, B as toOrgId, D as toAllowedOrigin, E as toAddress, F as toEmail, G as toRoleKey, I as toEpochMs, J as CAPXUL_ERROR_CODES, K as toSessionToken, L as toEpochSeconds, M as toCountryCode, N as toCurrencyCode, P as toDurationMs, Q as isCapxulError, R as toJwtToken, T as toAccountId, W as toPublishableKey, Y as CapxulError, Z as Errors, d as AuthClientError, et as FAILURE_MODES, f as AuthClientPortTag, g as BASE_SEPOLIA_CHAIN_ID, h as normalizeBindingEmail, j as toChainId, k as toAuthUserId, l as ClockPortTag, m as CAPXUL_PAYMENTS_V2_ADDRESS, q as decodeConvexError, s as AuthCachePortTag, u as authClientPortFromPromiseAdapter, w as currencySymbolFor, z as toKycTier } from "./clock-m_aHLaNm.mjs";
3
- import { n as SystemClockLayer } from "./OAuthBearerAuthClient-DfS4QOg7.mjs";
4
- import { keccak256, recoverAddress, stringToHex } from "viem";
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-BCq08ppe.mjs";
2
+ import { $ as CHAIN_UPSTREAMS, B as toOrgId, D as toAllowedOrigin, E as toAddress, F as toEmail, G as toRoleKey, I as toEpochMs, J as CAPXUL_ERROR_CODES, K as toSessionToken, L as toEpochSeconds, M as toCountryCode, N as toCurrencyCode, P as toDurationMs, Q as isCapxulError, R as toJwtToken, T as toAccountId, W as toPublishableKey, Y as CapxulError, Z as Errors, d as AuthClientError, et as FAILURE_MODES, f as AuthClientPortTag, g as BASE_SEPOLIA_CHAIN_ID, h as normalizeBindingEmail, j as toChainId, k as toAuthUserId, l as ClockPortTag, m as CAPXUL_PAYMENTS_V2_ADDRESS, q as decodeConvexError, s as AuthCachePortTag, u as authClientPortFromPromiseAdapter, w as currencySymbolFor, z as toKycTier } from "./clock-CWpcQlLy.mjs";
3
+ import { n as SystemClockLayer } from "./OAuthBearerAuthClient-8F_kyVP5.mjs";
5
4
  import { Cause, Context, Data, Duration, Effect, Exit, Layer, Result, Schedule, SchemaIssue, SchemaParser, Scope, Tracer } from "effect";
5
+ import { keccak256, recoverAddress, stringToHex } from "viem";
6
6
  import { getFunctionName, makeFunctionReference } from "convex/server";
7
7
  import { privateKeyToAccount } from "viem/accounts";
8
8
  import { FetchHttpClient, Headers, HttpClient } from "effect/unstable/http";
@@ -1866,7 +1866,7 @@ var ConvexAccountAdapter = class {
1866
1866
  this.#telemetry = deps.telemetry;
1867
1867
  }
1868
1868
  readBalance(input) {
1869
- return retryIdempotentRead(this.#convex.action(this.#fns.readBalance, copyInvocationObservation(input, { chainId: wireChainId(input.chainId) })), "accounts.read", this.#telemetry, input).pipe(Effect.mapError((error) => accountReadErrorFromCapxul("readBalance", error.publicError, error)), Effect.flatMap((wire) => brandAccountEffect("readBalance", wire)), Effect.catchDefect((cause) => Effect.fail(accountReadErrorFromUnknown("readBalance", cause))));
1869
+ return retryIdempotentRead(this.#convex.action(this.#fns.readBalance, copyInvocationObservation(input, { chainId: wireChainId(input.chainId) })), CAPXUL_OPERATIONS.accounts.read, this.#telemetry, input).pipe(Effect.mapError((error) => accountReadErrorFromCapxul("readBalance", error.publicError, error)), Effect.flatMap((wire) => brandAccountEffect("readBalance", wire)), Effect.catchDefect((cause) => Effect.fail(accountReadErrorFromUnknown("readBalance", cause))));
1870
1870
  }
1871
1871
  fundFromFaucet(input) {
1872
1872
  const operation = "fundFromFaucet";
@@ -2168,7 +2168,7 @@ var ConvexOrganizationAdapter = class {
2168
2168
  }
2169
2169
  #readTreasuryWire(input) {
2170
2170
  const orgId = String(input.orgId);
2171
- return retryIdempotentRead(this.#convex.action(this.#fns.readTreasury, copyInvocationObservation(input, { orgId })), "org.treasury", this.#telemetry, input).pipe(Effect.mapError((error) => orgErrorFromCapxul("readTreasury", error.publicError, error)), Effect.map((wire) => {
2171
+ return retryIdempotentRead(this.#convex.action(this.#fns.readTreasury, copyInvocationObservation(input, { orgId })), CAPXUL_OPERATIONS.org.treasury, this.#telemetry, input).pipe(Effect.mapError((error) => orgErrorFromCapxul("readTreasury", error.publicError, error)), Effect.map((wire) => {
2172
2172
  if (wire.orgId !== orgId) throw Errors.invalidInput("orgId", "Organization treasury scope does not match");
2173
2173
  const balance = fromWei(wire.rawBalance, wire.decimals, wire.currency);
2174
2174
  const available = fromWei(wire.rawAvailableBalance, wire.decimals, wire.currency);
@@ -2450,7 +2450,7 @@ function isSetupStep(value) {
2450
2450
  return value === "preparingFounderAccount" || value === "awaitingFounderAuthorization" || value === "submittingBootstrap" || value === "confirmingBootstrap";
2451
2451
  }
2452
2452
  function cancellation(signal) {
2453
- return signal?.aborted ? fail(Errors.cancelled({ operation: "organization.setup" })) : void 0;
2453
+ return signal?.aborted ? fail(Errors.cancelled({ operation: CAPXUL_OPERATIONS.organization.setup })) : void 0;
2454
2454
  }
2455
2455
  function fail(error) {
2456
2456
  return {
@@ -2556,8 +2556,23 @@ var ConsoleDiagnosticAdapter = class {
2556
2556
  };
2557
2557
  //#endregion
2558
2558
  //#region src/openfort/create-openfort-browser-signer.ts
2559
+ function httpStatusOf(link) {
2560
+ const carrier = link;
2561
+ if (typeof carrier.response?.status === "number") return carrier.response.status;
2562
+ if (typeof carrier.statusCode === "number") return carrier.statusCode;
2563
+ if (typeof carrier.status === "number") return carrier.status;
2564
+ }
2565
+ function isUnauthorizedCause(cause) {
2566
+ for (const link of causeChain(cause)) if (httpStatusOf(link) === 401) return true;
2567
+ return false;
2568
+ }
2559
2569
  function openfortProviderError(operation, cause) {
2560
- return cause instanceof CapxulError ? cause : Errors.providerError("openfort", operation, cause, { failure_mode: "unknown" });
2570
+ if (cause instanceof CapxulError) return cause;
2571
+ const failure_mode = operation === "configure" && isUnauthorizedCause(cause) ? "unauthorized" : "unknown";
2572
+ return Errors.providerError("openfort", operation, cause, { failure_mode });
2573
+ }
2574
+ function openfortFailureMode(error) {
2575
+ return error.mode ?? "unknown";
2561
2576
  }
2562
2577
  /** Build a named PROVIDER_ERROR. The assembled Core SDK boundary reports it. */
2563
2578
  function failOpenfort(operation, failure_mode, cause) {
@@ -2820,11 +2835,12 @@ function createOpenfortBrowserSignerFromBootstrap(bootstrap, options = {}) {
2820
2835
  await configureEmbeddedWallet(encryptionBody.sessionId);
2821
2836
  diagnostic?.trace("openfort.configure", { ok: true });
2822
2837
  } catch (cause) {
2838
+ const error = openfortProviderError("configure", cause);
2823
2839
  diagnostic?.trace("openfort.configure", {
2824
2840
  ok: false,
2825
- failure_mode: "unknown"
2841
+ failure_mode: openfortFailureMode(error)
2826
2842
  });
2827
- throw openfortProviderError("configure", cause);
2843
+ throw error;
2828
2844
  }
2829
2845
  }
2830
2846
  try {
@@ -3802,4 +3818,4 @@ function captureExceptionSync(telemetry, error, context) {
3802
3818
  } catch {}
3803
3819
  }
3804
3820
  //#endregion
3805
- 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 };
3821
+ export { CAPXUL_ERROR_CODES, CAPXUL_OPERATIONS, 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, isCapxulOperation, isClaimed, isMoneyParseError, isRestoring, isSettingUpLifecycle, localPrivateKeyAccountProvider, normalizeCapxulOperation, openfortEmbeddedSigner, openfortEmbeddedSignerFromWallet, openfortEmbeddedWalletPort, parseMoney, paymentPhase, postHogObservability, requestPhase, destination as resolveIdentityDestination, toCountryCode, toAddress as toEvmAddress };
@@ -1,7 +1,7 @@
1
- import { C as CachedJwt, M as AuthSession, S as AuthCachePortTag, b as AuthCacheError, n as CapxulSigner, x as AuthCachePort } from "../signer-BpjdawiY.mjs";
2
- import { n as oauthBearerAuthClient, t as OAuthBearerAuthClientInput } from "../OAuthBearerAuthClient-BxTiv8dg.mjs";
3
- import { Hex } from "viem";
1
+ import { C as CachedJwt, S as AuthCachePortTag, b as AuthCacheError, j as AuthSession, n as CapxulSigner, x as AuthCachePort } from "../signer-DOqb8M1Y.mjs";
2
+ import { n as oauthBearerAuthClient, t as OAuthBearerAuthClientInput } from "../OAuthBearerAuthClient-CsOgeeZa.mjs";
4
3
  import { Effect, FileSystem, Layer, Path } from "effect";
4
+ import { Hex } from "viem";
5
5
  //#region src/adapters/auth-cache/FileSystemAuthCacheAdapter.d.ts
6
6
  type FileSystemRuntime = FileSystem.FileSystem | Path.Path;
7
7
  declare class FileSystemAuthCacheAdapter implements AuthCachePort {
@@ -1,5 +1,5 @@
1
- import { E as toAddress, a as parseCachedJwt, i as parseAuthSession, n as InMemoryAuthCacheAdapter, o as AuthCacheError, r as BrowserAuthCacheAdapter, s as AuthCachePortTag } from "../clock-m_aHLaNm.mjs";
2
- import { t as oauthBearerAuthClient } from "../OAuthBearerAuthClient-DfS4QOg7.mjs";
1
+ import { E as toAddress, a as parseCachedJwt, i as parseAuthSession, n as InMemoryAuthCacheAdapter, o as AuthCacheError, r as BrowserAuthCacheAdapter, s as AuthCachePortTag } from "../clock-CWpcQlLy.mjs";
2
+ import { t as oauthBearerAuthClient } from "../OAuthBearerAuthClient-8F_kyVP5.mjs";
3
3
  import { Effect, FileSystem, Layer, Path } from "effect";
4
4
  import { privateKeyToAccount } from "viem/accounts";
5
5
  import * as os from "node:os";