zklighter-perps 1.0.169 → 1.0.171
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/AccountLimits.ts +9 -0
- package/models/ReqGetTrades.ts +37 -0
- package/openapi.json +49 -53
- 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/AccountLimits.ts
CHANGED
|
@@ -37,6 +37,12 @@ export interface AccountLimits {
|
|
|
37
37
|
* @memberof AccountLimits
|
|
38
38
|
*/
|
|
39
39
|
max_llp_percentage: number;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @memberof AccountLimits
|
|
44
|
+
*/
|
|
45
|
+
max_llp_amount: string;
|
|
40
46
|
/**
|
|
41
47
|
*
|
|
42
48
|
* @type {string}
|
|
@@ -57,6 +63,7 @@ export interface AccountLimits {
|
|
|
57
63
|
export function instanceOfAccountLimits(value: object): value is AccountLimits {
|
|
58
64
|
if (!('code' in value) || value['code'] === undefined) return false;
|
|
59
65
|
if (!('max_llp_percentage' in value) || value['max_llp_percentage'] === undefined) return false;
|
|
66
|
+
if (!('max_llp_amount' in value) || value['max_llp_amount'] === undefined) return false;
|
|
60
67
|
if (!('user_tier' in value) || value['user_tier'] === undefined) return false;
|
|
61
68
|
if (!('can_create_public_pool' in value) || value['can_create_public_pool'] === undefined) return false;
|
|
62
69
|
return true;
|
|
@@ -75,6 +82,7 @@ export function AccountLimitsFromJSONTyped(json: any, ignoreDiscriminator: boole
|
|
|
75
82
|
'code': json['code'],
|
|
76
83
|
'message': json['message'] == null ? undefined : json['message'],
|
|
77
84
|
'max_llp_percentage': json['max_llp_percentage'],
|
|
85
|
+
'max_llp_amount': json['max_llp_amount'],
|
|
78
86
|
'user_tier': json['user_tier'],
|
|
79
87
|
'can_create_public_pool': json['can_create_public_pool'],
|
|
80
88
|
};
|
|
@@ -89,6 +97,7 @@ export function AccountLimitsToJSON(value?: AccountLimits | null): any {
|
|
|
89
97
|
'code': value['code'],
|
|
90
98
|
'message': value['message'],
|
|
91
99
|
'max_llp_percentage': value['max_llp_percentage'],
|
|
100
|
+
'max_llp_amount': value['max_llp_amount'],
|
|
92
101
|
'user_tier': value['user_tier'],
|
|
93
102
|
'can_create_public_pool': value['can_create_public_pool'],
|
|
94
103
|
};
|
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",
|
|
@@ -3149,6 +3137,10 @@
|
|
|
3149
3137
|
"format": "int32",
|
|
3150
3138
|
"example": "25"
|
|
3151
3139
|
},
|
|
3140
|
+
"max_llp_amount": {
|
|
3141
|
+
"type": "string",
|
|
3142
|
+
"example": "1000000"
|
|
3143
|
+
},
|
|
3152
3144
|
"user_tier": {
|
|
3153
3145
|
"type": "string",
|
|
3154
3146
|
"example": "std"
|
|
@@ -3163,6 +3155,7 @@
|
|
|
3163
3155
|
"required": [
|
|
3164
3156
|
"code",
|
|
3165
3157
|
"max_llp_percentage",
|
|
3158
|
+
"max_llp_amount",
|
|
3166
3159
|
"user_tier",
|
|
3167
3160
|
"can_create_public_pool"
|
|
3168
3161
|
]
|
|
@@ -6457,22 +6450,6 @@
|
|
|
6457
6450
|
"account_index"
|
|
6458
6451
|
]
|
|
6459
6452
|
},
|
|
6460
|
-
"ReqCancelDeposit": {
|
|
6461
|
-
"type": "object",
|
|
6462
|
-
"properties": {
|
|
6463
|
-
"from_addr": {
|
|
6464
|
-
"type": "string"
|
|
6465
|
-
},
|
|
6466
|
-
"chain_id": {
|
|
6467
|
-
"type": "string"
|
|
6468
|
-
}
|
|
6469
|
-
},
|
|
6470
|
-
"title": "ReqCancelDeposit",
|
|
6471
|
-
"required": [
|
|
6472
|
-
"from_addr",
|
|
6473
|
-
"chain_id"
|
|
6474
|
-
]
|
|
6475
|
-
},
|
|
6476
6453
|
"ReqChangeAccountTier": {
|
|
6477
6454
|
"type": "object",
|
|
6478
6455
|
"properties": {
|
|
@@ -7464,6 +7441,25 @@
|
|
|
7464
7441
|
"format": "int8",
|
|
7465
7442
|
"default": "-1"
|
|
7466
7443
|
},
|
|
7444
|
+
"role": {
|
|
7445
|
+
"type": "string",
|
|
7446
|
+
"enum": [
|
|
7447
|
+
"all",
|
|
7448
|
+
"maker",
|
|
7449
|
+
"taker"
|
|
7450
|
+
],
|
|
7451
|
+
"default": "all"
|
|
7452
|
+
},
|
|
7453
|
+
"type": {
|
|
7454
|
+
"type": "string",
|
|
7455
|
+
"enum": [
|
|
7456
|
+
"all",
|
|
7457
|
+
"trade",
|
|
7458
|
+
"liquidation",
|
|
7459
|
+
"deleverage"
|
|
7460
|
+
],
|
|
7461
|
+
"default": "all"
|
|
7462
|
+
},
|
|
7467
7463
|
"limit": {
|
|
7468
7464
|
"type": "integer",
|
|
7469
7465
|
"format": "int64",
|