zklighter-perps 1.0.267 → 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
+ }
@@ -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
+
@@ -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
+
@@ -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 { StockFinancial } from './StockFinancial';
17
+ import {
18
+ StockFinancialFromJSON,
19
+ StockFinancialFromJSONTyped,
20
+ StockFinancialToJSON,
21
+ } from './StockFinancial';
22
+
23
+ /**
24
+ *
25
+ * @export
26
+ * @interface RespStockFinancials
27
+ */
28
+ export interface RespStockFinancials {
29
+ /**
30
+ *
31
+ * @type {number}
32
+ * @memberof RespStockFinancials
33
+ */
34
+ code: number;
35
+ /**
36
+ *
37
+ * @type {string}
38
+ * @memberof RespStockFinancials
39
+ */
40
+ message?: string;
41
+ /**
42
+ *
43
+ * @type {StockFinancial}
44
+ * @memberof RespStockFinancials
45
+ */
46
+ stock_financial: StockFinancial;
47
+ }
48
+
49
+ /**
50
+ * Check if a given object implements the RespStockFinancials interface.
51
+ */
52
+ export function instanceOfRespStockFinancials(value: object): value is RespStockFinancials {
53
+ if (!('code' in value) || value['code'] === undefined) return false;
54
+ if (!('stock_financial' in value) || value['stock_financial'] === undefined) return false;
55
+ return true;
56
+ }
57
+
58
+ export function RespStockFinancialsFromJSON(json: any): RespStockFinancials {
59
+ return RespStockFinancialsFromJSONTyped(json, false);
60
+ }
61
+
62
+ export function RespStockFinancialsFromJSONTyped(json: any, ignoreDiscriminator: boolean): RespStockFinancials {
63
+ if (json == null) {
64
+ return json;
65
+ }
66
+ return {
67
+
68
+ 'code': json['code'],
69
+ 'message': json['message'] == null ? undefined : json['message'],
70
+ 'stock_financial': StockFinancialFromJSON(json['stock_financial']),
71
+ };
72
+ }
73
+
74
+ export function RespStockFinancialsToJSON(value?: RespStockFinancials | null): any {
75
+ if (value == null) {
76
+ return value;
77
+ }
78
+ return {
79
+
80
+ 'code': value['code'],
81
+ 'message': value['message'],
82
+ 'stock_financial': StockFinancialToJSON(value['stock_financial']),
83
+ };
84
+ }
85
+