zklighter-perps 1.0.170 → 1.0.172
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/apis/BridgeApi.ts +0 -70
- package/apis/OrderApi.ts +29 -0
- package/models/MarketConfig.ts +18 -0
- package/models/ReqGetTrades.ts +37 -0
- package/openapi.json +55 -54
- package/package.json +1 -1
package/apis/BridgeApi.ts
CHANGED
|
@@ -58,11 +58,6 @@ export interface CreateIntentAddressRequest {
|
|
|
58
58
|
is_external_deposit?: boolean;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
export interface DepositCancelRequest {
|
|
62
|
-
from_addr: string;
|
|
63
|
-
chain_id: string;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
61
|
export interface DepositLatestRequest {
|
|
67
62
|
l1_address: string;
|
|
68
63
|
}
|
|
@@ -243,71 +238,6 @@ export class BridgeApi extends runtime.BaseAPI {
|
|
|
243
238
|
return await response.value();
|
|
244
239
|
}
|
|
245
240
|
|
|
246
|
-
/**
|
|
247
|
-
* Cancel bridge deposit
|
|
248
|
-
* deposit_cancel
|
|
249
|
-
*/
|
|
250
|
-
async depositCancelRaw(requestParameters: DepositCancelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ResultCode>> {
|
|
251
|
-
if (requestParameters['from_addr'] == null) {
|
|
252
|
-
throw new runtime.RequiredError(
|
|
253
|
-
'from_addr',
|
|
254
|
-
'Required parameter "from_addr" was null or undefined when calling depositCancel().'
|
|
255
|
-
);
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
if (requestParameters['chain_id'] == null) {
|
|
259
|
-
throw new runtime.RequiredError(
|
|
260
|
-
'chain_id',
|
|
261
|
-
'Required parameter "chain_id" was null or undefined when calling depositCancel().'
|
|
262
|
-
);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
const queryParameters: any = {};
|
|
266
|
-
|
|
267
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
268
|
-
|
|
269
|
-
const consumes: runtime.Consume[] = [
|
|
270
|
-
{ contentType: 'multipart/form-data' },
|
|
271
|
-
];
|
|
272
|
-
// @ts-ignore: canConsumeForm may be unused
|
|
273
|
-
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
274
|
-
|
|
275
|
-
let formParams: { append(param: string, value: any): any };
|
|
276
|
-
let useForm = false;
|
|
277
|
-
if (useForm) {
|
|
278
|
-
formParams = new FormData();
|
|
279
|
-
} else {
|
|
280
|
-
formParams = new URLSearchParams();
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
if (requestParameters['from_addr'] != null) {
|
|
284
|
-
formParams.append('from_addr', requestParameters['from_addr'] as any);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
if (requestParameters['chain_id'] != null) {
|
|
288
|
-
formParams.append('chain_id', requestParameters['chain_id'] as any);
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
const response = await this.request({
|
|
292
|
-
path: `/api/v1/deposit/cancel`,
|
|
293
|
-
method: 'POST',
|
|
294
|
-
headers: headerParameters,
|
|
295
|
-
query: queryParameters,
|
|
296
|
-
body: formParams,
|
|
297
|
-
}, initOverrides);
|
|
298
|
-
|
|
299
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => ResultCodeFromJSON(jsonValue));
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
/**
|
|
303
|
-
* Cancel bridge deposit
|
|
304
|
-
* deposit_cancel
|
|
305
|
-
*/
|
|
306
|
-
async depositCancel(requestParameters: DepositCancelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ResultCode> {
|
|
307
|
-
const response = await this.depositCancelRaw(requestParameters, initOverrides);
|
|
308
|
-
return await response.value();
|
|
309
|
-
}
|
|
310
|
-
|
|
311
241
|
/**
|
|
312
242
|
* Get most recent deposit for given l1 address
|
|
313
243
|
* deposit_latest
|
package/apis/OrderApi.ts
CHANGED
|
@@ -99,6 +99,8 @@ export interface TradesRequest {
|
|
|
99
99
|
cursor?: string;
|
|
100
100
|
from?: number;
|
|
101
101
|
ask_filter?: number;
|
|
102
|
+
role?: TradesRoleEnum;
|
|
103
|
+
type?: TradesTypeEnum;
|
|
102
104
|
}
|
|
103
105
|
|
|
104
106
|
/**
|
|
@@ -542,6 +544,14 @@ export class OrderApi extends runtime.BaseAPI {
|
|
|
542
544
|
queryParameters['ask_filter'] = requestParameters['ask_filter'];
|
|
543
545
|
}
|
|
544
546
|
|
|
547
|
+
if (requestParameters['role'] != null) {
|
|
548
|
+
queryParameters['role'] = requestParameters['role'];
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
if (requestParameters['type'] != null) {
|
|
552
|
+
queryParameters['type'] = requestParameters['type'];
|
|
553
|
+
}
|
|
554
|
+
|
|
545
555
|
if (requestParameters['limit'] != null) {
|
|
546
556
|
queryParameters['limit'] = requestParameters['limit'];
|
|
547
557
|
}
|
|
@@ -597,3 +607,22 @@ export const TradesSortDirEnum = {
|
|
|
597
607
|
Desc: 'desc'
|
|
598
608
|
} as const;
|
|
599
609
|
export type TradesSortDirEnum = typeof TradesSortDirEnum[keyof typeof TradesSortDirEnum];
|
|
610
|
+
/**
|
|
611
|
+
* @export
|
|
612
|
+
*/
|
|
613
|
+
export const TradesRoleEnum = {
|
|
614
|
+
All: 'all',
|
|
615
|
+
Maker: 'maker',
|
|
616
|
+
Taker: 'taker'
|
|
617
|
+
} as const;
|
|
618
|
+
export type TradesRoleEnum = typeof TradesRoleEnum[keyof typeof TradesRoleEnum];
|
|
619
|
+
/**
|
|
620
|
+
* @export
|
|
621
|
+
*/
|
|
622
|
+
export const TradesTypeEnum = {
|
|
623
|
+
All: 'all',
|
|
624
|
+
Trade: 'trade',
|
|
625
|
+
Liquidation: 'liquidation',
|
|
626
|
+
Deleverage: 'deleverage'
|
|
627
|
+
} as const;
|
|
628
|
+
export type TradesTypeEnum = typeof TradesTypeEnum[keyof typeof TradesTypeEnum];
|
package/models/MarketConfig.ts
CHANGED
|
@@ -31,6 +31,18 @@ export interface MarketConfig {
|
|
|
31
31
|
* @memberof MarketConfig
|
|
32
32
|
*/
|
|
33
33
|
insurance_fund_account_index: number;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {number}
|
|
37
|
+
* @memberof MarketConfig
|
|
38
|
+
*/
|
|
39
|
+
liquidation_mode: number;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {boolean}
|
|
43
|
+
* @memberof MarketConfig
|
|
44
|
+
*/
|
|
45
|
+
force_reduce_only: boolean;
|
|
34
46
|
}
|
|
35
47
|
|
|
36
48
|
/**
|
|
@@ -39,6 +51,8 @@ export interface MarketConfig {
|
|
|
39
51
|
export function instanceOfMarketConfig(value: object): value is MarketConfig {
|
|
40
52
|
if (!('market_margin_mode' in value) || value['market_margin_mode'] === undefined) return false;
|
|
41
53
|
if (!('insurance_fund_account_index' in value) || value['insurance_fund_account_index'] === undefined) return false;
|
|
54
|
+
if (!('liquidation_mode' in value) || value['liquidation_mode'] === undefined) return false;
|
|
55
|
+
if (!('force_reduce_only' in value) || value['force_reduce_only'] === undefined) return false;
|
|
42
56
|
return true;
|
|
43
57
|
}
|
|
44
58
|
|
|
@@ -54,6 +68,8 @@ export function MarketConfigFromJSONTyped(json: any, ignoreDiscriminator: boolea
|
|
|
54
68
|
|
|
55
69
|
'market_margin_mode': json['market_margin_mode'],
|
|
56
70
|
'insurance_fund_account_index': json['insurance_fund_account_index'],
|
|
71
|
+
'liquidation_mode': json['liquidation_mode'],
|
|
72
|
+
'force_reduce_only': json['force_reduce_only'],
|
|
57
73
|
};
|
|
58
74
|
}
|
|
59
75
|
|
|
@@ -65,6 +81,8 @@ export function MarketConfigToJSON(value?: MarketConfig | null): any {
|
|
|
65
81
|
|
|
66
82
|
'market_margin_mode': value['market_margin_mode'],
|
|
67
83
|
'insurance_fund_account_index': value['insurance_fund_account_index'],
|
|
84
|
+
'liquidation_mode': value['liquidation_mode'],
|
|
85
|
+
'force_reduce_only': value['force_reduce_only'],
|
|
68
86
|
};
|
|
69
87
|
}
|
|
70
88
|
|
package/models/ReqGetTrades.ts
CHANGED
|
@@ -73,6 +73,18 @@ export interface ReqGetTrades {
|
|
|
73
73
|
* @memberof ReqGetTrades
|
|
74
74
|
*/
|
|
75
75
|
ask_filter?: number;
|
|
76
|
+
/**
|
|
77
|
+
*
|
|
78
|
+
* @type {string}
|
|
79
|
+
* @memberof ReqGetTrades
|
|
80
|
+
*/
|
|
81
|
+
role?: ReqGetTradesRoleEnum;
|
|
82
|
+
/**
|
|
83
|
+
*
|
|
84
|
+
* @type {string}
|
|
85
|
+
* @memberof ReqGetTrades
|
|
86
|
+
*/
|
|
87
|
+
type?: ReqGetTradesTypeEnum;
|
|
76
88
|
/**
|
|
77
89
|
*
|
|
78
90
|
* @type {number}
|
|
@@ -100,6 +112,27 @@ export const ReqGetTradesSortDirEnum = {
|
|
|
100
112
|
} as const;
|
|
101
113
|
export type ReqGetTradesSortDirEnum = typeof ReqGetTradesSortDirEnum[keyof typeof ReqGetTradesSortDirEnum];
|
|
102
114
|
|
|
115
|
+
/**
|
|
116
|
+
* @export
|
|
117
|
+
*/
|
|
118
|
+
export const ReqGetTradesRoleEnum = {
|
|
119
|
+
All: 'all',
|
|
120
|
+
Maker: 'maker',
|
|
121
|
+
Taker: 'taker'
|
|
122
|
+
} as const;
|
|
123
|
+
export type ReqGetTradesRoleEnum = typeof ReqGetTradesRoleEnum[keyof typeof ReqGetTradesRoleEnum];
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @export
|
|
127
|
+
*/
|
|
128
|
+
export const ReqGetTradesTypeEnum = {
|
|
129
|
+
All: 'all',
|
|
130
|
+
Trade: 'trade',
|
|
131
|
+
Liquidation: 'liquidation',
|
|
132
|
+
Deleverage: 'deleverage'
|
|
133
|
+
} as const;
|
|
134
|
+
export type ReqGetTradesTypeEnum = typeof ReqGetTradesTypeEnum[keyof typeof ReqGetTradesTypeEnum];
|
|
135
|
+
|
|
103
136
|
|
|
104
137
|
/**
|
|
105
138
|
* Check if a given object implements the ReqGetTrades interface.
|
|
@@ -129,6 +162,8 @@ export function ReqGetTradesFromJSONTyped(json: any, ignoreDiscriminator: boolea
|
|
|
129
162
|
'cursor': json['cursor'] == null ? undefined : json['cursor'],
|
|
130
163
|
'from': json['from'] == null ? undefined : json['from'],
|
|
131
164
|
'ask_filter': json['ask_filter'] == null ? undefined : json['ask_filter'],
|
|
165
|
+
'role': json['role'] == null ? undefined : json['role'],
|
|
166
|
+
'type': json['type'] == null ? undefined : json['type'],
|
|
132
167
|
'limit': json['limit'],
|
|
133
168
|
};
|
|
134
169
|
}
|
|
@@ -148,6 +183,8 @@ export function ReqGetTradesToJSON(value?: ReqGetTrades | null): any {
|
|
|
148
183
|
'cursor': value['cursor'],
|
|
149
184
|
'from': value['from'],
|
|
150
185
|
'ask_filter': value['ask_filter'],
|
|
186
|
+
'role': value['role'],
|
|
187
|
+
'type': value['type'],
|
|
151
188
|
'limit': value['limit'],
|
|
152
189
|
};
|
|
153
190
|
}
|
package/openapi.json
CHANGED
|
@@ -927,43 +927,6 @@
|
|
|
927
927
|
"description": "Get current height"
|
|
928
928
|
}
|
|
929
929
|
},
|
|
930
|
-
"/api/v1/deposit/cancel": {
|
|
931
|
-
"post": {
|
|
932
|
-
"summary": "deposit_cancel",
|
|
933
|
-
"operationId": "deposit_cancel",
|
|
934
|
-
"responses": {
|
|
935
|
-
"200": {
|
|
936
|
-
"description": "A successful response.",
|
|
937
|
-
"schema": {
|
|
938
|
-
"$ref": "#/definitions/ResultCode"
|
|
939
|
-
}
|
|
940
|
-
},
|
|
941
|
-
"400": {
|
|
942
|
-
"description": "Bad request",
|
|
943
|
-
"schema": {
|
|
944
|
-
"$ref": "#/definitions/ResultCode"
|
|
945
|
-
}
|
|
946
|
-
}
|
|
947
|
-
},
|
|
948
|
-
"parameters": [
|
|
949
|
-
{
|
|
950
|
-
"name": "body",
|
|
951
|
-
"in": "body",
|
|
952
|
-
"required": true,
|
|
953
|
-
"schema": {
|
|
954
|
-
"$ref": "#/definitions/ReqCancelDeposit"
|
|
955
|
-
}
|
|
956
|
-
}
|
|
957
|
-
],
|
|
958
|
-
"tags": [
|
|
959
|
-
"bridge"
|
|
960
|
-
],
|
|
961
|
-
"consumes": [
|
|
962
|
-
"multipart/form-data"
|
|
963
|
-
],
|
|
964
|
-
"description": "Cancel bridge deposit"
|
|
965
|
-
}
|
|
966
|
-
},
|
|
967
930
|
"/api/v1/deposit/history": {
|
|
968
931
|
"get": {
|
|
969
932
|
"summary": "deposit_history",
|
|
@@ -2662,6 +2625,31 @@
|
|
|
2662
2625
|
"format": "int8",
|
|
2663
2626
|
"default": "-1"
|
|
2664
2627
|
},
|
|
2628
|
+
{
|
|
2629
|
+
"name": "role",
|
|
2630
|
+
"in": "query",
|
|
2631
|
+
"required": false,
|
|
2632
|
+
"type": "string",
|
|
2633
|
+
"enum": [
|
|
2634
|
+
"all",
|
|
2635
|
+
"maker",
|
|
2636
|
+
"taker"
|
|
2637
|
+
],
|
|
2638
|
+
"default": "all"
|
|
2639
|
+
},
|
|
2640
|
+
{
|
|
2641
|
+
"name": "type",
|
|
2642
|
+
"in": "query",
|
|
2643
|
+
"required": false,
|
|
2644
|
+
"type": "string",
|
|
2645
|
+
"enum": [
|
|
2646
|
+
"all",
|
|
2647
|
+
"trade",
|
|
2648
|
+
"liquidation",
|
|
2649
|
+
"deleverage"
|
|
2650
|
+
],
|
|
2651
|
+
"default": "all"
|
|
2652
|
+
},
|
|
2665
2653
|
{
|
|
2666
2654
|
"name": "limit",
|
|
2667
2655
|
"in": "query",
|
|
@@ -5208,12 +5196,22 @@
|
|
|
5208
5196
|
"insurance_fund_account_index": {
|
|
5209
5197
|
"type": "integer",
|
|
5210
5198
|
"format": "int64"
|
|
5199
|
+
},
|
|
5200
|
+
"liquidation_mode": {
|
|
5201
|
+
"type": "integer",
|
|
5202
|
+
"format": "int32"
|
|
5203
|
+
},
|
|
5204
|
+
"force_reduce_only": {
|
|
5205
|
+
"type": "boolean",
|
|
5206
|
+
"format": "boolean"
|
|
5211
5207
|
}
|
|
5212
5208
|
},
|
|
5213
5209
|
"title": "MarketConfig",
|
|
5214
5210
|
"required": [
|
|
5215
5211
|
"market_margin_mode",
|
|
5216
|
-
"insurance_fund_account_index"
|
|
5212
|
+
"insurance_fund_account_index",
|
|
5213
|
+
"liquidation_mode",
|
|
5214
|
+
"force_reduce_only"
|
|
5217
5215
|
]
|
|
5218
5216
|
},
|
|
5219
5217
|
"MarketInfo": {
|
|
@@ -6462,22 +6460,6 @@
|
|
|
6462
6460
|
"account_index"
|
|
6463
6461
|
]
|
|
6464
6462
|
},
|
|
6465
|
-
"ReqCancelDeposit": {
|
|
6466
|
-
"type": "object",
|
|
6467
|
-
"properties": {
|
|
6468
|
-
"from_addr": {
|
|
6469
|
-
"type": "string"
|
|
6470
|
-
},
|
|
6471
|
-
"chain_id": {
|
|
6472
|
-
"type": "string"
|
|
6473
|
-
}
|
|
6474
|
-
},
|
|
6475
|
-
"title": "ReqCancelDeposit",
|
|
6476
|
-
"required": [
|
|
6477
|
-
"from_addr",
|
|
6478
|
-
"chain_id"
|
|
6479
|
-
]
|
|
6480
|
-
},
|
|
6481
6463
|
"ReqChangeAccountTier": {
|
|
6482
6464
|
"type": "object",
|
|
6483
6465
|
"properties": {
|
|
@@ -7469,6 +7451,25 @@
|
|
|
7469
7451
|
"format": "int8",
|
|
7470
7452
|
"default": "-1"
|
|
7471
7453
|
},
|
|
7454
|
+
"role": {
|
|
7455
|
+
"type": "string",
|
|
7456
|
+
"enum": [
|
|
7457
|
+
"all",
|
|
7458
|
+
"maker",
|
|
7459
|
+
"taker"
|
|
7460
|
+
],
|
|
7461
|
+
"default": "all"
|
|
7462
|
+
},
|
|
7463
|
+
"type": {
|
|
7464
|
+
"type": "string",
|
|
7465
|
+
"enum": [
|
|
7466
|
+
"all",
|
|
7467
|
+
"trade",
|
|
7468
|
+
"liquidation",
|
|
7469
|
+
"deleverage"
|
|
7470
|
+
],
|
|
7471
|
+
"default": "all"
|
|
7472
|
+
},
|
|
7472
7473
|
"limit": {
|
|
7473
7474
|
"type": "integer",
|
|
7474
7475
|
"format": "int64",
|