zklighter-perps 1.0.105 → 1.0.107
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 +14 -0
- package/models/AccountPosition.ts +9 -0
- package/models/FundingRate.ts +23 -1
- package/models/Order.ts +51 -1
- package/models/ReqGetPositionFunding.ts +20 -0
- package/openapi.json +69 -2
- package/package.json +1 -1
package/apis/AccountApi.ts
CHANGED
|
@@ -104,6 +104,7 @@ export interface PositionFundingRequest {
|
|
|
104
104
|
limit: number;
|
|
105
105
|
market_id?: number;
|
|
106
106
|
cursor?: string;
|
|
107
|
+
side?: PositionFundingSideEnum;
|
|
107
108
|
}
|
|
108
109
|
|
|
109
110
|
export interface PublicPoolsRequest {
|
|
@@ -592,6 +593,10 @@ export class AccountApi extends runtime.BaseAPI {
|
|
|
592
593
|
queryParameters['limit'] = requestParameters['limit'];
|
|
593
594
|
}
|
|
594
595
|
|
|
596
|
+
if (requestParameters['side'] != null) {
|
|
597
|
+
queryParameters['side'] = requestParameters['side'];
|
|
598
|
+
}
|
|
599
|
+
|
|
595
600
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
596
601
|
|
|
597
602
|
const response = await this.request({
|
|
@@ -716,6 +721,15 @@ export const PnlResolutionEnum = {
|
|
|
716
721
|
_1d: '1d'
|
|
717
722
|
} as const;
|
|
718
723
|
export type PnlResolutionEnum = typeof PnlResolutionEnum[keyof typeof PnlResolutionEnum];
|
|
724
|
+
/**
|
|
725
|
+
* @export
|
|
726
|
+
*/
|
|
727
|
+
export const PositionFundingSideEnum = {
|
|
728
|
+
Long: 'long',
|
|
729
|
+
Short: 'short',
|
|
730
|
+
All: 'all'
|
|
731
|
+
} as const;
|
|
732
|
+
export type PositionFundingSideEnum = typeof PositionFundingSideEnum[keyof typeof PositionFundingSideEnum];
|
|
719
733
|
/**
|
|
720
734
|
* @export
|
|
721
735
|
*/
|
|
@@ -49,6 +49,12 @@ export interface AccountPosition {
|
|
|
49
49
|
* @memberof AccountPosition
|
|
50
50
|
*/
|
|
51
51
|
pending_order_count: number;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @type {number}
|
|
55
|
+
* @memberof AccountPosition
|
|
56
|
+
*/
|
|
57
|
+
position_tied_order_count: number;
|
|
52
58
|
/**
|
|
53
59
|
*
|
|
54
60
|
* @type {number}
|
|
@@ -96,6 +102,7 @@ export function instanceOfAccountPosition(value: object): value is AccountPositi
|
|
|
96
102
|
if (!('initial_margin_fraction' in value) || value['initial_margin_fraction'] === undefined) return false;
|
|
97
103
|
if (!('open_order_count' in value) || value['open_order_count'] === undefined) return false;
|
|
98
104
|
if (!('pending_order_count' in value) || value['pending_order_count'] === undefined) return false;
|
|
105
|
+
if (!('position_tied_order_count' in value) || value['position_tied_order_count'] === undefined) return false;
|
|
99
106
|
if (!('sign' in value) || value['sign'] === undefined) return false;
|
|
100
107
|
if (!('position' in value) || value['position'] === undefined) return false;
|
|
101
108
|
if (!('avg_entry_price' in value) || value['avg_entry_price'] === undefined) return false;
|
|
@@ -120,6 +127,7 @@ export function AccountPositionFromJSONTyped(json: any, ignoreDiscriminator: boo
|
|
|
120
127
|
'initial_margin_fraction': json['initial_margin_fraction'],
|
|
121
128
|
'open_order_count': json['open_order_count'],
|
|
122
129
|
'pending_order_count': json['pending_order_count'],
|
|
130
|
+
'position_tied_order_count': json['position_tied_order_count'],
|
|
123
131
|
'sign': json['sign'],
|
|
124
132
|
'position': json['position'],
|
|
125
133
|
'avg_entry_price': json['avg_entry_price'],
|
|
@@ -140,6 +148,7 @@ export function AccountPositionToJSON(value?: AccountPosition | null): any {
|
|
|
140
148
|
'initial_margin_fraction': value['initial_margin_fraction'],
|
|
141
149
|
'open_order_count': value['open_order_count'],
|
|
142
150
|
'pending_order_count': value['pending_order_count'],
|
|
151
|
+
'position_tied_order_count': value['position_tied_order_count'],
|
|
143
152
|
'sign': value['sign'],
|
|
144
153
|
'position': value['position'],
|
|
145
154
|
'avg_entry_price': value['avg_entry_price'],
|
package/models/FundingRate.ts
CHANGED
|
@@ -19,12 +19,18 @@ import { mapValues } from '../runtime';
|
|
|
19
19
|
* @interface FundingRate
|
|
20
20
|
*/
|
|
21
21
|
export interface FundingRate {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {number}
|
|
25
|
+
* @memberof FundingRate
|
|
26
|
+
*/
|
|
27
|
+
market_id: number;
|
|
22
28
|
/**
|
|
23
29
|
*
|
|
24
30
|
* @type {string}
|
|
25
31
|
* @memberof FundingRate
|
|
26
32
|
*/
|
|
27
|
-
exchange:
|
|
33
|
+
exchange: FundingRateExchangeEnum;
|
|
28
34
|
/**
|
|
29
35
|
*
|
|
30
36
|
* @type {string}
|
|
@@ -39,10 +45,24 @@ export interface FundingRate {
|
|
|
39
45
|
rate: number;
|
|
40
46
|
}
|
|
41
47
|
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @export
|
|
51
|
+
*/
|
|
52
|
+
export const FundingRateExchangeEnum = {
|
|
53
|
+
Binance: 'binance',
|
|
54
|
+
Bybit: 'bybit',
|
|
55
|
+
Hyperliquid: 'hyperliquid',
|
|
56
|
+
Lighter: 'lighter'
|
|
57
|
+
} as const;
|
|
58
|
+
export type FundingRateExchangeEnum = typeof FundingRateExchangeEnum[keyof typeof FundingRateExchangeEnum];
|
|
59
|
+
|
|
60
|
+
|
|
42
61
|
/**
|
|
43
62
|
* Check if a given object implements the FundingRate interface.
|
|
44
63
|
*/
|
|
45
64
|
export function instanceOfFundingRate(value: object): value is FundingRate {
|
|
65
|
+
if (!('market_id' in value) || value['market_id'] === undefined) return false;
|
|
46
66
|
if (!('exchange' in value) || value['exchange'] === undefined) return false;
|
|
47
67
|
if (!('symbol' in value) || value['symbol'] === undefined) return false;
|
|
48
68
|
if (!('rate' in value) || value['rate'] === undefined) return false;
|
|
@@ -59,6 +79,7 @@ export function FundingRateFromJSONTyped(json: any, ignoreDiscriminator: boolean
|
|
|
59
79
|
}
|
|
60
80
|
return {
|
|
61
81
|
|
|
82
|
+
'market_id': json['market_id'],
|
|
62
83
|
'exchange': json['exchange'],
|
|
63
84
|
'symbol': json['symbol'],
|
|
64
85
|
'rate': json['rate'],
|
|
@@ -71,6 +92,7 @@ export function FundingRateToJSON(value?: FundingRate | null): any {
|
|
|
71
92
|
}
|
|
72
93
|
return {
|
|
73
94
|
|
|
95
|
+
'market_id': value['market_id'],
|
|
74
96
|
'exchange': value['exchange'],
|
|
75
97
|
'symbol': value['symbol'],
|
|
76
98
|
'rate': value['rate'],
|
package/models/Order.ts
CHANGED
|
@@ -151,6 +151,12 @@ export interface Order {
|
|
|
151
151
|
* @memberof Order
|
|
152
152
|
*/
|
|
153
153
|
status: OrderStatusEnum;
|
|
154
|
+
/**
|
|
155
|
+
*
|
|
156
|
+
* @type {string}
|
|
157
|
+
* @memberof Order
|
|
158
|
+
*/
|
|
159
|
+
trigger_status: OrderTriggerStatusEnum;
|
|
154
160
|
/**
|
|
155
161
|
*
|
|
156
162
|
* @type {number}
|
|
@@ -169,6 +175,24 @@ export interface Order {
|
|
|
169
175
|
* @memberof Order
|
|
170
176
|
*/
|
|
171
177
|
parent_order_id: string;
|
|
178
|
+
/**
|
|
179
|
+
*
|
|
180
|
+
* @type {string}
|
|
181
|
+
* @memberof Order
|
|
182
|
+
*/
|
|
183
|
+
to_trigger_order_id_0: string;
|
|
184
|
+
/**
|
|
185
|
+
*
|
|
186
|
+
* @type {string}
|
|
187
|
+
* @memberof Order
|
|
188
|
+
*/
|
|
189
|
+
to_trigger_order_id_1: string;
|
|
190
|
+
/**
|
|
191
|
+
*
|
|
192
|
+
* @type {string}
|
|
193
|
+
* @memberof Order
|
|
194
|
+
*/
|
|
195
|
+
to_cancel_order_id_0: string;
|
|
172
196
|
/**
|
|
173
197
|
*
|
|
174
198
|
* @type {number}
|
|
@@ -227,10 +251,24 @@ export const OrderStatusEnum = {
|
|
|
227
251
|
CanceledTooMuchSlippage: 'canceled-too-much-slippage',
|
|
228
252
|
CanceledNotEnoughLiquidity: 'canceled-not-enough-liquidity',
|
|
229
253
|
CanceledSelfTrade: 'canceled-self-trade',
|
|
230
|
-
CanceledExpired: 'canceled-expired'
|
|
254
|
+
CanceledExpired: 'canceled-expired',
|
|
255
|
+
CanceledOco: 'canceled-oco',
|
|
256
|
+
CanceledChild: 'canceled-child'
|
|
231
257
|
} as const;
|
|
232
258
|
export type OrderStatusEnum = typeof OrderStatusEnum[keyof typeof OrderStatusEnum];
|
|
233
259
|
|
|
260
|
+
/**
|
|
261
|
+
* @export
|
|
262
|
+
*/
|
|
263
|
+
export const OrderTriggerStatusEnum = {
|
|
264
|
+
Na: 'na',
|
|
265
|
+
Ready: 'ready',
|
|
266
|
+
MarkPrice: 'mark-price',
|
|
267
|
+
Twap: 'twap',
|
|
268
|
+
ParentOrder: 'parent-order'
|
|
269
|
+
} as const;
|
|
270
|
+
export type OrderTriggerStatusEnum = typeof OrderTriggerStatusEnum[keyof typeof OrderTriggerStatusEnum];
|
|
271
|
+
|
|
234
272
|
|
|
235
273
|
/**
|
|
236
274
|
* Check if a given object implements the Order interface.
|
|
@@ -258,9 +296,13 @@ export function instanceOfOrder(value: object): value is Order {
|
|
|
258
296
|
if (!('trigger_price' in value) || value['trigger_price'] === undefined) return false;
|
|
259
297
|
if (!('order_expiry' in value) || value['order_expiry'] === undefined) return false;
|
|
260
298
|
if (!('status' in value) || value['status'] === undefined) return false;
|
|
299
|
+
if (!('trigger_status' in value) || value['trigger_status'] === undefined) return false;
|
|
261
300
|
if (!('trigger_time' in value) || value['trigger_time'] === undefined) return false;
|
|
262
301
|
if (!('parent_order_index' in value) || value['parent_order_index'] === undefined) return false;
|
|
263
302
|
if (!('parent_order_id' in value) || value['parent_order_id'] === undefined) return false;
|
|
303
|
+
if (!('to_trigger_order_id_0' in value) || value['to_trigger_order_id_0'] === undefined) return false;
|
|
304
|
+
if (!('to_trigger_order_id_1' in value) || value['to_trigger_order_id_1'] === undefined) return false;
|
|
305
|
+
if (!('to_cancel_order_id_0' in value) || value['to_cancel_order_id_0'] === undefined) return false;
|
|
264
306
|
if (!('block_height' in value) || value['block_height'] === undefined) return false;
|
|
265
307
|
if (!('timestamp' in value) || value['timestamp'] === undefined) return false;
|
|
266
308
|
return true;
|
|
@@ -298,9 +340,13 @@ export function OrderFromJSONTyped(json: any, ignoreDiscriminator: boolean): Ord
|
|
|
298
340
|
'trigger_price': json['trigger_price'],
|
|
299
341
|
'order_expiry': json['order_expiry'],
|
|
300
342
|
'status': json['status'],
|
|
343
|
+
'trigger_status': json['trigger_status'],
|
|
301
344
|
'trigger_time': json['trigger_time'],
|
|
302
345
|
'parent_order_index': json['parent_order_index'],
|
|
303
346
|
'parent_order_id': json['parent_order_id'],
|
|
347
|
+
'to_trigger_order_id_0': json['to_trigger_order_id_0'],
|
|
348
|
+
'to_trigger_order_id_1': json['to_trigger_order_id_1'],
|
|
349
|
+
'to_cancel_order_id_0': json['to_cancel_order_id_0'],
|
|
304
350
|
'block_height': json['block_height'],
|
|
305
351
|
'timestamp': json['timestamp'],
|
|
306
352
|
};
|
|
@@ -334,9 +380,13 @@ export function OrderToJSON(value?: Order | null): any {
|
|
|
334
380
|
'trigger_price': value['trigger_price'],
|
|
335
381
|
'order_expiry': value['order_expiry'],
|
|
336
382
|
'status': value['status'],
|
|
383
|
+
'trigger_status': value['trigger_status'],
|
|
337
384
|
'trigger_time': value['trigger_time'],
|
|
338
385
|
'parent_order_index': value['parent_order_index'],
|
|
339
386
|
'parent_order_id': value['parent_order_id'],
|
|
387
|
+
'to_trigger_order_id_0': value['to_trigger_order_id_0'],
|
|
388
|
+
'to_trigger_order_id_1': value['to_trigger_order_id_1'],
|
|
389
|
+
'to_cancel_order_id_0': value['to_cancel_order_id_0'],
|
|
340
390
|
'block_height': value['block_height'],
|
|
341
391
|
'timestamp': value['timestamp'],
|
|
342
392
|
};
|
|
@@ -43,8 +43,26 @@ export interface ReqGetPositionFunding {
|
|
|
43
43
|
* @memberof ReqGetPositionFunding
|
|
44
44
|
*/
|
|
45
45
|
limit: number;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @type {string}
|
|
49
|
+
* @memberof ReqGetPositionFunding
|
|
50
|
+
*/
|
|
51
|
+
side?: ReqGetPositionFundingSideEnum;
|
|
46
52
|
}
|
|
47
53
|
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @export
|
|
57
|
+
*/
|
|
58
|
+
export const ReqGetPositionFundingSideEnum = {
|
|
59
|
+
Long: 'long',
|
|
60
|
+
Short: 'short',
|
|
61
|
+
All: 'all'
|
|
62
|
+
} as const;
|
|
63
|
+
export type ReqGetPositionFundingSideEnum = typeof ReqGetPositionFundingSideEnum[keyof typeof ReqGetPositionFundingSideEnum];
|
|
64
|
+
|
|
65
|
+
|
|
48
66
|
/**
|
|
49
67
|
* Check if a given object implements the ReqGetPositionFunding interface.
|
|
50
68
|
*/
|
|
@@ -68,6 +86,7 @@ export function ReqGetPositionFundingFromJSONTyped(json: any, ignoreDiscriminato
|
|
|
68
86
|
'market_id': json['market_id'] == null ? undefined : json['market_id'],
|
|
69
87
|
'cursor': json['cursor'] == null ? undefined : json['cursor'],
|
|
70
88
|
'limit': json['limit'],
|
|
89
|
+
'side': json['side'] == null ? undefined : json['side'],
|
|
71
90
|
};
|
|
72
91
|
}
|
|
73
92
|
|
|
@@ -81,6 +100,7 @@ export function ReqGetPositionFundingToJSON(value?: ReqGetPositionFunding | null
|
|
|
81
100
|
'market_id': value['market_id'],
|
|
82
101
|
'cursor': value['cursor'],
|
|
83
102
|
'limit': value['limit'],
|
|
103
|
+
'side': value['side'],
|
|
84
104
|
};
|
|
85
105
|
}
|
|
86
106
|
|
package/openapi.json
CHANGED
|
@@ -1758,6 +1758,18 @@
|
|
|
1758
1758
|
"format": "int64",
|
|
1759
1759
|
"minimum": 1,
|
|
1760
1760
|
"maximum": 100
|
|
1761
|
+
},
|
|
1762
|
+
{
|
|
1763
|
+
"name": "side",
|
|
1764
|
+
"in": "query",
|
|
1765
|
+
"required": false,
|
|
1766
|
+
"type": "string",
|
|
1767
|
+
"enum": [
|
|
1768
|
+
"long",
|
|
1769
|
+
"short",
|
|
1770
|
+
"all"
|
|
1771
|
+
],
|
|
1772
|
+
"default": "all"
|
|
1761
1773
|
}
|
|
1762
1774
|
],
|
|
1763
1775
|
"tags": [
|
|
@@ -2714,6 +2726,11 @@
|
|
|
2714
2726
|
"format": "int64",
|
|
2715
2727
|
"example": "3"
|
|
2716
2728
|
},
|
|
2729
|
+
"position_tied_order_count": {
|
|
2730
|
+
"type": "integer",
|
|
2731
|
+
"format": "int64",
|
|
2732
|
+
"example": "3"
|
|
2733
|
+
},
|
|
2717
2734
|
"sign": {
|
|
2718
2735
|
"type": "integer",
|
|
2719
2736
|
"format": "int32",
|
|
@@ -2747,6 +2764,7 @@
|
|
|
2747
2764
|
"initial_margin_fraction",
|
|
2748
2765
|
"open_order_count",
|
|
2749
2766
|
"pending_order_count",
|
|
2767
|
+
"position_tied_order_count",
|
|
2750
2768
|
"sign",
|
|
2751
2769
|
"position",
|
|
2752
2770
|
"avg_entry_price",
|
|
@@ -3839,8 +3857,18 @@
|
|
|
3839
3857
|
"FundingRate": {
|
|
3840
3858
|
"type": "object",
|
|
3841
3859
|
"properties": {
|
|
3860
|
+
"market_id": {
|
|
3861
|
+
"type": "integer",
|
|
3862
|
+
"format": "uint8"
|
|
3863
|
+
},
|
|
3842
3864
|
"exchange": {
|
|
3843
|
-
"type": "string"
|
|
3865
|
+
"type": "string",
|
|
3866
|
+
"enum": [
|
|
3867
|
+
"binance",
|
|
3868
|
+
"bybit",
|
|
3869
|
+
"hyperliquid",
|
|
3870
|
+
"lighter"
|
|
3871
|
+
]
|
|
3844
3872
|
},
|
|
3845
3873
|
"symbol": {
|
|
3846
3874
|
"type": "string"
|
|
@@ -3852,6 +3880,7 @@
|
|
|
3852
3880
|
},
|
|
3853
3881
|
"title": "FundingRate",
|
|
3854
3882
|
"required": [
|
|
3883
|
+
"market_id",
|
|
3855
3884
|
"exchange",
|
|
3856
3885
|
"symbol",
|
|
3857
3886
|
"rate"
|
|
@@ -4344,7 +4373,20 @@
|
|
|
4344
4373
|
"canceled-too-much-slippage",
|
|
4345
4374
|
"canceled-not-enough-liquidity",
|
|
4346
4375
|
"canceled-self-trade",
|
|
4347
|
-
"canceled-expired"
|
|
4376
|
+
"canceled-expired",
|
|
4377
|
+
"canceled-oco",
|
|
4378
|
+
"canceled-child"
|
|
4379
|
+
]
|
|
4380
|
+
},
|
|
4381
|
+
"trigger_status": {
|
|
4382
|
+
"type": "string",
|
|
4383
|
+
"example": "twap",
|
|
4384
|
+
"enum": [
|
|
4385
|
+
"na",
|
|
4386
|
+
"ready",
|
|
4387
|
+
"mark-price",
|
|
4388
|
+
"twap",
|
|
4389
|
+
"parent-order"
|
|
4348
4390
|
]
|
|
4349
4391
|
},
|
|
4350
4392
|
"trigger_time": {
|
|
@@ -4361,6 +4403,18 @@
|
|
|
4361
4403
|
"type": "string",
|
|
4362
4404
|
"example": "1"
|
|
4363
4405
|
},
|
|
4406
|
+
"to_trigger_order_id_0": {
|
|
4407
|
+
"type": "string",
|
|
4408
|
+
"example": "1"
|
|
4409
|
+
},
|
|
4410
|
+
"to_trigger_order_id_1": {
|
|
4411
|
+
"type": "string",
|
|
4412
|
+
"example": "1"
|
|
4413
|
+
},
|
|
4414
|
+
"to_cancel_order_id_0": {
|
|
4415
|
+
"type": "string",
|
|
4416
|
+
"example": "1"
|
|
4417
|
+
},
|
|
4364
4418
|
"block_height": {
|
|
4365
4419
|
"type": "integer",
|
|
4366
4420
|
"format": "int64",
|
|
@@ -4396,9 +4450,13 @@
|
|
|
4396
4450
|
"trigger_price",
|
|
4397
4451
|
"order_expiry",
|
|
4398
4452
|
"status",
|
|
4453
|
+
"trigger_status",
|
|
4399
4454
|
"trigger_time",
|
|
4400
4455
|
"parent_order_index",
|
|
4401
4456
|
"parent_order_id",
|
|
4457
|
+
"to_trigger_order_id_0",
|
|
4458
|
+
"to_trigger_order_id_1",
|
|
4459
|
+
"to_cancel_order_id_0",
|
|
4402
4460
|
"block_height",
|
|
4403
4461
|
"timestamp"
|
|
4404
4462
|
]
|
|
@@ -5979,6 +6037,15 @@
|
|
|
5979
6037
|
"format": "int64",
|
|
5980
6038
|
"maximum": 100,
|
|
5981
6039
|
"minimum": 1
|
|
6040
|
+
},
|
|
6041
|
+
"side": {
|
|
6042
|
+
"type": "string",
|
|
6043
|
+
"enum": [
|
|
6044
|
+
"long",
|
|
6045
|
+
"short",
|
|
6046
|
+
"all"
|
|
6047
|
+
],
|
|
6048
|
+
"default": "all"
|
|
5982
6049
|
}
|
|
5983
6050
|
},
|
|
5984
6051
|
"title": "ReqGetPositionFunding",
|