zklighter-perps 1.0.369 → 1.0.370

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.
@@ -25,6 +25,15 @@ import {
25
25
  ResultCodeToJSON,
26
26
  } from '../models/index';
27
27
 
28
+ export interface StrategyFinishedRequest {
29
+ account_index: number;
30
+ strategy_id: string;
31
+ authorization?: string;
32
+ auth?: string;
33
+ strategy_type?: string;
34
+ aborted?: boolean;
35
+ }
36
+
28
37
  export interface StrategyHeartbeatRequest {
29
38
  account_index: number;
30
39
  authorization?: string;
@@ -44,6 +53,7 @@ export interface StrategyHeartbeatPingRequest {
44
53
  heartbeat_id: string;
45
54
  authorization?: string;
46
55
  auth?: string;
56
+ suppress_until?: number;
47
57
  }
48
58
 
49
59
  /**
@@ -51,6 +61,87 @@ export interface StrategyHeartbeatPingRequest {
51
61
  */
52
62
  export class StrategyApi extends runtime.BaseAPI {
53
63
 
64
+ /**
65
+ * Send the strategy finished (or aborted) push notification, once per strategy_id
66
+ * strategy_finished
67
+ */
68
+ async strategyFinishedRaw(requestParameters: StrategyFinishedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResultCode>> {
69
+ if (requestParameters['account_index'] == null) {
70
+ throw new runtime.RequiredError(
71
+ 'account_index',
72
+ 'Required parameter "account_index" was null or undefined when calling strategyFinished().'
73
+ );
74
+ }
75
+
76
+ if (requestParameters['strategy_id'] == null) {
77
+ throw new runtime.RequiredError(
78
+ 'strategy_id',
79
+ 'Required parameter "strategy_id" was null or undefined when calling strategyFinished().'
80
+ );
81
+ }
82
+
83
+ const queryParameters: any = {};
84
+
85
+ const headerParameters: runtime.HTTPHeaders = {};
86
+
87
+ if (requestParameters['authorization'] != null) {
88
+ headerParameters['authorization'] = String(requestParameters['authorization']);
89
+ }
90
+
91
+ const consumes: runtime.Consume[] = [
92
+ { contentType: 'multipart/form-data' },
93
+ ];
94
+ // @ts-ignore: canConsumeForm may be unused
95
+ const canConsumeForm = runtime.canConsumeForm(consumes);
96
+
97
+ let formParams: { append(param: string, value: any): any };
98
+ let useForm = false;
99
+ if (useForm) {
100
+ formParams = new FormData();
101
+ } else {
102
+ formParams = new URLSearchParams();
103
+ }
104
+
105
+ if (requestParameters['auth'] != null) {
106
+ formParams.append('auth', requestParameters['auth'] as any);
107
+ }
108
+
109
+ if (requestParameters['account_index'] != null) {
110
+ formParams.append('account_index', requestParameters['account_index'] as any);
111
+ }
112
+
113
+ if (requestParameters['strategy_id'] != null) {
114
+ formParams.append('strategy_id', requestParameters['strategy_id'] as any);
115
+ }
116
+
117
+ if (requestParameters['strategy_type'] != null) {
118
+ formParams.append('strategy_type', requestParameters['strategy_type'] as any);
119
+ }
120
+
121
+ if (requestParameters['aborted'] != null) {
122
+ formParams.append('aborted', requestParameters['aborted'] as any);
123
+ }
124
+
125
+ const response = await this.request({
126
+ path: `/api/v1/strategy/finished`,
127
+ method: 'POST',
128
+ headers: headerParameters,
129
+ query: queryParameters,
130
+ body: formParams,
131
+ }, initOverrides);
132
+
133
+ return new runtime.JSONApiResponse(response, (jsonValue) => ResultCodeFromJSON(jsonValue));
134
+ }
135
+
136
+ /**
137
+ * Send the strategy finished (or aborted) push notification, once per strategy_id
138
+ * strategy_finished
139
+ */
140
+ async strategyFinished(requestParameters: StrategyFinishedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResultCode> {
141
+ const response = await this.strategyFinishedRaw(requestParameters, initOverrides);
142
+ return await response.value();
143
+ }
144
+
54
145
  /**
55
146
  * Start a strategy heartbeat session
56
147
  * strategy_heartbeat
@@ -118,7 +209,7 @@ export class StrategyApi extends runtime.BaseAPI {
118
209
  }
119
210
 
120
211
  /**
121
- * Finish a strategy heartbeat session
212
+ * Finish a strategy heartbeat session without a push notification
122
213
  * strategy_heartbeat_finish
123
214
  */
124
215
  async strategyHeartbeatFinishRaw(requestParameters: StrategyHeartbeatFinishRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResultCode>> {
@@ -182,7 +273,7 @@ export class StrategyApi extends runtime.BaseAPI {
182
273
  }
183
274
 
184
275
  /**
185
- * Finish a strategy heartbeat session
276
+ * Finish a strategy heartbeat session without a push notification
186
277
  * strategy_heartbeat_finish
187
278
  */
188
279
  async strategyHeartbeatFinish(requestParameters: StrategyHeartbeatFinishRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResultCode> {
@@ -243,6 +334,10 @@ export class StrategyApi extends runtime.BaseAPI {
243
334
  formParams.append('heartbeat_id', requestParameters['heartbeat_id'] as any);
244
335
  }
245
336
 
337
+ if (requestParameters['suppress_until'] != null) {
338
+ formParams.append('suppress_until', requestParameters['suppress_until'] as any);
339
+ }
340
+
246
341
  const response = await this.request({
247
342
  path: `/api/v1/strategy/heartbeat/ping`,
248
343
  method: 'POST',
package/openapi.json CHANGED
@@ -7576,6 +7576,49 @@
7576
7576
  "description": "Get stock financials. Returns stock_financial for a single market_id, or stock_financials for every stock market when market_id is omitted. fields narrows the response to a subset of currency, exchange, industry, sector, country, market_cap, next_earnings, next_dividend; omit it to get the full record, which requires market_id."
7577
7577
  }
7578
7578
  },
7579
+ "/api/v1/strategy/finished": {
7580
+ "post": {
7581
+ "summary": "strategy_finished",
7582
+ "operationId": "strategy_finished",
7583
+ "responses": {
7584
+ "200": {
7585
+ "description": "A successful response.",
7586
+ "schema": {
7587
+ "$ref": "#/definitions/ResultCode"
7588
+ }
7589
+ },
7590
+ "400": {
7591
+ "description": "Bad request",
7592
+ "schema": {
7593
+ "$ref": "#/definitions/ResultCode"
7594
+ }
7595
+ }
7596
+ },
7597
+ "parameters": [
7598
+ {
7599
+ "name": "authorization",
7600
+ "in": "header",
7601
+ "required": false,
7602
+ "type": "string"
7603
+ },
7604
+ {
7605
+ "name": "body",
7606
+ "in": "body",
7607
+ "required": true,
7608
+ "schema": {
7609
+ "$ref": "#/definitions/ReqNotifyStrategyFinished"
7610
+ }
7611
+ }
7612
+ ],
7613
+ "tags": [
7614
+ "strategy"
7615
+ ],
7616
+ "consumes": [
7617
+ "multipart/form-data"
7618
+ ],
7619
+ "description": "Send the strategy finished (or aborted) push notification, once per strategy_id"
7620
+ }
7621
+ },
7579
7622
  "/api/v1/strategy/heartbeat": {
7580
7623
  "post": {
7581
7624
  "summary": "strategy_heartbeat",
@@ -7659,7 +7702,7 @@
7659
7702
  "consumes": [
7660
7703
  "multipart/form-data"
7661
7704
  ],
7662
- "description": "Finish a strategy heartbeat session"
7705
+ "description": "Finish a strategy heartbeat session without a push notification"
7663
7706
  }
7664
7707
  },
7665
7708
  "/api/v1/strategy/heartbeat/ping": {
@@ -21257,6 +21300,34 @@
21257
21300
  },
21258
21301
  "title": "ReqListRFQs"
21259
21302
  },
21303
+ "ReqNotifyStrategyFinished": {
21304
+ "type": "object",
21305
+ "properties": {
21306
+ "auth": {
21307
+ "type": "string",
21308
+ "description": " made optional to support header auth clients"
21309
+ },
21310
+ "account_index": {
21311
+ "type": "integer",
21312
+ "format": "int64"
21313
+ },
21314
+ "strategy_id": {
21315
+ "type": "string"
21316
+ },
21317
+ "strategy_type": {
21318
+ "type": "string"
21319
+ },
21320
+ "aborted": {
21321
+ "type": "boolean",
21322
+ "format": "boolean"
21323
+ }
21324
+ },
21325
+ "title": "ReqNotifyStrategyFinished",
21326
+ "required": [
21327
+ "account_index",
21328
+ "strategy_id"
21329
+ ]
21330
+ },
21260
21331
  "ReqPingStrategyHeartbeat": {
21261
21332
  "type": "object",
21262
21333
  "properties": {
@@ -21270,6 +21341,11 @@
21270
21341
  },
21271
21342
  "heartbeat_id": {
21272
21343
  "type": "string"
21344
+ },
21345
+ "suppress_until": {
21346
+ "type": "integer",
21347
+ "format": "int64",
21348
+ "description": " unix ms; no interrupted push before it, a past value clears it"
21273
21349
  }
21274
21350
  },
21275
21351
  "title": "ReqPingStrategyHeartbeat",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklighter-perps",
3
- "version": "1.0.369",
3
+ "version": "1.0.370",
4
4
  "description": "Lighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {