@capxul/sdk-react 1.2.2 → 2.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/dist/{controllers-GXZi2CmP.mjs → controllers--rna89ya.mjs} +17 -12
- package/dist/controllers-D3_Q5d2t.d.mts +1 -2
- package/dist/index.d.mts +246 -82
- package/dist/index.mjs +165 -149
- package/dist/testing/index.d.mts +1 -2
- package/dist/testing/index.mjs +1 -3
- package/package.json +8 -5
- package/dist/controllers-D3_Q5d2t.d.mts.map +0 -1
- package/dist/controllers-GXZi2CmP.mjs.map +0 -1
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/testing/index.d.mts.map +0 -1
- package/dist/testing/index.mjs.map +0 -1
|
@@ -50,11 +50,6 @@ const capxulKeys = {
|
|
|
50
50
|
provisioning: ["capxul", "provisioning"],
|
|
51
51
|
binding: ["capxul", "binding"],
|
|
52
52
|
accountBalance: ["capxul", "accountBalance"],
|
|
53
|
-
subAccounts: (accountId) => [
|
|
54
|
-
"capxul",
|
|
55
|
-
"subAccounts",
|
|
56
|
-
accountId ?? "pending"
|
|
57
|
-
],
|
|
58
53
|
orgs: ["capxul", "orgs"],
|
|
59
54
|
org: (orgId) => [
|
|
60
55
|
"capxul",
|
|
@@ -79,6 +74,20 @@ const capxulKeys = {
|
|
|
79
74
|
orgId ?? "pending",
|
|
80
75
|
"treasury"
|
|
81
76
|
],
|
|
77
|
+
orgPermissions: (orgId) => [
|
|
78
|
+
"capxul",
|
|
79
|
+
"org",
|
|
80
|
+
orgId ?? "pending",
|
|
81
|
+
"permissions"
|
|
82
|
+
],
|
|
83
|
+
activity: ["capxul", "activity"],
|
|
84
|
+
activityDetail: (kind, id) => [
|
|
85
|
+
"capxul",
|
|
86
|
+
"activity",
|
|
87
|
+
kind,
|
|
88
|
+
id ?? "pending"
|
|
89
|
+
],
|
|
90
|
+
holdings: ["capxul", "holdings"],
|
|
82
91
|
payments: ["capxul", "payments"],
|
|
83
92
|
payment: (paymentId) => [
|
|
84
93
|
"capxul",
|
|
@@ -421,7 +430,7 @@ function clearClientScopedQueries(queryClient, ownsQueryClient) {
|
|
|
421
430
|
queryClient.removeQueries({ predicate: (query) => isCapxulQueryKey(query.queryKey) });
|
|
422
431
|
}
|
|
423
432
|
function CapxulProvider(props) {
|
|
424
|
-
const { publishableKey, client: injectedClient, requirement, signer,
|
|
433
|
+
const { publishableKey, client: injectedClient, requirement, signer, observability, queryClient, children } = props;
|
|
425
434
|
const [resolvedQueryClient] = useState(() => queryClient ?? makeDefaultQueryClient());
|
|
426
435
|
const [ownsQueryClient] = useState(() => queryClient === void 0);
|
|
427
436
|
const [attempt, setAttempt] = useState(0);
|
|
@@ -432,14 +441,12 @@ function CapxulProvider(props) {
|
|
|
432
441
|
publishableKey,
|
|
433
442
|
...requirement === void 0 ? {} : { requirement },
|
|
434
443
|
...signer === void 0 ? {} : { signer },
|
|
435
|
-
...
|
|
436
|
-
...telemetry === void 0 ? {} : { telemetry }
|
|
444
|
+
...observability === void 0 ? {} : { observability }
|
|
437
445
|
}, [
|
|
438
446
|
publishableKey,
|
|
439
447
|
requirement,
|
|
440
448
|
signer,
|
|
441
|
-
|
|
442
|
-
telemetry,
|
|
449
|
+
observability,
|
|
443
450
|
attempt
|
|
444
451
|
]);
|
|
445
452
|
const [ownedBootstrap, setOwnedBootstrap] = useState(null);
|
|
@@ -678,5 +685,3 @@ function organizationForm(props, state, auth, submitted) {
|
|
|
678
685
|
}
|
|
679
686
|
//#endregion
|
|
680
687
|
export { useCapxulAuth as a, useCapxulIdentityOrNull as c, capxulKeys as d, useCapxulClientOrNull as f, entered as i, useCapxulSend as l, CapxulOnboardingController as n, useCapxulDestination as o, useCapxul as p, CapxulProvider as r, useCapxulIdentity as s, CapxulAuthenticationController as t, useCapxulTransitions as u };
|
|
681
|
-
|
|
682
|
-
//# sourceMappingURL=controllers-GXZi2CmP.mjs.map
|
|
@@ -204,5 +204,4 @@ interface OnboardingControllerProps {
|
|
|
204
204
|
}
|
|
205
205
|
declare function CapxulOnboardingController(props: OnboardingControllerProps): ReactNode;
|
|
206
206
|
//#endregion
|
|
207
|
-
export { useCapxulAuth as A, CreateOrganizationSubmission as C, ProfileDetails as D, OrganizationDetails as E, useCapxulIdentity as M, useCapxulSend as N, SendResult as O, useCapxulTransitions as P, CapxulSend as S, InvocationOptions as T, ReadyDestination as _, AuthenticationSlots as a, Slot as b, ControllerAction as c, OnboardingControllerProps as d, OrgFailure as f, ProfileSlotProps as g, PendingAuthState as h, AuthenticatedState as i, useCapxulDestination as j, entered as k, FaultedState as l, OtpPendingState as m, AccountProgress as n, CapxulAuthenticationController as o, OrgProgress as p, ActionResult as r, CapxulOnboardingController as s, AccountFailure as t, NavigationAction as u, RetryAction as v, Destination as w, CapxulAuth as x, SignedOutState as y };
|
|
208
|
-
//# sourceMappingURL=controllers-D3_Q5d2t.d.mts.map
|
|
207
|
+
export { useCapxulAuth as A, CreateOrganizationSubmission as C, ProfileDetails as D, OrganizationDetails as E, useCapxulIdentity as M, useCapxulSend as N, SendResult as O, useCapxulTransitions as P, CapxulSend as S, InvocationOptions as T, ReadyDestination as _, AuthenticationSlots as a, Slot as b, ControllerAction as c, OnboardingControllerProps as d, OrgFailure as f, ProfileSlotProps as g, PendingAuthState as h, AuthenticatedState as i, useCapxulDestination as j, entered as k, FaultedState as l, OtpPendingState as m, AccountProgress as n, CapxulAuthenticationController as o, OrgProgress as p, ActionResult as r, CapxulOnboardingController as s, AccountFailure as t, NavigationAction as u, RetryAction as v, Destination as w, CapxulAuth as x, SignedOutState as y };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { A as useCapxulAuth, C as CreateOrganizationSubmission, D as ProfileDetails, E as OrganizationDetails, M as useCapxulIdentity, N as useCapxulSend, O as SendResult, P as useCapxulTransitions, S as CapxulSend, T as InvocationOptions, _ as ReadyDestination, a as AuthenticationSlots, b as Slot, c as ControllerAction, d as OnboardingControllerProps, f as OrgFailure, g as ProfileSlotProps, h as PendingAuthState, i as AuthenticatedState, j as useCapxulDestination, k as entered, l as FaultedState, m as OtpPendingState, n as AccountProgress, o as CapxulAuthenticationController, p as OrgProgress, r as ActionResult, s as CapxulOnboardingController, t as AccountFailure, u as NavigationAction, v as RetryAction, w as Destination, x as CapxulAuth, y as SignedOutState } from "./controllers-D3_Q5d2t.mjs";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
import { QueryClient, UseMutationResult, UseQueryResult } from "@tanstack/react-query";
|
|
4
|
-
import { Account,
|
|
4
|
+
import { Account, AccountRequirement, ActivityAnnotationInput, ActivityDetail, ActivityListParams, ActivityPage, ActivityReference, CapxulClient, CapxulError, CapxulSigner, CreateOrgInput, CurrentHoldings, HostObservability, InviteMemberInput, MemberView, Money, MovementAnnotation, OrgId, OrgView, OrganizationPaymentBatchInput, OrganizationPaymentInput, Payment, PaymentTiming, PaymentsPayInput, Permission, PermissionReadResult, Profile, RoleView } from "@capxul/sdk";
|
|
5
5
|
|
|
6
6
|
//#region src/provider.d.ts
|
|
7
7
|
type CapxulProviderSharedProps = {
|
|
@@ -11,14 +11,8 @@ type CapxulProviderSharedProps = {
|
|
|
11
11
|
/** Browser / app path — the provider bootstraps the client from a publishable key. */
|
|
12
12
|
type CapxulProviderPublishableKeyProps = CapxulProviderSharedProps & {
|
|
13
13
|
readonly publishableKey: string;
|
|
14
|
-
readonly client?: never; /**
|
|
15
|
-
readonly
|
|
16
|
-
/**
|
|
17
|
-
* Host success-telemetry sink, typically `telemetryFromPostHog(posthog, …)`.
|
|
18
|
-
* Events from SDK producers wired to this port reach the host's PostHog
|
|
19
|
-
* person after the host calls `identify()`.
|
|
20
|
-
*/
|
|
21
|
-
readonly telemetry?: TelemetryPort; /** Init-time account readiness target. Default `"none"`. */
|
|
14
|
+
readonly client?: never; /** One host-owned product/failure observability module. */
|
|
15
|
+
readonly observability?: HostObservability; /** Init-time account readiness target. Default `"none"`. */
|
|
22
16
|
readonly requirement?: AccountRequirement;
|
|
23
17
|
/**
|
|
24
18
|
* Optional consumer-held signer for the deploy lane. Omitted in browser apps
|
|
@@ -32,9 +26,8 @@ type CapxulProviderPublishableKeyProps = CapxulProviderSharedProps & {
|
|
|
32
26
|
*/
|
|
33
27
|
type CapxulProviderInjectedClientProps = CapxulProviderSharedProps & {
|
|
34
28
|
readonly client: CapxulClient;
|
|
35
|
-
readonly publishableKey?: never; /** Injected clients must be created with
|
|
36
|
-
readonly
|
|
37
|
-
readonly telemetry?: never;
|
|
29
|
+
readonly publishableKey?: never; /** Injected clients must be created with observability at their owning factory. */
|
|
30
|
+
readonly observability?: never;
|
|
38
31
|
readonly requirement?: never;
|
|
39
32
|
readonly signer?: never;
|
|
40
33
|
};
|
|
@@ -75,46 +68,19 @@ type UseCapxulAccountFundReturn = UseMutationResult<{
|
|
|
75
68
|
}, CapxulError, Money>;
|
|
76
69
|
declare function useCapxulAccountFund(): UseCapxulAccountFundReturn;
|
|
77
70
|
//#endregion
|
|
78
|
-
//#region src/hooks/use-capxul-sub-accounts.d.ts
|
|
79
|
-
type UseCapxulSubAccountsListOptions = {
|
|
80
|
-
readonly enabled?: boolean;
|
|
81
|
-
};
|
|
82
|
-
type UseCapxulSubAccountsListReturn = UseQueryResult<readonly SubAccount[], CapxulError>;
|
|
83
|
-
declare function useCapxulSubAccountsList(accountId: AccountId | undefined, options?: UseCapxulSubAccountsListOptions): UseCapxulSubAccountsListReturn;
|
|
84
|
-
type UseCapxulSubAccountCreateReturn = UseMutationResult<SubAccount, CapxulError, {
|
|
85
|
-
readonly accountId: AccountId;
|
|
86
|
-
readonly name: string;
|
|
87
|
-
}>;
|
|
88
|
-
declare function useCapxulSubAccountCreate(): UseCapxulSubAccountCreateReturn;
|
|
89
|
-
type UseCapxulSubAccountRenameReturn = UseMutationResult<SubAccount, CapxulError, {
|
|
90
|
-
readonly accountId: AccountId;
|
|
91
|
-
readonly subAccountId: SubAccountId;
|
|
92
|
-
readonly name: string;
|
|
93
|
-
}>;
|
|
94
|
-
declare function useCapxulSubAccountRename(): UseCapxulSubAccountRenameReturn;
|
|
95
|
-
type UseCapxulSubAccountDeleteReturn = UseMutationResult<void, CapxulError, {
|
|
96
|
-
readonly accountId: AccountId;
|
|
97
|
-
readonly subAccountId: SubAccountId;
|
|
98
|
-
}>;
|
|
99
|
-
declare function useCapxulSubAccountDelete(): UseCapxulSubAccountDeleteReturn;
|
|
100
|
-
/**
|
|
101
|
-
* Move money between two of the SAME Account's balances (canon §5/§12). The
|
|
102
|
-
* consumer-facing labels are "Add money" (main → sub) and "Move money out"
|
|
103
|
-
* (sub → main), both calling `transfer`. `accountId` is carried only to
|
|
104
|
-
* invalidate the right cache keys; the SDK input itself is `{ from, to, amount }`.
|
|
105
|
-
*/
|
|
106
|
-
type UseCapxulTransferReturn = UseMutationResult<TransferResult, CapxulError, {
|
|
107
|
-
readonly accountId: AccountId;
|
|
108
|
-
} & TransferInput>;
|
|
109
|
-
declare function useCapxulTransfer(): UseCapxulTransferReturn;
|
|
110
|
-
//#endregion
|
|
111
71
|
//#region src/hooks/use-capxul-money.d.ts
|
|
112
72
|
type UseCapxulPayReturn = UseMutationResult<Payment, CapxulError, PaymentsPayInput>;
|
|
113
73
|
declare function useCapxulPay(): UseCapxulPayReturn;
|
|
114
|
-
type
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
74
|
+
type UseCapxulCreateCommitmentReturn = UseMutationResult<Payment, CapxulError, PaymentsPayInput & {
|
|
75
|
+
readonly timing: Exclude<PaymentTiming, {
|
|
76
|
+
readonly kind: "instant";
|
|
77
|
+
}>;
|
|
78
|
+
}>;
|
|
79
|
+
declare function useCapxulCreateCommitment(): UseCapxulCreateCommitmentReturn;
|
|
80
|
+
declare const useCapxulClaimPayment: () => UseMutationResult<Payment, CapxulError, string>;
|
|
81
|
+
declare const useCapxulCancelPayment: () => UseMutationResult<Payment, CapxulError, string>;
|
|
82
|
+
type UseCapxulRedirectPaymentReturn = UseMutationResult<Payment, CapxulError, Parameters<import("@capxul/sdk").PaymentsMethods["redirect"]>[0]>;
|
|
83
|
+
declare function useCapxulRedirectPayment(): UseCapxulRedirectPaymentReturn;
|
|
118
84
|
type UseCapxulPaymentsReturn = UseQueryResult<readonly Payment[], CapxulError>;
|
|
119
85
|
declare function useCapxulPayments(options?: {
|
|
120
86
|
readonly enabled?: boolean;
|
|
@@ -124,6 +90,235 @@ declare function useCapxulPayment(paymentId: string | undefined, options?: {
|
|
|
124
90
|
readonly enabled?: boolean;
|
|
125
91
|
}): UseCapxulPaymentReturn;
|
|
126
92
|
//#endregion
|
|
93
|
+
//#region src/hooks/use-capxul-organization-payments.d.ts
|
|
94
|
+
declare function useCapxulOrganizationPay(orgId: OrgId): UseMutationResult<Payment, CapxulError, OrganizationPaymentInput>;
|
|
95
|
+
declare function useCapxulOrganizationPayBatch(orgId: OrgId): UseMutationResult<readonly Payment[], CapxulError, OrganizationPaymentBatchInput>;
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region ../types/src/brand.d.ts
|
|
98
|
+
/**
|
|
99
|
+
* Nominal type helper. `Brand<T, B>` is structurally a `T` at runtime but
|
|
100
|
+
* distinct at compile time, preventing accidental swaps between primitives.
|
|
101
|
+
*
|
|
102
|
+
* @internal
|
|
103
|
+
*/
|
|
104
|
+
declare const brand: unique symbol;
|
|
105
|
+
type Brand<T, B extends string> = T & {
|
|
106
|
+
readonly [brand]: B;
|
|
107
|
+
};
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region ../types/src/index.d.ts
|
|
110
|
+
type Address = Brand<string, "Address">;
|
|
111
|
+
type PermissionId = Brand<string, "PermissionId">;
|
|
112
|
+
type PermissionAssignmentId = Brand<string, "PermissionAssignmentId">;
|
|
113
|
+
type PaymentCommandId = Brand<string, "PaymentCommandId">;
|
|
114
|
+
type WeiAmount = Brand<string, "WeiAmount">;
|
|
115
|
+
type RoleKey = Brand<string, "RoleKey">;
|
|
116
|
+
type AllowanceKey = Brand<string, "AllowanceKey">;
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/hooks/use-capxul-permissions.d.ts
|
|
119
|
+
declare const useCapxulPermissionCreate: (orgId: OrgId) => UseMutationResult<{
|
|
120
|
+
readonly status: "submitted";
|
|
121
|
+
readonly executionId: string;
|
|
122
|
+
readonly commandId: PaymentCommandId;
|
|
123
|
+
readonly userOpHash: string;
|
|
124
|
+
readonly value: readonly {
|
|
125
|
+
readonly permissionId: PermissionId;
|
|
126
|
+
readonly orgId: string;
|
|
127
|
+
readonly type: "budget" | "managePeople";
|
|
128
|
+
readonly state: "active" | "pending" | "quarantined" | "revoked" | "superseded" | "suspended";
|
|
129
|
+
readonly revision: number;
|
|
130
|
+
readonly roleKey: RoleKey;
|
|
131
|
+
readonly tokenAddress?: Address | undefined;
|
|
132
|
+
readonly limitRaw?: WeiAmount | undefined;
|
|
133
|
+
readonly allowanceKey?: AllowanceKey | undefined;
|
|
134
|
+
}[] | {
|
|
135
|
+
readonly permissionId: PermissionId;
|
|
136
|
+
readonly orgId: string;
|
|
137
|
+
readonly type: "budget" | "managePeople";
|
|
138
|
+
readonly state: "active" | "pending" | "quarantined" | "revoked" | "superseded" | "suspended";
|
|
139
|
+
readonly revision: number;
|
|
140
|
+
readonly roleKey: RoleKey;
|
|
141
|
+
readonly tokenAddress?: Address | undefined;
|
|
142
|
+
readonly limitRaw?: WeiAmount | undefined;
|
|
143
|
+
readonly allowanceKey?: AllowanceKey | undefined;
|
|
144
|
+
} | {
|
|
145
|
+
readonly permissionAssignmentId: PermissionAssignmentId;
|
|
146
|
+
readonly permissionId: PermissionId;
|
|
147
|
+
readonly actor: {
|
|
148
|
+
readonly kind: "account";
|
|
149
|
+
readonly accountId: string;
|
|
150
|
+
} | {
|
|
151
|
+
readonly kind: "organization";
|
|
152
|
+
readonly orgId: string;
|
|
153
|
+
};
|
|
154
|
+
readonly state: "active" | "pending" | "quarantined" | "revoked" | "superseded" | "suspended";
|
|
155
|
+
};
|
|
156
|
+
}, CapxulError, import("@capxul/sdk").PermissionCreateInput>;
|
|
157
|
+
declare const useCapxulPermissionChange: (orgId: OrgId) => UseMutationResult<{
|
|
158
|
+
readonly status: "submitted";
|
|
159
|
+
readonly executionId: string;
|
|
160
|
+
readonly commandId: PaymentCommandId;
|
|
161
|
+
readonly userOpHash: string;
|
|
162
|
+
readonly value: readonly {
|
|
163
|
+
readonly permissionId: PermissionId;
|
|
164
|
+
readonly orgId: string;
|
|
165
|
+
readonly type: "budget" | "managePeople";
|
|
166
|
+
readonly state: "active" | "pending" | "quarantined" | "revoked" | "superseded" | "suspended";
|
|
167
|
+
readonly revision: number;
|
|
168
|
+
readonly roleKey: RoleKey;
|
|
169
|
+
readonly tokenAddress?: Address | undefined;
|
|
170
|
+
readonly limitRaw?: WeiAmount | undefined;
|
|
171
|
+
readonly allowanceKey?: AllowanceKey | undefined;
|
|
172
|
+
}[] | {
|
|
173
|
+
readonly permissionId: PermissionId;
|
|
174
|
+
readonly orgId: string;
|
|
175
|
+
readonly type: "budget" | "managePeople";
|
|
176
|
+
readonly state: "active" | "pending" | "quarantined" | "revoked" | "superseded" | "suspended";
|
|
177
|
+
readonly revision: number;
|
|
178
|
+
readonly roleKey: RoleKey;
|
|
179
|
+
readonly tokenAddress?: Address | undefined;
|
|
180
|
+
readonly limitRaw?: WeiAmount | undefined;
|
|
181
|
+
readonly allowanceKey?: AllowanceKey | undefined;
|
|
182
|
+
} | {
|
|
183
|
+
readonly permissionAssignmentId: PermissionAssignmentId;
|
|
184
|
+
readonly permissionId: PermissionId;
|
|
185
|
+
readonly actor: {
|
|
186
|
+
readonly kind: "account";
|
|
187
|
+
readonly accountId: string;
|
|
188
|
+
} | {
|
|
189
|
+
readonly kind: "organization";
|
|
190
|
+
readonly orgId: string;
|
|
191
|
+
};
|
|
192
|
+
readonly state: "active" | "pending" | "quarantined" | "revoked" | "superseded" | "suspended";
|
|
193
|
+
};
|
|
194
|
+
}, CapxulError, import("@capxul/sdk").PermissionChangeInput>;
|
|
195
|
+
declare const useCapxulPermissionAssign: (orgId: OrgId) => UseMutationResult<{
|
|
196
|
+
readonly status: "submitted";
|
|
197
|
+
readonly executionId: string;
|
|
198
|
+
readonly commandId: PaymentCommandId;
|
|
199
|
+
readonly userOpHash: string;
|
|
200
|
+
readonly value: readonly {
|
|
201
|
+
readonly permissionId: PermissionId;
|
|
202
|
+
readonly orgId: string;
|
|
203
|
+
readonly type: "budget" | "managePeople";
|
|
204
|
+
readonly state: "active" | "pending" | "quarantined" | "revoked" | "superseded" | "suspended";
|
|
205
|
+
readonly revision: number;
|
|
206
|
+
readonly roleKey: RoleKey;
|
|
207
|
+
readonly tokenAddress?: Address | undefined;
|
|
208
|
+
readonly limitRaw?: WeiAmount | undefined;
|
|
209
|
+
readonly allowanceKey?: AllowanceKey | undefined;
|
|
210
|
+
}[] | {
|
|
211
|
+
readonly permissionId: PermissionId;
|
|
212
|
+
readonly orgId: string;
|
|
213
|
+
readonly type: "budget" | "managePeople";
|
|
214
|
+
readonly state: "active" | "pending" | "quarantined" | "revoked" | "superseded" | "suspended";
|
|
215
|
+
readonly revision: number;
|
|
216
|
+
readonly roleKey: RoleKey;
|
|
217
|
+
readonly tokenAddress?: Address | undefined;
|
|
218
|
+
readonly limitRaw?: WeiAmount | undefined;
|
|
219
|
+
readonly allowanceKey?: AllowanceKey | undefined;
|
|
220
|
+
} | {
|
|
221
|
+
readonly permissionAssignmentId: PermissionAssignmentId;
|
|
222
|
+
readonly permissionId: PermissionId;
|
|
223
|
+
readonly actor: {
|
|
224
|
+
readonly kind: "account";
|
|
225
|
+
readonly accountId: string;
|
|
226
|
+
} | {
|
|
227
|
+
readonly kind: "organization";
|
|
228
|
+
readonly orgId: string;
|
|
229
|
+
};
|
|
230
|
+
readonly state: "active" | "pending" | "quarantined" | "revoked" | "superseded" | "suspended";
|
|
231
|
+
};
|
|
232
|
+
}, CapxulError, import("@capxul/sdk").PermissionAssignInput>;
|
|
233
|
+
declare const useCapxulPermissionRevoke: (orgId: OrgId) => UseMutationResult<{
|
|
234
|
+
readonly status: "submitted";
|
|
235
|
+
readonly executionId: string;
|
|
236
|
+
readonly commandId: PaymentCommandId;
|
|
237
|
+
readonly userOpHash: string;
|
|
238
|
+
readonly value: readonly {
|
|
239
|
+
readonly permissionId: PermissionId;
|
|
240
|
+
readonly orgId: string;
|
|
241
|
+
readonly type: "budget" | "managePeople";
|
|
242
|
+
readonly state: "active" | "pending" | "quarantined" | "revoked" | "superseded" | "suspended";
|
|
243
|
+
readonly revision: number;
|
|
244
|
+
readonly roleKey: RoleKey;
|
|
245
|
+
readonly tokenAddress?: Address | undefined;
|
|
246
|
+
readonly limitRaw?: WeiAmount | undefined;
|
|
247
|
+
readonly allowanceKey?: AllowanceKey | undefined;
|
|
248
|
+
}[] | {
|
|
249
|
+
readonly permissionId: PermissionId;
|
|
250
|
+
readonly orgId: string;
|
|
251
|
+
readonly type: "budget" | "managePeople";
|
|
252
|
+
readonly state: "active" | "pending" | "quarantined" | "revoked" | "superseded" | "suspended";
|
|
253
|
+
readonly revision: number;
|
|
254
|
+
readonly roleKey: RoleKey;
|
|
255
|
+
readonly tokenAddress?: Address | undefined;
|
|
256
|
+
readonly limitRaw?: WeiAmount | undefined;
|
|
257
|
+
readonly allowanceKey?: AllowanceKey | undefined;
|
|
258
|
+
} | {
|
|
259
|
+
readonly permissionAssignmentId: PermissionAssignmentId;
|
|
260
|
+
readonly permissionId: PermissionId;
|
|
261
|
+
readonly actor: {
|
|
262
|
+
readonly kind: "account";
|
|
263
|
+
readonly accountId: string;
|
|
264
|
+
} | {
|
|
265
|
+
readonly kind: "organization";
|
|
266
|
+
readonly orgId: string;
|
|
267
|
+
};
|
|
268
|
+
readonly state: "active" | "pending" | "quarantined" | "revoked" | "superseded" | "suspended";
|
|
269
|
+
};
|
|
270
|
+
}, CapxulError, import("@capxul/sdk").PermissionRevokeInput>;
|
|
271
|
+
declare const useCapxulPermissionReplace: (orgId: OrgId) => UseMutationResult<{
|
|
272
|
+
readonly status: "submitted";
|
|
273
|
+
readonly executionId: string;
|
|
274
|
+
readonly commandId: PaymentCommandId;
|
|
275
|
+
readonly userOpHash: string;
|
|
276
|
+
readonly value: readonly {
|
|
277
|
+
readonly permissionId: PermissionId;
|
|
278
|
+
readonly orgId: string;
|
|
279
|
+
readonly type: "budget" | "managePeople";
|
|
280
|
+
readonly state: "active" | "pending" | "quarantined" | "revoked" | "superseded" | "suspended";
|
|
281
|
+
readonly revision: number;
|
|
282
|
+
readonly roleKey: RoleKey;
|
|
283
|
+
readonly tokenAddress?: Address | undefined;
|
|
284
|
+
readonly limitRaw?: WeiAmount | undefined;
|
|
285
|
+
readonly allowanceKey?: AllowanceKey | undefined;
|
|
286
|
+
}[] | {
|
|
287
|
+
readonly permissionId: PermissionId;
|
|
288
|
+
readonly orgId: string;
|
|
289
|
+
readonly type: "budget" | "managePeople";
|
|
290
|
+
readonly state: "active" | "pending" | "quarantined" | "revoked" | "superseded" | "suspended";
|
|
291
|
+
readonly revision: number;
|
|
292
|
+
readonly roleKey: RoleKey;
|
|
293
|
+
readonly tokenAddress?: Address | undefined;
|
|
294
|
+
readonly limitRaw?: WeiAmount | undefined;
|
|
295
|
+
readonly allowanceKey?: AllowanceKey | undefined;
|
|
296
|
+
} | {
|
|
297
|
+
readonly permissionAssignmentId: PermissionAssignmentId;
|
|
298
|
+
readonly permissionId: PermissionId;
|
|
299
|
+
readonly actor: {
|
|
300
|
+
readonly kind: "account";
|
|
301
|
+
readonly accountId: string;
|
|
302
|
+
} | {
|
|
303
|
+
readonly kind: "organization";
|
|
304
|
+
readonly orgId: string;
|
|
305
|
+
};
|
|
306
|
+
readonly state: "active" | "pending" | "quarantined" | "revoked" | "superseded" | "suspended";
|
|
307
|
+
};
|
|
308
|
+
}, CapxulError, import("@capxul/sdk").PermissionReplaceInput>;
|
|
309
|
+
declare function useCapxulPermissions(orgId: OrgId, options?: {
|
|
310
|
+
readonly enabled?: boolean;
|
|
311
|
+
}): UseQueryResult<PermissionReadResult, CapxulError>;
|
|
312
|
+
declare function useCapxulPermission(orgId: OrgId, permissionId: string | undefined): UseQueryResult<Permission | null, CapxulError>;
|
|
313
|
+
//#endregion
|
|
314
|
+
//#region src/hooks/use-capxul-activity.d.ts
|
|
315
|
+
declare function useCapxulActivity(params?: ActivityListParams): UseQueryResult<ActivityPage, CapxulError>;
|
|
316
|
+
declare function useCapxulActivityDetail(reference: ActivityReference | undefined): UseQueryResult<ActivityDetail | null, CapxulError>;
|
|
317
|
+
declare function useCapxulAnnotateMovement(): UseMutationResult<MovementAnnotation, CapxulError, ActivityAnnotationInput>;
|
|
318
|
+
//#endregion
|
|
319
|
+
//#region src/hooks/use-capxul-holdings.d.ts
|
|
320
|
+
declare function useCapxulHoldings(): UseQueryResult<CurrentHoldings, CapxulError>;
|
|
321
|
+
//#endregion
|
|
127
322
|
//#region src/hooks/use-capxul-orgs.d.ts
|
|
128
323
|
/**
|
|
129
324
|
* List the Orgs you belong to (canon §C1 "Org list" / §C3). Binds directly to
|
|
@@ -134,8 +329,7 @@ type UseCapxulOrgsOptions = {
|
|
|
134
329
|
/**
|
|
135
330
|
* Gate the query on auth readiness. `client.orgs()` is a session-scoped
|
|
136
331
|
* authenticated read; firing it before the session token settles surfaces a
|
|
137
|
-
* spurious `NOT_AUTHENTICATED`. Consumers pass `enabled: <auth-ready
|
|
138
|
-
* "the Organization surface is active") — mirrors `useCapxulSubAccountsList`.
|
|
332
|
+
* spurious `NOT_AUTHENTICATED`. Consumers pass `enabled: <auth-ready>`.
|
|
139
333
|
* Defaults to `true` to preserve the bare `useCapxulOrgs()` call shape.
|
|
140
334
|
*/
|
|
141
335
|
readonly enabled?: boolean;
|
|
@@ -167,10 +361,6 @@ type UseCapxulOrgRolesOptions = {
|
|
|
167
361
|
type UseCapxulOrgRolesReturn = UseQueryResult<readonly RoleView[], CapxulError>;
|
|
168
362
|
declare function useCapxulOrgRoles(orgId: OrgId | undefined, options?: UseCapxulOrgRolesOptions): UseCapxulOrgRolesReturn;
|
|
169
363
|
//#endregion
|
|
170
|
-
//#region src/hooks/use-capxul-org-deploy-roles.d.ts
|
|
171
|
-
type UseCapxulOrgDeployRolesReturn = UseMutationResult<readonly RoleView[], CapxulError, OrgId>;
|
|
172
|
-
declare function useCapxulOrgDeployRoles(): UseCapxulOrgDeployRolesReturn;
|
|
173
|
-
//#endregion
|
|
174
364
|
//#region src/hooks/use-capxul-org-treasury.d.ts
|
|
175
365
|
type UseCapxulOrgTreasuryOptions = {
|
|
176
366
|
readonly enabled?: boolean;
|
|
@@ -203,31 +393,6 @@ declare function useCapxulCreateOrg(): UseCapxulCreateOrgReturn;
|
|
|
203
393
|
type UseCapxulInviteMemberReturn = UseMutationResult<MemberView, CapxulError, InviteMemberInput>;
|
|
204
394
|
declare function useCapxulInviteMember(orgId: OrgId | undefined): UseCapxulInviteMemberReturn;
|
|
205
395
|
//#endregion
|
|
206
|
-
//#region src/hooks/use-capxul-remove-member.d.ts
|
|
207
|
-
/**
|
|
208
|
-
* Remove a member from an Org (canon §C2 J2 / §C3, S3, D7/D8) — drives the
|
|
209
|
-
* on-chain REVOKE + Convex mirror. Keyed on the member's personal Safe address
|
|
210
|
-
* (D7). Entity-scoped via the closed-over `orgId` (D13). Binds directly to
|
|
211
|
-
* `capxul.org(orgId).removeMember(input)`. On success, invalidates the member
|
|
212
|
-
* list. RED until S3 — `mutate` rejects with
|
|
213
|
-
* `Errors.notImplemented("org","removeMember")`.
|
|
214
|
-
*/
|
|
215
|
-
type UseCapxulRemoveMemberReturn = UseMutationResult<void, CapxulError, RemoveMemberInput>;
|
|
216
|
-
declare function useCapxulRemoveMember(orgId: OrgId | undefined): UseCapxulRemoveMemberReturn;
|
|
217
|
-
//#endregion
|
|
218
|
-
//#region src/hooks/use-capxul-assign-role.d.ts
|
|
219
|
-
/**
|
|
220
|
-
* Assign a role to a member (canon §C2 J2 / §C3, S3, D7/D9) — drives the
|
|
221
|
-
* on-chain GRANT + Convex mirror. Keyed on the member's personal Safe address
|
|
222
|
-
* (D7); the `role` label maps deterministically to the on-chain `roleKey` (D9).
|
|
223
|
-
* Entity-scoped via the closed-over `orgId` (D13). Binds directly to
|
|
224
|
-
* `capxul.org(orgId).assignRole(input)`. On success, invalidates the member
|
|
225
|
-
* list. RED until S3 — `mutate` rejects with
|
|
226
|
-
* `Errors.notImplemented("org","assignRole")`.
|
|
227
|
-
*/
|
|
228
|
-
type UseCapxulAssignRoleReturn = UseMutationResult<MemberView, CapxulError, AssignRoleInput>;
|
|
229
|
-
declare function useCapxulAssignRole(orgId: OrgId | undefined): UseCapxulAssignRoleReturn;
|
|
230
|
-
//#endregion
|
|
231
396
|
//#region src/headless/journey/journey-state.d.ts
|
|
232
397
|
type OnboardingIntent = "personal" | "organization";
|
|
233
398
|
type OnboardingStep = "profile" | "organization" | "provisioning";
|
|
@@ -355,5 +520,4 @@ type UseCapxulImageUploadReturn = UseMutationResult<{
|
|
|
355
520
|
*/
|
|
356
521
|
declare function useCapxulImageUpload(): UseCapxulImageUploadReturn;
|
|
357
522
|
//#endregion
|
|
358
|
-
export { type AccountFailure, type AccountProgress, type ActionResult, type AuthenticatedState, type AuthenticationSlots, type CapxulAuth, CapxulAuthenticationController, type CapxulBootstrapState, type CapxulBootstrapStatus, CapxulOnboardingController, CapxulProvider, type CapxulProviderProps, type CapxulSend, type ControllerAction, type CreateOrganizationSubmission, type Destination, type FaultedState, type ImageUploadInput, type ImageUploadTarget, type InvocationOptions, type NavigationAction, type OnboardingControllerProps, type OnboardingIntent, type OnboardingJourney, type OnboardingJourneyPosition, type OnboardingOrigin, type OnboardingStep, type OrgFailure, type OrgProgress, type OrganizationDetails, type OrganizationDraft, type OtpPendingState, type PayoutDraftChain, type PayoutDraftEntry, type PendingAuthState, type ProfileDetails, type ProfileDraft, type ProfileSlotProps, type ReadyDestination, type RetryAction, type SendResult, type SignedOutState, type Slot, type UseCapxulAccountBalanceOptions, type UseCapxulAccountBalanceReturn, type UseCapxulAccountFundReturn, type
|
|
359
|
-
//# sourceMappingURL=index.d.mts.map
|
|
523
|
+
export { type AccountFailure, type AccountProgress, type ActionResult, type AuthenticatedState, type AuthenticationSlots, type CapxulAuth, CapxulAuthenticationController, type CapxulBootstrapState, type CapxulBootstrapStatus, CapxulOnboardingController, CapxulProvider, type CapxulProviderProps, type CapxulSend, type ControllerAction, type CreateOrganizationSubmission, type Destination, type FaultedState, type ImageUploadInput, type ImageUploadTarget, type InvocationOptions, type NavigationAction, type OnboardingControllerProps, type OnboardingIntent, type OnboardingJourney, type OnboardingJourneyPosition, type OnboardingOrigin, type OnboardingStep, type OrgFailure, type OrgProgress, type OrganizationDetails, type OrganizationDraft, type OtpPendingState, type PayoutDraftChain, type PayoutDraftEntry, type PendingAuthState, type ProfileDetails, type ProfileDraft, type ProfileSlotProps, type ReadyDestination, type RetryAction, type SendResult, type SignedOutState, type Slot, type UseCapxulAccountBalanceOptions, type UseCapxulAccountBalanceReturn, type UseCapxulAccountFundReturn, type UseCapxulCreateCommitmentReturn, type UseCapxulCreateOrgReturn, type UseCapxulImageUploadReturn, type UseCapxulInviteMemberReturn, type UseCapxulOrgMembersOptions, type UseCapxulOrgMembersReturn, type UseCapxulOrgRolesOptions, type UseCapxulOrgRolesReturn, type UseCapxulOrgTreasuryOptions, type UseCapxulOrgTreasuryReturn, type UseCapxulOrgsReturn, type UseCapxulPayReturn, type UseCapxulPaymentReturn, type UseCapxulPaymentsReturn, type UseCapxulProfileReturn, type UseCapxulRedirectPaymentReturn, type UseCapxulUsernameAvailabilityReturn, type UsernameAvailability, acknowledgeOnboardingDestination, activeOnboardingRecovery, clearOnboardingJourney, currentOnboardingJourneyId, entered, invalidateOnboardingJourneyObservation, loadOnboardingJourney, onboardingJourneyPosition, saveOnboardingJourney, startOnboardingJourney, useCapxul, useCapxulAccountBalance, useCapxulAccountFund, useCapxulActivity, useCapxulActivityDetail, useCapxulAnnotateMovement, useCapxulAuth, useCapxulCancelPayment, useCapxulClaimPayment, useCapxulClientOrNull, useCapxulCreateCommitment, useCapxulCreateOrg, useCapxulDestination, useCapxulHoldings, useCapxulIdentity, useCapxulImageUpload, useCapxulInviteMember, useCapxulOrgMembers, useCapxulOrgRoles, useCapxulOrgTreasury, useCapxulOrganizationPay, useCapxulOrganizationPayBatch, useCapxulOrgs, useCapxulPay, useCapxulPayment, useCapxulPayments, useCapxulPermission, useCapxulPermissionAssign, useCapxulPermissionChange, useCapxulPermissionCreate, useCapxulPermissionReplace, useCapxulPermissionRevoke, useCapxulPermissions, useCapxulProfile, useCapxulRedirectPayment, useCapxulSend, useCapxulTransitions, useCapxulUsernameAvailability };
|