zklighter-perps 1.0.69 → 1.0.70

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.
@@ -79,6 +79,7 @@ models/ReqGetNextNonce.ts
79
79
  models/ReqGetOrderBookDetails.ts
80
80
  models/ReqGetOrderBookOrders.ts
81
81
  models/ReqGetOrderBooks.ts
82
+ models/ReqGetPublicPool.ts
82
83
  models/ReqGetPublicPools.ts
83
84
  models/ReqGetRangeWithCursor.ts
84
85
  models/ReqGetRangeWithIndex.ts
@@ -18,6 +18,7 @@ import type {
18
18
  AccountApiKeys,
19
19
  AccountPnL,
20
20
  Accounts,
21
+ DetailedAccount,
21
22
  DetailedAccounts,
22
23
  FeeBucket,
23
24
  IsWhitelisted,
@@ -33,6 +34,8 @@ import {
33
34
  AccountPnLToJSON,
34
35
  AccountsFromJSON,
35
36
  AccountsToJSON,
37
+ DetailedAccountFromJSON,
38
+ DetailedAccountToJSON,
36
39
  DetailedAccountsFromJSON,
37
40
  DetailedAccountsToJSON,
38
41
  FeeBucketFromJSON,
@@ -96,10 +99,16 @@ export interface PnlRequest {
96
99
  ignore_transfers?: boolean;
97
100
  }
98
101
 
102
+ export interface PublicPoolRequest {
103
+ index: number;
104
+ account_index?: number;
105
+ }
106
+
99
107
  export interface PublicPoolsRequest {
100
108
  filter: string;
101
109
  index: number;
102
110
  limit: number;
111
+ account_index?: number;
103
112
  }
104
113
 
105
114
  /**
@@ -551,6 +560,49 @@ export class AccountApi extends runtime.BaseAPI {
551
560
  return await response.value();
552
561
  }
553
562
 
563
+ /**
564
+ * Get public pool
565
+ * publicPool
566
+ */
567
+ async publicPoolRaw(requestParameters: PublicPoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DetailedAccount>> {
568
+ if (requestParameters['index'] == null) {
569
+ throw new runtime.RequiredError(
570
+ 'index',
571
+ 'Required parameter "index" was null or undefined when calling publicPool().'
572
+ );
573
+ }
574
+
575
+ const queryParameters: any = {};
576
+
577
+ if (requestParameters['index'] != null) {
578
+ queryParameters['index'] = requestParameters['index'];
579
+ }
580
+
581
+ if (requestParameters['account_index'] != null) {
582
+ queryParameters['account_index'] = requestParameters['account_index'];
583
+ }
584
+
585
+ const headerParameters: runtime.HTTPHeaders = {};
586
+
587
+ const response = await this.request({
588
+ path: `/api/v1/publicPool`,
589
+ method: 'GET',
590
+ headers: headerParameters,
591
+ query: queryParameters,
592
+ }, initOverrides);
593
+
594
+ return new runtime.JSONApiResponse(response, (jsonValue) => DetailedAccountFromJSON(jsonValue));
595
+ }
596
+
597
+ /**
598
+ * Get public pool
599
+ * publicPool
600
+ */
601
+ async publicPool(requestParameters: PublicPoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DetailedAccount> {
602
+ const response = await this.publicPoolRaw(requestParameters, initOverrides);
603
+ return await response.value();
604
+ }
605
+
554
606
  /**
555
607
  * Get public pools
556
608
  * publicPools
@@ -591,6 +643,10 @@ export class AccountApi extends runtime.BaseAPI {
591
643
  queryParameters['limit'] = requestParameters['limit'];
592
644
  }
593
645
 
646
+ if (requestParameters['account_index'] != null) {
647
+ queryParameters['account_index'] = requestParameters['account_index'];
648
+ }
649
+
594
650
  const headerParameters: runtime.HTTPHeaders = {};
595
651
 
596
652
  const response = await this.request({
@@ -146,6 +146,12 @@ export interface DetailedAccount {
146
146
  * @memberof DetailedAccount
147
147
  */
148
148
  shares: Array<PublicPoolShare>;
149
+ /**
150
+ *
151
+ * @type {PublicPoolShare}
152
+ * @memberof DetailedAccount
153
+ */
154
+ account_share: PublicPoolShare;
149
155
  }
150
156
 
151
157
  /**
@@ -168,6 +174,7 @@ export function instanceOfDetailedAccount(value: object): value is DetailedAccou
168
174
  if (!('market_stats' in value) || value['market_stats'] === undefined) return false;
169
175
  if (!('pool_info' in value) || value['pool_info'] === undefined) return false;
170
176
  if (!('shares' in value) || value['shares'] === undefined) return false;
177
+ if (!('account_share' in value) || value['account_share'] === undefined) return false;
171
178
  return true;
172
179
  }
173
180
 
@@ -198,6 +205,7 @@ export function DetailedAccountFromJSONTyped(json: any, ignoreDiscriminator: boo
198
205
  'market_stats': ((json['market_stats'] as Array<any>).map(AccountMarketStatsFromJSON)),
199
206
  'pool_info': PublicPoolInfoFromJSON(json['pool_info']),
200
207
  'shares': ((json['shares'] as Array<any>).map(PublicPoolShareFromJSON)),
208
+ 'account_share': PublicPoolShareFromJSON(json['account_share']),
201
209
  };
202
210
  }
203
211
 
@@ -224,6 +232,7 @@ export function DetailedAccountToJSON(value?: DetailedAccount | null): any {
224
232
  'market_stats': ((value['market_stats'] as Array<any>).map(AccountMarketStatsToJSON)),
225
233
  'pool_info': PublicPoolInfoToJSON(value['pool_info']),
226
234
  'shares': ((value['shares'] as Array<any>).map(PublicPoolShareToJSON)),
235
+ 'account_share': PublicPoolShareToJSON(value['account_share']),
227
236
  };
228
237
  }
229
238
 
@@ -19,6 +19,12 @@ import {
19
19
  PublicPoolInfoFromJSONTyped,
20
20
  PublicPoolInfoToJSON,
21
21
  } from './PublicPoolInfo';
22
+ import type { PublicPoolShare } from './PublicPoolShare';
23
+ import {
24
+ PublicPoolShareFromJSON,
25
+ PublicPoolShareFromJSONTyped,
26
+ PublicPoolShareToJSON,
27
+ } from './PublicPoolShare';
22
28
 
23
29
  /**
24
30
  *
@@ -110,6 +116,12 @@ export interface PublicPool {
110
116
  * @memberof PublicPool
111
117
  */
112
118
  pool_info: PublicPoolInfo;
119
+ /**
120
+ *
121
+ * @type {PublicPoolShare}
122
+ * @memberof PublicPool
123
+ */
124
+ account_share: PublicPoolShare;
113
125
  }
114
126
 
115
127
  /**
@@ -129,6 +141,7 @@ export function instanceOfPublicPool(value: object): value is PublicPool {
129
141
  if (!('description' in value) || value['description'] === undefined) return false;
130
142
  if (!('total_asset_value' in value) || value['total_asset_value'] === undefined) return false;
131
143
  if (!('pool_info' in value) || value['pool_info'] === undefined) return false;
144
+ if (!('account_share' in value) || value['account_share'] === undefined) return false;
132
145
  return true;
133
146
  }
134
147
 
@@ -156,6 +169,7 @@ export function PublicPoolFromJSONTyped(json: any, ignoreDiscriminator: boolean)
156
169
  'description': json['description'],
157
170
  'total_asset_value': json['total_asset_value'],
158
171
  'pool_info': PublicPoolInfoFromJSON(json['pool_info']),
172
+ 'account_share': PublicPoolShareFromJSON(json['account_share']),
159
173
  };
160
174
  }
161
175
 
@@ -179,6 +193,7 @@ export function PublicPoolToJSON(value?: PublicPool | null): any {
179
193
  'description': value['description'],
180
194
  'total_asset_value': value['total_asset_value'],
181
195
  'pool_info': PublicPoolInfoToJSON(value['pool_info']),
196
+ 'account_share': PublicPoolShareToJSON(value['account_share']),
182
197
  };
183
198
  }
184
199
 
@@ -0,0 +1,69 @@
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 ReqGetPublicPool
20
+ */
21
+ export interface ReqGetPublicPool {
22
+ /**
23
+ *
24
+ * @type {number}
25
+ * @memberof ReqGetPublicPool
26
+ */
27
+ index: number;
28
+ /**
29
+ *
30
+ * @type {number}
31
+ * @memberof ReqGetPublicPool
32
+ */
33
+ account_index?: number;
34
+ }
35
+
36
+ /**
37
+ * Check if a given object implements the ReqGetPublicPool interface.
38
+ */
39
+ export function instanceOfReqGetPublicPool(value: object): value is ReqGetPublicPool {
40
+ if (!('index' in value) || value['index'] === undefined) return false;
41
+ return true;
42
+ }
43
+
44
+ export function ReqGetPublicPoolFromJSON(json: any): ReqGetPublicPool {
45
+ return ReqGetPublicPoolFromJSONTyped(json, false);
46
+ }
47
+
48
+ export function ReqGetPublicPoolFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReqGetPublicPool {
49
+ if (json == null) {
50
+ return json;
51
+ }
52
+ return {
53
+
54
+ 'index': json['index'],
55
+ 'account_index': json['account_index'] == null ? undefined : json['account_index'],
56
+ };
57
+ }
58
+
59
+ export function ReqGetPublicPoolToJSON(value?: ReqGetPublicPool | null): any {
60
+ if (value == null) {
61
+ return value;
62
+ }
63
+ return {
64
+
65
+ 'index': value['index'],
66
+ 'account_index': value['account_index'],
67
+ };
68
+ }
69
+
@@ -37,6 +37,12 @@ export interface ReqGetPublicPools {
37
37
  * @memberof ReqGetPublicPools
38
38
  */
39
39
  limit: number;
40
+ /**
41
+ *
42
+ * @type {number}
43
+ * @memberof ReqGetPublicPools
44
+ */
45
+ account_index?: number;
40
46
  }
41
47
 
42
48
  /**
@@ -62,6 +68,7 @@ export function ReqGetPublicPoolsFromJSONTyped(json: any, ignoreDiscriminator: b
62
68
  'filter': json['filter'],
63
69
  'index': json['index'],
64
70
  'limit': json['limit'],
71
+ 'account_index': json['account_index'] == null ? undefined : json['account_index'],
65
72
  };
66
73
  }
67
74
 
@@ -74,6 +81,7 @@ export function ReqGetPublicPoolsToJSON(value?: ReqGetPublicPools | null): any {
74
81
  'filter': value['filter'],
75
82
  'index': value['index'],
76
83
  'limit': value['limit'],
84
+ 'account_index': value['account_index'],
77
85
  };
78
86
  }
79
87
 
package/models/index.ts CHANGED
@@ -71,6 +71,7 @@ export * from './ReqGetNextNonce';
71
71
  export * from './ReqGetOrderBookDetails';
72
72
  export * from './ReqGetOrderBookOrders';
73
73
  export * from './ReqGetOrderBooks';
74
+ export * from './ReqGetPublicPool';
74
75
  export * from './ReqGetPublicPools';
75
76
  export * from './ReqGetRangeWithCursor';
76
77
  export * from './ReqGetRangeWithIndex';
package/openapi.json CHANGED
@@ -1381,6 +1381,49 @@
1381
1381
  "description": "Get account PnL chart"
1382
1382
  }
1383
1383
  },
1384
+ "/api/v1/publicPool": {
1385
+ "get": {
1386
+ "summary": "publicPool",
1387
+ "operationId": "publicPool",
1388
+ "responses": {
1389
+ "200": {
1390
+ "description": "A successful response.",
1391
+ "schema": {
1392
+ "$ref": "#/definitions/DetailedAccount"
1393
+ }
1394
+ },
1395
+ "400": {
1396
+ "description": "Bad request",
1397
+ "schema": {
1398
+ "$ref": "#/definitions/ResultCode"
1399
+ }
1400
+ }
1401
+ },
1402
+ "parameters": [
1403
+ {
1404
+ "name": "index",
1405
+ "in": "query",
1406
+ "required": true,
1407
+ "type": "integer",
1408
+ "format": "int64"
1409
+ },
1410
+ {
1411
+ "name": "account_index",
1412
+ "in": "query",
1413
+ "required": false,
1414
+ "type": "integer",
1415
+ "format": "int64"
1416
+ }
1417
+ ],
1418
+ "tags": [
1419
+ "account"
1420
+ ],
1421
+ "consumes": [
1422
+ "multipart/form-data"
1423
+ ],
1424
+ "description": "Get public pool"
1425
+ }
1426
+ },
1384
1427
  "/api/v1/publicPools": {
1385
1428
  "get": {
1386
1429
  "summary": "publicPools",
@@ -1421,6 +1464,13 @@
1421
1464
  "format": "int64",
1422
1465
  "minimum": 1,
1423
1466
  "maximum": 100
1467
+ },
1468
+ {
1469
+ "name": "account_index",
1470
+ "in": "query",
1471
+ "required": false,
1472
+ "type": "integer",
1473
+ "format": "int64"
1424
1474
  }
1425
1475
  ],
1426
1476
  "tags": [
@@ -2457,6 +2507,9 @@
2457
2507
  "items": {
2458
2508
  "$ref": "#/definitions/PublicPoolShare"
2459
2509
  }
2510
+ },
2511
+ "account_share": {
2512
+ "$ref": "#/definitions/PublicPoolShare"
2460
2513
  }
2461
2514
  },
2462
2515
  "title": "DetailedAccount",
@@ -2476,7 +2529,8 @@
2476
2529
  "total_asset_value",
2477
2530
  "market_stats",
2478
2531
  "pool_info",
2479
- "shares"
2532
+ "shares",
2533
+ "account_share"
2480
2534
  ]
2481
2535
  },
2482
2536
  "DetailedAccounts": {
@@ -3908,6 +3962,9 @@
3908
3962
  },
3909
3963
  "pool_info": {
3910
3964
  "$ref": "#/definitions/PublicPoolInfo"
3965
+ },
3966
+ "account_share": {
3967
+ "$ref": "#/definitions/PublicPoolShare"
3911
3968
  }
3912
3969
  },
3913
3970
  "title": "PublicPool",
@@ -3924,7 +3981,8 @@
3924
3981
  "name",
3925
3982
  "description",
3926
3983
  "total_asset_value",
3927
- "pool_info"
3984
+ "pool_info",
3985
+ "account_share"
3928
3986
  ]
3929
3987
  },
3930
3988
  "PublicPoolInfo": {
@@ -4510,6 +4568,23 @@
4510
4568
  },
4511
4569
  "title": "ReqGetOrderBooks"
4512
4570
  },
4571
+ "ReqGetPublicPool": {
4572
+ "type": "object",
4573
+ "properties": {
4574
+ "index": {
4575
+ "type": "integer",
4576
+ "format": "int64"
4577
+ },
4578
+ "account_index": {
4579
+ "type": "integer",
4580
+ "format": "int64"
4581
+ }
4582
+ },
4583
+ "title": "ReqGetPublicPool",
4584
+ "required": [
4585
+ "index"
4586
+ ]
4587
+ },
4513
4588
  "ReqGetPublicPools": {
4514
4589
  "type": "object",
4515
4590
  "properties": {
@@ -4525,6 +4600,10 @@
4525
4600
  "format": "int64",
4526
4601
  "maximum": 100,
4527
4602
  "minimum": 1
4603
+ },
4604
+ "account_index": {
4605
+ "type": "integer",
4606
+ "format": "int64"
4528
4607
  }
4529
4608
  },
4530
4609
  "title": "ReqGetPublicPools",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklighter-perps",
3
- "version": "1.0.69",
3
+ "version": "1.0.70",
4
4
  "description": "zkLighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {