@stable_sea/sdk 0.2.25 → 0.2.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -340,6 +340,23 @@ const valid = verifyWebhookSignature(
340
340
  );
341
341
  ```
342
342
 
343
+ Subscribe to the lifecycle events you need when creating or updating a webhook
344
+ endpoint:
345
+
346
+ | Event | Meaning |
347
+ | --- | --- |
348
+ | `transfer_approval.created` | A request is pending human approval. |
349
+ | `transfer_approval.updated` | The request reached a terminal approval state. Partial votes do not emit this event. |
350
+ | `withdrawal.created` | A withdrawal request was accepted. |
351
+ | `withdrawal.updated` | The withdrawal completed, failed or was canceled. A later bank return can produce another update. |
352
+
353
+ Events contain resource pointers. Retrieve a withdrawal with
354
+ `GET /v1/withdrawals/{id}`; its current state is authoritative. To read an approval,
355
+ use an authenticated member session and query `/money/transfer_approvals` with
356
+ `request_id`, or `/money/test_transfer_approvals` for Test events. Existing member
357
+ visibility applies. API keys cannot cast human votes. Delivery is asynchronous;
358
+ handle duplicate event IDs and changes that arrive out of order.
359
+
343
360
  API request, response, pagination, and error types are generated from
344
361
  `services/backend/api/openapi.public.json` and exported as `paths`, `operations`,
345
362
  and `components`.
@@ -575,3 +592,43 @@ adopt new/reclassified assets, review `fund_catalog_changes`, then use the curre
575
592
  Preview checks saved settings and does not authorize execution. API keys do not
576
593
  act as the key owner's member; machine `/v1/policies` remains business controls
577
594
  and tiers, without member-policy administration.
595
+
596
+
597
+ ## Withdraw funds
598
+
599
+ Create a key with **Withdraw funds** (`money:withdrawals_write`) and **Read money**
600
+ (`money:read`) in Terminal's existing API keys pane. Test keys use the same
601
+ workflow with simulated funds and do not require a two-factor code.
602
+
603
+ For on-chain withdrawals, list `/v1/external_wallets` and select an enabled saved
604
+ destination. Its `symbol` identifies the withdrawal asset and `payment_rail` the
605
+ network; holdings can contain other assets. Submit `/v1/withdrawals` with
606
+ `method: "onchain"`, `external_wallet` and an amount in that asset's units.
607
+
608
+ For US ACH or domestic wire, create `/v1/withdrawal_quotes` with `method: "ach"`
609
+ or `"wire"`, the saved `bank_account` ID and a USD decimal amount with at most two fractional digits.
610
+ Retrieve the quote until `status` is `ready`, review `pricing`, then submit
611
+ `/v1/withdrawals` with the same method, bank and amount plus `quote_id`. Quotes
612
+ expire after five minutes and serve one withdrawal. Acceptance queues work without
613
+ booking funds. Processing must begin before `expires_ts`; queue delay or retries
614
+ can produce `quote_invalid`. Pending human approval preserves those fee terms
615
+ after quote expiry.
616
+
617
+ Use a stable `Idempotency-Key` for each write. Retrieve the withdrawal to follow
618
+ its status. `pending_approval` requires a human decision through the existing
619
+ approval workflow; it reserves no funds. Once booked, `transaction_id` links to
620
+ the native transaction and its settlement details. Request cancellation with
621
+ `POST /v1/withdrawals/{id}/cancel` while pending; `canceling` is not confirmation.
622
+ Wait for `canceled`, or follow the transaction if booking already won the race.
623
+ Cancellation requires the credential that created the withdrawal. A replacement
624
+ key can read the business's withdrawals but cannot cancel its predecessor's requests.
625
+
626
+ A failed bank payout can require recovery after conversion. `failed` does not
627
+ mean the principal has been refunded or is available to spend. A confirmed ACH
628
+ return also makes the original operation `failed` while preserving its settled
629
+ ledger entries. Read the transaction's `financial_details` for fee recovery;
630
+ a queued fee refund is separate from both principal recovery and a settled refund.
631
+
632
+ The [Sandbox test project](consumer-test/README.md#test-a-withdrawal) includes
633
+ `npm run test:withdrawal` for a saved Test destination. It preserves request keys
634
+ and receipts so an interrupted run can resume without creating a new withdrawal.
@@ -1105,6 +1105,114 @@ export interface paths {
1105
1105
  patch?: never;
1106
1106
  trace?: never;
1107
1107
  };
1108
+ "/v1/withdrawal_quotes": {
1109
+ parameters: {
1110
+ query?: never;
1111
+ header?: never;
1112
+ path?: never;
1113
+ cookie?: never;
1114
+ };
1115
+ get?: never;
1116
+ put?: never;
1117
+ /**
1118
+ * Create a withdrawal quote
1119
+ * @description Quotes an ACH or US domestic wire withdrawal to a saved US bank account. No money moves. Poll until ready, then submit the exact method, bank and amount with its quote_id before expiry. One quote serves one withdrawal; retries do not extend expiry. On-chain withdrawals use their saved wallet directly and do not require a bank quote.
1120
+ */
1121
+ post: operations["withdrawal_quotes.create"];
1122
+ delete?: never;
1123
+ options?: never;
1124
+ head?: never;
1125
+ patch?: never;
1126
+ trace?: never;
1127
+ };
1128
+ "/v1/withdrawal_quotes/{id}": {
1129
+ parameters: {
1130
+ query?: never;
1131
+ header?: never;
1132
+ path?: never;
1133
+ cookie?: never;
1134
+ };
1135
+ /**
1136
+ * Retrieve a withdrawal quote
1137
+ * @description Returns a bank withdrawal quote belonging to this business and API mode. Expiry remains fixed even when a ready quote is retrieved again.
1138
+ */
1139
+ get: operations["withdrawal_quotes.get"];
1140
+ put?: never;
1141
+ post?: never;
1142
+ delete?: never;
1143
+ options?: never;
1144
+ head?: never;
1145
+ patch?: never;
1146
+ trace?: never;
1147
+ };
1148
+ "/v1/withdrawals": {
1149
+ parameters: {
1150
+ query?: never;
1151
+ header?: never;
1152
+ path?: never;
1153
+ cookie?: never;
1154
+ };
1155
+ /**
1156
+ * List withdrawals
1157
+ * @description Lists this business's API withdrawals, newest first. Filter by method or paginate with one withdrawal ID cursor at a time. Native transaction history remains available separately.
1158
+ */
1159
+ get: operations["withdrawals.list"];
1160
+ put?: never;
1161
+ /**
1162
+ * Create a withdrawal
1163
+ * @description Queues a withdrawal to a saved external wallet or US bank account. Requires money:withdrawals_write and an Idempotency-Key. Reuse the same key and body after a lost response to recover the original request.
1164
+ *
1165
+ * Eligibility, funds, fees, limits and approval rules are enforced before booking. Pending human approval does not reserve funds; use the member client or Terminal to decide it. Follow status and transaction_id through settlement.
1166
+ *
1167
+ * For ACH and wire, processing must start before the quote's expires_ts. Queue delay or retries can produce quote_invalid after acceptance. Once human approval is pending, its agreed fees remain valid after quote expiry.
1168
+ */
1169
+ post: operations["withdrawals.create"];
1170
+ delete?: never;
1171
+ options?: never;
1172
+ head?: never;
1173
+ patch?: never;
1174
+ trace?: never;
1175
+ };
1176
+ "/v1/withdrawals/{id}": {
1177
+ parameters: {
1178
+ query?: never;
1179
+ header?: never;
1180
+ path?: never;
1181
+ cookie?: never;
1182
+ };
1183
+ /**
1184
+ * Retrieve a withdrawal
1185
+ * @description Returns one withdrawal, its retained approval reference and its native transaction outcome. A withdrawal belonging to another business or API mode is not found.
1186
+ */
1187
+ get: operations["withdrawals.get"];
1188
+ put?: never;
1189
+ post?: never;
1190
+ delete?: never;
1191
+ options?: never;
1192
+ head?: never;
1193
+ patch?: never;
1194
+ trace?: never;
1195
+ };
1196
+ "/v1/withdrawals/{id}/cancel": {
1197
+ parameters: {
1198
+ query?: never;
1199
+ header?: never;
1200
+ path?: never;
1201
+ cookie?: never;
1202
+ };
1203
+ get?: never;
1204
+ put?: never;
1205
+ /**
1206
+ * Cancel a withdrawal
1207
+ * @description Requests cancellation of an unbooked withdrawal created by this credential. Poll until canceled or another final outcome. Cancellation is asynchronous: a concurrent final approval or booking can win, in which case the withdrawal continues and its transaction remains visible. A booked withdrawal cannot be canceled.
1208
+ */
1209
+ post: operations["withdrawals.cancel"];
1210
+ delete?: never;
1211
+ options?: never;
1212
+ head?: never;
1213
+ patch?: never;
1214
+ trace?: never;
1215
+ };
1108
1216
  }
1109
1217
  export type webhooks = Record<string, never>;
1110
1218
  export interface components {
@@ -1463,7 +1571,7 @@ export interface components {
1463
1571
  object: "list";
1464
1572
  };
1465
1573
  /** @enum {string} */
1466
- EventTypeName: "bank_account.created" | "bank_account.removed" | "bank_account_operation.updated" | "deposit.updated" | "deposit_quote.updated" | "external_wallet.created" | "external_wallet.updated" | "external_wallet_operation.updated" | "notification.created" | "order.updated" | "source_wallet_declaration.updated" | "statement_generation.updated" | "transaction.created" | "transaction.updated";
1574
+ EventTypeName: "bank_account.created" | "bank_account.removed" | "bank_account_operation.updated" | "deposit.updated" | "deposit_quote.updated" | "external_wallet.created" | "external_wallet.updated" | "external_wallet_operation.updated" | "notification.created" | "order.updated" | "source_wallet_declaration.updated" | "statement_generation.updated" | "transaction.created" | "transaction.updated" | "transfer_approval.created" | "transfer_approval.updated" | "withdrawal.created" | "withdrawal.updated";
1467
1575
  ExternalWallet: {
1468
1576
  /** @description True when a Stable Sea operator registered this wallet for the business; false when the business added it itself. */
1469
1577
  added_by_stable_sea: boolean;
@@ -1508,6 +1616,8 @@ export interface components {
1508
1616
  * @enum {string}
1509
1617
  */
1510
1618
  status: "enabled" | "disabled";
1619
+ /** @description The asset this saved destination accepts for withdrawals. Address-level holdings can contain other assets. */
1620
+ symbol: string;
1511
1621
  };
1512
1622
  ExternalWalletCreateInput: {
1513
1623
  address: string;
@@ -2793,6 +2903,82 @@ export interface components {
2793
2903
  enabled_events?: components["schemas"]["EventTypeName"][];
2794
2904
  url?: string | null;
2795
2905
  };
2906
+ Withdrawal: {
2907
+ amount: string;
2908
+ approval_request_id: string | null;
2909
+ bank_account: string | null;
2910
+ /** Format: date-time */
2911
+ created_ts: string;
2912
+ external_wallet: string | null;
2913
+ failure_code?: string;
2914
+ id: string;
2915
+ livemode: boolean;
2916
+ /** @enum {string} */
2917
+ method: "onchain" | "ach" | "wire";
2918
+ /** @enum {string} */
2919
+ object: "withdrawal";
2920
+ quote_id: string | null;
2921
+ /** @enum {string} */
2922
+ status: "pending" | "pending_approval" | "canceling" | "processing" | "completed" | "failed" | "canceled";
2923
+ transaction_id: string | null;
2924
+ };
2925
+ WithdrawalFeeTerms: {
2926
+ bank_fee_usd: string;
2927
+ /** Format: int64 */
2928
+ bps: number;
2929
+ caps_at_par: boolean;
2930
+ conversion_input: string;
2931
+ estimated_conversion_rate?: string | null;
2932
+ estimated_proceeds?: string | null;
2933
+ platform_fee_usdc: string;
2934
+ /** @enum {string} */
2935
+ settlement_asset: "USD";
2936
+ settles_at_par: boolean;
2937
+ /** @enum {string} */
2938
+ source_symbol: "USDC";
2939
+ total_source_debit: string;
2940
+ };
2941
+ WithdrawalInput: {
2942
+ /** @description Principal excluding fees: USD for ACH/wire, or units of the saved wallet's asset for on-chain withdrawals. */
2943
+ amount: string;
2944
+ bank_account?: string;
2945
+ external_wallet?: string;
2946
+ /** @enum {string} */
2947
+ method: "onchain" | "ach" | "wire";
2948
+ /** @description A ready, unexpired quote for this exact bank, method and amount. Required for ACH/wire; omit for on-chain withdrawals. */
2949
+ quote_id?: string | null;
2950
+ };
2951
+ WithdrawalList: {
2952
+ data: components["schemas"]["Withdrawal"][];
2953
+ has_more: boolean;
2954
+ /** @enum {string} */
2955
+ object: "list";
2956
+ };
2957
+ WithdrawalQuote: {
2958
+ amount: string;
2959
+ bank_account: string;
2960
+ /** Format: date-time */
2961
+ created_ts: string;
2962
+ /** Format: date-time */
2963
+ expires_ts: string;
2964
+ failure_code?: string;
2965
+ id: string;
2966
+ livemode: boolean;
2967
+ /** @enum {string} */
2968
+ method: "ach" | "wire";
2969
+ /** @enum {string} */
2970
+ object: "withdrawal_quote";
2971
+ pricing: components["schemas"]["WithdrawalFeeTerms"] | null;
2972
+ /** @enum {string} */
2973
+ status: "pending" | "ready" | "failed";
2974
+ };
2975
+ WithdrawalQuoteInput: {
2976
+ /** @description USD principal in whole cents, excluding fees. */
2977
+ amount: string;
2978
+ bank_account: string;
2979
+ /** @enum {string} */
2980
+ method: "ach" | "wire";
2981
+ };
2796
2982
  };
2797
2983
  responses: {
2798
2984
  /** @description Invalid input, version, account directive, or idempotency header. Correct the request before retrying. */
@@ -5070,4 +5256,248 @@ export interface operations {
5070
5256
  };
5071
5257
  };
5072
5258
  };
5259
+ "withdrawal_quotes.create": {
5260
+ parameters: {
5261
+ query?: never;
5262
+ header: {
5263
+ "Idempotency-Key": components["parameters"]["Idempotency-Key"];
5264
+ };
5265
+ path?: never;
5266
+ cookie?: never;
5267
+ };
5268
+ requestBody?: {
5269
+ content: {
5270
+ "application/json": components["schemas"]["WithdrawalQuoteInput"];
5271
+ };
5272
+ };
5273
+ responses: {
5274
+ /** @description OK */
5275
+ 200: {
5276
+ headers: {
5277
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
5278
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
5279
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
5280
+ [name: string]: unknown;
5281
+ };
5282
+ content: {
5283
+ "application/json": components["schemas"]["WithdrawalQuote"];
5284
+ };
5285
+ };
5286
+ 400: components["responses"]["Error400"];
5287
+ 401: components["responses"]["Error401"];
5288
+ 403: components["responses"]["Error403"];
5289
+ 409: components["responses"]["Error409"];
5290
+ 429: components["responses"]["Error429"];
5291
+ /** @description Error response. */
5292
+ default: {
5293
+ headers: {
5294
+ [name: string]: unknown;
5295
+ };
5296
+ content: {
5297
+ "application/json": components["schemas"]["Error"];
5298
+ };
5299
+ };
5300
+ };
5301
+ };
5302
+ "withdrawal_quotes.get": {
5303
+ parameters: {
5304
+ query?: never;
5305
+ header?: never;
5306
+ path: {
5307
+ id: string;
5308
+ };
5309
+ cookie?: never;
5310
+ };
5311
+ requestBody?: never;
5312
+ responses: {
5313
+ /** @description OK */
5314
+ 200: {
5315
+ headers: {
5316
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
5317
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
5318
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
5319
+ [name: string]: unknown;
5320
+ };
5321
+ content: {
5322
+ "application/json": components["schemas"]["WithdrawalQuote"];
5323
+ };
5324
+ };
5325
+ 400: components["responses"]["Error400"];
5326
+ 401: components["responses"]["Error401"];
5327
+ 403: components["responses"]["Error403"];
5328
+ 429: components["responses"]["Error429"];
5329
+ /** @description Error response. */
5330
+ default: {
5331
+ headers: {
5332
+ [name: string]: unknown;
5333
+ };
5334
+ content: {
5335
+ "application/json": components["schemas"]["Error"];
5336
+ };
5337
+ };
5338
+ };
5339
+ };
5340
+ "withdrawals.list": {
5341
+ parameters: {
5342
+ query?: {
5343
+ limit?: number;
5344
+ starting_after?: string;
5345
+ ending_before?: string;
5346
+ method?: "onchain" | "ach" | "wire";
5347
+ };
5348
+ header?: never;
5349
+ path?: never;
5350
+ cookie?: never;
5351
+ };
5352
+ requestBody?: never;
5353
+ responses: {
5354
+ /** @description OK */
5355
+ 200: {
5356
+ headers: {
5357
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
5358
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
5359
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
5360
+ [name: string]: unknown;
5361
+ };
5362
+ content: {
5363
+ "application/json": components["schemas"]["WithdrawalList"];
5364
+ };
5365
+ };
5366
+ 400: components["responses"]["Error400"];
5367
+ 401: components["responses"]["Error401"];
5368
+ 403: components["responses"]["Error403"];
5369
+ 429: components["responses"]["Error429"];
5370
+ /** @description Error response. */
5371
+ default: {
5372
+ headers: {
5373
+ [name: string]: unknown;
5374
+ };
5375
+ content: {
5376
+ "application/json": components["schemas"]["Error"];
5377
+ };
5378
+ };
5379
+ };
5380
+ };
5381
+ "withdrawals.create": {
5382
+ parameters: {
5383
+ query?: never;
5384
+ header: {
5385
+ "Idempotency-Key": components["parameters"]["Idempotency-Key"];
5386
+ };
5387
+ path?: never;
5388
+ cookie?: never;
5389
+ };
5390
+ requestBody?: {
5391
+ content: {
5392
+ "application/json": components["schemas"]["WithdrawalInput"];
5393
+ };
5394
+ };
5395
+ responses: {
5396
+ /** @description OK */
5397
+ 200: {
5398
+ headers: {
5399
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
5400
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
5401
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
5402
+ [name: string]: unknown;
5403
+ };
5404
+ content: {
5405
+ "application/json": components["schemas"]["Withdrawal"];
5406
+ };
5407
+ };
5408
+ 400: components["responses"]["Error400"];
5409
+ 401: components["responses"]["Error401"];
5410
+ 403: components["responses"]["Error403"];
5411
+ 409: components["responses"]["Error409"];
5412
+ 429: components["responses"]["Error429"];
5413
+ /** @description Error response. */
5414
+ default: {
5415
+ headers: {
5416
+ [name: string]: unknown;
5417
+ };
5418
+ content: {
5419
+ "application/json": components["schemas"]["Error"];
5420
+ };
5421
+ };
5422
+ };
5423
+ };
5424
+ "withdrawals.get": {
5425
+ parameters: {
5426
+ query?: never;
5427
+ header?: never;
5428
+ path: {
5429
+ id: string;
5430
+ };
5431
+ cookie?: never;
5432
+ };
5433
+ requestBody?: never;
5434
+ responses: {
5435
+ /** @description OK */
5436
+ 200: {
5437
+ headers: {
5438
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
5439
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
5440
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
5441
+ [name: string]: unknown;
5442
+ };
5443
+ content: {
5444
+ "application/json": components["schemas"]["Withdrawal"];
5445
+ };
5446
+ };
5447
+ 400: components["responses"]["Error400"];
5448
+ 401: components["responses"]["Error401"];
5449
+ 403: components["responses"]["Error403"];
5450
+ 429: components["responses"]["Error429"];
5451
+ /** @description Error response. */
5452
+ default: {
5453
+ headers: {
5454
+ [name: string]: unknown;
5455
+ };
5456
+ content: {
5457
+ "application/json": components["schemas"]["Error"];
5458
+ };
5459
+ };
5460
+ };
5461
+ };
5462
+ "withdrawals.cancel": {
5463
+ parameters: {
5464
+ query?: never;
5465
+ header: {
5466
+ "Idempotency-Key": components["parameters"]["Idempotency-Key"];
5467
+ };
5468
+ path: {
5469
+ id: string;
5470
+ };
5471
+ cookie?: never;
5472
+ };
5473
+ requestBody?: never;
5474
+ responses: {
5475
+ /** @description OK */
5476
+ 200: {
5477
+ headers: {
5478
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
5479
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
5480
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
5481
+ [name: string]: unknown;
5482
+ };
5483
+ content: {
5484
+ "application/json": components["schemas"]["Withdrawal"];
5485
+ };
5486
+ };
5487
+ 400: components["responses"]["Error400"];
5488
+ 401: components["responses"]["Error401"];
5489
+ 403: components["responses"]["Error403"];
5490
+ 409: components["responses"]["Error409"];
5491
+ 429: components["responses"]["Error429"];
5492
+ /** @description Error response. */
5493
+ default: {
5494
+ headers: {
5495
+ [name: string]: unknown;
5496
+ };
5497
+ content: {
5498
+ "application/json": components["schemas"]["Error"];
5499
+ };
5500
+ };
5501
+ };
5502
+ };
5073
5503
  }
@@ -1644,8 +1644,8 @@ export interface paths {
1644
1644
  cookie?: never;
1645
1645
  };
1646
1646
  /**
1647
- * List onchain whitelisted addresses (business)
1648
- * @description Business-scoped cursor-paginated list of whitelisted external addresses for the caller's group. Set customer_visible_only to list only the wallets the customer connected, excluding the platform rails provisioned into the group.
1647
+ * List saved on-chain destinations
1648
+ * @description Lists the business's saved on-chain destinations. Set `customer_visible_only=true` to exclude platform-provisioned rails. Use a destination's `id` as `account_id` when submitting an on-chain withdrawal; its asset, network, address and memo are resolved from that saved account. Listing a destination does not guarantee withdrawal eligibility. Submission rechecks its current status, screening, network and financial controls. Use `next_cursor` as `cursor` to read the next page.
1649
1649
  */
1650
1650
  get: operations["money.accounts.whitelist.list"];
1651
1651
  put?: never;
@@ -1784,6 +1784,28 @@ export interface paths {
1784
1784
  patch?: never;
1785
1785
  trace?: never;
1786
1786
  };
1787
+ "/money/onchain/withdrawals": {
1788
+ parameters: {
1789
+ query?: never;
1790
+ header?: never;
1791
+ path?: never;
1792
+ cookie?: never;
1793
+ };
1794
+ get?: never;
1795
+ put?: never;
1796
+ /**
1797
+ * Create an on-chain withdrawal
1798
+ * @description Creates a withdrawal to an existing allowlisted external-wallet account. The account supplies the asset, network, address and any memo; raw destination addresses are not accepted. Requires business verification and `funds_withdraw`, plus the current network, compliance, balance and approval checks.
1799
+ *
1800
+ * An `approval_pending` outcome contains the approval request and moves no money. A `created` outcome identifies the booked movement; it does not mean settlement has completed. Keep the same `Idempotency-Key` and body after an uncertain submission; a duplicate returns 409.
1801
+ */
1802
+ post: operations["money.onchain.withdrawals.create"];
1803
+ delete?: never;
1804
+ options?: never;
1805
+ head?: never;
1806
+ patch?: never;
1807
+ trace?: never;
1808
+ };
1787
1809
  "/money/test_approval_rules": {
1788
1810
  parameters: {
1789
1811
  query?: never;
@@ -3790,14 +3812,113 @@ export interface components {
3790
3812
  contents?: string;
3791
3813
  found?: boolean;
3792
3814
  };
3793
- /** @enum {string} */
3794
- MoneyMovementsTransferApprovalStatus: "pending" | "approved" | "denied" | "cancelled" | "expired" | "policy_changed" | "failed";
3795
- Page_MoneyMovementsTransferApprovalView: {
3796
- data: components["schemas"]["MoneyMovementsTransferApprovalView"][] | null;
3797
- has_more: boolean;
3798
- next_cursor: string | null;
3799
- total_count?: number | null;
3815
+ MoneyMovementsCreateOnchainWithdrawalInput: {
3816
+ account_id: string;
3817
+ amount: string;
3818
+ };
3819
+ MoneyMovementsCreateMoneyMovementOutput: {
3820
+ money_movement_id?: string;
3821
+ /** @enum {string} */
3822
+ outcome?: "created" | "approval_pending";
3823
+ transaction?: components["schemas"]["MoneyMovementsMoneyMovementView"];
3824
+ transfer_approval?: components["schemas"]["MoneyMovementsTransferApprovalView"];
3825
+ };
3826
+ MoneyMovementsMoneyMovementView: {
3827
+ automation_id?: string | null;
3828
+ complete: boolean;
3829
+ /** Format: date-time */
3830
+ completed_ts?: string;
3831
+ created_by: string;
3832
+ /** Format: date-time */
3833
+ created_ts: string;
3834
+ /** Format: date-time */
3835
+ failed_ts?: string;
3836
+ fee?: components["schemas"]["MoneyfmtMoneyAmountView"];
3837
+ fund_symbol?: string;
3838
+ group_id: string;
3839
+ id: string;
3840
+ input: components["schemas"]["MoneyMovementsTransactionSideView"];
3841
+ metadata: components["schemas"]["MoneyMovementsMovementMetadataView"];
3842
+ /** @description Whether net_amount_view can still move. True while the cash leg it is computed from is neither final nor the figure the customer named at order entry, in which case the settled net is for now the quoted one. Always false on a fund buy, whose cash figure the customer fixed when placing the order; a BTC trade order gets no such exemption in either direction. False when there is no net amount at all, so read it only alongside net_amount_view. */
3843
+ net_amount_estimated?: boolean;
3844
+ net_amount_view?: components["schemas"]["MoneyfmtMoneyAmountView"];
3845
+ /** Format: date-time */
3846
+ occurred_ts: string;
3847
+ offramp_amounts?: components["schemas"]["MoneyMovementsOfframpAmountsView"];
3848
+ onchain_transactions?: components["schemas"]["MoneyMovementsOnchainTransactionView"][];
3849
+ onramp_amounts?: components["schemas"]["MoneyMovementsOnrampAmountsView"];
3850
+ output: components["schemas"]["MoneyMovementsTransactionSideView"];
3851
+ /** @description Whether price_per_unit_view was derived from a leg whose figure is not final, so the price can still move. True until both the cash leg and the share leg are final, because a fund trade prices at the net asset value struck at settlement; either leg alone is enough. False when there is no price at all, so read it only alongside price_per_unit_view. */
3852
+ price_per_unit_estimated?: boolean;
3853
+ price_per_unit_view?: components["schemas"]["MoneyfmtMoneyAmountView"];
3854
+ quoted_net_amount_view?: components["schemas"]["MoneyfmtMoneyAmountView"];
3855
+ quoted_price_per_unit_view?: components["schemas"]["MoneyfmtMoneyAmountView"];
3856
+ ramp_fee_returns?: components["schemas"]["MoneyMovementsRampFeeReturnsView"];
3857
+ settlement_commission_view?: components["schemas"]["MoneyfmtMoneyAmountView"];
3858
+ settlement_pathway?: string;
3859
+ /** Format: date-time */
3860
+ settlement_ts?: string;
3861
+ status: components["schemas"]["MoneyenumLifecycleStatus"];
3862
+ transaction_count: number;
3863
+ type: string;
3800
3864
  };
3865
+ MoneyMovementsTransactionSideView: {
3866
+ amount: components["schemas"]["MoneyfmtMoneyAmountView"];
3867
+ /** @description Whether amount is still an estimate — the leg's quoted subtotal, carried because the leg's figure is not final. True means the figure can still move and must be presented as an estimate rather than as a settled one. False means it can no longer change, either because the leg reached a terminal state or because it carries the figure the customer named at order entry (a fund buy's dollars, a fund sell's shares); it does not promise the figure was observed. */
3868
+ amount_estimated: boolean;
3869
+ money_account_id: string;
3870
+ money_symbol: string;
3871
+ payment_rail?: string;
3872
+ quoted_amount?: components["schemas"]["MoneyfmtMoneyAmountView"];
3873
+ };
3874
+ MoneyMovementsMovementMetadataView: {
3875
+ created_by: string;
3876
+ /** Format: date-time */
3877
+ created_ts: string;
3878
+ /** Format: date-time */
3879
+ updated_ts: string;
3880
+ };
3881
+ MoneyMovementsOfframpAmountsView: {
3882
+ bank_fee_usd: string;
3883
+ collected_platform_fee_usdc: string;
3884
+ /** @enum {string} */
3885
+ collection_status: "not_needed" | "pending" | "collected" | "failed";
3886
+ payout_delivered: boolean;
3887
+ payout_estimated: boolean;
3888
+ payout_usd: string;
3889
+ platform_fee_usdc: string;
3890
+ total_debit_usdc: string;
3891
+ };
3892
+ MoneyMovementsOnchainTransactionView: {
3893
+ chain?: string;
3894
+ explorer_url?: string;
3895
+ tx_hash: string;
3896
+ };
3897
+ MoneyMovementsOnrampAmountsView: {
3898
+ collected_platform_fee_usdc: string;
3899
+ /** @enum {string} */
3900
+ collection_status: "not_needed" | "pending" | "collected" | "failed" | "insufficient_proceeds";
3901
+ /** Format: date-time */
3902
+ first_observed_ts?: string | null;
3903
+ gross_deposit_usd: string;
3904
+ gross_proceeds_usdc: string;
3905
+ net_usdc: string;
3906
+ platform_fee_usdc: string;
3907
+ pricing_basis?: string | null;
3908
+ /** Format: date-time */
3909
+ pricing_ts?: string | null;
3910
+ proceeds_available: boolean;
3911
+ proceeds_estimated: boolean;
3912
+ };
3913
+ MoneyMovementsRampFeeReturnsView: {
3914
+ original_movement_id?: string | null;
3915
+ refund_movement_ids: string[] | null;
3916
+ refunded: boolean;
3917
+ refunded_usdc: string;
3918
+ waived: boolean;
3919
+ };
3920
+ /** @enum {string} */
3921
+ MoneyenumLifecycleStatus: "pending" | "completed" | "failed";
3801
3922
  MoneyMovementsTransferApprovalView: {
3802
3923
  also_required_ind_id?: string | null;
3803
3924
  also_required_name?: string;
@@ -3903,6 +4024,8 @@ export interface components {
3903
4024
  /** @enum {string} */
3904
4025
  source_network?: "ethereum" | "stellar";
3905
4026
  };
4027
+ /** @enum {string} */
4028
+ MoneyMovementsTransferApprovalStatus: "pending" | "approved" | "denied" | "cancelled" | "expired" | "policy_changed" | "failed";
3906
4029
  MoneyMovementsTransferApprovalVoteView: {
3907
4030
  approver?: string;
3908
4031
  /** @description Approver full name from historical business membership; a team member when identity is unavailable. Display only, independent of current voting eligibility. */
@@ -3915,6 +4038,12 @@ export interface components {
3915
4038
  };
3916
4039
  /** @enum {string} */
3917
4040
  MoneyenumTransferApprovalVoteDecision: "approved" | "denied";
4041
+ Page_MoneyMovementsTransferApprovalView: {
4042
+ data: components["schemas"]["MoneyMovementsTransferApprovalView"][] | null;
4043
+ has_more: boolean;
4044
+ next_cursor: string | null;
4045
+ total_count?: number | null;
4046
+ };
3918
4047
  MoneyMovementsApproveTransferApprovalInput: {
3919
4048
  /** @description Optional plain-text comment, at most 500 characters; recorded with the successful decision. */
3920
4049
  note?: string;
@@ -3962,102 +4091,6 @@ export interface components {
3962
4091
  transaction?: components["schemas"]["MoneyMovementsMoneyMovementView"];
3963
4092
  transfer_approval?: components["schemas"]["MoneyMovementsTransferApprovalView"];
3964
4093
  };
3965
- MoneyMovementsMoneyMovementView: {
3966
- automation_id?: string | null;
3967
- complete: boolean;
3968
- /** Format: date-time */
3969
- completed_ts?: string;
3970
- created_by: string;
3971
- /** Format: date-time */
3972
- created_ts: string;
3973
- /** Format: date-time */
3974
- failed_ts?: string;
3975
- fee?: components["schemas"]["MoneyfmtMoneyAmountView"];
3976
- fund_symbol?: string;
3977
- group_id: string;
3978
- id: string;
3979
- input: components["schemas"]["MoneyMovementsTransactionSideView"];
3980
- metadata: components["schemas"]["MoneyMovementsMovementMetadataView"];
3981
- /** @description Whether net_amount_view can still move. True while the cash leg it is computed from is neither final nor the figure the customer named at order entry, in which case the settled net is for now the quoted one. Always false on a fund buy, whose cash figure the customer fixed when placing the order; a BTC trade order gets no such exemption in either direction. False when there is no net amount at all, so read it only alongside net_amount_view. */
3982
- net_amount_estimated?: boolean;
3983
- net_amount_view?: components["schemas"]["MoneyfmtMoneyAmountView"];
3984
- /** Format: date-time */
3985
- occurred_ts: string;
3986
- offramp_amounts?: components["schemas"]["MoneyMovementsOfframpAmountsView"];
3987
- onchain_transactions?: components["schemas"]["MoneyMovementsOnchainTransactionView"][];
3988
- onramp_amounts?: components["schemas"]["MoneyMovementsOnrampAmountsView"];
3989
- output: components["schemas"]["MoneyMovementsTransactionSideView"];
3990
- /** @description Whether price_per_unit_view was derived from a leg whose figure is not final, so the price can still move. True until both the cash leg and the share leg are final, because a fund trade prices at the net asset value struck at settlement; either leg alone is enough. False when there is no price at all, so read it only alongside price_per_unit_view. */
3991
- price_per_unit_estimated?: boolean;
3992
- price_per_unit_view?: components["schemas"]["MoneyfmtMoneyAmountView"];
3993
- quoted_net_amount_view?: components["schemas"]["MoneyfmtMoneyAmountView"];
3994
- quoted_price_per_unit_view?: components["schemas"]["MoneyfmtMoneyAmountView"];
3995
- ramp_fee_returns?: components["schemas"]["MoneyMovementsRampFeeReturnsView"];
3996
- settlement_commission_view?: components["schemas"]["MoneyfmtMoneyAmountView"];
3997
- settlement_pathway?: string;
3998
- /** Format: date-time */
3999
- settlement_ts?: string;
4000
- status: components["schemas"]["MoneyenumLifecycleStatus"];
4001
- transaction_count: number;
4002
- type: string;
4003
- };
4004
- MoneyMovementsTransactionSideView: {
4005
- amount: components["schemas"]["MoneyfmtMoneyAmountView"];
4006
- /** @description Whether amount is still an estimate — the leg's quoted subtotal, carried because the leg's figure is not final. True means the figure can still move and must be presented as an estimate rather than as a settled one. False means it can no longer change, either because the leg reached a terminal state or because it carries the figure the customer named at order entry (a fund buy's dollars, a fund sell's shares); it does not promise the figure was observed. */
4007
- amount_estimated: boolean;
4008
- money_account_id: string;
4009
- money_symbol: string;
4010
- payment_rail?: string;
4011
- quoted_amount?: components["schemas"]["MoneyfmtMoneyAmountView"];
4012
- };
4013
- MoneyMovementsMovementMetadataView: {
4014
- created_by: string;
4015
- /** Format: date-time */
4016
- created_ts: string;
4017
- /** Format: date-time */
4018
- updated_ts: string;
4019
- };
4020
- MoneyMovementsOfframpAmountsView: {
4021
- bank_fee_usd: string;
4022
- collected_platform_fee_usdc: string;
4023
- /** @enum {string} */
4024
- collection_status: "not_needed" | "pending" | "collected" | "failed";
4025
- payout_delivered: boolean;
4026
- payout_estimated: boolean;
4027
- payout_usd: string;
4028
- platform_fee_usdc: string;
4029
- total_debit_usdc: string;
4030
- };
4031
- MoneyMovementsOnchainTransactionView: {
4032
- chain?: string;
4033
- explorer_url?: string;
4034
- tx_hash: string;
4035
- };
4036
- MoneyMovementsOnrampAmountsView: {
4037
- collected_platform_fee_usdc: string;
4038
- /** @enum {string} */
4039
- collection_status: "not_needed" | "pending" | "collected" | "failed" | "insufficient_proceeds";
4040
- /** Format: date-time */
4041
- first_observed_ts?: string | null;
4042
- gross_deposit_usd: string;
4043
- gross_proceeds_usdc: string;
4044
- net_usdc: string;
4045
- platform_fee_usdc: string;
4046
- pricing_basis?: string | null;
4047
- /** Format: date-time */
4048
- pricing_ts?: string | null;
4049
- proceeds_available: boolean;
4050
- proceeds_estimated: boolean;
4051
- };
4052
- MoneyMovementsRampFeeReturnsView: {
4053
- original_movement_id?: string | null;
4054
- refund_movement_ids: string[] | null;
4055
- refunded: boolean;
4056
- refunded_usdc: string;
4057
- waived: boolean;
4058
- };
4059
- /** @enum {string} */
4060
- MoneyenumLifecycleStatus: "pending" | "completed" | "failed";
4061
4094
  TradesPreviewBtcTradeFeeOutput: {
4062
4095
  below_minimum?: boolean;
4063
4096
  estimated_quantity?: string;
@@ -4083,13 +4116,6 @@ export interface components {
4083
4116
  TradesSettlementSource: "platform" | "stellar";
4084
4117
  /** @enum {string} */
4085
4118
  TradesSettlementPreference: "standard" | "instant";
4086
- MoneyMovementsCreateMoneyMovementOutput: {
4087
- money_movement_id?: string;
4088
- /** @enum {string} */
4089
- outcome?: "created" | "approval_pending";
4090
- transaction?: components["schemas"]["MoneyMovementsMoneyMovementView"];
4091
- transfer_approval?: components["schemas"]["MoneyMovementsTransferApprovalView"];
4092
- };
4093
4119
  /** @enum {string} */
4094
4120
  TradesTradeSymbol: "BTC" | "WTGXX" | "FLTTX" | "WTSIX";
4095
4121
  TradesGetPathwayAvailabilityOutput: {
@@ -10140,6 +10166,87 @@ export interface operations {
10140
10166
  };
10141
10167
  };
10142
10168
  };
10169
+ "money.onchain.withdrawals.create": {
10170
+ parameters: {
10171
+ query?: never;
10172
+ header: {
10173
+ /** @description Required client idempotency key; a duplicate submission with the same key is rejected with 409. */
10174
+ "Idempotency-Key": string;
10175
+ };
10176
+ path?: never;
10177
+ cookie?: never;
10178
+ };
10179
+ requestBody?: {
10180
+ content: {
10181
+ "application/json": components["schemas"]["MoneyMovementsCreateOnchainWithdrawalInput"];
10182
+ };
10183
+ };
10184
+ responses: {
10185
+ /** @description OK */
10186
+ 200: {
10187
+ headers: {
10188
+ [name: string]: unknown;
10189
+ };
10190
+ content: {
10191
+ "application/json": components["schemas"]["MoneyMovementsCreateMoneyMovementOutput"];
10192
+ };
10193
+ };
10194
+ /** @description Bad Request */
10195
+ 400: {
10196
+ headers: {
10197
+ [name: string]: unknown;
10198
+ };
10199
+ content: {
10200
+ "application/json": components["schemas"]["HttputilAPIError"];
10201
+ };
10202
+ };
10203
+ /** @description Unauthorized */
10204
+ 401: {
10205
+ headers: {
10206
+ [name: string]: unknown;
10207
+ };
10208
+ content: {
10209
+ "application/json": components["schemas"]["HttputilAPIError"];
10210
+ };
10211
+ };
10212
+ /** @description Forbidden */
10213
+ 403: {
10214
+ headers: {
10215
+ [name: string]: unknown;
10216
+ };
10217
+ content: {
10218
+ "application/json": components["schemas"]["HttputilAPIError"];
10219
+ };
10220
+ };
10221
+ /** @description Conflict */
10222
+ 409: {
10223
+ headers: {
10224
+ [name: string]: unknown;
10225
+ };
10226
+ content: {
10227
+ "application/json": components["schemas"]["HttputilAPIError"];
10228
+ };
10229
+ };
10230
+ /** @description Service Unavailable */
10231
+ 503: {
10232
+ headers: {
10233
+ [name: string]: unknown;
10234
+ };
10235
+ content: {
10236
+ "application/json": components["schemas"]["HttputilAPIError"];
10237
+ };
10238
+ };
10239
+ /** @description Error response. */
10240
+ default: {
10241
+ headers: {
10242
+ [name: string]: unknown;
10243
+ };
10244
+ content: {
10245
+ "application/json": components["schemas"]["HttputilAPIError"];
10246
+ };
10247
+ };
10248
+ };
10249
+ };
10143
10250
  "money.test_approvals.rules_get": {
10144
10251
  parameters: {
10145
10252
  query?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stable_sea/sdk",
3
- "version": "0.2.25",
3
+ "version": "0.2.26",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "files": [