zklighter-perps 1.0.243 → 1.0.244

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
@@ -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
@@ -7660,7 +7660,10 @@
7660
7660
  }
7661
7661
  },
7662
7662
  "asset_index_prices": {
7663
- "$ref": "#/definitions/mapint16string"
7663
+ "type": "object",
7664
+ "additionalProperties": {
7665
+ "type": "string"
7666
+ }
7664
7667
  }
7665
7668
  },
7666
7669
  "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.244",
4
4
  "description": "Lighter Perps SDK",
5
5
  "main": "index.ts",
6
6
  "directories": {