zklighter-perps 1.0.269 → 1.0.270

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.
@@ -94,6 +94,8 @@ models/MarkPriceCandle.ts
94
94
  models/MarkPriceCandles.ts
95
95
  models/MarketConfig.ts
96
96
  models/MarketMetricData.ts
97
+ models/MarketPriceChart.ts
98
+ models/MarketPriceCharts.ts
97
99
  models/NextNonce.ts
98
100
  models/NotificationPreferences.ts
99
101
  models/Order.ts
@@ -162,6 +164,7 @@ models/ReqGetLiquidationInfos.ts
162
164
  models/ReqGetMakerOnlyApiKeys.ts
163
165
  models/ReqGetMarkPriceCandles.ts
164
166
  models/ReqGetMarketMetrics.ts
167
+ models/ReqGetMarketPriceCharts.ts
165
168
  models/ReqGetNextNonce.ts
166
169
  models/ReqGetOrderBookDetails.ts
167
170
  models/ReqGetOrderBookOrders.ts
@@ -248,6 +248,7 @@ export interface PositionFundingRequest {
248
248
  authorization?: string;
249
249
  auth?: string;
250
250
  market_id?: number;
251
+ market_ids?: number;
251
252
  cursor?: string;
252
253
  side?: PositionFundingSideEnum;
253
254
  start_timestamp?: number;
@@ -1558,6 +1559,10 @@ export class AccountApi extends runtime.BaseAPI {
1558
1559
  queryParameters['market_id'] = requestParameters['market_id'];
1559
1560
  }
1560
1561
 
1562
+ if (requestParameters['market_ids'] != null) {
1563
+ queryParameters['market_ids'] = requestParameters['market_ids'];
1564
+ }
1565
+
1561
1566
  if (requestParameters['cursor'] != null) {
1562
1567
  queryParameters['cursor'] = requestParameters['cursor'];
1563
1568
  }
@@ -18,6 +18,7 @@ import type {
18
18
  Candles,
19
19
  Fundings,
20
20
  MarkPriceCandles,
21
+ MarketPriceCharts,
21
22
  ResultCode,
22
23
  } from '../models/index';
23
24
  import {
@@ -27,6 +28,8 @@ import {
27
28
  FundingsToJSON,
28
29
  MarkPriceCandlesFromJSON,
29
30
  MarkPriceCandlesToJSON,
31
+ MarketPriceChartsFromJSON,
32
+ MarketPriceChartsToJSON,
30
33
  ResultCodeFromJSON,
31
34
  ResultCodeToJSON,
32
35
  } from '../models/index';
@@ -56,6 +59,10 @@ export interface MarkPriceCandlesRequest {
56
59
  count_back: number;
57
60
  }
58
61
 
62
+ export interface MarketPriceChartsRequest {
63
+ market_ids?: number;
64
+ }
65
+
59
66
  /**
60
67
  *
61
68
  */
@@ -314,6 +321,38 @@ export class CandlestickApi extends runtime.BaseAPI {
314
321
  return await response.value();
315
322
  }
316
323
 
324
+ /**
325
+ * Get last 24h hourly prices for all markets (mark price for perps, index price for spot)
326
+ * marketPriceCharts
327
+ */
328
+ async marketPriceChartsRaw(requestParameters: MarketPriceChartsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MarketPriceCharts>> {
329
+ const queryParameters: any = {};
330
+
331
+ if (requestParameters['market_ids'] != null) {
332
+ queryParameters['market_ids'] = requestParameters['market_ids'];
333
+ }
334
+
335
+ const headerParameters: runtime.HTTPHeaders = {};
336
+
337
+ const response = await this.request({
338
+ path: `/api/v1/marketPriceCharts`,
339
+ method: 'GET',
340
+ headers: headerParameters,
341
+ query: queryParameters,
342
+ }, initOverrides);
343
+
344
+ return new runtime.JSONApiResponse(response, (jsonValue) => MarketPriceChartsFromJSON(jsonValue));
345
+ }
346
+
347
+ /**
348
+ * Get last 24h hourly prices for all markets (mark price for perps, index price for spot)
349
+ * marketPriceCharts
350
+ */
351
+ async marketPriceCharts(requestParameters: MarketPriceChartsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MarketPriceCharts> {
352
+ const response = await this.marketPriceChartsRaw(requestParameters, initOverrides);
353
+ return await response.value();
354
+ }
355
+
317
356
  }
318
357
 
319
358
  /**
@@ -32,11 +32,17 @@ export interface ReqGetPositionFunding {
32
32
  */
33
33
  account_index: number;
34
34
  /**
35
- *
35
+ * kept for backward compat, use MarketIDs instead
36
36
  * @type {number}
37
37
  * @memberof ReqGetPositionFunding
38
38
  */
39
39
  market_id?: number;
40
+ /**
41
+ *
42
+ * @type {Array<number>}
43
+ * @memberof ReqGetPositionFunding
44
+ */
45
+ market_ids?: Array<number>;
40
46
  /**
41
47
  *
42
48
  * @type {string}
@@ -103,6 +109,7 @@ export function ReqGetPositionFundingFromJSONTyped(json: any, ignoreDiscriminato
103
109
  'auth': json['auth'] == null ? undefined : json['auth'],
104
110
  'account_index': json['account_index'],
105
111
  'market_id': json['market_id'] == null ? undefined : json['market_id'],
112
+ 'market_ids': json['market_ids'] == null ? undefined : json['market_ids'],
106
113
  'cursor': json['cursor'] == null ? undefined : json['cursor'],
107
114
  'limit': json['limit'],
108
115
  'side': json['side'] == null ? undefined : json['side'],
@@ -120,6 +127,7 @@ export function ReqGetPositionFundingToJSON(value?: ReqGetPositionFunding | null
120
127
  'auth': value['auth'],
121
128
  'account_index': value['account_index'],
122
129
  'market_id': value['market_id'],
130
+ 'market_ids': value['market_ids'],
123
131
  'cursor': value['cursor'],
124
132
  'limit': value['limit'],
125
133
  'side': value['side'],
package/models/index.ts CHANGED
@@ -75,6 +75,8 @@ export * from './MarkPriceCandle';
75
75
  export * from './MarkPriceCandles';
76
76
  export * from './MarketConfig';
77
77
  export * from './MarketMetricData';
78
+ export * from './MarketPriceChart';
79
+ export * from './MarketPriceCharts';
78
80
  export * from './NextNonce';
79
81
  export * from './NotificationPreferences';
80
82
  export * from './Order';
@@ -143,6 +145,7 @@ export * from './ReqGetLiquidationInfos';
143
145
  export * from './ReqGetMakerOnlyApiKeys';
144
146
  export * from './ReqGetMarkPriceCandles';
145
147
  export * from './ReqGetMarketMetrics';
148
+ export * from './ReqGetMarketPriceCharts';
146
149
  export * from './ReqGetNextNonce';
147
150
  export * from './ReqGetOrderBookDetails';
148
151
  export * from './ReqGetOrderBookOrders';
package/openapi.json CHANGED
@@ -2818,6 +2818,42 @@
2818
2818
  "description": "Get market metrics for a specific timestamp, returns data for all markets"
2819
2819
  }
2820
2820
  },
2821
+ "/api/v1/marketPriceCharts": {
2822
+ "get": {
2823
+ "summary": "marketPriceCharts",
2824
+ "operationId": "marketPriceCharts",
2825
+ "responses": {
2826
+ "200": {
2827
+ "description": "A successful response.",
2828
+ "schema": {
2829
+ "$ref": "#/definitions/MarketPriceCharts"
2830
+ }
2831
+ },
2832
+ "400": {
2833
+ "description": "Bad request",
2834
+ "schema": {
2835
+ "$ref": "#/definitions/ResultCode"
2836
+ }
2837
+ }
2838
+ },
2839
+ "parameters": [
2840
+ {
2841
+ "name": "market_ids",
2842
+ "in": "query",
2843
+ "required": false,
2844
+ "type": "integer",
2845
+ "format": "int16"
2846
+ }
2847
+ ],
2848
+ "tags": [
2849
+ "candlestick"
2850
+ ],
2851
+ "consumes": [
2852
+ "multipart/form-data"
2853
+ ],
2854
+ "description": "Get last 24h hourly prices for all markets (mark price for perps, index price for spot)"
2855
+ }
2856
+ },
2821
2857
  "/api/v1/nextNonce": {
2822
2858
  "get": {
2823
2859
  "summary": "nextNonce",
@@ -3251,12 +3287,20 @@
3251
3287
  },
3252
3288
  {
3253
3289
  "name": "market_id",
3290
+ "description": " kept for backward compat, use MarketIDs instead",
3254
3291
  "in": "query",
3255
3292
  "required": false,
3256
3293
  "type": "integer",
3257
3294
  "format": "int16",
3258
3295
  "default": "255"
3259
3296
  },
3297
+ {
3298
+ "name": "market_ids",
3299
+ "in": "query",
3300
+ "required": false,
3301
+ "type": "integer",
3302
+ "format": "int16"
3303
+ },
3260
3304
  {
3261
3305
  "name": "cursor",
3262
3306
  "in": "query",
@@ -8449,6 +8493,55 @@
8449
8493
  "data"
8450
8494
  ]
8451
8495
  },
8496
+ "MarketPriceChart": {
8497
+ "type": "object",
8498
+ "properties": {
8499
+ "market_id": {
8500
+ "type": "integer",
8501
+ "format": "int16"
8502
+ },
8503
+ "prices": {
8504
+ "type": "array",
8505
+ "items": {
8506
+ "type": "string"
8507
+ }
8508
+ }
8509
+ },
8510
+ "title": "MarketPriceChart",
8511
+ "required": [
8512
+ "market_id",
8513
+ "prices"
8514
+ ]
8515
+ },
8516
+ "MarketPriceCharts": {
8517
+ "type": "object",
8518
+ "properties": {
8519
+ "code": {
8520
+ "type": "integer",
8521
+ "format": "int32",
8522
+ "example": "200"
8523
+ },
8524
+ "message": {
8525
+ "type": "string"
8526
+ },
8527
+ "resolution": {
8528
+ "type": "string",
8529
+ "example": "1h"
8530
+ },
8531
+ "price_charts": {
8532
+ "type": "array",
8533
+ "items": {
8534
+ "$ref": "#/definitions/MarketPriceChart"
8535
+ }
8536
+ }
8537
+ },
8538
+ "title": "MarketPriceCharts",
8539
+ "required": [
8540
+ "code",
8541
+ "resolution",
8542
+ "price_charts"
8543
+ ]
8544
+ },
8452
8545
  "NextNonce": {
8453
8546
  "type": "object",
8454
8547
  "properties": {
@@ -11541,6 +11634,19 @@
11541
11634
  "kind"
11542
11635
  ]
11543
11636
  },
11637
+ "ReqGetMarketPriceCharts": {
11638
+ "type": "object",
11639
+ "properties": {
11640
+ "market_ids": {
11641
+ "type": "array",
11642
+ "items": {
11643
+ "type": "integer",
11644
+ "format": "int64"
11645
+ }
11646
+ }
11647
+ },
11648
+ "title": "ReqGetMarketPriceCharts"
11649
+ },
11544
11650
  "ReqGetNextNonce": {
11545
11651
  "type": "object",
11546
11652
  "properties": {
@@ -11657,7 +11763,15 @@
11657
11763
  "market_id": {
11658
11764
  "type": "integer",
11659
11765
  "format": "int16",
11660
- "default": "255"
11766
+ "default": "255",
11767
+ "description": " kept for backward compat, use MarketIDs instead"
11768
+ },
11769
+ "market_ids": {
11770
+ "type": "array",
11771
+ "items": {
11772
+ "type": "integer",
11773
+ "format": "int64"
11774
+ }
11661
11775
  },
11662
11776
  "cursor": {
11663
11777
  "type": "string"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklighter-perps",
3
- "version": "1.0.269",
3
+ "version": "1.0.270",
4
4
  "description": "Lighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {