zklighter-perps 1.0.130 → 1.0.132
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/.openapi-generator/FILES +1 -0
- package/models/AccountMarginStats.ts +106 -0
- package/models/AccountStats.ts +25 -0
- package/models/DetailedAccount.ts +9 -0
- package/models/PnLEntry.ts +19 -10
- package/models/index.ts +1 -0
- package/openapi.json +65 -8
- package/package.json +1 -1
package/.openapi-generator/FILES
CHANGED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document:
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface AccountMarginStats
|
|
20
|
+
*/
|
|
21
|
+
export interface AccountMarginStats {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof AccountMarginStats
|
|
26
|
+
*/
|
|
27
|
+
collateral: string;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof AccountMarginStats
|
|
32
|
+
*/
|
|
33
|
+
portfolio_value: string;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof AccountMarginStats
|
|
38
|
+
*/
|
|
39
|
+
leverage: string;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @memberof AccountMarginStats
|
|
44
|
+
*/
|
|
45
|
+
available_balance: string;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @type {string}
|
|
49
|
+
* @memberof AccountMarginStats
|
|
50
|
+
*/
|
|
51
|
+
margin_usage: string;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @type {string}
|
|
55
|
+
* @memberof AccountMarginStats
|
|
56
|
+
*/
|
|
57
|
+
buying_power: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Check if a given object implements the AccountMarginStats interface.
|
|
62
|
+
*/
|
|
63
|
+
export function instanceOfAccountMarginStats(value: object): value is AccountMarginStats {
|
|
64
|
+
if (!('collateral' in value) || value['collateral'] === undefined) return false;
|
|
65
|
+
if (!('portfolio_value' in value) || value['portfolio_value'] === undefined) return false;
|
|
66
|
+
if (!('leverage' in value) || value['leverage'] === undefined) return false;
|
|
67
|
+
if (!('available_balance' in value) || value['available_balance'] === undefined) return false;
|
|
68
|
+
if (!('margin_usage' in value) || value['margin_usage'] === undefined) return false;
|
|
69
|
+
if (!('buying_power' in value) || value['buying_power'] === undefined) return false;
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function AccountMarginStatsFromJSON(json: any): AccountMarginStats {
|
|
74
|
+
return AccountMarginStatsFromJSONTyped(json, false);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function AccountMarginStatsFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountMarginStats {
|
|
78
|
+
if (json == null) {
|
|
79
|
+
return json;
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
|
|
83
|
+
'collateral': json['collateral'],
|
|
84
|
+
'portfolio_value': json['portfolio_value'],
|
|
85
|
+
'leverage': json['leverage'],
|
|
86
|
+
'available_balance': json['available_balance'],
|
|
87
|
+
'margin_usage': json['margin_usage'],
|
|
88
|
+
'buying_power': json['buying_power'],
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function AccountMarginStatsToJSON(value?: AccountMarginStats | null): any {
|
|
93
|
+
if (value == null) {
|
|
94
|
+
return value;
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
|
|
98
|
+
'collateral': value['collateral'],
|
|
99
|
+
'portfolio_value': value['portfolio_value'],
|
|
100
|
+
'leverage': value['leverage'],
|
|
101
|
+
'available_balance': value['available_balance'],
|
|
102
|
+
'margin_usage': value['margin_usage'],
|
|
103
|
+
'buying_power': value['buying_power'],
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
package/models/AccountStats.ts
CHANGED
|
@@ -13,6 +13,13 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { mapValues } from '../runtime';
|
|
16
|
+
import type { AccountMarginStats } from './AccountMarginStats';
|
|
17
|
+
import {
|
|
18
|
+
AccountMarginStatsFromJSON,
|
|
19
|
+
AccountMarginStatsFromJSONTyped,
|
|
20
|
+
AccountMarginStatsToJSON,
|
|
21
|
+
} from './AccountMarginStats';
|
|
22
|
+
|
|
16
23
|
/**
|
|
17
24
|
*
|
|
18
25
|
* @export
|
|
@@ -55,6 +62,18 @@ export interface AccountStats {
|
|
|
55
62
|
* @memberof AccountStats
|
|
56
63
|
*/
|
|
57
64
|
buying_power: string;
|
|
65
|
+
/**
|
|
66
|
+
*
|
|
67
|
+
* @type {AccountMarginStats}
|
|
68
|
+
* @memberof AccountStats
|
|
69
|
+
*/
|
|
70
|
+
cross_stats: AccountMarginStats;
|
|
71
|
+
/**
|
|
72
|
+
*
|
|
73
|
+
* @type {AccountMarginStats}
|
|
74
|
+
* @memberof AccountStats
|
|
75
|
+
*/
|
|
76
|
+
total_stats: AccountMarginStats;
|
|
58
77
|
}
|
|
59
78
|
|
|
60
79
|
/**
|
|
@@ -67,6 +86,8 @@ export function instanceOfAccountStats(value: object): value is AccountStats {
|
|
|
67
86
|
if (!('available_balance' in value) || value['available_balance'] === undefined) return false;
|
|
68
87
|
if (!('margin_usage' in value) || value['margin_usage'] === undefined) return false;
|
|
69
88
|
if (!('buying_power' in value) || value['buying_power'] === undefined) return false;
|
|
89
|
+
if (!('cross_stats' in value) || value['cross_stats'] === undefined) return false;
|
|
90
|
+
if (!('total_stats' in value) || value['total_stats'] === undefined) return false;
|
|
70
91
|
return true;
|
|
71
92
|
}
|
|
72
93
|
|
|
@@ -86,6 +107,8 @@ export function AccountStatsFromJSONTyped(json: any, ignoreDiscriminator: boolea
|
|
|
86
107
|
'available_balance': json['available_balance'],
|
|
87
108
|
'margin_usage': json['margin_usage'],
|
|
88
109
|
'buying_power': json['buying_power'],
|
|
110
|
+
'cross_stats': AccountMarginStatsFromJSON(json['cross_stats']),
|
|
111
|
+
'total_stats': AccountMarginStatsFromJSON(json['total_stats']),
|
|
89
112
|
};
|
|
90
113
|
}
|
|
91
114
|
|
|
@@ -101,6 +124,8 @@ export function AccountStatsToJSON(value?: AccountStats | null): any {
|
|
|
101
124
|
'available_balance': value['available_balance'],
|
|
102
125
|
'margin_usage': value['margin_usage'],
|
|
103
126
|
'buying_power': value['buying_power'],
|
|
127
|
+
'cross_stats': AccountMarginStatsToJSON(value['cross_stats']),
|
|
128
|
+
'total_stats': AccountMarginStatsToJSON(value['total_stats']),
|
|
104
129
|
};
|
|
105
130
|
}
|
|
106
131
|
|
|
@@ -146,6 +146,12 @@ export interface DetailedAccount {
|
|
|
146
146
|
* @memberof DetailedAccount
|
|
147
147
|
*/
|
|
148
148
|
total_asset_value: string;
|
|
149
|
+
/**
|
|
150
|
+
*
|
|
151
|
+
* @type {string}
|
|
152
|
+
* @memberof DetailedAccount
|
|
153
|
+
*/
|
|
154
|
+
cross_asset_value: string;
|
|
149
155
|
/**
|
|
150
156
|
*
|
|
151
157
|
* @type {PublicPoolInfo}
|
|
@@ -181,6 +187,7 @@ export function instanceOfDetailedAccount(value: object): value is DetailedAccou
|
|
|
181
187
|
if (!('referral_points_percentage' in value) || value['referral_points_percentage'] === undefined) return false;
|
|
182
188
|
if (!('positions' in value) || value['positions'] === undefined) return false;
|
|
183
189
|
if (!('total_asset_value' in value) || value['total_asset_value'] === undefined) return false;
|
|
190
|
+
if (!('cross_asset_value' in value) || value['cross_asset_value'] === undefined) return false;
|
|
184
191
|
if (!('pool_info' in value) || value['pool_info'] === undefined) return false;
|
|
185
192
|
if (!('shares' in value) || value['shares'] === undefined) return false;
|
|
186
193
|
return true;
|
|
@@ -214,6 +221,7 @@ export function DetailedAccountFromJSONTyped(json: any, ignoreDiscriminator: boo
|
|
|
214
221
|
'referral_points_percentage': json['referral_points_percentage'],
|
|
215
222
|
'positions': ((json['positions'] as Array<any>).map(AccountPositionFromJSON)),
|
|
216
223
|
'total_asset_value': json['total_asset_value'],
|
|
224
|
+
'cross_asset_value': json['cross_asset_value'],
|
|
217
225
|
'pool_info': PublicPoolInfoFromJSON(json['pool_info']),
|
|
218
226
|
'shares': ((json['shares'] as Array<any>).map(PublicPoolShareFromJSON)),
|
|
219
227
|
};
|
|
@@ -243,6 +251,7 @@ export function DetailedAccountToJSON(value?: DetailedAccount | null): any {
|
|
|
243
251
|
'referral_points_percentage': value['referral_points_percentage'],
|
|
244
252
|
'positions': ((value['positions'] as Array<any>).map(AccountPositionToJSON)),
|
|
245
253
|
'total_asset_value': value['total_asset_value'],
|
|
254
|
+
'cross_asset_value': value['cross_asset_value'],
|
|
246
255
|
'pool_info': PublicPoolInfoToJSON(value['pool_info']),
|
|
247
256
|
'shares': ((value['shares'] as Array<any>).map(PublicPoolShareToJSON)),
|
|
248
257
|
};
|
package/models/PnLEntry.ts
CHANGED
|
@@ -30,13 +30,19 @@ export interface PnLEntry {
|
|
|
30
30
|
* @type {number}
|
|
31
31
|
* @memberof PnLEntry
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
trade_pnl: number;
|
|
34
34
|
/**
|
|
35
35
|
*
|
|
36
36
|
* @type {number}
|
|
37
37
|
* @memberof PnLEntry
|
|
38
38
|
*/
|
|
39
|
-
|
|
39
|
+
inflow: number;
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
* @type {number}
|
|
43
|
+
* @memberof PnLEntry
|
|
44
|
+
*/
|
|
45
|
+
outflow: number;
|
|
40
46
|
/**
|
|
41
47
|
*
|
|
42
48
|
* @type {number}
|
|
@@ -48,13 +54,13 @@ export interface PnLEntry {
|
|
|
48
54
|
* @type {number}
|
|
49
55
|
* @memberof PnLEntry
|
|
50
56
|
*/
|
|
51
|
-
|
|
57
|
+
pool_inflow: number;
|
|
52
58
|
/**
|
|
53
59
|
*
|
|
54
60
|
* @type {number}
|
|
55
61
|
* @memberof PnLEntry
|
|
56
62
|
*/
|
|
57
|
-
|
|
63
|
+
pool_outflow: number;
|
|
58
64
|
}
|
|
59
65
|
|
|
60
66
|
/**
|
|
@@ -62,11 +68,12 @@ export interface PnLEntry {
|
|
|
62
68
|
*/
|
|
63
69
|
export function instanceOfPnLEntry(value: object): value is PnLEntry {
|
|
64
70
|
if (!('timestamp' in value) || value['timestamp'] === undefined) return false;
|
|
65
|
-
if (!('value' in value) || value['value'] === undefined) return false;
|
|
66
71
|
if (!('trade_pnl' in value) || value['trade_pnl'] === undefined) return false;
|
|
67
|
-
if (!('pool_pnl' in value) || value['pool_pnl'] === undefined) return false;
|
|
68
72
|
if (!('inflow' in value) || value['inflow'] === undefined) return false;
|
|
69
73
|
if (!('outflow' in value) || value['outflow'] === undefined) return false;
|
|
74
|
+
if (!('pool_pnl' in value) || value['pool_pnl'] === undefined) return false;
|
|
75
|
+
if (!('pool_inflow' in value) || value['pool_inflow'] === undefined) return false;
|
|
76
|
+
if (!('pool_outflow' in value) || value['pool_outflow'] === undefined) return false;
|
|
70
77
|
return true;
|
|
71
78
|
}
|
|
72
79
|
|
|
@@ -81,11 +88,12 @@ export function PnLEntryFromJSONTyped(json: any, ignoreDiscriminator: boolean):
|
|
|
81
88
|
return {
|
|
82
89
|
|
|
83
90
|
'timestamp': json['timestamp'],
|
|
84
|
-
'value': json['value'],
|
|
85
91
|
'trade_pnl': json['trade_pnl'],
|
|
86
|
-
'pool_pnl': json['pool_pnl'],
|
|
87
92
|
'inflow': json['inflow'],
|
|
88
93
|
'outflow': json['outflow'],
|
|
94
|
+
'pool_pnl': json['pool_pnl'],
|
|
95
|
+
'pool_inflow': json['pool_inflow'],
|
|
96
|
+
'pool_outflow': json['pool_outflow'],
|
|
89
97
|
};
|
|
90
98
|
}
|
|
91
99
|
|
|
@@ -96,11 +104,12 @@ export function PnLEntryToJSON(value?: PnLEntry | null): any {
|
|
|
96
104
|
return {
|
|
97
105
|
|
|
98
106
|
'timestamp': value['timestamp'],
|
|
99
|
-
'value': value['value'],
|
|
100
107
|
'trade_pnl': value['trade_pnl'],
|
|
101
|
-
'pool_pnl': value['pool_pnl'],
|
|
102
108
|
'inflow': value['inflow'],
|
|
103
109
|
'outflow': value['outflow'],
|
|
110
|
+
'pool_pnl': value['pool_pnl'],
|
|
111
|
+
'pool_inflow': value['pool_inflow'],
|
|
112
|
+
'pool_outflow': value['pool_outflow'],
|
|
104
113
|
};
|
|
105
114
|
}
|
|
106
115
|
|
package/models/index.ts
CHANGED
package/openapi.json
CHANGED
|
@@ -2911,6 +2911,44 @@
|
|
|
2911
2911
|
"max_llp_percentage"
|
|
2912
2912
|
]
|
|
2913
2913
|
},
|
|
2914
|
+
"AccountMarginStats": {
|
|
2915
|
+
"type": "object",
|
|
2916
|
+
"properties": {
|
|
2917
|
+
"collateral": {
|
|
2918
|
+
"type": "string",
|
|
2919
|
+
"example": "199955"
|
|
2920
|
+
},
|
|
2921
|
+
"portfolio_value": {
|
|
2922
|
+
"type": "string",
|
|
2923
|
+
"example": "199955"
|
|
2924
|
+
},
|
|
2925
|
+
"leverage": {
|
|
2926
|
+
"type": "string",
|
|
2927
|
+
"example": "1.0"
|
|
2928
|
+
},
|
|
2929
|
+
"available_balance": {
|
|
2930
|
+
"type": "string",
|
|
2931
|
+
"example": "199955"
|
|
2932
|
+
},
|
|
2933
|
+
"margin_usage": {
|
|
2934
|
+
"type": "string",
|
|
2935
|
+
"example": "0.0"
|
|
2936
|
+
},
|
|
2937
|
+
"buying_power": {
|
|
2938
|
+
"type": "string",
|
|
2939
|
+
"example": "199955"
|
|
2940
|
+
}
|
|
2941
|
+
},
|
|
2942
|
+
"title": "AccountMarginStats",
|
|
2943
|
+
"required": [
|
|
2944
|
+
"collateral",
|
|
2945
|
+
"portfolio_value",
|
|
2946
|
+
"leverage",
|
|
2947
|
+
"available_balance",
|
|
2948
|
+
"margin_usage",
|
|
2949
|
+
"buying_power"
|
|
2950
|
+
]
|
|
2951
|
+
},
|
|
2914
2952
|
"AccountMarketStats": {
|
|
2915
2953
|
"type": "object",
|
|
2916
2954
|
"properties": {
|
|
@@ -3196,6 +3234,12 @@
|
|
|
3196
3234
|
"buying_power": {
|
|
3197
3235
|
"type": "string",
|
|
3198
3236
|
"example": "199955"
|
|
3237
|
+
},
|
|
3238
|
+
"cross_stats": {
|
|
3239
|
+
"$ref": "#/definitions/AccountMarginStats"
|
|
3240
|
+
},
|
|
3241
|
+
"total_stats": {
|
|
3242
|
+
"$ref": "#/definitions/AccountMarginStats"
|
|
3199
3243
|
}
|
|
3200
3244
|
},
|
|
3201
3245
|
"title": "AccountStats",
|
|
@@ -3205,7 +3249,9 @@
|
|
|
3205
3249
|
"leverage",
|
|
3206
3250
|
"available_balance",
|
|
3207
3251
|
"margin_usage",
|
|
3208
|
-
"buying_power"
|
|
3252
|
+
"buying_power",
|
|
3253
|
+
"cross_stats",
|
|
3254
|
+
"total_stats"
|
|
3209
3255
|
]
|
|
3210
3256
|
},
|
|
3211
3257
|
"AccountTradeStats": {
|
|
@@ -3886,6 +3932,10 @@
|
|
|
3886
3932
|
"type": "string",
|
|
3887
3933
|
"example": "19995"
|
|
3888
3934
|
},
|
|
3935
|
+
"cross_asset_value": {
|
|
3936
|
+
"type": "string",
|
|
3937
|
+
"example": "19995"
|
|
3938
|
+
},
|
|
3889
3939
|
"pool_info": {
|
|
3890
3940
|
"$ref": "#/definitions/PublicPoolInfo"
|
|
3891
3941
|
},
|
|
@@ -3915,6 +3965,7 @@
|
|
|
3915
3965
|
"referral_points_percentage",
|
|
3916
3966
|
"positions",
|
|
3917
3967
|
"total_asset_value",
|
|
3968
|
+
"cross_asset_value",
|
|
3918
3969
|
"pool_info",
|
|
3919
3970
|
"shares"
|
|
3920
3971
|
]
|
|
@@ -5380,12 +5431,17 @@
|
|
|
5380
5431
|
"format": "int64",
|
|
5381
5432
|
"example": "1640995200"
|
|
5382
5433
|
},
|
|
5383
|
-
"
|
|
5434
|
+
"trade_pnl": {
|
|
5384
5435
|
"type": "number",
|
|
5385
5436
|
"format": "double",
|
|
5386
5437
|
"example": "12.0"
|
|
5387
5438
|
},
|
|
5388
|
-
"
|
|
5439
|
+
"inflow": {
|
|
5440
|
+
"type": "number",
|
|
5441
|
+
"format": "double",
|
|
5442
|
+
"example": "12.0"
|
|
5443
|
+
},
|
|
5444
|
+
"outflow": {
|
|
5389
5445
|
"type": "number",
|
|
5390
5446
|
"format": "double",
|
|
5391
5447
|
"example": "12.0"
|
|
@@ -5395,12 +5451,12 @@
|
|
|
5395
5451
|
"format": "double",
|
|
5396
5452
|
"example": "12.0"
|
|
5397
5453
|
},
|
|
5398
|
-
"
|
|
5454
|
+
"pool_inflow": {
|
|
5399
5455
|
"type": "number",
|
|
5400
5456
|
"format": "double",
|
|
5401
5457
|
"example": "12.0"
|
|
5402
5458
|
},
|
|
5403
|
-
"
|
|
5459
|
+
"pool_outflow": {
|
|
5404
5460
|
"type": "number",
|
|
5405
5461
|
"format": "double",
|
|
5406
5462
|
"example": "12.0"
|
|
@@ -5409,11 +5465,12 @@
|
|
|
5409
5465
|
"title": "PnLEntry",
|
|
5410
5466
|
"required": [
|
|
5411
5467
|
"timestamp",
|
|
5412
|
-
"value",
|
|
5413
5468
|
"trade_pnl",
|
|
5414
|
-
"pool_pnl",
|
|
5415
5469
|
"inflow",
|
|
5416
|
-
"outflow"
|
|
5470
|
+
"outflow",
|
|
5471
|
+
"pool_pnl",
|
|
5472
|
+
"pool_inflow",
|
|
5473
|
+
"pool_outflow"
|
|
5417
5474
|
]
|
|
5418
5475
|
},
|
|
5419
5476
|
"PositionFunding": {
|