zklighter-perps 1.0.271 → 1.0.272
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.
- package/.circleci/openapi_postprocess.py +31 -23
- package/apis/AccountApi.ts +2 -2
- package/apis/CandlestickApi.ts +2 -2
- package/openapi.json +10 -4
- package/package.json +1 -1
|
@@ -109,19 +109,40 @@ data = walk(data, _add_bad_request_response)
|
|
|
109
109
|
|
|
110
110
|
|
|
111
111
|
# ---------------------------------------------------------------------------
|
|
112
|
-
# Step 6.
|
|
113
|
-
#
|
|
114
|
-
#
|
|
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
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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
|
-
|
|
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())
|
package/apis/AccountApi.ts
CHANGED
|
@@ -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) {
|
package/apis/CandlestickApi.ts
CHANGED
|
@@ -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 = {};
|
package/openapi.json
CHANGED
|
@@ -2841,8 +2841,11 @@
|
|
|
2841
2841
|
"name": "market_ids",
|
|
2842
2842
|
"in": "query",
|
|
2843
2843
|
"required": false,
|
|
2844
|
-
"type": "
|
|
2845
|
-
"
|
|
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": "
|
|
3302
|
-
"
|
|
3304
|
+
"type": "array",
|
|
3305
|
+
"items": {
|
|
3306
|
+
"type": "integer",
|
|
3307
|
+
"format": "int16"
|
|
3308
|
+
}
|
|
3303
3309
|
},
|
|
3304
3310
|
{
|
|
3305
3311
|
"name": "cursor",
|