zklighter-perps 1.0.16 → 1.0.18

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,17 +2,20 @@ 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
8
9
  apis/index.ts
9
10
  index.ts
10
11
  models/Account.ts
12
+ models/AccountApiKeys.ts
11
13
  models/AccountMarketStats.ts
12
14
  models/AccountPnL.ts
13
15
  models/AccountPosition.ts
14
16
  models/AccountStats.ts
15
17
  models/Accounts.ts
18
+ models/ApiKey.ts
16
19
  models/Block.ts
17
20
  models/Blocks.ts
18
21
  models/Candlestick.ts
@@ -29,6 +32,7 @@ models/Fundings.ts
29
32
  models/L1ProviderInfo.ts
30
33
  models/Layer1BasicInfo.ts
31
34
  models/Layer2BasicInfo.ts
35
+ models/Liquidation.ts
32
36
  models/MarketInfo.ts
33
37
  models/NextNonce.ts
34
38
  models/Order.ts
@@ -46,6 +50,7 @@ models/PriceLevel.ts
46
50
  models/ReqDoFaucet.ts
47
51
  models/ReqGetAccount.ts
48
52
  models/ReqGetAccountActiveOrders.ts
53
+ models/ReqGetAccountApiKeys.ts
49
54
  models/ReqGetAccountByL1Address.ts
50
55
  models/ReqGetAccountInactiveOrders.ts
51
56
  models/ReqGetAccountOrders.ts
@@ -70,6 +75,7 @@ models/ReqGetRecentTrades.ts
70
75
  models/ReqGetRollbacks.ts
71
76
  models/ReqGetTrades.ts
72
77
  models/ReqGetTx.ts
78
+ models/ReqMarkNotifRead.ts
73
79
  models/ReqSearch.ts
74
80
  models/ResultCode.ts
75
81
  models/Rollback.ts
@@ -15,6 +15,7 @@
15
15
 
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
+ AccountApiKeys,
18
19
  AccountPnL,
19
20
  Accounts,
20
21
  DetailedAccounts,
@@ -23,6 +24,8 @@ import type {
23
24
  SubAccounts,
24
25
  } from '../models/index';
