zklighter-perps 1.0.44 → 1.0.46
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/OrderApi.ts +25 -0
- package/models/PositionFunding.ts +22 -4
- package/models/PublicPool.ts +9 -0
- package/models/ReqGetTrades.ts +26 -0
- package/openapi.json +47 -5
- package/package.json +1 -1
package/apis/OrderApi.ts
CHANGED
|
@@ -83,9 +83,11 @@ export interface RecentTradesRequest {
|
|
|
83
83
|
export interface TradesRequest {
|
|
84
84
|
market_id: number;
|
|
85
85
|
by: TradesByEnum;
|
|
86
|
+
filter: TradesFilterEnum;
|
|
86
87
|
from: number;
|
|
87
88
|
limit: number;
|
|
88
89
|
order_index?: number;
|
|
90
|
+
account_index?: number;
|
|
89
91
|
}
|
|
90
92
|
|
|
91
93
|
/**
|
|
@@ -510,6 +512,13 @@ export class OrderApi extends runtime.BaseAPI {
|
|
|
510
512
|
);
|
|
511
513
|
}
|
|
512
514
|
|
|
515
|
+
if (requestParameters['filter'] == null) {
|
|
516
|
+
throw new runtime.RequiredError(
|
|
517
|
+
'filter',
|
|
518
|
+
'Required parameter "filter" was null or undefined when calling trades().'
|
|
519
|
+
);
|
|
520
|
+
}
|
|
521
|
+
|
|
513
522
|
if (requestParameters['from'] == null) {
|
|
514
523
|
throw new runtime.RequiredError(
|
|
515
524
|
'from',
|
|
@@ -538,6 +547,14 @@ export class OrderApi extends runtime.BaseAPI {
|
|
|
538
547
|
queryParameters['by'] = requestParameters['by'];
|
|
539
548
|
}
|
|
540
549
|
|
|
550
|
+
if (requestParameters['filter'] != null) {
|
|
551
|
+
queryParameters['filter'] = requestParameters['filter'];
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
if (requestParameters['account_index'] != null) {
|
|
555
|
+
queryParameters['account_index'] = requestParameters['account_index'];
|
|
556
|
+
}
|
|
557
|
+
|
|
541
558
|
if (requestParameters['from'] != null) {
|
|
542
559
|
queryParameters['from'] = requestParameters['from'];
|
|
543
560
|
}
|
|
@@ -602,3 +619,11 @@ export const TradesByEnum = {
|
|
|
602
619
|
TradeId: 'trade_id'
|
|
603
620
|
} as const;
|
|
604
621
|
export type TradesByEnum = typeof TradesByEnum[keyof typeof TradesByEnum];
|
|
622
|
+
/**
|
|
623
|
+
* @export
|
|
624
|
+
*/
|
|
625
|
+
export const TradesFilterEnum = {
|
|
626
|
+
AccountIndex: 'account_index',
|
|
627
|
+
All: 'all'
|
|
628
|
+
} as const;
|
|
629
|
+
export type TradesFilterEnum = typeof TradesFilterEnum[keyof typeof TradesFilterEnum];
|
|
@@ -39,16 +39,28 @@ export interface PositionFunding {
|
|
|
39
39
|
funding_id: number;
|
|
40
40
|
/**
|
|
41
41
|
*
|
|
42
|
-
* @type {
|
|
42
|
+
* @type {string}
|
|
43
43
|
* @memberof PositionFunding
|
|
44
44
|
*/
|
|
45
|
-
change:
|
|
45
|
+
change: string;
|
|
46
46
|
/**
|
|
47
47
|
*
|
|
48
|
-
* @type {
|
|
48
|
+
* @type {string}
|
|
49
|
+
* @memberof PositionFunding
|
|
50
|
+
*/
|
|
51
|
+
rate: string;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @type {string}
|
|
55
|
+
* @memberof PositionFunding
|
|
56
|
+
*/
|
|
57
|
+
position_size: string;
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @type {string}
|
|
49
61
|
* @memberof PositionFunding
|
|
50
62
|
*/
|
|
51
|
-
|
|
63
|
+
position_side: string;
|
|
52
64
|
}
|
|
53
65
|
|
|
54
66
|
/**
|
|
@@ -60,6 +72,8 @@ export function instanceOfPositionFunding(value: object): value is PositionFundi
|
|
|
60
72
|
if (!('funding_id' in value) || value['funding_id'] === undefined) return false;
|
|
61
73
|
if (!('change' in value) || value['change'] === undefined) return false;
|
|
62
74
|
if (!('rate' in value) || value['rate'] === undefined) return false;
|
|
75
|
+
if (!('position_size' in value) || value['position_size'] === undefined) return false;
|
|
76
|
+
if (!('position_side' in value) || value['position_side'] === undefined) return false;
|
|
63
77
|
return true;
|
|
64
78
|
}
|
|
65
79
|
|
|
@@ -78,6 +92,8 @@ export function PositionFundingFromJSONTyped(json: any, ignoreDiscriminator: boo
|
|
|
78
92
|
'funding_id': json['funding_id'],
|
|
79
93
|
'change': json['change'],
|
|
80
94
|
'rate': json['rate'],
|
|
95
|
+
'position_size': json['position_size'],
|
|
96
|
+
'position_side': json['position_side'],
|
|
81
97
|
};
|
|
82
98
|
}
|
|
83
99
|
|
|
@@ -92,6 +108,8 @@ export function PositionFundingToJSON(value?: PositionFunding | null): any {
|
|
|
92
108
|
'funding_id': value['funding_id'],
|
|
93
109
|
'change': value['change'],
|
|
94
110
|
'rate': value['rate'],
|
|
111
|
+
'position_size': value['position_size'],
|
|
112
|
+
'position_side': value['position_side'],
|
|
95
113
|
};
|
|
96
114
|
}
|
|
97
115
|
|
package/models/PublicPool.ts
CHANGED
|
@@ -92,6 +92,12 @@ export interface PublicPool {
|
|
|
92
92
|
* @memberof PublicPool
|
|
93
93
|
*/
|
|
94
94
|
description: string;
|
|
95
|
+
/**
|
|
96
|
+
*
|
|
97
|
+
* @type {string}
|
|
98
|
+
* @memberof PublicPool
|
|
99
|
+
*/
|
|
100
|
+
total_asset_value: string;
|
|
95
101
|
/**
|
|
96
102
|
*
|
|
97
103
|
* @type {PublicPoolInfo}
|
|
@@ -114,6 +120,7 @@ export function instanceOfPublicPool(value: object): value is PublicPool {
|
|
|
114
120
|
if (!('collateral' in value) || value['collateral'] === undefined) return false;
|
|
115
121
|
if (!('name' in value) || value['name'] === undefined) return false;
|
|
116
122
|
if (!('description' in value) || value['description'] === undefined) return false;
|
|
123
|
+
if (!('total_asset_value' in value) || value['total_asset_value'] === undefined) return false;
|
|
117
124
|
if (!('pool_info' in value) || value['pool_info'] === undefined) return false;
|
|
118
125
|
return true;
|
|
119
126
|
}
|
|
@@ -139,6 +146,7 @@ export function PublicPoolFromJSONTyped(json: any, ignoreDiscriminator: boolean)
|
|
|
139
146
|
'collateral': json['collateral'],
|
|
140
147
|
'name': json['name'],
|
|
141
148
|
'description': json['description'],
|
|
149
|
+
'total_asset_value': json['total_asset_value'],
|
|
142
150
|
'pool_info': PublicPoolInfoFromJSON(json['pool_info']),
|
|
143
151
|
};
|
|
144
152
|
}
|
|
@@ -160,6 +168,7 @@ export function PublicPoolToJSON(value?: PublicPool | null): any {
|
|
|
160
168
|
'collateral': value['collateral'],
|
|
161
169
|
'name': value['name'],
|
|
162
170
|
'description': value['description'],
|
|
171
|
+
'total_asset_value': value['total_asset_value'],
|
|
163
172
|
'pool_info': PublicPoolInfoToJSON(value['pool_info']),
|
|
164
173
|
};
|
|
165
174
|
}
|
package/models/ReqGetTrades.ts
CHANGED
|
@@ -37,6 +37,18 @@ export interface ReqGetTrades {
|
|
|
37
37
|
* @memberof ReqGetTrades
|
|
38
38
|
*/
|
|
39
39
|
by: ReqGetTradesByEnum;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @memberof ReqGetTrades
|
|
44
|
+
*/
|
|
45
|
+
filter: ReqGetTradesFilterEnum;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @type {number}
|
|
49
|
+
* @memberof ReqGetTrades
|
|
50
|
+
*/
|
|
51
|
+
account_index?: number;
|
|
40
52
|
/**
|
|
41
53
|
*
|
|
42
54
|
* @type {number}
|
|
@@ -62,6 +74,15 @@ export const ReqGetTradesByEnum = {
|
|
|
62
74
|
} as const;
|
|
63
75
|
export type ReqGetTradesByEnum = typeof ReqGetTradesByEnum[keyof typeof ReqGetTradesByEnum];
|
|
64
76
|
|
|
77
|
+
/**
|
|
78
|
+
* @export
|
|
79
|
+
*/
|
|
80
|
+
export const ReqGetTradesFilterEnum = {
|
|
81
|
+
AccountIndex: 'account_index',
|
|
82
|
+
All: 'all'
|
|
83
|
+
} as const;
|
|
84
|
+
export type ReqGetTradesFilterEnum = typeof ReqGetTradesFilterEnum[keyof typeof ReqGetTradesFilterEnum];
|
|
85
|
+
|
|
65
86
|
|
|
66
87
|
/**
|
|
67
88
|
* Check if a given object implements the ReqGetTrades interface.
|
|
@@ -69,6 +90,7 @@ export type ReqGetTradesByEnum = typeof ReqGetTradesByEnum[keyof typeof ReqGetTr
|
|
|
69
90
|
export function instanceOfReqGetTrades(value: object): value is ReqGetTrades {
|
|
70
91
|
if (!('market_id' in value) || value['market_id'] === undefined) return false;
|
|
71
92
|
if (!('by' in value) || value['by'] === undefined) return false;
|
|
93
|
+
if (!('filter' in value) || value['filter'] === undefined) return false;
|
|
72
94
|
if (!('from' in value) || value['from'] === undefined) return false;
|
|
73
95
|
if (!('limit' in value) || value['limit'] === undefined) return false;
|
|
74
96
|
return true;
|
|
@@ -87,6 +109,8 @@ export function ReqGetTradesFromJSONTyped(json: any, ignoreDiscriminator: boolea
|
|
|
87
109
|
'market_id': json['market_id'],
|
|
88
110
|
'order_index': json['order_index'] == null ? undefined : json['order_index'],
|
|
89
111
|
'by': json['by'],
|
|
112
|
+
'filter': json['filter'],
|
|
113
|
+
'account_index': json['account_index'] == null ? undefined : json['account_index'],
|
|
90
114
|
'from': json['from'],
|
|
91
115
|
'limit': json['limit'],
|
|
92
116
|
};
|
|
@@ -101,6 +125,8 @@ export function ReqGetTradesToJSON(value?: ReqGetTrades | null): any {
|
|
|
101
125
|
'market_id': value['market_id'],
|
|
102
126
|
'order_index': value['order_index'],
|
|
103
127
|
'by': value['by'],
|
|
128
|
+
'filter': value['filter'],
|
|
129
|
+
'account_index': value['account_index'],
|
|
104
130
|
'from': value['from'],
|
|
105
131
|
'limit': value['limit'],
|
|
106
132
|
};
|
package/openapi.json
CHANGED
|
@@ -1595,6 +1595,23 @@
|
|
|
1595
1595
|
"trade_id"
|
|
1596
1596
|
]
|
|
1597
1597
|
},
|
|
1598
|
+
{
|
|
1599
|
+
"name": "filter",
|
|
1600
|
+
"in": "query",
|
|
1601
|
+
"required": true,
|
|
1602
|
+
"type": "string",
|
|
1603
|
+
"enum": [
|
|
1604
|
+
"account_index",
|
|
1605
|
+
"all"
|
|
1606
|
+
]
|
|
1607
|
+
},
|
|
1608
|
+
{
|
|
1609
|
+
"name": "account_index",
|
|
1610
|
+
"in": "query",
|
|
1611
|
+
"required": false,
|
|
1612
|
+
"type": "integer",
|
|
1613
|
+
"format": "int64"
|
|
1614
|
+
},
|
|
1598
1615
|
{
|
|
1599
1616
|
"name": "from",
|
|
1600
1617
|
"in": "query",
|
|
@@ -3529,13 +3546,19 @@
|
|
|
3529
3546
|
"example": "1"
|
|
3530
3547
|
},
|
|
3531
3548
|
"change": {
|
|
3532
|
-
"type": "
|
|
3533
|
-
"format": "int64",
|
|
3549
|
+
"type": "string",
|
|
3534
3550
|
"example": "1"
|
|
3535
3551
|
},
|
|
3536
3552
|
"rate": {
|
|
3537
|
-
"type": "
|
|
3538
|
-
"
|
|
3553
|
+
"type": "string",
|
|
3554
|
+
"example": "1"
|
|
3555
|
+
},
|
|
3556
|
+
"position_size": {
|
|
3557
|
+
"type": "string",
|
|
3558
|
+
"example": "1"
|
|
3559
|
+
},
|
|
3560
|
+
"position_side": {
|
|
3561
|
+
"type": "string",
|
|
3539
3562
|
"example": "1"
|
|
3540
3563
|
}
|
|
3541
3564
|
},
|
|
@@ -3545,7 +3568,9 @@
|
|
|
3545
3568
|
"market_id",
|
|
3546
3569
|
"funding_id",
|
|
3547
3570
|
"change",
|
|
3548
|
-
"rate"
|
|
3571
|
+
"rate",
|
|
3572
|
+
"position_size",
|
|
3573
|
+
"position_side"
|
|
3549
3574
|
]
|
|
3550
3575
|
},
|
|
3551
3576
|
"PriceLevel": {
|
|
@@ -3616,6 +3641,10 @@
|
|
|
3616
3641
|
"description": {
|
|
3617
3642
|
"type": "string"
|
|
3618
3643
|
},
|
|
3644
|
+
"total_asset_value": {
|
|
3645
|
+
"type": "string",
|
|
3646
|
+
"example": "19995"
|
|
3647
|
+
},
|
|
3619
3648
|
"pool_info": {
|
|
3620
3649
|
"$ref": "#/definitions/PublicPoolInfo"
|
|
3621
3650
|
}
|
|
@@ -3632,6 +3661,7 @@
|
|
|
3632
3661
|
"collateral",
|
|
3633
3662
|
"name",
|
|
3634
3663
|
"description",
|
|
3664
|
+
"total_asset_value",
|
|
3635
3665
|
"pool_info"
|
|
3636
3666
|
]
|
|
3637
3667
|
},
|
|
@@ -4371,6 +4401,17 @@
|
|
|
4371
4401
|
"trade_id"
|
|
4372
4402
|
]
|
|
4373
4403
|
},
|
|
4404
|
+
"filter": {
|
|
4405
|
+
"type": "string",
|
|
4406
|
+
"enum": [
|
|
4407
|
+
"account_index",
|
|
4408
|
+
"all"
|
|
4409
|
+
]
|
|
4410
|
+
},
|
|
4411
|
+
"account_index": {
|
|
4412
|
+
"type": "integer",
|
|
4413
|
+
"format": "int64"
|
|
4414
|
+
},
|
|
4374
4415
|
"from": {
|
|
4375
4416
|
"type": "integer",
|
|
4376
4417
|
"format": "int64"
|
|
@@ -4386,6 +4427,7 @@
|
|
|
4386
4427
|
"required": [
|
|
4387
4428
|
"market_id",
|
|
4388
4429
|
"by",
|
|
4430
|
+
"filter",
|
|
4389
4431
|
"from",
|
|
4390
4432
|
"limit"
|
|
4391
4433
|
]
|