zklighter-perps 1.0.266 → 1.0.268

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.
@@ -92,6 +92,8 @@ models/MarkPriceCandle.ts
92
92
  models/MarkPriceCandles.ts
93
93
  models/MarketConfig.ts
94
94
  models/MarketMetricData.ts
95
+ models/MarketPriceChart.ts
96
+ models/MarketPriceCharts.ts
95
97
  models/NextNonce.ts
96
98
  models/NotificationPreferences.ts
97
99
  models/Order.ts
@@ -159,6 +161,7 @@ models/ReqGetLiquidationInfos.ts
159
161
  models/ReqGetMakerOnlyApiKeys.ts
160
162
  models/ReqGetMarkPriceCandles.ts
161
163
  models/ReqGetMarketMetrics.ts
164
+ models/ReqGetMarketPriceCharts.ts
162
165
  models/ReqGetNextNonce.ts
163
166
  models/ReqGetOrderBookDetails.ts
164
167
  models/ReqGetOrderBookOrders.ts
@@ -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
  /**
@@ -0,0 +1,61 @@
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
+ UpcomingEarnings,
20
+ } from '../models/index';
21
+ import {
22
+ ResultCodeFromJSON,
23
+ ResultCodeToJSON,
24
+ UpcomingEarningsFromJSON,
25
+ UpcomingEarningsToJSON,
26
+ } from '../models/index';
27
+
28
+ /**
29
+ *
30
+ */
31
+ export class EarningsApi extends runtime.BaseAPI {
32
+
33
+ /**
34
+ * Get upcoming earnings
35
+ * upcomingEarnings
36
+ */
37
+ async upcomingEarningsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UpcomingEarnings>> {
38
+ const queryParameters: any = {};
39
+
40
+ const headerParameters: runtime.HTTPHeaders = {};
41
+
42
+ const response = await this.request({
43
+ path: `/api/v1/upcomingEarnings`,
44
+ method: 'GET',
45
+ headers: headerParameters,
46
+ query: queryParameters,
47
+ }, initOverrides);
48
+
49
+ return new runtime.JSONApiResponse(response, (jsonValue) => UpcomingEarningsFromJSON(jsonValue));
50
+ }
51
+
52
+ /**
53
+ * Get upcoming earnings
54
+ * upcomingEarnings
55
+ */
56
+ async upcomingEarnings(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UpcomingEarnings> {
57
+ const response = await this.upcomingEarningsRaw(initOverrides);
58
+ return await response.value();
59
+ }
60
+
61
+ }
@@ -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
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ RespStockFinancials,
19
+ ResultCode,
20
+ } from '../models/index';
21
+ import {
22
+ RespStockFinancialsFromJSON,
23
+ RespStockFinancialsToJSON,
24
+ ResultCodeFromJSON,
25
+ ResultCodeToJSON,
26
+ } from '../models/index';
27
+
28
+ export interface StockFinancialsRequest {
29
+ market_id: number;
30
+ }
31
+
32
+ /**
33
+ *
34
+ */
35
+ export class StockfinancialsApi extends runtime.BaseAPI {
36
+
37
+ /**
38
+ * Get stock financials
39
+ * stockFinancials
40
+ */
41
+ async stockFinancialsRaw(requestParameters: StockFinancialsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RespStockFinancials>> {
42
+ if (requestParameters['market_id'] == null) {
43
+ throw new runtime.RequiredError(
44
+ 'market_id',
45
+ 'Required parameter "market_id" was null or undefined when calling stockFinancials().'
46
+ );
47
+ }
48
+
49
+ const queryParameters: any = {};
50
+
51
+ if (requestParameters['market_id'] != null) {
52
+ queryParameters['market_id'] = requestParameters['market_id'];
53
+ }
54
+
55
+ const headerParameters: runtime.HTTPHeaders = {};
56
+
57
+ const response = await this.request({
58
+ path: `/api/v1/stockFinancials`,
59
+ method: 'GET',
60
+ headers: headerParameters,
61
+ query: queryParameters,
62
+ }, initOverrides);
63
+
64
+ return new runtime.JSONApiResponse(response, (jsonValue) => RespStockFinancialsFromJSON(jsonValue));
65
+ }
66
+
67
+ /**
68
+ * Get stock financials
69
+ * stockFinancials
70
+ */
71
+ async stockFinancials(requestParameters: StockFinancialsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespStockFinancials> {
72
+ const response = await this.stockFinancialsRaw(requestParameters, initOverrides);
73
+ return await response.value();
74
+ }
75
+
76
+ }
@@ -56,7 +56,7 @@ export interface AccountAsset {
56
56
  */
57
57
  margin_balance: string;
58
58
  /**
59
- *
59
+ *
60
60
  * @type {string}
61
61
  * @memberof AccountAsset
62
62
  */
package/models/Asset.ts CHANGED
@@ -122,7 +122,7 @@ export interface Asset {
122
122
  */
123
123
  total_supplied: string;
124
124
  /**
125
- *
125
+ *
126
126
  * @type {string}
127
127
  * @memberof Asset
128
128
  */
@@ -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 MarketPriceChart
20
+ */
21
+ export interface MarketPriceChart {
22
+ /**
23
+ *
24
+ * @type {number}
25
+ * @memberof MarketPriceChart
26
+ */
27
+ market_id: number;
28
+ /**
29
+ *
30
+ * @type {Array<string>}
31
+ * @memberof MarketPriceChart
32
+ */
33
+ prices: Array<string>;
34
+ }
35
+
36
+ /**
37
+ * Check if a given object implements the MarketPriceChart interface.
38
+ */
39
+ export function instanceOfMarketPriceChart(value: object): value is MarketPriceChart {
40
+ if (!('market_id' in value) || value['market_id'] === undefined) return false;
41
+ if (!('prices' in value) || value['prices'] === undefined) return false;
42
+ return true;
43
+ }
44
+
45
+ export function MarketPriceChartFromJSON(json: any): MarketPriceChart {
46
+ return MarketPriceChartFromJSONTyped(json, false);
47
+ }
48
+
49
+ export function MarketPriceChartFromJSONTyped(json: any, ignoreDiscriminator: boolean): MarketPriceChart {
50
+ if (json == null) {
51
+ return json;
52
+ }
53
+ return {
54
+
55
+ 'market_id': json['market_id'],
56
+ 'prices': json['prices'],
57
+ };
58
+ }
59
+
60
+ export function MarketPriceChartToJSON(value?: MarketPriceChart | null): any {
61
+ if (value == null) {
62
+ return value;
63
+ }
64
+ return {
65
+
66
+ 'market_id': value['market_id'],
67
+ 'prices': value['prices'],
68
+ };
69
+ }
70
+
@@ -0,0 +1,94 @@
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 { MarketPriceChart } from './MarketPriceChart';
17
+ import {
18
+ MarketPriceChartFromJSON,
19
+ MarketPriceChartFromJSONTyped,
20
+ MarketPriceChartToJSON,
21
+ } from './MarketPriceChart';
22
+
23
+ /**
24
+ *
25
+ * @export
26
+ * @interface MarketPriceCharts
27
+ */
28
+ export interface MarketPriceCharts {
29
+ /**
30
+ *
31
+ * @type {number}
32
+ * @memberof MarketPriceCharts
33
+ */
34
+ code: number;
35
+ /**
36
+ *
37
+ * @type {string}
38
+ * @memberof MarketPriceCharts
39
+ */
40
+ message?: string;
41
+ /**
42
+ *
43
+ * @type {string}
44
+ * @memberof MarketPriceCharts
45
+ */
46
+ resolution: string;
47
+ /**
48
+ *
49
+ * @type {Array<MarketPriceChart>}
50
+ * @memberof MarketPriceCharts
51
+ */
52
+ price_charts: Array<MarketPriceChart>;
53
+ }
54
+
55
+ /**
56
+ * Check if a given object implements the MarketPriceCharts interface.
57
+ */
58
+ export function instanceOfMarketPriceCharts(value: object): value is MarketPriceCharts {
59
+ if (!('code' in value) || value['code'] === undefined) return false;
60
+ if (!('resolution' in value) || value['resolution'] === undefined) return false;
61
+ if (!('price_charts' in value) || value['price_charts'] === undefined) return false;
62
+ return true;
63
+ }
64
+
65
+ export function MarketPriceChartsFromJSON(json: any): MarketPriceCharts {
66
+ return MarketPriceChartsFromJSONTyped(json, false);
67
+ }
68
+
69
+ export function MarketPriceChartsFromJSONTyped(json: any, ignoreDiscriminator: boolean): MarketPriceCharts {
70
+ if (json == null) {
71
+ return json;
72
+ }
73
+ return {
74
+
75
+ 'code': json['code'],
76
+ 'message': json['message'] == null ? undefined : json['message'],
77
+ 'resolution': json['resolution'],
78
+ 'price_charts': ((json['price_charts'] as Array<any>).map(MarketPriceChartFromJSON)),
79
+ };
80
+ }
81
+
82
+ export function MarketPriceChartsToJSON(value?: MarketPriceCharts | null): any {
83
+ if (value == null) {
84
+ return value;
85
+ }
86
+ return {
87
+
88
+ 'code': value['code'],
89
+ 'message': value['message'],
90
+ 'resolution': value['resolution'],
91
+ 'price_charts': ((value['price_charts'] as Array<any>).map(MarketPriceChartToJSON)),
92
+ };
93
+ }
94
+
@@ -128,7 +128,7 @@ export interface OrderBook {
128
128
  */
129
129
  created_at: string;
130
130
  /**
131
- *
131
+ *
132
132
  * @type {string}
133
133
  * @memberof OrderBook
134
134
  */
@@ -135,7 +135,7 @@ export interface PerpsOrderBookDetail {
135
135
  */
136
136
  created_at: string;
137
137
  /**
138
- *
138
+ *
139
139
  * @type {string}
140
140
  * @memberof PerpsOrderBookDetail
141
141
  */
@@ -266,6 +266,12 @@ export interface PerpsOrderBookDetail {
266
266
  * @memberof PerpsOrderBookDetail
267
267
  */
268
268
  market_flags: number;
269
+ /**
270
+ *
271
+ * @type {number}
272
+ * @memberof PerpsOrderBookDetail
273
+ */
274
+ funding_premium_multiplier: number;
269
275
  /**
270
276
  *
271
277
  * @type {string}
@@ -350,6 +356,7 @@ export function instanceOfPerpsOrderBookDetail(value: object): value is PerpsOrd
350
356
  if (!('market_config' in value) || value['market_config'] === undefined) return false;
351
357
  if (!('strategy_index' in value) || value['strategy_index'] === undefined) return false;
352
358
  if (!('market_flags' in value) || value['market_flags'] === undefined) return false;
359
+ if (!('funding_premium_multiplier' in value) || value['funding_premium_multiplier'] === undefined) return false;
353
360
  if (!('funding_clamp_small' in value) || value['funding_clamp_small'] === undefined) return false;
354
361
  if (!('funding_clamp_big' in value) || value['funding_clamp_big'] === undefined) return false;
355
362
  if (!('base_interest_rate' in value) || value['base_interest_rate'] === undefined) return false;
@@ -406,6 +413,7 @@ export function PerpsOrderBookDetailFromJSONTyped(json: any, ignoreDiscriminator
406
413
  'market_config': MarketConfigFromJSON(json['market_config']),
407
414
  'strategy_index': json['strategy_index'],
408
415
  'market_flags': json['market_flags'],
416
+ 'funding_premium_multiplier': json['funding_premium_multiplier'],
409
417
  'funding_clamp_small': json['funding_clamp_small'],
410
418
  'funding_clamp_big': json['funding_clamp_big'],
411
419
  'base_interest_rate': json['base_interest_rate'],
@@ -458,6 +466,7 @@ export function PerpsOrderBookDetailToJSON(value?: PerpsOrderBookDetail | null):
458
466
  'market_config': MarketConfigToJSON(value['market_config']),
459
467
  'strategy_index': value['strategy_index'],
460
468
  'market_flags': value['market_flags'],
469
+ 'funding_premium_multiplier': value['funding_premium_multiplier'],
461
470
  'funding_clamp_small': value['funding_clamp_small'],
462
471
  'funding_clamp_big': value['funding_clamp_big'],
463
472
  'base_interest_rate': value['base_interest_rate'],
@@ -20,45 +20,30 @@ import { mapValues } from '../runtime';
20
20
  */
21
21
  export interface ReqGetAccountOrders {
22
22
  /**
23
- *
23
+ * made optional to support header auth clients
24
24
  * @type {string}
25
25
  * @memberof ReqGetAccountOrders
26
26
  */
27
- auth: string;
28
- /**
29
- *
30
- * @type {number}
31
- * @memberof ReqGetAccountOrders
32
- */
33
- account_index: number;
27
+ auth?: string;
34
28
  /**
35
29
  *
36
30
  * @type {number}
37
31
  * @memberof ReqGetAccountOrders
38
32
  */
39
- market_id: number;
33
+ account_index?: number;
40
34
  /**
41
- *
35
+ * comma-separated int64s, e.g. "123,456"
42
36
  * @type {string}
43
37
  * @memberof ReqGetAccountOrders
44
38
  */
45
- cursor?: string;
46
- /**
47
- *
48
- * @type {number}
49
- * @memberof ReqGetAccountOrders
50
- */
51
- limit: number;
39
+ client_order_indexes: string;
52
40
  }
53
41
 
54
42
  /**
55
43
  * Check if a given object implements the ReqGetAccountOrders interface.
56
44
  */
57
45
  export function instanceOfReqGetAccountOrders(value: object): value is ReqGetAccountOrders {
58
- if (!('auth' in value) || value['auth'] === undefined) return false;
59
- if (!('account_index' in value) || value['account_index'] === undefined) return false;
60
- if (!('market_id' in value) || value['market_id'] === undefined) return false;
61
- if (!('limit' in value) || value['limit'] === undefined) return false;
46
+ if (!('client_order_indexes' in value) || value['client_order_indexes'] === undefined) return false;
62
47
  return true;
63
48
  }
64
49
 
@@ -72,11 +57,9 @@ export function ReqGetAccountOrdersFromJSONTyped(json: any, ignoreDiscriminator:
72
57
  }
73
58
  return {
74
59
 
75
- 'auth': json['auth'],
76
- 'account_index': json['account_index'],
77
- 'market_id': json['market_id'],
78
- 'cursor': json['cursor'] == null ? undefined : json['cursor'],
79
- 'limit': json['limit'],
60
+ 'auth': json['auth'] == null ? undefined : json['auth'],
61
+ 'account_index': json['account_index'] == null ? undefined : json['account_index'],
62
+ 'client_order_indexes': json['client_order_indexes'],
80
63
  };
81
64
  }
82
65
 
@@ -88,9 +71,7 @@ export function ReqGetAccountOrdersToJSON(value?: ReqGetAccountOrders | null): a
88
71
 
89
72
  'auth': value['auth'],
90
73
  'account_index': value['account_index'],
91
- 'market_id': value['market_id'],
92
- 'cursor': value['cursor'],
93
- 'limit': value['limit'],
74
+ 'client_order_indexes': value['client_order_indexes'],
94
75
  };
95
76
  }
96
77
 
@@ -0,0 +1,60 @@
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 ReqGetMarketPriceCharts
20
+ */
21
+ export interface ReqGetMarketPriceCharts {
22
+ /**
23
+ *
24
+ * @type {Array<number>}
25
+ * @memberof ReqGetMarketPriceCharts
26
+ */
27
+ market_ids?: Array<number>;
28
+ }
29
+
30
+ /**
31
+ * Check if a given object implements the ReqGetMarketPriceCharts interface.
32
+ */
33
+ export function instanceOfReqGetMarketPriceCharts(value: object): value is ReqGetMarketPriceCharts {
34
+ return true;
35
+ }
36
+
37
+ export function ReqGetMarketPriceChartsFromJSON(json: any): ReqGetMarketPriceCharts {
38
+ return ReqGetMarketPriceChartsFromJSONTyped(json, false);
39
+ }
40
+
41
+ export function ReqGetMarketPriceChartsFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReqGetMarketPriceCharts {
42
+ if (json == null) {
43
+ return json;
44
+ }
45
+ return {
46
+
47
+ 'market_ids': json['market_ids'] == null ? undefined : json['market_ids'],
48
+ };
49
+ }
50
+
51
+ export function ReqGetMarketPriceChartsToJSON(value?: ReqGetMarketPriceCharts | null): any {
52
+ if (value == null) {
53
+ return value;
54
+ }
55
+ return {
56
+
57
+ 'market_ids': value['market_ids'],
58
+ };
59
+ }
60
+
@@ -0,0 +1,61 @@
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 ReqGetStockFinancials
20
+ */
21
+ export interface ReqGetStockFinancials {
22
+ /**
23
+ *
24
+ * @type {number}
25
+ * @memberof ReqGetStockFinancials
26
+ */
27
+ market_id: number;
28
+ }
29
+
30
+ /**
31
+ * Check if a given object implements the ReqGetStockFinancials interface.
32
+ */
33
+ export function instanceOfReqGetStockFinancials(value: object): value is ReqGetStockFinancials {
34
+ if (!('market_id' in value) || value['market_id'] === undefined) return false;
35
+ return true;
36
+ }
37
+
38
+ export function ReqGetStockFinancialsFromJSON(json: any): ReqGetStockFinancials {
39
+ return ReqGetStockFinancialsFromJSONTyped(json, false);
40
+ }
41
+
42
+ export function ReqGetStockFinancialsFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReqGetStockFinancials {
43
+ if (json == null) {
44
+ return json;
45
+ }
46
+ return {
47
+
48
+ 'market_id': json['market_id'],
49
+ };
50
+ }
51
+
52
+ export function ReqGetStockFinancialsToJSON(value?: ReqGetStockFinancials | null): any {
53
+ if (value == null) {
54
+ return value;
55
+ }
56
+ return {
57
+
58
+ 'market_id': value['market_id'],
59
+ };
60
+ }
61
+