zklighter-perps 1.0.108 → 1.0.110

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.
@@ -16,6 +16,7 @@ models/Account.ts
16
16
  models/AccountApiKeys.ts
17
17
  models/AccountMarketStats.ts
18
18
  models/AccountMetadata.ts
19
+ models/AccountMetadatas.ts
19
20
  models/AccountPnL.ts
20
21
  models/AccountPosition.ts
21
22
  models/AccountStats.ts
@@ -82,6 +83,7 @@ models/ReqGetAccountActiveOrders.ts
82
83
  models/ReqGetAccountApiKeys.ts
83
84
  models/ReqGetAccountByL1Address.ts
84
85
  models/ReqGetAccountInactiveOrders.ts
86
+ models/ReqGetAccountMetadata.ts
85
87
  models/ReqGetAccountOrders.ts
86
88
  models/ReqGetAccountPendingTxs.ts
87
89
  models/ReqGetAccountPnL.ts
@@ -16,6 +16,7 @@
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
18
  AccountApiKeys,
19
+ AccountMetadatas,
19
20
  AccountPnL,
20
21
  Accounts,
21
22
  DetailedAccounts,
@@ -30,6 +31,8 @@ import type {
30
31
  import {
31
32
  AccountApiKeysFromJSON,
32
33
  AccountApiKeysToJSON,
34
+ AccountMetadatasFromJSON,
35
+ AccountMetadatasToJSON,
33
36
  AccountPnLFromJSON,
34
37
  AccountPnLToJSON,
35
38
  AccountsFromJSON,
@@ -57,6 +60,12 @@ export interface AccountRequest {
57
60
  value: string;
58
61
  }
59
62
 
63
+ export interface AccountMetadataRequest {
64
+ by: AccountMetadataByEnum;
65
+ value: string;
66
+ auth?: string;
67
+ }
68
+
60
69
  export interface AccountsRequest {
61
70
  limit: number;
62
71
  index?: number;
@@ -169,6 +178,60 @@ export class AccountApi extends runtime.BaseAPI {
169
178
  return await response.value();
170
179
  }
171
180
 
181
+ /**
182
+ * Get account metadatas
183
+ * accountMetadata
184
+ */
185
+ async accountMetadataRaw(requestParameters: AccountMetadataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AccountMetadatas>> {
186
+ if (requestParameters['by'] == null) {
187
+ throw new runtime.RequiredError(
188
+ 'by',
189
+ 'Required parameter "by" was null or undefined when calling accountMetadata().'
190
+ );
191
+ }
192
+
193
+ if (requestParameters['value'] == null) {
194
+ throw new runtime.RequiredError(
195
+ 'value',
196
+ 'Required parameter "value" was null or undefined when calling accountMetadata().'
197
+ );
198
+ }
199
+
200
+ const queryParameters: any = {};
201
+
202
+ if (requestParameters['by'] != null) {
203
+ queryParameters['by'] = requestParameters['by'];
204
+ }
205
+
206
+ if (requestParameters['value'] != null) {
207
+ queryParameters['value'] = requestParameters['value'];
208
+ }
209
+
210
+ if (requestParameters['auth'] != null) {
211
+ queryParameters['auth'] = requestParameters['auth'];
212
+ }
213
+
214
+ const headerParameters: runtime.HTTPHeaders = {};
215
+
216
+ const response = await this.request({
217
+ path: `/api/v1/accountMetadata`,
218
+ method: 'GET',
219
+ headers: headerParameters,
220
+ query: queryParameters,
221
+ }, initOverrides);
222
+
223
+ return new runtime.JSONApiResponse(response, (jsonValue) => AccountMetadatasFromJSON(jsonValue));
224
+ }
225
+
226
+ /**
227
+ * Get account metadatas
228
+ * accountMetadata
229
+ */
230
+ async accountMetadata(requestParameters: AccountMetadataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AccountMetadatas> {
231
+ const response = await this.accountMetadataRaw(requestParameters, initOverrides);
232
+ return await response.value();
233
+ }
234
+
172
235
  /**
173
236
  * Get accounts returns accounts by account index
174
237
  * accounts
@@ -686,6 +749,14 @@ export const AccountByEnum = {
686
749
  L1Address: 'l1_address'
687
750
  } as const;
688
751
  export type AccountByEnum = typeof AccountByEnum[keyof typeof AccountByEnum];
752
+ /**
753
+ * @export
754
+ */
755
+ export const AccountMetadataByEnum = {
756
+ Index: 'index',
757
+ L1Address: 'l1_address'
758
+ } as const;
759
+ export type AccountMetadataByEnum = typeof AccountMetadataByEnum[keyof typeof AccountMetadataByEnum];
689
760
  /**
690
761
  * @export
691
762
  */
@@ -0,0 +1,85 @@
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 { Mapint64AccountMetadata } from './Mapint64AccountMetadata';
17
+ import {
18
+ Mapint64AccountMetadataFromJSON,
19
+ Mapint64AccountMetadataFromJSONTyped,
20
+ Mapint64AccountMetadataToJSON,
21
+ } from './Mapint64AccountMetadata';
22
+
23
+ /**
24
+ *
25
+ * @export
26
+ * @interface AccountMetadatas
27
+ */
28
+ export interface AccountMetadatas {
29
+ /**
30
+ *
31
+ * @type {number}
32
+ * @memberof AccountMetadatas
33
+ */
34
+ code: number;
35
+ /**
36
+ *
37
+ * @type {string}
38
+ * @memberof AccountMetadatas
39
+ */
40
+ message?: string;
41
+ /**
42
+ *
43
+ * @type {Mapint64AccountMetadata}
44
+ * @memberof AccountMetadatas
45
+ */
46
+ account_metadatas: Mapint64AccountMetadata;
47
+ }
48
+
49
+ /**
50
+ * Check if a given object implements the AccountMetadatas interface.
51
+ */
52
+ export function instanceOfAccountMetadatas(value: object): value is AccountMetadatas {
53
+ if (!('code' in value) || value['code'] === undefined) return false;
54
+ if (!('account_metadatas' in value) || value['account_metadatas'] === undefined) return false;
55
+ return true;
56
+ }
57
+
58
+ export function AccountMetadatasFromJSON(json: any): AccountMetadatas {
59
+ return AccountMetadatasFromJSONTyped(json, false);
60
+ }
61
+
62
+ export function AccountMetadatasFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountMetadatas {
63
+ if (json == null) {
64
+ return json;
65
+ }
66
+ return {
67
+
68
+ 'code': json['code'],
69
+ 'message': json['message'] == null ? undefined : json['message'],
70
+ 'account_metadatas': Mapint64AccountMetadataFromJSON(json['account_metadatas']),
71
+ };
72
+ }
73
+
74
+ export function AccountMetadatasToJSON(value?: AccountMetadatas | null): any {
75
+ if (value == null) {
76
+ return value;
77
+ }
78
+ return {
79
+
80
+ 'code': value['code'],
81
+ 'message': value['message'],
82
+ 'account_metadatas': Mapint64AccountMetadataToJSON(value['account_metadatas']),
83
+ };
84
+ }
85
+
@@ -0,0 +1,89 @@
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 ReqGetAccountMetadata
20
+ */
21
+ export interface ReqGetAccountMetadata {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof ReqGetAccountMetadata
26
+ */
27
+ by: ReqGetAccountMetadataByEnum;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof ReqGetAccountMetadata
32
+ */
33
+ value: string;
34
+ /**
35
+ *
36
+ * @type {string}
37
+ * @memberof ReqGetAccountMetadata
38
+ */
39
+ auth?: string;
40
+ }
41
+
42
+
43
+ /**
44
+ * @export
45
+ */
46
+ export const ReqGetAccountMetadataByEnum = {
47
+ Index: 'index',
48
+ L1Address: 'l1_address'
49
+ } as const;
50
+ export type ReqGetAccountMetadataByEnum = typeof ReqGetAccountMetadataByEnum[keyof typeof ReqGetAccountMetadataByEnum];
51
+
52
+
53
+ /**
54
+ * Check if a given object implements the ReqGetAccountMetadata interface.
55
+ */
56
+ export function instanceOfReqGetAccountMetadata(value: object): value is ReqGetAccountMetadata {
57
+ if (!('by' in value) || value['by'] === undefined) return false;
58
+ if (!('value' in value) || value['value'] === undefined) return false;
59
+ return true;
60
+ }
61
+
62
+ export function ReqGetAccountMetadataFromJSON(json: any): ReqGetAccountMetadata {
63
+ return ReqGetAccountMetadataFromJSONTyped(json, false);
64
+ }
65
+
66
+ export function ReqGetAccountMetadataFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReqGetAccountMetadata {
67
+ if (json == null) {
68
+ return json;
69
+ }
70
+ return {
71
+
72
+ 'by': json['by'],
73
+ 'value': json['value'],
74
+ 'auth': json['auth'] == null ? undefined : json['auth'],
75
+ };
76
+ }
77
+
78
+ export function ReqGetAccountMetadataToJSON(value?: ReqGetAccountMetadata | null): any {
79
+ if (value == null) {
80
+ return value;
81
+ }
82
+ return {
83
+
84
+ 'by': value['by'],
85
+ 'value': value['value'],
86
+ 'auth': value['auth'],
87
+ };
88
+ }
89
+
package/models/index.ts CHANGED
@@ -4,6 +4,7 @@ export * from './Account';
4
4
  export * from './AccountApiKeys';
5
5
  export * from './AccountMarketStats';
6
6
  export * from './AccountMetadata';
7
+ export * from './AccountMetadatas';
7
8
  export * from './AccountPnL';
8
9
  export * from './AccountPosition';
9
10
  export * from './AccountStats';
@@ -70,6 +71,7 @@ export * from './ReqGetAccountActiveOrders';
70
71
  export * from './ReqGetAccountApiKeys';
71
72
  export * from './ReqGetAccountByL1Address';
72
73
  export * from './ReqGetAccountInactiveOrders';
74
+ export * from './ReqGetAccountMetadata';
73
75
  export * from './ReqGetAccountOrders';
74
76
  export * from './ReqGetAccountPendingTxs';
75
77
  export * from './ReqGetAccountPnL';
package/openapi.json CHANGED
@@ -206,6 +206,57 @@
206
206
  "description": "Get account inactive orders"
207
207
  }
208
208
  },
209
+ "/api/v1/accountMetadata": {
210
+ "get": {
211
+ "summary": "accountMetadata",
212
+ "operationId": "accountMetadata",
213
+ "responses": {
214
+ "200": {
215
+ "description": "A successful response.",
216
+ "schema": {
217
+ "$ref": "#/definitions/AccountMetadatas"
218
+ }
219
+ },
220
+ "400": {
221
+ "description": "Bad request",
222
+ "schema": {
223
+ "$ref": "#/definitions/ResultCode"
224
+ }
225
+ }
226
+ },
227
+ "parameters": [
228
+ {
229
+ "name": "by",
230
+ "in": "query",
231
+ "required": true,
232
+ "type": "string",
233
+ "enum": [
234
+ "index",
235
+ "l1_address"
236
+ ]
237
+ },
238
+ {
239
+ "name": "value",
240
+ "in": "query",
241
+ "required": true,
242
+ "type": "string"
243
+ },
244
+ {
245
+ "name": "auth",
246
+ "in": "query",
247
+ "required": false,
248
+ "type": "string"
249
+ }
250
+ ],
251
+ "tags": [
252
+ "account"
253
+ ],
254
+ "consumes": [
255
+ "multipart/form-data"
256
+ ],
257
+ "description": "Get account metadatas"
258
+ }
259
+ },
209
260
  "/api/v1/accountOrders": {
210
261
  "get": {
211
262
  "summary": "accountOrders",
@@ -738,14 +789,18 @@
738
789
  "in": "query",
739
790
  "required": true,
740
791
  "type": "integer",
741
- "format": "int64"
792
+ "format": "int64",
793
+ "minimum": 0,
794
+ "maximum": 5000000000000
742
795
  },
743
796
  {
744
797
  "name": "end_timestamp",
745
798
  "in": "query",
746
799
  "required": true,
747
800
  "type": "integer",
748
- "format": "int64"
801
+ "format": "int64",
802
+ "minimum": 0,
803
+ "maximum": 5000000000000
749
804
  },
750
805
  {
751
806
  "name": "count_back",
@@ -1225,14 +1280,18 @@
1225
1280
  "in": "query",
1226
1281
  "required": true,
1227
1282
  "type": "integer",
1228
- "format": "int64"
1283
+ "format": "int64",
1284
+ "minimum": 0,
1285
+ "maximum": 5000000000000
1229
1286
  },
1230
1287
  {
1231
1288
  "name": "end_timestamp",
1232
1289
  "in": "query",
1233
1290
  "required": true,
1234
1291
  "type": "integer",
1235
- "format": "int64"
1292
+ "format": "int64",
1293
+ "minimum": 0,
1294
+ "maximum": 5000000000000
1236
1295
  },
1237
1296
  {
1238
1297
  "name": "count_back",
@@ -1676,14 +1735,18 @@
1676
1735
  "in": "query",
1677
1736
  "required": true,
1678
1737
  "type": "integer",
1679
- "format": "int64"
1738
+ "format": "int64",
1739
+ "minimum": 0,
1740
+ "maximum": 5000000000000
1680
1741
  },
1681
1742
  {
1682
1743
  "name": "end_timestamp",
1683
1744
  "in": "query",
1684
1745
  "required": true,
1685
1746
  "type": "integer",
1686
- "format": "int64"
1747
+ "format": "int64",
1748
+ "minimum": 0,
1749
+ "maximum": 5000000000000
1687
1750
  },
1688
1751
  {
1689
1752
  "name": "count_back",
@@ -2671,6 +2734,27 @@
2671
2734
  "max_referral_usage_limit"
2672
2735
  ]
2673
2736
  },
2737
+ "AccountMetadatas": {
2738
+ "type": "object",
2739
+ "properties": {
2740
+ "code": {
2741
+ "type": "integer",
2742
+ "format": "int32",
2743
+ "example": "200"
2744
+ },
2745
+ "message": {
2746
+ "type": "string"
2747
+ },
2748
+ "account_metadatas": {
2749
+ "$ref": "#/definitions/mapint64AccountMetadata"
2750
+ }
2751
+ },
2752
+ "title": "AccountMetadatas",
2753
+ "required": [
2754
+ "code",
2755
+ "account_metadatas"
2756
+ ]
2757
+ },
2674
2758
  "AccountPnL": {
2675
2759
  "type": "object",
2676
2760
  "properties": {
@@ -5606,6 +5690,29 @@
5606
5690
  "limit"
5607
5691
  ]
5608
5692
  },
5693
+ "ReqGetAccountMetadata": {
5694
+ "type": "object",
5695
+ "properties": {
5696
+ "by": {
5697
+ "type": "string",
5698
+ "enum": [
5699
+ "index",
5700
+ "l1_address"
5701
+ ]
5702
+ },
5703
+ "value": {
5704
+ "type": "string"
5705
+ },
5706
+ "auth": {
5707
+ "type": "string"
5708
+ }
5709
+ },
5710
+ "title": "ReqGetAccountMetadata",
5711
+ "required": [
5712
+ "by",
5713
+ "value"
5714
+ ]
5715
+ },
5609
5716
  "ReqGetAccountOrders": {
5610
5717
  "type": "object",
5611
5718
  "properties": {
@@ -5681,11 +5788,13 @@
5681
5788
  },
5682
5789
  "start_timestamp": {
5683
5790
  "type": "integer",
5684
- "format": "int64"
5791
+ "format": "int64",
5792
+ "maximum": 5000000000000
5685
5793
  },
5686
5794
  "end_timestamp": {
5687
5795
  "type": "integer",
5688
- "format": "int64"
5796
+ "format": "int64",
5797
+ "maximum": 5000000000000
5689
5798
  },
5690
5799
  "count_back": {
5691
5800
  "type": "integer",
@@ -5818,11 +5927,13 @@
5818
5927
  },
5819
5928
  "start_timestamp": {
5820
5929
  "type": "integer",
5821
- "format": "int64"
5930
+ "format": "int64",
5931
+ "maximum": 5000000000000
5822
5932
  },
5823
5933
  "end_timestamp": {
5824
5934
  "type": "integer",
5825
- "format": "int64"
5935
+ "format": "int64",
5936
+ "maximum": 5000000000000
5826
5937
  },
5827
5938
  "count_back": {
5828
5939
  "type": "integer",
@@ -5898,11 +6009,13 @@
5898
6009
  },
5899
6010
  "start_timestamp": {
5900
6011
  "type": "integer",
5901
- "format": "int64"
6012
+ "format": "int64",
6013
+ "maximum": 5000000000000
5902
6014
  },
5903
6015
  "end_timestamp": {
5904
6016
  "type": "integer",
5905
- "format": "int64"
6017
+ "format": "int64",
6018
+ "maximum": 5000000000000
5906
6019
  },
5907
6020
  "count_back": {
5908
6021
  "type": "integer",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklighter-perps",
3
- "version": "1.0.108",
3
+ "version": "1.0.110",
4
4
  "description": "zkLighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {