zklighter-perps 1.0.113 → 1.0.114
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 +24 -0
- package/apis/OrderApi.ts +12 -0
- package/models/DetailedAccount.ts +0 -15
- package/models/ReqGetAccountOrders.ts +9 -0
- package/models/ReqGetAccountPnL.ts +9 -0
- package/models/ReqGetPositionFunding.ts +9 -0
- package/openapi.json +30 -7
- package/package.json +1 -1
package/apis/AccountApi.ts
CHANGED
|
@@ -81,6 +81,7 @@ export interface LeaderboardRequest {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
export interface PnlRequest {
|
|
84
|
+
auth: string;
|
|
84
85
|
by: PnlByEnum;
|
|
85
86
|
value: string;
|
|
86
87
|
resolution: PnlResolutionEnum;
|
|
@@ -91,6 +92,7 @@ export interface PnlRequest {
|
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
export interface PositionFundingRequest {
|
|
95
|
+
auth: string;
|
|
94
96
|
account_index: number;
|
|
95
97
|
limit: number;
|
|
96
98
|
market_id?: number;
|
|
@@ -407,6 +409,13 @@ export class AccountApi extends runtime.BaseAPI {
|
|
|
407
409
|
* pnl
|
|
408
410
|
*/
|
|
409
411
|
async pnlRaw(requestParameters: PnlRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AccountPnL>> {
|
|
412
|
+
if (requestParameters['auth'] == null) {
|
|
413
|
+
throw new runtime.RequiredError(
|
|
414
|
+
'auth',
|
|
415
|
+
'Required parameter "auth" was null or undefined when calling pnl().'
|
|
416
|
+
);
|
|
417
|
+
}
|
|
418
|
+
|
|
410
419
|
if (requestParameters['by'] == null) {
|
|
411
420
|
throw new runtime.RequiredError(
|
|
412
421
|
'by',
|
|
@@ -451,6 +460,10 @@ export class AccountApi extends runtime.BaseAPI {
|
|
|
451
460
|
|
|
452
461
|
const queryParameters: any = {};
|
|
453
462
|
|
|
463
|
+
if (requestParameters['auth'] != null) {
|
|
464
|
+
queryParameters['auth'] = requestParameters['auth'];
|
|
465
|
+
}
|
|
466
|
+
|
|
454
467
|
if (requestParameters['by'] != null) {
|
|
455
468
|
queryParameters['by'] = requestParameters['by'];
|
|
456
469
|
}
|
|
@@ -505,6 +518,13 @@ export class AccountApi extends runtime.BaseAPI {
|
|
|
505
518
|
* positionFunding
|
|
506
519
|
*/
|
|
507
520
|
async positionFundingRaw(requestParameters: PositionFundingRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PositionFundings>> {
|
|
521
|
+
if (requestParameters['auth'] == null) {
|
|
522
|
+
throw new runtime.RequiredError(
|
|
523
|
+
'auth',
|
|
524
|
+
'Required parameter "auth" was null or undefined when calling positionFunding().'
|
|
525
|
+
);
|
|
526
|
+
}
|
|
527
|
+
|
|
508
528
|
if (requestParameters['account_index'] == null) {
|
|
509
529
|
throw new runtime.RequiredError(
|
|
510
530
|
'account_index',
|
|
@@ -521,6 +541,10 @@ export class AccountApi extends runtime.BaseAPI {
|
|
|
521
541
|
|
|
522
542
|
const queryParameters: any = {};
|
|
523
543
|
|
|
544
|
+
if (requestParameters['auth'] != null) {
|
|
545
|
+
queryParameters['auth'] = requestParameters['auth'];
|
|
546
|
+
}
|
|
547
|
+
|
|
524
548
|
if (requestParameters['account_index'] != null) {
|
|
525
549
|
queryParameters['account_index'] = requestParameters['account_index'];
|
|
526
550
|
}
|
package/apis/OrderApi.ts
CHANGED
|
@@ -57,6 +57,7 @@ export interface AccountInactiveOrdersRequest {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
export interface AccountOrdersRequest {
|
|
60
|
+
auth: string;
|
|
60
61
|
account_index: number;
|
|
61
62
|
market_id: number;
|
|
62
63
|
limit: number;
|
|
@@ -241,6 +242,13 @@ export class OrderApi extends runtime.BaseAPI {
|
|
|
241
242
|
* accountOrders
|
|
242
243
|
*/
|
|
243
244
|
async accountOrdersRaw(requestParameters: AccountOrdersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Orders>> {
|
|
245
|
+
if (requestParameters['auth'] == null) {
|
|
246
|
+
throw new runtime.RequiredError(
|
|
247
|
+
'auth',
|
|
248
|
+
'Required parameter "auth" was null or undefined when calling accountOrders().'
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
|
|
244
252
|
if (requestParameters['account_index'] == null) {
|
|
245
253
|
throw new runtime.RequiredError(
|
|
246
254
|
'account_index',
|
|
@@ -264,6 +272,10 @@ export class OrderApi extends runtime.BaseAPI {
|
|
|
264
272
|
|
|
265
273
|
const queryParameters: any = {};
|
|
266
274
|
|
|
275
|
+
if (requestParameters['auth'] != null) {
|
|
276
|
+
queryParameters['auth'] = requestParameters['auth'];
|
|
277
|
+
}
|
|
278
|
+
|
|
267
279
|
if (requestParameters['account_index'] != null) {
|
|
268
280
|
queryParameters['account_index'] = requestParameters['account_index'];
|
|
269
281
|
}
|
|
@@ -13,12 +13,6 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { mapValues } from '../runtime';
|
|
16
|
-
import type { AccountMarketStats } from './AccountMarketStats';
|
|
17
|
-
import {
|
|
18
|
-
AccountMarketStatsFromJSON,
|
|
19
|
-
AccountMarketStatsFromJSONTyped,
|
|
20
|
-
AccountMarketStatsToJSON,
|
|
21
|
-
} from './AccountMarketStats';
|
|
22
16
|
import type { AccountPosition } from './AccountPosition';
|
|
23
17
|
import {
|
|
24
18
|
AccountPositionFromJSON,
|
|
@@ -146,12 +140,6 @@ export interface DetailedAccount {
|
|
|
146
140
|
* @memberof DetailedAccount
|
|
147
141
|
*/
|
|
148
142
|
total_asset_value: string;
|
|
149
|
-
/**
|
|
150
|
-
*
|
|
151
|
-
* @type {Array<AccountMarketStats>}
|
|
152
|
-
* @memberof DetailedAccount
|
|
153
|
-
*/
|
|
154
|
-
market_stats: Array<AccountMarketStats>;
|
|
155
143
|
/**
|
|
156
144
|
*
|
|
157
145
|
* @type {PublicPoolInfo}
|
|
@@ -186,7 +174,6 @@ export function instanceOfDetailedAccount(value: object): value is DetailedAccou
|
|
|
186
174
|
if (!('max_referral_usage_limit' in value) || value['max_referral_usage_limit'] === undefined) return false;
|
|
187
175
|
if (!('positions' in value) || value['positions'] === undefined) return false;
|
|
188
176
|
if (!('total_asset_value' in value) || value['total_asset_value'] === undefined) return false;
|
|
189
|
-
if (!('market_stats' in value) || value['market_stats'] === undefined) return false;
|
|
190
177
|
if (!('pool_info' in value) || value['pool_info'] === undefined) return false;
|
|
191
178
|
if (!('shares' in value) || value['shares'] === undefined) return false;
|
|
192
179
|
return true;
|
|
@@ -219,7 +206,6 @@ export function DetailedAccountFromJSONTyped(json: any, ignoreDiscriminator: boo
|
|
|
219
206
|
'max_referral_usage_limit': json['max_referral_usage_limit'],
|
|
220
207
|
'positions': ((json['positions'] as Array<any>).map(AccountPositionFromJSON)),
|
|
221
208
|
'total_asset_value': json['total_asset_value'],
|
|
222
|
-
'market_stats': ((json['market_stats'] as Array<any>).map(AccountMarketStatsFromJSON)),
|
|
223
209
|
'pool_info': PublicPoolInfoFromJSON(json['pool_info']),
|
|
224
210
|
'shares': ((json['shares'] as Array<any>).map(PublicPoolShareFromJSON)),
|
|
225
211
|
};
|
|
@@ -248,7 +234,6 @@ export function DetailedAccountToJSON(value?: DetailedAccount | null): any {
|
|
|
248
234
|
'max_referral_usage_limit': value['max_referral_usage_limit'],
|
|
249
235
|
'positions': ((value['positions'] as Array<any>).map(AccountPositionToJSON)),
|
|
250
236
|
'total_asset_value': value['total_asset_value'],
|
|
251
|
-
'market_stats': ((value['market_stats'] as Array<any>).map(AccountMarketStatsToJSON)),
|
|
252
237
|
'pool_info': PublicPoolInfoToJSON(value['pool_info']),
|
|
253
238
|
'shares': ((value['shares'] as Array<any>).map(PublicPoolShareToJSON)),
|
|
254
239
|
};
|
|
@@ -19,6 +19,12 @@ import { mapValues } from '../runtime';
|
|
|
19
19
|
* @interface ReqGetAccountOrders
|
|
20
20
|
*/
|
|
21
21
|
export interface ReqGetAccountOrders {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof ReqGetAccountOrders
|
|
26
|
+
*/
|
|
27
|
+
auth: string;
|
|
22
28
|
/**
|
|
23
29
|
*
|
|
24
30
|
* @type {number}
|
|
@@ -49,6 +55,7 @@ export interface ReqGetAccountOrders {
|
|
|
49
55
|
* Check if a given object implements the ReqGetAccountOrders interface.
|
|
50
56
|
*/
|
|
51
57
|
export function instanceOfReqGetAccountOrders(value: object): value is ReqGetAccountOrders {
|
|
58
|
+
if (!('auth' in value) || value['auth'] === undefined) return false;
|
|
52
59
|
if (!('account_index' in value) || value['account_index'] === undefined) return false;
|
|
53
60
|
if (!('market_id' in value) || value['market_id'] === undefined) return false;
|
|
54
61
|
if (!('limit' in value) || value['limit'] === undefined) return false;
|
|
@@ -65,6 +72,7 @@ export function ReqGetAccountOrdersFromJSONTyped(json: any, ignoreDiscriminator:
|
|
|
65
72
|
}
|
|
66
73
|
return {
|
|
67
74
|
|
|
75
|
+
'auth': json['auth'],
|
|
68
76
|
'account_index': json['account_index'],
|
|
69
77
|
'market_id': json['market_id'],
|
|
70
78
|
'cursor': json['cursor'] == null ? undefined : json['cursor'],
|
|
@@ -78,6 +86,7 @@ export function ReqGetAccountOrdersToJSON(value?: ReqGetAccountOrders | null): a
|
|
|
78
86
|
}
|
|
79
87
|
return {
|
|
80
88
|
|
|
89
|
+
'auth': value['auth'],
|
|
81
90
|
'account_index': value['account_index'],
|
|
82
91
|
'market_id': value['market_id'],
|
|
83
92
|
'cursor': value['cursor'],
|
|
@@ -19,6 +19,12 @@ import { mapValues } from '../runtime';
|
|
|
19
19
|
* @interface ReqGetAccountPnL
|
|
20
20
|
*/
|
|
21
21
|
export interface ReqGetAccountPnL {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof ReqGetAccountPnL
|
|
26
|
+
*/
|
|
27
|
+
auth: string;
|
|
22
28
|
/**
|
|
23
29
|
*
|
|
24
30
|
* @type {string}
|
|
@@ -90,6 +96,7 @@ export type ReqGetAccountPnLResolutionEnum = typeof ReqGetAccountPnLResolutionEn
|
|
|
90
96
|
* Check if a given object implements the ReqGetAccountPnL interface.
|
|
91
97
|
*/
|
|
92
98
|
export function instanceOfReqGetAccountPnL(value: object): value is ReqGetAccountPnL {
|
|
99
|
+
if (!('auth' in value) || value['auth'] === undefined) return false;
|
|
93
100
|
if (!('by' in value) || value['by'] === undefined) return false;
|
|
94
101
|
if (!('value' in value) || value['value'] === undefined) return false;
|
|
95
102
|
if (!('resolution' in value) || value['resolution'] === undefined) return false;
|
|
@@ -109,6 +116,7 @@ export function ReqGetAccountPnLFromJSONTyped(json: any, ignoreDiscriminator: bo
|
|
|
109
116
|
}
|
|
110
117
|
return {
|
|
111
118
|
|
|
119
|
+
'auth': json['auth'],
|
|
112
120
|
'by': json['by'],
|
|
113
121
|
'value': json['value'],
|
|
114
122
|
'resolution': json['resolution'],
|
|
@@ -125,6 +133,7 @@ export function ReqGetAccountPnLToJSON(value?: ReqGetAccountPnL | null): any {
|
|
|
125
133
|
}
|
|
126
134
|
return {
|
|
127
135
|
|
|
136
|
+
'auth': value['auth'],
|
|
128
137
|
'by': value['by'],
|
|
129
138
|
'value': value['value'],
|
|
130
139
|
'resolution': value['resolution'],
|
|
@@ -19,6 +19,12 @@ import { mapValues } from '../runtime';
|
|
|
19
19
|
* @interface ReqGetPositionFunding
|
|
20
20
|
*/
|
|
21
21
|
export interface ReqGetPositionFunding {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof ReqGetPositionFunding
|
|
26
|
+
*/
|
|
27
|
+
auth: string;
|
|
22
28
|
/**
|
|
23
29
|
*
|
|
24
30
|
* @type {number}
|
|
@@ -67,6 +73,7 @@ export type ReqGetPositionFundingSideEnum = typeof ReqGetPositionFundingSideEnum
|
|
|
67
73
|
* Check if a given object implements the ReqGetPositionFunding interface.
|
|
68
74
|
*/
|
|
69
75
|
export function instanceOfReqGetPositionFunding(value: object): value is ReqGetPositionFunding {
|
|
76
|
+
if (!('auth' in value) || value['auth'] === undefined) return false;
|
|
70
77
|
if (!('account_index' in value) || value['account_index'] === undefined) return false;
|
|
71
78
|
if (!('limit' in value) || value['limit'] === undefined) return false;
|
|
72
79
|
return true;
|
|
@@ -82,6 +89,7 @@ export function ReqGetPositionFundingFromJSONTyped(json: any, ignoreDiscriminato
|
|
|
82
89
|
}
|
|
83
90
|
return {
|
|
84
91
|
|
|
92
|
+
'auth': json['auth'],
|
|
85
93
|
'account_index': json['account_index'],
|
|
86
94
|
'market_id': json['market_id'] == null ? undefined : json['market_id'],
|
|
87
95
|
'cursor': json['cursor'] == null ? undefined : json['cursor'],
|
|
@@ -96,6 +104,7 @@ export function ReqGetPositionFundingToJSON(value?: ReqGetPositionFunding | null
|
|
|
96
104
|
}
|
|
97
105
|
return {
|
|
98
106
|
|
|
107
|
+
'auth': value['auth'],
|
|
99
108
|
'account_index': value['account_index'],
|
|
100
109
|
'market_id': value['market_id'],
|
|
101
110
|
'cursor': value['cursor'],
|
package/openapi.json
CHANGED
|
@@ -231,6 +231,12 @@
|
|
|
231
231
|
}
|
|
232
232
|
},
|
|
233
233
|
"parameters": [
|
|
234
|
+
{
|
|
235
|
+
"name": "auth",
|
|
236
|
+
"in": "query",
|
|
237
|
+
"required": true,
|
|
238
|
+
"type": "string"
|
|
239
|
+
},
|
|
234
240
|
{
|
|
235
241
|
"name": "account_index",
|
|
236
242
|
"in": "query",
|
|
@@ -1607,6 +1613,12 @@
|
|
|
1607
1613
|
}
|
|
1608
1614
|
},
|
|
1609
1615
|
"parameters": [
|
|
1616
|
+
{
|
|
1617
|
+
"name": "auth",
|
|
1618
|
+
"in": "query",
|
|
1619
|
+
"required": true,
|
|
1620
|
+
"type": "string"
|
|
1621
|
+
},
|
|
1610
1622
|
{
|
|
1611
1623
|
"name": "by",
|
|
1612
1624
|
"in": "query",
|
|
@@ -1698,6 +1710,12 @@
|
|
|
1698
1710
|
}
|
|
1699
1711
|
},
|
|
1700
1712
|
"parameters": [
|
|
1713
|
+
{
|
|
1714
|
+
"name": "auth",
|
|
1715
|
+
"in": "query",
|
|
1716
|
+
"required": true,
|
|
1717
|
+
"type": "string"
|
|
1718
|
+
},
|
|
1701
1719
|
{
|
|
1702
1720
|
"name": "account_index",
|
|
1703
1721
|
"in": "query",
|
|
@@ -3461,12 +3479,6 @@
|
|
|
3461
3479
|
"type": "string",
|
|
3462
3480
|
"example": "19995"
|
|
3463
3481
|
},
|
|
3464
|
-
"market_stats": {
|
|
3465
|
-
"type": "array",
|
|
3466
|
-
"items": {
|
|
3467
|
-
"$ref": "#/definitions/AccountMarketStats"
|
|
3468
|
-
}
|
|
3469
|
-
},
|
|
3470
3482
|
"pool_info": {
|
|
3471
3483
|
"$ref": "#/definitions/PublicPoolInfo"
|
|
3472
3484
|
},
|
|
@@ -3495,7 +3507,6 @@
|
|
|
3495
3507
|
"max_referral_usage_limit",
|
|
3496
3508
|
"positions",
|
|
3497
3509
|
"total_asset_value",
|
|
3498
|
-
"market_stats",
|
|
3499
3510
|
"pool_info",
|
|
3500
3511
|
"shares"
|
|
3501
3512
|
]
|
|
@@ -5523,6 +5534,9 @@
|
|
|
5523
5534
|
"ReqGetAccountOrders": {
|
|
5524
5535
|
"type": "object",
|
|
5525
5536
|
"properties": {
|
|
5537
|
+
"auth": {
|
|
5538
|
+
"type": "string"
|
|
5539
|
+
},
|
|
5526
5540
|
"account_index": {
|
|
5527
5541
|
"type": "integer",
|
|
5528
5542
|
"format": "int64"
|
|
@@ -5543,6 +5557,7 @@
|
|
|
5543
5557
|
},
|
|
5544
5558
|
"title": "ReqGetAccountOrders",
|
|
5545
5559
|
"required": [
|
|
5560
|
+
"auth",
|
|
5546
5561
|
"account_index",
|
|
5547
5562
|
"market_id",
|
|
5548
5563
|
"limit"
|
|
@@ -5573,6 +5588,9 @@
|
|
|
5573
5588
|
"ReqGetAccountPnL": {
|
|
5574
5589
|
"type": "object",
|
|
5575
5590
|
"properties": {
|
|
5591
|
+
"auth": {
|
|
5592
|
+
"type": "string"
|
|
5593
|
+
},
|
|
5576
5594
|
"by": {
|
|
5577
5595
|
"type": "string",
|
|
5578
5596
|
"enum": [
|
|
@@ -5615,6 +5633,7 @@
|
|
|
5615
5633
|
},
|
|
5616
5634
|
"title": "ReqGetAccountPnL",
|
|
5617
5635
|
"required": [
|
|
5636
|
+
"auth",
|
|
5618
5637
|
"by",
|
|
5619
5638
|
"value",
|
|
5620
5639
|
"resolution",
|
|
@@ -5970,6 +5989,9 @@
|
|
|
5970
5989
|
"ReqGetPositionFunding": {
|
|
5971
5990
|
"type": "object",
|
|
5972
5991
|
"properties": {
|
|
5992
|
+
"auth": {
|
|
5993
|
+
"type": "string"
|
|
5994
|
+
},
|
|
5973
5995
|
"account_index": {
|
|
5974
5996
|
"type": "integer",
|
|
5975
5997
|
"format": "int64"
|
|
@@ -6000,6 +6022,7 @@
|
|
|
6000
6022
|
},
|
|
6001
6023
|
"title": "ReqGetPositionFunding",
|
|
6002
6024
|
"required": [
|
|
6025
|
+
"auth",
|
|
6003
6026
|
"account_index",
|
|
6004
6027
|
"limit"
|
|
6005
6028
|
]
|