zklighter-perps 1.0.368 → 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,8 +25,18 @@ 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;
39
+ authorization?: string;
30
40
  auth?: string;
31
41
  strategy_type?: string;
32
42
  }
@@ -34,13 +44,16 @@ export interface StrategyHeartbeatRequest {
34
44
  export interface StrategyHeartbeatFinishRequest {
35
45
  account_index: number;
36
46
  heartbeat_id: string;
47
+ authorization?: string;
37
48
  auth?: string;
38
49
  }
39
50
 
40
51
  export interface StrategyHeartbeatPingRequest {
41
52
  account_index: number;
42
53
  heartbeat_id: string;
54
+ authorization?: string;
43
55
  auth?: string;
56
+ suppress_until?: number;
44
57
  }
45
58
 
46
59
  /**
@@ -48,6 +61,87 @@ export interface StrategyHeartbeatPingRequest {
48
61
  */
49
62
  export class StrategyApi extends runtime.BaseAPI {
50
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
+
51
145
  /**
52
146
  * Start a strategy heartbeat session
53
147
  * strategy_heartbeat
@@ -64,6 +158,10 @@ export class StrategyApi extends runtime.BaseAPI {
64
158
 
65
159
  const headerParameters: runtime.HTTPHeaders = {};
66
160
 
161
+ if (requestParameters['authorization'] != null) {
162
+ headerParameters['authorization'] = String(requestParameters['authorization']);
163
+ }
164
+
67
165
  const consumes: runtime.Consume[] = [
68
166
  { contentType: 'multipart/form-data' },
69
167
  ];
@@ -111,7 +209,7 @@ export class StrategyApi extends runtime.BaseAPI {
111
209
  }
112
210
 
113
211
  /**
114
- * Finish a strategy heartbeat session
212
+ * Finish a strategy heartbeat session without a push notification
115
213
  * strategy_heartbeat_finish
116
214
  */
117
215
  async strategyHeartbeatFinishRaw(requestParameters: StrategyHeartbeatFinishRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResultCode>> {
@@ -133,6 +231,10 @@ export class StrategyApi extends runtime.BaseAPI {
133
231
 
134
232
  const headerParameters: runtime.HTTPHeaders = {};
135
233
 
234
+ if (requestParameters['authorization'] != null) {
235
+ headerParameters['authorization'] = String(requestParameters['authorization']);
236
+ }
237
+
136
238
  const consumes: runtime.Consume[] = [
137
239
  { contentType: 'multipart/form-data' },
138
240
  ];
@@ -171,7 +273,7 @@ export class StrategyApi extends runtime.BaseAPI {
171
273
  }
172
274
 
173
275
  /**
174
- * Finish a strategy heartbeat session
276
+ * Finish a strategy heartbeat session without a push notification
175
277
  * strategy_heartbeat_finish
176
278
  */
177
279
  async strategyHeartbeatFinish(requestParameters: StrategyHeartbeatFinishRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResultCode> {
@@ -202,6 +304,10 @@ export class StrategyApi extends runtime.BaseAPI {
202
304
 
203
305
  const headerParameters: runtime.HTTPHeaders = {};
204
306
 
307
+ if (requestParameters['authorization'] != null) {
308
+ headerParameters['authorization'] = String(requestParameters['authorization']);
309
+ }
310
+
205
311
  const consumes: runtime.Consume[] = [
206
312
  { contentType: 'multipart/form-data' },
207
313
  ];
@@ -228,6 +334,10 @@ export class StrategyApi extends runtime.BaseAPI {
228
334
  formParams.append('heartbeat_id', requestParameters['heartbeat_id'] as any);
229
335
  }
230
336
 
337
+ if (requestParameters['suppress_until'] != null) {
338
+ formParams.append('suppress_until', requestParameters['suppress_until'] as any);
339
+ }
340
+
231
341
  const response = await this.request({
232
342
  path: `/api/v1/strategy/heartbeat/ping`,
233
343
  method: 'POST',
@@ -174,10 +174,6 @@ export class TransactionApi extends runtime.BaseAPI {
174
174
  queryParameters['value'] = requestParameters['value'];
175
175
  }
176
176
 
177
- if (requestParameters['authorization'] != null) {
178
- queryParameters['authorization'] = requestParameters['authorization'];
179
- }
180
-
181
177
  if (requestParameters['auth'] != null) {
182
178
  queryParameters['auth'] = requestParameters['auth'];
183
179
  }
@@ -188,6 +184,10 @@ export class TransactionApi extends runtime.BaseAPI {
188
184
 
189
185
  const headerParameters: runtime.HTTPHeaders = {};
190
186
 
187
+ if (requestParameters['authorization'] != null) {
188
+ headerParameters['authorization'] = String(requestParameters['authorization']);
189
+ }
190
+
191
191
  const response = await this.request({
192
192
  path: `/api/v1/accountTxs`,
193
193
  method: 'GET',
@@ -278,10 +278,6 @@ export class TransactionApi extends runtime.BaseAPI {
278
278
 
279
279
  const queryParameters: any = {};
280
280
 
281
- if (requestParameters['authorization'] != null) {
282
- queryParameters['authorization'] = requestParameters['authorization'];
283
- }
284
-
285
281
  if (requestParameters['auth'] != null) {
286
282
  queryParameters['auth'] = requestParameters['auth'];
287
283
  }
@@ -304,6 +300,10 @@ export class TransactionApi extends runtime.BaseAPI {
304
300
 
305
301
  const headerParameters: runtime.HTTPHeaders = {};
306
302
 
303
+ if (requestParameters['authorization'] != null) {
304
+ headerParameters['authorization'] = String(requestParameters['authorization']);
305
+ }
306
+
307
307
  const response = await this.request({
308
308
  path: `/api/v1/deposit/history`,
309
309
  method: 'GET',
@@ -616,10 +616,6 @@ export class TransactionApi extends runtime.BaseAPI {
616
616
 
617
617
  const queryParameters: any = {};
618
618
 
619
- if (requestParameters['authorization'] != null) {
620
- queryParameters['authorization'] = requestParameters['authorization'];
621
- }
622
-
623
619
  if (requestParameters['auth'] != null) {
624
620
  queryParameters['auth'] = requestParameters['auth'];
625
621
  }
@@ -638,6 +634,10 @@ export class TransactionApi extends runtime.BaseAPI {
638
634
 
639
635
  const headerParameters: runtime.HTTPHeaders = {};
640
636
 
637
+ if (requestParameters['authorization'] != null) {
638
+ headerParameters['authorization'] = String(requestParameters['authorization']);
639
+ }
640
+
641
641
  const response = await this.request({
642
642
  path: `/api/v1/transfer/history`,
643
643
  method: 'GET',
@@ -803,10 +803,6 @@ export class TransactionApi extends runtime.BaseAPI {
803
803
 
804
804
  const queryParameters: any = {};
805
805
 
806
- if (requestParameters['authorization'] != null) {
807
- queryParameters['authorization'] = requestParameters['authorization'];
808
- }
809
-
810
806
  if (requestParameters['auth'] != null) {
811
807
  queryParameters['auth'] = requestParameters['auth'];
812
808
  }
@@ -825,6 +821,10 @@ export class TransactionApi extends runtime.BaseAPI {
825
821
 
826
822
  const headerParameters: runtime.HTTPHeaders = {};
827
823
 
824
+ if (requestParameters['authorization'] != null) {
825
+ headerParameters['authorization'] = String(requestParameters['authorization']);
826
+ }
827
+
828
828
  const response = await this.request({
829
829
  path: `/api/v1/withdraw/history`,
830
830
  method: 'GET',
@@ -32,7 +32,7 @@ export interface ReqGetAccountMetadata {
32
32
  */
33
33
  value: string;
34
34
  /**
35
- *
35
+ * made optional to support header auth clients
36
36
  * @type {string}
37
37
  * @memberof ReqGetAccountMetadata
38
38
  */
@@ -26,7 +26,7 @@ export interface ReqGetAirdropAllocations {
26
26
  */
27
27
  l1_address: string;
28
28
  /**
29
- *
29
+ * made optional to support header auth clients
30
30
  * @type {string}
31
31
  * @memberof ReqGetAirdropAllocations
32
32
  */
@@ -20,7 +20,7 @@ import { mapValues } from '../runtime';
20
20
  */
21
21
  export interface ReqGetGuildDuelMine {
22
22
  /**
23
- *
23
+ * made optional to support header auth clients
24
24
  * @type {string}
25
25
  * @memberof ReqGetGuildDuelMine
26
26
  */
@@ -20,7 +20,7 @@ import { mapValues } from '../runtime';
20
20
  */
21
21
  export interface ReqGetGuildDuelMineDetail {
22
22
  /**
23
- *
23
+ * made optional to support header auth clients
24
24
  * @type {string}
25
25
  * @memberof ReqGetGuildDuelMineDetail
26
26
  */
@@ -38,7 +38,7 @@ export interface ReqGetLeaderboard {
38
38
  */
39
39
  competition_id?: string;
40
40
  /**
41
- *
41
+ * made optional to support header auth clients
42
42
  * @type {string}
43
43
  * @memberof ReqGetLeaderboard
44
44
  */
@@ -20,7 +20,7 @@ import { mapValues } from '../runtime';
20
20
  */
21
21
  export interface ReqGetMakerOnlyApiKeys {
22
22
  /**
23
- *
23
+ * made optional to support header auth clients
24
24
  * @type {string}
25
25
  * @memberof ReqGetMakerOnlyApiKeys
26
26
  */
@@ -20,7 +20,7 @@ import { mapValues } from '../runtime';
20
20
  */
21
21
  export interface ReqGetRFQ {
22
22
  /**
23
- *
23
+ * made optional to support header auth clients
24
24
  * @type {string}
25
25
  * @memberof ReqGetRFQ
26
26
  */
@@ -20,7 +20,7 @@ import { mapValues } from '../runtime';
20
20
  */
21
21
  export interface ReqGetReferralStats {
22
22
  /**
23
- *
23
+ * made optional to support header auth clients
24
24
  * @type {string}
25
25
  * @memberof ReqGetReferralStats
26
26
  */
@@ -20,7 +20,7 @@ import { mapValues } from '../runtime';
20
20
  */
21
21
  export interface ReqGetUserReferrals {
22
22
  /**
23
- *
23
+ * made optional to support header auth clients
24
24
  * @type {string}
25
25
  * @memberof ReqGetUserReferrals
26
26
  */
@@ -20,7 +20,7 @@ import { mapValues } from '../runtime';
20
20
  */
21
21
  export interface ReqListRFQs {
22
22
  /**
23
- *
23
+ * made optional to support header auth clients
24
24
  * @type {string}
25
25
  * @memberof ReqListRFQs
26
26
  */