@dakota-xyz/ts-sdk 2.0.0 → 2.1.1

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/README.md CHANGED
@@ -376,7 +376,9 @@ const client = new DakotaClient({
376
376
  // Auth mode (default: Auto)
377
377
  authMode: AuthMode.Auto, // Auto, APIKey, or ApplicationToken
378
378
 
379
- // Custom timeout (default: 15000ms)
379
+ // Custom timeout (default: 15000ms).
380
+ // Setting this applies it to EVERY request, including the model-backed
381
+ // agentic endpoints that otherwise get 180000ms — see "Timeouts" below.
380
382
  timeout: 30000,
381
383
 
382
384
  // Custom retry policy
@@ -397,6 +399,54 @@ const client = new DakotaClient({
397
399
  });
398
400
  ```
399
401
 
402
+ ## Timeouts
403
+
404
+ Requests default to **15s**, which suits ordinary reads and writes. The
405
+ agentic endpoints that call a model default to **180s** instead:
406
+
407
+ | Endpoint | Default |
408
+ |---|---|
409
+ | Everything else | 15s |
410
+ | `paymentAgents.createProposals` / `AgentConversation.send` | 180s |
411
+ | `insights.chat` | 180s |
412
+
413
+ A drafting turn is a sequence of model calls — read the payees, check
414
+ balances, draft, revise — so "pay these nine vendors every Friday"
415
+ legitimately runs minutes while "what can you do?" returns at once. Under a
416
+ 15s deadline the simple turns pass and the complex ones abort client-side,
417
+ which looks like flakiness rather than a deadline.
418
+
419
+ Override it at whichever level fits, most specific first:
420
+
421
+ ```typescript
422
+ // Per request — one slow call, everything else untouched. Available on
423
+ // every method that takes request options (the mutating ones).
424
+ await client.paymentAgents.createProposals(agentId, { prompt }, { timeout: 240_000 });
425
+
426
+ // Per conversation — every turn of this chat
427
+ const conv = client.newAgentConversation(agentId, { timeout: 240_000 });
428
+
429
+ // Client-wide — applies to EVERYTHING, agentic endpoints included
430
+ const client = new DakotaClient({ apiKey, timeout: 30_000 });
431
+ ```
432
+
433
+ Precedence is: per-request `timeout` → explicit client `timeout` → endpoint
434
+ default → 15s. Note the third row: **an explicit client-wide `timeout` wins
435
+ over the long agentic default**, because a deadline you configured is a
436
+ choice the SDK should not overrule. If you set a short global timeout and
437
+ also use agent conversations, raise it per conversation.
438
+
439
+ Two more things worth knowing:
440
+
441
+ - The deadline is **per attempt**, not per call. A timing-out request is
442
+ retried per `retryPolicy`, so budget roughly `timeout × maxAttempts`.
443
+ - A timeout raises `TransportError` naming the elapsed deadline and how to
444
+ change it. It is a client-side abort, not a server error — the server may
445
+ well still be completing the work.
446
+ - Per-request `timeout` rides on `RequestOptions`, so it is available on the
447
+ methods that accept them. Plain `get` / `list` reads do not take options
448
+ yet; use the client-wide setting for those.
449
+
400
450
  ## Idempotency Keys
401
451
 
402
452
  Dakota requires idempotency keys (**must be valid UUIDs**) for all `POST`, `PUT`, and `PATCH` requests to ensure safe retries. By default, the SDK auto-generates UUID keys for you, but you can provide your own for deterministic API calls:
@@ -482,6 +532,13 @@ Manage customer entities representing businesses and organizations.
482
532
  | `customers.create(data)` | Create a customer (triggers KYB) |
483
533
  | `customers.list(params?)` | List all customers (paginated) |
484
534
  | `customers.get(id)` | Get customer by ID |
535
+ | `customers.delete(id)` | Soft-delete a customer (blocked if it has accounts) |
536
+ | `customers.getCapabilities(id)` | Capabilities + outstanding requirements to unlock each |
537
+ | `customers.reEngage(id)` | Mint a fresh application link for an approved customer |
538
+ | `customers.bulkImportFromSumsubTokens(data)` | Import from Sumsub share tokens (synchronous) |
539
+ | `customers.importPersonaTokens(data)` | Import from Persona Connect share tokens (async job) |
540
+ | `customers.listPersonaImportJobs(params?)` | List Persona import jobs, newest first |
541
+ | `customers.getPersonaImportJob(jobId, params?)` | Job status + per-token results |
485
542
 
486
543
  ### Recipients
487
544
 
@@ -594,9 +651,9 @@ Manage multi-party authorization.
594
651
  |--------|-------------|
595
652
  | `signerGroups.create(data)` | Create signer group |
596
653
  | `signerGroups.list(params?)` | List signer groups |
597
- | `signerGroups.get(id)` | Get signer group by ID |
654
+ | `signerGroups.get(id, params?)` | Get signer group by ID (`{ include_removed: true }` adds `removed_members`) |
598
655
  | `signerGroups.addSigner(groupId, data)` | Add signer to group |
599
- | `signerGroups.removeSigner(groupId, signerId)` | Remove signer |
656
+ | `signerGroups.removeSigner(groupId, signerId)` | Remove signer (by KSUID `signer_id`, not public key) |
600
657
  | `signerGroups.attachToWallet(walletId, groupId)` | Attach to wallet |
601
658
  | `signerGroups.detachFromWallet(walletId, groupId)` | Detach from wallet |
602
659
 
@@ -668,6 +725,26 @@ Test simulations (sandbox environment only).
668
725
  | `sandbox.advanceSimulation(id)` | Advance simulation state |
669
726
  | `sandbox.listScenarios(params?)` | List available scenarios |
670
727
 
728
+ ### Fee Payout Destination
729
+
730
+ Where Dakota pays your accrued developer fees. Exactly one per organization,
731
+ and crypto-only — a USDC wallet on any supported chain.
732
+
733
+ | Method | Description |
734
+ |--------|-------------|
735
+ | `feePayoutDestination.get()` | Get the registered destination |
736
+ | `feePayoutDestination.set(data)` | Register or replace it (emits `fee_payout_destination.updated`) |
737
+ | `feePayoutDestination.delete()` | Remove it (emits `fee_payout_destination.deleted`) |
738
+
739
+ ```typescript
740
+ await client.feePayoutDestination.set({
741
+ usdc_wallet: {
742
+ chain: 'eip155:8453', // CAIP-2 chain id — see client.info.getNetworks()
743
+ address: '0x1234567890123456789012345678901234567890',
744
+ },
745
+ });
746
+ ```
747
+
671
748
  ### Payment Agents (Alpha)
672
749
 
673
750
  Hosted signing agents that draft payments (`x-alpha`, flag-gated).
@@ -678,6 +755,7 @@ Hosted signing agents that draft payments (`x-alpha`, flag-gated).
678
755
  | `paymentAgents.get(id)` | Get payment agent by ID |
679
756
  | `paymentAgents.revoke(id)` | Revoke the agent's key (kill switch) |
680
757
  | `paymentAgents.createProposals(id, data)` | One-shot proposals turn (see `newAgentConversation`) |
758
+ | `paymentAgents.getProposalsProgress(id)` | Live progress of an in-flight drafting turn (advisory) |
681
759
 
682
760
  ### Mandates (Alpha)
683
761
 
@@ -690,6 +768,9 @@ The §8 authorizations that arm scheduled payments.
690
768
  | `mandates.get(id)` | Get mandate by ID (full wire shape for signing) |
691
769
  | `mandates.approve(id, data)` | Activate with a customer signature |
692
770
  | `mandates.cancel(id, data)` | Cancel a mandate |
771
+ | `mandates.amend(id, data)` | Append a signed NEW version of the rule (keeps window spend) |
772
+ | `mandates.listVersions(id)` | Append-only version history, oldest first |
773
+ | `mandates.getBudget(id)` | Remaining budget: spent, earmarked, left (advisory) |
693
774
 
694
775
  ### Instructions (Alpha)
695
776