@capxul/sdk 3.1.0 → 4.0.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/README.md +15 -9
- package/dist/{OAuthBearerAuthClient-DfS4QOg7.mjs → OAuthBearerAuthClient-BHvDR8_0.mjs} +1 -1
- package/dist/{OAuthBearerAuthClient-BxTiv8dg.d.mts → OAuthBearerAuthClient-D-DLYlKj.d.mts} +1 -1
- package/dist/{clock-m_aHLaNm.mjs → clock-C2AUlq1V.mjs} +35 -2
- package/dist/{create-capxul-client-dk67qjlK.mjs → create-capxul-client-DyCEJZtD.mjs} +6557 -5691
- package/dist/index.d.mts +421 -5
- package/dist/index.mjs +41 -15
- package/dist/node/index.d.mts +3 -3
- package/dist/node/index.mjs +2 -2
- package/dist/{observation-B3PCugGC.d.mts → observation-DtzTdv20.d.mts} +103 -68
- package/dist/{signer-BpjdawiY.d.mts → signer-C0hZ6Kiy.d.mts} +14 -7
- package/dist/testing/index.d.mts +1 -1
- package/dist/testing/index.mjs +7 -7
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,424 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { $ as OrganizationPaymentsMethods, $n as
|
|
3
|
-
import "./OAuthBearerAuthClient-
|
|
4
|
-
import { Hex } from "viem";
|
|
1
|
+
import { B as EVM_ADDRESS_RE, Ct as RevertSummary, E as Address, G as OrgId, I as CountryCode, J as PayrollGroupId, K as PartyId, M as AuthUserId, P as BudgetId, St as FailureMode, T as AccountId, U as Handle, W as Money, Y as PayrollRunId, _t as isCapxulError, a as SignerStatusStore, bt as ChainUpstream, c as AccountProviderSource, ct as toHandle, d as eip1193AccountProvider, dt as CAPXUL_ERROR_CODES, et as RoleKey, f as localPrivateKeyAccountProvider, ft as CapxulError, g as SmartAccount, h as Session, ht as Errors, i as SignerStatus, j as AuthSession, l as AccountRequirement, lt as toPartyId, m as Profile, mt as CapxulErrorDetails, n as CapxulSigner, o as injectedWalletSigner, ot as toAddress, p as CapxulResult, pt as CapxulErrorCode, r as Eip1193RequestProvider, rt as TesterKind, s as AccountProvider, st as toCountryCode, t as CapxulDigestSigner, u as Eip1193Provider, ut as CAPXUL_PAYMENTS_V2_ADDRESS, vt as CHAIN_UPSTREAMS, w as Account, xt as FAILURE_MODES, yt as ChainCause } from "./signer-C0hZ6Kiy.mjs";
|
|
2
|
+
import { $ as OrganizationPaymentsMethods, $n as TelemetryPort, $t as DestinationListInput, A as OrgView, An as TargetsMethods, At as AddressBookMethods, B as PayrollGroupInput, Bn as OrgSetupStep, Bt as ActivityListParams, C as DetectPendingOrgInvitationsResult, Cn as PaymentType, Ct as ActorRelationshipMethods, D as OrgMethods, Dn as Ref, Dt as AddressBookAddInput, E as MemberView, En as RecipientResolution, Et as ActorRequestsMethods, F as RoleSpendCap, Fn as CompleteProfileInput, Ft as ActivityAnnotationInput, G as PayrollRun, Gn as InboxStatus, Gt as ActivitySummary, H as PayrollGroupsMethods, Hn as CurrentHoldings, Ht as ActivityPage, I as RoleView, In as IdentityMethods, It as ActivityDetail, J as PayrollRuns, Jn as PaymentStatus$1, Jt as ActorReference, K as PayrollRunItemInput, Kn as PAYMENT_DIRECTIONS, Kt as ActivitySummaryParams, L as AuthorizeRunInput, Ln as SmartAccountMethods, Lt as ActivityFilter, M as OrganizationAuditLogItem, Mn as AccountLifecycle, Mt as InboxItem, N as ResendInviteTokenInput, Nn as AccountSetupStep, Nt as InboxMethods, O as OrgScopedMethods, On as ResolvedTarget, Ot as AddressBookEntry, P as RoleDefinition, Pn as isSettingUpLifecycle, Pt as ActivityAnnotation, Q as OrganizationPaymentItemInput, Qt as DestinationKind, R as PayrollEngagementTerms, Rn as AuthMethods, Rt as ActivityItem, S as CreateOrgInput, Sn as PaymentTiming, St as ActorProfileMethods, T as MemberStatus, Tn as PaymentsPayInput, Tt as ActorRequestIssueInput, U as PayrollMethods, Un as Permission, Ut as ActivityRange, V as PayrollGroupMember, Vn as ActorRef, Vt as ActivityMethods, W as PayrollOptions, Wn as SubmittedPermissionExecution, Wt as ActivityReference, X as OrganizationPaymentBatchInput, Xt as Destination, Y as PayrollTermsUnit, Yn as RequestStatus, Yt as DepositInstructions, Z as OrganizationPaymentInput, Zt as DestinationAddInput, _ as SystemMethods, _n as PaymentDocumentRender, _t as PersonOnboarding, a as SdkFailureObservation, an as MeMethods, ar as StateLabel, at as PermissionReplaceInput, b as CurrentUserContext, bn as PaymentMoney, bt as AccountMethods, c as PostHogObservabilityOptions, cn as OfframpMethods, cr as isRestoring, ct as Budget, d as CreateCapxulClientInput, dn as OfframpStatus, dt as OrgMeOptions, en as DestinationPayload, er as Destination$1, et as PermissionAssignInput, f as IdentityProfileDetails, fn as Payment, ft as AccountsMethods, g as Holding, gn as PaymentDocumentRef, gt as OrganizationOnboardingInput, h as HoldingsMethods, hn as PaymentDocumentKind, ht as OrganizationOnboarding, i as ObservationDelivery, in as FinancialOpsMethods, ir as Readiness, it as PermissionOptions, j as OrganizationAccount, jn as fingerprintPaymentIntent, jt as InboxApproveInput, k as OrgTemplate, kn as TargetReference, kt as AddressBookLabelInput, l as postHogObservability, ln as OfframpQuote, lr as IdentityTransition, lt as OrgMe, m as IdentityRuntimeSendResult, mn as PaymentDirection, mt as OnboardingMethods, n as ObservationAdapter, nn as DestinationRemoveInput, nr as IdentityState, nt as PermissionCreateInput, o as HostObservability, on as MeProfile, or as destination, ot as PermissionRevokeInput, p as IdentityRuntime, pn as PaymentActivityEvidence, pt as CompletedPersonProfile, q as PayrollRunStatus, qn as PAYMENT_STATUSES, qt as ActivitySummaryTotal, r as ObservationContext, rn as DestinationsMethods, rr as OrgLane, rt as PermissionMethods, s as PostHogObservabilityClient, sn as MovementActivityEvidence, sr as isClaimed, st as PermissionReadResult, t as CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, tn as DestinationRail, tr as IdentityEvent, tt as PermissionChangeInput, u as CapxulClient, un as OfframpQuoteInput, ur as InvocationControls, ut as OrgMeMethod, v as SystemHealth, vn as PaymentDocumentVerification, vt as PersonOnboardingInput, w as InviteMemberInput, wn as PaymentsMethods, wt as ActorRequest, x as CurrentUserMethods, xn as PaymentStatus, xt as ActorProfile, y as MediaMethods, yn as PaymentDocumentsMethods, yt as ReadyAccountLifecycle, z as PayrollGroup, zn as OrgLifecycle, zt as ActivityKind } from "./observation-DtzTdv20.mjs";
|
|
3
|
+
import "./OAuthBearerAuthClient-D-DLYlKj.mjs";
|
|
5
4
|
import { Context, Effect, Layer } from "effect";
|
|
5
|
+
import { Hex } from "viem";
|
|
6
6
|
import { FunctionReference } from "convex/server";
|
|
7
|
+
//#region ../errors/src/index.d.ts
|
|
8
|
+
/** Canonical handle syntax shared by validation and branded constructors. */
|
|
9
|
+
declare const HANDLE_RE: RegExp;
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region ../observability/src/operations.d.ts
|
|
12
|
+
declare const CAPXUL_OPERATIONS: {
|
|
13
|
+
readonly account: {
|
|
14
|
+
readonly addressBook: {
|
|
15
|
+
readonly add: "account.addressBook.add";
|
|
16
|
+
readonly get: "account.addressBook.get";
|
|
17
|
+
readonly hide: "account.addressBook.hide";
|
|
18
|
+
readonly label: "account.addressBook.label";
|
|
19
|
+
readonly list: "account.addressBook.list";
|
|
20
|
+
readonly unhide: "account.addressBook.unhide";
|
|
21
|
+
};
|
|
22
|
+
readonly balance: "account.balance";
|
|
23
|
+
readonly faucetMint: "account.faucetMint";
|
|
24
|
+
readonly getLifecycle: "account.getLifecycle";
|
|
25
|
+
readonly readBalance: "account.readBalance";
|
|
26
|
+
readonly retrySetup: "account.retrySetup";
|
|
27
|
+
readonly status: "account.status";
|
|
28
|
+
readonly profile: {
|
|
29
|
+
readonly depositInstructions: "account.profile.depositInstructions";
|
|
30
|
+
readonly get: "account.profile.get";
|
|
31
|
+
};
|
|
32
|
+
readonly inbox: {
|
|
33
|
+
readonly approve: "account.inbox.approve";
|
|
34
|
+
readonly decline: "account.inbox.decline";
|
|
35
|
+
readonly list: "account.inbox.list";
|
|
36
|
+
};
|
|
37
|
+
readonly requests: {
|
|
38
|
+
readonly cancel: "account.requests.cancel";
|
|
39
|
+
readonly get: "account.requests.get";
|
|
40
|
+
readonly issue: "account.requests.issue";
|
|
41
|
+
readonly list: "account.requests.list";
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
readonly accounts: {
|
|
45
|
+
readonly fund: "accounts.fund";
|
|
46
|
+
readonly read: "accounts.read";
|
|
47
|
+
};
|
|
48
|
+
readonly activity: {
|
|
49
|
+
readonly annotate: "activity.annotate";
|
|
50
|
+
readonly get: "activity.get";
|
|
51
|
+
readonly list: "activity.list";
|
|
52
|
+
readonly summary: "activity.summary";
|
|
53
|
+
};
|
|
54
|
+
readonly addressBook: {
|
|
55
|
+
readonly add: "addressBook.add";
|
|
56
|
+
readonly get: "addressBook.get";
|
|
57
|
+
readonly hide: "addressBook.hide";
|
|
58
|
+
readonly label: "addressBook.label";
|
|
59
|
+
readonly list: "addressBook.list";
|
|
60
|
+
readonly unhide: "addressBook.unhide";
|
|
61
|
+
};
|
|
62
|
+
readonly applications: {
|
|
63
|
+
readonly create: "applications.create";
|
|
64
|
+
};
|
|
65
|
+
readonly auth: {
|
|
66
|
+
readonly canSendOtp: "auth.canSendOtp";
|
|
67
|
+
readonly getSession: "auth.getSession";
|
|
68
|
+
readonly signIn: "auth.signIn";
|
|
69
|
+
readonly signOut: "auth.signOut";
|
|
70
|
+
readonly sendVerificationOtp: "auth.sendVerificationOTP";
|
|
71
|
+
readonly verifyOtp: "auth.verifyOtp";
|
|
72
|
+
};
|
|
73
|
+
readonly client: {
|
|
74
|
+
readonly createOrg: "createOrg";
|
|
75
|
+
readonly orgs: "orgs";
|
|
76
|
+
};
|
|
77
|
+
readonly credentials: {
|
|
78
|
+
readonly bootstrapClient: "credentials.bootstrapClient";
|
|
79
|
+
readonly mintQuickstartKey: "credentials.mintQuickstartKey";
|
|
80
|
+
};
|
|
81
|
+
readonly currentUser: {
|
|
82
|
+
readonly get: "currentUser.get";
|
|
83
|
+
};
|
|
84
|
+
readonly devIdentity: {
|
|
85
|
+
readonly seedFinancialOpsOrg: "devIdentity.seedFinancialOpsOrg";
|
|
86
|
+
};
|
|
87
|
+
readonly dev: {
|
|
88
|
+
readonly browserSeed: "dev.browserSeed";
|
|
89
|
+
};
|
|
90
|
+
readonly destinations: {
|
|
91
|
+
readonly add: "destinations.add";
|
|
92
|
+
readonly list: "destinations.list";
|
|
93
|
+
readonly remove: "destinations.remove";
|
|
94
|
+
};
|
|
95
|
+
readonly faucetSafe: {
|
|
96
|
+
readonly deploy: "FaucetSafe.deploy";
|
|
97
|
+
};
|
|
98
|
+
readonly financialOps: {
|
|
99
|
+
readonly addDestination: "financialOps.addDestination";
|
|
100
|
+
readonly approveRequest: "financialOps.approveRequest";
|
|
101
|
+
readonly cancelRequest: "financialOps.cancelRequest";
|
|
102
|
+
readonly createPayee: "financialOps.createPayee";
|
|
103
|
+
readonly declineRequest: "financialOps.declineRequest";
|
|
104
|
+
readonly emitPaymentWriterTelemetry: "financialOps.emitPaymentWriterTelemetry";
|
|
105
|
+
readonly issueRequest: "financialOps.issueRequest";
|
|
106
|
+
readonly recoverSettlementVerification: "financialOps.recoverSettlementVerification";
|
|
107
|
+
readonly removeDestination: "financialOps.removeDestination";
|
|
108
|
+
readonly verifySettlement: "financialOps.verifySettlement";
|
|
109
|
+
};
|
|
110
|
+
readonly holdings: {
|
|
111
|
+
readonly current: "holdings.current";
|
|
112
|
+
readonly primary: "holdings.primary";
|
|
113
|
+
};
|
|
114
|
+
readonly identity: {
|
|
115
|
+
readonly accountAt: "identity.AccountAt";
|
|
116
|
+
readonly accountClaimed: "identity.AccountClaimed";
|
|
117
|
+
readonly accountClaiming: "identity.AccountClaiming";
|
|
118
|
+
readonly accountDerived: "identity.AccountDerived";
|
|
119
|
+
readonly accountFailed: "identity.AccountFailed";
|
|
120
|
+
readonly attachOrganization: "identity.AttachOrganization";
|
|
121
|
+
readonly claimAccount: "identity.ClaimAccount";
|
|
122
|
+
readonly completeOnboarding: "identity.completeOnboarding";
|
|
123
|
+
readonly completeProfile: "identity.completeProfile";
|
|
124
|
+
readonly create: "identity.create";
|
|
125
|
+
readonly createOrganization: "identity.CreateOrganization";
|
|
126
|
+
readonly ensureAccount: "identity.EnsureAccount";
|
|
127
|
+
readonly leaveOrganization: "identity.LeaveOrganization";
|
|
128
|
+
readonly loadCurrent: "identity.loadCurrent";
|
|
129
|
+
readonly orgAt: "identity.OrgAt";
|
|
130
|
+
readonly orgFailed: "identity.OrgFailed";
|
|
131
|
+
readonly orgReady: "identity.OrgReady";
|
|
132
|
+
readonly otpFailed: "identity.OtpFailed";
|
|
133
|
+
readonly otpSent: "identity.OtpSent";
|
|
134
|
+
readonly readSession: "identity.ReadSession";
|
|
135
|
+
readonly requestOtp: "identity.RequestOtp";
|
|
136
|
+
readonly reset: "identity.Reset";
|
|
137
|
+
readonly restoreSession: "identity.RestoreSession";
|
|
138
|
+
readonly resumeOtpEntry: "identity.ResumeOtpEntry";
|
|
139
|
+
readonly retryAccount: "identity.RetryAccount";
|
|
140
|
+
readonly retryOrganization: "identity.RetryOrganization";
|
|
141
|
+
readonly sessionAbsent: "identity.SessionAbsent";
|
|
142
|
+
readonly sessionRead: "identity.SessionRead";
|
|
143
|
+
readonly sessionReadFailed: "identity.SessionReadFailed";
|
|
144
|
+
readonly sessionRestored: "identity.SessionRestored";
|
|
145
|
+
readonly signedOut: "identity.SignedOut";
|
|
146
|
+
readonly signOut: "identity.SignOut";
|
|
147
|
+
readonly signOutFailed: "identity.SignOutFailed";
|
|
148
|
+
readonly update: "identity.update";
|
|
149
|
+
readonly handleAvailable: "identity.handleAvailable";
|
|
150
|
+
readonly verified: "identity.Verified";
|
|
151
|
+
readonly verifyFailed: "identity.VerifyFailed";
|
|
152
|
+
readonly verifyOtp: "identity.VerifyOtp";
|
|
153
|
+
};
|
|
154
|
+
readonly media: {
|
|
155
|
+
readonly generateUploadUrl: "media.generateUploadUrl";
|
|
156
|
+
readonly setOrgLogo: "media.setOrgLogo";
|
|
157
|
+
readonly setProfileImage: "media.setProfileImage";
|
|
158
|
+
readonly uploadImage: "media.uploadImage";
|
|
159
|
+
};
|
|
160
|
+
readonly me: {
|
|
161
|
+
readonly depositInstructions: "me.depositInstructions";
|
|
162
|
+
readonly get: "me.get";
|
|
163
|
+
};
|
|
164
|
+
readonly moneyExecution: {
|
|
165
|
+
readonly abandonPaymentExecution: "moneyExecution.abandonPaymentExecution";
|
|
166
|
+
readonly prepareOrganizationPaymentExecution: "moneyExecution.prepareOrganizationPaymentExecution";
|
|
167
|
+
readonly preparePaymentExecution: "moneyExecution.preparePaymentExecution";
|
|
168
|
+
readonly preparePaymentLifecycleExecution: "moneyExecution.preparePaymentLifecycleExecution";
|
|
169
|
+
readonly preparePermissionExecution: "moneyExecution.preparePermissionExecution";
|
|
170
|
+
readonly recoverSubmissionClaims: "moneyExecution.recoverSubmissionClaims";
|
|
171
|
+
readonly submit: "moneyExecution.submit";
|
|
172
|
+
readonly submitPaymentCommandExecution: "moneyExecution.submitPaymentCommandExecution";
|
|
173
|
+
readonly submitPaymentExecution: "moneyExecution.submitPaymentExecution";
|
|
174
|
+
readonly submitPermissionExecution: "moneyExecution.submitPermissionExecution";
|
|
175
|
+
};
|
|
176
|
+
readonly movement: {
|
|
177
|
+
readonly emitDepositSettled: "movement.emitDepositSettled";
|
|
178
|
+
readonly scan: "movement.scan";
|
|
179
|
+
};
|
|
180
|
+
readonly inbox: {
|
|
181
|
+
readonly approve: "inbox.approve";
|
|
182
|
+
readonly decline: "inbox.decline";
|
|
183
|
+
readonly list: "inbox.list";
|
|
184
|
+
};
|
|
185
|
+
readonly offramp: {
|
|
186
|
+
readonly quote: "offramp.quote";
|
|
187
|
+
readonly status: "offramp.status";
|
|
188
|
+
};
|
|
189
|
+
readonly onboarding: {
|
|
190
|
+
readonly completeOrganization: "onboarding.completeOrganization";
|
|
191
|
+
readonly completePerson: "onboarding.completePerson";
|
|
192
|
+
};
|
|
193
|
+
readonly org: {
|
|
194
|
+
readonly acceptInvitations: "org.acceptInvitations";
|
|
195
|
+
readonly account: {
|
|
196
|
+
readonly get: "org.account.get";
|
|
197
|
+
};
|
|
198
|
+
readonly activateMember: "org.activateMember";
|
|
199
|
+
readonly auditLog: "org.auditLog";
|
|
200
|
+
readonly confirmBootstrap: "org.confirmBootstrap";
|
|
201
|
+
readonly createOrg: "org.createOrg";
|
|
202
|
+
readonly create: "org.create";
|
|
203
|
+
readonly detectAndAcceptPendingInvitations: "org.detectAndAcceptPendingInvitations";
|
|
204
|
+
readonly expireInvitations: "org.expireInvitations";
|
|
205
|
+
readonly getLifecycle: "org.getLifecycle";
|
|
206
|
+
readonly getProofReceipt: "org.getProofReceipt";
|
|
207
|
+
readonly invite: "org.invite";
|
|
208
|
+
readonly inviteMember: "org.inviteMember";
|
|
209
|
+
readonly list: "org.list";
|
|
210
|
+
readonly load: "org.load";
|
|
211
|
+
readonly me: "org.me";
|
|
212
|
+
readonly members: "org.members";
|
|
213
|
+
readonly orgs: "org.orgs";
|
|
214
|
+
readonly payment: "org.payment";
|
|
215
|
+
readonly permissions: {
|
|
216
|
+
readonly assign: "org.permissions.assign";
|
|
217
|
+
readonly change: "org.permissions.change";
|
|
218
|
+
readonly create: "org.permissions.create";
|
|
219
|
+
readonly get: "org.permissions.get";
|
|
220
|
+
readonly list: "org.permissions.list";
|
|
221
|
+
readonly replace: "org.permissions.replace";
|
|
222
|
+
readonly revoke: "org.permissions.revoke";
|
|
223
|
+
};
|
|
224
|
+
readonly payments: {
|
|
225
|
+
readonly pay: "org.payments.pay";
|
|
226
|
+
readonly payBatch: "org.payments.payBatch";
|
|
227
|
+
};
|
|
228
|
+
readonly payroll: {
|
|
229
|
+
readonly authorizeRun: "org.payroll.authorizeRun";
|
|
230
|
+
readonly groups: {
|
|
231
|
+
readonly list: "org.payroll.groups.list";
|
|
232
|
+
readonly remove: "org.payroll.groups.remove";
|
|
233
|
+
readonly save: "org.payroll.groups.save";
|
|
234
|
+
};
|
|
235
|
+
readonly runs: "org.payroll.runs";
|
|
236
|
+
readonly terms: "org.payroll.terms";
|
|
237
|
+
};
|
|
238
|
+
readonly addressBook: {
|
|
239
|
+
readonly add: "org.addressBook.add";
|
|
240
|
+
readonly get: "org.addressBook.get";
|
|
241
|
+
readonly hide: "org.addressBook.hide";
|
|
242
|
+
readonly label: "org.addressBook.label";
|
|
243
|
+
readonly list: "org.addressBook.list";
|
|
244
|
+
readonly unhide: "org.addressBook.unhide";
|
|
245
|
+
};
|
|
246
|
+
readonly inbox: {
|
|
247
|
+
readonly approve: "org.inbox.approve";
|
|
248
|
+
readonly decline: "org.inbox.decline";
|
|
249
|
+
readonly list: "org.inbox.list";
|
|
250
|
+
};
|
|
251
|
+
readonly lifecycle: {
|
|
252
|
+
readonly startOrResume: "org.lifecycle.startOrResume";
|
|
253
|
+
};
|
|
254
|
+
readonly prepareBootstrap: "org.prepareBootstrap";
|
|
255
|
+
readonly prepareFounderAccount: "org.prepareFounderAccount";
|
|
256
|
+
readonly profile: {
|
|
257
|
+
readonly depositInstructions: "org.profile.depositInstructions";
|
|
258
|
+
readonly get: "org.profile.get";
|
|
259
|
+
};
|
|
260
|
+
readonly readTreasury: "org.readTreasury";
|
|
261
|
+
readonly requests: {
|
|
262
|
+
readonly cancel: "org.requests.cancel";
|
|
263
|
+
readonly get: "org.requests.get";
|
|
264
|
+
readonly issue: "org.requests.issue";
|
|
265
|
+
readonly list: "org.requests.list";
|
|
266
|
+
};
|
|
267
|
+
readonly recordFailure: "org.recordFailure";
|
|
268
|
+
readonly recordProgress: "org.recordProgress";
|
|
269
|
+
readonly resendInviteToken: "org.resendInviteToken";
|
|
270
|
+
readonly resumeBootstrapSubmission: "org.resumeBootstrapSubmission";
|
|
271
|
+
readonly retry: "org.retry";
|
|
272
|
+
readonly retrySetup: "org.retrySetup";
|
|
273
|
+
readonly roles: "org.roles";
|
|
274
|
+
readonly startOrResume: "org.startOrResume";
|
|
275
|
+
readonly submitBootstrap: "org.submitBootstrap";
|
|
276
|
+
readonly treasury: "org.treasury";
|
|
277
|
+
};
|
|
278
|
+
readonly organization: {
|
|
279
|
+
readonly setup: "organization.setup";
|
|
280
|
+
};
|
|
281
|
+
readonly organizationPayments: {
|
|
282
|
+
readonly pay: "organizationPayments.pay";
|
|
283
|
+
readonly payBatch: "organizationPayments.payBatch";
|
|
284
|
+
readonly prepareExecution: "organizationPayments.prepareExecution";
|
|
285
|
+
};
|
|
286
|
+
readonly organizationSetup: {
|
|
287
|
+
readonly getProofReceipt: "organizationSetup.getProofReceipt";
|
|
288
|
+
};
|
|
289
|
+
readonly organizations: {
|
|
290
|
+
readonly detectAndAcceptPendingInvitations: "orgs.detectAndAcceptPendingInvitations";
|
|
291
|
+
};
|
|
292
|
+
readonly payments: {
|
|
293
|
+
readonly cancel: "payments.cancel";
|
|
294
|
+
readonly claim: "payments.claim";
|
|
295
|
+
readonly createCommitment: "payments.createCommitment";
|
|
296
|
+
readonly get: "payments.get";
|
|
297
|
+
readonly ledger: "payments";
|
|
298
|
+
readonly list: "payments.list";
|
|
299
|
+
readonly pay: "payments.pay";
|
|
300
|
+
readonly prepareExecution: "payments.prepareExecution";
|
|
301
|
+
readonly prepareLifecycleExecution: "payments.prepareLifecycleExecution";
|
|
302
|
+
readonly redirect: "payments.redirect";
|
|
303
|
+
readonly submitCommandExecution: "payments.submitCommandExecution";
|
|
304
|
+
readonly submitExecution: "payments.submitExecution";
|
|
305
|
+
};
|
|
306
|
+
readonly paymentDocuments: {
|
|
307
|
+
readonly render: "paymentDocuments.render";
|
|
308
|
+
readonly verify: "paymentDocuments.verify";
|
|
309
|
+
};
|
|
310
|
+
readonly recipient: {
|
|
311
|
+
readonly resolve: "recipient.resolve";
|
|
312
|
+
};
|
|
313
|
+
readonly payroll: {
|
|
314
|
+
readonly authorizeRun: "payroll.authorizeRun";
|
|
315
|
+
readonly groups: {
|
|
316
|
+
readonly access: "payroll.groups";
|
|
317
|
+
readonly list: "payroll.groups.list";
|
|
318
|
+
readonly remove: "payroll.groups.remove";
|
|
319
|
+
readonly save: "payroll.groups.save";
|
|
320
|
+
};
|
|
321
|
+
readonly removeGroup: "payroll.removeGroup";
|
|
322
|
+
readonly runs: "payroll.runs";
|
|
323
|
+
readonly saveGroup: "payroll.saveGroup";
|
|
324
|
+
readonly terms: "payroll.terms";
|
|
325
|
+
};
|
|
326
|
+
readonly permission: {
|
|
327
|
+
readonly command: "permission.command";
|
|
328
|
+
readonly retryVerification: "permission.retryVerification";
|
|
329
|
+
readonly verify: "permission.verify";
|
|
330
|
+
readonly verifySubmitted: "permission.verifySubmitted";
|
|
331
|
+
};
|
|
332
|
+
readonly permissions: {
|
|
333
|
+
readonly assign: "permissions.assign";
|
|
334
|
+
readonly change: "permissions.change";
|
|
335
|
+
readonly create: "permissions.create";
|
|
336
|
+
readonly get: "permissions.get";
|
|
337
|
+
readonly list: "permissions.list";
|
|
338
|
+
readonly prepareExecution: "permissions.prepareExecution";
|
|
339
|
+
readonly replace: "permissions.replace";
|
|
340
|
+
readonly revoke: "permissions.revoke";
|
|
341
|
+
readonly submitExecution: "permissions.submitExecution";
|
|
342
|
+
};
|
|
343
|
+
readonly publishableKeys: {
|
|
344
|
+
readonly mint: "publishableKeys.mint";
|
|
345
|
+
readonly revoke: "publishableKeys.revoke";
|
|
346
|
+
readonly rotate: "publishableKeys.rotate";
|
|
347
|
+
};
|
|
348
|
+
readonly requests: {
|
|
349
|
+
readonly cancel: "requests.cancel";
|
|
350
|
+
readonly get: "requests.get";
|
|
351
|
+
readonly issue: "requests.issue";
|
|
352
|
+
readonly list: "requests.list";
|
|
353
|
+
};
|
|
354
|
+
readonly runtime: {
|
|
355
|
+
readonly assign: "assign";
|
|
356
|
+
readonly canSendOtp: "canSendOtp";
|
|
357
|
+
readonly cancelCommitment: "cancel_commitment";
|
|
358
|
+
readonly change: "change";
|
|
359
|
+
readonly claimCommitment: "claim_commitment";
|
|
360
|
+
readonly create: "create";
|
|
361
|
+
readonly createCapxulClient: "createCapxulClient";
|
|
362
|
+
readonly createCapxulClientWithOrgDeploymentSeams: "createCapxulClientWithOrgDeploymentSeams";
|
|
363
|
+
readonly createCommitment: "create_commitment";
|
|
364
|
+
readonly getConvexJwt: "getConvexJwt";
|
|
365
|
+
readonly getSession: "getSession";
|
|
366
|
+
readonly initialize: "initialize";
|
|
367
|
+
readonly mutation: "mutation";
|
|
368
|
+
readonly now: "now";
|
|
369
|
+
readonly port: "port";
|
|
370
|
+
readonly query: "query";
|
|
371
|
+
readonly redirectCommitment: "redirect_commitment";
|
|
372
|
+
readonly replace: "replace";
|
|
373
|
+
readonly resolve: "resolve";
|
|
374
|
+
readonly revoke: "revoke";
|
|
375
|
+
readonly send: "send";
|
|
376
|
+
readonly sendOtp: "sendOtp";
|
|
377
|
+
readonly signIn: "signIn";
|
|
378
|
+
readonly signOut: "signOut";
|
|
379
|
+
readonly sleep: "sleep";
|
|
380
|
+
readonly verifyOtp: "verifyOtp";
|
|
381
|
+
readonly wallet: "wallet";
|
|
382
|
+
};
|
|
383
|
+
readonly smartAccount: {
|
|
384
|
+
readonly claim: "smartAccount.claim";
|
|
385
|
+
readonly confirmDeployment: "smartAccount.confirmDeployment";
|
|
386
|
+
readonly loadCurrent: "smartAccount.loadCurrent";
|
|
387
|
+
readonly provision: "smartAccount.provision";
|
|
388
|
+
};
|
|
389
|
+
readonly system: {
|
|
390
|
+
readonly health: "system.health";
|
|
391
|
+
readonly ping: "system.ping";
|
|
392
|
+
readonly runtimeChain: "system.runtimeChain";
|
|
393
|
+
};
|
|
394
|
+
readonly testUsdc: {
|
|
395
|
+
readonly mint: "TestUSDC.mint";
|
|
396
|
+
};
|
|
397
|
+
readonly _internal: {
|
|
398
|
+
readonly accounts: {
|
|
399
|
+
readonly fund: "_internal.accounts.fund";
|
|
400
|
+
};
|
|
401
|
+
readonly close: "_internal.close";
|
|
402
|
+
readonly identity: {
|
|
403
|
+
readonly completeProfile: "_internal.identity.completeProfile";
|
|
404
|
+
readonly runFacade: "_internal.identity.runFacade";
|
|
405
|
+
readonly send: "_internal.identity.send";
|
|
406
|
+
};
|
|
407
|
+
readonly organizationSetup: {
|
|
408
|
+
readonly getProofReceipt: "_internal.organizationSetup.getProofReceipt";
|
|
409
|
+
};
|
|
410
|
+
};
|
|
411
|
+
readonly tenancy: {
|
|
412
|
+
readonly revokeBackendTenancyConsent: "tenancy.revokeBackendTenancyConsent";
|
|
413
|
+
readonly seedBackendTenancy: "tenancy.seedBackendTenancy";
|
|
414
|
+
};
|
|
415
|
+
};
|
|
416
|
+
type StringLeaves<T> = T extends string ? T : T extends Readonly<Record<string, unknown>> ? { readonly [K in keyof T]: StringLeaves<T[K]>; }[keyof T] : never;
|
|
417
|
+
type CapxulOperation = StringLeaves<typeof CAPXUL_OPERATIONS>;
|
|
418
|
+
type NormalizedCapxulOperation = CapxulOperation | "unknown";
|
|
419
|
+
declare function isCapxulOperation(value: unknown): value is CapxulOperation;
|
|
420
|
+
declare function normalizeCapxulOperation(value: unknown): NormalizedCapxulOperation;
|
|
421
|
+
//#endregion
|
|
7
422
|
//#region src/domain/activity/phase.d.ts
|
|
8
423
|
interface ActivityPhase {
|
|
9
424
|
/** The row is in a final state. No subsequent status change occurs. */
|
|
@@ -179,6 +594,7 @@ declare function createCapxulClient(input: CapxulClientInput): Promise<CapxulRes
|
|
|
179
594
|
//#region src/telemetry/capture-exception.d.ts
|
|
180
595
|
interface HandledErrorReportContext {
|
|
181
596
|
readonly layer?: string;
|
|
597
|
+
/** Host input is normalized at the reporting boundary. */
|
|
182
598
|
readonly operation?: string;
|
|
183
599
|
readonly provider?: string;
|
|
184
600
|
readonly capxul_error_code?: string;
|
|
@@ -204,4 +620,4 @@ declare function captureException(telemetry: TelemetryPort, error: unknown, cont
|
|
|
204
620
|
*/
|
|
205
621
|
declare function captureExceptionSync(telemetry: TelemetryPort, error: unknown, context?: HandledErrorReportContext): void;
|
|
206
622
|
//#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
|
|
623
|
+
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, EVM_ADDRESS_RE, type Eip1193Provider, type Eip1193RequestProvider, Errors, FAILURE_MODES, type FailureMode, type FinancialOpsMethods, HANDLE_RE, type Handle, type HandledErrorReportContext, 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 OrganizationOnboarding, type OrganizationOnboardingInput, type OrganizationPaymentBatchInput, type OrganizationPaymentInput, type OrganizationPaymentItemInput, type OrganizationPaymentsMethods, PAYMENT_DIRECTIONS, PAYMENT_STATUSES, type PartyId, 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 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, type TesterKind, 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, toHandle, toPartyId };
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { $ as
|
|
3
|
-
import { n as SystemClockLayer } from "./OAuthBearerAuthClient-
|
|
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-DyCEJZtD.mjs";
|
|
2
|
+
import { $ as CapxulError, A as toAuthUserId, B as toJwtToken, D as toAddress, E as toAccountId, F as toDurationMs, H as toOrgId, I as toEmail, J as toSessionToken, K as toPublishableKey, L as toEpochMs, M as toChainId, N as toCountryCode, O as toAllowedOrigin, P as toCurrencyCode, Q as CAPXUL_ERROR_CODES, R as toEpochSeconds, T as currencySymbolFor, U as toPartyId, V as toKycTier, X as HANDLE_RE, Y as toTesterKind, Z as decodeConvexError, d as AuthClientError, f as AuthClientPortTag, g as BASE_SEPOLIA_CHAIN_ID, h as normalizeBindingEmail, it as FAILURE_MODES, l as ClockPortTag, m as CAPXUL_PAYMENTS_V2_ADDRESS, nt as isCapxulError, q as toRoleKey, rt as CHAIN_UPSTREAMS, s as AuthCachePortTag, tt as Errors, u as authClientPortFromPromiseAdapter, x as EVM_ADDRESS_RE, z as toHandle } from "./clock-C2AUlq1V.mjs";
|
|
3
|
+
import { n as SystemClockLayer } from "./OAuthBearerAuthClient-BHvDR8_0.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";
|
|
@@ -60,7 +60,8 @@ function paymentPhase(status) {
|
|
|
60
60
|
case "pending_claim": return AWAITING_ACTOR;
|
|
61
61
|
case "settled": return COMPLETED;
|
|
62
62
|
case "cancelled": return WITHDRAWN;
|
|
63
|
-
case "failed":
|
|
63
|
+
case "failed":
|
|
64
|
+
case "unresolved": return FAILED;
|
|
64
65
|
default: return unknownStatus(status);
|
|
65
66
|
}
|
|
66
67
|
}
|
|
@@ -1601,9 +1602,16 @@ const OBSERVED_CONVEX_ACTIONS = /* @__PURE__ */ new Set([
|
|
|
1601
1602
|
"org/actions:submitBootstrap",
|
|
1602
1603
|
"org/actions:resumeBootstrapSubmission",
|
|
1603
1604
|
"org/actions:confirmBootstrap",
|
|
1604
|
-
"org/actions:readTreasury"
|
|
1605
|
+
"org/actions:readTreasury",
|
|
1606
|
+
"moneyExecution/actions:preparePaymentExecution",
|
|
1607
|
+
"moneyExecution/actions:abandonPaymentExecution",
|
|
1608
|
+
"moneyExecution/actions:submitPaymentExecution",
|
|
1609
|
+
"moneyExecution/paymentCommandActions:preparePaymentLifecycleExecution",
|
|
1610
|
+
"moneyExecution/paymentCommandActions:prepareOrganizationPaymentExecution",
|
|
1611
|
+
"moneyExecution/paymentCommandActions:submitPaymentCommandExecution"
|
|
1605
1612
|
]);
|
|
1606
1613
|
const OBSERVED_CONVEX_QUERIES = /* @__PURE__ */ new Set([
|
|
1614
|
+
"financialOps/queries:resolveRecipient",
|
|
1607
1615
|
"identity/queries:loadByAuthUserId",
|
|
1608
1616
|
"smartAccount/queries:loadByAuthUserId",
|
|
1609
1617
|
"org/lifecycle:load"
|
|
@@ -1834,12 +1842,13 @@ function ConvexIdentityLayer() {
|
|
|
1834
1842
|
function brandProfile(raw) {
|
|
1835
1843
|
return {
|
|
1836
1844
|
authUserId: toAuthUserId(raw.authUserId),
|
|
1845
|
+
...raw.testerKind === void 0 ? {} : { testerKind: toTesterKind(raw.testerKind) },
|
|
1837
1846
|
email: toEmail(raw.email),
|
|
1838
1847
|
displayName: raw.displayName,
|
|
1839
1848
|
country: raw.country === null ? null : toCountryCode(raw.country),
|
|
1840
1849
|
onboarded: raw.onboarded ?? false,
|
|
1841
1850
|
withdrawalAddress: raw.withdrawalAddress === null || raw.withdrawalAddress === void 0 ? null : toAddress(raw.withdrawalAddress),
|
|
1842
|
-
|
|
1851
|
+
handle: raw.handle === null || raw.handle === void 0 ? null : toHandle(raw.handle),
|
|
1843
1852
|
imageUrl: raw.imageUrl ?? null,
|
|
1844
1853
|
kycTier: toKycTier(raw.kycTier),
|
|
1845
1854
|
createdAt: toEpochMs(raw.createdAt),
|
|
@@ -1866,7 +1875,7 @@ var ConvexAccountAdapter = class {
|
|
|
1866
1875
|
this.#telemetry = deps.telemetry;
|
|
1867
1876
|
}
|
|
1868
1877
|
readBalance(input) {
|
|
1869
|
-
return retryIdempotentRead(this.#convex.action(this.#fns.readBalance, copyInvocationObservation(input, { chainId: wireChainId(input.chainId) })),
|
|
1878
|
+
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
1879
|
}
|
|
1871
1880
|
fundFromFaucet(input) {
|
|
1872
1881
|
const operation = "fundFromFaucet";
|
|
@@ -2012,8 +2021,9 @@ var OrgPortTag = class extends Context.Service()("@capxul/sdk/ports/OrgPort") {}
|
|
|
2012
2021
|
function brandOrgView(wire, treasury, viewerRole) {
|
|
2013
2022
|
return {
|
|
2014
2023
|
id: toOrgId(wire.orgId),
|
|
2024
|
+
...wire.creationSource === void 0 ? {} : { creationSource: toTesterKind(wire.creationSource) },
|
|
2015
2025
|
name: wire.name,
|
|
2016
|
-
handle: wire.
|
|
2026
|
+
handle: wire.handle,
|
|
2017
2027
|
safeAddress: toAddress(wire.safeAddress.toLowerCase()),
|
|
2018
2028
|
role: viewerRole,
|
|
2019
2029
|
treasury,
|
|
@@ -2168,7 +2178,7 @@ var ConvexOrganizationAdapter = class {
|
|
|
2168
2178
|
}
|
|
2169
2179
|
#readTreasuryWire(input) {
|
|
2170
2180
|
const orgId = String(input.orgId);
|
|
2171
|
-
return retryIdempotentRead(this.#convex.action(this.#fns.readTreasury, copyInvocationObservation(input, { orgId })),
|
|
2181
|
+
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
2182
|
if (wire.orgId !== orgId) throw Errors.invalidInput("orgId", "Organization treasury scope does not match");
|
|
2173
2183
|
const balance = fromWei(wire.rawBalance, wire.decimals, wire.currency);
|
|
2174
2184
|
const available = fromWei(wire.rawAvailableBalance, wire.decimals, wire.currency);
|
|
@@ -2450,7 +2460,7 @@ function isSetupStep(value) {
|
|
|
2450
2460
|
return value === "preparingFounderAccount" || value === "awaitingFounderAuthorization" || value === "submittingBootstrap" || value === "confirmingBootstrap";
|
|
2451
2461
|
}
|
|
2452
2462
|
function cancellation(signal) {
|
|
2453
|
-
return signal?.aborted ? fail(Errors.cancelled({ operation:
|
|
2463
|
+
return signal?.aborted ? fail(Errors.cancelled({ operation: CAPXUL_OPERATIONS.organization.setup })) : void 0;
|
|
2454
2464
|
}
|
|
2455
2465
|
function fail(error) {
|
|
2456
2466
|
return {
|
|
@@ -2556,8 +2566,23 @@ var ConsoleDiagnosticAdapter = class {
|
|
|
2556
2566
|
};
|
|
2557
2567
|
//#endregion
|
|
2558
2568
|
//#region src/openfort/create-openfort-browser-signer.ts
|
|
2569
|
+
function httpStatusOf(link) {
|
|
2570
|
+
const carrier = link;
|
|
2571
|
+
if (typeof carrier.response?.status === "number") return carrier.response.status;
|
|
2572
|
+
if (typeof carrier.statusCode === "number") return carrier.statusCode;
|
|
2573
|
+
if (typeof carrier.status === "number") return carrier.status;
|
|
2574
|
+
}
|
|
2575
|
+
function isUnauthorizedCause(cause) {
|
|
2576
|
+
for (const link of causeChain(cause)) if (httpStatusOf(link) === 401) return true;
|
|
2577
|
+
return false;
|
|
2578
|
+
}
|
|
2559
2579
|
function openfortProviderError(operation, cause) {
|
|
2560
|
-
|
|
2580
|
+
if (cause instanceof CapxulError) return cause;
|
|
2581
|
+
const failure_mode = operation === "configure" && isUnauthorizedCause(cause) ? "unauthorized" : "unknown";
|
|
2582
|
+
return Errors.providerError("openfort", operation, cause, { failure_mode });
|
|
2583
|
+
}
|
|
2584
|
+
function openfortFailureMode(error) {
|
|
2585
|
+
return error.mode ?? "unknown";
|
|
2561
2586
|
}
|
|
2562
2587
|
/** Build a named PROVIDER_ERROR. The assembled Core SDK boundary reports it. */
|
|
2563
2588
|
function failOpenfort(operation, failure_mode, cause) {
|
|
@@ -2820,11 +2845,12 @@ function createOpenfortBrowserSignerFromBootstrap(bootstrap, options = {}) {
|
|
|
2820
2845
|
await configureEmbeddedWallet(encryptionBody.sessionId);
|
|
2821
2846
|
diagnostic?.trace("openfort.configure", { ok: true });
|
|
2822
2847
|
} catch (cause) {
|
|
2848
|
+
const error = openfortProviderError("configure", cause);
|
|
2823
2849
|
diagnostic?.trace("openfort.configure", {
|
|
2824
2850
|
ok: false,
|
|
2825
|
-
failure_mode:
|
|
2851
|
+
failure_mode: openfortFailureMode(error)
|
|
2826
2852
|
});
|
|
2827
|
-
throw
|
|
2853
|
+
throw error;
|
|
2828
2854
|
}
|
|
2829
2855
|
}
|
|
2830
2856
|
try {
|
|
@@ -3802,4 +3828,4 @@ function captureExceptionSync(telemetry, error, context) {
|
|
|
3802
3828
|
} catch {}
|
|
3803
3829
|
}
|
|
3804
3830
|
//#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 };
|
|
3831
|
+
export { CAPXUL_ERROR_CODES, CAPXUL_OPERATIONS, CAPXUL_PAYMENTS_V2_ADDRESS, CAPXUL_SDK_EXPECTED_OUTCOME_EVENT, CHAIN_UPSTREAMS, CapxulError, EVM_ADDRESS_RE, Errors, FAILURE_MODES, HANDLE_RE, 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, toHandle, toPartyId };
|
package/dist/node/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as CachedJwt,
|
|
2
|
-
import { n as oauthBearerAuthClient, t as OAuthBearerAuthClientInput } from "../OAuthBearerAuthClient-
|
|
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-C0hZ6Kiy.mjs";
|
|
2
|
+
import { n as oauthBearerAuthClient, t as OAuthBearerAuthClientInput } from "../OAuthBearerAuthClient-D-DLYlKj.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 {
|