zklighter-perps 1.0.271 → 1.0.273

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.
@@ -109,19 +109,40 @@ data = walk(data, _add_bad_request_response)
109
109
 
110
110
 
111
111
  # ---------------------------------------------------------------------------
112
- # Step 6. Model the `types` parameter as a byte array (array of uint8) instead of
113
- # the non-standard scalar the spec declares.
114
- # (was: jq 'walk(if .name == "types" then .type="array" | .items=... | del(.format) end)')
112
+ # Step 6. Restore array request parameters from their request definitions. The
113
+ # generator preserves arrays in definitions but flattens them in path
114
+ # parameters.
115
115
  # ---------------------------------------------------------------------------
116
- def _types_param_to_byte_array(node):
117
- if isinstance(node, dict) and node.get("name") == "types":
118
- node["type"] = "array"
119
- node["items"] = {"type": "integer", "format": "uint8"}
120
- node.pop("format", None)
121
- return node
116
+ def restore_array_parameters(data):
117
+ definitions = data.get("definitions", {})
118
+
119
+ for path_item in data.get("paths", {}).values():
120
+ for operation in path_item.values():
121
+ if not isinstance(operation, dict):
122
+ continue
123
+
124
+ request = definitions.get(f"Req{operation.get('operationId')}", {})
125
+ properties = request.get("properties", {})
126
+
127
+ for parameter in operation.get("parameters", []):
128
+ property_schema = properties.get(parameter.get("name"), {})
129
+ if (
130
+ property_schema.get("type") != "array"
131
+ or parameter.get("type") == "array"
132
+ ):
133
+ continue
122
134
 
135
+ items = {"type": parameter["type"]}
136
+ if "format" in parameter:
137
+ items["format"] = parameter.pop("format")
138
+ if "enum" in parameter:
139
+ items["enum"] = parameter.pop("enum")
123
140
 
124
- data = walk(data, _types_param_to_byte_array)
141
+ parameter["type"] = "array"
142
+ parameter["items"] = items
143
+
144
+
145
+ restore_array_parameters(data)
125
146
 
126
147
 
127
148
  # ---------------------------------------------------------------------------
@@ -209,19 +230,6 @@ for defn in data["definitions"].values():
209
230
  if prop.get("type") == "array" and "enum" in prop:
210
231
  prop["items"]["enum"] = prop.pop("enum")
211
232
 
212
- # transfer_history type parameter to be array
213
- if "/api/v1/transfer/history" in data["paths"]:
214
- for method in data["paths"]["/api/v1/transfer/history"].values():
215
- for param in method.get("parameters", []):
216
- if (
217
- param.get("name") == "type"
218
- and param.get("type") == "string"
219
- and "enum" in param
220
- ):
221
- param["type"] = "array"
222
- param["items"] = {"type": "string", "enum": param.pop("enum")}
223
- break
224
-
225
233
  for path in data["definitions"]:
226
234
  if not path.startswith("Req"):
227
235
  required_fields = list(data["definitions"][path]["properties"].keys())
@@ -240,6 +240,7 @@ models/StockCashFlowStatement.ts
240
240
  models/StockFinancial.ts
241
241
  models/StockFinancialEarnings.ts
242
242
  models/StockFinancialEarningsEvent.ts
243
+ models/StockFinancialHistoricalEarning.ts
243
244
  models/StockFinancialPeriod.ts
244
245
  models/StockFinancialProfile.ts
245
246
  models/StockFinancialStatements.ts
@@ -248,7 +248,7 @@ export interface PositionFundingRequest {
248
248
  authorization?: string;
249
249
  auth?: string;
250
250
  market_id?: number;
251
- market_ids?: number;
251
+ market_ids?: Array<number>;
252
252
  cursor?: string;
253
253
  side?: PositionFundingSideEnum;
254
254
  start_timestamp?: number;
@@ -1560,7 +1560,7 @@ export class AccountApi extends runtime.BaseAPI {
1560
1560
  }
1561
1561
 
1562
1562
  if (requestParameters['market_ids'] != null) {
1563
- queryParameters['market_ids'] = requestParameters['market_ids'];
1563
+ queryParameters['market_ids'] = requestParameters['market_ids']!.join(runtime.COLLECTION_FORMATS["csv"]);
1564
1564
  }
1565
1565
 
1566
1566
  if (requestParameters['cursor'] != null) {
@@ -60,7 +60,7 @@ export interface MarkPriceCandlesRequest {
60
60
  }
61
61
 
62
62
  export interface MarketPriceChartsRequest {
63
- market_ids?: number;
63
+ market_ids?: Array<number>;
64
64
  }
65
65
 
66
66
  /**
@@ -329,7 +329,7 @@ export class CandlestickApi extends runtime.BaseAPI {
329
329
  const queryParameters: any = {};
330
330
 
331
331
  if (requestParameters['market_ids'] != null) {
332
- queryParameters['market_ids'] = requestParameters['market_ids'];
332
+ queryParameters['market_ids'] = requestParameters['market_ids']!.join(runtime.COLLECTION_FORMATS["csv"]);
333
333
  }
334
334
 
335
335
  const headerParameters: runtime.HTTPHeaders = {};
@@ -31,6 +31,30 @@ export interface StockBalanceSheet {
31
31
  * @memberof StockBalanceSheet
32
32
  */
33
33
  total_assets: number;
34
+ /**
35
+ *
36
+ * @type {number}
37
+ * @memberof StockBalanceSheet
38
+ */
39
+ total_liabilities: number;
40
+ /**
41
+ *
42
+ * @type {number}
43
+ * @memberof StockBalanceSheet
44
+ */
45
+ total_equity: number;
46
+ /**
47
+ *
48
+ * @type {number}
49
+ * @memberof StockBalanceSheet
50
+ */
51
+ total_debt: number;
52
+ /**
53
+ *
54
+ * @type {number}
55
+ * @memberof StockBalanceSheet
56
+ */
57
+ net_debt: number;
34
58
  }
35
59
 
36
60
  /**
@@ -39,6 +63,10 @@ export interface StockBalanceSheet {
39
63
  export function instanceOfStockBalanceSheet(value: object): value is StockBalanceSheet {
40
64
  if (!('cash_and_cash_equivalents' in value) || value['cash_and_cash_equivalents'] === undefined) return false;
41
65
  if (!('total_assets' in value) || value['total_assets'] === undefined) return false;
66
+ if (!('total_liabilities' in value) || value['total_liabilities'] === undefined) return false;
67
+ if (!('total_equity' in value) || value['total_equity'] === undefined) return false;
68
+ if (!('total_debt' in value) || value['total_debt'] === undefined) return false;
69
+ if (!('net_debt' in value) || value['net_debt'] === undefined) return false;
42
70
  return true;
43
71
  }
44
72
 
@@ -54,6 +82,10 @@ export function StockBalanceSheetFromJSONTyped(json: any, ignoreDiscriminator: b
54
82
 
55
83
  'cash_and_cash_equivalents': json['cash_and_cash_equivalents'],
56
84
  'total_assets': json['total_assets'],
85
+ 'total_liabilities': json['total_liabilities'],
86
+ 'total_equity': json['total_equity'],
87
+ 'total_debt': json['total_debt'],
88
+ 'net_debt': json['net_debt'],
57
89
  };
58
90
  }
59
91
 
@@ -65,6 +97,10 @@ export function StockBalanceSheetToJSON(value?: StockBalanceSheet | null): any {
65
97
 
66
98
  'cash_and_cash_equivalents': value['cash_and_cash_equivalents'],
67
99
  'total_assets': value['total_assets'],
100
+ 'total_liabilities': value['total_liabilities'],
101
+ 'total_equity': value['total_equity'],
102
+ 'total_debt': value['total_debt'],
103
+ 'net_debt': value['net_debt'],
68
104
  };
69
105
  }
70
106
 
@@ -19,6 +19,12 @@ import {
19
19
  StockFinancialEarningsEventFromJSONTyped,
20
20
  StockFinancialEarningsEventToJSON,
21
21
  } from './StockFinancialEarningsEvent';
22
+ import type { StockFinancialHistoricalEarning } from './StockFinancialHistoricalEarning';
23
+ import {
24
+ StockFinancialHistoricalEarningFromJSON,
25
+ StockFinancialHistoricalEarningFromJSONTyped,
26
+ StockFinancialHistoricalEarningToJSON,
27
+ } from './StockFinancialHistoricalEarning';
22
28
 
23
29
  /**
24
30
  *
@@ -32,12 +38,19 @@ export interface StockFinancialEarnings {
32
38
  * @memberof StockFinancialEarnings
33
39
  */
34
40
  next?: StockFinancialEarningsEvent;
41
+ /**
42
+ *
43
+ * @type {Array<StockFinancialHistoricalEarning>}
44
+ * @memberof StockFinancialEarnings
45
+ */
46
+ history: Array<StockFinancialHistoricalEarning>;
35
47
  }
36
48
 
37
49
  /**
38
50
  * Check if a given object implements the StockFinancialEarnings interface.
39
51
  */
40
52
  export function instanceOfStockFinancialEarnings(value: object): value is StockFinancialEarnings {
53
+ if (!('history' in value) || value['history'] === undefined) return false;
41
54
  return true;
42
55
  }
43
56
 
@@ -52,6 +65,7 @@ export function StockFinancialEarningsFromJSONTyped(json: any, ignoreDiscriminat
52
65
  return {
53
66
 
54
67
  'next': json['next'] == null ? undefined : StockFinancialEarningsEventFromJSON(json['next']),
68
+ 'history': ((json['history'] as Array<any>).map(StockFinancialHistoricalEarningFromJSON)),
55
69
  };
56
70
  }
57
71
 
@@ -62,6 +76,7 @@ export function StockFinancialEarningsToJSON(value?: StockFinancialEarnings | nu
62
76
  return {
63
77
 
64
78
  'next': StockFinancialEarningsEventToJSON(value['next']),
79
+ 'history': ((value['history'] as Array<any>).map(StockFinancialHistoricalEarningToJSON)),
65
80
  };
66
81
  }
67
82
 
@@ -0,0 +1,97 @@
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 StockFinancialHistoricalEarning
20
+ */
21
+ export interface StockFinancialHistoricalEarning {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof StockFinancialHistoricalEarning
26
+ */
27
+ date: string;
28
+ /**
29
+ *
30
+ * @type {number}
31
+ * @memberof StockFinancialHistoricalEarning
32
+ */
33
+ eps_estimated: number;
34
+ /**
35
+ *
36
+ * @type {number}
37
+ * @memberof StockFinancialHistoricalEarning
38
+ */
39
+ eps_actual: number;
40
+ /**
41
+ *
42
+ * @type {number}
43
+ * @memberof StockFinancialHistoricalEarning
44
+ */
45
+ revenue_estimated: number;
46
+ /**
47
+ *
48
+ * @type {number}
49
+ * @memberof StockFinancialHistoricalEarning
50
+ */
51
+ revenue_actual: number;
52
+ }
53
+
54
+ /**
55
+ * Check if a given object implements the StockFinancialHistoricalEarning interface.
56
+ */
57
+ export function instanceOfStockFinancialHistoricalEarning(value: object): value is StockFinancialHistoricalEarning {
58
+ if (!('date' in value) || value['date'] === undefined) return false;
59
+ if (!('eps_estimated' in value) || value['eps_estimated'] === undefined) return false;
60
+ if (!('eps_actual' in value) || value['eps_actual'] === undefined) return false;
61
+ if (!('revenue_estimated' in value) || value['revenue_estimated'] === undefined) return false;
62
+ if (!('revenue_actual' in value) || value['revenue_actual'] === undefined) return false;
63
+ return true;
64
+ }
65
+
66
+ export function StockFinancialHistoricalEarningFromJSON(json: any): StockFinancialHistoricalEarning {
67
+ return StockFinancialHistoricalEarningFromJSONTyped(json, false);
68
+ }
69
+
70
+ export function StockFinancialHistoricalEarningFromJSONTyped(json: any, ignoreDiscriminator: boolean): StockFinancialHistoricalEarning {
71
+ if (json == null) {
72
+ return json;
73
+ }
74
+ return {
75
+
76
+ 'date': json['date'],
77
+ 'eps_estimated': json['eps_estimated'],
78
+ 'eps_actual': json['eps_actual'],
79
+ 'revenue_estimated': json['revenue_estimated'],
80
+ 'revenue_actual': json['revenue_actual'],
81
+ };
82
+ }
83
+
84
+ export function StockFinancialHistoricalEarningToJSON(value?: StockFinancialHistoricalEarning | null): any {
85
+ if (value == null) {
86
+ return value;
87
+ }
88
+ return {
89
+
90
+ 'date': value['date'],
91
+ 'eps_estimated': value['eps_estimated'],
92
+ 'eps_actual': value['eps_actual'],
93
+ 'revenue_estimated': value['revenue_estimated'],
94
+ 'revenue_actual': value['revenue_actual'],
95
+ };
96
+ }
97
+
@@ -31,12 +31,36 @@ export interface StockIncomeStatement {
31
31
  * @memberof StockIncomeStatement
32
32
  */
33
33
  gross_profit: number;
34
+ /**
35
+ *
36
+ * @type {number}
37
+ * @memberof StockIncomeStatement
38
+ */
39
+ operating_income: number;
40
+ /**
41
+ *
42
+ * @type {number}
43
+ * @memberof StockIncomeStatement
44
+ */
45
+ ebitda: number;
34
46
  /**
35
47
  *
36
48
  * @type {number}
37
49
  * @memberof StockIncomeStatement
38
50
  */
39
51
  net_income: number;
52
+ /**
53
+ *
54
+ * @type {number}
55
+ * @memberof StockIncomeStatement
56
+ */
57
+ eps: number;
58
+ /**
59
+ *
60
+ * @type {number}
61
+ * @memberof StockIncomeStatement
62
+ */
63
+ eps_diluted: number;
40
64
  }
41
65
 
42
66
  /**
@@ -45,7 +69,11 @@ export interface StockIncomeStatement {
45
69
  export function instanceOfStockIncomeStatement(value: object): value is StockIncomeStatement {
46
70
  if (!('revenue' in value) || value['revenue'] === undefined) return false;
47
71
  if (!('gross_profit' in value) || value['gross_profit'] === undefined) return false;
72
+ if (!('operating_income' in value) || value['operating_income'] === undefined) return false;
73
+ if (!('ebitda' in value) || value['ebitda'] === undefined) return false;
48
74
  if (!('net_income' in value) || value['net_income'] === undefined) return false;
75
+ if (!('eps' in value) || value['eps'] === undefined) return false;
76
+ if (!('eps_diluted' in value) || value['eps_diluted'] === undefined) return false;
49
77
  return true;
50
78
  }
51
79
 
@@ -61,7 +89,11 @@ export function StockIncomeStatementFromJSONTyped(json: any, ignoreDiscriminator
61
89
 
62
90
  'revenue': json['revenue'],
63
91
  'gross_profit': json['gross_profit'],
92
+ 'operating_income': json['operating_income'],
93
+ 'ebitda': json['ebitda'],
64
94
  'net_income': json['net_income'],
95
+ 'eps': json['eps'],
96
+ 'eps_diluted': json['eps_diluted'],
65
97
  };
66
98
  }
67
99
 
@@ -73,7 +105,11 @@ export function StockIncomeStatementToJSON(value?: StockIncomeStatement | null):
73
105
 
74
106
  'revenue': value['revenue'],
75
107
  'gross_profit': value['gross_profit'],
108
+ 'operating_income': value['operating_income'],
109
+ 'ebitda': value['ebitda'],
76
110
  'net_income': value['net_income'],
111
+ 'eps': value['eps'],
112
+ 'eps_diluted': value['eps_diluted'],
77
113
  };
78
114
  }
79
115
 
package/models/index.ts CHANGED
@@ -221,6 +221,7 @@ export * from './StockCashFlowStatement';
221
221
  export * from './StockFinancial';
222
222
  export * from './StockFinancialEarnings';
223
223
  export * from './StockFinancialEarningsEvent';
224
+ export * from './StockFinancialHistoricalEarning';
224
225
  export * from './StockFinancialPeriod';
225
226
  export * from './StockFinancialProfile';
226
227
  export * from './StockFinancialStatements';
package/openapi.json CHANGED
@@ -2841,8 +2841,11 @@
2841
2841
  "name": "market_ids",
2842
2842
  "in": "query",
2843
2843
  "required": false,
2844
- "type": "integer",
2845
- "format": "int16"
2844
+ "type": "array",
2845
+ "items": {
2846
+ "type": "integer",
2847
+ "format": "int16"
2848
+ }
2846
2849
  }
2847
2850
  ],
2848
2851
  "tags": [
@@ -3298,8 +3301,11 @@
3298
3301
  "name": "market_ids",
3299
3302
  "in": "query",
3300
3303
  "required": false,
3301
- "type": "integer",
3302
- "format": "int16"
3304
+ "type": "array",
3305
+ "items": {
3306
+ "type": "integer",
3307
+ "format": "int16"
3308
+ }
3303
3309
  },
3304
3310
  {
3305
3311
  "name": "cursor",
@@ -14335,12 +14341,32 @@
14335
14341
  "total_assets": {
14336
14342
  "type": "number",
14337
14343
  "format": "double"
14344
+ },
14345
+ "total_liabilities": {
14346
+ "type": "number",
14347
+ "format": "double"
14348
+ },
14349
+ "total_equity": {
14350
+ "type": "number",
14351
+ "format": "double"
14352
+ },
14353
+ "total_debt": {
14354
+ "type": "number",
14355
+ "format": "double"
14356
+ },
14357
+ "net_debt": {
14358
+ "type": "number",
14359
+ "format": "double"
14338
14360
  }
14339
14361
  },
14340
14362
  "title": "StockBalanceSheet",
14341
14363
  "required": [
14342
14364
  "cash_and_cash_equivalents",
14343
- "total_assets"
14365
+ "total_assets",
14366
+ "total_liabilities",
14367
+ "total_equity",
14368
+ "total_debt",
14369
+ "net_debt"
14344
14370
  ]
14345
14371
  },
14346
14372
  "StockCashFlowStatement": {
@@ -14396,9 +14422,18 @@
14396
14422
  "properties": {
14397
14423
  "next": {
14398
14424
  "$ref": "#/definitions/StockFinancialEarningsEvent"
14425
+ },
14426
+ "history": {
14427
+ "type": "array",
14428
+ "items": {
14429
+ "$ref": "#/definitions/StockFinancialHistoricalEarning"
14430
+ }
14399
14431
  }
14400
14432
  },
14401
- "title": "StockFinancialEarnings"
14433
+ "title": "StockFinancialEarnings",
14434
+ "required": [
14435
+ "history"
14436
+ ]
14402
14437
  },
14403
14438
  "StockFinancialEarningsEvent": {
14404
14439
  "type": "object",
@@ -14430,6 +14465,38 @@
14430
14465
  "revenue_estimated"
14431
14466
  ]
14432
14467
  },
14468
+ "StockFinancialHistoricalEarning": {
14469
+ "type": "object",
14470
+ "properties": {
14471
+ "date": {
14472
+ "type": "string"
14473
+ },
14474
+ "eps_estimated": {
14475
+ "type": "number",
14476
+ "format": "double"
14477
+ },
14478
+ "eps_actual": {
14479
+ "type": "number",
14480
+ "format": "double"
14481
+ },
14482
+ "revenue_estimated": {
14483
+ "type": "number",
14484
+ "format": "double"
14485
+ },
14486
+ "revenue_actual": {
14487
+ "type": "number",
14488
+ "format": "double"
14489
+ }
14490
+ },
14491
+ "title": "StockFinancialHistoricalEarning",
14492
+ "required": [
14493
+ "date",
14494
+ "eps_estimated",
14495
+ "eps_actual",
14496
+ "revenue_estimated",
14497
+ "revenue_actual"
14498
+ ]
14499
+ },
14433
14500
  "StockFinancialPeriod": {
14434
14501
  "type": "object",
14435
14502
  "properties": {
@@ -14528,16 +14595,36 @@
14528
14595
  "type": "number",
14529
14596
  "format": "double"
14530
14597
  },
14598
+ "operating_income": {
14599
+ "type": "number",
14600
+ "format": "double"
14601
+ },
14602
+ "ebitda": {
14603
+ "type": "number",
14604
+ "format": "double"
14605
+ },
14531
14606
  "net_income": {
14532
14607
  "type": "number",
14533
14608
  "format": "double"
14609
+ },
14610
+ "eps": {
14611
+ "type": "number",
14612
+ "format": "double"
14613
+ },
14614
+ "eps_diluted": {
14615
+ "type": "number",
14616
+ "format": "double"
14534
14617
  }
14535
14618
  },
14536
14619
  "title": "StockIncomeStatement",
14537
14620
  "required": [
14538
14621
  "revenue",
14539
14622
  "gross_profit",
14540
- "net_income"
14623
+ "operating_income",
14624
+ "ebitda",
14625
+ "net_income",
14626
+ "eps",
14627
+ "eps_diluted"
14541
14628
  ]
14542
14629
  },
14543
14630
  "Strategy": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklighter-perps",
3
- "version": "1.0.271",
3
+ "version": "1.0.273",
4
4
  "description": "Lighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {