@capxul/sdk 0.1.0-alpha.3 → 0.1.0-alpha.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @capxul/sdk
2
2
 
3
+ ## 0.1.0-alpha.4
4
+
5
+ ### Minor Changes
6
+
7
+ - Post-alpha hardening — WAVE 1 + WAVE 2 cumulative
8
+
9
+ **WAVE 1 (merged 2026-05-03 12:44Z):**
10
+ - S2 story 1: wire onboarding readback hooks (#469) — `me.update`, `accounts.retrieve`, `accounts.update`, `useAccount`, `useSafe`
11
+ - S3 phase 1: Ink reference CLI scaffold + `auth+me` end-to-end against live alpha-3 Convex (#470). Stickiness gate (D3) fired.
12
+ - S5: split `CapxulProvider` into public single-input `BrowserCapxulConfig` + test-only `CapxulTestProvider` from `@capxul/sdk-react/proof` (#473). Q1 lock honored. 7 type-level provider-shape guards including `@ts-expect-error` against test-provider leaking to public barrel.
13
+
14
+ **WAVE 2 (merged 2026-05-03 12:54-13:16Z):**
15
+ - S3 phase 2: per-domain CLI commands closing #458 (#476) — `account retrieve/update`, `safe retrieve`, `payment retrieve`, `withdrawal retrieve/list`. 12/12 agent-driver tests pass.
16
+ - S2 story 2: `capxul.tokenTransfers.*` non-canonical SDK namespace (#479) — Option A per #477 (canon-aligned `transfers.*` shape deferred to alpha.5+ pending backend canon work). New `useTokenTransfers` + `useTokenTransfer` hooks; new `getByTxLogIndex` backend query. Hook proof matrix length unchanged at 41 (non-canonical hooks deliberately excluded).
17
+
18
+ **S1 (#456) closed no-op** — alpha publish infrastructure (tsup, lazy-DX, transport state machine, npm metadata, READMEs, CHANGELOG, changesets, OIDC release workflow) physically merged into `api-first` via PRs #449-#452 earlier the same day; the slice merge produced 0 file changes per clean-room probe.
19
+
20
+ **Friction issues filed for alpha.4+ polish:**
21
+ - #474 — `me.get` returns `NOT_IMPLEMENTED` when `config.data` is undefined; should be `NOT_AUTHENTICATED`.
22
+ - #475 — `@capxul/sdk/headless` slim entry point excludes xstate flow machines + brand constructors (1.6 MB → much smaller).
23
+ - #477 / #478 — `transfers.*` / `balanceLedger.*` / `treasury` canon-shape alignment with indexer feed.
24
+ - #471 — Vercel-capxul-web preview-deploy systemic failure on api-first base (separate from epic).
25
+
3
26
  ## 0.1.0-alpha.3
4
27
 
5
28
  ### Patch Changes
@@ -2,7 +2,7 @@ import { Account as Account$1 } from 'viem';
2
2
  import { AnyStateMachine } from 'xstate';
3
3
  import { A as AccountId, S as SafeId, c as KycProfileId, b as ExternalAccountId, f as SubAccountId, d as OrganizationId, a as ApiKeyId, X as TimestampIso, D as DocumentId, O as OperationId, P as PaymentId, g as TransferId, k as WithdrawalId, W as WebhookEndpointId, j as WebhookEventId, M as MemberId, K as KybProfileId, V as VirtualAccountId, i as VirtualCardId } from './next-action-DkrwXYay.cjs';
4
4
  import { d as CapxulResult, C as CapxulError } from './errors-GgKrSUKp.cjs';
5
- import { A as Account, U as UserIdentifier, a as AccountLookupResult, S as Safe, i as KycProfile, E as ExternalAccount, L as List, v as SubAccount, B as BalanceLedgerEntry, b as ApiKey, D as Document, O as Operation, l as OperationStatus, k as Money, C as CreatePaymentResult, o as Payment, F as TransferEndpoint, f as CreateTransferResult, y as Transfer, g as CreateWithdrawalResult, _ as Withdrawal, Y as WebhookEndpoint, Z as WebhookEvent, n as Organization, J as Treasury, M as Member, K as KybProfile, V as VirtualAccount, Q as VirtualCard } from './types-z4VLz9rS.cjs';
5
+ import { A as Account, U as UserIdentifier, a as AccountLookupResult, S as Safe, i as KycProfile, E as ExternalAccount, L as List, v as SubAccount, B as BalanceLedgerEntry, b as ApiKey, D as Document, O as Operation, l as OperationStatus, k as Money, C as CreatePaymentResult, o as Payment, F as TransferEndpoint, f as CreateTransferResult, y as Transfer, g as CreateWithdrawalResult, _ as Withdrawal, Y as WebhookEndpoint, Z as WebhookEvent, n as Organization, J as Treasury, M as Member, K as KybProfile, V as VirtualAccount, Q as VirtualCard } from './types-DVWojoy4.cjs';
6
6
  import * as types from '@repo/api-contract/gen/types';
7
7
 
8
8
  /**
@@ -53,10 +53,10 @@ type AccountCreateExternalAccountInput = {
53
53
  readonly panToken?: string;
54
54
  readonly last4?: string;
55
55
  };
56
- type RetrieveCodes$d = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
56
+ type RetrieveCodes$e = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
57
57
  type LookupCodes = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
58
58
  type UpdateCodes$1 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND" | "INVALID_INPUT";
59
- type ListCodes$a = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
59
+ type ListCodes$b = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
60
60
  type SafeRetrieveCodes$1 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND" | "SAFE_NOT_READY";
61
61
  type RemoveCodes$5 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
62
62
  type AccountSafesClient = {
@@ -64,32 +64,32 @@ type AccountSafesClient = {
64
64
  };
65
65
  type AccountKycProfilesClient = {
66
66
  readonly create: (input: AccountCreateKycProfileInput) => Promise<CapxulResult<KycProfile, UpdateCodes$1>>;
67
- readonly retrieve: (kycProfileId: KycProfileId) => Promise<CapxulResult<KycProfile, RetrieveCodes$d>>;
67
+ readonly retrieve: (kycProfileId: KycProfileId) => Promise<CapxulResult<KycProfile, RetrieveCodes$e>>;
68
68
  };
69
69
  type AccountExternalAccountsClient = {
70
70
  readonly create: (input: AccountCreateExternalAccountInput) => Promise<CapxulResult<ExternalAccount, UpdateCodes$1>>;
71
71
  readonly list: (input: {
72
72
  readonly accountId: AccountId;
73
- } & AccountListInput) => Promise<CapxulResult<List<ExternalAccount>, ListCodes$a>>;
74
- readonly retrieve: (externalAccountId: ExternalAccountId) => Promise<CapxulResult<ExternalAccount, RetrieveCodes$d>>;
73
+ } & AccountListInput) => Promise<CapxulResult<List<ExternalAccount>, ListCodes$b>>;
74
+ readonly retrieve: (externalAccountId: ExternalAccountId) => Promise<CapxulResult<ExternalAccount, RetrieveCodes$e>>;
75
75
  readonly remove: (externalAccountId: ExternalAccountId) => Promise<CapxulResult<void, RemoveCodes$5>>;
76
76
  };
77
77
  type AccountSubAccountsClient = {
78
78
  readonly create: (input: AccountCreateSubAccountInput) => Promise<CapxulResult<SubAccount, UpdateCodes$1>>;
79
79
  readonly list: (input: {
80
80
  readonly accountId: AccountId;
81
- } & AccountListInput) => Promise<CapxulResult<List<SubAccount>, ListCodes$a>>;
82
- readonly retrieve: (subAccountId: SubAccountId) => Promise<CapxulResult<SubAccount, RetrieveCodes$d>>;
81
+ } & AccountListInput) => Promise<CapxulResult<List<SubAccount>, ListCodes$b>>;
82
+ readonly retrieve: (subAccountId: SubAccountId) => Promise<CapxulResult<SubAccount, RetrieveCodes$e>>;
83
83
  readonly remove: (subAccountId: SubAccountId) => Promise<CapxulResult<void, RemoveCodes$5>>;
84
84
  };
85
85
  type AccountBalanceLedgerClient = {
86
86
  readonly list: (input: {
87
87
  readonly accountId: AccountId;
88
- } & AccountListInput) => Promise<CapxulResult<List<BalanceLedgerEntry>, ListCodes$a>>;
89
- readonly retrieve: (entryId: string) => Promise<CapxulResult<BalanceLedgerEntry, RetrieveCodes$d>>;
88
+ } & AccountListInput) => Promise<CapxulResult<List<BalanceLedgerEntry>, ListCodes$b>>;
89
+ readonly retrieve: (entryId: string) => Promise<CapxulResult<BalanceLedgerEntry, RetrieveCodes$e>>;
90
90
  };
91
91
  type AccountsClient = {
92
- readonly retrieve: (accountId: AccountId) => Promise<CapxulResult<Account, RetrieveCodes$d>>;
92
+ readonly retrieve: (accountId: AccountId) => Promise<CapxulResult<Account, RetrieveCodes$e>>;
93
93
  readonly lookup: (input: AccountLookupInput) => Promise<CapxulResult<AccountLookupResult, LookupCodes>>;
94
94
  readonly update: (input: {
95
95
  readonly accountId: AccountId;
@@ -125,9 +125,9 @@ type ApiKeysListInput = {
125
125
  };
126
126
  type ApiKeysRevokeInput = ApiKeysRetrieveInput;
127
127
  type CreateCodes$8 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT" | "RATE_LIMITED" | "NETWORK_ERROR";
128
- type RetrieveCodes$c = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
129
- type ListCodes$9 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
130
- type RevokeCodes = RetrieveCodes$c;
128
+ type RetrieveCodes$d = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
129
+ type ListCodes$a = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
130
+ type RevokeCodes = RetrieveCodes$d;
131
131
  /**
132
132
  * Shape returned by `organizations.apiKeys.create` — the one-time
133
133
  * secret `value` is included here and omitted from every subsequent
@@ -138,8 +138,8 @@ type ApiKeyCreateResult = ApiKey & {
138
138
  };
139
139
  type ApiKeysClient = {
140
140
  readonly create: (input: ApiKeysCreateInput) => Promise<CapxulResult<ApiKeyCreateResult, CreateCodes$8>>;
141
- readonly retrieve: (input: ApiKeysRetrieveInput) => Promise<CapxulResult<ApiKey, RetrieveCodes$c>>;
142
- readonly list: (input: ApiKeysListInput) => Promise<CapxulResult<List<ApiKey>, ListCodes$9>>;
141
+ readonly retrieve: (input: ApiKeysRetrieveInput) => Promise<CapxulResult<ApiKey, RetrieveCodes$d>>;
142
+ readonly list: (input: ApiKeysListInput) => Promise<CapxulResult<List<ApiKey>, ListCodes$a>>;
143
143
  readonly revoke: (input: ApiKeysRevokeInput) => Promise<CapxulResult<ApiKey, RevokeCodes>>;
144
144
  };
145
145
 
@@ -260,19 +260,19 @@ type OrgDocumentsCancelInput = {
260
260
  readonly documentId: DocumentId;
261
261
  };
262
262
  type CreateCodes$7 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT" | "IDEMPOTENCY_CONFLICT" | "RATE_LIMITED" | "NETWORK_ERROR";
263
- type RetrieveCodes$b = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
264
- type ListCodes$8 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
263
+ type RetrieveCodes$c = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
264
+ type ListCodes$9 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
265
265
  type CancelCodes$1 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND" | "OPERATION_CANCELED";
266
266
  type DocumentsClient = {
267
267
  readonly create: (input: DocumentsCreateInput) => Promise<CapxulResult<Document, CreateCodes$7>>;
268
- readonly retrieve: (documentId: DocumentId) => Promise<CapxulResult<Document, RetrieveCodes$b>>;
269
- readonly list: (input?: DocumentsListInput) => Promise<CapxulResult<List<Document>, ListCodes$8>>;
268
+ readonly retrieve: (documentId: DocumentId) => Promise<CapxulResult<Document, RetrieveCodes$c>>;
269
+ readonly list: (input?: DocumentsListInput) => Promise<CapxulResult<List<Document>, ListCodes$9>>;
270
270
  readonly cancel: (documentId: DocumentId) => Promise<CapxulResult<Document, CancelCodes$1>>;
271
271
  };
272
272
  type OrgDocumentsClient = {
273
273
  readonly create: (input: OrgDocumentsCreateInput) => Promise<CapxulResult<Document, CreateCodes$7>>;
274
- readonly retrieve: (input: OrgDocumentsRetrieveInput) => Promise<CapxulResult<Document, RetrieveCodes$b>>;
275
- readonly list: (input: OrgDocumentsListInput) => Promise<CapxulResult<List<Document>, ListCodes$8>>;
274
+ readonly retrieve: (input: OrgDocumentsRetrieveInput) => Promise<CapxulResult<Document, RetrieveCodes$c>>;
275
+ readonly list: (input: OrgDocumentsListInput) => Promise<CapxulResult<List<Document>, ListCodes$9>>;
276
276
  readonly cancel: (input: OrgDocumentsCancelInput) => Promise<CapxulResult<Document, CancelCodes$1>>;
277
277
  };
278
278
 
@@ -286,10 +286,10 @@ type OrgDocumentsClient = {
286
286
  * ID without scoping.
287
287
  */
288
288
 
289
- type RetrieveCodes$a = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
290
- type RemoveCodes$4 = RetrieveCodes$a;
289
+ type RetrieveCodes$b = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
290
+ type RemoveCodes$4 = RetrieveCodes$b;
291
291
  type ExternalAccountsClient = {
292
- readonly retrieve: (externalAccountId: ExternalAccountId) => Promise<CapxulResult<ExternalAccount, RetrieveCodes$a>>;
292
+ readonly retrieve: (externalAccountId: ExternalAccountId) => Promise<CapxulResult<ExternalAccount, RetrieveCodes$b>>;
293
293
  readonly remove: (externalAccountId: ExternalAccountId) => Promise<CapxulResult<void, RemoveCodes$4>>;
294
294
  };
295
295
 
@@ -329,10 +329,10 @@ type OperationsWaitInput = {
329
329
  readonly timeoutSeconds?: number;
330
330
  readonly pollIntervalMs?: number;
331
331
  };
332
- type RetrieveCodes$9 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
333
- type WaitCodes = RetrieveCodes$9 | "OPERATION_TIMEOUT";
332
+ type RetrieveCodes$a = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
333
+ type WaitCodes = RetrieveCodes$a | "OPERATION_TIMEOUT";
334
334
  type OperationsClient = {
335
- readonly retrieve: (operationId: OperationId) => Promise<CapxulResult<Operation, RetrieveCodes$9>>;
335
+ readonly retrieve: (operationId: OperationId) => Promise<CapxulResult<Operation, RetrieveCodes$a>>;
336
336
  readonly wait: (operationId: OperationId, input?: OperationsWaitInput) => Promise<CapxulResult<Operation, WaitCodes>>;
337
337
  };
338
338
 
@@ -393,17 +393,17 @@ type OrgPaymentsListInput = {
393
393
  };
394
394
  type CreateCodes$6 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT" | "INVALID_RECIPIENT" | "INSUFFICIENT_BALANCE" | "IDEMPOTENCY_CONFLICT" | "RATE_LIMITED" | "NETWORK_ERROR";
395
395
  type OrgCreateCodes = CreateCodes$6 | "POLICY_DENIED" | "SAFE_NOT_READY";
396
- type RetrieveCodes$8 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
397
- type ListCodes$7 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
396
+ type RetrieveCodes$9 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
397
+ type ListCodes$8 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
398
398
  type PaymentsClient = {
399
399
  readonly create: (input: PaymentsCreateInput) => Promise<CapxulResult<CreatePaymentResult, CreateCodes$6>>;
400
- readonly retrieve: (paymentId: PaymentId) => Promise<CapxulResult<Payment, RetrieveCodes$8>>;
401
- readonly list: (input?: PaymentsListInput) => Promise<CapxulResult<List<Payment>, ListCodes$7>>;
400
+ readonly retrieve: (paymentId: PaymentId) => Promise<CapxulResult<Payment, RetrieveCodes$9>>;
401
+ readonly list: (input?: PaymentsListInput) => Promise<CapxulResult<List<Payment>, ListCodes$8>>;
402
402
  };
403
403
  type OrgPaymentsClient = {
404
404
  readonly create: (input: OrgPaymentsCreateInput) => Promise<CapxulResult<CreatePaymentResult, OrgCreateCodes>>;
405
- readonly retrieve: (input: OrgPaymentsRetrieveInput) => Promise<CapxulResult<Payment, RetrieveCodes$8>>;
406
- readonly list: (input: OrgPaymentsListInput) => Promise<CapxulResult<List<Payment>, ListCodes$7>>;
405
+ readonly retrieve: (input: OrgPaymentsRetrieveInput) => Promise<CapxulResult<Payment, RetrieveCodes$9>>;
406
+ readonly list: (input: OrgPaymentsListInput) => Promise<CapxulResult<List<Payment>, ListCodes$8>>;
407
407
  };
408
408
 
409
409
  /**
@@ -452,34 +452,56 @@ type OrgTransfersCancelInput = {
452
452
  readonly transferId: TransferId;
453
453
  };
454
454
  type CreateCodes$5 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT" | "INSUFFICIENT_BALANCE" | "IDEMPOTENCY_CONFLICT" | "RATE_LIMITED" | "NETWORK_ERROR";
455
- type RetrieveCodes$7 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
456
- type ListCodes$6 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
455
+ type RetrieveCodes$8 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
456
+ type ListCodes$7 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
457
457
  type ConfirmCodes = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND" | "QUOTE_EXPIRED" | "QUOTE_NOT_FOUND";
458
458
  type CancelCodes = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND" | "OPERATION_CANCELED";
459
459
  type TransfersClient = {
460
460
  readonly create: (input: TransfersCreateInput) => Promise<CapxulResult<CreateTransferResult, CreateCodes$5>>;
461
- readonly retrieve: (transferId: TransferId) => Promise<CapxulResult<Transfer, RetrieveCodes$7>>;
462
- readonly list: (input?: TransfersListInput) => Promise<CapxulResult<List<Transfer>, ListCodes$6>>;
461
+ readonly retrieve: (transferId: TransferId) => Promise<CapxulResult<Transfer, RetrieveCodes$8>>;
462
+ readonly list: (input?: TransfersListInput) => Promise<CapxulResult<List<Transfer>, ListCodes$7>>;
463
463
  readonly confirm: (input: TransfersConfirmInput) => Promise<CapxulResult<Transfer, ConfirmCodes>>;
464
464
  readonly cancel: (transferId: TransferId) => Promise<CapxulResult<Transfer, CancelCodes>>;
465
465
  };
466
466
  type OrgTransfersClient = {
467
467
  readonly create: (input: OrgTransfersCreateInput) => Promise<CapxulResult<CreateTransferResult, CreateCodes$5>>;
468
- readonly retrieve: (input: OrgTransfersRetrieveInput) => Promise<CapxulResult<Transfer, RetrieveCodes$7>>;
469
- readonly list: (input: OrgTransfersListInput) => Promise<CapxulResult<List<Transfer>, ListCodes$6>>;
468
+ readonly retrieve: (input: OrgTransfersRetrieveInput) => Promise<CapxulResult<Transfer, RetrieveCodes$8>>;
469
+ readonly list: (input: OrgTransfersListInput) => Promise<CapxulResult<List<Transfer>, ListCodes$7>>;
470
470
  readonly confirm: (input: OrgTransfersConfirmInput) => Promise<CapxulResult<Transfer, ConfirmCodes>>;
471
471
  readonly cancel: (input: OrgTransfersCancelInput) => Promise<CapxulResult<Transfer, CancelCodes>>;
472
472
  };
473
473
 
474
474
  /**
475
475
  * Withdrawals domain — funds exit Capxul via an `external_account` per
476
- * sdk-surface.md §1a + §4.52.
476
+ * sdk-surface.md §1a + §4.52 + withdrawal-orchestration.mdx (slice 1
477
+ * of Withdrawals v1, #440).
478
+ *
479
+ * Slice 1 NOTE — transitional input shape:
480
+ * Until the `external_accounts` resource lands (slice 1.x or v2), the
481
+ * destination input includes a `kind` field so the backend + SDK can
482
+ * route to the chain_wallet rail without a real external_accounts
483
+ * lookup. When the resource lands, `kind` becomes optional / ignored
484
+ * and the kind is inferred from the resolved row.
485
+ *
486
+ * Slice 1 NOTE — chain_wallet rail integration:
487
+ * For evm destinations, the `externalAccountId` is treated as the
488
+ * destination address (must start with `0x`) so the chain_wallet rail
489
+ * can call `transferAsOwner` directly. For solana / starknet the SDK
490
+ * accepts the create call but does NOT execute the rail submission —
491
+ * the row stays in `processing` until external_accounts lands. The
492
+ * caller can transition it via `markFailed` if needed.
477
493
  */
478
494
 
479
495
  type WithdrawalsCreateInput = {
480
496
  readonly amount: Money;
481
497
  readonly destination: {
482
498
  readonly externalAccountId: ExternalAccountId;
499
+ /**
500
+ * Slice 1 transitional field. Required until the
501
+ * `external_accounts` resource lands; will become optional / ignored
502
+ * when the resource is the source of truth for kind.
503
+ */
504
+ readonly kind: "evm" | "solana" | "starknet" | "bank" | "momo" | "card_payout";
483
505
  };
484
506
  readonly source?: {
485
507
  readonly subAccountId: SubAccountId;
@@ -505,17 +527,17 @@ type OrgWithdrawalsListInput = {
505
527
  readonly cursor?: string;
506
528
  };
507
529
  type CreateCodes$4 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT" | "INSUFFICIENT_BALANCE" | "IDEMPOTENCY_CONFLICT" | "KYC_REQUIRED" | "POLICY_DENIED" | "RATE_LIMITED" | "NETWORK_ERROR";
508
- type RetrieveCodes$6 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
509
- type ListCodes$5 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
530
+ type RetrieveCodes$7 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
531
+ type ListCodes$6 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
510
532
  type WithdrawalsClient = {
511
533
  readonly create: (input: WithdrawalsCreateInput) => Promise<CapxulResult<CreateWithdrawalResult, CreateCodes$4>>;
512
- readonly retrieve: (withdrawalId: WithdrawalId) => Promise<CapxulResult<Withdrawal, RetrieveCodes$6>>;
513
- readonly list: (input?: WithdrawalsListInput) => Promise<CapxulResult<List<Withdrawal>, ListCodes$5>>;
534
+ readonly retrieve: (withdrawalId: WithdrawalId) => Promise<CapxulResult<Withdrawal, RetrieveCodes$7>>;
535
+ readonly list: (input?: WithdrawalsListInput) => Promise<CapxulResult<List<Withdrawal>, ListCodes$6>>;
514
536
  };
515
537
  type OrgWithdrawalsClient = {
516
538
  readonly create: (input: OrgWithdrawalsCreateInput) => Promise<CapxulResult<CreateWithdrawalResult, CreateCodes$4>>;
517
- readonly retrieve: (input: OrgWithdrawalsRetrieveInput) => Promise<CapxulResult<Withdrawal, RetrieveCodes$6>>;
518
- readonly list: (input: OrgWithdrawalsListInput) => Promise<CapxulResult<List<Withdrawal>, ListCodes$5>>;
539
+ readonly retrieve: (input: OrgWithdrawalsRetrieveInput) => Promise<CapxulResult<Withdrawal, RetrieveCodes$7>>;
540
+ readonly list: (input: OrgWithdrawalsListInput) => Promise<CapxulResult<List<Withdrawal>, ListCodes$6>>;
519
541
  };
520
542
 
521
543
  /**
@@ -541,9 +563,9 @@ type WebhookEndpointsListInput = {
541
563
  };
542
564
  type WebhookEndpointsRemoveInput = WebhookEndpointsRetrieveInput;
543
565
  type CreateCodes$3 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT" | "RATE_LIMITED" | "NETWORK_ERROR";
544
- type RetrieveCodes$5 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
545
- type ListCodes$4 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
546
- type RemoveCodes$3 = RetrieveCodes$5;
566
+ type RetrieveCodes$6 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
567
+ type ListCodes$5 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
568
+ type RemoveCodes$3 = RetrieveCodes$6;
547
569
  /**
548
570
  * Shape returned by `organizations.webhookEndpoints.create` — the
549
571
  * one-time `signingSecret` is included here and omitted from every
@@ -554,8 +576,8 @@ type WebhookEndpointCreateResult = WebhookEndpoint & {
554
576
  };
555
577
  type WebhookEndpointsClient = {
556
578
  readonly create: (input: WebhookEndpointsCreateInput) => Promise<CapxulResult<WebhookEndpointCreateResult, CreateCodes$3>>;
557
- readonly retrieve: (input: WebhookEndpointsRetrieveInput) => Promise<CapxulResult<WebhookEndpoint, RetrieveCodes$5>>;
558
- readonly list: (input: WebhookEndpointsListInput) => Promise<CapxulResult<List<WebhookEndpoint>, ListCodes$4>>;
579
+ readonly retrieve: (input: WebhookEndpointsRetrieveInput) => Promise<CapxulResult<WebhookEndpoint, RetrieveCodes$6>>;
580
+ readonly list: (input: WebhookEndpointsListInput) => Promise<CapxulResult<List<WebhookEndpoint>, ListCodes$5>>;
559
581
  readonly remove: (input: WebhookEndpointsRemoveInput) => Promise<CapxulResult<void, RemoveCodes$3>>;
560
582
  };
561
583
 
@@ -576,11 +598,11 @@ type WebhookEventsListInput = {
576
598
  readonly endpointId?: string;
577
599
  readonly type?: string;
578
600
  };
579
- type RetrieveCodes$4 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
580
- type ListCodes$3 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
601
+ type RetrieveCodes$5 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
602
+ type ListCodes$4 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
581
603
  type WebhookEventsClient = {
582
- readonly retrieve: (input: WebhookEventsRetrieveInput) => Promise<CapxulResult<WebhookEvent, RetrieveCodes$4>>;
583
- readonly list: (input: WebhookEventsListInput) => Promise<CapxulResult<List<WebhookEvent>, ListCodes$3>>;
604
+ readonly retrieve: (input: WebhookEventsRetrieveInput) => Promise<CapxulResult<WebhookEvent, RetrieveCodes$5>>;
605
+ readonly list: (input: WebhookEventsListInput) => Promise<CapxulResult<List<WebhookEvent>, ListCodes$4>>;
584
606
  };
585
607
 
586
608
  /**
@@ -653,8 +675,8 @@ type OrgCreateExternalAccountInput = {
653
675
  readonly last4?: string;
654
676
  };
655
677
  type CreateCodes$2 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT" | "RATE_LIMITED" | "NETWORK_ERROR";
656
- type RetrieveCodes$3 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
657
- type ListCodes$2 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
678
+ type RetrieveCodes$4 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
679
+ type ListCodes$3 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
658
680
  type UpdateCodes = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND" | "INVALID_INPUT";
659
681
  /**
660
682
  * Org safe retrieve does NOT surface `SAFE_NOT_READY` — a co-member
@@ -669,7 +691,7 @@ type UpdateCodes = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND" | "IN
669
691
  */
670
692
  type SafeRetrieveCodes = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
671
693
  type TreasuryRetrieveCodes = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND" | "SAFE_NOT_READY";
672
- type RemoveCodes$2 = RetrieveCodes$3;
694
+ type RemoveCodes$2 = RetrieveCodes$4;
673
695
  type OrgSafesClient = {
674
696
  readonly retrieve: (input: OrgSafeRetrieveInput) => Promise<CapxulResult<Safe, SafeRetrieveCodes>>;
675
697
  };
@@ -677,23 +699,23 @@ type OrgTreasuryClient = {
677
699
  readonly retrieve: (organizationId: OrganizationId) => Promise<CapxulResult<Treasury, TreasuryRetrieveCodes>>;
678
700
  };
679
701
  type OrgMembersClient = {
680
- readonly list: (input: OrgListInput) => Promise<CapxulResult<List<Member>, ListCodes$2>>;
681
- readonly retrieve: (input: OrgMemberRetrieveInput) => Promise<CapxulResult<Member, RetrieveCodes$3>>;
702
+ readonly list: (input: OrgListInput) => Promise<CapxulResult<List<Member>, ListCodes$3>>;
703
+ readonly retrieve: (input: OrgMemberRetrieveInput) => Promise<CapxulResult<Member, RetrieveCodes$4>>;
682
704
  readonly invite: (input: OrgMemberInviteInput) => Promise<CapxulResult<Member, UpdateCodes>>;
683
705
  readonly updateRole: (input: OrgMemberUpdateRoleInput) => Promise<CapxulResult<Member, UpdateCodes>>;
684
706
  readonly remove: (input: OrgMemberRemoveInput) => Promise<CapxulResult<void, RemoveCodes$2>>;
685
707
  };
686
708
  type OrgKybProfileClient = {
687
709
  readonly start: (input: OrgKybProfileStartInput) => Promise<CapxulResult<KybProfile, CreateCodes$2>>;
688
- readonly retrieve: (input: OrgKybProfileRetrieveInput) => Promise<CapxulResult<KybProfile, RetrieveCodes$3>>;
710
+ readonly retrieve: (input: OrgKybProfileRetrieveInput) => Promise<CapxulResult<KybProfile, RetrieveCodes$4>>;
689
711
  };
690
712
  type OrgSubAccountsClient = {
691
713
  readonly create: (input: OrgCreateSubAccountInput) => Promise<CapxulResult<SubAccount, UpdateCodes>>;
692
- readonly list: (input: OrgListInput) => Promise<CapxulResult<List<SubAccount>, ListCodes$2>>;
714
+ readonly list: (input: OrgListInput) => Promise<CapxulResult<List<SubAccount>, ListCodes$3>>;
693
715
  readonly retrieve: (input: {
694
716
  readonly organizationId: OrganizationId;
695
717
  readonly subAccountId: SubAccountId;
696
- }) => Promise<CapxulResult<SubAccount, RetrieveCodes$3>>;
718
+ }) => Promise<CapxulResult<SubAccount, RetrieveCodes$4>>;
697
719
  readonly remove: (input: {
698
720
  readonly organizationId: OrganizationId;
699
721
  readonly subAccountId: SubAccountId;
@@ -701,28 +723,28 @@ type OrgSubAccountsClient = {
701
723
  };
702
724
  type OrgExternalAccountsClient = {
703
725
  readonly create: (input: OrgCreateExternalAccountInput) => Promise<CapxulResult<ExternalAccount, UpdateCodes>>;
704
- readonly list: (input: OrgListInput) => Promise<CapxulResult<List<ExternalAccount>, ListCodes$2>>;
726
+ readonly list: (input: OrgListInput) => Promise<CapxulResult<List<ExternalAccount>, ListCodes$3>>;
705
727
  readonly retrieve: (input: {
706
728
  readonly organizationId: OrganizationId;
707
729
  readonly externalAccountId: ExternalAccountId;
708
- }) => Promise<CapxulResult<ExternalAccount, RetrieveCodes$3>>;
730
+ }) => Promise<CapxulResult<ExternalAccount, RetrieveCodes$4>>;
709
731
  readonly remove: (input: {
710
732
  readonly organizationId: OrganizationId;
711
733
  readonly externalAccountId: ExternalAccountId;
712
734
  }) => Promise<CapxulResult<void, RemoveCodes$2>>;
713
735
  };
714
736
  type OrgBalanceLedgerClient = {
715
- readonly list: (input: OrgListInput) => Promise<CapxulResult<List<BalanceLedgerEntry>, ListCodes$2>>;
737
+ readonly list: (input: OrgListInput) => Promise<CapxulResult<List<BalanceLedgerEntry>, ListCodes$3>>;
716
738
  readonly retrieve: (input: {
717
739
  readonly organizationId: OrganizationId;
718
740
  readonly entryId: string;
719
- }) => Promise<CapxulResult<BalanceLedgerEntry, RetrieveCodes$3>>;
741
+ }) => Promise<CapxulResult<BalanceLedgerEntry, RetrieveCodes$4>>;
720
742
  };
721
743
  type OrgApiKeysClient = ApiKeysClient;
722
744
  type OrganizationsClient = {
723
745
  readonly create: (input: OrganizationsCreateInput) => Promise<CapxulResult<Organization, CreateCodes$2>>;
724
- readonly retrieve: (organizationId: OrganizationId) => Promise<CapxulResult<Organization, RetrieveCodes$3>>;
725
- readonly list: (input?: OrganizationsListInput) => Promise<CapxulResult<List<Organization>, ListCodes$2>>;
746
+ readonly retrieve: (organizationId: OrganizationId) => Promise<CapxulResult<Organization, RetrieveCodes$4>>;
747
+ readonly list: (input?: OrganizationsListInput) => Promise<CapxulResult<List<Organization>, ListCodes$3>>;
726
748
  readonly update: (input: OrganizationsUpdateInput) => Promise<CapxulResult<Organization, UpdateCodes>>;
727
749
  readonly safes: OrgSafesClient;
728
750
  readonly treasury: OrgTreasuryClient;
@@ -879,13 +901,111 @@ declare function makeHttpTransport(config: BrowserCapxulConfig): HttpTransport;
879
901
  * `remove` live at the top level.
880
902
  */
881
903
 
882
- type RetrieveCodes$2 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
883
- type RemoveCodes$1 = RetrieveCodes$2;
904
+ type RetrieveCodes$3 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
905
+ type RemoveCodes$1 = RetrieveCodes$3;
884
906
  type SubAccountsClient = {
885
- readonly retrieve: (subAccountId: SubAccountId) => Promise<CapxulResult<SubAccount, RetrieveCodes$2>>;
907
+ readonly retrieve: (subAccountId: SubAccountId) => Promise<CapxulResult<SubAccount, RetrieveCodes$3>>;
886
908
  readonly remove: (subAccountId: SubAccountId) => Promise<CapxulResult<void, RemoveCodes$1>>;
887
909
  };
888
910
 
911
+ /**
912
+ * **NON-CANONICAL surface.**
913
+ *
914
+ * `capxul.tokenTransfers.*` exposes the indexer's raw on-chain ERC-20
915
+ * transfer rows directly to consumers, backed by
916
+ * `packages/backend/convex/tokenTransfers/queries.ts`. Authorized at
917
+ * `slice/02-story2-balance` per the conductor's Option-A verdict —
918
+ * the canonical SDK `transfers.*` namespace assumes a cross-custody
919
+ * internal-move shape (`Transfer = { source, destination, fx,
920
+ * operation, ... }`) that has no canon-aligned backing query yet.
921
+ * Surfacing the on-chain feed under a separate, clearly-marked
922
+ * non-canonical namespace lets the Ink CLI's activity dashboard
923
+ * progress without forcing canon synthesis.
924
+ *
925
+ * **NOT in `packages/api-contract`.** Do NOT use this surface as the
926
+ * basis for new canon. When `transfers.*` shape alignment lands
927
+ * (post-alpha.4 follow-up issue), the canonical `transfers.*` will
928
+ * subsume this and `tokenTransfers.*` becomes a deprecation alias.
929
+ *
930
+ * Stub families that REMAIN deferred at this slice
931
+ * (per `[DEFERRED-CANON]` markers in
932
+ * `.claude/worktrees/post-alpha-wire2/.progress.txt`):
933
+ * - `transfers.{create,retrieve,list,confirm,cancel}` — canon shape mismatch
934
+ * - `accounts.balanceLedger.{list,retrieve}` — no canon backing query
935
+ * - `organizations.balanceLedger.*` — no canon backing query
936
+ * - `organizations.transfers.*` — canon shape mismatch
937
+ * - `organizations.treasury.retrieve` — backing query has different shape
938
+ */
939
+
940
+ /**
941
+ * Branded id for an on-chain `tokenTransfer` row. Backed by the
942
+ * Convex document id; the brand prevents accidental swaps with other
943
+ * SDK ids without leaking the document-id constraint into call sites.
944
+ *
945
+ * Returned in `TokenTransfer.id` for clients that want a stable
946
+ * back-reference; the canonical lookup key is the
947
+ * `(txHash, logIndex)` composite used by `retrieve`.
948
+ */
949
+ type TokenTransferId = string & {
950
+ readonly __capxulTokenTransferIdBrand: "TokenTransferId";
951
+ };
952
+ declare const toTokenTransferId: (raw: string) => TokenTransferId;
953
+ /**
954
+ * Raw on-chain ERC-20 transfer row. Shape mirrors
955
+ * `tokenTransfers/queries.ts` `list` / `getByTxLogIndex` output. The
956
+ * primitive fields (`txHash`, `tokenAddress`, etc.) match
957
+ * `@repo/api-contract` conventions — `string` for hashes/addresses,
958
+ * `number` for block + chain ids — so consumers don't need to import
959
+ * a brand surface that isn't in the SDK's published deps.
960
+ */
961
+ type TokenTransfer = {
962
+ readonly id: TokenTransferId;
963
+ readonly object: "token_transfer";
964
+ readonly direction: "in" | "out";
965
+ /** Token-units string ("123456" not "1.23456"). Decimals carried in `tokenDecimals`. */
966
+ readonly amount: string;
967
+ readonly tokenSymbol: string;
968
+ readonly tokenDecimals: number;
969
+ readonly tokenAddress: string;
970
+ readonly counterpartyName: string | null;
971
+ readonly counterpartyAddress: string;
972
+ readonly description: string;
973
+ /** Block timestamp in epoch milliseconds. */
974
+ readonly createdAt: number;
975
+ readonly txHash: string;
976
+ readonly blockNumber: number;
977
+ readonly chainId: number;
978
+ };
979
+ type TokenTransfersListPage = {
980
+ readonly object: "list";
981
+ readonly data: readonly TokenTransfer[];
982
+ readonly page: {
983
+ readonly hasMore: boolean;
984
+ /** Block-timestamp cursor (epoch ms) for the next page; null when exhausted. */
985
+ readonly nextCursor: number | null;
986
+ };
987
+ /** Caller's display currency. The backend echoes it so renderers don't need a second round-trip. */
988
+ readonly displayCurrency: string;
989
+ };
990
+ type TokenTransfersListInput = {
991
+ readonly limit?: number;
992
+ /** Block-timestamp cursor (epoch ms) returned in the previous page's `page.nextCursor`. */
993
+ readonly cursor?: number;
994
+ readonly direction?: "in" | "out";
995
+ };
996
+ type TokenTransfersRetrieveInput = {
997
+ readonly txHash: string;
998
+ readonly logIndex: number;
999
+ /** Optional chain filter. When omitted, the first index hit wins (single-chain default). */
1000
+ readonly chainId?: number;
1001
+ };
1002
+ type ListCodes$2 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
1003
+ type RetrieveCodes$2 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
1004
+ type TokenTransfersClient = {
1005
+ readonly list: (input?: TokenTransfersListInput) => Promise<CapxulResult<TokenTransfersListPage, ListCodes$2>>;
1006
+ readonly retrieve: (input: TokenTransfersRetrieveInput) => Promise<CapxulResult<TokenTransfer, RetrieveCodes$2>>;
1007
+ };
1008
+
889
1009
  /**
890
1010
  * Virtual accounts domain — International Bank Account Number (IBAN)-
891
1011
  * bearing receive rails per sdk-surface.md §1a + §4.51.
@@ -1093,6 +1213,13 @@ type CapxulClient = {
1093
1213
  readonly organizations: OrganizationsClient;
1094
1214
  readonly payments: PaymentsClient;
1095
1215
  readonly transfers: TransfersClient;
1216
+ /**
1217
+ * **NON-CANONICAL.** On-chain ERC-20 transfer feed (raw indexer
1218
+ * rows). NOT part of `packages/api-contract`. Slated for
1219
+ * deprecation when canonical `transfers.*` shape alignment lands.
1220
+ * See `core/token-transfers.ts` for the doc-comment contract.
1221
+ */
1222
+ readonly tokenTransfers: TokenTransfersClient;
1096
1223
  readonly withdrawals: WithdrawalsClient;
1097
1224
  readonly documents: DocumentsClient;
1098
1225
  readonly subAccounts: SubAccountsClient;
@@ -1122,4 +1249,4 @@ type CapxulClient = {
1122
1249
  */
1123
1250
  declare function createCapxulClient(config?: CapxulConfig): CapxulClient;
1124
1251
 
1125
- export { type AccountProvisionPersonalInput as A, type BrowserCapxulConfig as B, type CapxulClient as C, type DocumentsClient as D, type ExternalAccountsClient as E, type HttpTransport as H, type LocalPrivateKeySignerProvider as L, type MeClient as M, type OperationsClient as O, type PaymentsClient as P, type Session as S, type TransfersClient as T, type VirtualAccountsClient as V, type WebhookEndpointCreateResult as W, type AccountsClient as a, type ApiKeyCreateResult as b, type ApiKeysClient as c, type AuthClient as d, type AuthSessionStore as e, type CapxulAuthConfig as f, type CapxulConfig as g, type CapxulDataClient as h, type CapxulFlowFactories as i, type CapxulSigningConfig as j, type OrgDocumentsClient as k, type OrgPaymentsClient as l, type OrgSafesClient as m, type OrgTransfersClient as n, type OrgTreasuryClient as o, type OrgWithdrawalsClient as p, type OrganizationsClient as q, type SubAccountsClient as r, type TransportRuntime as s, type TransportState as t, type VirtualCardsClient as u, type WebhookEndpointsClient as v, type WebhookEventsClient as w, type WithdrawalsClient as x, createCapxulClient as y, makeHttpTransport as z };
1252
+ export { type AccountProvisionPersonalInput as A, type BrowserCapxulConfig as B, type CapxulClient as C, type DocumentsClient as D, type ExternalAccountsClient as E, type VirtualCardsClient as F, type WebhookEndpointsClient as G, type HttpTransport as H, type WebhookEventsClient as I, type WithdrawalsClient as J, createCapxulClient as K, type LocalPrivateKeySignerProvider as L, type MeClient as M, makeHttpTransport as N, type OperationsClient as O, type PaymentsClient as P, toTokenTransferId as Q, type Session as S, type TokenTransfer as T, type VirtualAccountsClient as V, type WebhookEndpointCreateResult as W, type AccountsClient as a, type ApiKeyCreateResult as b, type ApiKeysClient as c, type AuthClient as d, type AuthSessionStore as e, type CapxulAuthConfig as f, type CapxulConfig as g, type CapxulDataClient as h, type CapxulFlowFactories as i, type CapxulSigningConfig as j, type OrgDocumentsClient as k, type OrgPaymentsClient as l, type OrgSafesClient as m, type OrgTransfersClient as n, type OrgTreasuryClient as o, type OrgWithdrawalsClient as p, type OrganizationsClient as q, type SubAccountsClient as r, type TokenTransferId as s, type TokenTransfersClient as t, type TokenTransfersListInput as u, type TokenTransfersListPage as v, type TokenTransfersRetrieveInput as w, type TransfersClient as x, type TransportRuntime as y, type TransportState as z };