@capxul/sdk-react 0.2.0-alpha.4 → 1.0.0-alpha.10

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.
@@ -0,0 +1,658 @@
1
+ import { ReactNode } from "react";
2
+ import { QueryClient, UseMutationResult, UseQueryResult } from "@tanstack/react-query";
3
+ import { Account, AccountLifecycle, AccountRequirement, ActorRequest, ActorRequestIssueInput, AddressBookAddInput, AddressBookEntry, AddressBookLabelInput, AssignRoleInput, CapxulClient, CapxulSigner, CompleteOrganizationOnboardingInput, CompleteOrganizationOnboardingResult, CompletePersonalOnboardingInput, CompletePersonalOnboardingResult, CreateOrgInput, Destination, DestinationAddInput, DestinationListInput, DestinationRemoveInput, InboxApproveInput, InboxItem, InsightsSummary as InsightsSummary$1, InviteMemberInput, MemberView, OrgId, OrgView, Payment, PaymentsPayInput, PaymentsPayoutInput, PaymentsWithdrawInput, PayrollRosterAddInput, PayrollRosterLine, PayrollRunInput, Profile, ReconciliationEntry, RemoveMemberInput, RoleView, Session, TransferInput, TransferResult } from "@capxul/sdk";
4
+
5
+ //#region src/provider.d.ts
6
+ type CapxulProviderSharedProps = {
7
+ /** Bring your own QueryClient; otherwise the provider creates one. */readonly queryClient?: QueryClient;
8
+ readonly children: ReactNode;
9
+ };
10
+ /** Browser / app path — the provider bootstraps the client from a publishable key. */
11
+ type CapxulProviderPublishableKeyProps = CapxulProviderSharedProps & {
12
+ readonly publishableKey: string;
13
+ readonly client?: never; /** Init-time account readiness target. Default `"none"`. */
14
+ readonly requirement?: AccountRequirement;
15
+ /**
16
+ * Optional consumer-held signer for the deploy lane. Omitted in browser apps
17
+ * with `requirement: "deployed"` — the SDK wires Openfort from bootstrap.
18
+ */
19
+ readonly signer?: CapxulSigner;
20
+ };
21
+ /**
22
+ * Node / server / test path — a pre-built client is supplied; lifecycle stays
23
+ * with the caller. Mutually exclusive with `publishableKey`.
24
+ */
25
+ type CapxulProviderInjectedClientProps = CapxulProviderSharedProps & {
26
+ readonly client: CapxulClient;
27
+ readonly publishableKey?: never;
28
+ readonly requirement?: never;
29
+ readonly signer?: never;
30
+ };
31
+ type CapxulProviderProps = CapxulProviderPublishableKeyProps | CapxulProviderInjectedClientProps;
32
+ declare function CapxulProvider(props: CapxulProviderProps): import("react/jsx-runtime").JSX.Element;
33
+ //#endregion
34
+ //#region ../errors/src/errors.d.ts
35
+ declare const CAPXUL_ERROR_CODES: readonly ["NOT_AUTHENTICATED", "EMAIL_DELIVERY_FAILED", "PROFILE_NOT_FOUND", "SMART_ACCOUNT_MISSING", "PLAYER_NOT_FOUND", "ACCOUNT_NOT_FOUND", "PROVIDER_ERROR", "INVALID_INPUT", "ENV_MISSING", "NOT_IMPLEMENTED", "VERIFICATION_REQUIRED", "INSUFFICIENT_BALANCE", "INVALID_RECIPIENT", "ROLE_PERMISSION_DENIED", "TRANSACTION_FAILED", "RATE_LIMITED", "NETWORK_ERROR", "UNKNOWN", "OTP_EXPIRED", "SIGNER_REJECTED", "CANCELLED", "WRONG_STATE"];
36
+ type CapxulErrorCode = (typeof CAPXUL_ERROR_CODES)[number];
37
+ /**
38
+ * Why an auth/provider call failed — a flat CAUSE enum. The *where* (which
39
+ * OpenFort operation) stays in the separate `operation` detail field; this
40
+ * names the root cause so a single `$exception` can be triaged without
41
+ * parsing the message. Five members, no free strings:
42
+ *
43
+ * - `auth-origin-mismatch`: OTP cookies live on `localhost:PORT` but OpenFort
44
+ * hits the Convex host → no session reaches the provider.
45
+ * - `stale-openfort-cache`: an old `userId` in scoped storage makes the SDK
46
+ * skip re-auth → 401 on `v2/accounts`.
47
+ * - `app-env-allowlist`: missing `VITE_CAPXUL_CONVEX_SITE_URL` / the origin is
48
+ * not allowlisted → 401.
49
+ * - `no-secure-context`: sandboxed/headless browser with no Web Crypto, so
50
+ * `getAddress`/`configure` can never produce an address. Previously vanished
51
+ * into `unknown`; the signer's secure-context probe now names it.
52
+ * - `unknown`: catch-all when no cause could be determined.
53
+ */
54
+ type FailureMode = "auth-origin-mismatch" | "stale-openfort-cache" | "app-env-allowlist" | "no-secure-context" | "unknown";
55
+ type CapxulErrorDetails = Record<string, unknown>;
56
+ type CapxulErrorOptions = {
57
+ readonly cause?: unknown;
58
+ readonly details?: CapxulErrorDetails;
59
+ readonly correlationId?: string;
60
+ readonly layer?: string;
61
+ };
62
+ declare class CapxulError extends Error {
63
+ readonly code: CapxulErrorCode;
64
+ readonly details?: CapxulErrorDetails;
65
+ readonly correlationId?: string;
66
+ readonly layer?: string;
67
+ constructor(code: CapxulErrorCode, message: string, options?: CapxulErrorOptions);
68
+ }
69
+ //#endregion
70
+ //#region src/internal/capxul-bootstrap-context.d.ts
71
+ type CapxulBootstrapStatus = "bootstrapping" | "ready" | "error";
72
+ interface CapxulBootstrapState {
73
+ readonly status: CapxulBootstrapStatus;
74
+ readonly error: CapxulError | null;
75
+ readonly retry: () => void;
76
+ }
77
+ declare function useCapxul(): CapxulBootstrapState;
78
+ //#endregion
79
+ //#region src/internal/capxul-client-context.d.ts
80
+ /**
81
+ * Returns the client, or `null` while `<CapxulProvider>` is still bootstrapping.
82
+ * Data hooks use this so they can sit in `isPending` (disabled query) until the
83
+ * client resolves, rather than throwing during bootstrap.
84
+ */
85
+ declare function useCapxulClientOrNull(): CapxulClient | null;
86
+ //#endregion
87
+ //#region src/hooks/use-capxul-session.d.ts
88
+ type UseCapxulSessionReturn = UseQueryResult<Session | null, CapxulError>;
89
+ declare function useCapxulSession(): UseCapxulSessionReturn;
90
+ //#endregion
91
+ //#region src/hooks/use-capxul-profile.d.ts
92
+ type UseCapxulProfileReturn = UseQueryResult<Profile | null, CapxulError>;
93
+ declare function useCapxulProfile(): UseCapxulProfileReturn;
94
+ //#endregion
95
+ //#region src/hooks/use-capxul-account-lifecycle.d.ts
96
+ interface UseCapxulAccountLifecycleReturn {
97
+ readonly lifecycle: AccountLifecycle;
98
+ readonly isSettingUp: boolean;
99
+ readonly error: CapxulError | null;
100
+ readonly isLoading: boolean;
101
+ readonly isFetching: boolean;
102
+ readonly isError: boolean;
103
+ readonly retry: UseMutationResult<AccountLifecycle, CapxulError, void>["mutateAsync"];
104
+ readonly isRetrying: boolean;
105
+ }
106
+ declare function useCapxulAccountLifecycle(): UseCapxulAccountLifecycleReturn;
107
+ //#endregion
108
+ //#region src/hooks/use-capxul-account-balance.d.ts
109
+ type UseCapxulAccountBalanceReturn = UseQueryResult<Account, CapxulError>;
110
+ type UseCapxulAccountBalanceOptions = {
111
+ /** When false, skips the Convex readBalance action until the account ladder is ready. */readonly enabled?: boolean;
112
+ };
113
+ declare function useCapxulAccountBalance(options?: UseCapxulAccountBalanceOptions): UseCapxulAccountBalanceReturn;
114
+ //#endregion
115
+ //#region ../types/src/brand.d.ts
116
+ /**
117
+ * Nominal type helper. `Brand<T, B>` is structurally a `T` at runtime but
118
+ * distinct at compile time, preventing accidental swaps between primitives.
119
+ *
120
+ * @internal
121
+ */
122
+ declare const brand: unique symbol;
123
+ type Brand<T, B extends string> = T & {
124
+ readonly [brand]: B;
125
+ };
126
+ //#endregion
127
+ //#region ../types/src/index.d.ts
128
+ type Money = {
129
+ readonly currency: CurrencyCode;
130
+ readonly value: string;
131
+ readonly decimals: number;
132
+ };
133
+ type Account$1 = {
134
+ readonly id: AccountId;
135
+ readonly balance: Money;
136
+ readonly available: Money;
137
+ };
138
+ /** Named bucket partitioning a logical Account (canon §9). */
139
+ type SubAccount = {
140
+ readonly id: SubAccountId;
141
+ readonly accountId: AccountId;
142
+ readonly name: string;
143
+ readonly balance: Money;
144
+ readonly createdAt: EpochMs;
145
+ };
146
+ type AccountId = Brand<string, "AccountId">;
147
+ type SubAccountId = Brand<string, "SubAccountId">;
148
+ type OrgId$1 = Brand<string, "OrgId">;
149
+ type EpochMs = Brand<number, "EpochMs">;
150
+ type CurrencyCode = Brand<SupportedCurrencyCode, "CurrencyCode">;
151
+ declare const SUPPORTED_CURRENCIES: readonly [{
152
+ readonly code: "USD";
153
+ readonly symbol: "$";
154
+ readonly name: "US Dollar";
155
+ }, {
156
+ readonly code: "NGN";
157
+ readonly symbol: "NGN";
158
+ readonly name: "Nigerian Naira";
159
+ }, {
160
+ readonly code: "GHS";
161
+ readonly symbol: "GHS";
162
+ readonly name: "Ghanaian Cedi";
163
+ }, {
164
+ readonly code: "KES";
165
+ readonly symbol: "KSh";
166
+ readonly name: "Kenyan Shilling";
167
+ }, {
168
+ readonly code: "UGX";
169
+ readonly symbol: "USh";
170
+ readonly name: "Ugandan Shilling";
171
+ }];
172
+ type SupportedCurrencyCode = (typeof SUPPORTED_CURRENCIES)[number]["code"];
173
+ //#endregion
174
+ //#region src/hooks/use-capxul-account-fund.d.ts
175
+ type UseCapxulAccountFundReturn = UseMutationResult<{
176
+ readonly txHash: string;
177
+ }, CapxulError, Money>;
178
+ declare function useCapxulAccountFund(): UseCapxulAccountFundReturn;
179
+ //#endregion
180
+ //#region src/hooks/use-capxul-sign-in.d.ts
181
+ interface SignInInput {
182
+ readonly email: string;
183
+ }
184
+ interface SignInSuccess {
185
+ readonly sessionId: string;
186
+ readonly expiresAt: number;
187
+ }
188
+ type UseCapxulSignInReturn = UseMutationResult<SignInSuccess, CapxulError, SignInInput>;
189
+ declare function useCapxulSignIn(): UseCapxulSignInReturn;
190
+ //#endregion
191
+ //#region src/hooks/use-capxul-verify-otp.d.ts
192
+ interface VerifyOtpInput {
193
+ readonly email: string;
194
+ readonly code: string;
195
+ }
196
+ type UseCapxulVerifyOtpReturn = UseMutationResult<Session, CapxulError, VerifyOtpInput>;
197
+ declare function useCapxulVerifyOtp(): UseCapxulVerifyOtpReturn;
198
+ //#endregion
199
+ //#region src/hooks/use-capxul-sign-out.d.ts
200
+ type UseCapxulSignOutReturn = UseMutationResult<void, CapxulError, void>;
201
+ declare function useCapxulSignOut(): UseCapxulSignOutReturn;
202
+ //#endregion
203
+ //#region src/hooks/use-capxul-sub-accounts.d.ts
204
+ type UseCapxulSubAccountsListOptions = {
205
+ readonly enabled?: boolean;
206
+ };
207
+ type UseCapxulSubAccountsListReturn = UseQueryResult<readonly SubAccount[], CapxulError>;
208
+ declare function useCapxulSubAccountsList(accountId: AccountId | undefined, options?: UseCapxulSubAccountsListOptions): UseCapxulSubAccountsListReturn;
209
+ type UseCapxulSubAccountCreateReturn = UseMutationResult<SubAccount, CapxulError, {
210
+ readonly accountId: AccountId;
211
+ readonly name: string;
212
+ }>;
213
+ declare function useCapxulSubAccountCreate(): UseCapxulSubAccountCreateReturn;
214
+ type UseCapxulSubAccountRenameReturn = UseMutationResult<SubAccount, CapxulError, {
215
+ readonly accountId: AccountId;
216
+ readonly subAccountId: SubAccountId;
217
+ readonly name: string;
218
+ }>;
219
+ declare function useCapxulSubAccountRename(): UseCapxulSubAccountRenameReturn;
220
+ type UseCapxulSubAccountDeleteReturn = UseMutationResult<void, CapxulError, {
221
+ readonly accountId: AccountId;
222
+ readonly subAccountId: SubAccountId;
223
+ }>;
224
+ declare function useCapxulSubAccountDelete(): UseCapxulSubAccountDeleteReturn;
225
+ /**
226
+ * Move money between two of the SAME Account's balances (canon §5/§12). The
227
+ * consumer-facing labels are "Add money" (main → sub) and "Move money out"
228
+ * (sub → main), both calling `transfer`. `accountId` is carried only to
229
+ * invalidate the right cache keys; the SDK input itself is `{ from, to, amount }`.
230
+ */
231
+ type UseCapxulTransferReturn = UseMutationResult<TransferResult, CapxulError, {
232
+ readonly accountId: AccountId;
233
+ } & TransferInput>;
234
+ declare function useCapxulTransfer(): UseCapxulTransferReturn;
235
+ //#endregion
236
+ //#region src/hooks/use-capxul-money.d.ts
237
+ type UseCapxulPayReturn = UseMutationResult<Payment, CapxulError, PaymentsPayInput>;
238
+ declare function useCapxulPay(): UseCapxulPayReturn;
239
+ type UseCapxulPayoutReturn = UseMutationResult<Payment, CapxulError, PaymentsPayoutInput>;
240
+ declare function useCapxulPayout(): UseCapxulPayoutReturn;
241
+ type UseCapxulWithdrawReturn = UseMutationResult<Payment, CapxulError, PaymentsWithdrawInput>;
242
+ declare function useCapxulWithdraw(): UseCapxulWithdrawReturn;
243
+ type UseCapxulPaymentsReturn = UseQueryResult<readonly Payment[], CapxulError>;
244
+ declare function useCapxulPayments(options?: {
245
+ readonly enabled?: boolean;
246
+ }): UseCapxulPaymentsReturn;
247
+ type UseCapxulPaymentReturn = UseQueryResult<Payment | null, CapxulError>;
248
+ declare function useCapxulPayment(paymentId: string | undefined, options?: {
249
+ readonly enabled?: boolean;
250
+ }): UseCapxulPaymentReturn;
251
+ //#endregion
252
+ //#region src/internal/reactivity-keys.d.ts
253
+ type ReactActorScope = {
254
+ readonly kind: "account";
255
+ } | {
256
+ readonly kind: "org";
257
+ readonly orgId: string;
258
+ };
259
+ //#endregion
260
+ //#region src/hooks/use-capxul-actor-scope.d.ts
261
+ type CapxulActorScope = ReactActorScope;
262
+ declare const capxulAccountScope: {
263
+ readonly kind: "account";
264
+ };
265
+ declare function capxulOrgScope(orgId: OrgId$1 | undefined): CapxulActorScope | undefined;
266
+ type UseCapxulAddressBookReturn = UseQueryResult<readonly AddressBookEntry[], CapxulError>;
267
+ declare function useCapxulAddressBook(actor: CapxulActorScope | undefined, options?: {
268
+ readonly enabled?: boolean;
269
+ }): UseCapxulAddressBookReturn;
270
+ type UseCapxulAddressBookEntryReturn = UseQueryResult<AddressBookEntry | null, CapxulError>;
271
+ declare function useCapxulAddressBookEntry(actor: CapxulActorScope | undefined, entryId: string | undefined, options?: {
272
+ readonly enabled?: boolean;
273
+ }): UseCapxulAddressBookEntryReturn;
274
+ type AddressBookMutation<TData, TVariables> = UseMutationResult<TData, CapxulError, TVariables>;
275
+ type UseCapxulAddAddressBookEntryReturn = AddressBookMutation<AddressBookEntry, AddressBookAddInput>;
276
+ declare const useCapxulAddAddressBookEntry: (actor?: CapxulActorScope | undefined) => AddressBookMutation<AddressBookEntry, AddressBookAddInput>;
277
+ type UseCapxulHideAddressBookEntryReturn = AddressBookMutation<AddressBookEntry, string>;
278
+ declare const useCapxulHideAddressBookEntry: (actor?: CapxulActorScope | undefined) => AddressBookMutation<AddressBookEntry, string>;
279
+ type UseCapxulUnhideAddressBookEntryReturn = AddressBookMutation<AddressBookEntry, string>;
280
+ declare const useCapxulUnhideAddressBookEntry: (actor?: CapxulActorScope | undefined) => AddressBookMutation<AddressBookEntry, string>;
281
+ type UseCapxulLabelAddressBookEntryReturn = AddressBookMutation<AddressBookEntry, AddressBookLabelInput>;
282
+ declare const useCapxulLabelAddressBookEntry: (actor?: CapxulActorScope | undefined) => AddressBookMutation<AddressBookEntry, AddressBookLabelInput>;
283
+ type UseCapxulRequestsReturn = UseQueryResult<readonly ActorRequest[], CapxulError>;
284
+ declare function useCapxulRequests(actor: CapxulActorScope | undefined, options?: {
285
+ readonly enabled?: boolean;
286
+ }): UseCapxulRequestsReturn;
287
+ type UseCapxulRequestReturn = UseQueryResult<ActorRequest | null, CapxulError>;
288
+ declare function useCapxulRequest(actor: CapxulActorScope | undefined, requestId: string | undefined, options?: {
289
+ readonly enabled?: boolean;
290
+ }): UseCapxulRequestReturn;
291
+ type UseCapxulIssueRequestReturn = UseMutationResult<ActorRequest, CapxulError, ActorRequestIssueInput>;
292
+ declare const useCapxulIssueRequest: (actor?: CapxulActorScope | undefined) => UseMutationResult<ActorRequest, CapxulError, ActorRequestIssueInput>;
293
+ type UseCapxulCancelRequestReturn = UseMutationResult<ActorRequest, CapxulError, string>;
294
+ declare const useCapxulCancelRequest: (actor?: CapxulActorScope | undefined) => UseMutationResult<ActorRequest, CapxulError, string>;
295
+ type UseCapxulReconcileRequestsReturn = UseMutationResult<readonly ReconciliationEntry[], CapxulError, void>;
296
+ declare const useCapxulReconcileRequests: (actor?: CapxulActorScope | undefined) => UseMutationResult<readonly ReconciliationEntry[], CapxulError, unknown>;
297
+ type UseCapxulInboxReturn = UseQueryResult<readonly InboxItem[], CapxulError>;
298
+ declare function useCapxulInbox(actor: CapxulActorScope | undefined, options?: {
299
+ readonly enabled?: boolean;
300
+ }): UseCapxulInboxReturn;
301
+ type UseCapxulApproveInboxRequestReturn = UseMutationResult<Payment, CapxulError, InboxApproveInput>;
302
+ declare const useCapxulApproveInboxRequest: (actor?: CapxulActorScope | undefined) => UseMutationResult<Payment, CapxulError, InboxApproveInput>;
303
+ type UseCapxulDeclineInboxRequestReturn = UseMutationResult<InboxItem, CapxulError, string>;
304
+ declare const useCapxulDeclineInboxRequest: (actor?: CapxulActorScope | undefined) => UseMutationResult<InboxItem, CapxulError, string>;
305
+ type UseCapxulInsightsSummaryReturn = UseQueryResult<InsightsSummary$1, CapxulError>;
306
+ declare function useCapxulInsightsSummary(actor: CapxulActorScope | undefined, options?: {
307
+ readonly enabled?: boolean;
308
+ }): UseCapxulInsightsSummaryReturn;
309
+ type UseCapxulInsightsHistoryReturn = UseQueryResult<readonly Payment[], CapxulError>;
310
+ declare function useCapxulInsightsHistory(actor: CapxulActorScope | undefined, options?: {
311
+ readonly enabled?: boolean;
312
+ }): UseCapxulInsightsHistoryReturn;
313
+ //#endregion
314
+ //#region src/hooks/use-capxul-destinations.d.ts
315
+ type UseCapxulDestinationsReturn = UseQueryResult<readonly Destination[], CapxulError>;
316
+ declare function useCapxulDestinations(input: DestinationListInput | undefined, options?: {
317
+ readonly enabled?: boolean;
318
+ }): UseCapxulDestinationsReturn;
319
+ type UseCapxulAddDestinationReturn = UseMutationResult<Destination, CapxulError, DestinationAddInput>;
320
+ declare function useCapxulAddDestination(): UseCapxulAddDestinationReturn;
321
+ type UseCapxulRemoveDestinationReturn = UseMutationResult<{
322
+ readonly id: string;
323
+ }, CapxulError, DestinationRemoveInput>;
324
+ declare function useCapxulRemoveDestination(): UseCapxulRemoveDestinationReturn;
325
+ //#endregion
326
+ //#region src/hooks/use-capxul-payroll.d.ts
327
+ type UseCapxulPayrollRosterReturn = UseQueryResult<readonly PayrollRosterLine[], CapxulError>;
328
+ declare function useCapxulPayrollRoster(orgId: OrgId$1 | undefined, options?: {
329
+ readonly enabled?: boolean;
330
+ }): UseCapxulPayrollRosterReturn;
331
+ type UseCapxulAddPayrollRosterLineReturn = UseMutationResult<PayrollRosterLine, CapxulError, PayrollRosterAddInput>;
332
+ declare const useCapxulAddPayrollRosterLine: (orgId: OrgId$1 | undefined) => UseMutationResult<PayrollRosterLine, CapxulError, PayrollRosterAddInput>;
333
+ type UseCapxulUpdatePayrollRosterLineInput = {
334
+ readonly rosterLineId: string;
335
+ readonly input: Partial<PayrollRosterAddInput>;
336
+ };
337
+ type UseCapxulUpdatePayrollRosterLineReturn = UseMutationResult<PayrollRosterLine, CapxulError, UseCapxulUpdatePayrollRosterLineInput>;
338
+ declare const useCapxulUpdatePayrollRosterLine: (orgId: OrgId$1 | undefined) => UseMutationResult<PayrollRosterLine, CapxulError, UseCapxulUpdatePayrollRosterLineInput>;
339
+ type UseCapxulRemovePayrollRosterLineReturn = UseMutationResult<PayrollRosterLine, CapxulError, string>;
340
+ declare const useCapxulRemovePayrollRosterLine: (orgId: OrgId$1 | undefined) => UseMutationResult<PayrollRosterLine, CapxulError, string>;
341
+ type UseCapxulRunPayrollReturn = UseMutationResult<readonly Payment[], CapxulError, PayrollRunInput>;
342
+ declare const useCapxulRunPayroll: (orgId: OrgId$1 | undefined) => UseMutationResult<readonly Payment[], CapxulError, PayrollRunInput>;
343
+ //#endregion
344
+ //#region src/hooks/use-capxul-orgs.d.ts
345
+ /**
346
+ * List the Orgs you belong to (canon §C1 "Org list" / §C3). Binds directly to
347
+ * the locked `capxul.orgs()` SDK method.
348
+ */
349
+ type UseCapxulOrgsReturn = UseQueryResult<readonly OrgView[], CapxulError>;
350
+ type UseCapxulOrgsOptions = {
351
+ /**
352
+ * Gate the query on auth readiness. `client.orgs()` is a session-scoped
353
+ * authenticated read; firing it before the session token settles surfaces a
354
+ * spurious `NOT_AUTHENTICATED`. Consumers pass `enabled: <auth-ready>` (e.g.
355
+ * "the Organization surface is active") — mirrors `useCapxulSubAccountsList`.
356
+ * Defaults to `true` to preserve the bare `useCapxulOrgs()` call shape.
357
+ */
358
+ readonly enabled?: boolean;
359
+ };
360
+ declare function useCapxulOrgs(options?: UseCapxulOrgsOptions): UseCapxulOrgsReturn;
361
+ //#endregion
362
+ //#region src/hooks/use-capxul-org.d.ts
363
+ type UseCapxulOrgOptions = {
364
+ readonly enabled?: boolean;
365
+ };
366
+ /**
367
+ * A single Org you belong to, resolved from `capxul.orgs()` and narrowed to the
368
+ * requested `orgId` (canon §C3). Returns `null` when the Org is not in your list.
369
+ * Gated by `orgId !== undefined`. RED until S1.
370
+ */
371
+ type UseCapxulOrgReturn = UseQueryResult<OrgView | null, CapxulError>;
372
+ declare function useCapxulOrg(orgId: OrgId | undefined, options?: UseCapxulOrgOptions): UseCapxulOrgReturn;
373
+ //#endregion
374
+ //#region src/hooks/use-capxul-org-members.d.ts
375
+ type UseCapxulOrgMembersOptions = {
376
+ readonly enabled?: boolean;
377
+ };
378
+ /**
379
+ * The members of an Org (canon §C1 "Members" / §C3, D8/D9). Binds directly to
380
+ * the entity-scoped `capxul.org(orgId).members()` (D13). Gated by
381
+ * `orgId !== undefined`. RED until S3.
382
+ */
383
+ type UseCapxulOrgMembersReturn = UseQueryResult<readonly MemberView[], CapxulError>;
384
+ declare function useCapxulOrgMembers(orgId: OrgId | undefined, options?: UseCapxulOrgMembersOptions): UseCapxulOrgMembersReturn;
385
+ //#endregion
386
+ //#region src/hooks/use-capxul-org-roles.d.ts
387
+ type UseCapxulOrgRolesOptions = {
388
+ readonly enabled?: boolean;
389
+ };
390
+ /**
391
+ * The roles seeded on an Org (canon §C1 "Roles" / §C3, D4/D6). Binds directly
392
+ * to the entity-scoped `capxul.org(orgId).roles()` (D13). Gated by
393
+ * `orgId !== undefined`. RED until S2.
394
+ */
395
+ type UseCapxulOrgRolesReturn = UseQueryResult<readonly RoleView[], CapxulError>;
396
+ declare function useCapxulOrgRoles(orgId: OrgId | undefined, options?: UseCapxulOrgRolesOptions): UseCapxulOrgRolesReturn;
397
+ //#endregion
398
+ //#region src/hooks/use-capxul-org-deploy-roles.d.ts
399
+ type UseCapxulOrgDeployRolesReturn = UseMutationResult<readonly RoleView[], CapxulError, OrgId>;
400
+ declare function useCapxulOrgDeployRoles(): UseCapxulOrgDeployRolesReturn;
401
+ //#endregion
402
+ //#region src/hooks/use-capxul-org-treasury.d.ts
403
+ type UseCapxulOrgTreasuryOptions = {
404
+ readonly enabled?: boolean;
405
+ };
406
+ /**
407
+ * The Org treasury — the real M2 `Account` over the Org Safe (canon §C3, D3).
408
+ * NEVER `AccountStatus` (the deploy-readiness ladder, no balance). Binds
409
+ * directly to the entity-scoped `capxul.org(orgId).treasury()` (D13). Gated by
410
+ * `orgId !== undefined`. RED until S1.
411
+ */
412
+ type UseCapxulOrgTreasuryReturn = UseQueryResult<Account$1, CapxulError>;
413
+ declare function useCapxulOrgTreasury(orgId: OrgId | undefined, options?: UseCapxulOrgTreasuryOptions): UseCapxulOrgTreasuryReturn;
414
+ //#endregion
415
+ //#region src/hooks/use-capxul-create-org.d.ts
416
+ /**
417
+ * Create an Org (canon §C2 J1 / §C3, S1). Binds directly to the locked
418
+ * `capxul.createOrg(input)` SDK method. On success, invalidates the org list.
419
+ * RED until S1 — `mutate` rejects with `Errors.notImplemented("org","createOrg")`.
420
+ */
421
+ type UseCapxulCreateOrgReturn = UseMutationResult<OrgView, CapxulError, CreateOrgInput>;
422
+ declare function useCapxulCreateOrg(): UseCapxulCreateOrgReturn;
423
+ //#endregion
424
+ //#region src/hooks/use-capxul-complete-personal-onboarding.d.ts
425
+ /**
426
+ * Complete personal onboarding (D-ONBOARD · #669). Binds to
427
+ * `capxul.onboarding.completePersonal(input)`: persist the user's first identity
428
+ * profile + trigger provisioning, then return the leak-safe `{ lifecycle }`. A
429
+ * mutation, NOT an effect — call `mutateAsync` from a submit handler and route
430
+ * on `lifecycle.status` (see `docs/onboarding.md`). On success it invalidates the
431
+ * identity + account-lifecycle queries so the dashboard/provisioning screen
432
+ * reactively reflects the new state. No effect hooks — a handler + a query.
433
+ */
434
+ type UseCapxulCompletePersonalOnboardingReturn = UseMutationResult<CompletePersonalOnboardingResult, CapxulError, CompletePersonalOnboardingInput>;
435
+ declare function useCapxulCompletePersonalOnboarding(): UseCapxulCompletePersonalOnboardingReturn;
436
+ //#endregion
437
+ //#region src/hooks/use-capxul-complete-organization-onboarding.d.ts
438
+ /**
439
+ * Complete organization onboarding (D-ONBOARD · #669). Binds to
440
+ * `capxul.onboarding.completeOrganization(input)`: persist the founder's identity
441
+ * profile, create the Org (reusing `createOrg`), trigger provisioning, and return
442
+ * `{ org, lifecycle }`. Scope every later org call via `capxul.org(org.id).*`. A
443
+ * mutation, NOT an effect. On success it invalidates the identity, account-
444
+ * lifecycle, and org-list queries. No effect hooks — a handler + a query.
445
+ */
446
+ type UseCapxulCompleteOrganizationOnboardingReturn = UseMutationResult<CompleteOrganizationOnboardingResult, CapxulError, CompleteOrganizationOnboardingInput>;
447
+ declare function useCapxulCompleteOrganizationOnboarding(): UseCapxulCompleteOrganizationOnboardingReturn;
448
+ //#endregion
449
+ //#region src/hooks/use-capxul-invite-member.d.ts
450
+ /**
451
+ * Invite a member to an Org by email (canon §C2 J2 virality loop / §C3, S3, D8).
452
+ * Entity-scoped via the closed-over `orgId` (D13). Binds directly to
453
+ * `capxul.org(orgId).invite(input)`. On success, invalidates the member list.
454
+ * RED until S3 — `mutate` rejects with `Errors.notImplemented("org","invite")`.
455
+ */
456
+ type UseCapxulInviteMemberReturn = UseMutationResult<MemberView, CapxulError, InviteMemberInput>;
457
+ declare function useCapxulInviteMember(orgId: OrgId | undefined): UseCapxulInviteMemberReturn;
458
+ //#endregion
459
+ //#region src/hooks/use-capxul-remove-member.d.ts
460
+ /**
461
+ * Remove a member from an Org (canon §C2 J2 / §C3, S3, D7/D8) — drives the
462
+ * on-chain REVOKE + Convex mirror. Keyed on the member's personal Safe address
463
+ * (D7). Entity-scoped via the closed-over `orgId` (D13). Binds directly to
464
+ * `capxul.org(orgId).removeMember(input)`. On success, invalidates the member
465
+ * list. RED until S3 — `mutate` rejects with
466
+ * `Errors.notImplemented("org","removeMember")`.
467
+ */
468
+ type UseCapxulRemoveMemberReturn = UseMutationResult<void, CapxulError, RemoveMemberInput>;
469
+ declare function useCapxulRemoveMember(orgId: OrgId | undefined): UseCapxulRemoveMemberReturn;
470
+ //#endregion
471
+ //#region src/hooks/use-capxul-assign-role.d.ts
472
+ /**
473
+ * Assign a role to a member (canon §C2 J2 / §C3, S3, D7/D9) — drives the
474
+ * on-chain GRANT + Convex mirror. Keyed on the member's personal Safe address
475
+ * (D7); the `role` label maps deterministically to the on-chain `roleKey` (D9).
476
+ * Entity-scoped via the closed-over `orgId` (D13). Binds directly to
477
+ * `capxul.org(orgId).assignRole(input)`. On success, invalidates the member
478
+ * list. RED until S3 — `mutate` rejects with
479
+ * `Errors.notImplemented("org","assignRole")`.
480
+ */
481
+ type UseCapxulAssignRoleReturn = UseMutationResult<MemberView, CapxulError, AssignRoleInput>;
482
+ declare function useCapxulAssignRole(orgId: OrgId | undefined): UseCapxulAssignRoleReturn;
483
+ //#endregion
484
+ //#region src/hooks/use-capxul-switch-acting-entity.d.ts
485
+ type SwitchActingEntityInput = {
486
+ readonly orgId?: OrgId;
487
+ };
488
+ /**
489
+ * Switch the acting entity (personal Account ↔ Organization).
490
+ *
491
+ * Per canon D13 the acting entity is NOT shared mutable SDK state — scoping is
492
+ * explicit per `capxul.org(orgId)` call — so this mutation carries no SDK side
493
+ * effect. It exists as the stable mutation seam the headless
494
+ * `CapxulEntitySwitcher` drives; the actual context switch is the consumer's
495
+ * own local state, applied through the component's `onSwitchPersonal` /
496
+ * `onSwitchOrg` callbacks.
497
+ *
498
+ * The legacy `org_entity_switched` telemetry emission was removed when master's
499
+ * unified telemetry pipeline (#402) dropped that event from the Layer 0 spine.
500
+ */
501
+ type UseCapxulSwitchActingEntityReturn = UseMutationResult<void, Error, SwitchActingEntityInput | undefined>;
502
+ declare function useCapxulSwitchActingEntity(): UseCapxulSwitchActingEntityReturn;
503
+ //#endregion
504
+ //#region src/headless/shared/headless-error-view.d.ts
505
+ type HeadlessSuggestedAction = "retry" | "sign_out_and_in" | "check_configuration" | "contact_support";
506
+ type HeadlessErrorView = {
507
+ readonly code: CapxulErrorCode;
508
+ readonly failureMode: FailureMode | undefined;
509
+ readonly userMessage: string;
510
+ readonly suggestedAction: HeadlessSuggestedAction;
511
+ readonly recoverable: boolean;
512
+ readonly diagnostics: string;
513
+ readonly correlationId: string | undefined;
514
+ };
515
+ //#endregion
516
+ //#region src/headless/shared/types.d.ts
517
+ type Slot<TProps> = (props: TProps) => ReactNode;
518
+ type QuerySlotState<T> = {
519
+ readonly data: T | undefined;
520
+ readonly isLoading: boolean;
521
+ readonly isFetching: boolean;
522
+ readonly isError: boolean;
523
+ readonly error: HeadlessErrorView | null;
524
+ };
525
+ //#endregion
526
+ //#region src/headless/money/SendMoney.d.ts
527
+ type SendMoneySlots = {
528
+ readonly root?: Slot<{
529
+ readonly children: React.ReactNode;
530
+ }>;
531
+ readonly form?: Slot<{
532
+ readonly value: PaymentsPayInput | null;
533
+ readonly setValue: (value: PaymentsPayInput | null) => void;
534
+ readonly submit: () => void;
535
+ readonly pending: boolean;
536
+ readonly disabled: boolean;
537
+ readonly succeeded: boolean;
538
+ readonly error: HeadlessErrorView | null;
539
+ }>;
540
+ readonly error?: Slot<HeadlessErrorView>;
541
+ };
542
+ interface SendMoneyProps {
543
+ readonly initialValue?: PaymentsPayInput | null;
544
+ readonly slots: SendMoneySlots;
545
+ readonly onSent?: () => void;
546
+ }
547
+ declare function SendMoney({
548
+ initialValue,
549
+ slots,
550
+ onSent
551
+ }: SendMoneyProps): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined>;
552
+ //#endregion
553
+ //#region src/headless/relationship/AddressBook.d.ts
554
+ type AddressBookSlots = {
555
+ readonly root?: Slot<{
556
+ readonly children: React.ReactNode;
557
+ }>;
558
+ readonly entries?: Slot<QuerySlotState<readonly AddressBookEntry[]>>;
559
+ readonly actions?: Slot<{
560
+ readonly add: (input: AddressBookAddInput) => Promise<AddressBookEntry>;
561
+ readonly hide: (entryId: string) => Promise<AddressBookEntry>;
562
+ readonly unhide: (entryId: string) => Promise<AddressBookEntry>;
563
+ readonly label: (input: AddressBookLabelInput) => Promise<AddressBookEntry>;
564
+ readonly pending: boolean;
565
+ readonly disabled: boolean;
566
+ }>;
567
+ };
568
+ interface AddressBookProps {
569
+ readonly actor?: CapxulActorScope | undefined;
570
+ readonly slots: AddressBookSlots;
571
+ }
572
+ declare function AddressBook(props: AddressBookProps): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined>;
573
+ //#endregion
574
+ //#region src/headless/relationship/RequestInbox.d.ts
575
+ type RequestInboxSlots = {
576
+ readonly root?: Slot<{
577
+ readonly children: React.ReactNode;
578
+ }>;
579
+ readonly requests?: Slot<QuerySlotState<readonly ActorRequest[]>>;
580
+ readonly inbox?: Slot<QuerySlotState<readonly InboxItem[]>>;
581
+ readonly actions?: Slot<{
582
+ readonly issue: (input: ActorRequestIssueInput) => Promise<ActorRequest>;
583
+ readonly cancel: (requestId: string) => Promise<ActorRequest>;
584
+ readonly approve: (input: InboxApproveInput) => Promise<Payment>;
585
+ readonly decline: (requestId: string) => Promise<InboxItem>;
586
+ readonly pending: boolean;
587
+ readonly disabled: boolean;
588
+ }>;
589
+ };
590
+ interface RequestInboxProps {
591
+ readonly actor?: CapxulActorScope | undefined;
592
+ readonly slots: RequestInboxSlots;
593
+ }
594
+ declare function RequestInbox(props: RequestInboxProps): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined>;
595
+ //#endregion
596
+ //#region src/headless/relationship/InsightsSummary.d.ts
597
+ type InsightsSummarySlots = {
598
+ readonly root?: Slot<{
599
+ readonly children: React.ReactNode;
600
+ }>;
601
+ readonly summary?: Slot<QuerySlotState<InsightsSummary$1>>;
602
+ };
603
+ interface InsightsSummaryProps {
604
+ readonly actor?: CapxulActorScope | undefined;
605
+ readonly slots: InsightsSummarySlots;
606
+ }
607
+ declare function InsightsSummary(props: InsightsSummaryProps): import("react").ReactNode;
608
+ //#endregion
609
+ //#region src/headless/relationship/PayrollRoster.d.ts
610
+ type PayrollRosterSlots = {
611
+ readonly root?: Slot<{
612
+ readonly children: React.ReactNode;
613
+ }>;
614
+ readonly roster?: Slot<QuerySlotState<readonly PayrollRosterLine[]>>;
615
+ readonly actions?: Slot<{
616
+ readonly add: (input: PayrollRosterAddInput) => Promise<PayrollRosterLine>;
617
+ readonly update: (input: UseCapxulUpdatePayrollRosterLineInput) => Promise<PayrollRosterLine>;
618
+ readonly remove: (rosterLineId: string) => Promise<PayrollRosterLine>;
619
+ readonly run: (input: PayrollRunInput) => Promise<readonly Payment[]>;
620
+ readonly pending: boolean;
621
+ readonly disabled: boolean;
622
+ }>;
623
+ };
624
+ interface PayrollRosterProps {
625
+ readonly orgId: OrgId$1;
626
+ readonly slots: PayrollRosterSlots;
627
+ }
628
+ declare function PayrollRoster({
629
+ orgId,
630
+ slots
631
+ }: PayrollRosterProps): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined>;
632
+ //#endregion
633
+ //#region src/headless/relationship/Destinations.d.ts
634
+ type DestinationsSlots = {
635
+ readonly root?: Slot<{
636
+ readonly children: React.ReactNode;
637
+ }>;
638
+ readonly destinations?: Slot<QuerySlotState<readonly Destination[]>>;
639
+ readonly actions?: Slot<{
640
+ readonly add: (input: DestinationAddInput) => Promise<Destination>;
641
+ readonly remove: (input: DestinationRemoveInput) => Promise<{
642
+ readonly id: string;
643
+ }>;
644
+ readonly pending: boolean;
645
+ readonly disabled: boolean;
646
+ }>;
647
+ };
648
+ interface DestinationsProps {
649
+ readonly input: DestinationListInput;
650
+ readonly slots: DestinationsSlots;
651
+ }
652
+ declare function Destinations({
653
+ input,
654
+ slots
655
+ }: DestinationsProps): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined>;
656
+ //#endregion
657
+ export { AddressBook, type AddressBookProps, type AddressBookSlots, type CapxulActorScope, type CapxulBootstrapState, type CapxulBootstrapStatus, CapxulProvider, type CapxulProviderProps, Destinations, type DestinationsProps, type DestinationsSlots, InsightsSummary, type InsightsSummaryProps, type InsightsSummarySlots, PayrollRoster, type PayrollRosterProps, type PayrollRosterSlots, RequestInbox, type RequestInboxProps, type RequestInboxSlots, SendMoney, type SendMoneyProps, type SendMoneySlots, type SignInInput, type SignInSuccess, type SwitchActingEntityInput, type UseCapxulAccountBalanceOptions, type UseCapxulAccountBalanceReturn, type UseCapxulAccountFundReturn, type UseCapxulAccountLifecycleReturn, type UseCapxulAddAddressBookEntryReturn, type UseCapxulAddDestinationReturn, type UseCapxulAddPayrollRosterLineReturn, type UseCapxulAddressBookEntryReturn, type UseCapxulAddressBookReturn, type UseCapxulApproveInboxRequestReturn, type UseCapxulAssignRoleReturn, type UseCapxulCancelRequestReturn, type UseCapxulCompleteOrganizationOnboardingReturn, type UseCapxulCompletePersonalOnboardingReturn, type UseCapxulCreateOrgReturn, type UseCapxulDeclineInboxRequestReturn, type UseCapxulDestinationsReturn, type UseCapxulHideAddressBookEntryReturn, type UseCapxulInboxReturn, type UseCapxulInsightsHistoryReturn, type UseCapxulInsightsSummaryReturn, type UseCapxulInviteMemberReturn, type UseCapxulIssueRequestReturn, type UseCapxulLabelAddressBookEntryReturn, type UseCapxulOrgDeployRolesReturn, type UseCapxulOrgMembersOptions, type UseCapxulOrgMembersReturn, type UseCapxulOrgOptions, type UseCapxulOrgReturn, type UseCapxulOrgRolesOptions, type UseCapxulOrgRolesReturn, type UseCapxulOrgTreasuryOptions, type UseCapxulOrgTreasuryReturn, type UseCapxulOrgsReturn, type UseCapxulPayReturn, type UseCapxulPaymentReturn, type UseCapxulPaymentsReturn, type UseCapxulPayoutReturn, type UseCapxulPayrollRosterReturn, type UseCapxulProfileReturn, type UseCapxulReconcileRequestsReturn, type UseCapxulRemoveDestinationReturn, type UseCapxulRemoveMemberReturn, type UseCapxulRemovePayrollRosterLineReturn, type UseCapxulRequestReturn, type UseCapxulRequestsReturn, type UseCapxulRunPayrollReturn, type UseCapxulSessionReturn, type UseCapxulSignInReturn, type UseCapxulSignOutReturn, type UseCapxulSubAccountCreateReturn, type UseCapxulSubAccountDeleteReturn, type UseCapxulSubAccountRenameReturn, type UseCapxulSubAccountsListOptions, type UseCapxulSubAccountsListReturn, type UseCapxulSwitchActingEntityReturn, type UseCapxulTransferReturn, type UseCapxulUnhideAddressBookEntryReturn, type UseCapxulUpdatePayrollRosterLineInput, type UseCapxulUpdatePayrollRosterLineReturn, type UseCapxulVerifyOtpReturn, type UseCapxulWithdrawReturn, type VerifyOtpInput, capxulAccountScope, capxulOrgScope, useCapxul, useCapxulAccountBalance, useCapxulAccountFund, useCapxulAccountLifecycle, useCapxulAddAddressBookEntry, useCapxulAddDestination, useCapxulAddPayrollRosterLine, useCapxulAddressBook, useCapxulAddressBookEntry, useCapxulApproveInboxRequest, useCapxulAssignRole, useCapxulCancelRequest, useCapxulClientOrNull, useCapxulCompleteOrganizationOnboarding, useCapxulCompletePersonalOnboarding, useCapxulCreateOrg, useCapxulDeclineInboxRequest, useCapxulDestinations, useCapxulHideAddressBookEntry, useCapxulInbox, useCapxulInsightsHistory, useCapxulInsightsSummary, useCapxulInviteMember, useCapxulIssueRequest, useCapxulLabelAddressBookEntry, useCapxulOrg, useCapxulOrgDeployRoles, useCapxulOrgMembers, useCapxulOrgRoles, useCapxulOrgTreasury, useCapxulOrgs, useCapxulPay, useCapxulPayment, useCapxulPayments, useCapxulPayout, useCapxulPayrollRoster, useCapxulProfile, useCapxulReconcileRequests, useCapxulRemoveDestination, useCapxulRemoveMember, useCapxulRemovePayrollRosterLine, useCapxulRequest, useCapxulRequests, useCapxulRunPayroll, useCapxulSession, useCapxulSignIn, useCapxulSignOut, useCapxulSubAccountCreate, useCapxulSubAccountDelete, useCapxulSubAccountRename, useCapxulSubAccountsList, useCapxulSwitchActingEntity, useCapxulTransfer, useCapxulUnhideAddressBookEntry, useCapxulUpdatePayrollRosterLine, useCapxulVerifyOtp, useCapxulWithdraw };
658
+ //# sourceMappingURL=index.d.mts.map