@stable_sea/sdk 0.2.26 → 0.2.27

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
@@ -99,6 +99,26 @@ do not place another subscription to resolve it. Instructions can lag the native
99
99
  state: retry a 503 read. Sandbox instructions are synthetic and must never be used
100
100
  to send real funds. Existing native eligibility, agreements and controls apply.
101
101
 
102
+ ## Cancel an unbooked order
103
+
104
+ Use the original key with `investments:write` to request cancellation. Save the
105
+ mutation object and reuse it after a lost response. A replacement key cannot
106
+ cancel the original key's order.
107
+
108
+ ```ts
109
+ const cancellation = client.mutation();
110
+ const result = await cancellation.POST("/v1/orders/{id}/cancel", {
111
+ params: { path: { id: orderId } },
112
+ });
113
+ if (result.error) throw new Error(result.error.error.message);
114
+ console.log(result.data.state);
115
+ ```
116
+
117
+ Cancellation is asynchronous. Poll `GET /v1/orders/{id}` for the outcome: a
118
+ stopped order has `state: "failed"` and `failure_code: "order_cancelled"`.
119
+ A concurrent booking or final approval can win; its transaction remains visible
120
+ and is never reversed. An already-booked order returns `order_not_cancellable`.
121
+
102
122
  ## Member administration and personal actions
103
123
 
104
124
  Use `createStableSeaSessionClient` for onboarding, legal documents, your profile
@@ -570,6 +570,28 @@ export interface paths {
570
570
  patch?: never;
571
571
  trace?: never;
572
572
  };
573
+ "/v1/orders/{id}/cancel": {
574
+ parameters: {
575
+ query?: never;
576
+ header?: never;
577
+ path?: never;
578
+ cookie?: never;
579
+ };
580
+ get?: never;
581
+ put?: never;
582
+ /**
583
+ * Cancel an order
584
+ * @description Requests cancellation of an unbooked order created by this credential. Requires `investments:write` and an `Idempotency-Key`. Poll the order for its final outcome.
585
+ *
586
+ * Cancellation is asynchronous. A concurrent booking or final approval can win; its transaction remains visible and is never reversed. An order stopped by this request fails with `order_cancelled`. Orders that have already booked cannot be canceled.
587
+ */
588
+ post: operations["orders.cancel"];
589
+ delete?: never;
590
+ options?: never;
591
+ head?: never;
592
+ patch?: never;
593
+ trace?: never;
594
+ };
573
595
  "/v1/policies": {
574
596
  parameters: {
575
597
  query?: never;
@@ -4240,6 +4262,47 @@ export interface operations {
4240
4262
  };
4241
4263
  };
4242
4264
  };
4265
+ "orders.cancel": {
4266
+ parameters: {
4267
+ query?: never;
4268
+ header: {
4269
+ "Idempotency-Key": components["parameters"]["Idempotency-Key"];
4270
+ };
4271
+ path: {
4272
+ id: string;
4273
+ };
4274
+ cookie?: never;
4275
+ };
4276
+ requestBody?: never;
4277
+ responses: {
4278
+ /** @description OK */
4279
+ 200: {
4280
+ headers: {
4281
+ "X-RateLimit-Limit": components["headers"]["X-RateLimit-Limit"];
4282
+ "X-RateLimit-Remaining": components["headers"]["X-RateLimit-Remaining"];
4283
+ "X-RateLimit-Reset": components["headers"]["X-RateLimit-Reset"];
4284
+ [name: string]: unknown;
4285
+ };
4286
+ content: {
4287
+ "application/json": components["schemas"]["Order"];
4288
+ };
4289
+ };
4290
+ 400: components["responses"]["Error400"];
4291
+ 401: components["responses"]["Error401"];
4292
+ 403: components["responses"]["Error403"];
4293
+ 409: components["responses"]["Error409"];
4294
+ 429: components["responses"]["Error429"];
4295
+ /** @description Error response. */
4296
+ default: {
4297
+ headers: {
4298
+ [name: string]: unknown;
4299
+ };
4300
+ content: {
4301
+ "application/json": components["schemas"]["Error"];
4302
+ };
4303
+ };
4304
+ };
4305
+ };
4243
4306
  "policies.snapshot": {
4244
4307
  parameters: {
4245
4308
  query?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stable_sea/sdk",
3
- "version": "0.2.26",
3
+ "version": "0.2.27",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "files": [