@capxul/sdk-react 0.1.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,568 @@
1
+ "use client";
2
+ import { createContext, useContext, useSyncExternalStore, useMemo, useState, useEffect } from 'react';
3
+ import { createCapxulClient, makeHttpTransport, CapxulError as CapxulError$1 } from '@capxul/sdk';
4
+ import { QueryClient, QueryClientProvider, useQuery } from '@tanstack/react-query';
5
+ import { jsx } from 'react/jsx-runtime';
6
+ import { CapxulError as CapxulError$2 } from '@capxul/sdk/errors';
7
+ import { useActor } from '@xstate/react';
8
+ import { getAddress } from 'viem';
9
+ import { privateKeyToAccount } from 'viem/accounts';
10
+
11
+ // src/provider.tsx
12
+
13
+ // ../config/src/errors.ts
14
+ var CapxulError = class extends Error {
15
+ code;
16
+ details;
17
+ correlationId;
18
+ layer;
19
+ constructor(code, message, options) {
20
+ super(message, options?.cause ? { cause: options.cause } : void 0);
21
+ this.code = code;
22
+ this.details = options?.details;
23
+ this.correlationId = options?.correlationId;
24
+ this.layer = options?.layer;
25
+ }
26
+ };
27
+ var Errors = {
28
+ notAuthenticated: () => new CapxulError("NOT_AUTHENTICATED", "Not authenticated"),
29
+ profileNotFound: (authUserId) => new CapxulError("PROFILE_NOT_FOUND", `Profile not found for user ${authUserId}`),
30
+ smartAccountMissing: (authUserId) => new CapxulError("SMART_ACCOUNT_MISSING", `Smart account not provisioned for user ${authUserId}`),
31
+ envMissing: (name) => new CapxulError("ENV_MISSING", `Environment variable ${name} not configured`),
32
+ openfortApi: (operation, cause) => new CapxulError(
33
+ "PROVIDER_ERROR",
34
+ `Openfort ${operation} failed: ${cause instanceof Error ? cause.message : String(cause)}`,
35
+ { cause, details: { provider: "openfort", operation } }
36
+ ),
37
+ shieldApi: (status, detail) => new CapxulError(
38
+ "PROVIDER_ERROR",
39
+ `Shield API error (${status}): ${detail}`,
40
+ { details: { provider: "shield", status } }
41
+ ),
42
+ providerError: (provider, operation, cause) => new CapxulError(
43
+ "PROVIDER_ERROR",
44
+ `${provider} ${operation} failed: ${cause instanceof Error ? cause.message : String(cause)}`,
45
+ { cause, details: { provider, operation } }
46
+ ),
47
+ invalidInput: (field, reason) => new CapxulError(
48
+ "INVALID_INPUT",
49
+ `Invalid ${field}: ${reason}`,
50
+ { details: { field, reason } }
51
+ ),
52
+ playerNotFound: (playerId) => new CapxulError(
53
+ "PLAYER_NOT_FOUND",
54
+ playerId ? `Openfort player ${playerId} not found` : "Openfort player not found"
55
+ ),
56
+ accountNotFound: (accountId) => new CapxulError(
57
+ "ACCOUNT_NOT_FOUND",
58
+ accountId ? `Openfort account ${accountId} not found` : "Openfort smart account not found"
59
+ ),
60
+ invalidRecipient: (reason) => new CapxulError("INVALID_RECIPIENT", reason),
61
+ permissionDenied: (reason = "Permission denied") => new CapxulError("PERMISSION_DENIED", reason),
62
+ notFound: (resource, id) => new CapxulError(
63
+ "NOT_FOUND",
64
+ id ? `${resource} ${id} not found` : `${resource} not found`
65
+ ),
66
+ idempotencyConflict: (details) => new CapxulError(
67
+ "IDEMPOTENCY_CONFLICT",
68
+ "Idempotency key was already used for a different request",
69
+ { details }
70
+ ),
71
+ emailDeliveryFailed: (detail) => new CapxulError("EMAIL_DELIVERY_FAILED", `Failed to send email: ${detail}`),
72
+ internalError: (reason) => new CapxulError("INTERNAL_ERROR", `Internal error: ${reason}`)
73
+ };
74
+
75
+ // ../config/src/org-roles.ts
76
+ function roleKeyFromLabel(label) {
77
+ const bytes = new TextEncoder().encode(label);
78
+ const hex = Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("");
79
+ return "0x" + hex.padEnd(64, "0");
80
+ }
81
+ roleKeyFromLabel("OWNER");
82
+ roleKeyFromLabel("FINANCE_MANAGER");
83
+ roleKeyFromLabel("TEAM_LEAD");
84
+ var CapxulClientContext = createContext(null);
85
+ function CapxulClientProvider({
86
+ client,
87
+ children
88
+ }) {
89
+ return /* @__PURE__ */ jsx(CapxulClientContext.Provider, { value: client, children });
90
+ }
91
+ function useCapxul() {
92
+ const client = useContext(CapxulClientContext);
93
+ if (!client) {
94
+ throw new Error(
95
+ "useCapxul() was called outside a <CapxulProvider>. Wrap your app in <CapxulProvider config={...}> before rendering hooks from @capxul/sdk-react."
96
+ );
97
+ }
98
+ return client;
99
+ }
100
+ var CapxulTransportContext = createContext(null);
101
+ function CapxulTransportProvider({
102
+ transport,
103
+ children
104
+ }) {
105
+ return /* @__PURE__ */ jsx(CapxulTransportContext.Provider, { value: transport, children });
106
+ }
107
+ function useCapxulStatus() {
108
+ const transport = useContext(CapxulTransportContext);
109
+ return useSyncExternalStore(
110
+ (listener) => {
111
+ if (!transport) return () => {
112
+ };
113
+ return transport.subscribe(listener);
114
+ },
115
+ () => transport?.getState() ?? FALLBACK_READY,
116
+ () => transport?.getState() ?? FALLBACK_READY
117
+ );
118
+ }
119
+ var FALLBACK_READY = Object.freeze({
120
+ status: "ready",
121
+ runtime: { authBaseUrl: "", convexUrl: "" }
122
+ });
123
+ function CapxulProvider({
124
+ config,
125
+ publishableKey,
126
+ browserConfig,
127
+ queryClient,
128
+ children
129
+ }) {
130
+ const wiring = useMemo(
131
+ () => buildWiring({ config, publishableKey, browserConfig }),
132
+ [config, publishableKey, browserConfig]
133
+ );
134
+ const defaultClient = useMemo(
135
+ () => new QueryClient({
136
+ defaultOptions: { queries: { staleTime: 3e4 } }
137
+ }),
138
+ []
139
+ );
140
+ const effectiveClient = queryClient ?? defaultClient;
141
+ const inner = /* @__PURE__ */ jsx(CapxulClientProvider, { client: wiring.client, children });
142
+ return /* @__PURE__ */ jsx(QueryClientProvider, { client: effectiveClient, children: wiring.transport ? /* @__PURE__ */ jsx(CapxulTransportProvider, { transport: wiring.transport, children: inner }) : inner });
143
+ }
144
+ function buildWiring({
145
+ config,
146
+ publishableKey,
147
+ browserConfig
148
+ }) {
149
+ const sources = [
150
+ config !== void 0,
151
+ publishableKey !== void 0,
152
+ browserConfig !== void 0
153
+ ].filter(Boolean).length;
154
+ if (sources === 0) {
155
+ throw Errors.invalidInput(
156
+ "CapxulProvider",
157
+ "Pass exactly one of `config`, `publishableKey`, or `browserConfig`."
158
+ );
159
+ }
160
+ if (sources > 1) {
161
+ throw Errors.invalidInput(
162
+ "CapxulProvider",
163
+ "`config`, `publishableKey`, and `browserConfig` are mutually exclusive \u2014 pass exactly one."
164
+ );
165
+ }
166
+ if (config !== void 0) {
167
+ return {
168
+ client: createCapxulClient(config),
169
+ transport: null
170
+ };
171
+ }
172
+ const browserCfg = browserConfig ?? {
173
+ mode: "publishable-key",
174
+ // The narrowing above (`sources === 0` rejected; `config` not
175
+ // present) guarantees `publishableKey` is set on this branch.
176
+ publishableKey
177
+ };
178
+ const transport = makeHttpTransport(browserCfg);
179
+ const sdkConfig = {
180
+ _transport: transport,
181
+ publishableKey: browserCfg.mode === "publishable-key" ? browserCfg.publishableKey : void 0
182
+ };
183
+ return {
184
+ client: createCapxulClient(sdkConfig),
185
+ transport
186
+ };
187
+ }
188
+ function notImplementedQuery(hookName) {
189
+ return {
190
+ status: "error",
191
+ error: new CapxulError$2({
192
+ code: "NOT_IMPLEMENTED",
193
+ message: `${hookName} is not yet implemented in @capxul/sdk-react. The hook remains a reset placeholder until its vertical lands per sdk-surface.md \xA73b.`
194
+ })
195
+ };
196
+ }
197
+ function useSdkQuery(read, dependencies) {
198
+ const [state, setState] = useState({
199
+ dependencies,
200
+ result: { status: "loading" }
201
+ });
202
+ const dependenciesChanged = didDependenciesChange(
203
+ state.dependencies,
204
+ dependencies
205
+ );
206
+ useEffect(() => {
207
+ let active = true;
208
+ setState({ dependencies, result: { status: "loading" } });
209
+ void read().then(([error, data]) => {
210
+ if (!active) {
211
+ return;
212
+ }
213
+ if (error) {
214
+ setState({ dependencies, result: { status: "error", error } });
215
+ return;
216
+ }
217
+ setState({ dependencies, result: { status: "data", data } });
218
+ }).catch((cause) => {
219
+ if (!active) {
220
+ return;
221
+ }
222
+ setState({
223
+ dependencies,
224
+ result: {
225
+ status: "error",
226
+ error: cause instanceof CapxulError$2 ? cause : new CapxulError$2({
227
+ code: "UNKNOWN",
228
+ message: "SDK read failed before returning a CapxulResult.",
229
+ cause
230
+ })
231
+ }
232
+ });
233
+ });
234
+ return () => {
235
+ active = false;
236
+ };
237
+ }, dependencies);
238
+ if (dependenciesChanged) {
239
+ return { status: "loading" };
240
+ }
241
+ return state.result;
242
+ }
243
+ function didDependenciesChange(previous, next) {
244
+ if (previous.length !== next.length) {
245
+ return true;
246
+ }
247
+ return previous.some((previousDependency, index) => {
248
+ return !Object.is(previousDependency, next[index]);
249
+ });
250
+ }
251
+
252
+ // src/hooks/singular.ts
253
+ function useMe() {
254
+ const capxul = useCapxul();
255
+ return useQuery({
256
+ queryKey: [capxul.id, "capxul", "me"],
257
+ queryFn: () => capxul.me.get().then(([error, data]) => {
258
+ if (error) {
259
+ throw error;
260
+ }
261
+ return data;
262
+ }).catch((cause) => {
263
+ if (cause instanceof CapxulError$1) {
264
+ throw cause;
265
+ }
266
+ throw new CapxulError$1({
267
+ code: "UNKNOWN",
268
+ message: "SDK read failed before returning a CapxulResult.",
269
+ cause
270
+ });
271
+ }),
272
+ staleTime: 3e4
273
+ });
274
+ }
275
+ function useAccount(_accountId) {
276
+ return notImplementedQuery("useAccount");
277
+ }
278
+ function useOrganization(_organizationId) {
279
+ return notImplementedQuery("useOrganization");
280
+ }
281
+ function useMember(_args) {
282
+ return notImplementedQuery("useMember");
283
+ }
284
+ function useSafe(_safeId) {
285
+ return notImplementedQuery("useSafe");
286
+ }
287
+ function useTreasury(_organizationId) {
288
+ return notImplementedQuery("useTreasury");
289
+ }
290
+ function useApiKey(_args) {
291
+ return notImplementedQuery("useApiKey");
292
+ }
293
+ function useKycProfile(_accountId) {
294
+ return notImplementedQuery("useKycProfile");
295
+ }
296
+ function useKybProfile(_organizationId) {
297
+ return notImplementedQuery("useKybProfile");
298
+ }
299
+ function useExternalAccount(_args) {
300
+ return notImplementedQuery("useExternalAccount");
301
+ }
302
+ function useSubAccount(_subAccountId) {
303
+ return notImplementedQuery("useSubAccount");
304
+ }
305
+ function useVirtualAccount(_virtualAccountId) {
306
+ return notImplementedQuery("useVirtualAccount");
307
+ }
308
+ function useVirtualCard(_virtualCardId) {
309
+ return notImplementedQuery("useVirtualCard");
310
+ }
311
+ function usePayment(_paymentId) {
312
+ return notImplementedQuery("usePayment");
313
+ }
314
+ function useTransfer(_transferId) {
315
+ return notImplementedQuery("useTransfer");
316
+ }
317
+ function useBalanceLedgerEntry(_args) {
318
+ return notImplementedQuery("useBalanceLedgerEntry");
319
+ }
320
+ function useDocument(_documentId) {
321
+ return notImplementedQuery("useDocument");
322
+ }
323
+ function useWithdrawal(withdrawalId) {
324
+ const capxul = useCapxul();
325
+ return useSdkQuery(() => capxul.withdrawals.retrieve(withdrawalId), [
326
+ capxul,
327
+ withdrawalId
328
+ ]);
329
+ }
330
+ function useOperation(operationId) {
331
+ const capxul = useCapxul();
332
+ return useSdkQuery(() => capxul.operations.retrieve(operationId), [
333
+ capxul,
334
+ operationId
335
+ ]);
336
+ }
337
+ function useWebhookEndpoint(_endpointId) {
338
+ return notImplementedQuery("useWebhookEndpoint");
339
+ }
340
+ function useWebhookEvent(_eventId) {
341
+ return notImplementedQuery("useWebhookEvent");
342
+ }
343
+
344
+ // src/hooks/list.ts
345
+ function useOrganizations() {
346
+ return notImplementedQuery("useOrganizations");
347
+ }
348
+ function useMembers(_organizationId) {
349
+ return notImplementedQuery("useMembers");
350
+ }
351
+ function useExternalAccounts(_args) {
352
+ return notImplementedQuery("useExternalAccounts");
353
+ }
354
+ function useSubAccounts(_args) {
355
+ return notImplementedQuery("useSubAccounts");
356
+ }
357
+ function useVirtualAccounts(_filters) {
358
+ return notImplementedQuery("useVirtualAccounts");
359
+ }
360
+ function useVirtualCards(_filters) {
361
+ return notImplementedQuery("useVirtualCards");
362
+ }
363
+ function usePayments(_filters) {
364
+ return notImplementedQuery("usePayments");
365
+ }
366
+ function useOrgPayments(_args) {
367
+ return notImplementedQuery("useOrgPayments");
368
+ }
369
+ function useTransfers(_filters) {
370
+ return notImplementedQuery("useTransfers");
371
+ }
372
+ function useOrgTransfers(_args) {
373
+ return notImplementedQuery("useOrgTransfers");
374
+ }
375
+ function useBalanceLedger(_args) {
376
+ return notImplementedQuery("useBalanceLedger");
377
+ }
378
+ function useDocuments(_filters) {
379
+ return notImplementedQuery("useDocuments");
380
+ }
381
+ function useOrgDocuments(_args) {
382
+ return notImplementedQuery("useOrgDocuments");
383
+ }
384
+ function useWithdrawals(filters) {
385
+ const capxul = useCapxul();
386
+ return useSdkQuery(
387
+ () => capxul.withdrawals.list(filters),
388
+ [capxul, filters?.limit, filters?.cursor]
389
+ );
390
+ }
391
+ function useOrgWithdrawals(args) {
392
+ const capxul = useCapxul();
393
+ return useSdkQuery(
394
+ () => capxul.organizations.withdrawals.list(args),
395
+ [capxul, args.organizationId, args.limit, args.cursor]
396
+ );
397
+ }
398
+ function useApiKeys(_organizationId) {
399
+ return notImplementedQuery("useApiKeys");
400
+ }
401
+ function useWebhookEndpoints() {
402
+ return notImplementedQuery("useWebhookEndpoints");
403
+ }
404
+ function useAuthFlow() {
405
+ const client = useCapxul();
406
+ const machine = useMemo(() => client.flows.auth(), [client]);
407
+ const [snapshot, send] = useActor(machine);
408
+ return { snapshot, send };
409
+ }
410
+ function useOnboardingFlow() {
411
+ const client = useCapxul();
412
+ const machine = useMemo(() => client.flows.onboarding(), [client]);
413
+ const [snapshot, send] = useActor(machine);
414
+ return { snapshot, send };
415
+ }
416
+ function useProvisioningFlow() {
417
+ const client = useCapxul();
418
+ const machine = useMemo(() => client.flows.provisioning(), [client]);
419
+ const [snapshot, send] = useActor(machine);
420
+ return { snapshot, send };
421
+ }
422
+
423
+ // src/config.ts
424
+ function createCapxulConfig(input) {
425
+ assertOnlyKnownKeys(input);
426
+ assertModeRequiredFields(input);
427
+ return Object.freeze({ ...input });
428
+ }
429
+ var ALLOWED_BROWSER_CONFIG_KEYS = [
430
+ "mode",
431
+ "authBaseUrl",
432
+ "convexUrl",
433
+ "publishableKey",
434
+ "bootstrapUrl",
435
+ "fetchImpl"
436
+ ];
437
+ function assertOnlyKnownKeys(input) {
438
+ const candidate = input;
439
+ const allowed = new Set(ALLOWED_BROWSER_CONFIG_KEYS);
440
+ const unknown = Object.keys(candidate).filter((key) => !allowed.has(key));
441
+ if (unknown.length === 0) return;
442
+ throw Errors.invalidInput(
443
+ "config",
444
+ `Browser Capxul config contains unknown or secret/server-only fields: ${unknown.join(", ")}. Allowed keys: ${ALLOWED_BROWSER_CONFIG_KEYS.join(", ")}.`
445
+ );
446
+ }
447
+ function assertModeRequiredFields(input) {
448
+ switch (input.mode) {
449
+ case "build-time-urls": {
450
+ if (!input.authBaseUrl || input.authBaseUrl.trim().length === 0) {
451
+ throw Errors.invalidInput("authBaseUrl", "non-empty string required.");
452
+ }
453
+ if (!input.convexUrl || input.convexUrl.trim().length === 0) {
454
+ throw Errors.invalidInput("convexUrl", "non-empty string required.");
455
+ }
456
+ return;
457
+ }
458
+ case "publishable-key": {
459
+ if (!input.publishableKey || input.publishableKey.trim().length === 0) {
460
+ throw Errors.invalidInput("publishableKey", "non-empty string required.");
461
+ }
462
+ return;
463
+ }
464
+ default: {
465
+ const value = input;
466
+ throw Errors.internalError(
467
+ `Unhandled BrowserCapxulConfig.mode: ${String(value.mode)}.`
468
+ );
469
+ }
470
+ }
471
+ }
472
+ var PRIVATE_KEY_PATTERN = /^0x[0-9a-fA-F]{64}$/;
473
+ var EVM_ADDRESS_PATTERN = /^0x[0-9a-fA-F]{40}$/;
474
+ function injectedConnector(options = {}) {
475
+ const id = options.id ?? "injected";
476
+ return {
477
+ id,
478
+ name: options.name ?? "Injected wallet",
479
+ kind: "injected",
480
+ async connect() {
481
+ const provider = readInjectedProvider();
482
+ const result = await provider.request({
483
+ method: "eth_requestAccounts"
484
+ });
485
+ const accounts = Array.isArray(result) ? result : void 0;
486
+ const rawSignerAddress = accounts?.[0];
487
+ if (rawSignerAddress === void 0 || rawSignerAddress === null) {
488
+ throw Errors.providerError(
489
+ "connector",
490
+ "injected",
491
+ new Error("Injected wallet did not return an account.")
492
+ );
493
+ }
494
+ const signerAddress = validateAndNormalizeEvmAddress(
495
+ "signerAddress",
496
+ rawSignerAddress
497
+ );
498
+ return {
499
+ connectorId: id,
500
+ connectorKind: "injected",
501
+ signerAddress
502
+ };
503
+ }
504
+ };
505
+ }
506
+ function localPrivateKeyConnector(options) {
507
+ if (!options.privateKey || !PRIVATE_KEY_PATTERN.test(options.privateKey)) {
508
+ throw Errors.invalidInput(
509
+ "privateKey",
510
+ "must be a 0x-prefixed 32-byte (64 hex chars) string."
511
+ );
512
+ }
513
+ const safeAddress = validateAndNormalizeEvmAddress(
514
+ "safeAddress",
515
+ options.safeAddress
516
+ );
517
+ const id = options.id ?? "local-private-key";
518
+ return {
519
+ id,
520
+ name: options.name ?? "Local private key",
521
+ kind: "local-private-key",
522
+ autoConnect: true,
523
+ async connect() {
524
+ const account = privateKeyToAccount(options.privateKey);
525
+ return {
526
+ connectorId: id,
527
+ connectorKind: "local-private-key",
528
+ signerAddress: account.address,
529
+ safeAddress,
530
+ signerProvider: {
531
+ kind: "local-private-key",
532
+ signerAddress: account.address,
533
+ safeAddress
534
+ }
535
+ };
536
+ }
537
+ };
538
+ }
539
+ function readInjectedProvider() {
540
+ const provider = globalThis.ethereum;
541
+ if (!provider || typeof provider.request !== "function") {
542
+ throw Errors.providerError(
543
+ "connector",
544
+ "injected",
545
+ new Error("No injected EIP-1193 wallet was found.")
546
+ );
547
+ }
548
+ return provider;
549
+ }
550
+ function validateAndNormalizeEvmAddress(field, raw) {
551
+ if (typeof raw !== "string" || !EVM_ADDRESS_PATTERN.test(raw)) {
552
+ const display = typeof raw === "string" ? raw.slice(0, 64) : String(raw);
553
+ throw Errors.invalidInput(
554
+ field,
555
+ `must be a 0x-prefixed 40 hex char address, got ${display}.`
556
+ );
557
+ }
558
+ try {
559
+ return getAddress(raw);
560
+ } catch (cause) {
561
+ throw Errors.invalidInput(
562
+ field,
563
+ `failed EIP-55 checksum: ${cause instanceof Error ? cause.message : String(cause)}.`
564
+ );
565
+ }
566
+ }
567
+
568
+ export { CapxulClientProvider, CapxulProvider, CapxulTransportProvider, createCapxulConfig, injectedConnector, localPrivateKeyConnector, useAccount, useApiKey, useApiKeys, useAuthFlow, useBalanceLedger, useBalanceLedgerEntry, useCapxul, useCapxulStatus, useDocument, useDocuments, useExternalAccount, useExternalAccounts, useKybProfile, useKycProfile, useMe, useMember, useMembers, useOnboardingFlow, useOperation, useOrgDocuments, useOrgPayments, useOrgTransfers, useOrgWithdrawals, useOrganization, useOrganizations, usePayment, usePayments, useProvisioningFlow, useSafe, useSubAccount, useSubAccounts, useTransfer, useTransfers, useTreasury, useVirtualAccount, useVirtualAccounts, useVirtualCard, useVirtualCards, useWebhookEndpoint, useWebhookEndpoints, useWebhookEvent, useWithdrawal, useWithdrawals };
package/package.json ADDED
@@ -0,0 +1,86 @@
1
+ {
2
+ "name": "@capxul/sdk-react",
3
+ "version": "0.1.0-alpha.0",
4
+ "description": "React provider + hooks for the @capxul/sdk headless client.",
5
+ "license": "UNLICENSED",
6
+ "private": false,
7
+ "type": "module",
8
+ "homepage": "https://capxul.com",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/Xelmar-tech/Capxul.git",
12
+ "directory": "packages/sdk-react"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/Xelmar-tech/Capxul/issues"
16
+ },
17
+ "author": "Capxul (Xelmar Tech Ltd.)",
18
+ "keywords": [
19
+ "capxul",
20
+ "sdk",
21
+ "react",
22
+ "hooks",
23
+ "stablecoin",
24
+ "payments",
25
+ "typescript"
26
+ ],
27
+ "exports": {
28
+ ".": {
29
+ "types": "./dist/index.d.ts",
30
+ "import": "./dist/index.js",
31
+ "require": "./dist/index.cjs"
32
+ }
33
+ },
34
+ "files": [
35
+ "dist",
36
+ "README.md",
37
+ "LICENSE",
38
+ "CHANGELOG.md"
39
+ ],
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "dependencies": {
44
+ "@capxul/sdk": "0.1.0-alpha.0",
45
+ "@repo/config": "0.0.0",
46
+ "@repo/observability": "0.0.0",
47
+ "@repo/platform-kernel": "0.0.0"
48
+ },
49
+ "peerDependencies": {
50
+ "@tanstack/react-query": "^5",
51
+ "@xstate/react": "^5",
52
+ "react": ">=19.0.0",
53
+ "viem": ">=2.0.0"
54
+ },
55
+ "devDependencies": {
56
+ "@tanstack/react-query": "^5",
57
+ "@testing-library/react": "^16.3.2",
58
+ "@xstate/react": "^5",
59
+ "@types/node": "^22.15.3",
60
+ "@types/react": "19.2.2",
61
+ "@types/react-dom": "19.2.3",
62
+ "jsdom": "^29.0.1",
63
+ "react": "19.2.5",
64
+ "react-dom": "19.2.5",
65
+ "tsup": "^8.5.1",
66
+ "tsx": "^4.21.0",
67
+ "typescript": "5.9.2",
68
+ "viem": "2.47.10",
69
+ "vitest": "^4.1.2",
70
+ "@repo/typescript-config": "0.0.0"
71
+ },
72
+ "scripts": {
73
+ "build": "tsup",
74
+ "check-types": "tsc --noEmit",
75
+ "proof:contract": "vitest run ops/proof/sdk-contract.test.ts",
76
+ "proof:drift": "vitest run ops/proof/reset-contract-drift.test.ts",
77
+ "proof:evidence": "tsx ops/proof/evidence-cli.ts",
78
+ "proof:plan": "tsx ops/proof/plan-cli.ts",
79
+ "proof:react-headless": "vitest run ops/proof/react-headless.test.tsx",
80
+ "test": "vitest run",
81
+ "test:types": "vitest run --typecheck"
82
+ },
83
+ "main": "./dist/index.cjs",
84
+ "module": "./dist/index.js",
85
+ "types": "./dist/index.d.ts"
86
+ }