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

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,56 @@
1
1
  # @capxul/sdk
2
2
 
3
+ ## 0.1.0-alpha.6
4
+
5
+ ### Minor Changes
6
+
7
+ - 57203a4: Withdrawals v1 W2 (#465) — public surface tightening + org-scope create
8
+ - `WithdrawalsCreateInput.destination` no longer accepts `kind`. The
9
+ backend now resolves the `external_account` row by FK and infers
10
+ the kind + rail server-side. Anything that doesn't route to
11
+ `chain_wallet` (or is chain_wallet but non-EVM in slice 1) returns
12
+ `VERIFICATION_REQUIRED` with `details.rail` + `details.currentKind`.
13
+ - `organizations.withdrawals.create` is now a real mutation (no
14
+ longer a `NOT_IMPLEMENTED` stub). Returns the `processing` row
15
+ only — Safe + Zodiac submission orchestration ships in W3+.
16
+ - `Errors.verificationRequired({ rail, currentKind })` factory
17
+ added; the `VERIFICATION_REQUIRED` code now broadens to cover
18
+ both KYC tier gates and unsupported withdrawal rails.
19
+
20
+ **Migration:** Remove `destination.kind` from any
21
+ `capxul.withdrawals.create({ destination: { kind, externalAccountId } })`
22
+ call sites. Pass only `externalAccountId`.
23
+
24
+ ## 0.1.0-alpha.5
25
+
26
+ ### Patch Changes
27
+
28
+ - Version sync with `@capxul/sdk-react@0.1.0-alpha.5`; no headless SDK runtime
29
+ changes.
30
+
31
+ ## 0.1.0-alpha.4
32
+
33
+ ### Minor Changes
34
+
35
+ - Post-alpha hardening — WAVE 1 + WAVE 2 cumulative
36
+
37
+ **WAVE 1 (merged 2026-05-03 12:44Z):**
38
+ - S2 story 1: wire onboarding readback hooks (#469) — `me.update`, `accounts.retrieve`, `accounts.update`, `useAccount`, `useSafe`
39
+ - S3 phase 1: Ink reference CLI scaffold + `auth+me` end-to-end against live alpha-3 Convex (#470). Stickiness gate (D3) fired.
40
+ - 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.
41
+
42
+ **WAVE 2 (merged 2026-05-03 12:54-13:16Z):**
43
+ - 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.
44
+ - 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).
45
+
46
+ **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.
47
+
48
+ **Friction issues filed for alpha.4+ polish:**
49
+ - #474 — `me.get` returns `NOT_IMPLEMENTED` when `config.data` is undefined; should be `NOT_AUTHENTICATED`.
50
+ - #475 — `@capxul/sdk/headless` slim entry point excludes xstate flow machines + brand constructors (1.6 MB → much smaller).
51
+ - #477 / #478 — `transfers.*` / `balanceLedger.*` / `treasury` canon-shape alignment with indexer feed.
52
+ - #471 — Vercel-capxul-web preview-deploy systemic failure on api-first base (separate from epic).
53
+
3
54
  ## 0.1.0-alpha.3
4
55
 
5
56
  ### Patch Changes
package/README.md CHANGED
@@ -90,7 +90,7 @@ capxul.accounts // create, retrieve, list
90
90
  capxul.organizations // CRUD + members + payments + treasury
91
91
  capxul.payments // create, retrieve, list
92
92
  capxul.invoices // create, retrieve, list
93
- capxul.withdrawals // request, retrieve, list
93
+ capxul.withdrawals // create, retrieve, list
94
94
  capxul.documents // KYC uploads, invoices, receipts, tax forms
95
95
  capxul.flows.{auth, onboarding, provisioning} // XState v5 flows
96
96
  ```
@@ -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.js';
4
4
  import { d as CapxulResult, C as CapxulError } from './errors-QHD5Tlok.js';
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-BE3tVIOI.js';
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-CYvLP5pP.js';
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
 
@@ -282,14 +282,26 @@ type OrgDocumentsClient = {
282
282
  * Per sdk-surface.md §1a, `external_account` is a reusable withdrawal
283
283
  * destination. `create` + `list` live under the owner's nested
284
284
  * namespace (Pattern A — `accounts.externalAccounts.*` or
285
- * `organizations.externalAccounts.*`). `retrieve` and `remove` work by
286
- * ID without scoping.
285
+ * `organizations.externalAccounts.*`). The top-level `retrieve` and
286
+ * `remove` keep PERSONAL-scope semantics — for org rows route via
287
+ * the `organizations.externalAccounts.*` namespace which carries
288
+ * `organizationId` end-to-end and pins the row's owner pair to
289
+ * prevent cross-org IDOR (revision 1, #464).
290
+ *
291
+ * Withdrawals v1 W1 (#464) wires these stubs through the
292
+ * `externalAccounts/{queries,mutations}` Convex domain. The wire shape
293
+ * matches OpenAPI: `{ object: "external_account", id, kind, status,
294
+ * ..., operation: { id, status, correlationId } }` — the trust-chain
295
+ * ids live under the canonical nested `operation: OperationSummary`
296
+ * envelope (revision 3, #464), matching Withdrawal / Payment /
297
+ * Transfer / Organization. The SDK rebrands `id` + the nested
298
+ * `operation` sub-ids at the read edge.
287
299
  */
288
300
 
289
- type RetrieveCodes$a = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
290
- type RemoveCodes$4 = RetrieveCodes$a;
301
+ type RetrieveCodes$b = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
302
+ type RemoveCodes$4 = RetrieveCodes$b;
291
303
  type ExternalAccountsClient = {
292
- readonly retrieve: (externalAccountId: ExternalAccountId) => Promise<CapxulResult<ExternalAccount, RetrieveCodes$a>>;
304
+ readonly retrieve: (externalAccountId: ExternalAccountId) => Promise<CapxulResult<ExternalAccount, RetrieveCodes$b>>;
293
305
  readonly remove: (externalAccountId: ExternalAccountId) => Promise<CapxulResult<void, RemoveCodes$4>>;
294
306
  };
295
307
 
@@ -329,10 +341,10 @@ type OperationsWaitInput = {
329
341
  readonly timeoutSeconds?: number;
330
342
  readonly pollIntervalMs?: number;
331
343
  };
332
- type RetrieveCodes$9 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
333
- type WaitCodes = RetrieveCodes$9 | "OPERATION_TIMEOUT";
344
+ type RetrieveCodes$a = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
345
+ type WaitCodes = RetrieveCodes$a | "OPERATION_TIMEOUT";
334
346
  type OperationsClient = {
335
- readonly retrieve: (operationId: OperationId) => Promise<CapxulResult<Operation, RetrieveCodes$9>>;
347
+ readonly retrieve: (operationId: OperationId) => Promise<CapxulResult<Operation, RetrieveCodes$a>>;
336
348
  readonly wait: (operationId: OperationId, input?: OperationsWaitInput) => Promise<CapxulResult<Operation, WaitCodes>>;
337
349
  };
338
350
 
@@ -393,17 +405,17 @@ type OrgPaymentsListInput = {
393
405
  };
394
406
  type CreateCodes$6 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT" | "INVALID_RECIPIENT" | "INSUFFICIENT_BALANCE" | "IDEMPOTENCY_CONFLICT" | "RATE_LIMITED" | "NETWORK_ERROR";
395
407
  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";
408
+ type RetrieveCodes$9 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
409
+ type ListCodes$8 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
398
410
  type PaymentsClient = {
399
411
  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>>;
412
+ readonly retrieve: (paymentId: PaymentId) => Promise<CapxulResult<Payment, RetrieveCodes$9>>;
413
+ readonly list: (input?: PaymentsListInput) => Promise<CapxulResult<List<Payment>, ListCodes$8>>;
402
414
  };
403
415
  type OrgPaymentsClient = {
404
416
  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>>;
417
+ readonly retrieve: (input: OrgPaymentsRetrieveInput) => Promise<CapxulResult<Payment, RetrieveCodes$9>>;
418
+ readonly list: (input: OrgPaymentsListInput) => Promise<CapxulResult<List<Payment>, ListCodes$8>>;
407
419
  };
408
420
 
409
421
  /**
@@ -452,28 +464,40 @@ type OrgTransfersCancelInput = {
452
464
  readonly transferId: TransferId;
453
465
  };
454
466
  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";
467
+ type RetrieveCodes$8 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
468
+ type ListCodes$7 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
457
469
  type ConfirmCodes = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND" | "QUOTE_EXPIRED" | "QUOTE_NOT_FOUND";
458
470
  type CancelCodes = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND" | "OPERATION_CANCELED";
459
471
  type TransfersClient = {
460
472
  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>>;
473
+ readonly retrieve: (transferId: TransferId) => Promise<CapxulResult<Transfer, RetrieveCodes$8>>;
474
+ readonly list: (input?: TransfersListInput) => Promise<CapxulResult<List<Transfer>, ListCodes$7>>;
463
475
  readonly confirm: (input: TransfersConfirmInput) => Promise<CapxulResult<Transfer, ConfirmCodes>>;
464
476
  readonly cancel: (transferId: TransferId) => Promise<CapxulResult<Transfer, CancelCodes>>;
465
477
  };
466
478
  type OrgTransfersClient = {
467
479
  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>>;
480
+ readonly retrieve: (input: OrgTransfersRetrieveInput) => Promise<CapxulResult<Transfer, RetrieveCodes$8>>;
481
+ readonly list: (input: OrgTransfersListInput) => Promise<CapxulResult<List<Transfer>, ListCodes$7>>;
470
482
  readonly confirm: (input: OrgTransfersConfirmInput) => Promise<CapxulResult<Transfer, ConfirmCodes>>;
471
483
  readonly cancel: (input: OrgTransfersCancelInput) => Promise<CapxulResult<Transfer, CancelCodes>>;
472
484
  };
473
485
 
474
486
  /**
475
487
  * Withdrawals domain — funds exit Capxul via an `external_account` per
476
- * sdk-surface.md §1a + §4.52.
488
+ * sdk-surface.md §1a + §4.52 + withdrawal-orchestration.mdx.
489
+ *
490
+ * Withdrawals v1 W2 (#465) refactor:
491
+ * - The `kind` shim on `destination` is GONE. The backend now resolves
492
+ * the destination row by FK and infers kind + rail. Anything that
493
+ * doesn't route to `chain_wallet` returns `VERIFICATION_REQUIRED`.
494
+ * - Org-scope `create` is now a real mutation (no longer a stub).
495
+ * Personal-scope keeps the on-chain submission tail; org-scope
496
+ * returns the `processing` row only — Safe + Zodiac orchestration
497
+ * ships in W3+ (D6).
498
+ * - All raw `try/catch` blocks have been replaced with `tryCatch` from
499
+ * `@repo/observability`, mirroring `core/external-accounts.ts`
500
+ * (precedent D2).
477
501
  */
478
502
 
479
503
  type WithdrawalsCreateInput = {
@@ -492,6 +516,22 @@ type WithdrawalsListInput = {
492
516
  readonly limit?: number;
493
517
  readonly cursor?: string;
494
518
  };
519
+ /**
520
+ * Withdrawals v1 W4 (#467) — input for the reconciliation pipe.
521
+ * Caller passes the same `txHash` that `recordSubmitted` wrote; the
522
+ * backend cross-checks the value against the persisted operation row.
523
+ *
524
+ * `withdrawalId` accepts either the branded `WithdrawalId` or a raw
525
+ * string. `txHash` is a raw string at the SDK boundary — the backend
526
+ * re-validates the shape via `toTxHash` at the mutation handler (the
527
+ * SDK package is no longer coupled to `@repo/types`'s brand surface
528
+ * post the alpha-epic decoupling; see
529
+ * `packages/sdk/docs/internal/decoupling-prep.md`).
530
+ */
531
+ type WithdrawalsRecordCompletedInput = {
532
+ readonly withdrawalId: WithdrawalId | string;
533
+ readonly txHash: string;
534
+ };
495
535
  type OrgWithdrawalsCreateInput = WithdrawalsCreateInput & {
496
536
  readonly organizationId: OrganizationId;
497
537
  };
@@ -504,18 +544,40 @@ type OrgWithdrawalsListInput = {
504
544
  readonly limit?: number;
505
545
  readonly cursor?: string;
506
546
  };
507
- 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";
547
+ type CreateCodes$4 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT" | "INSUFFICIENT_BALANCE" | "IDEMPOTENCY_CONFLICT" | "KYC_REQUIRED" | "POLICY_DENIED" | "RATE_LIMITED" | "NETWORK_ERROR" | "NOT_FOUND" | "VERIFICATION_REQUIRED";
548
+ type RetrieveCodes$7 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
549
+ type ListCodes$6 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
550
+ /**
551
+ * Narrow code set for `recordCompleted`. Mirror of `recordSubmitted`'s
552
+ * code surface — the SDK does NOT export `recordSubmitted` publicly
553
+ * (the create signing tail invokes it), but the call shape is the
554
+ * reference. Per ADR 9, `recordCompleted` is exposed on personal-scope
555
+ * `WithdrawalsClient` ONLY.
556
+ */
557
+ type RecordCompletedCodes = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT" | "NOT_FOUND" | "NETWORK_ERROR" | "INTERNAL_ERROR";
510
558
  type WithdrawalsClient = {
511
559
  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>>;
560
+ readonly retrieve: (withdrawalId: WithdrawalId) => Promise<CapxulResult<Withdrawal, RetrieveCodes$7>>;
561
+ readonly list: (input?: WithdrawalsListInput) => Promise<CapxulResult<List<Withdrawal>, ListCodes$6>>;
562
+ /**
563
+ * Withdrawals v1 W4 (#467) — reconciliation pipe.
564
+ *
565
+ * Caller invokes this AFTER `withdrawals.create` resolves AND after
566
+ * the on-chain receipt confirms (e.g., via the harness's
567
+ * `chain.waitReceipt`). The mutation patches the withdrawal +
568
+ * execution + attempt + operation rows to terminal happy state and
569
+ * emits a single `operation.succeeded` outbox event joined to the
570
+ * original correlationId. Idempotent on already-`completed` rows.
571
+ *
572
+ * Personal-scope only — the org-scope client does NOT expose this
573
+ * method (mirror of `recordSubmitted`; see ADR 9 in #467).
574
+ */
575
+ readonly recordCompleted: (input: WithdrawalsRecordCompletedInput) => Promise<CapxulResult<null, RecordCompletedCodes>>;
514
576
  };
515
577
  type OrgWithdrawalsClient = {
516
578
  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>>;
579
+ readonly retrieve: (input: OrgWithdrawalsRetrieveInput) => Promise<CapxulResult<Withdrawal, RetrieveCodes$7>>;
580
+ readonly list: (input: OrgWithdrawalsListInput) => Promise<CapxulResult<List<Withdrawal>, ListCodes$6>>;
519
581
  };
520
582
 
521
583
  /**
@@ -541,9 +603,9 @@ type WebhookEndpointsListInput = {
541
603
  };
542
604
  type WebhookEndpointsRemoveInput = WebhookEndpointsRetrieveInput;
543
605
  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;
606
+ type RetrieveCodes$6 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
607
+ type ListCodes$5 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
608
+ type RemoveCodes$3 = RetrieveCodes$6;
547
609
  /**
548
610
  * Shape returned by `organizations.webhookEndpoints.create` — the
549
611
  * one-time `signingSecret` is included here and omitted from every
@@ -554,8 +616,8 @@ type WebhookEndpointCreateResult = WebhookEndpoint & {
554
616
  };
555
617
  type WebhookEndpointsClient = {
556
618
  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>>;
619
+ readonly retrieve: (input: WebhookEndpointsRetrieveInput) => Promise<CapxulResult<WebhookEndpoint, RetrieveCodes$6>>;
620
+ readonly list: (input: WebhookEndpointsListInput) => Promise<CapxulResult<List<WebhookEndpoint>, ListCodes$5>>;
559
621
  readonly remove: (input: WebhookEndpointsRemoveInput) => Promise<CapxulResult<void, RemoveCodes$3>>;
560
622
  };
561
623
 
@@ -576,11 +638,11 @@ type WebhookEventsListInput = {
576
638
  readonly endpointId?: string;
577
639
  readonly type?: string;
578
640
  };
579
- type RetrieveCodes$4 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
580
- type ListCodes$3 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
641
+ type RetrieveCodes$5 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
642
+ type ListCodes$4 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
581
643
  type WebhookEventsClient = {
582
- readonly retrieve: (input: WebhookEventsRetrieveInput) => Promise<CapxulResult<WebhookEvent, RetrieveCodes$4>>;
583
- readonly list: (input: WebhookEventsListInput) => Promise<CapxulResult<List<WebhookEvent>, ListCodes$3>>;
644
+ readonly retrieve: (input: WebhookEventsRetrieveInput) => Promise<CapxulResult<WebhookEvent, RetrieveCodes$5>>;
645
+ readonly list: (input: WebhookEventsListInput) => Promise<CapxulResult<List<WebhookEvent>, ListCodes$4>>;
584
646
  };
585
647
 
586
648
  /**
@@ -653,8 +715,8 @@ type OrgCreateExternalAccountInput = {
653
715
  readonly last4?: string;
654
716
  };
655
717
  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";
718
+ type RetrieveCodes$4 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
719
+ type ListCodes$3 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
658
720
  type UpdateCodes = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND" | "INVALID_INPUT";
659
721
  /**
660
722
  * Org safe retrieve does NOT surface `SAFE_NOT_READY` — a co-member
@@ -669,7 +731,7 @@ type UpdateCodes = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND" | "IN
669
731
  */
670
732
  type SafeRetrieveCodes = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
671
733
  type TreasuryRetrieveCodes = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND" | "SAFE_NOT_READY";
672
- type RemoveCodes$2 = RetrieveCodes$3;
734
+ type RemoveCodes$2 = RetrieveCodes$4;
673
735
  type OrgSafesClient = {
674
736
  readonly retrieve: (input: OrgSafeRetrieveInput) => Promise<CapxulResult<Safe, SafeRetrieveCodes>>;
675
737
  };
@@ -677,23 +739,23 @@ type OrgTreasuryClient = {
677
739
  readonly retrieve: (organizationId: OrganizationId) => Promise<CapxulResult<Treasury, TreasuryRetrieveCodes>>;
678
740
  };
679
741
  type OrgMembersClient = {
680
- readonly list: (input: OrgListInput) => Promise<CapxulResult<List<Member>, ListCodes$2>>;
681
- readonly retrieve: (input: OrgMemberRetrieveInput) => Promise<CapxulResult<Member, RetrieveCodes$3>>;
742
+ readonly list: (input: OrgListInput) => Promise<CapxulResult<List<Member>, ListCodes$3>>;
743
+ readonly retrieve: (input: OrgMemberRetrieveInput) => Promise<CapxulResult<Member, RetrieveCodes$4>>;
682
744
  readonly invite: (input: OrgMemberInviteInput) => Promise<CapxulResult<Member, UpdateCodes>>;
683
745
  readonly updateRole: (input: OrgMemberUpdateRoleInput) => Promise<CapxulResult<Member, UpdateCodes>>;
684
746
  readonly remove: (input: OrgMemberRemoveInput) => Promise<CapxulResult<void, RemoveCodes$2>>;
685
747
  };
686
748
  type OrgKybProfileClient = {
687
749
  readonly start: (input: OrgKybProfileStartInput) => Promise<CapxulResult<KybProfile, CreateCodes$2>>;
688
- readonly retrieve: (input: OrgKybProfileRetrieveInput) => Promise<CapxulResult<KybProfile, RetrieveCodes$3>>;
750
+ readonly retrieve: (input: OrgKybProfileRetrieveInput) => Promise<CapxulResult<KybProfile, RetrieveCodes$4>>;
689
751
  };
690
752
  type OrgSubAccountsClient = {
691
753
  readonly create: (input: OrgCreateSubAccountInput) => Promise<CapxulResult<SubAccount, UpdateCodes>>;
692
- readonly list: (input: OrgListInput) => Promise<CapxulResult<List<SubAccount>, ListCodes$2>>;
754
+ readonly list: (input: OrgListInput) => Promise<CapxulResult<List<SubAccount>, ListCodes$3>>;
693
755
  readonly retrieve: (input: {
694
756
  readonly organizationId: OrganizationId;
695
757
  readonly subAccountId: SubAccountId;
696
- }) => Promise<CapxulResult<SubAccount, RetrieveCodes$3>>;
758
+ }) => Promise<CapxulResult<SubAccount, RetrieveCodes$4>>;
697
759
  readonly remove: (input: {
698
760
  readonly organizationId: OrganizationId;
699
761
  readonly subAccountId: SubAccountId;
@@ -701,28 +763,28 @@ type OrgSubAccountsClient = {
701
763
  };
702
764
  type OrgExternalAccountsClient = {
703
765
  readonly create: (input: OrgCreateExternalAccountInput) => Promise<CapxulResult<ExternalAccount, UpdateCodes>>;
704
- readonly list: (input: OrgListInput) => Promise<CapxulResult<List<ExternalAccount>, ListCodes$2>>;
766
+ readonly list: (input: OrgListInput) => Promise<CapxulResult<List<ExternalAccount>, ListCodes$3>>;
705
767
  readonly retrieve: (input: {
706
768
  readonly organizationId: OrganizationId;
707
769
  readonly externalAccountId: ExternalAccountId;
708
- }) => Promise<CapxulResult<ExternalAccount, RetrieveCodes$3>>;
770
+ }) => Promise<CapxulResult<ExternalAccount, RetrieveCodes$4>>;
709
771
  readonly remove: (input: {
710
772
  readonly organizationId: OrganizationId;
711
773
  readonly externalAccountId: ExternalAccountId;
712
774
  }) => Promise<CapxulResult<void, RemoveCodes$2>>;
713
775
  };
714
776
  type OrgBalanceLedgerClient = {
715
- readonly list: (input: OrgListInput) => Promise<CapxulResult<List<BalanceLedgerEntry>, ListCodes$2>>;
777
+ readonly list: (input: OrgListInput) => Promise<CapxulResult<List<BalanceLedgerEntry>, ListCodes$3>>;
716
778
  readonly retrieve: (input: {
717
779
  readonly organizationId: OrganizationId;
718
780
  readonly entryId: string;
719
- }) => Promise<CapxulResult<BalanceLedgerEntry, RetrieveCodes$3>>;
781
+ }) => Promise<CapxulResult<BalanceLedgerEntry, RetrieveCodes$4>>;
720
782
  };
721
783
  type OrgApiKeysClient = ApiKeysClient;
722
784
  type OrganizationsClient = {
723
785
  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>>;
786
+ readonly retrieve: (organizationId: OrganizationId) => Promise<CapxulResult<Organization, RetrieveCodes$4>>;
787
+ readonly list: (input?: OrganizationsListInput) => Promise<CapxulResult<List<Organization>, ListCodes$3>>;
726
788
  readonly update: (input: OrganizationsUpdateInput) => Promise<CapxulResult<Organization, UpdateCodes>>;
727
789
  readonly safes: OrgSafesClient;
728
790
  readonly treasury: OrgTreasuryClient;
@@ -879,13 +941,111 @@ declare function makeHttpTransport(config: BrowserCapxulConfig): HttpTransport;
879
941
  * `remove` live at the top level.
880
942
  */
881
943
 
882
- type RetrieveCodes$2 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
883
- type RemoveCodes$1 = RetrieveCodes$2;
944
+ type RetrieveCodes$3 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
945
+ type RemoveCodes$1 = RetrieveCodes$3;
884
946
  type SubAccountsClient = {
885
- readonly retrieve: (subAccountId: SubAccountId) => Promise<CapxulResult<SubAccount, RetrieveCodes$2>>;
947
+ readonly retrieve: (subAccountId: SubAccountId) => Promise<CapxulResult<SubAccount, RetrieveCodes$3>>;
886
948
  readonly remove: (subAccountId: SubAccountId) => Promise<CapxulResult<void, RemoveCodes$1>>;
887
949
  };
888
950
 
951
+ /**
952
+ * **NON-CANONICAL surface.**
953
+ *
954
+ * `capxul.tokenTransfers.*` exposes the indexer's raw on-chain ERC-20
955
+ * transfer rows directly to consumers, backed by
956
+ * `packages/backend/convex/tokenTransfers/queries.ts`. Authorized at
957
+ * `slice/02-story2-balance` per the conductor's Option-A verdict —
958
+ * the canonical SDK `transfers.*` namespace assumes a cross-custody
959
+ * internal-move shape (`Transfer = { source, destination, fx,
960
+ * operation, ... }`) that has no canon-aligned backing query yet.
961
+ * Surfacing the on-chain feed under a separate, clearly-marked
962
+ * non-canonical namespace lets the Ink CLI's activity dashboard
963
+ * progress without forcing canon synthesis.
964
+ *
965
+ * **NOT in `packages/api-contract`.** Do NOT use this surface as the
966
+ * basis for new canon. When `transfers.*` shape alignment lands
967
+ * (post-alpha.4 follow-up issue), the canonical `transfers.*` will
968
+ * subsume this and `tokenTransfers.*` becomes a deprecation alias.
969
+ *
970
+ * Stub families that REMAIN deferred at this slice
971
+ * (per `[DEFERRED-CANON]` markers in
972
+ * `.claude/worktrees/post-alpha-wire2/.progress.txt`):
973
+ * - `transfers.{create,retrieve,list,confirm,cancel}` — canon shape mismatch
974
+ * - `accounts.balanceLedger.{list,retrieve}` — no canon backing query
975
+ * - `organizations.balanceLedger.*` — no canon backing query
976
+ * - `organizations.transfers.*` — canon shape mismatch
977
+ * - `organizations.treasury.retrieve` — backing query has different shape
978
+ */
979
+
980
+ /**
981
+ * Branded id for an on-chain `tokenTransfer` row. Backed by the
982
+ * Convex document id; the brand prevents accidental swaps with other
983
+ * SDK ids without leaking the document-id constraint into call sites.
984
+ *
985
+ * Returned in `TokenTransfer.id` for clients that want a stable
986
+ * back-reference; the canonical lookup key is the
987
+ * `(txHash, logIndex)` composite used by `retrieve`.
988
+ */
989
+ type TokenTransferId = string & {
990
+ readonly __capxulTokenTransferIdBrand: "TokenTransferId";
991
+ };
992
+ declare const toTokenTransferId: (raw: string) => TokenTransferId;
993
+ /**
994
+ * Raw on-chain ERC-20 transfer row. Shape mirrors
995
+ * `tokenTransfers/queries.ts` `list` / `getByTxLogIndex` output. The
996
+ * primitive fields (`txHash`, `tokenAddress`, etc.) match
997
+ * `@repo/api-contract` conventions — `string` for hashes/addresses,
998
+ * `number` for block + chain ids — so consumers don't need to import
999
+ * a brand surface that isn't in the SDK's published deps.
1000
+ */
1001
+ type TokenTransfer = {
1002
+ readonly id: TokenTransferId;
1003
+ readonly object: "token_transfer";
1004
+ readonly direction: "in" | "out";
1005
+ /** Token-units string ("123456" not "1.23456"). Decimals carried in `tokenDecimals`. */
1006
+ readonly amount: string;
1007
+ readonly tokenSymbol: string;
1008
+ readonly tokenDecimals: number;
1009
+ readonly tokenAddress: string;
1010
+ readonly counterpartyName: string | null;
1011
+ readonly counterpartyAddress: string;
1012
+ readonly description: string;
1013
+ /** Block timestamp in epoch milliseconds. */
1014
+ readonly createdAt: number;
1015
+ readonly txHash: string;
1016
+ readonly blockNumber: number;
1017
+ readonly chainId: number;
1018
+ };
1019
+ type TokenTransfersListPage = {
1020
+ readonly object: "list";
1021
+ readonly data: readonly TokenTransfer[];
1022
+ readonly page: {
1023
+ readonly hasMore: boolean;
1024
+ /** Block-timestamp cursor (epoch ms) for the next page; null when exhausted. */
1025
+ readonly nextCursor: number | null;
1026
+ };
1027
+ /** Caller's display currency. The backend echoes it so renderers don't need a second round-trip. */
1028
+ readonly displayCurrency: string;
1029
+ };
1030
+ type TokenTransfersListInput = {
1031
+ readonly limit?: number;
1032
+ /** Block-timestamp cursor (epoch ms) returned in the previous page's `page.nextCursor`. */
1033
+ readonly cursor?: number;
1034
+ readonly direction?: "in" | "out";
1035
+ };
1036
+ type TokenTransfersRetrieveInput = {
1037
+ readonly txHash: string;
1038
+ readonly logIndex: number;
1039
+ /** Optional chain filter. When omitted, the first index hit wins (single-chain default). */
1040
+ readonly chainId?: number;
1041
+ };
1042
+ type ListCodes$2 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "INVALID_INPUT";
1043
+ type RetrieveCodes$2 = "NOT_AUTHENTICATED" | "PERMISSION_DENIED" | "NOT_FOUND";
1044
+ type TokenTransfersClient = {
1045
+ readonly list: (input?: TokenTransfersListInput) => Promise<CapxulResult<TokenTransfersListPage, ListCodes$2>>;
1046
+ readonly retrieve: (input: TokenTransfersRetrieveInput) => Promise<CapxulResult<TokenTransfer, RetrieveCodes$2>>;
1047
+ };
1048
+
889
1049
  /**
890
1050
  * Virtual accounts domain — International Bank Account Number (IBAN)-
891
1051
  * bearing receive rails per sdk-surface.md §1a + §4.51.
@@ -1093,6 +1253,13 @@ type CapxulClient = {
1093
1253
  readonly organizations: OrganizationsClient;
1094
1254
  readonly payments: PaymentsClient;
1095
1255
  readonly transfers: TransfersClient;
1256
+ /**
1257
+ * **NON-CANONICAL.** On-chain ERC-20 transfer feed (raw indexer
1258
+ * rows). NOT part of `packages/api-contract`. Slated for
1259
+ * deprecation when canonical `transfers.*` shape alignment lands.
1260
+ * See `core/token-transfers.ts` for the doc-comment contract.
1261
+ */
1262
+ readonly tokenTransfers: TokenTransfersClient;
1096
1263
  readonly withdrawals: WithdrawalsClient;
1097
1264
  readonly documents: DocumentsClient;
1098
1265
  readonly subAccounts: SubAccountsClient;
@@ -1122,4 +1289,4 @@ type CapxulClient = {
1122
1289
  */
1123
1290
  declare function createCapxulClient(config?: CapxulConfig): CapxulClient;
1124
1291
 
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 };
1292
+ 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 };