@dakota-xyz/ts-sdk 1.4.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +122 -0
- package/dist/index.d.mts +1352 -46
- package/dist/index.d.ts +1352 -46
- package/dist/index.js +840 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +821 -32
- package/dist/index.mjs.map +1 -1
- package/dist/webhook/index.d.mts +141 -7
- package/dist/webhook/index.d.ts +141 -7
- package/dist/webhook/index.js +9 -2
- package/dist/webhook/index.js.map +1 -1
- package/dist/webhook/index.mjs +9 -2
- package/dist/webhook/index.mjs.map +1 -1
- package/package.json +5 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { KeyObject } from 'node:crypto';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Environment configuration for Dakota Platform API.
|
|
3
5
|
*/
|
|
@@ -728,7 +730,7 @@ type components = {
|
|
|
728
730
|
* @example transaction.auto.updated
|
|
729
731
|
* @enum {string}
|
|
730
732
|
*/
|
|
731
|
-
readonly EventType: "user.created" | "user.updated" | "user.deleted" | "api_key.created" | "api_key.deleted" | "customer.created" | "customer.updated" | "customer.kyb_link.created" | "customer.kyb_link.updated" | "customer.kyb_status.created" | "customer.kyb_status.updated" | "customer.kyb_application.submitted" | "auto_account.created" | "auto_account.updated" | "auto_account.deleted" | "transaction.auto.created" | "transaction.auto.updated" | "transaction.one_off.created" | "transaction.one_off.updated" | "recipient.created" | "recipient.updated" | "recipient.deleted" | "destination.created" | "destination.deleted" | "target.created" | "target.updated" | "target.deleted" | "exception.created" | "exception.cleared" | "bvnk.onboarding.created" | "bvnk.onboarding.updated" | "wallet.created" | "wallet.updated" | "wallet.signer_group.created" | "wallet.signer_group.updated" | "wallet.policy.created" | "wallet.policy.updated" | "wallet.transaction.created" | "wallet.transaction.updated" | "wallet.deposit";
|
|
733
|
+
readonly EventType: "user.created" | "user.updated" | "user.deleted" | "api_key.created" | "api_key.deleted" | "customer.created" | "customer.updated" | "customer.kyb_link.created" | "customer.kyb_link.updated" | "customer.kyb_status.created" | "customer.kyb_status.updated" | "customer.kyb_application.submitted" | "customer.capability_status.updated" | "auto_account.created" | "auto_account.updated" | "auto_account.deleted" | "transaction.auto.created" | "transaction.auto.updated" | "transaction.one_off.created" | "transaction.one_off.updated" | "recipient.created" | "recipient.updated" | "recipient.deleted" | "destination.created" | "destination.deleted" | "target.created" | "target.updated" | "target.deleted" | "exception.created" | "exception.cleared" | "bvnk.onboarding.created" | "bvnk.onboarding.updated" | "wallet.created" | "wallet.updated" | "wallet.signer_group.created" | "wallet.signer_group.updated" | "wallet.policy.created" | "wallet.policy.updated" | "wallet.transaction.created" | "wallet.transaction.updated" | "wallet.deposit" | "fee_payout_destination.updated" | "fee_payout_destination.deleted" | "scheduled_payment.failed";
|
|
732
734
|
/** @description Request metadata for the original operation that emitted the event, when available. */
|
|
733
735
|
readonly EventRequest: {
|
|
734
736
|
/**
|
|
@@ -906,8 +908,13 @@ type components = {
|
|
|
906
908
|
* @example external_customer_123
|
|
907
909
|
*/
|
|
908
910
|
readonly external_id?: string;
|
|
909
|
-
/** @description ID of an existing
|
|
911
|
+
/** @description ID of an existing sub-client to associate this new customer with. The referenced customer must belong to the same client and must itself be a sub-client. Cannot be combined with is_sub_client. */
|
|
910
912
|
readonly sub_client_id?: components["schemas"]["KSUID"];
|
|
913
|
+
/**
|
|
914
|
+
* @description When true, create this customer as a sub-client. A customer can only be designated a sub-client at creation time; a regular customer cannot be promoted to a sub-client afterwards. Cannot be combined with sub_client_id.
|
|
915
|
+
* @default false
|
|
916
|
+
*/
|
|
917
|
+
readonly is_sub_client: boolean;
|
|
911
918
|
};
|
|
912
919
|
/** @description Response returned when a customer creation process is successfully initiated. */
|
|
913
920
|
readonly CustomerCreateResponse: {
|
|
@@ -1026,7 +1033,7 @@ type components = {
|
|
|
1026
1033
|
*/
|
|
1027
1034
|
readonly sub_client_name?: string;
|
|
1028
1035
|
/**
|
|
1029
|
-
* @description Whether this customer is
|
|
1036
|
+
* @description Whether this customer is a sub-client. This is set when the customer is created and cannot be changed afterwards.
|
|
1030
1037
|
* @default false
|
|
1031
1038
|
*/
|
|
1032
1039
|
readonly is_sub_client: boolean;
|
|
@@ -1239,12 +1246,18 @@ type components = {
|
|
|
1239
1246
|
};
|
|
1240
1247
|
/**
|
|
1241
1248
|
* Account Update Request
|
|
1242
|
-
* @description Unified account update request for onramp/offramp/swap.
|
|
1249
|
+
* @description Unified account update request for onramp/offramp/swap. `developer_fee_bps` is also updatable and applies to future transactions only; existing transactions are unaffected.
|
|
1243
1250
|
*/
|
|
1244
1251
|
readonly AccountUpdateRequest: {
|
|
1245
1252
|
readonly account_type: components["schemas"]["AccountType"];
|
|
1246
1253
|
readonly crypto_destination_id?: components["schemas"]["KSUID"];
|
|
1247
1254
|
readonly fiat_destination_id?: components["schemas"]["KSUID"];
|
|
1255
|
+
/**
|
|
1256
|
+
* Format: int32
|
|
1257
|
+
* @description Developer fee (client revenue share) in basis points. When set, updates the fee applied to FUTURE transactions on this account; existing transactions are unaffected. Routing fields remain immutable.
|
|
1258
|
+
* @example 50
|
|
1259
|
+
*/
|
|
1260
|
+
readonly developer_fee_bps?: number;
|
|
1248
1261
|
readonly destination_network_id?: components["schemas"]["NetworkId"];
|
|
1249
1262
|
/**
|
|
1250
1263
|
* @description Asset to receive at the destination.
|
|
@@ -1773,7 +1786,7 @@ type components = {
|
|
|
1773
1786
|
readonly PaginatedCustomerTransactionResponse: components["schemas"]["PaginatedListResponse"] & {
|
|
1774
1787
|
readonly data?: readonly components["schemas"]["Transaction"][];
|
|
1775
1788
|
};
|
|
1776
|
-
readonly PaginatedTransactionResourceResponse: components["schemas"]["PaginatedOneOffTransactionResponse"] | components["schemas"]["PaginatedCustomerTransactionResponse"];
|
|
1789
|
+
readonly PaginatedTransactionResourceResponse: components["schemas"]["PaginatedOneOffTransactionResponse"] | components["schemas"]["PaginatedCustomerTransactionResponse"] | components["schemas"]["PaginatedWalletTransactionResponse"];
|
|
1777
1790
|
/** @description An amount of money with its asset. */
|
|
1778
1791
|
readonly TransactionAmount: {
|
|
1779
1792
|
/**
|
|
@@ -2331,6 +2344,9 @@ type components = {
|
|
|
2331
2344
|
readonly PaginatedOneOffTransactionResponse: components["schemas"]["PaginatedListResponse"] & {
|
|
2332
2345
|
readonly data?: readonly components["schemas"]["OneOffTransaction"][];
|
|
2333
2346
|
};
|
|
2347
|
+
readonly PaginatedWalletTransactionResponse: components["schemas"]["PaginatedListResponse"] & {
|
|
2348
|
+
readonly data?: readonly components["schemas"]["WalletTransaction"][];
|
|
2349
|
+
};
|
|
2334
2350
|
/** @description Non-custodial wallet managed by Dakota Platform with a single address usable across networks within the same family. */
|
|
2335
2351
|
readonly Wallet: {
|
|
2336
2352
|
readonly id: components["schemas"]["KSUID"];
|
|
@@ -2374,7 +2390,7 @@ type components = {
|
|
|
2374
2390
|
/** @description List of asset balances */
|
|
2375
2391
|
readonly balances: readonly components["schemas"]["AssetBalance"][];
|
|
2376
2392
|
/**
|
|
2377
|
-
* @description Total USD value of all balances
|
|
2393
|
+
* @description Total USD value of all balances, as a decimal string with 2 decimal places (cents). Rounded DOWN (truncated toward zero), never rounded up, so the value never exceeds the holder's spendable balance.
|
|
2378
2394
|
* @example 1234.56
|
|
2379
2395
|
*/
|
|
2380
2396
|
readonly total_amount_usd: string;
|
|
@@ -2383,7 +2399,7 @@ type components = {
|
|
|
2383
2399
|
readonly AssetBalance: {
|
|
2384
2400
|
readonly asset: components["schemas"]["AssetDeployment"];
|
|
2385
2401
|
/**
|
|
2386
|
-
* @description USD value of this asset balance
|
|
2402
|
+
* @description USD value of this asset balance, as a decimal string with 2 decimal places (cents). Rounded DOWN (truncated toward zero), never rounded up, so the value never exceeds the holder's spendable balance.
|
|
2387
2403
|
* @example 123.45
|
|
2388
2404
|
*/
|
|
2389
2405
|
readonly amount_usd: string;
|
|
@@ -2415,6 +2431,18 @@ type components = {
|
|
|
2415
2431
|
readonly amount?: string;
|
|
2416
2432
|
readonly asset?: components["schemas"]["Asset"];
|
|
2417
2433
|
readonly status: components["schemas"]["TransactionStatus"];
|
|
2434
|
+
/**
|
|
2435
|
+
* Format: int64
|
|
2436
|
+
* @description Unix time the transaction was created.
|
|
2437
|
+
* @example 1781181600
|
|
2438
|
+
*/
|
|
2439
|
+
readonly created_at?: number;
|
|
2440
|
+
/**
|
|
2441
|
+
* Format: int64
|
|
2442
|
+
* @description Unix time the transaction was confirmed on chain; absent until confirmed.
|
|
2443
|
+
* @example 1781181660
|
|
2444
|
+
*/
|
|
2445
|
+
readonly confirmed_at?: number;
|
|
2418
2446
|
};
|
|
2419
2447
|
/**
|
|
2420
2448
|
* @description Type of transaction
|
|
@@ -4496,6 +4524,423 @@ type components = {
|
|
|
4496
4524
|
*/
|
|
4497
4525
|
readonly created_at?: string;
|
|
4498
4526
|
};
|
|
4527
|
+
readonly PaymentAgentResponse: {
|
|
4528
|
+
readonly id?: string;
|
|
4529
|
+
readonly name?: string;
|
|
4530
|
+
readonly customer_id?: string;
|
|
4531
|
+
readonly hosted?: boolean;
|
|
4532
|
+
readonly signer_id?: string;
|
|
4533
|
+
/** @description base64 P-256 SPKI */
|
|
4534
|
+
readonly signer_public_key?: string;
|
|
4535
|
+
/** @description DERIVED - wallets whose attached signer groups contain the agent's signer. Empty until the customer's endorsed attaches land. */
|
|
4536
|
+
readonly wallet_ids?: readonly string[];
|
|
4537
|
+
/**
|
|
4538
|
+
* @description pending is DERIVED - a non-revoked agent recognized on no wallet. It cannot accept instructions until a wallet attach is endorsed.
|
|
4539
|
+
* @enum {string}
|
|
4540
|
+
*/
|
|
4541
|
+
readonly state?: "pending" | "active" | "revoked";
|
|
4542
|
+
/** @description Present on revoke: the signer groups the (now-revoked) agent's signer still belongs to. A revoked signer can't sign, but its group membership lingers — remove signer_id from each (DELETE /signer-groups/{signer_group_id}/signers/{signer_id}) to finish de-provisioning. Absent when there is nothing to clean up. */
|
|
4543
|
+
readonly signer_group_cleanup?: readonly components["schemas"]["PaymentAgentSignerGroupRef"][];
|
|
4544
|
+
};
|
|
4545
|
+
/** @description A signer-group reference (id + display name). */
|
|
4546
|
+
readonly PaymentAgentSignerGroupRef: {
|
|
4547
|
+
readonly signer_group_id: string;
|
|
4548
|
+
readonly name: string;
|
|
4549
|
+
};
|
|
4550
|
+
/** @description Tagged union - exactly one payload field matching `type` is set. */
|
|
4551
|
+
readonly AgenticAction: {
|
|
4552
|
+
/** @enum {string} */
|
|
4553
|
+
readonly type: "create_recipient" | "create_crypto_destination" | "create_bank_destination" | "create_mandate" | "create_scheduled_payments" | "create_auto_account";
|
|
4554
|
+
readonly create_recipient?: components["schemas"]["RecipientRequest"];
|
|
4555
|
+
readonly create_crypto_destination?: components["schemas"]["CreateCryptoDestinationAction"];
|
|
4556
|
+
readonly create_bank_destination?: components["schemas"]["CreateBankDestinationAction"];
|
|
4557
|
+
readonly create_mandate?: components["schemas"]["CreateMandateAction"];
|
|
4558
|
+
readonly create_scheduled_payments?: components["schemas"]["CreateScheduledPaymentsAction"];
|
|
4559
|
+
readonly create_auto_account?: components["schemas"]["CreateAutoAccountAction"];
|
|
4560
|
+
};
|
|
4561
|
+
readonly AgenticActionDownstream: {
|
|
4562
|
+
readonly recipient_id?: string;
|
|
4563
|
+
readonly destination_id?: string;
|
|
4564
|
+
readonly mandate_id?: string;
|
|
4565
|
+
readonly scheduled_payment_ids?: readonly string[];
|
|
4566
|
+
/** @description The provisioned auto-account (set for a create_auto_account action). */
|
|
4567
|
+
readonly auto_account_id?: string;
|
|
4568
|
+
};
|
|
4569
|
+
/** @description An input artifact attached to a conversation turn. Tagged union: exactly one payload field matching `type` is set. Extensible — further kinds (e.g. an email stream) are added as new `type` enum values + payload fields, additively, without breaking this shape. */
|
|
4570
|
+
readonly AgenticAttachment: {
|
|
4571
|
+
/**
|
|
4572
|
+
* @description The attachment kind — `document` (a PDF or image) today; further sources are added additively.
|
|
4573
|
+
* @enum {string}
|
|
4574
|
+
*/
|
|
4575
|
+
readonly type: "document";
|
|
4576
|
+
readonly document?: components["schemas"]["AgenticDocumentAttachment"];
|
|
4577
|
+
};
|
|
4578
|
+
/** @description One typed reference to the platform object an insight item was computed from. */
|
|
4579
|
+
readonly InsightEvidence: {
|
|
4580
|
+
/** @description Platform resource name — the kind of object `id` refers to. OPEN set (like `InsightItem.kind`): new resource types may be referenced without a breaking change, so a client MUST handle an unrecognized type gracefully (e.g. show the item without a deep-link), never error. `transaction` is reserved (advertised and client-handled, but not emitted today). */
|
|
4581
|
+
readonly type: string;
|
|
4582
|
+
readonly id: string;
|
|
4583
|
+
};
|
|
4584
|
+
/** @description One observation (in `insights`) or advisory recommendation (in `suggestions`) — the same schema in both arrays. `kind` is an OPEN set: new kinds appear without notice and clients must ignore kinds they do not recognize. */
|
|
4585
|
+
readonly InsightItem: {
|
|
4586
|
+
/**
|
|
4587
|
+
* @description Machine-readable item type. This is an OPEN set — the values below are the kinds emitted TODAY, but new kinds may be added at any time without a breaking change, so it is documented as an extensible enum rather than a closed one. A client MUST render an unrecognized kind generically from `message` + `severity` (and `evidence`), never drop it. Kinds emitted today, by array:
|
|
4588
|
+
* Observations (`insights[]`):
|
|
4589
|
+
* * `upcoming_payments` — open payments due within the horizon (count + per-asset totals).
|
|
4590
|
+
* * `payment_failures_clustered` — ≥2 recent failures to the same payee sharing one reason (root cause).
|
|
4591
|
+
* * `payments_failed` — remaining recent singleton failures, summarized.
|
|
4592
|
+
* * `account_activity` — executed volume over the window + mandates awaiting signature.
|
|
4593
|
+
* * `new_counterparty` — first open payments to a recently-added payee.
|
|
4594
|
+
* * `counterparty_concentration` — one payee dominates recent executed outflow.
|
|
4595
|
+
*
|
|
4596
|
+
* Suggestions (`suggestions[]`, advisory — acting is a separate human-gated step):
|
|
4597
|
+
* * `payment_at_risk` — an open payment is past its scheduled time.
|
|
4598
|
+
* * `funding_shortfall` — a funding wallet's indexed balance is below its near-term payment needs.
|
|
4599
|
+
* * `mandate_expiring` — an active mandate ends soon (warn when open payments depend on it).
|
|
4600
|
+
* * `mandate_headroom` — a mandate's window budget is nearly or already over-consumed.
|
|
4601
|
+
*/
|
|
4602
|
+
readonly kind: string;
|
|
4603
|
+
/** @enum {string} */
|
|
4604
|
+
readonly severity: "info" | "warn" | "critical";
|
|
4605
|
+
/** @description Human-readable, self-contained statement of the finding, with exact amounts and dates. */
|
|
4606
|
+
readonly message: string;
|
|
4607
|
+
/** @description Machine-readable facts behind the message (decimal strings, counts, unix timestamps). Keys vary by kind. */
|
|
4608
|
+
readonly detail?: {
|
|
4609
|
+
readonly [key: string]: unknown;
|
|
4610
|
+
};
|
|
4611
|
+
/** @description The platform objects this item is computed from (capped; may be empty when the claim is an aggregate). */
|
|
4612
|
+
readonly evidence: readonly components["schemas"]["InsightEvidence"][];
|
|
4613
|
+
};
|
|
4614
|
+
/** @description One funding wallet's indexed holding of one asset on one network. The balance index prices holdings in USD; values may lag the chain. */
|
|
4615
|
+
readonly InsightSnapshotBalance: {
|
|
4616
|
+
readonly wallet_id: string;
|
|
4617
|
+
readonly name?: string;
|
|
4618
|
+
readonly network_id: string;
|
|
4619
|
+
readonly asset: string;
|
|
4620
|
+
readonly amount_usd: string;
|
|
4621
|
+
};
|
|
4622
|
+
/** @description Open scheduled payments due within the window. */
|
|
4623
|
+
readonly InsightSnapshotUpcoming: {
|
|
4624
|
+
readonly days: number;
|
|
4625
|
+
readonly count: number;
|
|
4626
|
+
/** @description Asset → total amount due in the window (decimal strings). */
|
|
4627
|
+
readonly totals?: {
|
|
4628
|
+
readonly [key: string]: string;
|
|
4629
|
+
};
|
|
4630
|
+
};
|
|
4631
|
+
/** @description Typed FACTS about the account — rendered directly by clients, not narrated. `balances`/`total_usd` cover the wallets the customer's open payments spend from and are present only when the balance index is configured; they degrade to absent, never to an error. */
|
|
4632
|
+
readonly InsightSnapshot: {
|
|
4633
|
+
readonly total_usd?: string;
|
|
4634
|
+
readonly balances?: readonly components["schemas"]["InsightSnapshotBalance"][];
|
|
4635
|
+
readonly upcoming: components["schemas"]["InsightSnapshotUpcoming"];
|
|
4636
|
+
readonly open_scheduled_payments: number;
|
|
4637
|
+
readonly active_mandates: number;
|
|
4638
|
+
};
|
|
4639
|
+
/** @description The deterministic, read-only insight report for a customer. Computed on demand; nothing is stored. */
|
|
4640
|
+
readonly InsightReport: {
|
|
4641
|
+
readonly customer_id: string;
|
|
4642
|
+
/** Format: int64 */
|
|
4643
|
+
readonly generated_at: number;
|
|
4644
|
+
readonly snapshot: components["schemas"]["InsightSnapshot"];
|
|
4645
|
+
/** @description Observations about the account (always present, possibly empty). */
|
|
4646
|
+
readonly insights: readonly components["schemas"]["InsightItem"][];
|
|
4647
|
+
/** @description Advisory recommendations (always present, possibly empty). Non-binding — acting on one is a separate, human-gated step. */
|
|
4648
|
+
readonly suggestions: readonly components["schemas"]["InsightItem"][];
|
|
4649
|
+
};
|
|
4650
|
+
readonly InsightChatMessage: {
|
|
4651
|
+
/** @enum {string} */
|
|
4652
|
+
readonly role: "user" | "assistant";
|
|
4653
|
+
readonly content: string;
|
|
4654
|
+
};
|
|
4655
|
+
readonly InsightChatRequest: {
|
|
4656
|
+
/** @description The conversation so far, oldest first. */
|
|
4657
|
+
readonly messages: readonly components["schemas"]["InsightChatMessage"][];
|
|
4658
|
+
};
|
|
4659
|
+
readonly InsightChatResponse: {
|
|
4660
|
+
/** @description The assistant's plain-text answer. Advisory only — the assistant cannot execute anything. */
|
|
4661
|
+
readonly reply: string;
|
|
4662
|
+
/**
|
|
4663
|
+
* @description How the boundary screen treated this turn. `ok` is a normal turn; `warned` means the request was off-topic and the customer was warned but may continue; `blocked` means the conversation has been terminated (repeated off-topic turns or a manipulation attempt) — the client should stop serving it and offer a fresh chat.
|
|
4664
|
+
* @enum {string}
|
|
4665
|
+
*/
|
|
4666
|
+
readonly conversation_status?: "ok" | "warned" | "blocked";
|
|
4667
|
+
};
|
|
4668
|
+
readonly AgenticChatMessage: {
|
|
4669
|
+
/** @enum {string} */
|
|
4670
|
+
readonly role: "user" | "assistant";
|
|
4671
|
+
readonly content: string;
|
|
4672
|
+
/** @description Input artifacts attached to this turn for the agent to investigate — e.g. an invoice PDF to draft a payment from. Optional. Document attachments (PDF or image) are accepted up to 8 MiB per document and 16 MiB per request, measured on the decoded payload. */
|
|
4673
|
+
readonly attachments?: readonly components["schemas"]["AgenticAttachment"][];
|
|
4674
|
+
};
|
|
4675
|
+
readonly AgenticDocumentAttachment: {
|
|
4676
|
+
/**
|
|
4677
|
+
* @description MIME type of the attached document.
|
|
4678
|
+
* @enum {string}
|
|
4679
|
+
*/
|
|
4680
|
+
readonly media_type: "application/pdf" | "image/png" | "image/jpeg" | "image/webp" | "image/gif";
|
|
4681
|
+
/**
|
|
4682
|
+
* Format: byte
|
|
4683
|
+
* @description The document bytes, base64-encoded.
|
|
4684
|
+
*/
|
|
4685
|
+
readonly data: string;
|
|
4686
|
+
/** @description Optional original filename, for display and audit. */
|
|
4687
|
+
readonly filename?: string;
|
|
4688
|
+
};
|
|
4689
|
+
readonly AgenticInstruction: {
|
|
4690
|
+
readonly id?: string;
|
|
4691
|
+
readonly payment_agent_id?: string;
|
|
4692
|
+
/** @enum {string} */
|
|
4693
|
+
readonly status?: "proposed" | "executed" | "failed";
|
|
4694
|
+
readonly actions?: readonly components["schemas"]["AgenticAction"][];
|
|
4695
|
+
readonly downstream?: readonly components["schemas"]["AgenticActionDownstream"][];
|
|
4696
|
+
};
|
|
4697
|
+
readonly AgenticInstructionsResult: {
|
|
4698
|
+
/** @description Every mandate this batch DRAFTED, in full wire shape (identical to GET /mandates/{mandate_id}) — sign the §8 approval immediately, no follow-up fetch or polling. Pending until a signer other than the bound one approves. */
|
|
4699
|
+
readonly mandates?: readonly components["schemas"]["Mandate"][];
|
|
4700
|
+
readonly instruction_ids?: readonly string[];
|
|
4701
|
+
};
|
|
4702
|
+
/** @description A self-contained series of actions. Cross-action links are <entity>_id fields - empty binds to the artifact created in this proposal, a real id reuses an existing one. Every proposal must instruct a payment or draft a mandate - a mandate-only proposal is a standing authorization (sign now, schedule under it later by mandate_id with no new signature). */
|
|
4703
|
+
readonly AgenticProposal: {
|
|
4704
|
+
readonly summary?: string;
|
|
4705
|
+
readonly actions: readonly components["schemas"]["AgenticAction"][];
|
|
4706
|
+
};
|
|
4707
|
+
/** @description The agent's next step. At least one of `proposals` or `reply` is always present in a successful response — `proposals` at high confidence (optionally with a short `reply` note), or `reply` alone when the agent needs more from the user. */
|
|
4708
|
+
readonly AgenticProposalsResult: {
|
|
4709
|
+
/** @description Validated action-series proposals, ready to accept via POST /instructions. Present only at high confidence. */
|
|
4710
|
+
readonly proposals?: readonly components["schemas"]["AgenticProposal"][];
|
|
4711
|
+
/** @description The agent's conversational reply — a clarifying question or confirmation. Present without proposals when the agent needs more from the user; may accompany proposals as a short note. */
|
|
4712
|
+
readonly reply?: string;
|
|
4713
|
+
/**
|
|
4714
|
+
* @description How the boundary screen treated this turn: `ok` is a normal payments turn; `warned` means the request was off-topic and the customer was warned but may continue; `blocked` means the conversation has been terminated (repeated off-topic turns or a manipulation attempt) — the client should stop serving it and offer a fresh chat.
|
|
4715
|
+
* @enum {string}
|
|
4716
|
+
*/
|
|
4717
|
+
readonly conversation_status?: "ok" | "warned" | "blocked";
|
|
4718
|
+
};
|
|
4719
|
+
readonly ApproveMandateRequest: {
|
|
4720
|
+
readonly approver_public_key: string;
|
|
4721
|
+
readonly signature: string;
|
|
4722
|
+
};
|
|
4723
|
+
readonly CancelMandateRequest: {
|
|
4724
|
+
readonly signer_public_key: string;
|
|
4725
|
+
readonly signature: string;
|
|
4726
|
+
};
|
|
4727
|
+
readonly CreatePaymentAgentRequest: {
|
|
4728
|
+
readonly customer_id: string;
|
|
4729
|
+
readonly name: string;
|
|
4730
|
+
/** @description Must be true. Only hosted agents (signing keys custodied by the isolated agent-signer service) are supported today; bring-your-own-signer agents are not yet available, so the API rejects hosted=false. */
|
|
4731
|
+
readonly hosted: boolean;
|
|
4732
|
+
};
|
|
4733
|
+
readonly CreateBankDestinationAction: {
|
|
4734
|
+
readonly recipient_id?: string;
|
|
4735
|
+
readonly account_holder_name?: string;
|
|
4736
|
+
readonly account_number?: string;
|
|
4737
|
+
readonly routing_number?: string;
|
|
4738
|
+
/** @enum {string} */
|
|
4739
|
+
readonly account_type?: "checking" | "savings";
|
|
4740
|
+
readonly iban?: string;
|
|
4741
|
+
readonly bic?: string;
|
|
4742
|
+
readonly bank_name?: string;
|
|
4743
|
+
};
|
|
4744
|
+
readonly CreateCryptoDestinationAction: {
|
|
4745
|
+
/** @description recipient reference: empty = the recipient created in this proposal; a recipient id or name = an existing recipient */
|
|
4746
|
+
readonly recipient_id?: string;
|
|
4747
|
+
readonly address: string;
|
|
4748
|
+
readonly network_id: components["schemas"]["NetworkId"];
|
|
4749
|
+
};
|
|
4750
|
+
readonly CreateInstructionsRequest: {
|
|
4751
|
+
readonly payment_agent_id: string;
|
|
4752
|
+
readonly proposals: readonly components["schemas"]["AgenticProposal"][];
|
|
4753
|
+
};
|
|
4754
|
+
readonly CreateMandateAction: {
|
|
4755
|
+
readonly rule: components["schemas"]["MandateRule"];
|
|
4756
|
+
/** Format: int64 */
|
|
4757
|
+
readonly valid_from?: number;
|
|
4758
|
+
/** Format: int64 */
|
|
4759
|
+
readonly valid_until?: number;
|
|
4760
|
+
};
|
|
4761
|
+
/** @description Exactly one binding form is required - payment_agent_id alone, or signer_id together with customer_id. Any other combination is rejected with 400. */
|
|
4762
|
+
readonly CreateMandateRequest: {
|
|
4763
|
+
/** @description Binding form A (hosted convenience) - the mandate binds this agent's signer and anchors to the agent's customer. Mutually exclusive with signer_id/customer_id. */
|
|
4764
|
+
readonly payment_agent_id?: string;
|
|
4765
|
+
/** @description Binding form B - the mandate binds this signer directly (any of the client's signers, not only an agent's). Requires customer_id. */
|
|
4766
|
+
readonly signer_id?: string;
|
|
4767
|
+
/** @description Binding form B - the customer the mandate is anchored to; must belong to the calling client. Defines the recipient-target scope and the §8 approver set (approval requires a recognized signer of THIS customer other than the bound one). Requires signer_id. */
|
|
4768
|
+
readonly customer_id?: string;
|
|
4769
|
+
readonly rule: components["schemas"]["MandateRule"];
|
|
4770
|
+
/** Format: int64 */
|
|
4771
|
+
readonly valid_from?: number;
|
|
4772
|
+
/** Format: int64 */
|
|
4773
|
+
readonly valid_until?: number;
|
|
4774
|
+
};
|
|
4775
|
+
/** @description A freeform proposals conversation. The server is stateless — send the whole history in `messages` on each call. `prompt` is a convenience for a single-shot turn (or the latest user message); it is appended after `messages`. At least one of `prompt` or `messages` must be non-empty. Supplying both is valid only when `messages` does not already end with a user turn; otherwise the request is rejected with 400 (two consecutive user turns are not allowed). */
|
|
4776
|
+
readonly CreateProposalsRequest: {
|
|
4777
|
+
/** @description Single-shot input, appended as the latest user turn. */
|
|
4778
|
+
readonly prompt?: string;
|
|
4779
|
+
/** @description The conversation so far, oldest first. */
|
|
4780
|
+
readonly messages?: readonly components["schemas"]["AgenticChatMessage"][];
|
|
4781
|
+
};
|
|
4782
|
+
readonly CreateScheduledPaymentsAction: {
|
|
4783
|
+
readonly destination_id?: string;
|
|
4784
|
+
/** @description The funding wallet for these payments — one the agent recognizes. Optional only when the agent recognizes exactly one wallet (used by default); otherwise required, since a signer can recognize several and the choice cannot be deferred to fire time. Its chain family must match the payment network. */
|
|
4785
|
+
readonly wallet_id?: string;
|
|
4786
|
+
readonly amount: string;
|
|
4787
|
+
readonly asset: string;
|
|
4788
|
+
readonly dates?: readonly number[];
|
|
4789
|
+
readonly count?: number;
|
|
4790
|
+
/** Format: int64 */
|
|
4791
|
+
readonly interval_seconds?: number;
|
|
4792
|
+
/** Format: int64 */
|
|
4793
|
+
readonly start_at?: number;
|
|
4794
|
+
};
|
|
4795
|
+
/** @description Direct (signer-first) schedule create. The signer + funding wallet are the caller's choice; the schedule is explicit `dates`, or `count` × `interval_seconds` from `start_at`. Name the payee EITHER with `destination_id` (an existing crypto destination of the wallet's customer) OR with a direct `address` + `network_id` (a raw crypto address, no recipient — matched on the address at fire time, like a mandate address target) — exactly one of the two. */
|
|
4796
|
+
readonly CreateScheduledPaymentRequest: {
|
|
4797
|
+
/** @description The signer the payments bind to; its hosted agent signs at fire time. */
|
|
4798
|
+
readonly signer_id: string;
|
|
4799
|
+
/** @description The funding wallet these payments spend from. Required — the signer must be permitted to spend on it, and its chain family must match the payment network. */
|
|
4800
|
+
readonly wallet_id: string;
|
|
4801
|
+
/** @description An existing crypto destination of the wallet's customer to pay. Omit to pay a direct address (address + network_id). */
|
|
4802
|
+
readonly destination_id?: string;
|
|
4803
|
+
/** @description A direct crypto address to pay — an alternative to destination_id (no recipient). Requires network_id; the wallet's chain family must match. */
|
|
4804
|
+
readonly address?: string;
|
|
4805
|
+
/** @description The network for a direct-address payment (required together with address). */
|
|
4806
|
+
readonly network_id?: string;
|
|
4807
|
+
/** @description Decimal string, at the destination asset. */
|
|
4808
|
+
readonly amount: string;
|
|
4809
|
+
readonly asset: string;
|
|
4810
|
+
/** @description Explicit per-payment unix times (one payment each). Win over count × interval_seconds. */
|
|
4811
|
+
readonly dates?: readonly number[];
|
|
4812
|
+
/** @description Number of payments when using count × interval_seconds (default 1). */
|
|
4813
|
+
readonly count?: number;
|
|
4814
|
+
/**
|
|
4815
|
+
* Format: int64
|
|
4816
|
+
* @description Cadence in seconds between payments when using count.
|
|
4817
|
+
*/
|
|
4818
|
+
readonly interval_seconds?: number;
|
|
4819
|
+
/**
|
|
4820
|
+
* Format: int64
|
|
4821
|
+
* @description First due time (0 ⇒ now).
|
|
4822
|
+
*/
|
|
4823
|
+
readonly start_at?: number;
|
|
4824
|
+
};
|
|
4825
|
+
/** @description Provision a provider-managed convert-and-forward "auto-account" so a payment can cross chain families (crypto→crypto swap) or exit to a bank (crypto→bank offramp). The agent pays the auto-account's crypto DEPOSIT on source_network_id (on the funding wallet's own family) and the provider converts source_asset→output_asset and forwards to destination_id. A scheduled payment then targets the deposit; the mandate still targets the real recipient. */
|
|
4826
|
+
readonly CreateAutoAccountAction: {
|
|
4827
|
+
/** @description The REAL destination the auto-account forwards to: a crypto destination (⇒ swap) or a bank destination (⇒ offramp). Empty = the destination created in this proposal. */
|
|
4828
|
+
readonly destination_id?: string;
|
|
4829
|
+
/** @description The asset the agent deposits and the scheduled payment sends (may be the ANY wildcard). */
|
|
4830
|
+
readonly source_asset: string;
|
|
4831
|
+
readonly source_network_id: components["schemas"]["NetworkId"];
|
|
4832
|
+
/** @description The asset the recipient receives (a currency such as USD for a bank offramp). */
|
|
4833
|
+
readonly output_asset: string;
|
|
4834
|
+
/** @description Outbound rail — REQUIRED for a bank offramp (e.g. ach, fedwire, swift, sepa); omit for a crypto swap. */
|
|
4835
|
+
readonly rail?: string;
|
|
4836
|
+
/** @enum {string} */
|
|
4837
|
+
readonly routing_preference?: "fastest" | "cheapest";
|
|
4838
|
+
/**
|
|
4839
|
+
* Format: int32
|
|
4840
|
+
* @description Optional developer fee in basis points (0–10000).
|
|
4841
|
+
*/
|
|
4842
|
+
readonly fee_bps?: number;
|
|
4843
|
+
};
|
|
4844
|
+
readonly Mandate: {
|
|
4845
|
+
readonly id?: string;
|
|
4846
|
+
/**
|
|
4847
|
+
* @description expired is DERIVED, never stored - a pending or active mandate whose valid_until has passed. It cannot authorize payments and cannot be approved; it can still be cancelled.
|
|
4848
|
+
* @enum {string}
|
|
4849
|
+
*/
|
|
4850
|
+
readonly status?: "pending" | "active" | "expired" | "rejected" | "revoked" | "done";
|
|
4851
|
+
readonly bound_signer_id?: string;
|
|
4852
|
+
/** @description The customer this mandate is anchored to - approval requires a recognized signer of this customer other than the bound one (§8), and recipient targets belong to it. Absent only on rows created before the anchor existed. */
|
|
4853
|
+
readonly customer_id?: string;
|
|
4854
|
+
/** @description DERIVED, display-only - the rule's recipient targets resolved to names, parallel to rule.targets (raw id on a miss). Absent for address/any target kinds. The ids in the rule remain the grant. */
|
|
4855
|
+
readonly target_names?: readonly string[];
|
|
4856
|
+
readonly instruction_id?: string;
|
|
4857
|
+
readonly rule?: components["schemas"]["MandateRule"];
|
|
4858
|
+
/** Format: int64 */
|
|
4859
|
+
readonly valid_from?: number;
|
|
4860
|
+
/** Format: int64 */
|
|
4861
|
+
readonly valid_until?: number;
|
|
4862
|
+
readonly approved_by_signer_id?: string;
|
|
4863
|
+
/**
|
|
4864
|
+
* Format: int64
|
|
4865
|
+
* @description Unix time of the §8 approval; absent until approved.
|
|
4866
|
+
*/
|
|
4867
|
+
readonly approved_at?: number;
|
|
4868
|
+
/** @description The signer that cancelled the mandate while it was still pending (§8); absent otherwise. */
|
|
4869
|
+
readonly rejected_by_signer_id?: string;
|
|
4870
|
+
/** @description The signer that cancelled the mandate after activation (§8); absent otherwise. */
|
|
4871
|
+
readonly revoked_by_signer_id?: string;
|
|
4872
|
+
};
|
|
4873
|
+
readonly MandateResponse: {
|
|
4874
|
+
readonly id?: string;
|
|
4875
|
+
/** @enum {string} */
|
|
4876
|
+
readonly status?: "pending" | "active" | "rejected" | "revoked" | "done";
|
|
4877
|
+
readonly approved_by_signer_id?: string;
|
|
4878
|
+
/** @description The signer that cancelled the mandate while it was still pending (§8); absent otherwise. */
|
|
4879
|
+
readonly rejected_by_signer_id?: string;
|
|
4880
|
+
/** @description The signer that cancelled the mandate after activation (§8); absent otherwise. */
|
|
4881
|
+
readonly revoked_by_signer_id?: string;
|
|
4882
|
+
};
|
|
4883
|
+
readonly MandateRule: {
|
|
4884
|
+
/** @enum {string} */
|
|
4885
|
+
readonly target_type: "any" | "recipient" | "address";
|
|
4886
|
+
/** @description One or more targets of the declared kind (recipient ids or addresses; empty for any). Max 32. */
|
|
4887
|
+
readonly targets?: readonly string[];
|
|
4888
|
+
/** @description The network the funding wallet pays on (e.g. base-sepolia). Empty authorizes any network — the other dimensions still apply. */
|
|
4889
|
+
readonly network_id?: string;
|
|
4890
|
+
/** @description The asset the funding wallet SENDS — deposit-denominated, e.g. USDC — compared case-insensitively against the firing payment. Write the crypto deposit asset even when the recipient ultimately receives fiat via a bank offramp (stablecoin conversion is 1:1): a fiat symbol such as USD can never match a send, so the mandate would deny every payment. */
|
|
4891
|
+
readonly asset: string;
|
|
4892
|
+
/** @description Per-payment cap — a decimal string in the rule's (deposit) asset. Empty means no per-payment cap; the window caps may still bound total spend. */
|
|
4893
|
+
readonly max_per_tx?: string;
|
|
4894
|
+
/**
|
|
4895
|
+
* @description Spend-cap window for the per-target limits (calendar, not rolling). NONE = lifetime; WEEKLY = calendar week from Monday 00:00 UTC; MONTHLY = calendar month from the 1st, 00:00 UTC.
|
|
4896
|
+
* @enum {string}
|
|
4897
|
+
*/
|
|
4898
|
+
readonly window?: "NONE" | "WEEKLY" | "MONTHLY";
|
|
4899
|
+
/** @description Cumulative cap over the window, PER TARGET (never shared across targets). */
|
|
4900
|
+
readonly max_amount_per_target_in_window?: string;
|
|
4901
|
+
/** @description Up to N times PER TARGET in the window (window NONE = lifetime). */
|
|
4902
|
+
readonly max_count_per_target_in_window?: number;
|
|
4903
|
+
};
|
|
4904
|
+
readonly ScheduledPaymentResponse: {
|
|
4905
|
+
readonly id?: string;
|
|
4906
|
+
/** @description The signer (hosted agent) this payment fires under. Updatable via PATCH while scheduled. */
|
|
4907
|
+
readonly signer_id?: string;
|
|
4908
|
+
/** @description The funding wallet this payment spends from (the customer's choice at acceptance; updatable via PATCH while scheduled). */
|
|
4909
|
+
readonly wallet_id?: string;
|
|
4910
|
+
/** @description AUDIT — the mandate that covered this payment at fire time. Absent until the payment executes (coverage is decided at fire time, not bound at rest). */
|
|
4911
|
+
readonly mandate_id?: string;
|
|
4912
|
+
/** @description AUDIT — the money-path transaction created when this payment fired. Absent until the payment executes. */
|
|
4913
|
+
readonly wallet_transaction_id?: string;
|
|
4914
|
+
readonly amount?: string;
|
|
4915
|
+
readonly asset?: string;
|
|
4916
|
+
/** @description Why the payment failed (e.g. the mandate gate's denied dimensions); absent unless status is failed. */
|
|
4917
|
+
readonly failure_reason?: string;
|
|
4918
|
+
/** @description The recipient this payment pays, when created from a destination. Absent for a direct-address payment. Use this — NOT the address — to resolve the payee (two payees can share a destination address). */
|
|
4919
|
+
readonly recipient_id?: string;
|
|
4920
|
+
/** @description The REAL destination this settles to (a bank for an offramp, a crypto destination otherwise). For an auto-account payment the address is the crypto DEPOSIT while this names the bank/crypto target. */
|
|
4921
|
+
readonly destination_id?: string;
|
|
4922
|
+
/**
|
|
4923
|
+
* @description The kind of the REAL destination. `bank` marks an offramp (crypto converts to fiat, forwarded via a bank rail); `crypto` a direct or cross-family crypto payout.
|
|
4924
|
+
* @enum {string}
|
|
4925
|
+
*/
|
|
4926
|
+
readonly destination_type?: "bank" | "crypto";
|
|
4927
|
+
/** @description A human label for the real destination — e.g. "Chase ••••5432" for a bank, or a shortened address for crypto — so a client shows which account the payment settles to without a second lookup. */
|
|
4928
|
+
readonly destination_label?: string;
|
|
4929
|
+
/** @description For a bank destination, the payout rail (e.g. ach, fedwire, swift, sepa). Absent for crypto. */
|
|
4930
|
+
readonly destination_rail?: string;
|
|
4931
|
+
/** @description The asset the recipient ULTIMATELY receives — the fiat currency (e.g. USD) for an offramp, else equal to `asset`. Stablecoin conversion is 1:1, so the output amount equals `amount`. */
|
|
4932
|
+
readonly output_asset?: string;
|
|
4933
|
+
/** @description For a crypto destination, the network the recipient receives on — differs from `network_id` (the deposit network) for a cross-family swap (e.g. solana-devnet vs base-sepolia); equals `network_id` for a direct crypto payment; absent for a bank offramp. */
|
|
4934
|
+
readonly output_network?: string;
|
|
4935
|
+
readonly address?: string;
|
|
4936
|
+
readonly network_id?: string;
|
|
4937
|
+
/** @enum {string} */
|
|
4938
|
+
readonly status?: "scheduled" | "cancelled" | "executed" | "failed";
|
|
4939
|
+
/** Format: int64 */
|
|
4940
|
+
readonly executed_at?: number;
|
|
4941
|
+
/** Format: int64 */
|
|
4942
|
+
readonly scheduled_at?: number;
|
|
4943
|
+
};
|
|
4499
4944
|
};
|
|
4500
4945
|
responses: never;
|
|
4501
4946
|
parameters: {
|
|
@@ -4568,8 +5013,19 @@ type Address = components['schemas']['Address'];
|
|
|
4568
5013
|
type PersonName = components['schemas']['PersonName'];
|
|
4569
5014
|
/** Customer record */
|
|
4570
5015
|
type Customer = components['schemas']['Customer'];
|
|
4571
|
-
/**
|
|
4572
|
-
|
|
5016
|
+
/**
|
|
5017
|
+
* Customer creation request.
|
|
5018
|
+
*
|
|
5019
|
+
* NOTE: openapi-typescript generates `is_sub_client` as required because the
|
|
5020
|
+
* OpenAPI spec declares a `default: false`. The spec's `required:` list is
|
|
5021
|
+
* only `['name', 'customer_type']`, so this alias re-exports with
|
|
5022
|
+
* `is_sub_client` optional to match the server's runtime behaviour. Pass
|
|
5023
|
+
* `is_sub_client: true` to designate a sub-client at creation; cannot be
|
|
5024
|
+
* combined with `sub_client_id`. See ENG-2454.
|
|
5025
|
+
*/
|
|
5026
|
+
type CustomerCreateRequest = Omit<components['schemas']['CustomerCreateRequest'], 'is_sub_client'> & {
|
|
5027
|
+
is_sub_client?: boolean;
|
|
5028
|
+
};
|
|
4573
5029
|
/** Customer creation response */
|
|
4574
5030
|
type CustomerCreateResponse = components['schemas']['CustomerCreateResponse'];
|
|
4575
5031
|
/** KYB status */
|
|
@@ -4604,10 +5060,17 @@ type Recipient = components['schemas']['RecipientResponse'];
|
|
|
4604
5060
|
type RecipientRequest = components['schemas']['RecipientRequest'];
|
|
4605
5061
|
/** Recipient update request */
|
|
4606
5062
|
type RecipientUpdateRequest = components['schemas']['RecipientRequest'];
|
|
4607
|
-
/** Destination response union */
|
|
5063
|
+
/** Destination response union (used by `destinations.list`) */
|
|
4608
5064
|
type Destination = components['schemas']['DestinationResponseUnion'];
|
|
4609
5065
|
/** Destination request union */
|
|
4610
5066
|
type DestinationRequest = components['schemas']['DestinationRequestUnion'];
|
|
5067
|
+
/**
|
|
5068
|
+
* Response for `destinations.create` — the platform returns just `{ id }`
|
|
5069
|
+
* (per `IDResponse`), NOT the full `DestinationResponseUnion`. Call
|
|
5070
|
+
* `destinations.list(recipientId)` afterwards to read the full shape if
|
|
5071
|
+
* you need it.
|
|
5072
|
+
*/
|
|
5073
|
+
type DestinationCreateResponse = components['schemas']['IDResponse'];
|
|
4611
5074
|
/** Fiat US destination request */
|
|
4612
5075
|
type FiatUSDestinationRequest = components['schemas']['FiatUSDestinationRequest'];
|
|
4613
5076
|
/** Crypto destination request */
|
|
@@ -4650,8 +5113,24 @@ type WalletCreateRequest = components['schemas']['WalletCreateRequest'];
|
|
|
4650
5113
|
type WalletBalance = components['schemas']['AssetBalance'];
|
|
4651
5114
|
/** Wallet balances */
|
|
4652
5115
|
type WalletBalances = components['schemas']['WalletBalances'];
|
|
4653
|
-
/**
|
|
4654
|
-
|
|
5116
|
+
/**
|
|
5117
|
+
* Wallet transaction request body.
|
|
5118
|
+
*
|
|
5119
|
+
* `POST /wallets/{id}/transactions` expects an endorsed envelope —
|
|
5120
|
+
* `{ signatures: string[], intent: SendTransactionIntent }` — NOT a bare
|
|
5121
|
+
* intent. Build the `SendTransactionIntent`, canonicalize per RFC 8785,
|
|
5122
|
+
* sign with the wallet's signer-group ECDSA P-256 key, then post the
|
|
5123
|
+
* `{ signatures, intent }` envelope.
|
|
5124
|
+
*
|
|
5125
|
+
* @see https://docs.dakota.xyz/documentation/signing-guide
|
|
5126
|
+
*/
|
|
5127
|
+
type WalletTransactionRequest = components['schemas']['EndorsedRequest'];
|
|
5128
|
+
/**
|
|
5129
|
+
* The bare intent that goes inside `WalletTransactionRequest.intent`.
|
|
5130
|
+
* Exposed for callers building + signing the intent locally before
|
|
5131
|
+
* wrapping it in the endorsed envelope.
|
|
5132
|
+
*/
|
|
5133
|
+
type SendTransactionIntent = components['schemas']['SendTransactionIntent'];
|
|
4655
5134
|
/**
|
|
4656
5135
|
* Endorsed request envelope: `{ signatures: string[], intent: <one of the
|
|
4657
5136
|
* endorsed intent types> }`. Required by every mutating policy / signer-group
|
|
@@ -4763,8 +5242,13 @@ type SignerGroup = components['schemas']['SignerGroup'];
|
|
|
4763
5242
|
type SignerGroupCreateRequest = components['schemas']['SignerGroupCreateRequest'];
|
|
4764
5243
|
/** Signer */
|
|
4765
5244
|
type Signer = components['schemas']['Signer'];
|
|
4766
|
-
/** Signer creation request */
|
|
5245
|
+
/** Signer creation request (POST /signers — creates a signer resource) */
|
|
4767
5246
|
type SignerCreateRequest = components['schemas']['SignerCreateRequest'];
|
|
5247
|
+
/**
|
|
5248
|
+
* Signer group signer add request (POST /signer-groups/{id}/signers —
|
|
5249
|
+
* adds an EXISTING signer's public key to a group).
|
|
5250
|
+
*/
|
|
5251
|
+
type SignerGroupSignerAddRequest = components['schemas']['CreateSignerGroupSignerRequest'];
|
|
4768
5252
|
/** API key */
|
|
4769
5253
|
type ApiKey = components['schemas']['ApiKeyListItem'];
|
|
4770
5254
|
/** API key response */
|
|
@@ -5119,10 +5603,11 @@ interface SelfServeCreditsLedgerParams {
|
|
|
5119
5603
|
*
|
|
5120
5604
|
* @example
|
|
5121
5605
|
* ```typescript
|
|
5122
|
-
* // Use a custom idempotency key for replay safety
|
|
5606
|
+
* // Use a custom idempotency key for replay safety (must be a valid UUID —
|
|
5607
|
+
* // the platform rejects other formats with 400)
|
|
5123
5608
|
* const tx = await client.transactions.create(
|
|
5124
5609
|
* { customer_id: '...', amount: '100.00', ... },
|
|
5125
|
-
* { idempotencyKey:
|
|
5610
|
+
* { idempotencyKey: randomUUID() }
|
|
5126
5611
|
* );
|
|
5127
5612
|
* ```
|
|
5128
5613
|
*/
|
|
@@ -5178,11 +5663,98 @@ interface TransactionListParams extends ListParams {
|
|
|
5178
5663
|
source_network_id?: string;
|
|
5179
5664
|
source_asset?: string;
|
|
5180
5665
|
destination_asset?: string;
|
|
5666
|
+
/**
|
|
5667
|
+
* Filter wallet transactions by wallet ID.
|
|
5668
|
+
* Only valid with `transaction_type: 'wallet'`.
|
|
5669
|
+
*/
|
|
5670
|
+
wallet_id?: string;
|
|
5671
|
+
/**
|
|
5672
|
+
* Filter wallet transactions by direction relative to the wallet:
|
|
5673
|
+
* - `'out'` — transactions sent FROM the wallet
|
|
5674
|
+
* - `'in'` — transactions recorded with the wallet as the recipient
|
|
5675
|
+
*
|
|
5676
|
+
* Only valid with `transaction_type: 'wallet'`.
|
|
5677
|
+
*/
|
|
5678
|
+
direction?: 'in' | 'out';
|
|
5181
5679
|
}
|
|
5182
5680
|
/** Event list parameters */
|
|
5183
5681
|
interface EventListParams extends ListParams {
|
|
5184
5682
|
event_type?: string;
|
|
5185
5683
|
}
|
|
5684
|
+
/** Payment agent (hosted signer that drafts payments on a customer's behalf) */
|
|
5685
|
+
type PaymentAgent = components['schemas']['PaymentAgentResponse'];
|
|
5686
|
+
/** Payment agent creation request */
|
|
5687
|
+
type PaymentAgentCreateRequest = components['schemas']['CreatePaymentAgentRequest'];
|
|
5688
|
+
/** Slim reference to a signer group an agent's signer still belongs to (returned by revoke). */
|
|
5689
|
+
type PaymentAgentSignerGroupRef = components['schemas']['PaymentAgentSignerGroupRef'];
|
|
5690
|
+
/** A single reviewable action series drafted by an agent. */
|
|
5691
|
+
type AgenticProposal = components['schemas']['AgenticProposal'];
|
|
5692
|
+
/** One tagged action inside an AgenticProposal. */
|
|
5693
|
+
type AgenticAction = components['schemas']['AgenticAction'];
|
|
5694
|
+
/** Per-action downstream artifacts produced by actuation. */
|
|
5695
|
+
type AgenticActionDownstream = components['schemas']['AgenticActionDownstream'];
|
|
5696
|
+
/** The result of POST /payment-agents/{id}/proposals. */
|
|
5697
|
+
type AgenticProposalsResult = components['schemas']['AgenticProposalsResult'];
|
|
5698
|
+
/** Request body for POST /payment-agents/{id}/proposals. */
|
|
5699
|
+
type CreateProposalsRequest = components['schemas']['CreateProposalsRequest'];
|
|
5700
|
+
/** Request body for POST /instructions. */
|
|
5701
|
+
type CreateInstructionsRequest = components['schemas']['CreateInstructionsRequest'];
|
|
5702
|
+
/** A persisted, actuated instruction (the accepted proposal). */
|
|
5703
|
+
type AgenticInstruction = components['schemas']['AgenticInstruction'];
|
|
5704
|
+
/** The result of POST /instructions — instruction_ids + the mandates the batch drafted. */
|
|
5705
|
+
type AgenticInstructionsResult = components['schemas']['AgenticInstructionsResult'];
|
|
5706
|
+
/** A mandate — the §8 authorization a customer signs to arm scheduled payments. */
|
|
5707
|
+
type Mandate = components['schemas']['Mandate'];
|
|
5708
|
+
/** Mandate rule — the spend authorization the customer approves. */
|
|
5709
|
+
type MandateRule = components['schemas']['MandateRule'];
|
|
5710
|
+
/** Slim mandate response (approve/cancel). */
|
|
5711
|
+
type MandateResponse = components['schemas']['MandateResponse'];
|
|
5712
|
+
/** Request body for POST /mandates — draft a mandate from a direct user interaction. */
|
|
5713
|
+
type CreateMandateRequest = components['schemas']['CreateMandateRequest'];
|
|
5714
|
+
/** Request body for POST /mandates/{id}/approve. */
|
|
5715
|
+
type ApproveMandateRequest = components['schemas']['ApproveMandateRequest'];
|
|
5716
|
+
/** Request body for POST /mandates/{id}/cancel. */
|
|
5717
|
+
type CancelMandateRequest = components['schemas']['CancelMandateRequest'];
|
|
5718
|
+
/** A scheduled payment — bookkeeping row created by accepting an instruction. */
|
|
5719
|
+
type ScheduledPayment = components['schemas']['ScheduledPaymentResponse'];
|
|
5720
|
+
/** Request body for POST /scheduled-payments — direct (signer-first) schedule create. */
|
|
5721
|
+
type CreateScheduledPaymentRequest = components['schemas']['CreateScheduledPaymentRequest'];
|
|
5722
|
+
/** The customer's account insight report (deterministic, read-only). */
|
|
5723
|
+
type InsightReport = components['schemas']['InsightReport'];
|
|
5724
|
+
/** One observation or suggestion inside an InsightReport. `kind` is an OPEN set. */
|
|
5725
|
+
type InsightItem = components['schemas']['InsightItem'];
|
|
5726
|
+
/** Typed reference to the platform object an insight was computed from. */
|
|
5727
|
+
type InsightEvidence = components['schemas']['InsightEvidence'];
|
|
5728
|
+
/** The typed-facts snapshot inside an InsightReport. */
|
|
5729
|
+
type InsightSnapshot = components['schemas']['InsightSnapshot'];
|
|
5730
|
+
/** One conversation turn for the insight chat. */
|
|
5731
|
+
type InsightChatMessage = components['schemas']['InsightChatMessage'];
|
|
5732
|
+
/** Request body for POST /customers/{id}/insights/chat (stateless; send the whole conversation). */
|
|
5733
|
+
type InsightChatRequest = components['schemas']['InsightChatRequest'];
|
|
5734
|
+
/** The insight-chat assistant's reply. */
|
|
5735
|
+
type InsightChatResponse = components['schemas']['InsightChatResponse'];
|
|
5736
|
+
/** Parameters for listing mandates. */
|
|
5737
|
+
interface MandateListParams extends ListParams {
|
|
5738
|
+
customer_id?: string;
|
|
5739
|
+
signer_id?: string;
|
|
5740
|
+
/**
|
|
5741
|
+
* Effective status(es) to include. Accepts a single status or a
|
|
5742
|
+
* comma-separated combination, e.g. 'active,expired'. Omit for all.
|
|
5743
|
+
*/
|
|
5744
|
+
status?: NonNullable<Mandate['status']> | (string & NonNullable<unknown>);
|
|
5745
|
+
}
|
|
5746
|
+
/** Parameters for listing scheduled payments. */
|
|
5747
|
+
interface ScheduledPaymentListParams extends ListParams {
|
|
5748
|
+
customer_id?: string;
|
|
5749
|
+
signer_id?: string;
|
|
5750
|
+
wallet_id?: string;
|
|
5751
|
+
mandate_id?: string;
|
|
5752
|
+
/**
|
|
5753
|
+
* Status(es) to include. Accepts a single status or a comma-separated
|
|
5754
|
+
* combination, e.g. 'scheduled,executed'. Omit for all.
|
|
5755
|
+
*/
|
|
5756
|
+
status?: NonNullable<ScheduledPayment['status']> | (string & NonNullable<unknown>);
|
|
5757
|
+
}
|
|
5186
5758
|
|
|
5187
5759
|
/**
|
|
5188
5760
|
* Customers resource.
|
|
@@ -5216,6 +5788,15 @@ declare class CustomersResource extends BaseResource {
|
|
|
5216
5788
|
* { idempotencyKey: 'create-acme-corp-001' }
|
|
5217
5789
|
* );
|
|
5218
5790
|
* console.log(customer.applicationUrl); // KYB onboarding URL
|
|
5791
|
+
*
|
|
5792
|
+
* // Designate as a sub-client at creation (ENG-2454).
|
|
5793
|
+
* // `is_sub_client` can only be set here — a regular customer cannot
|
|
5794
|
+
* // be promoted afterwards. Cannot be combined with `sub_client_id`.
|
|
5795
|
+
* const subClient = await client.customers.create({
|
|
5796
|
+
* name: 'Partner Corp',
|
|
5797
|
+
* customer_type: 'business',
|
|
5798
|
+
* is_sub_client: true,
|
|
5799
|
+
* });
|
|
5219
5800
|
* ```
|
|
5220
5801
|
*/
|
|
5221
5802
|
create(data: CustomerCreateRequest, options?: RequestOptions): Promise<CustomerCreateResponse>;
|
|
@@ -5410,33 +5991,42 @@ declare class DestinationsResource extends BaseResource {
|
|
|
5410
5991
|
/**
|
|
5411
5992
|
* Create a new destination for a recipient.
|
|
5412
5993
|
*
|
|
5413
|
-
* Destinations can be bank accounts (fiat_us) or crypto
|
|
5994
|
+
* Destinations can be bank accounts (fiat_us / fiat_iban) or crypto
|
|
5995
|
+
* wallets (crypto).
|
|
5996
|
+
*
|
|
5997
|
+
* The platform returns just `{ id }` here (per `IDResponse`), not the
|
|
5998
|
+
* full destination object. Call `destinations.list(recipientId)` if
|
|
5999
|
+
* you need the rest of the fields.
|
|
5414
6000
|
*
|
|
5415
6001
|
* @param recipientId - Recipient ID
|
|
5416
6002
|
* @param data - Destination creation data
|
|
5417
|
-
* @returns
|
|
6003
|
+
* @returns `{ id }` of the newly-created destination
|
|
5418
6004
|
*
|
|
5419
6005
|
* @example
|
|
5420
6006
|
* ```typescript
|
|
5421
|
-
* //
|
|
5422
|
-
* const bankDest = await client.destinations.create(recipientId, {
|
|
5423
|
-
* destination_type: 'fiat_us',
|
|
5424
|
-
* bank_name: 'Chase Bank',
|
|
5425
|
-
* account_holder_name: 'Acme Corp',
|
|
5426
|
-
* account_number: '123456789',
|
|
5427
|
-
* routing_number: '021000021',
|
|
5428
|
-
* account_type: 'checking',
|
|
5429
|
-
* });
|
|
5430
|
-
*
|
|
5431
|
-
* // Create a crypto destination (for on-ramp)
|
|
6007
|
+
* // Crypto destination (for on-ramp)
|
|
5432
6008
|
* const cryptoDest = await client.destinations.create(recipientId, {
|
|
5433
6009
|
* destination_type: 'crypto',
|
|
6010
|
+
* name: 'Treasury USDC',
|
|
5434
6011
|
* crypto_address: '0x742d35Cc6634C0532925a3b844Bc9e7595f...',
|
|
5435
6012
|
* network_id: 'ethereum-mainnet',
|
|
5436
6013
|
* });
|
|
6014
|
+
* // → cryptoDest.id
|
|
6015
|
+
*
|
|
6016
|
+
* // Fiat US destination (for off-ramp)
|
|
6017
|
+
* const bankDest = await client.destinations.create(recipientId, {
|
|
6018
|
+
* destination_type: 'fiat_us',
|
|
6019
|
+
* name: 'Acme Chase Checking',
|
|
6020
|
+
* bank_name: 'JPMorgan Chase',
|
|
6021
|
+
* account_holder_name: 'Acme Corp',
|
|
6022
|
+
* account_number: '000123456789',
|
|
6023
|
+
* aba_routing_number: '021000021',
|
|
6024
|
+
* account_type: 'checking',
|
|
6025
|
+
* });
|
|
6026
|
+
* // → bankDest.id
|
|
5437
6027
|
* ```
|
|
5438
6028
|
*/
|
|
5439
|
-
create(recipientId: string, data: DestinationRequest, options?: RequestOptions): Promise<
|
|
6029
|
+
create(recipientId: string, data: DestinationRequest, options?: RequestOptions): Promise<DestinationCreateResponse>;
|
|
5440
6030
|
/**
|
|
5441
6031
|
* List destinations for a recipient.
|
|
5442
6032
|
*
|
|
@@ -5641,6 +6231,13 @@ declare class TransactionsResource extends BaseResource {
|
|
|
5641
6231
|
* customer_id: customerId,
|
|
5642
6232
|
* status: 'completed',
|
|
5643
6233
|
* });
|
|
6234
|
+
*
|
|
6235
|
+
* // Wallet-scoped filters (require transaction_type: 'wallet')
|
|
6236
|
+
* const sent = client.transactions.list({
|
|
6237
|
+
* transaction_type: 'wallet',
|
|
6238
|
+
* wallet_id: walletId,
|
|
6239
|
+
* direction: 'out',
|
|
6240
|
+
* });
|
|
5644
6241
|
* ```
|
|
5645
6242
|
*/
|
|
5646
6243
|
list(params?: TransactionListParams): PaginatedIterator<OneOffTransaction>;
|
|
@@ -5754,34 +6351,71 @@ declare class WalletsResource extends BaseResource {
|
|
|
5754
6351
|
/**
|
|
5755
6352
|
* Get wallet balances.
|
|
5756
6353
|
*
|
|
6354
|
+
* Returns the platform's full `WalletBalances` response: the wallet id,
|
|
6355
|
+
* its on-chain address, every per-asset balance, and a pre-computed
|
|
6356
|
+
* `total_amount_usd` across all assets. The previous return shape
|
|
6357
|
+
* (`WalletBalance[]`) silently dropped `address` and `total_amount_usd`,
|
|
6358
|
+
* forcing callers to do a second `wallets.get()` and sum the balances
|
|
6359
|
+
* by hand. This is a small breaking change with a one-line migration
|
|
6360
|
+
* (`balances` → `balances.balances`); the prior shape had been broken
|
|
6361
|
+
* since 1.3.x anyway.
|
|
6362
|
+
*
|
|
5757
6363
|
* @param walletId - Wallet ID
|
|
5758
|
-
* @returns
|
|
6364
|
+
* @returns `{ wallet_id, address, balances, total_amount_usd }`
|
|
5759
6365
|
*
|
|
5760
6366
|
* @example
|
|
5761
6367
|
* ```typescript
|
|
5762
|
-
* const balances =
|
|
5763
|
-
*
|
|
5764
|
-
*
|
|
6368
|
+
* const { address, total_amount_usd, balances } =
|
|
6369
|
+
* await client.wallets.getBalances(walletId);
|
|
6370
|
+
* console.log(`${address} → $${total_amount_usd}`);
|
|
6371
|
+
* for (const b of balances) {
|
|
6372
|
+
* console.log(b.asset.id, b.amount_usd);
|
|
5765
6373
|
* }
|
|
5766
6374
|
* ```
|
|
5767
6375
|
*/
|
|
5768
|
-
getBalances(walletId: string): Promise<
|
|
6376
|
+
getBalances(walletId: string): Promise<WalletBalances>;
|
|
5769
6377
|
/**
|
|
5770
|
-
*
|
|
6378
|
+
* Send a transaction from a wallet.
|
|
6379
|
+
*
|
|
6380
|
+
* The platform expects an **endorsed request** envelope —
|
|
6381
|
+
* `{ signatures, intent }` — at this endpoint. Build the
|
|
6382
|
+
* `SendTransactionIntent`, canonicalize it per RFC 8785 (JCS), sign
|
|
6383
|
+
* with the wallet's signer-group ECDSA P-256 key, base64-encode the
|
|
6384
|
+
* DER signature, then post the envelope.
|
|
5771
6385
|
*
|
|
5772
6386
|
* @param walletId - Wallet ID
|
|
5773
|
-
* @param data -
|
|
6387
|
+
* @param data - Endorsed wallet transaction request: `{ signatures, intent }`
|
|
5774
6388
|
* @returns Created transaction
|
|
5775
6389
|
*
|
|
5776
6390
|
* @example
|
|
5777
6391
|
* ```typescript
|
|
6392
|
+
* import canonicalize from 'canonicalize';
|
|
6393
|
+
* import { createSign, createPrivateKey, randomUUID } from 'node:crypto';
|
|
6394
|
+
*
|
|
6395
|
+
* const intent = {
|
|
6396
|
+
* wallet_id: walletId,
|
|
6397
|
+
* caip2: 'eip155:1', // 11155111 for sepolia
|
|
6398
|
+
* operation: {
|
|
6399
|
+
* kind: 'transfer',
|
|
6400
|
+
* from: wallet.address,
|
|
6401
|
+
* to: '0x...',
|
|
6402
|
+
* amount: '100.00',
|
|
6403
|
+
* asset_id: 'USDC',
|
|
6404
|
+
* },
|
|
6405
|
+
* idempotency_key: randomUUID(),
|
|
6406
|
+
* };
|
|
6407
|
+
* const canonical = canonicalize(intent)!;
|
|
6408
|
+
* const sig = createSign('SHA256').update(canonical).sign({
|
|
6409
|
+
* key: createPrivateKey({ key: privateKeyDer, format: 'der', type: 'pkcs8' }),
|
|
6410
|
+
* dsaEncoding: 'der',
|
|
6411
|
+
* });
|
|
5778
6412
|
* const tx = await client.wallets.createTransaction(walletId, {
|
|
5779
|
-
*
|
|
5780
|
-
*
|
|
5781
|
-
* asset: 'USDC',
|
|
5782
|
-
* network_id: 'ethereum-mainnet',
|
|
6413
|
+
* signatures: [sig.toString('base64')],
|
|
6414
|
+
* intent,
|
|
5783
6415
|
* });
|
|
5784
6416
|
* ```
|
|
6417
|
+
*
|
|
6418
|
+
* @see https://docs.dakota.xyz/documentation/signing-guide
|
|
5785
6419
|
*/
|
|
5786
6420
|
createTransaction(walletId: string, data: WalletTransactionRequest, options?: RequestOptions): Promise<WalletTransaction>;
|
|
5787
6421
|
}
|
|
@@ -6144,20 +6778,26 @@ declare class SignerGroupsResource extends BaseResource {
|
|
|
6144
6778
|
*/
|
|
6145
6779
|
get(signerGroupId: string): Promise<SignerGroup>;
|
|
6146
6780
|
/**
|
|
6147
|
-
* Add
|
|
6781
|
+
* Add an existing signer's public key to a group.
|
|
6782
|
+
*
|
|
6783
|
+
* The endpoint takes `{ member_key }` — the base64 PKIX (SPKI) public
|
|
6784
|
+
* key of an existing signer resource — not a fresh signer definition.
|
|
6785
|
+
* Returns the updated group (with the new member included).
|
|
6148
6786
|
*
|
|
6149
6787
|
* @param signerGroupId - Signer group ID
|
|
6150
|
-
* @param data -
|
|
6151
|
-
* @returns
|
|
6788
|
+
* @param data - `{ member_key }` (the signer's base64 PKIX public key)
|
|
6789
|
+
* @returns The updated signer group
|
|
6152
6790
|
*/
|
|
6153
|
-
addSigner(signerGroupId: string, data:
|
|
6791
|
+
addSigner(signerGroupId: string, data: SignerGroupSignerAddRequest, options?: RequestOptions): Promise<SignerGroup>;
|
|
6154
6792
|
/**
|
|
6155
6793
|
* Remove a signer from a group.
|
|
6156
6794
|
*
|
|
6157
6795
|
* @param signerGroupId - Signer group ID
|
|
6158
6796
|
* @param signerId - Signer ID
|
|
6797
|
+
* @param options - Optional request options (e.g. an explicit idempotency
|
|
6798
|
+
* key — the platform requires one on this DELETE)
|
|
6159
6799
|
*/
|
|
6160
|
-
removeSigner(signerGroupId: string, signerId: string): Promise<void>;
|
|
6800
|
+
removeSigner(signerGroupId: string, signerId: string, options?: RequestOptions): Promise<void>;
|
|
6161
6801
|
/**
|
|
6162
6802
|
* Get wallets attached to a signer group.
|
|
6163
6803
|
*
|
|
@@ -6724,6 +7364,363 @@ declare class SelfServeResource extends BaseResource {
|
|
|
6724
7364
|
getPricing(): Promise<SelfServeCreditsPricingResponse>;
|
|
6725
7365
|
}
|
|
6726
7366
|
|
|
7367
|
+
/**
|
|
7368
|
+
* Payment Agents resource (ALPHA).
|
|
7369
|
+
*
|
|
7370
|
+
* Agentic payments is an alpha surface (x-alpha, flag-gated on the platform)
|
|
7371
|
+
* and may change without a major-version bump.
|
|
7372
|
+
*/
|
|
7373
|
+
|
|
7374
|
+
/**
|
|
7375
|
+
* Payment Agents API resource (ALPHA).
|
|
7376
|
+
*/
|
|
7377
|
+
declare class PaymentAgentsResource extends BaseResource {
|
|
7378
|
+
/**
|
|
7379
|
+
* Create a hosted payment agent.
|
|
7380
|
+
*
|
|
7381
|
+
* @param data - Payment agent creation data (customer_id, name, hosted)
|
|
7382
|
+
* @returns The created payment agent (id, signer_id, signer_public_key, state)
|
|
7383
|
+
*/
|
|
7384
|
+
create(data: PaymentAgentCreateRequest, options?: RequestOptions): Promise<PaymentAgent>;
|
|
7385
|
+
/**
|
|
7386
|
+
* Get a hosted payment agent.
|
|
7387
|
+
*
|
|
7388
|
+
* Returns the agent together with the wallets it can currently spend
|
|
7389
|
+
* from. `wallet_ids` are DERIVED at query time from the agent signer's
|
|
7390
|
+
* live signer-group membership, so they reflect the agent's access
|
|
7391
|
+
* right now — not just at creation time.
|
|
7392
|
+
*
|
|
7393
|
+
* @param paymentAgentId - Payment agent ID
|
|
7394
|
+
*/
|
|
7395
|
+
get(paymentAgentId: string): Promise<PaymentAgent>;
|
|
7396
|
+
/**
|
|
7397
|
+
* Revoke a hosted payment agent.
|
|
7398
|
+
*
|
|
7399
|
+
* The agent can no longer be used, and its signing key is destroyed
|
|
7400
|
+
* in the isolated signer service (best-effort — the revoked state is
|
|
7401
|
+
* authoritative). Idempotent.
|
|
7402
|
+
*
|
|
7403
|
+
* The response's `signer_group_cleanup` names the signer groups the
|
|
7404
|
+
* (now-revoked) agent's signer still belongs to. A revoked signer can't
|
|
7405
|
+
* sign, but its group membership lingers — remove it with
|
|
7406
|
+
* `client.signerGroups.removeSigner(signer_group_id, signer_id)` to
|
|
7407
|
+
* finish de-provisioning.
|
|
7408
|
+
*
|
|
7409
|
+
* @param paymentAgentId - Payment agent ID
|
|
7410
|
+
* @returns The revoked payment agent (state=revoked, signer_group_cleanup?)
|
|
7411
|
+
*/
|
|
7412
|
+
revoke(paymentAgentId: string, options?: RequestOptions): Promise<PaymentAgent>;
|
|
7413
|
+
/**
|
|
7414
|
+
* Draft payment proposals from a conversation.
|
|
7415
|
+
*
|
|
7416
|
+
* Pure cognition, no side effects: turn a customer's natural-language
|
|
7417
|
+
* request into reviewable proposals. Stateless — send the whole
|
|
7418
|
+
* conversation so far in `messages` on each call. Prefer
|
|
7419
|
+
* `AgentConversation` for multi-turn chat; use this directly only for
|
|
7420
|
+
* one-shot proposals.
|
|
7421
|
+
*
|
|
7422
|
+
* @param paymentAgentId - Payment agent ID
|
|
7423
|
+
* @param data - Prompt and/or messages
|
|
7424
|
+
* @returns Proposals (at high confidence) and/or a conversational reply
|
|
7425
|
+
*/
|
|
7426
|
+
createProposals(paymentAgentId: string, data: CreateProposalsRequest, options?: RequestOptions): Promise<AgenticProposalsResult>;
|
|
7427
|
+
}
|
|
7428
|
+
|
|
7429
|
+
/**
|
|
7430
|
+
* Instructions resource (ALPHA).
|
|
7431
|
+
*
|
|
7432
|
+
* Agentic payments is an alpha surface (x-alpha, flag-gated on the platform)
|
|
7433
|
+
* and may change without a major-version bump.
|
|
7434
|
+
*/
|
|
7435
|
+
|
|
7436
|
+
/**
|
|
7437
|
+
* Instructions API resource (ALPHA).
|
|
7438
|
+
*
|
|
7439
|
+
* Each accepted proposal becomes one persisted instruction whose action
|
|
7440
|
+
* series is actuated deterministically.
|
|
7441
|
+
*/
|
|
7442
|
+
declare class InstructionsResource extends BaseResource {
|
|
7443
|
+
/**
|
|
7444
|
+
* Accept proposals — actuate them into persisted instructions.
|
|
7445
|
+
*
|
|
7446
|
+
* @param data - The payment agent id and the proposals to accept
|
|
7447
|
+
* @returns instruction_ids + the mandates the batch drafted (in full
|
|
7448
|
+
* wire shape; sign the §8 approval immediately)
|
|
7449
|
+
*/
|
|
7450
|
+
create(data: CreateInstructionsRequest, options?: RequestOptions): Promise<AgenticInstructionsResult>;
|
|
7451
|
+
/**
|
|
7452
|
+
* Get an accepted instruction — its action series and the per-action
|
|
7453
|
+
* downstream artifacts actuation produced.
|
|
7454
|
+
*
|
|
7455
|
+
* @param instructionId - Instruction ID
|
|
7456
|
+
*/
|
|
7457
|
+
get(instructionId: string): Promise<AgenticInstruction>;
|
|
7458
|
+
}
|
|
7459
|
+
|
|
7460
|
+
/**
|
|
7461
|
+
* Mandates resource (ALPHA).
|
|
7462
|
+
*
|
|
7463
|
+
* Agentic payments is an alpha surface (x-alpha, flag-gated on the platform)
|
|
7464
|
+
* and may change without a major-version bump.
|
|
7465
|
+
*/
|
|
7466
|
+
|
|
7467
|
+
/**
|
|
7468
|
+
* Mandates API resource (ALPHA).
|
|
7469
|
+
*/
|
|
7470
|
+
declare class MandatesResource extends BaseResource {
|
|
7471
|
+
/**
|
|
7472
|
+
* List mandates (newest first), with the EFFECTIVE status — a pending or
|
|
7473
|
+
* active mandate past its valid_until reads "expired". Filter with
|
|
7474
|
+
* customer_id / signer_id / status; omit them all for the full collection.
|
|
7475
|
+
*
|
|
7476
|
+
* @param params - Optional pagination + filter parameters
|
|
7477
|
+
* @returns Async iterator of mandates
|
|
7478
|
+
*/
|
|
7479
|
+
list(params?: MandateListParams): PaginatedIterator<Mandate>;
|
|
7480
|
+
/**
|
|
7481
|
+
* Get a mandate — the signer it binds, its rule exactly as the customer
|
|
7482
|
+
* approves it, validity, and status.
|
|
7483
|
+
*
|
|
7484
|
+
* @param mandateId - Mandate ID
|
|
7485
|
+
*/
|
|
7486
|
+
get(mandateId: string): Promise<Mandate>;
|
|
7487
|
+
/**
|
|
7488
|
+
* Create a mandate directly.
|
|
7489
|
+
*
|
|
7490
|
+
* Drafts a PENDING mandate from a direct user interaction — no instruction
|
|
7491
|
+
* back-link. Exactly one binding form names the signer the mandate binds:
|
|
7492
|
+
* `payment_agent_id` (hosted convenience — binds that agent's signer and
|
|
7493
|
+
* anchors to the agent's customer), or `signer_id` together with
|
|
7494
|
+
* `customer_id` (any of the client's signers, BYO keys included). The rule
|
|
7495
|
+
* is the one the customer will approve (via `approve`, a recognized signer
|
|
7496
|
+
* other than the bound one, §8).
|
|
7497
|
+
*
|
|
7498
|
+
* @param data - One binding form + rule + optional validity window
|
|
7499
|
+
* @returns The drafted (pending) mandate
|
|
7500
|
+
*/
|
|
7501
|
+
create(data: CreateMandateRequest, options?: RequestOptions): Promise<Mandate>;
|
|
7502
|
+
/**
|
|
7503
|
+
* Approve a mandate.
|
|
7504
|
+
*
|
|
7505
|
+
* A recognized signer OTHER than the bound one signs the mandate payload
|
|
7506
|
+
* (see `mandateSignPayload` + `MandateSigner`) to activate it; arms its
|
|
7507
|
+
* scheduled payments.
|
|
7508
|
+
*
|
|
7509
|
+
* @param mandateId - Mandate ID
|
|
7510
|
+
* @param data - Approver public key (base64 PKIX) + base64 ASN.1 signature
|
|
7511
|
+
*/
|
|
7512
|
+
approve(mandateId: string, data: ApproveMandateRequest, options?: RequestOptions): Promise<MandateResponse>;
|
|
7513
|
+
/**
|
|
7514
|
+
* Cancel a mandate.
|
|
7515
|
+
*
|
|
7516
|
+
* Revokes a pending or active mandate. The canceller must be a recognized
|
|
7517
|
+
* signer OTHER than the bound one, with a valid signature over the mandate
|
|
7518
|
+
* payload — the bound signer can never mutate its own mandate.
|
|
7519
|
+
*
|
|
7520
|
+
* @param mandateId - Mandate ID
|
|
7521
|
+
* @param data - Signer public key (base64 PKIX) + base64 ASN.1 signature
|
|
7522
|
+
*/
|
|
7523
|
+
cancel(mandateId: string, data: CancelMandateRequest, options?: RequestOptions): Promise<MandateResponse>;
|
|
7524
|
+
}
|
|
7525
|
+
|
|
7526
|
+
/**
|
|
7527
|
+
* Scheduled Payments resource (ALPHA).
|
|
7528
|
+
*
|
|
7529
|
+
* Agentic payments is an alpha surface (x-alpha, flag-gated on the platform)
|
|
7530
|
+
* and may change without a major-version bump.
|
|
7531
|
+
*/
|
|
7532
|
+
|
|
7533
|
+
/**
|
|
7534
|
+
* Scheduled Payments API resource (ALPHA).
|
|
7535
|
+
*/
|
|
7536
|
+
declare class ScheduledPaymentsResource extends BaseResource {
|
|
7537
|
+
/**
|
|
7538
|
+
* List scheduled payments (oldest due first).
|
|
7539
|
+
*
|
|
7540
|
+
* Narrow the collection with the optional customer_id, signer_id,
|
|
7541
|
+
* wallet_id, mandate_id, and status filters; omit them all for the full
|
|
7542
|
+
* client collection.
|
|
7543
|
+
*
|
|
7544
|
+
* @param params - Optional pagination + filter parameters
|
|
7545
|
+
* @returns Async iterator of scheduled payments
|
|
7546
|
+
*/
|
|
7547
|
+
list(params?: ScheduledPaymentListParams): PaginatedIterator<ScheduledPayment>;
|
|
7548
|
+
/**
|
|
7549
|
+
* Schedule payments directly — bypass the proposal flow.
|
|
7550
|
+
*
|
|
7551
|
+
* Creates one or more scheduled payments for a signer under an existing
|
|
7552
|
+
* active mandate (coverage is matched at fire time, so no new signature
|
|
7553
|
+
* is needed here). The schedule is explicit `dates` OR `count` ×
|
|
7554
|
+
* `interval_seconds` from `start_at`.
|
|
7555
|
+
*
|
|
7556
|
+
* @param data - Signer + wallet + destination (or address+network_id) + schedule
|
|
7557
|
+
* @returns The rows that were created (one per date)
|
|
7558
|
+
*/
|
|
7559
|
+
create(data: CreateScheduledPaymentRequest, options?: RequestOptions): Promise<ScheduledPayment[]>;
|
|
7560
|
+
/**
|
|
7561
|
+
* Cancel one still-scheduled payment.
|
|
7562
|
+
*
|
|
7563
|
+
* Finalizes the row as cancelled. No signature is required — schedule rows
|
|
7564
|
+
* are bookkeeping, not authorization; the signed grant is the MANDATE,
|
|
7565
|
+
* which this does not touch.
|
|
7566
|
+
*
|
|
7567
|
+
* @param scheduledPaymentId - Scheduled payment ID
|
|
7568
|
+
*/
|
|
7569
|
+
cancel(scheduledPaymentId: string, options?: RequestOptions): Promise<void>;
|
|
7570
|
+
}
|
|
7571
|
+
|
|
7572
|
+
/**
|
|
7573
|
+
* Insights resource (ALPHA).
|
|
7574
|
+
*
|
|
7575
|
+
* Agentic payments is an alpha surface (x-alpha, flag-gated on the platform)
|
|
7576
|
+
* and may change without a major-version bump.
|
|
7577
|
+
*/
|
|
7578
|
+
|
|
7579
|
+
/**
|
|
7580
|
+
* Insights API resource (ALPHA).
|
|
7581
|
+
*
|
|
7582
|
+
* Read-only, advisory reporting over a customer's agentic activity. Nothing
|
|
7583
|
+
* here moves money or changes state.
|
|
7584
|
+
*/
|
|
7585
|
+
declare class InsightsResource extends BaseResource {
|
|
7586
|
+
/**
|
|
7587
|
+
* Get the customer's account insight report.
|
|
7588
|
+
*
|
|
7589
|
+
* A deterministic, read-only report: a snapshot of typed facts
|
|
7590
|
+
* (funding-wallet balances, upcoming totals, open payments, active
|
|
7591
|
+
* mandates), observations (`insights`), and advisory recommendations
|
|
7592
|
+
* (`suggestions`). Every item carries `evidence` — typed references to
|
|
7593
|
+
* the platform objects it was computed from. `kind` is an OPEN set;
|
|
7594
|
+
* ignore kinds you do not recognize.
|
|
7595
|
+
*
|
|
7596
|
+
* @param customerId - Customer ID
|
|
7597
|
+
* @returns The customer's insight report
|
|
7598
|
+
*/
|
|
7599
|
+
get(customerId: string): Promise<InsightReport>;
|
|
7600
|
+
/**
|
|
7601
|
+
* Ask about the customer's account.
|
|
7602
|
+
*
|
|
7603
|
+
* A read-only, advisory conversation. Stateless: send the conversation so
|
|
7604
|
+
* far in `messages` on each call; the response is the assistant's next
|
|
7605
|
+
* plain-text `reply`. The assistant narrates the same deterministic report
|
|
7606
|
+
* {@link get} returns — it never originates a number, never proposes, and
|
|
7607
|
+
* never moves money. Rate-limited per customer (hourly burst + daily
|
|
7608
|
+
* window) — a 429 means back off and retry later.
|
|
7609
|
+
*
|
|
7610
|
+
* @param customerId - Customer ID
|
|
7611
|
+
* @param data - The conversation so far (1–40 messages)
|
|
7612
|
+
* @returns The assistant's reply (+ how the boundary screen treated the turn)
|
|
7613
|
+
*/
|
|
7614
|
+
chat(customerId: string, data: InsightChatRequest, options?: RequestOptions): Promise<InsightChatResponse>;
|
|
7615
|
+
}
|
|
7616
|
+
|
|
7617
|
+
/**
|
|
7618
|
+
* Multi-turn agent chat. The platform's proposals endpoint is STATELESS —
|
|
7619
|
+
* it holds no session and must be sent the whole transcript on every turn.
|
|
7620
|
+
* `AgentConversation` hides that bookkeeping so a caller just sends user
|
|
7621
|
+
* messages and reads the agent's clarifying questions / final proposals.
|
|
7622
|
+
*
|
|
7623
|
+
* Agentic payments is an alpha surface (x-alpha, flag-gated on the platform)
|
|
7624
|
+
* and may change without a major-version bump.
|
|
7625
|
+
*/
|
|
7626
|
+
|
|
7627
|
+
/**
|
|
7628
|
+
* MIME types the platform accepts for a document attachment.
|
|
7629
|
+
*/
|
|
7630
|
+
type AttachmentMediaType = 'application/pdf' | 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif';
|
|
7631
|
+
/**
|
|
7632
|
+
* An input artifact on a user turn for the agent to read — today a document
|
|
7633
|
+
* (a PDF or image, e.g. an invoice to draft a payment from). `data` is the
|
|
7634
|
+
* RAW document bytes; the SDK base64-encodes them on the wire.
|
|
7635
|
+
*/
|
|
7636
|
+
interface Attachment {
|
|
7637
|
+
mediaType: AttachmentMediaType;
|
|
7638
|
+
/** raw document bytes (not base64) */
|
|
7639
|
+
data: Uint8Array;
|
|
7640
|
+
/** optional, for display/audit */
|
|
7641
|
+
filename?: string;
|
|
7642
|
+
}
|
|
7643
|
+
/**
|
|
7644
|
+
* One turn of an agent conversation.
|
|
7645
|
+
*/
|
|
7646
|
+
interface ChatMessage {
|
|
7647
|
+
role: 'user' | 'assistant';
|
|
7648
|
+
content: string;
|
|
7649
|
+
/**
|
|
7650
|
+
* Input artifacts attached to this turn for the agent to investigate.
|
|
7651
|
+
* Attachments ride only on the turn they are passed; they are NOT
|
|
7652
|
+
* persisted in the transcript.
|
|
7653
|
+
*/
|
|
7654
|
+
attachments?: Attachment[];
|
|
7655
|
+
}
|
|
7656
|
+
/**
|
|
7657
|
+
* The agent's response to one user message.
|
|
7658
|
+
*/
|
|
7659
|
+
interface ConversationTurn {
|
|
7660
|
+
/**
|
|
7661
|
+
* The agent's conversational text — a clarifying question or a
|
|
7662
|
+
* confirmation. May be empty when only proposals are returned.
|
|
7663
|
+
*/
|
|
7664
|
+
reply: string;
|
|
7665
|
+
/**
|
|
7666
|
+
* The reviewable action series, present once the agent reaches high
|
|
7667
|
+
* confidence. Accept it via the instructions flow.
|
|
7668
|
+
*/
|
|
7669
|
+
proposals: AgenticProposal[];
|
|
7670
|
+
/** Whether the agent drafted proposals this turn. */
|
|
7671
|
+
hasProposals: boolean;
|
|
7672
|
+
/**
|
|
7673
|
+
* The boundary screen's verdict for this turn: `"ok"` (normal), `"warned"`
|
|
7674
|
+
* (off-topic — the customer was warned), or `"blocked"` (the chat is
|
|
7675
|
+
* terminated; stop serving and offer a fresh conversation). Empty when
|
|
7676
|
+
* the platform sent none.
|
|
7677
|
+
*/
|
|
7678
|
+
conversationStatus: string;
|
|
7679
|
+
}
|
|
7680
|
+
/**
|
|
7681
|
+
* A stateful, multi-turn proposals chat with one agent.
|
|
7682
|
+
*
|
|
7683
|
+
* Keeps the running transcript, appends each user message and the agent's
|
|
7684
|
+
* reply, and resends the whole transcript on every {@link send} — so
|
|
7685
|
+
* callers never deal with the stateless endpoint's "send all history each
|
|
7686
|
+
* time" contract.
|
|
7687
|
+
*
|
|
7688
|
+
* For a stateless backend (one HTTP request per chat message), persist
|
|
7689
|
+
* {@link messages} between requests and rebuild with
|
|
7690
|
+
* {@link DakotaClient.resumeAgentConversation}.
|
|
7691
|
+
*/
|
|
7692
|
+
declare class AgentConversation {
|
|
7693
|
+
private readonly client;
|
|
7694
|
+
private readonly paymentAgentId;
|
|
7695
|
+
private history;
|
|
7696
|
+
constructor(client: DakotaClient, paymentAgentId: string, history?: ChatMessage[]);
|
|
7697
|
+
/**
|
|
7698
|
+
* Adds the user's message to the transcript, asks the agent, records the
|
|
7699
|
+
* agent's reply, and returns the turn. When `hasProposals` is true the
|
|
7700
|
+
* agent has drafted a reviewable action series; otherwise `reply` holds
|
|
7701
|
+
* its next question.
|
|
7702
|
+
*
|
|
7703
|
+
* On error the optimistic user turn is rolled back, so the caller may
|
|
7704
|
+
* retry the same call without duplicating it.
|
|
7705
|
+
*/
|
|
7706
|
+
send(userMessage: string): Promise<ConversationTurn>;
|
|
7707
|
+
/**
|
|
7708
|
+
* {@link send} with documents (e.g. an invoice PDF) attached to the user
|
|
7709
|
+
* turn for the agent to read and draft payments from. Same turn semantics
|
|
7710
|
+
* and rollback-on-error behavior as `send`. Attachments ride only on the
|
|
7711
|
+
* turn they are passed; the stateless transcript keeps the agent's text
|
|
7712
|
+
* reply, so a follow-up turn relies on that summary rather than re-sending
|
|
7713
|
+
* the document.
|
|
7714
|
+
*/
|
|
7715
|
+
sendWithAttachments(userMessage: string, attachments?: Attachment[]): Promise<ConversationTurn>;
|
|
7716
|
+
/**
|
|
7717
|
+
* A copy of the full transcript so far. Persist this between requests in
|
|
7718
|
+
* a stateless backend and rebuild with
|
|
7719
|
+
* {@link DakotaClient.resumeAgentConversation}.
|
|
7720
|
+
*/
|
|
7721
|
+
messages(): ChatMessage[];
|
|
7722
|
+
}
|
|
7723
|
+
|
|
6727
7724
|
/**
|
|
6728
7725
|
* Dakota Platform API Client.
|
|
6729
7726
|
*/
|
|
@@ -6793,6 +7790,16 @@ declare class DakotaClient {
|
|
|
6793
7790
|
readonly sandbox: SandboxResource;
|
|
6794
7791
|
/** Self-Serve Credits API - manage prepaid transfer credits */
|
|
6795
7792
|
readonly selfServe: SelfServeResource;
|
|
7793
|
+
/** Payment Agents API (ALPHA) - hosted signing agents that draft payments */
|
|
7794
|
+
readonly paymentAgents: PaymentAgentsResource;
|
|
7795
|
+
/** Instructions API (ALPHA) - accept and inspect actuated proposals */
|
|
7796
|
+
readonly instructions: InstructionsResource;
|
|
7797
|
+
/** Mandates API (ALPHA) - the §8 authorizations that arm scheduled payments */
|
|
7798
|
+
readonly mandates: MandatesResource;
|
|
7799
|
+
/** Scheduled Payments API (ALPHA) - schedule rows created from instructions */
|
|
7800
|
+
readonly scheduledPayments: ScheduledPaymentsResource;
|
|
7801
|
+
/** Insights API (ALPHA) - read-only advisory reporting over agentic activity */
|
|
7802
|
+
readonly insights: InsightsResource;
|
|
6796
7803
|
/**
|
|
6797
7804
|
* Create a new Dakota client.
|
|
6798
7805
|
*
|
|
@@ -6826,6 +7833,41 @@ declare class DakotaClient {
|
|
|
6826
7833
|
* ```
|
|
6827
7834
|
*/
|
|
6828
7835
|
constructor(config: DakotaClientConfig);
|
|
7836
|
+
/**
|
|
7837
|
+
* Start a fresh multi-turn conversation with a payment agent.
|
|
7838
|
+
*
|
|
7839
|
+
* @see AgentConversation
|
|
7840
|
+
*/
|
|
7841
|
+
newAgentConversation(paymentAgentId: string): AgentConversation;
|
|
7842
|
+
/**
|
|
7843
|
+
* Rebuild a conversation from a persisted transcript (oldest first) —
|
|
7844
|
+
* for backends that store the history between requests.
|
|
7845
|
+
*/
|
|
7846
|
+
resumeAgentConversation(paymentAgentId: string, history: ChatMessage[]): AgentConversation;
|
|
7847
|
+
/**
|
|
7848
|
+
* Grant a principal (user or agent — both are just signers) permission to
|
|
7849
|
+
* spend from a wallet by adding its signer to an EXISTING signer group on
|
|
7850
|
+
* that wallet. Idempotent; errors if the group isn't attached to the wallet.
|
|
7851
|
+
*
|
|
7852
|
+
* @see attachUserToWallet in `agentic/wallets.ts` for the full contract.
|
|
7853
|
+
*/
|
|
7854
|
+
attachUserToWallet(walletId: string, signerPublicKey: string, spendingGroupId: string, options?: {
|
|
7855
|
+
idempotencyKey?: string;
|
|
7856
|
+
}): Promise<{
|
|
7857
|
+
alreadyMember: boolean;
|
|
7858
|
+
}>;
|
|
7859
|
+
/**
|
|
7860
|
+
* Revoke a principal's spend permission by removing its signer from the
|
|
7861
|
+
* given signer group — the inverse of {@link attachUserToWallet}.
|
|
7862
|
+
* Idempotent; errors if the group isn't attached to the wallet.
|
|
7863
|
+
*
|
|
7864
|
+
* @see detachUserFromWallet in `agentic/wallets.ts` for the full contract.
|
|
7865
|
+
*/
|
|
7866
|
+
detachUserFromWallet(walletId: string, signerPublicKey: string, spendingGroupId: string, options?: {
|
|
7867
|
+
idempotencyKey?: string;
|
|
7868
|
+
}): Promise<{
|
|
7869
|
+
wasMember: boolean;
|
|
7870
|
+
}>;
|
|
6829
7871
|
/**
|
|
6830
7872
|
* Get the resolved base URL.
|
|
6831
7873
|
*/
|
|
@@ -6878,4 +7920,268 @@ declare class ConfigurationError extends Error {
|
|
|
6878
7920
|
constructor(message: string);
|
|
6879
7921
|
}
|
|
6880
7922
|
|
|
6881
|
-
|
|
7923
|
+
/**
|
|
7924
|
+
* High-level agentic helpers: collapse the multi-step, crypto-heavy hosted-
|
|
7925
|
+
* agent flows into single calls with good defaults, so a partner integration
|
|
7926
|
+
* stays short. The raw operations remain reachable via the resource classes
|
|
7927
|
+
* on `DakotaClient`.
|
|
7928
|
+
*
|
|
7929
|
+
* Agentic payments is an alpha surface (x-alpha, flag-gated on the platform)
|
|
7930
|
+
* and may change without a major-version bump.
|
|
7931
|
+
*/
|
|
7932
|
+
|
|
7933
|
+
/**
|
|
7934
|
+
* Grant a principal — a user OR an agent, both are just signers — permission
|
|
7935
|
+
* to spend from a wallet by adding its signer to an EXISTING signer group on
|
|
7936
|
+
* that wallet: the group whose attached policies should govern it.
|
|
7937
|
+
*
|
|
7938
|
+
* That membership change is the whole operation, and it is UNENDORSED: group
|
|
7939
|
+
* membership is a client-admin action, not a wallet endorsement, so it needs
|
|
7940
|
+
* NO signature — not from the wallet owner, not from the principal being
|
|
7941
|
+
* added. From then on the principal's transactions are subject to exactly
|
|
7942
|
+
* the policies bound to `spendingGroupId`, the same as any other member of
|
|
7943
|
+
* that group. The per-payment spend bound remains the agentic mandate gate,
|
|
7944
|
+
* not the policy.
|
|
7945
|
+
*
|
|
7946
|
+
* Deliberately reuses the wallet's pre-built policies and creates NO
|
|
7947
|
+
* per-signer policy. Two policy-engine realities make a per-signer policy
|
|
7948
|
+
* the wrong tool: a policy → wallet attach is endorsed by the policy's OWN
|
|
7949
|
+
* signer group (so only that group's key could attach it), and an
|
|
7950
|
+
* unconditional approval-threshold ALLOW policy inverts to a deny for any
|
|
7951
|
+
* transaction its group didn't sign, so a second signer's policy would veto
|
|
7952
|
+
* the first. Prepare the wallet's groups + policies in advance and point
|
|
7953
|
+
* each principal at the group whose constraints you want it to inherit.
|
|
7954
|
+
*
|
|
7955
|
+
* Idempotent: if the signer is already a member, returns
|
|
7956
|
+
* `alreadyMember: true` and makes no write. Rejects `spendingGroupId` if it
|
|
7957
|
+
* is not attached to `walletId`, so a wrong group fails loudly instead of
|
|
7958
|
+
* silently granting nothing.
|
|
7959
|
+
*
|
|
7960
|
+
* The key must already exist as a signer resource — the add endpoint takes
|
|
7961
|
+
* a `member_key` reference, it does not register keys. A hosted agent's key
|
|
7962
|
+
* is minted by `paymentAgents.create`; for a bare user key, register it
|
|
7963
|
+
* first (`POST /signers`) or the add fails with a signer-not-found error.
|
|
7964
|
+
*
|
|
7965
|
+
* @param client - Dakota client
|
|
7966
|
+
* @param walletId - The wallet the principal will spend from
|
|
7967
|
+
* @param signerPublicKey - The principal's registered signer public key
|
|
7968
|
+
* (base64 PKIX) — e.g. `signer_public_key` returned by
|
|
7969
|
+
* `paymentAgents.create` for a hosted agent
|
|
7970
|
+
* @param spendingGroupId - The signer group whose attached policies should
|
|
7971
|
+
* govern the principal; must already be attached to `walletId`
|
|
7972
|
+
* @param options - Optional. Supply `idempotencyKey` (a valid UUID — the
|
|
7973
|
+
* platform rejects other formats with 400) to make the WHOLE helper
|
|
7974
|
+
* safely retryable — a crashed or partitioned call replayed with the
|
|
7975
|
+
* same key dedupes the underlying write server-side. Defaults to a
|
|
7976
|
+
* fresh random UUID per call.
|
|
7977
|
+
* @returns `{ alreadyMember }` — true when the signer was already a member
|
|
7978
|
+
* (no write performed)
|
|
7979
|
+
*/
|
|
7980
|
+
declare function attachUserToWallet(client: DakotaClient, walletId: string, signerPublicKey: string, spendingGroupId: string, options?: {
|
|
7981
|
+
idempotencyKey?: string;
|
|
7982
|
+
}): Promise<{
|
|
7983
|
+
alreadyMember: boolean;
|
|
7984
|
+
}>;
|
|
7985
|
+
/**
|
|
7986
|
+
* Revoke a principal's spend permission by removing its signer from
|
|
7987
|
+
* `spendingGroupId` — the inverse of {@link attachUserToWallet}, and
|
|
7988
|
+
* likewise UNENDORSED (no signature).
|
|
7989
|
+
*
|
|
7990
|
+
* Deliberately SCOPED to the one group you pass, NOT a sweep across every
|
|
7991
|
+
* group on the wallet, for two reasons:
|
|
7992
|
+
* - signer groups are NOT wallet-exclusive — the same group can govern
|
|
7993
|
+
* multiple wallets — so removing a signer from a group revokes it on
|
|
7994
|
+
* EVERY wallet that group governs; passing one explicit group keeps
|
|
7995
|
+
* that blast radius known instead of multiplying it across all of the
|
|
7996
|
+
* wallet's groups;
|
|
7997
|
+
* - a sweep cannot tell "added for this agent" from "belongs here for
|
|
7998
|
+
* another reason" (e.g. the human owner sitting in the admin group),
|
|
7999
|
+
* so it can lock out a legitimate member.
|
|
8000
|
+
*
|
|
8001
|
+
* Pass the same group you used to attach. Idempotent: if the signer isn't
|
|
8002
|
+
* a member, it is a no-op (`wasMember: false`). Rejects `spendingGroupId`
|
|
8003
|
+
* if it is not attached to `walletId`.
|
|
8004
|
+
*
|
|
8005
|
+
* NOTE: this does not guard against removing a group's LAST member —
|
|
8006
|
+
* emptying the group that governs a wallet can leave it with no authorized
|
|
8007
|
+
* signer. The caller must avoid stranding the wallet. For a hosted agent,
|
|
8008
|
+
* prefer `paymentAgents.revoke` (it destroys the agent's key, so the signer
|
|
8009
|
+
* can authorize nothing even while still listed) and use this for
|
|
8010
|
+
* membership hygiene.
|
|
8011
|
+
*
|
|
8012
|
+
* @param options - Optional. Supply `idempotencyKey` (a valid UUID) to
|
|
8013
|
+
* make the WHOLE helper safely retryable across crashes/partitions;
|
|
8014
|
+
* defaults to a fresh random UUID per call.
|
|
8015
|
+
*/
|
|
8016
|
+
declare function detachUserFromWallet(client: DakotaClient, walletId: string, signerPublicKey: string, spendingGroupId: string, options?: {
|
|
8017
|
+
idempotencyKey?: string;
|
|
8018
|
+
}): Promise<{
|
|
8019
|
+
wasMember: boolean;
|
|
8020
|
+
}>;
|
|
8021
|
+
|
|
8022
|
+
/**
|
|
8023
|
+
* §8 mandate signing. Approving (or cancelling) a mandate is not a bare API
|
|
8024
|
+
* call: it requires a cryptographic signature over the mandate's canonical
|
|
8025
|
+
* bytes, proving the action came from a holder of the registered key. This
|
|
8026
|
+
* file reproduces the platform's exact signed payload (RFC 8785 / JCS
|
|
8027
|
+
* canonical JSON) and a P-256 signing/verification path, so partners never
|
|
8028
|
+
* hand-roll JCS + ECDSA.
|
|
8029
|
+
*
|
|
8030
|
+
* The canonical bytes a signature covers — matched byte-for-byte with the
|
|
8031
|
+
* platform's MandatePayload — are JCS JSON of:
|
|
8032
|
+
*
|
|
8033
|
+
* {action, id, bound_signer, rule, valid_from, valid_until}
|
|
8034
|
+
*
|
|
8035
|
+
* signed as base64( ASN.1( ECDSA-P256( SHA-256(payload) ))), with the public
|
|
8036
|
+
* key as base64 PKIX (SPKI).
|
|
8037
|
+
*
|
|
8038
|
+
* Agentic payments is an alpha surface (x-alpha, flag-gated on the platform)
|
|
8039
|
+
* and may change without a major-version bump.
|
|
8040
|
+
*/
|
|
8041
|
+
|
|
8042
|
+
/**
|
|
8043
|
+
* The §8 verb a signature authorizes. It is part of the signed payload so
|
|
8044
|
+
* an approval and a cancellation can never be each other's replay: a signed
|
|
8045
|
+
* cancel must not be byte-identical to a signed approve.
|
|
8046
|
+
*/
|
|
8047
|
+
type MandateAction = 'approve' | 'cancel';
|
|
8048
|
+
/**
|
|
8049
|
+
* Produces the §8 signature the platform verifies for a mandate
|
|
8050
|
+
* approve/cancel. The caller holds the private key; the SDK never sees it.
|
|
8051
|
+
*
|
|
8052
|
+
* Implement this over your own key custody (HSM/KMS) for production. For
|
|
8053
|
+
* sandbox and tests, `P256MandateSigner` is a ready in-memory implementation.
|
|
8054
|
+
*/
|
|
8055
|
+
interface MandateSigner {
|
|
8056
|
+
/**
|
|
8057
|
+
* The base64 PKIX (SPKI) P-256 public key — the exact form the platform
|
|
8058
|
+
* registered for this signer and verifies signatures against.
|
|
8059
|
+
*/
|
|
8060
|
+
publicKeyBase64(): string;
|
|
8061
|
+
/**
|
|
8062
|
+
* Returns a base64 ASN.1 ECDSA signature over SHA-256(payload).
|
|
8063
|
+
*/
|
|
8064
|
+
sign(payload: Uint8Array): Promise<string> | string;
|
|
8065
|
+
}
|
|
8066
|
+
/**
|
|
8067
|
+
* Reproduces, byte-for-byte, the canonical bytes the platform signs for one
|
|
8068
|
+
* §8 action on a mandate. Build it straight from the mandate as returned by
|
|
8069
|
+
* `mandates.get` / `mandates.list` — no server state is needed, and field
|
|
8070
|
+
* order is irrelevant (JCS sorts).
|
|
8071
|
+
*
|
|
8072
|
+
* `valid_from` / `valid_until` are always present in the signed payload
|
|
8073
|
+
* (even when zero); the wire omits a zero value, so a missing field
|
|
8074
|
+
* canonicalizes to 0 — matching the platform, which signs the int64
|
|
8075
|
+
* directly.
|
|
8076
|
+
*/
|
|
8077
|
+
declare function mandateSignPayload(mandate: Mandate, action: MandateAction): Uint8Array;
|
|
8078
|
+
/**
|
|
8079
|
+
* Canonical bytes a recognized wallet signer endorses to attach a signer
|
|
8080
|
+
* group to a wallet.
|
|
8081
|
+
*/
|
|
8082
|
+
declare function attachGroupPayload(walletId: string, groupId: string, idempotencyKey: string): Uint8Array;
|
|
8083
|
+
/**
|
|
8084
|
+
* Canonical bytes a recognized wallet signer endorses to attach a policy to
|
|
8085
|
+
* a wallet.
|
|
8086
|
+
*/
|
|
8087
|
+
declare function attachPolicyPayload(walletId: string, policyId: string, idempotencyKey: string): Uint8Array;
|
|
8088
|
+
/**
|
|
8089
|
+
* Canonical bytes a recognized wallet signer endorses to remove a signer
|
|
8090
|
+
* group from a wallet — the inverse of {@link attachGroupPayload}.
|
|
8091
|
+
*/
|
|
8092
|
+
declare function detachGroupPayload(walletId: string, groupId: string, idempotencyKey: string): Uint8Array;
|
|
8093
|
+
/**
|
|
8094
|
+
* Canonical bytes a recognized wallet signer endorses to remove a policy
|
|
8095
|
+
* from a wallet — the inverse of {@link attachPolicyPayload}.
|
|
8096
|
+
*/
|
|
8097
|
+
declare function detachPolicyPayload(walletId: string, policyId: string, idempotencyKey: string): Uint8Array;
|
|
8098
|
+
/**
|
|
8099
|
+
* Canonical bytes a member of the policy's governing signer group endorses
|
|
8100
|
+
* to delete a policy.
|
|
8101
|
+
*/
|
|
8102
|
+
declare function deletePolicyPayload(policyId: string, idempotencyKey: string): Uint8Array;
|
|
8103
|
+
/**
|
|
8104
|
+
* Canonical bytes a member of the policy's governing signer group endorses
|
|
8105
|
+
* to remove a rule from a policy.
|
|
8106
|
+
*/
|
|
8107
|
+
declare function removePolicyRulePayload(policyId: string, ruleId: string, idempotencyKey: string): Uint8Array;
|
|
8108
|
+
/**
|
|
8109
|
+
* Canonical bytes a member of the policy's governing signer group endorses
|
|
8110
|
+
* to update a rule's definition. `updatedDefinition` is the rule definition
|
|
8111
|
+
* as a JSON STRING; it is signed opaquely, exactly as sent on the update
|
|
8112
|
+
* request.
|
|
8113
|
+
*/
|
|
8114
|
+
declare function updatePolicyRulePayload(policyId: string, ruleId: string, updatedDefinition: string, idempotencyKey: string): Uint8Array;
|
|
8115
|
+
/**
|
|
8116
|
+
* Canonical bytes a member of the policy's governing signer group endorses
|
|
8117
|
+
* to add a rule to a policy. `action` (e.g. `"allow"`), `ruleType` (e.g.
|
|
8118
|
+
* `"amount_threshold"`), and `definition` (the rule-type-specific config,
|
|
8119
|
+
* in API format) must match the values sent on the add request, or the
|
|
8120
|
+
* endorsement won't verify against it.
|
|
8121
|
+
*/
|
|
8122
|
+
declare function addPolicyRulePayload(policyId: string, action: string, ruleType: string, definition: Record<string, unknown>, idempotencyKey: string): Uint8Array;
|
|
8123
|
+
/**
|
|
8124
|
+
* A {@link MandateSigner} holding a P-256 (ES256) private key in memory.
|
|
8125
|
+
*
|
|
8126
|
+
* Convenient for sandbox and tests; for production, implement
|
|
8127
|
+
* {@link MandateSigner} over your own key custody so the private key never
|
|
8128
|
+
* lives in the process.
|
|
8129
|
+
*/
|
|
8130
|
+
declare class P256MandateSigner implements MandateSigner {
|
|
8131
|
+
private readonly privateKey;
|
|
8132
|
+
private readonly publicKey;
|
|
8133
|
+
private constructor();
|
|
8134
|
+
/**
|
|
8135
|
+
* Generate a fresh P-256 keypair.
|
|
8136
|
+
*/
|
|
8137
|
+
static generate(): P256MandateSigner;
|
|
8138
|
+
/**
|
|
8139
|
+
* Adopt an existing P-256 private key. Accepts a PKCS#8 PEM string, a
|
|
8140
|
+
* DER-encoded PKCS#8 buffer, or a Node {@link KeyObject}.
|
|
8141
|
+
*/
|
|
8142
|
+
static fromPrivateKey(key: KeyObject | string | Uint8Array): P256MandateSigner;
|
|
8143
|
+
/**
|
|
8144
|
+
* base64 PKIX (SPKI) public key — pass this as the signer's registered
|
|
8145
|
+
* public key at agent creation / mandate approval.
|
|
8146
|
+
*/
|
|
8147
|
+
publicKeyBase64(): string;
|
|
8148
|
+
/**
|
|
8149
|
+
* Returns base64( ASN.1 ECDSA signature over SHA-256(payload) ).
|
|
8150
|
+
*/
|
|
8151
|
+
sign(payload: Uint8Array): string;
|
|
8152
|
+
}
|
|
8153
|
+
/**
|
|
8154
|
+
* Check a base64 ASN.1 signature over SHA-256 of the canonical payload
|
|
8155
|
+
* against a base64 PKIX P-256 public key — the platform's exact
|
|
8156
|
+
* verification. Exposed so callers (and tests) can self-check a signature
|
|
8157
|
+
* before submitting it.
|
|
8158
|
+
*
|
|
8159
|
+
* @throws if the public key or signature can't be parsed, or the signature
|
|
8160
|
+
* does not verify against the payload.
|
|
8161
|
+
*/
|
|
8162
|
+
declare function verifyMandateSignature(publicKeyBase64: string, payload: Uint8Array, signatureBase64: string): void;
|
|
8163
|
+
|
|
8164
|
+
/**
|
|
8165
|
+
* RFC 8785 (JCS) canonical JSON — the exact bytes the platform signs.
|
|
8166
|
+
*
|
|
8167
|
+
* A payload canonicalized here matches the platform's `enc.C14nJSON`
|
|
8168
|
+
* (json.Marshal + jsoncanonicalizer.Transform) byte-for-byte, so a
|
|
8169
|
+
* signature produced from the result verifies server-side.
|
|
8170
|
+
*
|
|
8171
|
+
* This implementation covers the value shapes the SDK ever puts into a
|
|
8172
|
+
* signed payload: nulls, booleans, finite integers/floats, strings,
|
|
8173
|
+
* arrays, and plain object maps. It intentionally does NOT handle
|
|
8174
|
+
* non-integer numbers with fractional parts differently from
|
|
8175
|
+
* JSON.stringify, because every mandate/endorsement payload the SDK
|
|
8176
|
+
* produces uses only integers, strings, arrays, and object maps — decimal
|
|
8177
|
+
* amounts are always sent as strings.
|
|
8178
|
+
*/
|
|
8179
|
+
/**
|
|
8180
|
+
* RFC 8785 (JCS) canonicalize `value` and return its bytes as a UTF-8 string.
|
|
8181
|
+
*
|
|
8182
|
+
* @throws if `value` contains a non-finite number, a Symbol, a bigint, or a
|
|
8183
|
+
* circular reference — any of which cannot be encoded to canonical JSON.
|
|
8184
|
+
*/
|
|
8185
|
+
declare function canonicalJSON(value: unknown): string;
|
|
8186
|
+
|
|
8187
|
+
export { APIError, type Account, type AccountCreateRequest, type AccountListParams, type AccountUpdateRequest, AccountsResource, type Address, type AdvanceSimulationRequest, type AdvanceSimulationResult, AgentConversation, type AgenticAction, type AgenticActionDownstream, type AgenticInstruction, type AgenticInstructionsResult, type AgenticProposal, type AgenticProposalsResult, type ApiKey, type ApiKeyCreateRequest, type ApiKeyResponse, ApiKeysResource, type Application, type ApplicationDocumentType, type ApplicationDocumentUploadRequest, type ApplicationDocumentUploadUrlRequest, type ApplicationListItem, type ApplicationStatus, type ApplicationSubmissionRequest, ApplicationsResource, type ApproveMandateRequest, type AssociatedIndividual, type AssociatedIndividualRequest, type AttachedPolicy, type AttachedWallet, type Attachment, type AttachmentMediaType, type AttestationSubmitRequest, type AttestationType, AuthMode, type AutoTransaction, AutoTransactionsResource, type AverageMonthlyRevenue, type BulkImportSumsubTokensRequest, type BulkImportSumsubTokensResponse, type BulkImportSumsubTokensResult, type BusinessApplicationCreateRequest, type BusinessDetailsResponse, type BusinessPurposeOfAccount, type BusinessSourceOfFunds, type CancelMandateRequest, type ChatMessage, type ClientPricingConfig, ConfigurationError, type ConversationTurn, type Country, type CreateApiKeyForClientRequest, type CreateInstructionsRequest, type CreateMandateRequest, type CreateProposalsRequest, type CreateScheduledPaymentRequest, type CryptoDestination, type CryptoDestinationRequest, type CursorExtractor, type Customer, type CustomerCreateRequest, type CustomerCreateResponse, type CustomerListParams, CustomersResource, DEFAULT_RETRY_POLICY, DakotaClient, type DakotaClientConfig, type Destination, type DestinationCreateResponse, type DestinationRequest, DestinationsResource, type DocumentUploadResponse, type DocumentUploadUrlResponse, type EDDRequest, type EDDWithApplicationID, type EmploymentStatus, type EndorsedRequest, Environment, type Event, type EventListParams, type EventType, EventsResource, type ExpectedMonthlyDeposit, type Family, type FiatUSDestination, type FiatUSDestinationRequest, type IndividualDetailsResponse, type IndividualDocumentType, type IndividualDocumentUploadRequest, type IndividualDocumentUploadUrlRequest, type IndividualRequest, type IndividualRole, type IndividualTitle, InfoResource, type InsightChatMessage, type InsightChatRequest, type InsightChatResponse, type InsightEvidence, type InsightItem, type InsightReport, type InsightSnapshot, InsightsResource, InstructionsResource, type KSUID, type KybStatus, type LegalStructure, type ListParams, type Logger, type Mandate, type MandateAction, type MandateListParams, type MandateResponse, type MandateRule, type MandateSigner, MandatesResource, type Meta, type Network, type NetworkId, type OfframpAccount, type OfframpAccountCreateRequest, type OneOffTransaction, type OneOffTransactionRequest, type OnrampAccount, type OnrampAccountCreateRequest, P256MandateSigner, type PageFetcher, PaginatedIterator, type PaginatedResponse, type PaginationMeta, type PaginationParams, type PaymentAgent, type PaymentAgentCreateRequest, type PaymentAgentSignerGroupRef, PaymentAgentsResource, type PaymentCapability, type PersonName, PoliciesResource, type Policy, type PolicyCreateRequest, type PolicyRule, type PolicyRuleCreateRequest, type Recipient, type RecipientRequest, type RecipientUpdateRequest, RecipientsResource, type RequestOptions, type ResolvedConfig, type RetryPolicy, SandboxResource, type SandboxScenario, type ScheduledPayment, type ScheduledPaymentListParams, ScheduledPaymentsResource, type SelfServeCreditTier, type SelfServeCreditTiersResponse, type SelfServeCreditsBalanceResponse, type SelfServeCreditsLedgerEntry, type SelfServeCreditsLedgerEntryType, type SelfServeCreditsLedgerParams, type SelfServeCreditsLedgerResponse, type SelfServeCreditsPricingResponse, type SelfServeCreditsPurchaseRequest, type SelfServeCreditsPurchaseResponse, SelfServeResource, type SendTransactionIntent, type Signer, type SignerCreateRequest, type SignerGroup, type SignerGroupCreateRequest, type SignerGroupSignerAddRequest, SignerGroupsResource, SignersResource, type SimulateInboundRequest, type SimulateInboundType, type SimulateOnboardingRequest, type SimulateOnboardingResponse, type SimulateOnboardingType, type SimulationCallbackRecord, type SimulationInspection, type SimulationResponse, type SubClientSummary, type SwapAccount, type SwapAccountCreateRequest, type TransactionListParams, type TransactionStatus, TransactionsResource, TransportError, type UpdateCustomerSubClientRequest, type UploadedDocumentMetadata, type User, type UserCreateRequest, type UserUpdateRequest, UsersResource, type Wallet, type WalletBalance, type WalletBalances, type WalletCreateRequest, type WalletTransaction, type WalletTransactionRequest, WalletsResource, type WebhookEvent, type WebhookHistoryList, type WebhookHistoryListParams, type WebhookHistoryResponse, type WebhookReplayResponse, type WebhookTarget, type WebhookTargetCreateRequest, type WebhookTargetUpdateRequest, WebhooksResource, addPolicyRulePayload, attachGroupPayload, attachPolicyPayload, attachUserToWallet, canonicalJSON, consoleLogger, deletePolicyPayload, detachGroupPayload, detachPolicyPayload, detachUserFromWallet, getEnvironmentURL, mandateSignPayload, noopLogger, paginate, removePolicyRulePayload, updatePolicyRulePayload, verifyMandateSignature };
|