zklighter-perps 1.0.65 → 1.0.67
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/AccountApi.ts +5 -0
- package/apis/OrderApi.ts +12 -0
- package/apis/TransactionApi.ts +6 -6
- package/models/AccountPosition.ts +17 -8
- package/models/OrderBookDetail.ts +13 -4
- package/models/ReqGetAccountActiveOrders.ts +9 -0
- package/models/ReqGetAccountPnL.ts +8 -0
- package/openapi.json +44 -10
- package/package.json +1 -1
package/apis/AccountApi.ts
CHANGED
|
@@ -86,6 +86,7 @@ export interface PnlRequest {
|
|
|
86
86
|
start_timestamp: number;
|
|
87
87
|
end_timestamp: number;
|
|
88
88
|
count_back: number;
|
|
89
|
+
ignore_transfers?: boolean;
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
export interface PublicPoolsRequest {
|
|
@@ -479,6 +480,10 @@ export class AccountApi extends runtime.BaseAPI {
|
|
|
479
480
|
queryParameters['count_back'] = requestParameters['count_back'];
|
|
480
481
|
}
|
|
481
482
|
|
|
483
|
+
if (requestParameters['ignore_transfers'] != null) {
|
|
484
|
+
queryParameters['ignore_transfers'] = requestParameters['ignore_transfers'];
|
|
485
|
+
}
|
|
486
|
+
|
|
482
487
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
483
488
|
|
|
484
489
|
const response = await this.request({
|
package/apis/OrderApi.ts
CHANGED
|
@@ -43,6 +43,7 @@ import {
|
|
|
43
43
|
export interface AccountActiveOrdersRequest {
|
|
44
44
|
account_index: number;
|
|
45
45
|
market_id: number;
|
|
46
|
+
auth: string;
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
export interface AccountInactiveOrdersRequest {
|
|
@@ -114,6 +115,13 @@ export class OrderApi extends runtime.BaseAPI {
|
|
|
114
115
|
);
|
|
115
116
|
}
|
|
116
117
|
|
|
118
|
+
if (requestParameters['auth'] == null) {
|
|
119
|
+
throw new runtime.RequiredError(
|
|
120
|
+
'auth',
|
|
121
|
+
'Required parameter "auth" was null or undefined when calling accountActiveOrders().'
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
117
125
|
const queryParameters: any = {};
|
|
118
126
|
|
|
119
127
|
if (requestParameters['account_index'] != null) {
|
|
@@ -124,6 +132,10 @@ export class OrderApi extends runtime.BaseAPI {
|
|
|
124
132
|
queryParameters['market_id'] = requestParameters['market_id'];
|
|
125
133
|
}
|
|
126
134
|
|
|
135
|
+
if (requestParameters['auth'] != null) {
|
|
136
|
+
queryParameters['auth'] = requestParameters['auth'];
|
|
137
|
+
}
|
|
138
|
+
|
|
127
139
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
128
140
|
|
|
129
141
|
const response = await this.request({
|
package/apis/TransactionApi.ts
CHANGED
|
@@ -82,7 +82,7 @@ export interface SetAccountMetadataRequest {
|
|
|
82
82
|
target_account_index: number;
|
|
83
83
|
api_key_index: number;
|
|
84
84
|
metadata: string;
|
|
85
|
-
|
|
85
|
+
auth: string;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
export interface TxRequest {
|
|
@@ -537,10 +537,10 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
537
537
|
);
|
|
538
538
|
}
|
|
539
539
|
|
|
540
|
-
if (requestParameters['
|
|
540
|
+
if (requestParameters['auth'] == null) {
|
|
541
541
|
throw new runtime.RequiredError(
|
|
542
|
-
'
|
|
543
|
-
'Required parameter "
|
|
542
|
+
'auth',
|
|
543
|
+
'Required parameter "auth" was null or undefined when calling setAccountMetadata().'
|
|
544
544
|
);
|
|
545
545
|
}
|
|
546
546
|
|
|
@@ -578,8 +578,8 @@ export class TransactionApi extends runtime.BaseAPI {
|
|
|
578
578
|
formParams.append('metadata', requestParameters['metadata'] as any);
|
|
579
579
|
}
|
|
580
580
|
|
|
581
|
-
if (requestParameters['
|
|
582
|
-
formParams.append('
|
|
581
|
+
if (requestParameters['auth'] != null) {
|
|
582
|
+
formParams.append('auth', requestParameters['auth'] as any);
|
|
583
583
|
}
|
|
584
584
|
|
|
585
585
|
const response = await this.request({
|
|
@@ -27,22 +27,28 @@ export interface AccountPosition {
|
|
|
27
27
|
market_id: number;
|
|
28
28
|
/**
|
|
29
29
|
*
|
|
30
|
-
* @type {
|
|
30
|
+
* @type {string}
|
|
31
31
|
* @memberof AccountPosition
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
symbol: string;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof AccountPosition
|
|
38
|
+
*/
|
|
39
|
+
initial_margin_fraction: string;
|
|
34
40
|
/**
|
|
35
41
|
*
|
|
36
42
|
* @type {number}
|
|
37
43
|
* @memberof AccountPosition
|
|
38
44
|
*/
|
|
39
|
-
|
|
45
|
+
open_order_count: number;
|
|
40
46
|
/**
|
|
41
47
|
*
|
|
42
|
-
* @type {
|
|
48
|
+
* @type {number}
|
|
43
49
|
* @memberof AccountPosition
|
|
44
50
|
*/
|
|
45
|
-
|
|
51
|
+
pending_order_count: number;
|
|
46
52
|
/**
|
|
47
53
|
*
|
|
48
54
|
* @type {number}
|
|
@@ -86,9 +92,10 @@ export interface AccountPosition {
|
|
|
86
92
|
*/
|
|
87
93
|
export function instanceOfAccountPosition(value: object): value is AccountPosition {
|
|
88
94
|
if (!('market_id' in value) || value['market_id'] === undefined) return false;
|
|
95
|
+
if (!('symbol' in value) || value['symbol'] === undefined) return false;
|
|
96
|
+
if (!('initial_margin_fraction' in value) || value['initial_margin_fraction'] === undefined) return false;
|
|
89
97
|
if (!('open_order_count' in value) || value['open_order_count'] === undefined) return false;
|
|
90
98
|
if (!('pending_order_count' in value) || value['pending_order_count'] === undefined) return false;
|
|
91
|
-
if (!('symbol' in value) || value['symbol'] === undefined) return false;
|
|
92
99
|
if (!('sign' in value) || value['sign'] === undefined) return false;
|
|
93
100
|
if (!('position' in value) || value['position'] === undefined) return false;
|
|
94
101
|
if (!('avg_entry_price' in value) || value['avg_entry_price'] === undefined) return false;
|
|
@@ -109,9 +116,10 @@ export function AccountPositionFromJSONTyped(json: any, ignoreDiscriminator: boo
|
|
|
109
116
|
return {
|
|
110
117
|
|
|
111
118
|
'market_id': json['market_id'],
|
|
119
|
+
'symbol': json['symbol'],
|
|
120
|
+
'initial_margin_fraction': json['initial_margin_fraction'],
|
|
112
121
|
'open_order_count': json['open_order_count'],
|
|
113
122
|
'pending_order_count': json['pending_order_count'],
|
|
114
|
-
'symbol': json['symbol'],
|
|
115
123
|
'sign': json['sign'],
|
|
116
124
|
'position': json['position'],
|
|
117
125
|
'avg_entry_price': json['avg_entry_price'],
|
|
@@ -128,9 +136,10 @@ export function AccountPositionToJSON(value?: AccountPosition | null): any {
|
|
|
128
136
|
return {
|
|
129
137
|
|
|
130
138
|
'market_id': value['market_id'],
|
|
139
|
+
'symbol': value['symbol'],
|
|
140
|
+
'initial_margin_fraction': value['initial_margin_fraction'],
|
|
131
141
|
'open_order_count': value['open_order_count'],
|
|
132
142
|
'pending_order_count': value['pending_order_count'],
|
|
133
|
-
'symbol': value['symbol'],
|
|
134
143
|
'sign': value['sign'],
|
|
135
144
|
'position': value['position'],
|
|
136
145
|
'avg_entry_price': value['avg_entry_price'],
|
|
@@ -108,7 +108,13 @@ export interface OrderBookDetail {
|
|
|
108
108
|
* @type {number}
|
|
109
109
|
* @memberof OrderBookDetail
|
|
110
110
|
*/
|
|
111
|
-
|
|
111
|
+
default_initial_margin_fraction: number;
|
|
112
|
+
/**
|
|
113
|
+
*
|
|
114
|
+
* @type {number}
|
|
115
|
+
* @memberof OrderBookDetail
|
|
116
|
+
*/
|
|
117
|
+
min_initial_margin_fraction: number;
|
|
112
118
|
/**
|
|
113
119
|
*
|
|
114
120
|
* @type {number}
|
|
@@ -206,7 +212,8 @@ export function instanceOfOrderBookDetail(value: object): value is OrderBookDeta
|
|
|
206
212
|
if (!('size_decimals' in value) || value['size_decimals'] === undefined) return false;
|
|
207
213
|
if (!('price_decimals' in value) || value['price_decimals'] === undefined) return false;
|
|
208
214
|
if (!('quote_multiplier' in value) || value['quote_multiplier'] === undefined) return false;
|
|
209
|
-
if (!('
|
|
215
|
+
if (!('default_initial_margin_fraction' in value) || value['default_initial_margin_fraction'] === undefined) return false;
|
|
216
|
+
if (!('min_initial_margin_fraction' in value) || value['min_initial_margin_fraction'] === undefined) return false;
|
|
210
217
|
if (!('maintenance_margin_fraction' in value) || value['maintenance_margin_fraction'] === undefined) return false;
|
|
211
218
|
if (!('closeout_margin_fraction' in value) || value['closeout_margin_fraction'] === undefined) return false;
|
|
212
219
|
if (!('last_trade_price' in value) || value['last_trade_price'] === undefined) return false;
|
|
@@ -245,7 +252,8 @@ export function OrderBookDetailFromJSONTyped(json: any, ignoreDiscriminator: boo
|
|
|
245
252
|
'size_decimals': json['size_decimals'],
|
|
246
253
|
'price_decimals': json['price_decimals'],
|
|
247
254
|
'quote_multiplier': json['quote_multiplier'],
|
|
248
|
-
'
|
|
255
|
+
'default_initial_margin_fraction': json['default_initial_margin_fraction'],
|
|
256
|
+
'min_initial_margin_fraction': json['min_initial_margin_fraction'],
|
|
249
257
|
'maintenance_margin_fraction': json['maintenance_margin_fraction'],
|
|
250
258
|
'closeout_margin_fraction': json['closeout_margin_fraction'],
|
|
251
259
|
'last_trade_price': json['last_trade_price'],
|
|
@@ -280,7 +288,8 @@ export function OrderBookDetailToJSON(value?: OrderBookDetail | null): any {
|
|
|
280
288
|
'size_decimals': value['size_decimals'],
|
|
281
289
|
'price_decimals': value['price_decimals'],
|
|
282
290
|
'quote_multiplier': value['quote_multiplier'],
|
|
283
|
-
'
|
|
291
|
+
'default_initial_margin_fraction': value['default_initial_margin_fraction'],
|
|
292
|
+
'min_initial_margin_fraction': value['min_initial_margin_fraction'],
|
|
284
293
|
'maintenance_margin_fraction': value['maintenance_margin_fraction'],
|
|
285
294
|
'closeout_margin_fraction': value['closeout_margin_fraction'],
|
|
286
295
|
'last_trade_price': value['last_trade_price'],
|
|
@@ -31,6 +31,12 @@ export interface ReqGetAccountActiveOrders {
|
|
|
31
31
|
* @memberof ReqGetAccountActiveOrders
|
|
32
32
|
*/
|
|
33
33
|
market_id: number;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof ReqGetAccountActiveOrders
|
|
38
|
+
*/
|
|
39
|
+
auth: string;
|
|
34
40
|
}
|
|
35
41
|
|
|
36
42
|
/**
|
|
@@ -39,6 +45,7 @@ export interface ReqGetAccountActiveOrders {
|
|
|
39
45
|
export function instanceOfReqGetAccountActiveOrders(value: object): value is ReqGetAccountActiveOrders {
|
|
40
46
|
if (!('account_index' in value) || value['account_index'] === undefined) return false;
|
|
41
47
|
if (!('market_id' in value) || value['market_id'] === undefined) return false;
|
|
48
|
+
if (!('auth' in value) || value['auth'] === undefined) return false;
|
|
42
49
|
return true;
|
|
43
50
|
}
|
|
44
51
|
|
|
@@ -54,6 +61,7 @@ export function ReqGetAccountActiveOrdersFromJSONTyped(json: any, ignoreDiscrimi
|
|
|
54
61
|
|
|
55
62
|
'account_index': json['account_index'],
|
|
56
63
|
'market_id': json['market_id'],
|
|
64
|
+
'auth': json['auth'],
|
|
57
65
|
};
|
|
58
66
|
}
|
|
59
67
|
|
|
@@ -65,6 +73,7 @@ export function ReqGetAccountActiveOrdersToJSON(value?: ReqGetAccountActiveOrder
|
|
|
65
73
|
|
|
66
74
|
'account_index': value['account_index'],
|
|
67
75
|
'market_id': value['market_id'],
|
|
76
|
+
'auth': value['auth'],
|
|
68
77
|
};
|
|
69
78
|
}
|
|
70
79
|
|
|
@@ -55,6 +55,12 @@ export interface ReqGetAccountPnL {
|
|
|
55
55
|
* @memberof ReqGetAccountPnL
|
|
56
56
|
*/
|
|
57
57
|
count_back: number;
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @type {boolean}
|
|
61
|
+
* @memberof ReqGetAccountPnL
|
|
62
|
+
*/
|
|
63
|
+
ignore_transfers?: boolean;
|
|
58
64
|
}
|
|
59
65
|
|
|
60
66
|
|
|
@@ -109,6 +115,7 @@ export function ReqGetAccountPnLFromJSONTyped(json: any, ignoreDiscriminator: bo
|
|
|
109
115
|
'start_timestamp': json['start_timestamp'],
|
|
110
116
|
'end_timestamp': json['end_timestamp'],
|
|
111
117
|
'count_back': json['count_back'],
|
|
118
|
+
'ignore_transfers': json['ignore_transfers'] == null ? undefined : json['ignore_transfers'],
|
|
112
119
|
};
|
|
113
120
|
}
|
|
114
121
|
|
|
@@ -124,6 +131,7 @@ export function ReqGetAccountPnLToJSON(value?: ReqGetAccountPnL | null): any {
|
|
|
124
131
|
'start_timestamp': value['start_timestamp'],
|
|
125
132
|
'end_timestamp': value['end_timestamp'],
|
|
126
133
|
'count_back': value['count_back'],
|
|
134
|
+
'ignore_transfers': value['ignore_transfers'],
|
|
127
135
|
};
|
|
128
136
|
}
|
|
129
137
|
|
package/openapi.json
CHANGED
|
@@ -116,6 +116,12 @@
|
|
|
116
116
|
"required": true,
|
|
117
117
|
"type": "integer",
|
|
118
118
|
"format": "uint8"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"name": "auth",
|
|
122
|
+
"in": "query",
|
|
123
|
+
"required": true,
|
|
124
|
+
"type": "string"
|
|
119
125
|
}
|
|
120
126
|
],
|
|
121
127
|
"tags": [
|
|
@@ -1321,6 +1327,14 @@
|
|
|
1321
1327
|
"required": true,
|
|
1322
1328
|
"type": "integer",
|
|
1323
1329
|
"format": "int64"
|
|
1330
|
+
},
|
|
1331
|
+
{
|
|
1332
|
+
"name": "ignore_transfers",
|
|
1333
|
+
"in": "query",
|
|
1334
|
+
"required": false,
|
|
1335
|
+
"type": "boolean",
|
|
1336
|
+
"format": "boolean",
|
|
1337
|
+
"default": "false"
|
|
1324
1338
|
}
|
|
1325
1339
|
],
|
|
1326
1340
|
"tags": [
|
|
@@ -1939,6 +1953,14 @@
|
|
|
1939
1953
|
"format": "uint8",
|
|
1940
1954
|
"example": "1"
|
|
1941
1955
|
},
|
|
1956
|
+
"symbol": {
|
|
1957
|
+
"type": "string",
|
|
1958
|
+
"example": "ETH"
|
|
1959
|
+
},
|
|
1960
|
+
"initial_margin_fraction": {
|
|
1961
|
+
"type": "string",
|
|
1962
|
+
"example": "20.00"
|
|
1963
|
+
},
|
|
1942
1964
|
"open_order_count": {
|
|
1943
1965
|
"type": "integer",
|
|
1944
1966
|
"format": "int64",
|
|
@@ -1949,10 +1971,6 @@
|
|
|
1949
1971
|
"format": "int64",
|
|
1950
1972
|
"example": "3"
|
|
1951
1973
|
},
|
|
1952
|
-
"symbol": {
|
|
1953
|
-
"type": "string",
|
|
1954
|
-
"example": "ETH"
|
|
1955
|
-
},
|
|
1956
1974
|
"sign": {
|
|
1957
1975
|
"type": "integer",
|
|
1958
1976
|
"format": "int32",
|
|
@@ -1982,9 +2000,10 @@
|
|
|
1982
2000
|
"title": "AccountPosition",
|
|
1983
2001
|
"required": [
|
|
1984
2002
|
"market_id",
|
|
2003
|
+
"symbol",
|
|
2004
|
+
"initial_margin_fraction",
|
|
1985
2005
|
"open_order_count",
|
|
1986
2006
|
"pending_order_count",
|
|
1987
|
-
"symbol",
|
|
1988
2007
|
"sign",
|
|
1989
2008
|
"position",
|
|
1990
2009
|
"avg_entry_price",
|
|
@@ -3417,7 +3436,12 @@
|
|
|
3417
3436
|
"format": "int64",
|
|
3418
3437
|
"example": "10000"
|
|
3419
3438
|
},
|
|
3420
|
-
"
|
|
3439
|
+
"default_initial_margin_fraction": {
|
|
3440
|
+
"type": "integer",
|
|
3441
|
+
"format": "uin16",
|
|
3442
|
+
"example": "100"
|
|
3443
|
+
},
|
|
3444
|
+
"min_initial_margin_fraction": {
|
|
3421
3445
|
"type": "integer",
|
|
3422
3446
|
"format": "uin16",
|
|
3423
3447
|
"example": "100"
|
|
@@ -3497,7 +3521,8 @@
|
|
|
3497
3521
|
"size_decimals",
|
|
3498
3522
|
"price_decimals",
|
|
3499
3523
|
"quote_multiplier",
|
|
3500
|
-
"
|
|
3524
|
+
"default_initial_margin_fraction",
|
|
3525
|
+
"min_initial_margin_fraction",
|
|
3501
3526
|
"maintenance_margin_fraction",
|
|
3502
3527
|
"closeout_margin_fraction",
|
|
3503
3528
|
"last_trade_price",
|
|
@@ -3968,12 +3993,16 @@
|
|
|
3968
3993
|
"market_id": {
|
|
3969
3994
|
"type": "integer",
|
|
3970
3995
|
"format": "uint8"
|
|
3996
|
+
},
|
|
3997
|
+
"auth": {
|
|
3998
|
+
"type": "string"
|
|
3971
3999
|
}
|
|
3972
4000
|
},
|
|
3973
4001
|
"title": "ReqGetAccountActiveOrders",
|
|
3974
4002
|
"required": [
|
|
3975
4003
|
"account_index",
|
|
3976
|
-
"market_id"
|
|
4004
|
+
"market_id",
|
|
4005
|
+
"auth"
|
|
3977
4006
|
]
|
|
3978
4007
|
},
|
|
3979
4008
|
"ReqGetAccountApiKeys": {
|
|
@@ -4121,6 +4150,11 @@
|
|
|
4121
4150
|
"count_back": {
|
|
4122
4151
|
"type": "integer",
|
|
4123
4152
|
"format": "int64"
|
|
4153
|
+
},
|
|
4154
|
+
"ignore_transfers": {
|
|
4155
|
+
"type": "boolean",
|
|
4156
|
+
"format": "boolean",
|
|
4157
|
+
"default": "false"
|
|
4124
4158
|
}
|
|
4125
4159
|
},
|
|
4126
4160
|
"title": "ReqGetAccountPnL",
|
|
@@ -4675,7 +4709,7 @@
|
|
|
4675
4709
|
"metadata": {
|
|
4676
4710
|
"type": "string"
|
|
4677
4711
|
},
|
|
4678
|
-
"
|
|
4712
|
+
"auth": {
|
|
4679
4713
|
"type": "string"
|
|
4680
4714
|
}
|
|
4681
4715
|
},
|
|
@@ -4685,7 +4719,7 @@
|
|
|
4685
4719
|
"target_account_index",
|
|
4686
4720
|
"api_key_index",
|
|
4687
4721
|
"metadata",
|
|
4688
|
-
"
|
|
4722
|
+
"auth"
|
|
4689
4723
|
]
|
|
4690
4724
|
},
|
|
4691
4725
|
"ResultCode": {
|