25
26
  import {
27
+ AccountApiKeysFromJSON,
28
+ AccountApiKeysToJSON,
26
29
  AccountPnLFromJSON,
27
30
  AccountPnLToJSON,
28
31
  AccountsFromJSON,
@@ -46,6 +49,11 @@ export interface GetAccountRequest {
46
49
  value: string;
47
50
  }
48
51
 
52
+ export interface GetAccountApiKeysRequest {
53
+ account_index: number;
54
+ api_key_index: number;
55
+ }
56
+
49
57
  export interface GetAccountPnlRequest {
50
58
  by: GetAccountPnlByEnum;
51
59
  value: string;
@@ -165,6 +173,56 @@ export class AccountApi extends runtime.BaseAPI {
165
173
  return await response.value();
166
174
  }
167
175
 
176
+ /**
177
+ * Get account api key
178
+ * GetAccountApiKeys
179
+ */
180
+ async getAccountApiKeysRaw(requestParameters: GetAccountApiKeysRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AccountApiKeys>> {
181
+ if (requestParameters['account_index'] == null) {
182
+ throw new runtime.RequiredError(
183
+ 'account_index',
184
+ 'Required parameter "account_index" was null or undefined when calling getAccountApiKeys().'
185
+ );
186
+ }
187
+
188
+ if (requestParameters['api_key_index'] == null) {
189
+ throw new runtime.RequiredError(
190
+ 'api_key_index',
191
+ 'Required parameter "api_key_index" was null or undefined when calling getAccountApiKeys().'
192
+ );
193
+ }
194
+
195
+ const queryParameters: any = {};
196
+
197
+ if (requestParameters['account_index'] != null) {
198
+ queryParameters['account_index'] = requestParameters['account_index'];
199
+ }
200
+
201
+ if (requestParameters['api_key_index'] != null) {
202
+ queryParameters['api_key_index'] = requestParameters['api_key_index'];
203
+ }
204
+
205
+ const headerParameters: runtime.HTTPHeaders = {};
206
+
207
+ const response = await this.request({
208
+ path: `/api/v1/apikeys`,
209
+ method: 'GET',
210
+ headers: headerParameters,
211
+ query: queryParameters,
212
+ }, initOverrides);
213
+
214
+ return new runtime.JSONApiResponse(response, (jsonValue) => AccountApiKeysFromJSON(jsonValue));
215
+ }
216
+
217
+ /**
218
+ * Get account api key
219
+ * GetAccountApiKeys
220
+ */
221
+ async getAccountApiKeys(requestParameters: GetAccountApiKeysRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AccountApiKeys> {
222
+ const response = await this.getAccountApiKeysRaw(requestParameters, initOverrides);
223
+ return await response.value();
224
+ }
225
+
168
226
  /**
169
227
  * Get account PnL chart
170
228
  * GetAccountPnl
@@ -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';
@@ -0,0 +1,84 @@
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
+ import type { ApiKey } from './ApiKey';
17
+ import {
18
+ ApiKeyFromJSON,
19
+ ApiKeyFromJSONTyped,
20
+ ApiKeyToJSON,
21
+ } from './ApiKey';
22
+
23
+ /**
24
+ *
25
+ * @export
26
+ * @interface AccountApiKeys
27
+ */
28
+ export interface AccountApiKeys {
29
+ /**
30
+ *
31
+ * @type {number}
32
+ * @memberof AccountApiKeys
33
+ */
34
+ code?: number;
35
+ /**
36
+ *
37
+ * @type {string}
38
+ * @memberof AccountApiKeys
39
+ */
40
+ message?: string;
41
+ /**
42
+ *
43
+ * @type {Array<ApiKey>}
44
+ * @memberof AccountApiKeys
45
+ */
46
+ api_keys: Array<ApiKey>;
47
+ }
48
+
49
+ /**
50
+ * Check if a given object implements the AccountApiKeys interface.
51
+ */
52
+ export function instanceOfAccountApiKeys(value: object): value is AccountApiKeys {
53
+ if (!('api_keys' in value) || value['api_keys'] === undefined) return false;
54
+ return true;
55
+ }
56
+
57
+ export function AccountApiKeysFromJSON(json: any): AccountApiKeys {
58
+ return AccountApiKeysFromJSONTyped(json, false);
59
+ }
60
+
61
+ export function AccountApiKeysFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountApiKeys {
62
+ if (json == null) {
63
+ return json;
64
+ }
65
+ return {
66
+
67
+ 'code': json['code'] == null ? undefined : json['code'],
68
+ 'message': json['message'] == null ? undefined : json['message'],
69
+ 'api_keys': ((json['api_keys'] as Array<any>).map(ApiKeyFromJSON)),
70
+ };
71
+ }
72
+
73
+ export function AccountApiKeysToJSON(value?: AccountApiKeys | null): any {
74
+ if (value == null) {
75
+ return value;
76
+ }
77
+ return {
78
+
79
+ 'code': value['code'],
80
+ 'message': value['message'],
81
+ 'api_keys': ((value['api_keys'] as Array<any>).map(ApiKeyToJSON)),
82
+ };
83
+ }
84
+
@@ -0,0 +1,88 @@
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 ApiKey
20
+ */
21
+ export interface ApiKey {
22
+ /**
23
+ *
24
+ * @type {number}
25
+ * @memberof ApiKey
26
+ */
27
+ account_index: number;
28
+ /**
29
+ *
30
+ * @type {number}
31
+ * @memberof ApiKey
32
+ */
33
+ api_key_index: number;
34
+ /**
35
+ *
36
+ * @type {number}
37
+ * @memberof ApiKey
38
+ */
39
+ nonce: number;
40
+ /**
41
+ *
42
+ * @type {string}
43
+ * @memberof ApiKey
44
+ */
45
+ public_key: string;
46
+ }
47
+
48
+ /**
49
+ * Check if a given object implements the ApiKey interface.
50
+ */
51
+ export function instanceOfApiKey(value: object): value is ApiKey {
52
+ if (!('account_index' in value) || value['account_index'] === undefined) return false;
53
+ if (!('api_key_index' in value) || value['api_key_index'] === undefined) return false;
54
+ if (!('nonce' in value) || value['nonce'] === undefined) return false;
55
+ if (!('public_key' in value) || value['public_key'] === undefined) return false;
56
+ return true;
57
+ }
58
+
59
+ export function ApiKeyFromJSON(json: any): ApiKey {
60
+ return ApiKeyFromJSONTyped(json, false);
61
+ }
62
+
63
+ export function ApiKeyFromJSONTyped(json: any, ignoreDiscriminator: boolean): ApiKey {
64
+ if (json == null) {
65
+ return json;
66
+ }
67
+ return {
68
+
69
+ 'account_index': json['account_index'],
70
+ 'api_key_index': json['api_key_index'],
71
+ 'nonce': json['nonce'],
72
+ 'public_key': json['public_key'],
73
+ };
74
+ }
75
+
76
+ export function ApiKeyToJSON(value?: ApiKey | null): any {
77
+ if (value == null) {
78
+ return value;
79
+ }
80
+ return {
81
+
82
+ 'account_index': value['account_index'],
83
+ 'api_key_index': value['api_key_index'],
84
+ 'nonce': value['nonce'],
85
+ 'public_key': value['public_key'],
86
+ };
87
+ }
88
+
@@ -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,70 @@
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 ReqGetAccountApiKeys
20
+ */
21
+ export interface ReqGetAccountApiKeys {
22
+ /**
23
+ *
24
+ * @type {number}
25
+ * @memberof ReqGetAccountApiKeys
26
+ */
27
+ account_index: number;
28
+ /**
29
+ *
30
+ * @type {number}
31
+ * @memberof ReqGetAccountApiKeys
32
+ */
33
+ api_key_index: number;
34
+ }
35
+
36
+ /**
37
+ * Check if a given object implements the ReqGetAccountApiKeys interface.
38
+ */
39
+ export function instanceOfReqGetAccountApiKeys(value: object): value is ReqGetAccountApiKeys {
40
+ if (!('account_index' in value) || value['account_index'] === undefined) return false;
41
+ if (!('api_key_index' in value) || value['api_key_index'] === undefined) return false;
42
+ return true;
43
+ }
44
+
45
+ export function ReqGetAccountApiKeysFromJSON(json: any): ReqGetAccountApiKeys {
46
+ return ReqGetAccountApiKeysFromJSONTyped(json, false);
47
+ }
48
+
49
+ export function ReqGetAccountApiKeysFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReqGetAccountApiKeys {
50
+ if (json == null) {
51
+ return json;
52
+ }
53
+ return {
54
+
55
+ 'account_index': json['account_index'],
56
+ 'api_key_index': json['api_key_index'],
57
+ };
58
+ }
59
+
60
+ export function ReqGetAccountApiKeysToJSON(value?: ReqGetAccountApiKeys | null): any {
61
+ if (value == null) {
62
+ return value;
63
+ }
64
+ return {
65
+
66
+ 'account_index': value['account_index'],
67
+ 'api_key_index': value['api_key_index'],
68
+ };
69
+ }
70
+
@@ -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
@@ -1,11 +1,13 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export * from './Account';
4
+ export * from './AccountApiKeys';
4
5
  export * from './AccountMarketStats';
5
6
  export * from './AccountPnL';
6
7
  export * from './AccountPosition';
7
8
  export * from './AccountStats';
8
9
  export * from './Accounts';
10
+ export * from './ApiKey';
9
11
  export * from './Block';
10
12
  export * from './Blocks';
11
13
  export * from './Candlestick';
@@ -22,6 +24,7 @@ export * from './Fundings';
22
24
  export * from './L1ProviderInfo';
23
25
  export * from './Layer1BasicInfo';
24
26
  export * from './Layer2BasicInfo';
27
+ export * from './Liquidation';
25
28
  export * from './MarketInfo';
26
29
  export * from './NextNonce';
27
30
  export * from './Order';
@@ -39,6 +42,7 @@ export * from './PriceLevel';
39
42
  export * from './ReqDoFaucet';
40
43
  export * from './ReqGetAccount';
41
44
  export * from './ReqGetAccountActiveOrders';
45
+ export * from './ReqGetAccountApiKeys';
42
46
  export * from './ReqGetAccountByL1Address';
43
47
  export * from './ReqGetAccountInactiveOrders';
44
48
  export * from './ReqGetAccountOrders';
@@ -63,6 +67,7 @@ export * from './ReqGetRecentTrades';
63
67
  export * from './ReqGetRollbacks';
64
68
  export * from './ReqGetTrades';
65
69
  export * from './ReqGetTx';
70
+ export * from './ReqMarkNotifRead';
66
71
  export * from './ReqSearch';
67
72
  export * from './ResultCode';
68
73
  export * from './Rollback';
package/openapi.json CHANGED
@@ -464,6 +464,49 @@
464
464
  "description": "Get accounts by l1_address returns all accounts associated with the given L1 address"
465
465
  }
466
466
  },
467
+ "/api/v1/apikeys": {
468
+ "get": {
469
+ "summary": "GetAccountApiKeys",
470
+ "operationId": "GetAccountApiKeys",
471
+ "responses": {
472
+ "200": {
473
+ "description": "A successful response.",
474
+ "schema": {
475
+ "$ref": "#/definitions/AccountApiKeys"
476
+ }
477
+ },
478
+ "400": {
479
+ "description": "Bad request",
480
+ "schema": {
481
+ "$ref": "#/definitions/ResultCode"
482
+ }
483
+ }
484
+ },
485
+ "parameters": [
486
+ {
487
+ "name": "account_index",
488
+ "in": "query",
489
+ "required": true,
490
+ "type": "integer",
491
+ "format": "int32"
492
+ },
493
+ {
494
+ "name": "api_key_index",
495
+ "in": "query",
496
+ "required": true,
497
+ "type": "integer",
498
+ "format": "uint8"
499
+ }
500
+ ],
501
+ "tags": [
502
+ "account"
503
+ ],
504
+ "consumes": [
505
+ "multipart/form-data"
506
+ ],
507
+ "description": "Get account api key"
508
+ }
509
+ },
467
510
  "/api/v1/block": {
468
511
  "get": {
469
512
  "summary": "GetBlock",
@@ -914,6 +957,67 @@
914
957
  "description": "Get zklighter general info, including contract address, and count of transactions and active users"
915
958
  }
916
959
  },
960
+ "/api/v1/markNotifRead": {
961
+ "get": {
962
+ "summary": "MarkNotifRead",
963
+ "operationId": "MarkNotifRead",
964
+ "responses": {
965
+ "200": {
966
+ "description": "A successful response.",
967
+ "schema": {
968
+ "$ref": "#/definitions/ResultCode"
969
+ }
970
+ },
971
+ "400": {
972
+ "description": "Bad request",
973
+ "schema": {
974
+ "$ref": "#/definitions/ResultCode"
975
+ }
976
+ }
977
+ },
978
+ "parameters": [
979
+ {
980
+ "name": "notif_type",
981
+ "in": "query",
982
+ "required": true,
983
+ "type": "string"
984
+ },
985
+ {
986
+ "name": "account_index",
987
+ "in": "query",
988
+ "required": true,
989
+ "type": "integer",
990
+ "format": "int32"
991
+ },
992
+ {
993
+ "name": "api_key_index",
994
+ "in": "query",
995
+ "required": true,
996
+ "type": "integer",
997
+ "format": "uint8"
998
+ },
999
+ {
1000
+ "name": "liquidation_ids",
1001
+ "in": "query",
1002
+ "required": true,
1003
+ "type": "string"
1004
+ },
1005
+ {
1006
+ "name": "signature",
1007
+ "in": "query",
1008
+ "required": true,
1009
+ "type": "string"
1010
+ }
1011
+ ],
1012
+ "tags": [
1013
+ "liquidation"
1014
+ ],
1015
+ "consumes": [
1016
+ "multipart/form-data"
1017
+ ],
1018
+ "description": "Mark"
1019
+ }
1020
+ },
917
1021
  "/api/v1/nextNonce": {
918
1022
  "get": {
919
1023
  "summary": "GetNextNonce",
@@ -1714,6 +1818,29 @@
1714
1818
  "collateral"
1715
1819
  ]
1716
1820
  },
1821
+ "AccountApiKeys": {
1822
+ "type": "object",
1823
+ "properties": {
1824
+ "code": {
1825
+ "type": "integer",
1826
+ "format": "int32",
1827
+ "example": "100"
1828
+ },
1829
+ "message": {
1830
+ "type": "string"
1831
+ },
1832
+ "api_keys": {
1833
+ "type": "array",
1834
+ "items": {
1835
+ "$ref": "#/definitions/ApiKey"
1836
+ }
1837
+ }
1838
+ },
1839
+ "title": "AccountApiKeys",
1840
+ "required": [
1841
+ "api_keys"
1842
+ ]
1843
+ },
1717
1844
  "AccountMarketStats": {
1718
1845
  "type": "object",
1719
1846
  "properties": {
@@ -1913,6 +2040,36 @@
1913
2040
  "accounts"
1914
2041
  ]
1915
2042
  },
2043
+ "ApiKey": {
2044
+ "type": "object",
2045
+ "properties": {
2046
+ "account_index": {
2047
+ "type": "integer",
2048
+ "format": "int32",
2049
+ "example": "3"
2050
+ },
2051
+ "api_key_index": {
2052
+ "type": "integer",
2053
+ "format": "uint8",
2054
+ "example": "0"
2055
+ },
2056
+ "nonce": {
2057
+ "type": "integer",
2058
+ "format": "int64",
2059
+ "example": "722"
2060
+ },
2061
+ "public_key": {
2062
+ "type": "string"
2063
+ }
2064
+ },
2065
+ "title": "ApiKey",
2066
+ "required": [
2067
+ "account_index",
2068
+ "api_key_index",
2069
+ "nonce",
2070
+ "public_key"
2071
+ ]
2072
+ },
1916
2073
  "Block": {
1917
2074
  "type": "object",
1918
2075
  "properties": {
@@ -2288,7 +2445,7 @@
2288
2445
  "format": "int64",
2289
2446
  "example": "1640995200"
2290
2447
  },
2291
- "verify_at": {
2448
+ "executed_at": {
2292
2449
  "type": "integer",
2293
2450
  "format": "int64",
2294
2451
  "example": "1640995200"
@@ -2307,11 +2464,6 @@
2307
2464
  "type": "integer",
2308
2465
  "format": "int64",
2309
2466
  "example": "1640995200"
2310
- },
2311
- "executed_at": {
2312
- "type": "integer",
2313
- "format": "int64",
2314
- "example": "1640995200"
2315
2467
  }
2316
2468
  },
2317
2469
  "title": "EnrichedTx",
@@ -2545,6 +2697,24 @@
2545
2697
  "total_transaction_count"
2546
2698
  ]
2547
2699
  },
2700
+ "Liquidation": {
2701
+ "type": "object",
2702
+ "properties": {
2703
+ "LiquidationId": {
2704
+ "type": "integer",
2705
+ "format": "int64"
2706
+ },
2707
+ "AccountIndex": {
2708
+ "type": "integer",
2709
+ "format": "int32"
2710
+ },
2711
+ "LiquidationType": {
2712
+ "type": "integer",
2713
+ "format": "uint8"
2714
+ }
2715
+ },
2716
+ "title": "Liquidation"
2717
+ },
2548
2718
  "MarketInfo": {
2549
2719
  "type": "object",
2550
2720
  "properties": {
@@ -3288,6 +3458,24 @@
3288
3458
  "market_id"
3289
3459
  ]
3290
3460
  },
3461
+ "ReqGetAccountApiKeys": {
3462
+ "type": "object",
3463
+ "properties": {
3464
+ "account_index": {
3465
+ "type": "integer",
3466
+ "format": "int32"
3467
+ },
3468
+ "api_key_index": {
3469
+ "type": "integer",
3470
+ "format": "uint8"
3471
+ }
3472
+ },
3473
+ "title": "ReqGetAccountApiKeys",
3474
+ "required": [
3475
+ "account_index",
3476
+ "api_key_index"
3477
+ ]
3478
+ },
3291
3479
  "ReqGetAccountByL1Address": {
3292
3480
  "type": "object",
3293
3481
  "properties": {
@@ -3885,6 +4073,36 @@
3885
4073
  "value"
3886
4074
  ]
3887
4075
  },
4076
+ "ReqMarkNotifRead": {
4077
+ "type": "object",
4078
+ "properties": {
4079
+ "notif_type": {
4080
+ "type": "string"
4081
+ },
4082
+ "account_index": {
4083
+ "type": "integer",
4084
+ "format": "int32"
4085
+ },
4086
+ "api_key_index": {
4087
+ "type": "integer",
4088
+ "format": "uint8"
4089
+ },
4090
+ "liquidation_ids": {
4091
+ "type": "string"
4092
+ },
4093
+ "signature": {
4094
+ "type": "string"
4095
+ }
4096
+ },
4097
+ "title": "ReqMarkNotifRead",
4098
+ "required": [
4099
+ "notif_type",
4100
+ "account_index",
4101
+ "api_key_index",
4102
+ "liquidation_ids",
4103
+ "signature"
4104
+ ]
4105
+ },
3888
4106
  "ReqSearch": {
3889
4107
  "type": "object",
3890
4108
  "properties": {
@@ -4295,7 +4513,7 @@
4295
4513
  "format": "int64",
4296
4514
  "example": "1640995200"
4297
4515
  },
4298
- "verify_at": {
4516
+ "executed_at": {
4299
4517
  "type": "integer",
4300
4518
  "format": "int64",
4301
4519
  "example": "1640995200"
@@ -4320,7 +4538,7 @@
4320
4538
  "expire_at",
4321
4539
  "block_height",
4322
4540
  "created_at",
4323
- "verify_at",
4541
+ "executed_at",
4324
4542
  "sequence_index"
4325
4543
  ]
4326
4544
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklighter-perps",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "description": "zkLighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {