zklighter-perps 1.0.16 → 1.0.17

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.
@@ -2,6 +2,7 @@ apis/AccountApi.ts
2
2
  apis/BlockApi.ts
3
3
  apis/CandlestickApi.ts
4
4
  apis/InfoApi.ts
5
+ apis/LiquidationApi.ts
5
6
  apis/OrderApi.ts
6
7
  apis/RootApi.ts
7
8
  apis/TransactionApi.ts
@@ -29,6 +30,7 @@ models/Fundings.ts
29
30
  models/L1ProviderInfo.ts
30
31
  models/Layer1BasicInfo.ts
31
32
  models/Layer2BasicInfo.ts
33
+ models/Liquidation.ts
32
34
  models/MarketInfo.ts
33
35
  models/NextNonce.ts
34
36
  models/Order.ts
@@ -70,6 +72,7 @@ models/ReqGetRecentTrades.ts
70
72
  models/ReqGetRollbacks.ts
71
73
  models/ReqGetTrades.ts
72
74
  models/ReqGetTx.ts
75
+ models/ReqMarkNotifRead.ts
73
76
  models/ReqSearch.ts
74
77
  models/ResultCode.ts
75
78
  models/Rollback.ts
@@ -0,0 +1,121 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ *
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document:
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ ResultCode,
19
+ } from '../models/index';
20
+ import {
21
+ ResultCodeFromJSON,
22
+ ResultCodeToJSON,
23
+ } from '../models/index';
24
+
25
+ export interface MarkNotifReadRequest {
26
+ notif_type: string;
27
+ account_index: number;
28
+ api_key_index: number;
29
+ liquidation_ids: string;
30
+ signature: string;
31
+ }
32
+
33
+ /**
34
+ *
35
+ */
36
+ export class LiquidationApi extends runtime.BaseAPI {
37
+
38
+ /**
39
+ * Mark
40
+ * MarkNotifRead
41
+ */
42
+ async markNotifReadRaw(requestParameters: MarkNotifReadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResultCode>> {
43
+ if (requestParameters['notif_type'] == null) {
44
+ throw new runtime.RequiredError(
45
+ 'notif_type',
46
+ 'Required parameter "notif_type" was null or undefined when calling markNotifRead().'
47
+ );
48
+ }
49
+
50
+ if (requestParameters['account_index'] == null) {
51
+ throw new runtime.RequiredError(
52
+ 'account_index',
53
+ 'Required parameter "account_index" was null or undefined when calling markNotifRead().'
54
+ );
55
+ }
56
+
57
+ if (requestParameters['api_key_index'] == null) {
58
+ throw new runtime.RequiredError(
59
+ 'api_key_index',
60
+ 'Required parameter "api_key_index" was null or undefined when calling markNotifRead().'
61
+ );
62
+ }
63
+
64
+ if (requestParameters['liquidation_ids'] == null) {
65
+ throw new runtime.RequiredError(
66
+ 'liquidation_ids',
67
+ 'Required parameter "liquidation_ids" was null or undefined when calling markNotifRead().'
68
+ );
69
+ }
70
+
71
+ if (requestParameters['signature'] == null) {
72
+ throw new runtime.RequiredError(
73
+ 'signature',
74
+ 'Required parameter "signature" was null or undefined when calling markNotifRead().'
75
+ );
76
+ }
77
+
78
+ const queryParameters: any = {};
79
+
80
+ if (requestParameters['notif_type'] != null) {
81
+ queryParameters['notif_type'] = requestParameters['notif_type'];
82
+ }
83
+
84
+ if (requestParameters['account_index'] != null) {
85
+ queryParameters['account_index'] = requestParameters['account_index'];
86
+ }
87
+
88
+ if (requestParameters['api_key_index'] != null) {
89
+ queryParameters['api_key_index'] = requestParameters['api_key_index'];
90
+ }
91
+
92
+ if (requestParameters['liquidation_ids'] != null) {
93
+ queryParameters['liquidation_ids'] = requestParameters['liquidation_ids'];
94
+ }
95
+
96
+ if (requestParameters['signature'] != null) {
97
+ queryParameters['signature'] = requestParameters['signature'];
98
+ }
99
+
100
+ const headerParameters: runtime.HTTPHeaders = {};
101
+
102
+ const response = await this.request({
103
+ path: `/api/v1/markNotifRead`,
104
+ method: 'GET',
105
+ headers: headerParameters,
106
+ query: queryParameters,
107
+ }, initOverrides);
108
+
109
+ return new runtime.JSONApiResponse(response, (jsonValue) => ResultCodeFromJSON(jsonValue));
110
+ }
111
+
112
+ /**
113
+ * Mark
114
+ * MarkNotifRead
115
+ */
116
+ async markNotifRead(requestParameters: MarkNotifReadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResultCode> {
117
+ const response = await this.markNotifReadRaw(requestParameters, initOverrides);
118
+ return await response.value();
119
+ }
120
+
121
+ }
package/apis/index.ts CHANGED
@@ -4,6 +4,7 @@ export * from './AccountApi';
4
4
  export * from './BlockApi';
5
5
  export * from './CandlestickApi';
6
6
  export * from './InfoApi';
7
+ export * from './LiquidationApi';
7
8
  export * from './OrderApi';
8
9
  export * from './RootApi';
9
10
  export * from './TransactionApi';
@@ -108,7 +108,7 @@ export interface EnrichedTx {
108
108
  * @type {number}
109
109
  * @memberof EnrichedTx
110
110
  */
111
- verify_at?: number;
111
+ executed_at: number;
112
112
  /**
113
113
  *
114
114
  * @type {number}
@@ -127,21 +127,15 @@ export interface EnrichedTx {
127
127
  * @memberof EnrichedTx
128
128
  */
129
129
  verified_at: number;
130
- /**
131
- *
132
- * @type {number}
133
- * @memberof EnrichedTx
134
- */
135
- executed_at: number;
136
130
  }
137
131
 
138
132
  /**
139
133
  * Check if a given object implements the EnrichedTx interface.
140
134
  */
141
135
  export function instanceOfEnrichedTx(value: object): value is EnrichedTx {
136
+ if (!('executed_at' in value) || value['executed_at'] === undefined) return false;
142
137
  if (!('committed_at' in value) || value['committed_at'] === undefined) return false;
143
138
  if (!('verified_at' in value) || value['verified_at'] === undefined) return false;
144
- if (!('executed_at' in value) || value['executed_at'] === undefined) return false;
145
139
  return true;
146
140
  }
147
141
 
@@ -169,11 +163,10 @@ export function EnrichedTxFromJSONTyped(json: any, ignoreDiscriminator: boolean)
169
163
  'expire_at': json['expire_at'] == null ? undefined : json['expire_at'],
170
164
  'block_height': json['block_height'] == null ? undefined : json['block_height'],
171
165
  'created_at': json['created_at'] == null ? undefined : json['created_at'],
172
- 'verify_at': json['verify_at'] == null ? undefined : json['verify_at'],
166
+ 'executed_at': json['executed_at'],
173
167
  'sequence_index': json['sequence_index'] == null ? undefined : json['sequence_index'],
174
168
  'committed_at': json['committed_at'],
175
169
  'verified_at': json['verified_at'],
176
- 'executed_at': json['executed_at'],
177
170
  };
178
171
  }
179
172
 
@@ -197,11 +190,10 @@ export function EnrichedTxToJSON(value?: EnrichedTx | null): any {
197
190
  'expire_at': value['expire_at'],
198
191
  'block_height': value['block_height'],
199
192
  'created_at': value['created_at'],
200
- 'verify_at': value['verify_at'],
193
+ 'executed_at': value['executed_at'],
201
194
  'sequence_index': value['sequence_index'],
202
195
  'committed_at': value['committed_at'],
203
196
  'verified_at': value['verified_at'],
204
- 'executed_at': value['executed_at'],
205
197
  };
206
198
  }
207
199
 
@@ -0,0 +1,76 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ *
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document:
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface Liquidation
20
+ */
21
+ export interface Liquidation {
22
+ /**
23
+ *
24
+ * @type {number}
25
+ * @memberof Liquidation
26
+ */
27
+ LiquidationId?: number;
28
+ /**
29
+ *
30
+ * @type {number}
31
+ * @memberof Liquidation
32
+ */
33
+ AccountIndex?: number;
34
+ /**
35
+ *
36
+ * @type {number}
37
+ * @memberof Liquidation
38
+ */
39
+ LiquidationType?: number;
40
+ }
41
+
42
+ /**
43
+ * Check if a given object implements the Liquidation interface.
44
+ */
45
+ export function instanceOfLiquidation(value: object): value is Liquidation {
46
+ return true;
47
+ }
48
+
49
+ export function LiquidationFromJSON(json: any): Liquidation {
50
+ return LiquidationFromJSONTyped(json, false);
51
+ }
52
+
53
+ export function LiquidationFromJSONTyped(json: any, ignoreDiscriminator: boolean): Liquidation {
54
+ if (json == null) {
55
+ return json;
56
+ }
57
+ return {
58
+
59
+ 'LiquidationId': json['LiquidationId'] == null ? undefined : json['LiquidationId'],
60
+ 'AccountIndex': json['AccountIndex'] == null ? undefined : json['AccountIndex'],
61
+ 'LiquidationType': json['LiquidationType'] == null ? undefined : json['LiquidationType'],
62
+ };
63
+ }
64
+
65
+ export function LiquidationToJSON(value?: Liquidation | null): any {
66
+ if (value == null) {
67
+ return value;
68
+ }
69
+ return {
70
+
71
+ 'LiquidationId': value['LiquidationId'],
72
+ 'AccountIndex': value['AccountIndex'],
73
+ 'LiquidationType': value['LiquidationType'],
74
+ };
75
+ }
76
+
@@ -0,0 +1,97 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ *
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document:
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface ReqMarkNotifRead
20
+ */
21
+ export interface ReqMarkNotifRead {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof ReqMarkNotifRead
26
+ */
27
+ notif_type: string;
28
+ /**
29
+ *
30
+ * @type {number}
31
+ * @memberof ReqMarkNotifRead
32
+ */
33
+ account_index: number;
34
+ /**
35
+ *
36
+ * @type {number}
37
+ * @memberof ReqMarkNotifRead
38
+ */
39
+ api_key_index: number;
40
+ /**
41
+ *
42
+ * @type {string}
43
+ * @memberof ReqMarkNotifRead
44
+ */
45
+ liquidation_ids: string;
46
+ /**
47
+ *
48
+ * @type {string}
49
+ * @memberof ReqMarkNotifRead
50
+ */
51
+ signature: string;
52
+ }
53
+
54
+ /**
55
+ * Check if a given object implements the ReqMarkNotifRead interface.
56
+ */
57
+ export function instanceOfReqMarkNotifRead(value: object): value is ReqMarkNotifRead {
58
+ if (!('notif_type' in value) || value['notif_type'] === undefined) return false;
59
+ if (!('account_index' in value) || value['account_index'] === undefined) return false;
60
+ if (!('api_key_index' in value) || value['api_key_index'] === undefined) return false;
61
+ if (!('liquidation_ids' in value) || value['liquidation_ids'] === undefined) return false;
62
+ if (!('signature' in value) || value['signature'] === undefined) return false;
63
+ return true;
64
+ }
65
+
66
+ export function ReqMarkNotifReadFromJSON(json: any): ReqMarkNotifRead {
67
+ return ReqMarkNotifReadFromJSONTyped(json, false);
68
+ }
69
+
70
+ export function ReqMarkNotifReadFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReqMarkNotifRead {
71
+ if (json == null) {
72
+ return json;
73
+ }
74
+ return {
75
+
76
+ 'notif_type': json['notif_type'],
77
+ 'account_index': json['account_index'],
78
+ 'api_key_index': json['api_key_index'],
79
+ 'liquidation_ids': json['liquidation_ids'],
80
+ 'signature': json['signature'],
81
+ };
82
+ }
83
+
84
+ export function ReqMarkNotifReadToJSON(value?: ReqMarkNotifRead | null): any {
85
+ if (value == null) {
86
+ return value;
87
+ }
88
+ return {
89
+
90
+ 'notif_type': value['notif_type'],
91
+ 'account_index': value['account_index'],
92
+ 'api_key_index': value['api_key_index'],
93
+ 'liquidation_ids': value['liquidation_ids'],
94
+ 'signature': value['signature'],
95
+ };
96
+ }
97
+
package/models/Tx.ts CHANGED
@@ -96,7 +96,7 @@ export interface Tx {
96
96
  * @type {number}
97
97
  * @memberof Tx
98
98
  */
99
- verify_at: number;
99
+ executed_at: number;
100
100
  /**
101
101
  *
102
102
  * @type {number}
@@ -121,7 +121,7 @@ export function instanceOfTx(value: object): value is Tx {
121
121
  if (!('expire_at' in value) || value['expire_at'] === undefined) return false;
122
122
  if (!('block_height' in value) || value['block_height'] === undefined) return false;
123
123
  if (!('created_at' in value) || value['created_at'] === undefined) return false;
124
- if (!('verify_at' in value) || value['verify_at'] === undefined) return false;
124
+ if (!('executed_at' in value) || value['executed_at'] === undefined) return false;
125
125
  if (!('sequence_index' in value) || value['sequence_index'] === undefined) return false;
126
126
  return true;
127
127
  }
@@ -148,7 +148,7 @@ export function TxFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tx {
148
148
  'expire_at': json['expire_at'],
149
149
  'block_height': json['block_height'],
150
150
  'created_at': json['created_at'],
151
- 'verify_at': json['verify_at'],
151
+ 'executed_at': json['executed_at'],
152
152
  'sequence_index': json['sequence_index'],
153
153
  };
154
154
  }
@@ -171,7 +171,7 @@ export function TxToJSON(value?: Tx | null): any {
171
171
  'expire_at': value['expire_at'],
172
172
  'block_height': value['block_height'],
173
173
  'created_at': value['created_at'],
174
- 'verify_at': value['verify_at'],
174
+ 'executed_at': value['executed_at'],
175
175
  'sequence_index': value['sequence_index'],
176
176
  };
177
177
  }
package/models/index.ts CHANGED
@@ -22,6 +22,7 @@ export * from './Fundings';
22
22
  export * from './L1ProviderInfo';
23
23
  export * from './Layer1BasicInfo';
24
24
  export * from './Layer2BasicInfo';
25
+ export * from './Liquidation';
25
26
  export * from './MarketInfo';
26
27
  export * from './NextNonce';
27
28
  export * from './Order';
@@ -63,6 +64,7 @@ export * from './ReqGetRecentTrades';
63
64
  export * from './ReqGetRollbacks';
64
65
  export * from './ReqGetTrades';
65
66
  export * from './ReqGetTx';
67
+ export * from './ReqMarkNotifRead';
66
68
  export * from './ReqSearch';
67
69
  export * from './ResultCode';
68
70
  export * from './Rollback';
package/openapi.json CHANGED
@@ -914,6 +914,67 @@
914
914
  "description": "Get zklighter general info, including contract address, and count of transactions and active users"
915
915
  }
916
916
  },
917
+ "/api/v1/markNotifRead": {
918
+ "get": {
919
+ "summary": "MarkNotifRead",
920
+ "operationId": "MarkNotifRead",
921
+ "responses": {
922
+ "200": {
923
+ "description": "A successful response.",
924
+ "schema": {
925
+ "$ref": "#/definitions/ResultCode"
926
+ }
927
+ },
928
+ "400": {
929
+ "description": "Bad request",
930
+ "schema": {
931
+ "$ref": "#/definitions/ResultCode"
932
+ }
933
+ }
934
+ },
935
+ "parameters": [
936
+ {
937
+ "name": "notif_type",
938
+ "in": "query",
939
+ "required": true,
940
+ "type": "string"
941
+ },
942
+ {
943
+ "name": "account_index",
944
+ "in": "query",
945
+ "required": true,
946
+ "type": "integer",
947
+ "format": "int32"
948
+ },
949
+ {
950
+ "name": "api_key_index",
951
+ "in": "query",
952
+ "required": true,
953
+ "type": "integer",
954
+ "format": "uint8"
955
+ },
956
+ {
957
+ "name": "liquidation_ids",
958
+ "in": "query",
959
+ "required": true,
960
+ "type": "string"
961
+ },
962
+ {
963
+ "name": "signature",
964
+ "in": "query",
965
+ "required": true,
966
+ "type": "string"
967
+ }
968
+ ],
969
+ "tags": [
970
+ "liquidation"
971
+ ],
972
+ "consumes": [
973
+ "multipart/form-data"
974
+ ],
975
+ "description": "Mark"
976
+ }
977
+ },
917
978
  "/api/v1/nextNonce": {
918
979
  "get": {
919
980
  "summary": "GetNextNonce",
@@ -2288,7 +2349,7 @@
2288
2349
  "format": "int64",
2289
2350
  "example": "1640995200"
2290
2351
  },
2291
- "verify_at": {
2352
+ "executed_at": {
2292
2353
  "type": "integer",
2293
2354
  "format": "int64",
2294
2355
  "example": "1640995200"
@@ -2307,11 +2368,6 @@
2307
2368
  "type": "integer",
2308
2369
  "format": "int64",
2309
2370
  "example": "1640995200"
2310
- },
2311
- "executed_at": {
2312
- "type": "integer",
2313
- "format": "int64",
2314
- "example": "1640995200"
2315
2371
  }
2316
2372
  },
2317
2373
  "title": "EnrichedTx",
@@ -2545,6 +2601,24 @@
2545
2601
  "total_transaction_count"
2546
2602
  ]
2547
2603
  },
2604
+ "Liquidation": {
2605
+ "type": "object",
2606
+ "properties": {
2607
+ "LiquidationId": {
2608
+ "type": "integer",
2609
+ "format": "int64"
2610
+ },
2611
+ "AccountIndex": {
2612
+ "type": "integer",
2613
+ "format": "int32"
2614
+ },
2615
+ "LiquidationType": {
2616
+ "type": "integer",
2617
+ "format": "uint8"
2618
+ }
2619
+ },
2620
+ "title": "Liquidation"
2621
+ },
2548
2622
  "MarketInfo": {
2549
2623
  "type": "object",
2550
2624
  "properties": {
@@ -3885,6 +3959,36 @@
3885
3959
  "value"
3886
3960
  ]
3887
3961
  },
3962
+ "ReqMarkNotifRead": {
3963
+ "type": "object",
3964
+ "properties": {
3965
+ "notif_type": {
3966
+ "type": "string"
3967
+ },
3968
+ "account_index": {
3969
+ "type": "integer",
3970
+ "format": "int32"
3971
+ },
3972
+ "api_key_index": {
3973
+ "type": "integer",
3974
+ "format": "uint8"
3975
+ },
3976
+ "liquidation_ids": {
3977
+ "type": "string"
3978
+ },
3979
+ "signature": {
3980
+ "type": "string"
3981
+ }
3982
+ },
3983
+ "title": "ReqMarkNotifRead",
3984
+ "required": [
3985
+ "notif_type",
3986
+ "account_index",
3987
+ "api_key_index",
3988
+ "liquidation_ids",
3989
+ "signature"
3990
+ ]
3991
+ },
3888
3992
  "ReqSearch": {
3889
3993
  "type": "object",
3890
3994
  "properties": {
@@ -4295,7 +4399,7 @@
4295
4399
  "format": "int64",
4296
4400
  "example": "1640995200"
4297
4401
  },
4298
- "verify_at": {
4402
+ "executed_at": {
4299
4403
  "type": "integer",
4300
4404
  "format": "int64",
4301
4405
  "example": "1640995200"
@@ -4320,7 +4424,7 @@
4320
4424
  "expire_at",
4321
4425
  "block_height",
4322
4426
  "created_at",
4323
- "verify_at",
4427
+ "executed_at",
4324
4428
  "sequence_index"
4325
4429
  ]
4326
4430
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklighter-perps",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "description": "zkLighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {