zklighter-perps 1.0.243 → 1.0.245

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.
@@ -38,21 +38,23 @@ with open(FILE, "r") as f:
38
38
  else:
39
39
  data["paths"][path][method]["operationId"] = "status"
40
40
 
41
- # Replace $ref to int16 with inline int64 in RespGetMakerOnlyApiKeys.
42
- # int16 is not a standard OpenAPI format and causes the generator to emit
43
- # broken Int16 model references when used as a $ref in response schemas.
41
+ # Replace $ref to int16 types with inline equivalents across all definitions.
42
+ # int16 and derived map types are not standard OpenAPI and cause the generator
43
+ # to emit broken model references.
44
44
  def replace_int16_refs(obj):
45
45
  if isinstance(obj, dict):
46
46
  if obj.get("$ref") == "#/definitions/int16":
47
47
  return {"type": "integer", "format": "int64"}
48
+ if obj.get("$ref") == "#/definitions/mapint16string":
49
+ return {"type": "object", "additionalProperties": {"type": "string"}}
48
50
  return {k: replace_int16_refs(v) for k, v in obj.items()}
49
51
  if isinstance(obj, list):
50
52
  return [replace_int16_refs(i) for i in obj]
51
53
  return obj
52
54
 
53
- if "RespGetMakerOnlyApiKeys" in data["definitions"]:
54
- data["definitions"]["RespGetMakerOnlyApiKeys"] = replace_int16_refs(
55
- data["definitions"]["RespGetMakerOnlyApiKeys"]
55
+ for defn_name in list(data["definitions"]):
56
+ data["definitions"][defn_name] = replace_int16_refs(
57
+ data["definitions"][defn_name]
56
58
  )
57
59
 
58
60
  # Fix enum placement for array types: move enum from array level into items
@@ -55,6 +55,12 @@ export interface AccountMetadata {
55
55
  * @memberof AccountMetadata
56
56
  */
57
57
  can_rfq: boolean;
58
+ /**
59
+ *
60
+ * @type {Array<string>}
61
+ * @memberof AccountMetadata
62
+ */
63
+ can_rfq_market_ids: Array<string>;
58
64
  /**
59
65
  *
60
66
  * @type {number}
@@ -73,6 +79,7 @@ export function instanceOfAccountMetadata(value: object): value is AccountMetada
73
79
  if (!('can_invite' in value) || value['can_invite'] === undefined) return false;
74
80
  if (!('referral_points_percentage' in value) || value['referral_points_percentage'] === undefined) return false;
75
81
  if (!('can_rfq' in value) || value['can_rfq'] === undefined) return false;
82
+ if (!('can_rfq_market_ids' in value) || value['can_rfq_market_ids'] === undefined) return false;
76
83
  if (!('created_at' in value) || value['created_at'] === undefined) return false;
77
84
  return true;
78
85
  }
@@ -93,6 +100,7 @@ export function AccountMetadataFromJSONTyped(json: any, ignoreDiscriminator: boo
93
100
  'can_invite': json['can_invite'],
94
101
  'referral_points_percentage': json['referral_points_percentage'],
95
102
  'can_rfq': json['can_rfq'],
103
+ 'can_rfq_market_ids': json['can_rfq_market_ids'],
96
104
  'created_at': json['created_at'],
97
105
  };
98
106
  }
@@ -109,6 +117,7 @@ export function AccountMetadataToJSON(value?: AccountMetadata | null): any {
109
117
  'can_invite': value['can_invite'],
110
118
  'referral_points_percentage': value['referral_points_percentage'],
111
119
  'can_rfq': value['can_rfq'],
120
+ 'can_rfq_market_ids': value['can_rfq_market_ids'],
112
121
  'created_at': value['created_at'],
113
122
  };
114
123
  }
@@ -176,6 +176,12 @@ export interface DetailedAccount {
176
176
  * @memberof DetailedAccount
177
177
  */
178
178
  can_rfq: boolean;
179
+ /**
180
+ *
181
+ * @type {Array<string>}
182
+ * @memberof DetailedAccount
183
+ */
184
+ can_rfq_market_ids: Array<string>;
179
185
  /**
180
186
  *
181
187
  * @type {number}
@@ -266,6 +272,7 @@ export function instanceOfDetailedAccount(value: object): value is DetailedAccou
266
272
  if (!('can_invite' in value) || value['can_invite'] === undefined) return false;
267
273
  if (!('referral_points_percentage' in value) || value['referral_points_percentage'] === undefined) return false;
268
274
  if (!('can_rfq' in value) || value['can_rfq'] === undefined) return false;
275
+ if (!('can_rfq_market_ids' in value) || value['can_rfq_market_ids'] === undefined) return false;
269
276
  if (!('created_at' in value) || value['created_at'] === undefined) return false;
270
277
  if (!('positions' in value) || value['positions'] === undefined) return false;
271
278
  if (!('assets' in value) || value['assets'] === undefined) return false;
@@ -308,6 +315,7 @@ export function DetailedAccountFromJSONTyped(json: any, ignoreDiscriminator: boo
308
315
  'can_invite': json['can_invite'],
309
316
  'referral_points_percentage': json['referral_points_percentage'],
310
317
  'can_rfq': json['can_rfq'],
318
+ 'can_rfq_market_ids': json['can_rfq_market_ids'],
311
319
  'created_at': json['created_at'],
312
320
  'positions': ((json['positions'] as Array<any>).map(AccountPositionFromJSON)),
313
321
  'assets': ((json['assets'] as Array<any>).map(AccountAssetFromJSON)),
@@ -348,6 +356,7 @@ export function DetailedAccountToJSON(value?: DetailedAccount | null): any {
348
356
  'can_invite': value['can_invite'],
349
357
  'referral_points_percentage': value['referral_points_percentage'],
350
358
  'can_rfq': value['can_rfq'],
359
+ 'can_rfq_market_ids': value['can_rfq_market_ids'],
351
360
  'created_at': value['created_at'],
352
361
  'positions': ((value['positions'] as Array<any>).map(AccountPositionToJSON)),
353
362
  'assets': ((value['assets'] as Array<any>).map(AccountAssetToJSON)),
@@ -25,12 +25,6 @@ import {
25
25
  AccountPositionFromJSONTyped,
26
26
  AccountPositionToJSON,
27
27
  } from './AccountPosition';
28
- import type { Mapint16string } from './Mapint16string';
29
- import {
30
- Mapint16stringFromJSON,
31
- Mapint16stringFromJSONTyped,
32
- Mapint16stringToJSON,
33
- } from './Mapint16string';
34
28
  import type { RiskInfo } from './RiskInfo';
35
29
  import {
36
30
  RiskInfoFromJSON,
@@ -76,10 +70,10 @@ export interface LiquidationInfo {
76
70
  assets: Array<AccountAsset>;
77
71
  /**
78
72
  *
79
- * @type {Mapint16string}
73
+ * @type {{ [key: string]: string; }}
80
74
  * @memberof LiquidationInfo
81
75
  */
82
- asset_index_prices: Mapint16string;
76
+ asset_index_prices: { [key: string]: string; };
83
77
  }
84
78
 
85
79
  /**
@@ -110,7 +104,7 @@ export function LiquidationInfoFromJSONTyped(json: any, ignoreDiscriminator: boo
110
104
  'risk_info_after': RiskInfoFromJSON(json['risk_info_after']),
111
105
  'mark_prices': json['mark_prices'],
112
106
  'assets': ((json['assets'] as Array<any>).map(AccountAssetFromJSON)),
113
- 'asset_index_prices': Mapint16stringFromJSON(json['asset_index_prices']),
107
+ 'asset_index_prices': json['asset_index_prices'],
114
108
  };
115
109
  }
116
110
 
@@ -125,7 +119,7 @@ export function LiquidationInfoToJSON(value?: LiquidationInfo | null): any {
125
119
  'risk_info_after': RiskInfoToJSON(value['risk_info_after']),
126
120
  'mark_prices': value['mark_prices'],
127
121
  'assets': ((value['assets'] as Array<any>).map(AccountAssetToJSON)),
128
- 'asset_index_prices': Mapint16stringToJSON(value['asset_index_prices']),
122
+ 'asset_index_prices': value['asset_index_prices'],
129
123
  };
130
124
  }
131
125
 
package/openapi.json CHANGED
@@ -5049,6 +5049,12 @@
5049
5049
  "type": "boolean",
5050
5050
  "format": "boolean"
5051
5051
  },
5052
+ "can_rfq_market_ids": {
5053
+ "type": "array",
5054
+ "items": {
5055
+ "type": "string"
5056
+ }
5057
+ },
5052
5058
  "created_at": {
5053
5059
  "type": "integer",
5054
5060
  "format": "int64"
@@ -5062,6 +5068,7 @@
5062
5068
  "can_invite",
5063
5069
  "referral_points_percentage",
5064
5070
  "can_rfq",
5071
+ "can_rfq_market_ids",
5065
5072
  "created_at"
5066
5073
  ]
5067
5074
  },
@@ -6510,6 +6517,12 @@
6510
6517
  "type": "boolean",
6511
6518
  "format": "boolean"
6512
6519
  },
6520
+ "can_rfq_market_ids": {
6521
+ "type": "array",
6522
+ "items": {
6523
+ "type": "string"
6524
+ }
6525
+ },
6513
6526
  "created_at": {
6514
6527
  "type": "integer",
6515
6528
  "format": "int64"
@@ -6584,6 +6597,7 @@
6584
6597
  "can_invite",
6585
6598
  "referral_points_percentage",
6586
6599
  "can_rfq",
6600
+ "can_rfq_market_ids",
6587
6601
  "created_at",
6588
6602
  "positions",
6589
6603
  "assets",
@@ -7660,7 +7674,10 @@
7660
7674
  }
7661
7675
  },
7662
7676
  "asset_index_prices": {
7663
- "$ref": "#/definitions/mapint16string"
7677
+ "type": "object",
7678
+ "additionalProperties": {
7679
+ "type": "string"
7680
+ }
7664
7681
  }
7665
7682
  },
7666
7683
  "title": "LiquidationInfo",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zklighter-perps",
3
- "version": "1.0.243",
3
+ "version": "1.0.245",
4
4
  "description": "Lighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {