zklighter-perps 1.0.294 → 1.0.295

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.
@@ -26,7 +26,8 @@ import {
26
26
  } from '../models/index';
27
27
 
28
28
  export interface StockFinancialsRequest {
29
- market_id: number;
29
+ market_id?: number;
30
+ fields?: string;
30
31
  }
31
32
 
32
33
  /**
@@ -35,23 +36,20 @@ export interface StockFinancialsRequest {
35
36
  export class StockfinancialsApi extends runtime.BaseAPI {
36
37
 
37
38
  /**
38
- * Get stock financials
39
+ * Get stock financials. Returns stock_financial for a single market_id, or stock_financials for every stock market when market_id is omitted. fields narrows the response to a subset of currency, exchange, industry, sector, country, market_cap, next_earnings; omit it to get the full record, which requires market_id.
39
40
  * stockFinancials
40
41
  */
41
42
  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
43
  const queryParameters: any = {};
50
44
 
51
45
  if (requestParameters['market_id'] != null) {
52
46
  queryParameters['market_id'] = requestParameters['market_id'];
53
47
  }
54
48
 
49
+ if (requestParameters['fields'] != null) {
50
+ queryParameters['fields'] = requestParameters['fields'];
51
+ }
52
+
55
53
  const headerParameters: runtime.HTTPHeaders = {};
56
54
 
57
55
  const response = await this.request({
@@ -65,10 +63,10 @@ export class StockfinancialsApi extends runtime.BaseAPI {
65
63
  }
66
64
 
67
65
  /**
68
- * Get stock financials
66
+ * Get stock financials. Returns stock_financial for a single market_id, or stock_financials for every stock market when market_id is omitted. fields narrows the response to a subset of currency, exchange, industry, sector, country, market_cap, next_earnings; omit it to get the full record, which requires market_id.
69
67
  * stockFinancials
70
68
  */
71
- async stockFinancials(requestParameters: StockFinancialsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespStockFinancials> {
69
+ async stockFinancials(requestParameters: StockFinancialsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RespStockFinancials> {
72
70
  const response = await this.stockFinancialsRaw(requestParameters, initOverrides);
73
71
  return await response.value();
74
72
  }
@@ -24,14 +24,19 @@ export interface ReqGetStockFinancials {
24
24
  * @type {number}
25
25
  * @memberof ReqGetStockFinancials
26
26
  */
27
- market_id: number;
27
+ market_id?: number;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof ReqGetStockFinancials
32
+ */
33
+ fields?: string;
28
34
  }
29
35
 
30
36
  /**
31
37
  * Check if a given object implements the ReqGetStockFinancials interface.
32
38
  */
33
39
  export function instanceOfReqGetStockFinancials(value: object): value is ReqGetStockFinancials {
34
- if (!('market_id' in value) || value['market_id'] === undefined) return false;
35
40
  return true;
36
41
  }
37
42
 
@@ -45,7 +50,8 @@ export function ReqGetStockFinancialsFromJSONTyped(json: any, ignoreDiscriminato
45
50
  }
46
51
  return {
47
52
 
48
- 'market_id': json['market_id'],
53
+ 'market_id': json['market_id'] == null ? undefined : json['market_id'],
54
+ 'fields': json['fields'] == null ? undefined : json['fields'],
49
55
  };
50
56
  }
51
57
 
@@ -56,6 +62,7 @@ export function ReqGetStockFinancialsToJSON(value?: ReqGetStockFinancials | null
56
62
  return {
57
63
 
58
64
  'market_id': value['market_id'],
65
+ 'fields': value['fields'],
59
66
  };
60
67
  }
61
68
 
@@ -44,6 +44,12 @@ export interface RespStockFinancials {
44
44
  * @memberof RespStockFinancials
45
45
  */
46
46
  stock_financial: StockFinancial;
47
+ /**
48
+ *
49
+ * @type {Array<StockFinancial>}
50
+ * @memberof RespStockFinancials
51
+ */
52
+ stock_financials: Array<StockFinancial>;
47
53
  }
48
54
 
49
55
  /**
@@ -52,6 +58,7 @@ export interface RespStockFinancials {
52
58
  export function instanceOfRespStockFinancials(value: object): value is RespStockFinancials {
53
59
  if (!('code' in value) || value['code'] === undefined) return false;
54
60
  if (!('stock_financial' in value) || value['stock_financial'] === undefined) return false;
61
+ if (!('stock_financials' in value) || value['stock_financials'] === undefined) return false;
55
62
  return true;
56
63
  }
57
64
 
@@ -68,6 +75,7 @@ export function RespStockFinancialsFromJSONTyped(json: any, ignoreDiscriminator:
68
75
  'code': json['code'],
69
76
  'message': json['message'] == null ? undefined : json['message'],
70
77
  'stock_financial': StockFinancialFromJSON(json['stock_financial']),
78
+ 'stock_financials': ((json['stock_financials'] as Array<any>).map(StockFinancialFromJSON)),
71
79
  };
72
80
  }
73
81
 
@@ -80,6 +88,7 @@ export function RespStockFinancialsToJSON(value?: RespStockFinancials | null): a
80
88
  'code': value['code'],
81
89
  'message': value['message'],
82
90
  'stock_financial': StockFinancialToJSON(value['stock_financial']),
91
+ 'stock_financials': ((value['stock_financials'] as Array<any>).map(StockFinancialToJSON)),
83
92
  };
84
93
  }
85
94
 
package/openapi.json CHANGED
@@ -4627,9 +4627,16 @@
4627
4627
  {
4628
4628
  "name": "market_id",
4629
4629
  "in": "query",
4630
- "required": true,
4630
+ "required": false,
4631
4631
  "type": "integer",
4632
- "format": "int16"
4632
+ "format": "int16",
4633
+ "default": "-1"
4634
+ },
4635
+ {
4636
+ "name": "fields",
4637
+ "in": "query",
4638
+ "required": false,
4639
+ "type": "string"
4633
4640
  }
4634
4641
  ],
4635
4642
  "tags": [
@@ -4638,7 +4645,7 @@
4638
4645
  "consumes": [
4639
4646
  "multipart/form-data"
4640
4647
  ],
4641
- "description": "Get stock financials"
4648
+ "description": "Get stock financials. Returns stock_financial for a single market_id, or stock_financials for every stock market when market_id is omitted. fields narrows the response to a subset of currency, exchange, industry, sector, country, market_cap, next_earnings; omit it to get the full record, which requires market_id."
4642
4649
  }
4643
4650
  },
4644
4651
  "/api/v1/syntheticSpotInfo": {
@@ -12591,13 +12598,14 @@
12591
12598
  "properties": {
12592
12599
  "market_id": {
12593
12600
  "type": "integer",
12594
- "format": "int16"
12601
+ "format": "int16",
12602
+ "default": "-1"
12603
+ },
12604
+ "fields": {
12605
+ "type": "string"
12595
12606
  }
12596
12607
  },
12597
- "title": "ReqGetStockFinancials",
12598
- "required": [
12599
- "market_id"
12600
- ]
12608
+ "title": "ReqGetStockFinancials"
12601
12609
  },
12602
12610
  "ReqGetSyntheticSpotInfo": {
12603
12611
  "type": "object",
@@ -14256,12 +14264,19 @@
14256
14264
  },
14257
14265
  "stock_financial": {
14258
14266
  "$ref": "#/definitions/StockFinancial"
14267
+ },
14268
+ "stock_financials": {
14269
+ "type": "array",
14270
+ "items": {
14271
+ "$ref": "#/definitions/StockFinancial"
14272
+ }
14259
14273
  }
14260
14274
  },
14261
14275
  "title": "RespStockFinancials",
14262
14276
  "required": [
14263
14277
  "code",
14264
- "stock_financial"
14278
+ "stock_financial",
14279
+ "stock_financials"
14265
14280
  ]
14266
14281
  },
14267
14282
  "RespSyntheticSpotInfo": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklighter-perps",
3
- "version": "1.0.294",
3
+ "version": "1.0.295",
4
4
  "description": "Lighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {